Mercurial > emacs
comparison lisp/progmodes/compile.el @ 54833:7b278dbd537f
(compile-goto-error): Select the buffer/window corresponding to the event.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 12 Apr 2004 23:02:48 +0000 |
parents | 1e00569924bf |
children | eb5c70ae728c |
comparison
equal
deleted
inserted
replaced
54832:8a894d554fb1 | 54833:7b278dbd537f |
---|---|
1368 "Visit the source for the error message at point. | 1368 "Visit the source for the error message at point. |
1369 Use this command in a compilation log buffer. Sets the mark at point there." | 1369 Use this command in a compilation log buffer. Sets the mark at point there." |
1370 (interactive (list last-input-event)) | 1370 (interactive (list last-input-event)) |
1371 (or (compilation-buffer-p (current-buffer)) | 1371 (or (compilation-buffer-p (current-buffer)) |
1372 (error "Not in a compilation buffer")) | 1372 (error "Not in a compilation buffer")) |
1373 (let ((pos (if event (posn-point (event-end event)) (point)))) | 1373 (let* ((loc (event-end event)) |
1374 (if (get-text-property (point) 'directory) | 1374 (pos (posn-point loc))) |
1375 (dired-other-window (car (get-text-property pos 'directory))) | 1375 (with-selected-window (posn-window loc) |
1376 (push-mark) | 1376 (if (get-text-property pos 'directory) |
1377 (setq compilation-current-error pos) | 1377 (dired-other-window (car (get-text-property pos 'directory))) |
1378 (next-error 0)))) | 1378 (push-mark) |
1379 (setq compilation-current-error pos) | |
1380 (next-error 0))))) | |
1379 | 1381 |
1380 ;; Return a compilation buffer. | 1382 ;; Return a compilation buffer. |
1381 ;; If the current buffer is a compilation buffer, return it. | 1383 ;; If the current buffer is a compilation buffer, return it. |
1382 ;; If compilation-last-buffer is set to a live buffer, use that. | 1384 ;; If compilation-last-buffer is set to a live buffer, use that. |
1383 ;; Otherwise, look for a compilation buffer and signal an error | 1385 ;; Otherwise, look for a compilation buffer and signal an error |