From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: display-buffer-alist simplifications Date: Mon, 08 Aug 2011 17:34:09 -0400 Message-ID: References: <87mxgem09k.fsf@stupidchicken.com> <4E22AE2B.5040806@gmx.at> <4E248102.6080904@gmx.at> <4E380918.3060806@gmx.at> <4E397611.5020603@gmx.at> <87oc037qwj.fsf@mail.jurta.org> <87y5z3ocdg.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT X-Trace: dough.gmane.org 1312839261 1089 80.91.229.12 (8 Aug 2011 21:34:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 8 Aug 2011 21:34:21 +0000 (UTC) Cc: Juri Linkov , martin rudalics , emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 08 23:34:17 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 1QqXSg-0003Tw-OP for ged-emacs-devel@m.gmane.org; Mon, 08 Aug 2011 23:34:14 +0200 Original-Received: from localhost ([::1]:50874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqXSg-000856-90 for ged-emacs-devel@m.gmane.org; Mon, 08 Aug 2011 17:34:14 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqXSe-000851-1I for emacs-devel@gnu.org; Mon, 08 Aug 2011 17:34:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QqXSd-00034Y-6s for emacs-devel@gnu.org; Mon, 08 Aug 2011 17:34:12 -0400 Original-Received: from relais.videotron.ca ([24.201.245.36]:12305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqXSd-00034R-45 for emacs-devel@gnu.org; Mon, 08 Aug 2011 17:34:11 -0400 Original-Received: from ceviche.home ([96.22.109.87]) by VL-VM-MR005.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0LPM00FLPP8YJM50@VL-VM-MR005.ip.videotron.ca> for emacs-devel@gnu.org; Mon, 08 Aug 2011 17:34:10 -0400 (EDT) Original-Received: by ceviche.home (Postfix, from userid 20848) id E454D6610B; Mon, 08 Aug 2011 17:34:09 -0400 (EDT) In-reply-to: <87y5z3ocdg.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 24.201.245.36 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:143033 Archived-At: >>> Should I write a new function and use it like: >>> (setq display-buffer-alist '( >>> ("*Help*" display-buffer-other-window-same-frame-or-same-window))) >> Yes, I think that would be the answer. > Except that this should be a list of rules, because you don't want to > force users to define a new function each time they want to "chain" two > rules together. I don't know how important it is in practice. > (setq display-buffer-alist > '(("*Help*" (rules rule-1 rule-2) > (param-1 foo) > (param-2 bar)))) So you're suggesting I extend my scheme from display-buffer-alist ::= list of (CONDITION . RULE) RULE ::= (FUNCTION . ALIST) to display-buffer-alist ::= list of (CONDITION . RULE) RULE ::= (FUNCTIONS . ALIST) FUNCTIONS ::= list of FUNCTION so you'd run it as (run-hook-with-args-until-success FUNCTION BUFFER ALIST)? And we could accept a single function for FUNCTIONS (i.e. allow both of the above forms). That's still fairly simple and clean, so I'm OK with it, although it may impact the choice of predefined functions we provide in a way that will make it more complicated for the user to setup (rather than just display-buffer-same-window, she may have to choose a list of functions, specifying explicitly what to do when same-window doesn't work). But I guess it would let us form both FUNCTIONS and ALIST by concatenating the various FUNCTIONS and ALIST provided by the default, the caller, the user, and any potential override. Stefan