# HG changeset patch # User Stefan Monnier # Date 1081810968 0 # Node ID 7b278dbd537fc3e8eeaf8f2b461472e102d36a0a # Parent 8a894d554fb1b82fc7818dc47f796106f69e4596 (compile-goto-error): Select the buffer/window corresponding to the event. diff -r 8a894d554fb1 -r 7b278dbd537f lisp/progmodes/compile.el --- a/lisp/progmodes/compile.el Mon Apr 12 20:50:16 2004 +0000 +++ b/lisp/progmodes/compile.el Mon Apr 12 23:02:48 2004 +0000 @@ -1370,12 +1370,14 @@ (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.