From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#13594: 24.2.92; [PATCH] compilation-start doesn't consider nil OUTWIN Date: Thu, 31 Jan 2013 10:14:13 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1359645267 18807 80.91.229.3 (31 Jan 2013 15:14:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Jan 2013 15:14:27 +0000 (UTC) Cc: 13594@debbugs.gnu.org To: Leo Liu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 31 16:14:47 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 1U0vqg-0001Fa-9C for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Jan 2013 16:14:46 +0100 Original-Received: from localhost ([::1]:52412 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0vqO-000796-3D for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Jan 2013 10:14:28 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0vqL-00078o-1e for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 10:14:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0vqF-0002pE-Sm for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 10:14:24 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0vqF-0002pA-PW for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 10:14:19 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U0vqw-0000ur-2e for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 10:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Jan 2013 15:15:02 +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 Original-Received: via spool by 13594-submit@debbugs.gnu.org id=B13594.13596452993502 (code B ref 13594); Thu, 31 Jan 2013 15:15:02 +0000 Original-Received: (at 13594) by debbugs.gnu.org; 31 Jan 2013 15:14:59 +0000 Original-Received: from localhost ([127.0.0.1]:57754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0vqs-0000uQ-8A for submit@debbugs.gnu.org; Thu, 31 Jan 2013 10:14:59 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:47965) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0vqr-0000uK-23 for 13594@debbugs.gnu.org; Thu, 31 Jan 2013 10:14:57 -0500 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r0VFEDfu021229; Thu, 31 Jan 2013 10:14:14 -0500 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id D3B2CB4182; Thu, 31 Jan 2013 10:14:13 -0500 (EST) In-Reply-To: (Leo Liu's message of "Thu, 31 Jan 2013 18:43:31 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4478=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4478> : streams <898124> : uri <1332948> 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:70527 Archived-At: > - (setq outwin (display-buffer outbuf)) > + (setq outwin (display-buffer outbuf)) ; Note: OUTWIN may be nil `display-buffer' says: Return the window chosen for displaying BUFFER-OR-NAME, or nil if no such window is found. which mostly means that it only returns nil if it couldn't find any window to display the buffer, which is exceedingly rare. Most/all callers assume that display-buffer will display the buffer somewhere (they sometimes disregard to return value, but when they don't they almost systematically assume the return value is non-nil). If you look further in the docstring you'll also see: Then it calls each function in the combined function list in turn, passing the buffer as the first argument and the combined alist as the second argument, until one of the functions returns non-nil. Which again hints at the fact that nil is not treated as a valid return value of display-buffer except when everything else failed. IOW returning nil from display-buffer will inevitably bump into bugs. Generally if you don't want to display a buffer, the best way to do that is by not calling display-buffer. So maybe the best approach is to extend compile.el such that it can be told to do its job without displaying the compilation buffer. If you do that, try to take into account that this usage pattern could be useful in other contexts than ggtags.el, for example users might prefer to not see the compilation buffer and just be moved to the first error automatically, and have C-x ` output the error message in the echo area (maybe, accompanied by the number of errors left). Stefan