From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Liu Newsgroups: gmane.emacs.bugs Subject: bug#13594: 24.2.92; [PATCH] compilation-start doesn't consider nil OUTWIN Date: Thu, 31 Jan 2013 20:35:23 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1359635795 22504 80.91.229.3 (31 Jan 2013 12:36:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Jan 2013 12:36:35 +0000 (UTC) To: 13594@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 31 13:36:55 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U0tNo-0006JU-NJ for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Jan 2013 13:36:48 +0100 Original-Received: from localhost ([::1]:36152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0tNW-0002bi-Mb for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Jan 2013 07:36:30 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0tNS-0002ai-4h for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 07:36:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0tNM-0000DU-Cq for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 07:36:26 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0tNM-0000DG-2f for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 07:36:20 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U0tO1-0005XB-O9 for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 07:37:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Leo Liu Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Jan 2013 12:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13594 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.135963578821234 (code B ref -1); Thu, 31 Jan 2013 12:37:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 31 Jan 2013 12:36:28 +0000 Original-Received: from localhost ([127.0.0.1]:57016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0tNU-0005WQ-Ci for submit@debbugs.gnu.org; Thu, 31 Jan 2013 07:36:28 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:52759) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0tNS-0005WJ-Ed for submit@debbugs.gnu.org; Thu, 31 Jan 2013 07:36:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0tMk-0008Rw-LG for submit@debbugs.gnu.org; Thu, 31 Jan 2013 07:35:44 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:45171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0tMk-0008Rq-Hf for submit@debbugs.gnu.org; Thu, 31 Jan 2013 07:35:42 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0tMf-0002DR-Et for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 07:35:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0tMd-0008Qq-GR for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 07:35:37 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:46661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0tMd-0008Qd-6z for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 07:35:35 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1U0tMt-0005cb-8L for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 13:35:51 +0100 Original-Received: from 119.255.41.66 ([119.255.41.66]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 Jan 2013 13:35:51 +0100 Original-Received: from sdl.web by 119.255.41.66 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 Jan 2013 13:35:51 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 83 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 119.255.41.66 Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAG1BMVEUAAAA9Cgm3Hx1WWFWA gn+WmJWsrqv4+vcCAwCRl2MkAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAYoA AAGKATOXMFgAAAAHdElNRQfXAQwDNR+ZJmElAAABIklEQVQoz22SPW+DQAyGWUq65qasd9PNUSX4 AZHK2C1rJy5jpDS4IwRVup9dn7GNafpKIPPgzztXFSujqq1eM2n8h22oMkvxI/i9C97kRfMRUN55 dS3BrsAwBXUtMLAO4lryh8kTjOxKpQNniNxAgZOEe4bZwsDTFhKdqZRLNII4OQNHhEuq/RMkm6Cj TnnEA/fk0BorcYn5qA3oaeAxbaBOLrX+9G48NZ2Fzc2tzDM8Q+tMypEOqYHh8mAWaaK3U/cDMOT5 aMZMABgPXc7zPMs1A8DXO756GFJ/4fMEq47hTsAdn5avoxZ4ywl0c2w4Flu2Ybeyb3S+EqxX2DYA H8veJGEDTnHnrXvRaPyt+2kSfK6rfBZ2tUtfP/mR+pR6sX8BUZ/cDV7tvkoAAAAASUVORK5CYII= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.92 (OS X 10.8.2) Cancel-Lock: sha1:8AuBBlNv3igbYiHKSPJ9sv0JN28= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:70523 Archived-At: On 2013-01-31 18:43 +0800, Leo Liu wrote: > (proposed patch attached) All three instances of display-buffer in compile fails to account for nil value. The following patch fix them all. lisp/progmodes/compile.el | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) Modified lisp/progmodes/compile.el diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index f383e02b..09a2d9a2 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 (append @@ -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) 'compilation-revert-buffer) - (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) (point-max) ;; Normally put it at the top. (point-min)))) - (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 @@ -2490,11 +2491,12 @@ (defun compilation-goto-locus (msg mk end-mk) (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) + (and w (compilation-set-window w msg)) compilation-highlight-regexp))) ;; Ideally, the window-size should be passed to `display-buffer' ;; so it's only used when creating a new window. - (unless pre-existing (compilation-set-window-height w)) + (when (and (not pre-existing) w) + (compilation-set-window-height w)) (if from-compilation-buffer ;; If the compilation buffer window was selected, @@ -2605,9 +2607,9 @@ (defun compilation-find-file (marker filename directory &rest formats) (while (null buffer) ;Repeat until the user selects an existing file. ;; The file doesn't exist. Ask the user where to find it. (save-excursion ;This save-excursion is probably not right. - (let ((pop-up-windows t)) - (compilation-set-window (display-buffer (marker-buffer marker)) - marker) + (let* ((pop-up-windows t) + (w (display-buffer (marker-buffer marker)))) + (and w (compilation-set-window w marker)) (let* ((name (read-file-name (format "Find this %s in (default %s): " compilation-error filename)