emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: display-buffer-alist simplifications


From: Stefan Monnier
Subject: Re: display-buffer-alist simplifications
Date: Mon, 08 Aug 2011 17:34:09 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>>> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]