diff options
| author | Richard M. Stallman | 1999-01-18 01:10:25 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-01-18 01:10:25 +0000 |
| commit | d28701c72f24aca5d3be77418a6bf9a7ce37b65b (patch) | |
| tree | b6498b8e187e1497a87f851582d9ff43f68418d6 | |
| parent | fc56773e1ff573c2485033fe7a1507230514ab77 (diff) | |
| download | emacs-d28701c72f24aca5d3be77418a6bf9a7ce37b65b.tar.gz emacs-d28701c72f24aca5d3be77418a6bf9a7ce37b65b.zip | |
(compilation-goto-locus): If already in the
compilation buffer's window, keep it in that window.
(compile-mouse-goto-error): Add Doc. Don't play with windows.
(compile-goto-error): Don't play with windows.
| -rw-r--r-- | lisp/progmodes/compile.el | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 18b1d387b5a..bb7b3f2bffa 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -1270,6 +1270,9 @@ Does NOT find the source line like \\[next-error]." | |||
| 1270 | ))))) | 1270 | ))))) |
| 1271 | 1271 | ||
| 1272 | (defun compile-mouse-goto-error (event) | 1272 | (defun compile-mouse-goto-error (event) |
| 1273 | "Visit the source for the error message the mouse is pointing at. | ||
| 1274 | This is like `compile-goto-error' called without prefix arg | ||
| 1275 | at the end of the line." | ||
| 1273 | (interactive "e") | 1276 | (interactive "e") |
| 1274 | (save-excursion | 1277 | (save-excursion |
| 1275 | (set-buffer (window-buffer (posn-window (event-end event)))) | 1278 | (set-buffer (window-buffer (posn-window (event-end event)))) |
| @@ -1297,14 +1300,6 @@ Does NOT find the source line like \\[next-error]." | |||
| 1297 | (or compilation-error-list | 1300 | (or compilation-error-list |
| 1298 | (error "No error to go to"))) | 1301 | (error "No error to go to"))) |
| 1299 | (select-window (posn-window (event-end event))) | 1302 | (select-window (posn-window (event-end event))) |
| 1300 | ;; Move to another window, so that next-error's window changes | ||
| 1301 | ;; result in the desired setup. | ||
| 1302 | (or (one-window-p) | ||
| 1303 | (progn | ||
| 1304 | (other-window -1) | ||
| 1305 | ;; other-window changed the selected buffer, | ||
| 1306 | ;; but we didn't want to do that. | ||
| 1307 | (set-buffer compilation-last-buffer))) | ||
| 1308 | 1303 | ||
| 1309 | (push-mark) | 1304 | (push-mark) |
| 1310 | (next-error 1)) | 1305 | (next-error 1)) |
| @@ -1330,15 +1325,6 @@ other kinds of prefix arguments are ignored." | |||
| 1330 | (> (point) (car (car compilation-error-list)))) | 1325 | (> (point) (car (car compilation-error-list)))) |
| 1331 | (setq compilation-error-list (cdr compilation-error-list))) | 1326 | (setq compilation-error-list (cdr compilation-error-list))) |
| 1332 | 1327 | ||
| 1333 | ;; Move to another window, so that next-error's window changes | ||
| 1334 | ;; result in the desired setup. | ||
| 1335 | (or (one-window-p) | ||
| 1336 | (progn | ||
| 1337 | (other-window -1) | ||
| 1338 | ;; other-window changed the selected buffer, | ||
| 1339 | ;; but we didn't want to do that. | ||
| 1340 | (set-buffer compilation-last-buffer))) | ||
| 1341 | |||
| 1342 | (push-mark) | 1328 | (push-mark) |
| 1343 | (next-error 1)) | 1329 | (next-error 1)) |
| 1344 | 1330 | ||
| @@ -1583,10 +1569,17 @@ The current buffer should be the desired compilation output buffer." | |||
| 1583 | "Jump to an error locus returned by `compilation-next-error-locus'. | 1569 | "Jump to an error locus returned by `compilation-next-error-locus'. |
| 1584 | Takes one argument, a cons (ERROR . SOURCE) of two markers. | 1570 | Takes one argument, a cons (ERROR . SOURCE) of two markers. |
| 1585 | Selects a window with point at SOURCE, with another window displaying ERROR." | 1571 | Selects a window with point at SOURCE, with another window displaying ERROR." |
| 1586 | (if (and (window-dedicated-p (selected-window)) | 1572 | (if (eq (window-buffer (selected-window)) |
| 1587 | (eq (selected-window) (frame-root-window))) | 1573 | (marker-buffer (car next-error))) |
| 1588 | (switch-to-buffer-other-frame (marker-buffer (cdr next-error))) | 1574 | ;; If the compilation buffer window is selected, |
| 1589 | (switch-to-buffer (marker-buffer (cdr next-error)))) | 1575 | ;; keep the compilation buffer in this window; |
| 1576 | ;; display the source in another window. | ||
| 1577 | (let ((pop-up-windows t)) | ||
| 1578 | (pop-to-buffer (marker-buffer (cdr next-error)))) | ||
| 1579 | (if (and (window-dedicated-p (selected-window)) | ||
| 1580 | (eq (selected-window) (frame-root-window))) | ||
| 1581 | (switch-to-buffer-other-frame (marker-buffer (cdr next-error))) | ||
| 1582 | (switch-to-buffer (marker-buffer (cdr next-error))))) | ||
| 1590 | (goto-char (cdr next-error)) | 1583 | (goto-char (cdr next-error)) |
| 1591 | ;; If narrowing got in the way of | 1584 | ;; If narrowing got in the way of |
| 1592 | ;; going to the right place, widen. | 1585 | ;; going to the right place, widen. |