changeset 8425:8b8835f1630a

Set up a "Compile" menubar item. (recompile): New function. (previous-error): New function. (first-error): New function.
author Richard M. Stallman <rms@gnu.org>
date Tue, 02 Aug 1994 21:01:04 +0000
parents af4e01d24892
children 3abe02e03dc8
files lisp/progmodes/compile.el
diffstat 1 files changed, 42 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Tue Aug 02 05:39:48 1994 +0000
+++ b/lisp/progmodes/compile.el	Tue Aug 02 21:01:04 1994 +0000
@@ -278,6 +278,13 @@
   (save-some-buffers (not compilation-ask-about-save) nil)
   (compile-internal compile-command "No more errors"))
 
+;;; run compile with the default command line
+(defun recompile ()
+  "Re-compile the program including the current buffer."
+  (interactive)
+  (save-some-buffers (not compilation-ask-about-save) nil)
+  (compile-internal compile-command "No more errors"))
+  
 ;;;###autoload
 (defun grep (command-args)
   "Run grep, with user-specified args, and collect output in a buffer.
@@ -416,6 +423,28 @@
   (let ((map (cons 'keymap compilation-minor-mode-map)))
     (define-key map " " 'scroll-up)
     (define-key map "\^?" 'scroll-down)
+    ;; Set up the menu-bar
+    (define-key map [menu-bar compilation-menu]
+      (cons "Compile" (make-sparse-keymap "Compile")))
+
+    (define-key map [menu-bar compilation-menu compilation-mode-kill-compilation]
+      '("Stop compilation" . kill-compilation))
+    (define-key map [menu-bar compilation-menu compilation-mode-separator2]
+      '("----" . nil))
+    (define-key map [menu-bar compilation-menu compilation-mode-first-error]
+      '("First error" . first-error))
+    (define-key map [menu-bar compilation-menu compilation-mode-previous-error]
+      '("Previous error" . previous-error))
+    (define-key map [menu-bar compilation-menu compilation-mode-next-error]
+      '("Next error" . next-error))
+    (define-key map [menu-bar compilation-menu compilation-separator2]
+      '("----" . nil))
+    (define-key map [menu-bar compilation-menu compilation-mode-grep]
+      '("Grep" . grep))
+    (define-key map [menu-bar compilation-menu compilation-mode-recompile]
+      '("Recompile" . recompile))
+    (define-key map [menu-bar compilation-menu compilation-mode-compile]
+      '("Compile" . compile))
     map)
   "Keymap for compilation log buffers.
 `compilation-minor-mode-map' is a cdr of this.")
@@ -836,6 +865,19 @@
 			   (consp argp))))
 ;;;###autoload (define-key ctl-x-map "`" 'next-error)
 
+(defun previous-error ()
+  "Visit previous compilation error message and corresponding source code.
+This operates on the output from the \\[compile] command."
+  (interactive)
+  (next-error '-1))
+
+(defun first-error ()
+  "Reparse the error message buffer and start at the first error
+Visit corresponding source code.
+This operates on the output from the \\[compile] command."
+  (interactive)
+  (next-error '(1.1)))
+
 (defun compilation-next-error-locus (&optional move reparse silent)
   "Visit next compilation error and return locus in corresponding source code.
 This operates on the output from the \\[compile] command.