diff options
| -rw-r--r-- | lisp/progmodes/compile.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 6321216dcce..f0836cbf2b0 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -1688,14 +1688,18 @@ and overlay is highlighted between MK and END-MK." | |||
| 1688 | ;; Show compilation buffer in other window, scrolled to this error. | 1688 | ;; Show compilation buffer in other window, scrolled to this error. |
| 1689 | (let* ((pop-up-windows t) | 1689 | (let* ((pop-up-windows t) |
| 1690 | ;; Use an existing window if it is in a visible frame. | 1690 | ;; Use an existing window if it is in a visible frame. |
| 1691 | (w (or (get-buffer-window (marker-buffer msg) 'visible) | 1691 | (pre-existing (get-buffer-window (marker-buffer msg) 0)) |
| 1692 | ;; Pop up a window. | 1692 | (w (let ((display-buffer-reuse-frames t)) |
| 1693 | (display-buffer (marker-buffer msg)))) | 1693 | ;; Pop up a window. |
| 1694 | (display-buffer (marker-buffer msg)))) | ||
| 1694 | (highlight-regexp (with-current-buffer (marker-buffer msg) | 1695 | (highlight-regexp (with-current-buffer (marker-buffer msg) |
| 1695 | ;; also do this while we change buffer | 1696 | ;; also do this while we change buffer |
| 1696 | (compilation-set-window w msg) | 1697 | (compilation-set-window w msg) |
| 1697 | compilation-highlight-regexp))) | 1698 | compilation-highlight-regexp))) |
| 1698 | (compilation-set-window-height w) | 1699 | ;; Ideally, the window-size should be passed to `display-buffer' (via |
| 1700 | ;; something like special-display-buffer) so it's only used when | ||
| 1701 | ;; creating a new window. | ||
| 1702 | (unless pre-existing (compilation-set-window-height w)) | ||
| 1699 | 1703 | ||
| 1700 | (when highlight-regexp | 1704 | (when highlight-regexp |
| 1701 | (if (timerp next-error-highlight-timer) | 1705 | (if (timerp next-error-highlight-timer) |