From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#8865: 24.0.50; `display-buffer' does not respect `pop-up-frames' Date: Thu, 16 Jun 2011 17:08:27 +0200 Message-ID: <4DFA1C6B.50400@gmx.at> References: <4DF7B1BB.6050704@gmx.at><4DF87A4F.60704@gmx.at><5F95025D0ABE4561A305F30293828F38@us.oracle.com><4DF8DD1E.8080004@gmx.at><68E985ED37824BE799A9C01162553E22@us.oracle.com><4DF8EF87.8080903@gmx.at> <7923A876A42744A39EEC6AAB67362EAC@us.oracle.com> <4DF9FEA7.1050509@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1308236986 31095 80.91.229.12 (16 Jun 2011 15:09:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Jun 2011 15:09:46 +0000 (UTC) Cc: 8865@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 16 17:09:41 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QXECT-0001Zl-0g for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Jun 2011 17:09:41 +0200 Original-Received: from localhost ([::1]:32838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXECR-00053I-HM for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Jun 2011 11:09:39 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:53449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXEBx-00051R-SZ for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2011 11:09:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXEBr-0004Ed-Q2 for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2011 11:09:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXEBr-0004EP-5f for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2011 11:09:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QXEBq-0005wI-RO; Thu, 16 Jun 2011 11:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Jun 2011 15:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8865 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8865-submit@debbugs.gnu.org id=B8865.130823691822793 (code B ref 8865); Thu, 16 Jun 2011 15:09:02 +0000 Original-Received: (at 8865) by debbugs.gnu.org; 16 Jun 2011 15:08:38 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QXEBR-0005vZ-Fo for submit@debbugs.gnu.org; Thu, 16 Jun 2011 11:08:37 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1QXEBP-0005vE-Qh for 8865@debbugs.gnu.org; Thu, 16 Jun 2011 11:08:36 -0400 Original-Received: (qmail invoked by alias); 16 Jun 2011 15:08:29 -0000 Original-Received: from 62-47-62-1.adsl.highway.telekom.at (EHLO [62.47.62.1]) [62.47.62.1] by mail.gmx.net (mp058) with SMTP; 16 Jun 2011 17:08:29 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/zFl4X8Ezz1t2xPfDCKhIbTLORMME1mxmywFFNT/ mBUA8joINaRVmX User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 16 Jun 2011 11:09:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:47240 Archived-At: > How about looking at the Emacs sources before you made your changes? ;-) If you > grep the Emacs 20, 21, 22, or 23 Lisp source code for `pop-up-frames' you will > see lots of hits, some of which are tests of its value. For example (Emacs > 23.3): > >>From help.el: > (cond ((or pop-up-frames...)...) > ... All these tests will be removed/replaced in due time because these variables are obsolete now. > I use such tests in only a couple of places. They are of course based on the > (original) meaning of `pop-up-frames': non-nil means `display-buffer' uses a > separate frame. And that was incorrect already in Emacs 23. The value 'graphic-only should have been dealt with separately. > Nothing special. > > So the question is how to test that user intention using the latest Emacs > design. From my code: > > ;; If non-nil `pop-up-frames' then inhibit showing annotation. > (let ((bookmark-automatically-show-annotations > (and bookmark-automatically-show-annotations > (not pop-up-frames)))) > > ;; Use separate frames instead of windows if `pop-up-frames' > ;; is non-nil or if prefix arg is negative. > (cond (...) > ((or pop-up-frames option) > (while file-list (find-file-other-frame... Code shouldn't try to guess the user's intentions in the first place: The strategy, in increasing priority, is - users express their intentions in `display-buffer-alist', - the code can suggest a better solution by passing a second argument to the buffer display function, - users can override the code by setting the override specifier in `display-buffer-alist'. Code should only express suggestions in the sense that "displaying the buffer in this or that way is best to my knowledge". The user can accept that suggestion or override it. In most cases, however, code should not suggest anything and leave the decision to the user. Obviously, if your code is targeted only at users not customizing `display-buffer-alist', you can test `pop-up-frames' as before, taking care of the special values 'unset (which means the user doesn't bother) and 'graphic-only. One benefit of this is that if `pop-up-frames' is nil, the user has explicitly delared that she doesn't want to pop up new frames with your code. martin