changeset 54856:6a45f159f315

(compilation-minor-mode-map) (compilation-shell-minor-mode-map, compile-mouse-goto-error) (compile-goto-error): Re-merge the mouse and non-mouse commands.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 13 Apr 2004 23:16:29 +0000
parents 7a95e5491050
children 3064d74c4fe1
files lisp/progmodes/compile.el
diffstat 1 files changed, 9 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Tue Apr 13 22:46:18 2004 +0000
+++ b/lisp/progmodes/compile.el	Tue Apr 13 23:16:29 2004 +0000
@@ -982,7 +982,7 @@
 
 (defvar compilation-minor-mode-map
   (let ((map (make-sparse-keymap)))
-    (define-key map [mouse-2] 'compile-mouse-goto-error)
+    (define-key map [mouse-2] 'compile-goto-error)
     (define-key map "\C-c\C-c" 'compile-goto-error)
     (define-key map "\C-m" 'compile-goto-error)
     (define-key map "\C-c\C-k" 'kill-compilation)
@@ -998,7 +998,7 @@
 
 (defvar compilation-shell-minor-mode-map
   (let ((map (make-sparse-keymap)))
-    (define-key map [mouse-2] 'compile-mouse-goto-error)
+    (define-key map [mouse-2] 'compile-goto-error)
     (define-key map "\M-\C-m" 'compile-goto-error)
     (define-key map "\M-\C-n" 'compilation-next-error)
     (define-key map "\M-\C-p" 'compilation-previous-error)
@@ -1358,23 +1358,20 @@
 	(interrupt-process (get-buffer-process buffer))
       (error "The compilation process is not running"))))
 
-(defun compile-mouse-goto-error (event)
-  "Visit the source for the error message the mouse is pointing at."
-  (interactive "e")
+(defalias 'compile-mouse-goto-error 'compile-goto-error)
+
+(defun compile-goto-error (&optional event)
+  "Visit the source for the error message at point.
+Use this command in a compilation log buffer.  Sets the mark at point there."
+  (interactive (list last-input-event))
   (mouse-set-point event)
-  (compile-goto-error))
-
-(defun compile-goto-error ()
-  "Visit the source for the error message point is on.
-Use this command in a compilation log buffer.  Sets the mark at point there."
-  (interactive)
   (or (compilation-buffer-p (current-buffer))
       (error "Not in a compilation buffer"))
   (if (get-text-property (point) 'directory)
       (dired-other-window (car (get-text-property (point) 'directory)))
     (push-mark)
     (setq compilation-current-error (point))
-    (next-error 0)))
+    (next-error 0)))))
 
 ;; Return a compilation buffer.
 ;; If the current buffer is a compilation buffer, return it.