emacs-devel
[Top][All Lists]
Advanced

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

Re: display-buffer-alist simplifications


From: Juri Linkov
Subject: Re: display-buffer-alist simplifications
Date: Mon, 08 Aug 2011 12:45:36 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)

> You can already do that since Emacs-20 by setting special-display-regexp
> to something like
>
>   (add-to-list 'special-display-regexps
>                '("\\*Completions\\*" my-display-completions))
>
> Tho I haven't seen any sample "my-display-completions" yet.

A possible explanation is that users don't like to write functions
to specify buffer-displaying behavior :)

>> I expect this eventually will turn `display-buffer-alist' into
>
>>   (("\\*\\(vc-\\)?diff*"
>>     display-buffer-according-to-specifiers (spec . val))
>>    ("\\*\\(compilation\\|grep\\)\\*"
>>     display-buffer-according-to-specifiers (spec . val))
>>    ...)
>
>> because predefined spec values are easier to customize.
>
> Easier than what?

Selecting from the set of predefined values is easier than
writing a new function to customize the buffer-displaying behavior.

>> Yes, a single variable would be enough to override the display-buffer's arg
>> (maybe a better name would be `display-buffer-specifiers').
>
> In my proposal, these things are called "rule", where RULE has the form
> (FUNCTION . ARGS).

In classical logic, necessary part of "rule" is "condition".
So "rule" is rather such an element if `display-buffer-alist':

  ("*Completions*" display-buffer-according-to-specifiers (spec . val))

But since "condition" part is unnecessary in the call of `display-buffer',
what remains is just specifiers.

According to your earlier proposals such specifiers should be
as short as possible like:

  (display-buffer buffer 'same-frame)
  (display-buffer buffer 'same-window)
  (display-buffer buffer 'other-window)
  (display-buffer buffer 'nearby)
  (display-buffer buffer 'near-minibuffer)
  (display-buffer buffer 'below-selected)
  (display-buffer buffer 'side-window)

But now you propose to use function names. So it seems that instead of

  (display-buffer buffer 'reuse-window)
  (display-buffer buffer 'pop-up-window)

using function names as an argument of `display-buffer'
would look very weird:

  (display-buffer buffer 'display-buffer-reuse-window)
  (display-buffer buffer 'display-buffer-pop-up-window)

It will cause the callers to ask the questions like
why this can't be written simply as:

  (display-buffer-reuse-window buffer)
  (display-buffer-pop-up-window buffer)



reply via email to

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