From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: display-buffer-alist simplifications Date: Fri, 02 Sep 2011 10:54:41 -0400 Message-ID: <87wrdrc7v2.fsf@stupidchicken.com> References: <87mxgem09k.fsf@stupidchicken.com> <4E3FA812.3080009@gmx.at> <87zkjkb572.fsf@mail.jurta.org> <4E3FD5ED.5000206@gmx.at> <4E412E2D.90908@gmx.at> <4E422ECA.2020207@gmx.at> <4E43A253.9040404@gmx.at> <4E59F6D1.5060800@gmx.at> <4E5BE2B9.9030307@gmx.at> <87zkiqicdo.fsf@stupidchicken.com> <87hb4ythby.fsf@stupidchicken.com> <4E5DFFE1.6080200@gmx.at> <87hb4xq3jn.fsf@mail.jurta.org> <878vq937w4.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1314975302 8149 80.91.229.12 (2 Sep 2011 14:55:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 2 Sep 2011 14:55:02 +0000 (UTC) Cc: Juri Linkov , martin rudalics , Drew Adams , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 02 16:54:58 2011 Return-path: Envelope-to: ged-emacs-devel@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 1QzV8y-0004qU-RK for ged-emacs-devel@m.gmane.org; Fri, 02 Sep 2011 16:54:56 +0200 Original-Received: from localhost ([::1]:44550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzV8v-0006bS-5P for ged-emacs-devel@m.gmane.org; Fri, 02 Sep 2011 10:54:53 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzV8s-0006bA-4Q for emacs-devel@gnu.org; Fri, 02 Sep 2011 10:54:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzV8r-0001P6-4X for emacs-devel@gnu.org; Fri, 02 Sep 2011 10:54:50 -0400 Original-Received: from vm-emlprdomr-02.its.yale.edu ([130.132.50.143]:52088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzV8q-0001Ov-Vu for emacs-devel@gnu.org; Fri, 02 Sep 2011 10:54:49 -0400 Original-Received: from furball (dhcp-128-36-14-41.central.yale.edu [128.36.14.41]) (authenticated bits=0) by vm-emlprdomr-02.its.yale.edu (8.14.4/8.14.4) with ESMTP id p82EsfdA027100 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 2 Sep 2011 10:54:41 -0400 In-Reply-To: (Stefan Monnier's message of "Thu, 01 Sep 2011 21:33:26 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Scanned-By: MIMEDefang 2.71 on 130.132.50.143 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 130.132.50.143 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:143721 Archived-At: Stefan Monnier writes: > Four variables should be made obsolete by display-buffer-alist: > same-window-buffer-names, same-window-regexps, special-display-regexps, > and special-display-buffer-names. > > The rest should be made obsolete by display-buffer-default-rule (or by > the RULE (formerly NOT-THIS-WINDOW) arg of display-buffer): > pop-up-frames, pop-up-windows, display-buffer-mark-dedicated, > display-buffer-reuse-frames, probably a few more. > > I also think that special-display-function can be marked obsolete, not > because something superceded it, but because I don't think anyone ever > used it. I've now split up display-buffer-default into separate functions. So the default action of display-buffer is given by the following value of display-buffer-default-action: '((display-buffer-reuse-selected-window display-buffer-maybe-same-window display-buffer-reuse-or-pop-window display-buffer-use-some-window display-buffer-pop-up-frame)) The "rule" terminology does sound nicer, so I guess we could rename display-buffer-default-action to display-buffer-default-rule, and display-buffer-use-some-window to display-rule-use-some-window etc. Currently `display-buffer-maybe-same-window' handles the same-window-* variables simply as (defun display-buffer-maybe-same-window (buffer alist) (and (same-window-p (buffer-name buffer)) (display-buffer-same-window buffer alist))) If you want to convert same-window-* into alist entries, the cleanest way is probably to add new optional args to `same-window-p' that, if non-nil, override the values of same-window-*. Then `display-buffer-maybe-same-window' can pass the alist values to `same-window-p' in those arguments. OTOH we don't need any special handling for `special-display-*', `display-buffer-reuse-frames', `pop-up-frames', or `pop-up-windows'. They're currently handled in `display-buffer-reuse-or-pop-window', which checks those variables and conditionally calls other functions like `display-buffer-pop-up-frame', etc. So those variables can be replaced at a future date, by changing `display-buffer-default-action' and replacing `display-buffer-reuse-or-pop-window' with the desired combination of those other functions.