emacs-devel
[Top][All Lists]
Advanced

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

Re: display-buffer-alist simplifications


From: martin rudalics
Subject: Re: display-buffer-alist simplifications
Date: Thu, 04 Aug 2011 15:59:54 +0200
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

> Fair enough.  So use `display-buffer-fallback-alist' as Juri said.  The
> main point is to make it so that (i) display specifiers behave like
> familiar old variable binding, and (ii) there is an easy way to set the
> default without introducing complex merging sematics.
...
> We can specify that these old variables override the new behavior,
> i.e. `display-buffer-fallback-alist' only applies to buffers not
> matching `special-display-buffer-names'.

In Emacs 23 a user can specify that a buffer shall be displayed in the
selected window by adding its name to `same-window-buffer-names'.  An
application can override the user by binding `same-window-buffer-names'
temporarily to nil.  We have to offer a similar feature in Emacs 24.

Currently this can be done by setting `display-buffer-alist' from
`same-window-buffer-names' via `display-buffer-alist-set'.  But how
would we do that with `display-buffer-fallback-alist'?  If we add the
value to `display-buffer-fallback-alist' then the latter must be fully
customizable just as `display-buffer-alist'.  If we add the value to
`display-buffer-alist' itself it can't be overridden by the application.
If we let applications bind `display-buffer-alist' there's no sense in
supplying an argument in the first place.

>> If so how would we express to first find another window showing the
>> same buffer and then another window showing another buffer?
>
> One way would be to allow display-buffer-method to be a list of macro
> specifiers, e.g. something like:
>
>   (setq display-buffer-fallback-alist
>     '((display-buffer-method (other-window-same-buffer other-window))))
>
>   (setq display-buffer-macro-specifiers
>     '((other-window-same-buffer
>        (display-buffer-method reuse-window)
>        (reuse-window-buffer same)
          ^^^^^^^^^^^^^^^^^^^

Would such a naming scheme suit you?

>        (reuse-window-window other))
>       (other-window
>        (display-buffer-method reuse-window)
>        (reuse-window-window other))

Basically, this means to shift complexity from `display-buffer-alist' to
`display-buffer-macro-specifiers' which sounds reasonable.

martin



reply via email to

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