aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-08-02 21:01:04 +0000
committerRichard M. Stallman1994-08-02 21:01:04 +0000
commite60476ca9cb2eee347186bd2a43a9506f23222a8 (patch)
tree427359f53a43cd6681181ba463f8f879ce21f2a6
parent5b66a32f60ce3484cea30469369926dcae9c2768 (diff)
downloademacs-e60476ca9cb2eee347186bd2a43a9506f23222a8.tar.gz
emacs-e60476ca9cb2eee347186bd2a43a9506f23222a8.zip
Set up a "Compile" menubar item.
(recompile): New function. (previous-error): New function. (first-error): New function.
-rw-r--r--lisp/progmodes/compile.el42
1 files changed, 42 insertions, 0 deletions
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."
278 (save-some-buffers (not compilation-ask-about-save) nil) 278 (save-some-buffers (not compilation-ask-about-save) nil)
279 (compile-internal compile-command "No more errors")) 279 (compile-internal compile-command "No more errors"))
280 280
281;;; run compile with the default command line
282(defun recompile ()
283 "Re-compile the program including the current buffer."
284 (interactive)
285 (save-some-buffers (not compilation-ask-about-save) nil)
286 (compile-internal compile-command "No more errors"))
287
281;;;###autoload 288;;;###autoload
282(defun grep (command-args) 289(defun grep (command-args)
283 "Run grep, with user-specified args, and collect output in a buffer. 290 "Run grep, with user-specified args, and collect output in a buffer.
@@ -416,6 +423,28 @@ Returns the compilation buffer created."
416 (let ((map (cons 'keymap compilation-minor-mode-map))) 423 (let ((map (cons 'keymap compilation-minor-mode-map)))
417 (define-key map " " 'scroll-up) 424 (define-key map " " 'scroll-up)
418 (define-key map "\^?" 'scroll-down) 425 (define-key map "\^?" 'scroll-down)
426 ;; Set up the menu-bar
427 (define-key map [menu-bar compilation-menu]
428 (cons "Compile" (make-sparse-keymap "Compile")))
429
430 (define-key map [menu-bar compilation-menu compilation-mode-kill-compilation]
431 '("Stop compilation" . kill-compilation))
432 (define-key map [menu-bar compilation-menu compilation-mode-separator2]
433 '("----" . nil))
434 (define-key map [menu-bar compilation-menu compilation-mode-first-error]
435 '("First error" . first-error))
436 (define-key map [menu-bar compilation-menu compilation-mode-previous-error]
437 '("Previous error" . previous-error))
438 (define-key map [menu-bar compilation-menu compilation-mode-next-error]
439 '("Next error" . next-error))
440 (define-key map [menu-bar compilation-menu compilation-separator2]
441 '("----" . nil))
442 (define-key map [menu-bar compilation-menu compilation-mode-grep]
443 '("Grep" . grep))
444 (define-key map [menu-bar compilation-menu compilation-mode-recompile]
445 '("Recompile" . recompile))
446 (define-key map [menu-bar compilation-menu compilation-mode-compile]
447 '("Compile" . compile))
419 map) 448 map)
420 "Keymap for compilation log buffers. 449 "Keymap for compilation log buffers.
421`compilation-minor-mode-map' is a cdr of this.") 450`compilation-minor-mode-map' is a cdr of this.")
@@ -836,6 +865,19 @@ See variables `compilation-parse-errors-function' and
836 (consp argp)))) 865 (consp argp))))
837;;;###autoload (define-key ctl-x-map "`" 'next-error) 866;;;###autoload (define-key ctl-x-map "`" 'next-error)
838 867
868(defun previous-error ()
869 "Visit previous compilation error message and corresponding source code.
870This operates on the output from the \\[compile] command."
871 (interactive)
872 (next-error '-1))
873
874(defun first-error ()
875 "Reparse the error message buffer and start at the first error
876Visit corresponding source code.
877This operates on the output from the \\[compile] command."
878 (interactive)
879 (next-error '(1.1)))
880
839(defun compilation-next-error-locus (&optional move reparse silent) 881(defun compilation-next-error-locus (&optional move reparse silent)
840 "Visit next compilation error and return locus in corresponding source code. 882 "Visit next compilation error and return locus in corresponding source code.
841This operates on the output from the \\[compile] command. 883This operates on the output from the \\[compile] command.