[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#13594: closed (24.2.92; [PATCH] compilation-start

From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#13594: closed (24.2.92; [PATCH] compilation-start doesn't consider nil OUTWIN)
Date: Tue, 03 Dec 2013 03:24:02 +0000

Your message dated Tue, 03 Dec 2013 11:23:20 +0800
with message-id <address@hidden>
and subject line Re: bug#13594: Planning Emacs-24.4
has caused the debbugs.gnu.org bug report #13594,
regarding 24.2.92; [PATCH] compilation-start doesn't consider nil OUTWIN
to be marked as done.

(If you believe you have received this mail in error, please contact

13594: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13594
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.2.92; [PATCH] compilation-start doesn't consider nil OUTWIN Date: Thu, 31 Jan 2013 18:43:31 +0800
In building ggtags on top of compile.el, I have found one annoyance that
is I need to popup and immediately delete the compile window if there is
one or zero match, which is visually disturbing.

While finding my way to fix this annoyance, I discovered
compilation-start does not consider the case when OUTWIN is nil (which
is legitimate per the doc-string of `display-buffer').

        (setq outwin (display-buffer outbuf))

When OUTWIN is nil, all the subsequent window operations will be acting
on the wrong window.

(proposed patch attached)


diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index f383e02b..13ef425f 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1616,7 +1616,7 @@ (defun compilation-start (command &optional mode 
name-function highlight-regexp)
       (set-buffer-modified-p nil))
     ;; Pop up the compilation buffer.
     ;; http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01638.html
-    (setq outwin (display-buffer outbuf))
+    (setq outwin (display-buffer outbuf)) ; Note: OUTWIN may be nil
     (with-current-buffer outbuf
       (let ((process-environment
@@ -1638,7 +1638,7 @@ (defun compilation-start (command &optional mode 
name-function highlight-regexp)
             (list command mode name-function highlight-regexp))
        (set (make-local-variable 'revert-buffer-function)
-       (set-window-start outwin (point-min))
+       (and outwin (set-window-start outwin (point-min)))
        ;; Position point as the user will see it.
        (let ((desired-visible-point
@@ -1647,15 +1647,16 @@ (defun compilation-start (command &optional mode 
name-function highlight-regexp)
                 ;; Normally put it at the top.
-         (if (eq outwin (selected-window))
-             (goto-char desired-visible-point)
-           (set-window-point outwin desired-visible-point)))
+         (when outwin
+           (if (eq outwin (selected-window))
+               (goto-char desired-visible-point)
+             (set-window-point outwin desired-visible-point))))
        ;; The setup function is called before compilation-set-window-height
        ;; so it can set the compilation-window-height buffer locally.
        (if compilation-process-setup-function
            (funcall compilation-process-setup-function))
-       (compilation-set-window-height outwin)
+       (and outwin (compilation-set-window-height outwin))
        ;; Start the compilation.
        (if (fboundp 'start-process)
            (let ((proc

--- End Message ---
--- Begin Message --- Subject: Re: bug#13594: Planning Emacs-24.4 Date: Tue, 03 Dec 2013 11:23:20 +0800 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (OS X 10.9)
Fixed in 24.4

On 2013-12-03 09:19 +0800, Juri Linkov wrote:
> I installed the patch.  Please have a look and close this bug
> if everything is fixed.

Thanks for the improvement.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]