From 50c3a20bac9ebccc003fb899f575e73d0e04216a Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Tue, 19 Mar 2013 08:16:14 +0800 Subject: [PATCH] * progmodes/compile.el (compilation-display-error): New command. (compilation-mode-map, compilation-minor-mode-map): Bind it to C-o. Fixes: debbugs:13992 --- lisp/ChangeLog | 6 ++++++ lisp/progmodes/compile.el | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 019ea722be8..4c2b17ff0fa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-03-19 Leo Liu + + * progmodes/compile.el (compilation-display-error): New command. + (compilation-mode-map, compilation-minor-mode-map): Bind it to + C-o. (Bug#13992) + 2013-03-18 Paul Eggert * term/x-win.el (x-keysym-pair): Add a Fixme (Bug#13936). diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 9e9e2f0b090..98a89bb2363 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1814,6 +1814,7 @@ Returns the compilation buffer created." (define-key map [follow-link] 'mouse-face) (define-key map "\C-c\C-c" 'compile-goto-error) (define-key map "\C-m" 'compile-goto-error) + (define-key map "\C-o" 'compilation-display-error) (define-key map "\C-c\C-k" 'kill-compilation) (define-key map "\M-n" 'compilation-next-error) (define-key map "\M-p" 'compilation-previous-error) @@ -1858,6 +1859,7 @@ Returns the compilation buffer created." (define-key map [follow-link] 'mouse-face) (define-key map "\C-c\C-c" 'compile-goto-error) (define-key map "\C-m" 'compile-goto-error) + (define-key map "\C-o" 'compilation-display-error) (define-key map "\C-c\C-k" 'kill-compilation) (define-key map "\M-n" 'compilation-next-error) (define-key map "\M-p" 'compilation-previous-error) @@ -2299,6 +2301,12 @@ Prefix arg N says how many files to move backwards (or forwards, if negative)." (interactive "p") (compilation-next-file (- n))) +(defun compilation-display-error () + "Display the source for current error in another window." + (interactive) + (setq compilation-current-error (point)) + (next-error-no-select 0)) + (defun kill-compilation () "Kill the process made by the \\[compile] or \\[grep] commands." (interactive) -- 2.39.2