summaryrefslogtreecommitdiff
path: root/usr.bin/mg
diff options
context:
space:
mode:
authorVincent Labrecque <vincent@cvs.openbsd.org>2003-04-08 21:19:58 +0000
committerVincent Labrecque <vincent@cvs.openbsd.org>2003-04-08 21:19:58 +0000
commitfc89301c88195890175f72af5968b2f57b993cff (patch)
tree77c41b1e47c7cda62d2d34d3f3c6154702463f2c /usr.bin/mg
parent431db2481ef2df2f8b0b0c4a1feffcabb119a425 (diff)
remember the last M-x compile command used.
ok art@
Diffstat (limited to 'usr.bin/mg')
-rw-r--r--usr.bin/mg/grep.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/mg/grep.c b/usr.bin/mg/grep.c
index 37b4bbd5d32..d69799fcfb9 100644
--- a/usr.bin/mg/grep.c
+++ b/usr.bin/mg/grep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grep.c,v 1.7 2002/07/25 16:37:54 vincent Exp $ */
+/* $OpenBSD: grep.c,v 1.8 2003/04/08 21:19:57 vincent Exp $ */
/*
* Copyright (c) 2001 Artur Grabowski <art@openbsd.org>. All rights reserved.
*
@@ -37,6 +37,8 @@ static BUFFER *compile_mode(char *name, char *command);
void grep_init(void);
+static char compile_last_command[NFILEN] = "make ";
+
/*
* Hints for next-error
*
@@ -100,9 +102,10 @@ compile(int f, int n)
BUFFER *bp;
MGWIN *wp;
- (void)strlcpy(prompt, "make ", sizeof prompt);
+ (void)strlcpy(prompt, compile_last_command, sizeof prompt);
if (eread("Compile command: ", prompt, NFILEN, EFDEF|EFNEW|EFCR) == ABORT)
return ABORT;
+ (void)strlcpy(compile_last_command, prompt, sizeof compile_last_command);
(void)snprintf(command, sizeof command, "%s 2>&1", prompt);