summaryrefslogtreecommitdiff
path: root/lisp/progmodes/compile.el
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2005-10-19 14:06:17 +0000
committerKaroly Lorentey <lorentey@elte.hu>2005-10-19 14:06:17 +0000
commit1072671b5b0f1fda9f91ea99da4bf0bd275ce6eb (patch)
treef1b05485825e65d7c0ca06cb273be4fe16a44a3f /lisp/progmodes/compile.el
parent6d8cf83040cdb54a0b1d72bd6a021f9815bd4af2 (diff)
parent8b1b64617b37243f75c4052653761d2e2a3943f3 (diff)
downloademacs-1072671b5b0f1fda9f91ea99da4bf0bd275ce6eb.tar.gz
emacs-1072671b5b0f1fda9f91ea99da4bf0bd275ce6eb.tar.bz2
emacs-1072671b5b0f1fda9f91ea99da4bf0bd275ce6eb.zip
Merged from miles@gnu.org--gnu-2005 (patch 133-141, 596-609)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-596 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-597 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-598 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-599 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-600 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-601 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-602 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-603 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-604 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-605 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-606 Remove lisp/toolbar directory * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-607 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-608 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-609 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-133 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-134 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-135 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-136 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-137 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-138 Update from CVS: texi/gnus.texi (RSS): Fix key description. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-139 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-140 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-141 Update from CVS: texi/gnus.texi (Document Server Internals): Addition. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-426
Diffstat (limited to 'lisp/progmodes/compile.el')
-rw-r--r--lisp/progmodes/compile.el64
1 files changed, 35 insertions, 29 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 269fbeaf137..d041fa366c8 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1678,37 +1678,20 @@ displays at the top of the window; there is no arrow."
"Jump to an error corresponding to MSG at MK.
All arguments are markers. If END-MK is non-nil, mark is set there
and overlay is highlighted between MK and END-MK."
- (if (eq (window-buffer (selected-window))
- (marker-buffer msg))
- ;; If the compilation buffer window is selected,
- ;; keep the compilation buffer in this window;
- ;; display the source in another window.
- (let ((pop-up-windows t))
- (pop-to-buffer (marker-buffer mk)))
- (if (window-dedicated-p (selected-window))
- (pop-to-buffer (marker-buffer mk))
- (switch-to-buffer (marker-buffer mk))))
- ;; If narrowing gets in the way of going to the right place, widen.
- (unless (eq (goto-char mk) (point))
- (widen)
- (goto-char mk))
- (if end-mk
- (push-mark end-mk t)
- (if mark-active (setq mark-active)))
- ;; If hideshow got in the way of
- ;; seeing the right place, open permanently.
- (dolist (ov (overlays-at (point)))
- (when (eq 'hs (overlay-get ov 'invisible))
- (delete-overlay ov)
- (goto-char mk)))
-
;; Show compilation buffer in other window, scrolled to this error.
- (let* ((pop-up-windows t)
- ;; Use an existing window if it is in a visible frame.
+ (let* ((from-compilation-buffer (eq (window-buffer (selected-window))
+ (marker-buffer msg)))
+ ;; Use an existing window if it is in a visible frame.
(pre-existing (get-buffer-window (marker-buffer msg) 0))
- (w (let ((display-buffer-reuse-frames t))
- ;; Pop up a window.
- (display-buffer (marker-buffer msg))))
+ (w (if (and from-compilation-buffer pre-existing)
+ ;; Calling display-buffer here may end up (partly) hiding
+ ;; the error location if the two buffers are in two
+ ;; different frames. So don't do it if it's not necessary.
+ pre-existing
+ (let ((display-buffer-reuse-frames t)
+ (pop-up-windows t))
+ ;; Pop up a window.
+ (display-buffer (marker-buffer msg)))))
(highlight-regexp (with-current-buffer (marker-buffer msg)
;; also do this while we change buffer
(compilation-set-window w msg)
@@ -1718,6 +1701,29 @@ and overlay is highlighted between MK and END-MK."
;; creating a new window.
(unless pre-existing (compilation-set-window-height w))
+ (if from-compilation-buffer
+ ;; If the compilation buffer window was selected,
+ ;; keep the compilation buffer in this window;
+ ;; display the source in another window.
+ (let ((pop-up-windows t))
+ (pop-to-buffer (marker-buffer mk) 'other-window))
+ (if (window-dedicated-p (selected-window))
+ (pop-to-buffer (marker-buffer mk))
+ (switch-to-buffer (marker-buffer mk))))
+ ;; If narrowing gets in the way of going to the right place, widen.
+ (unless (eq (goto-char mk) (point))
+ (widen)
+ (goto-char mk))
+ (if end-mk
+ (push-mark end-mk t)
+ (if mark-active (setq mark-active)))
+ ;; If hideshow got in the way of
+ ;; seeing the right place, open permanently.
+ (dolist (ov (overlays-at (point)))
+ (when (eq 'hs (overlay-get ov 'invisible))
+ (delete-overlay ov)
+ (goto-char mk)))
+
(when highlight-regexp
(if (timerp next-error-highlight-timer)
(cancel-timer next-error-highlight-timer))