From: Richard M. Stallman Date: Tue, 2 Aug 1994 21:01:04 +0000 (+0000) Subject: Set up a "Compile" menubar item. X-Git-Tag: emacs-19.34~7428 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e60476ca9cb2eee347186bd2a43a9506f23222a8;p=emacs.git Set up a "Compile" menubar item. (recompile): New function. (previous-error): New function. (first-error): New function. --- diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 0e206fea5c0..300186619a5 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -278,6 +278,13 @@ to a function that generates a unique name." (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 @@ Returns the compilation buffer created." (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 @@ See variables `compilation-parse-errors-function' and (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.