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, 12 Aug 2011 14:03:20 -0400 Message-ID: <87zkjev76f.fsf@stupidchicken.com> References: <87mxgem09k.fsf@stupidchicken.com> <4E355D2C.40709@gmx.at> <87k4axzg7j.fsf@mail.jurta.org> <87oc092gy0.fsf@stupidchicken.com> <4E380897.5000406@gmx.at> <871ux2nsrw.fsf@stupidchicken.com> <4E3AA5DA.8030403@gmx.at> <87mxfnn414.fsf@stupidchicken.com> <4E3D41F2.8060801@gmx.at> <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> <4E45330C.9060801@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1313172213 27376 80.91.229.12 (12 Aug 2011 18:03:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 12 Aug 2011 18:03:33 +0000 (UTC) Cc: Juri Linkov , Stefan Monnier , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 12 20:03:29 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 1Qrw4u-0000eR-LB for ged-emacs-devel@m.gmane.org; Fri, 12 Aug 2011 20:03:28 +0200 Original-Received: from localhost ([::1]:52340 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qrw4u-0008QD-6z for ged-emacs-devel@m.gmane.org; Fri, 12 Aug 2011 14:03:28 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:50752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qrw4q-0008IY-Os for emacs-devel@gnu.org; Fri, 12 Aug 2011 14:03:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qrw4p-0007ze-Ut for emacs-devel@gnu.org; Fri, 12 Aug 2011 14:03:24 -0400 Original-Received: from vm-emlprdomr-04.its.yale.edu ([130.132.50.145]:45771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qrw4p-0007zT-T7 for emacs-devel@gnu.org; Fri, 12 Aug 2011 14:03:23 -0400 Original-Received: from furball (dhcp-128-36-14-148.central.yale.edu [128.36.14.148]) (authenticated bits=0) by vm-emlprdomr-04.its.yale.edu (8.14.4/8.14.4) with ESMTP id p7CI3KIL031038 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 12 Aug 2011 14:03:21 -0400 In-Reply-To: <4E45330C.9060801@gmx.at> (martin rudalics's message of "Fri, 12 Aug 2011 16:05:00 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Scanned-By: MIMEDefang 2.71 on 130.132.50.145 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 130.132.50.145 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:143168 Archived-At: >> "Specifications of user preferences for `display-buffer'. >> This is a list of elements of the form (CONDITION . ACTION) >> where CONDITION is either a regexp matching buffer names, or a function >> that takes a buffer and returns a boolean. >> ACTION is a list of the form (FUNCTION . ALIST) where FUNCTION can be >> either a function or a list of functions. This is probably more simply stated as This is a list of elements of the form (CONDITION FUNCTIONS ACTION-ARGS...) >> (defun display-buffer (&optional buffer action) >> "Display BUFFER in some window." >> (let* ((user-action >> (assq-regexp (buffer-name buffer) display-buffer-alist)) >> (functions (append (car display-buffer-overriding-action) >> (car user-action) >> (car action) > > Here the user has only two choices: Either accept the (car action) with > its alist or use its own (car user-action) with its own alist. > >> (car display-buffer-default-action))) I don't see any problem with that. > As a next step suppose Chong wants to adjust the height of the new > window created by `display-buffer-near-minibuffer' calling, for > example, `fit-window-to-buffer'. We'll soon find someone who dislikes > this behavior and wants `display-buffer' to leave the new height > alone. So someone will propose to add a new user option to turn that > behavior off. It's not necessary for a new option. This can be handled with an element in display-buffer-default-action, since the alist of arguments passed to the display function is constructed by >> (alist (append (cdr display-buffer-overriding-action) >> (cdr user-action) >> (cdr action) >> (cdr display-buffer-default-action)))) The display function just needs to know about that alist element. So I don't think this objection is valid.