From: Stefan Monnier Date: Tue, 13 Apr 2004 23:16:29 +0000 (+0000) Subject: (compilation-minor-mode-map) X-Git-Tag: ttn-vms-21-2-B4~6846 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9da85ee5a07aa6ff061bcaf519b6eec6ce2c7105;p=emacs.git (compilation-minor-mode-map) (compilation-shell-minor-mode-map, compile-mouse-goto-error) (compile-goto-error): Re-merge the mouse and non-mouse commands. --- diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index d99cddadc3a..dfd1f0a3eea 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -982,7 +982,7 @@ exited abnormally with code %d\n" (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 @@ exited abnormally with code %d\n" (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 @@ Prefix arg N says how many files to move backwards (or forwards, if negative)." (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") - (mouse-set-point event) - (compile-goto-error)) +(defalias 'compile-mouse-goto-error 'compile-goto-error) -(defun compile-goto-error () - "Visit the source for the error message point is on. +(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) + (interactive (list last-input-event)) + (mouse-set-point event) (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.