diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2004-04-12 23:02:48 +0000 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2004-04-12 23:02:48 +0000 |
| commit | 912f0c34b2e4cca38bf0b4285afaf6b23c90f906 (patch) | |
| tree | eaead077e70626870ef8af3cac1f7a3f2f224add | |
| parent | 42b369cd7c556d5d47e831457b96815e39c88ac7 (diff) | |
| download | emacs-912f0c34b2e4cca38bf0b4285afaf6b23c90f906.tar.gz | |
(compile-goto-error): Select the buffer/window corresponding to the event.
| -rw-r--r-- | lisp/progmodes/compile.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index de90c2aa378..b1e4caa5513 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1370,12 +1370,14 @@ Use this command in a compilation log buffer. Sets the mark at point there." (interactive (list last-input-event)) (or (compilation-buffer-p (current-buffer)) (error "Not in a compilation buffer")) - (let ((pos (if event (posn-point (event-end event)) (point)))) - (if (get-text-property (point) 'directory) - (dired-other-window (car (get-text-property pos 'directory))) - (push-mark) - (setq compilation-current-error pos) - (next-error 0)))) + (let* ((loc (event-end event)) + (pos (posn-point loc))) + (with-selected-window (posn-window loc) + (if (get-text-property pos 'directory) + (dired-other-window (car (get-text-property pos 'directory))) + (push-mark) + (setq compilation-current-error pos) + (next-error 0))))) ;; Return a compilation buffer. ;; If the current buffer is a compilation buffer, return it. |
