1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-05 11:45:45 +00:00

(compile-goto-error): Select the buffer/window corresponding to the event.

This commit is contained in:
Stefan Monnier 2004-04-12 23:02:48 +00:00
parent 42b369cd7c
commit 912f0c34b2

View File

@ -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.