emacs-devel
[Top][All Lists]
Advanced

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

Re: display-buffer-alist simplifications


From: Chong Yidong
Subject: Re: display-buffer-alist simplifications
Date: Fri, 02 Sep 2011 10:54:41 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> Four variables should be made obsolete by display-buffer-alist:
> same-window-buffer-names, same-window-regexps, special-display-regexps,
> and special-display-buffer-names.
>
> The rest should be made obsolete by display-buffer-default-rule (or by
> the RULE (formerly NOT-THIS-WINDOW) arg of display-buffer):
> pop-up-frames, pop-up-windows, display-buffer-mark-dedicated,
> display-buffer-reuse-frames, probably a few more.
>
> I also think that special-display-function can be marked obsolete, not
> because something superceded it, but because I don't think anyone ever
> used it.

I've now split up display-buffer-default into separate functions.  So
the default action of display-buffer is given by the following value of
display-buffer-default-action:

  '((display-buffer-reuse-selected-window
     display-buffer-maybe-same-window
     display-buffer-reuse-or-pop-window
     display-buffer-use-some-window
     display-buffer-pop-up-frame))

The "rule" terminology does sound nicer, so I guess we could rename
display-buffer-default-action to display-buffer-default-rule, and
display-buffer-use-some-window to display-rule-use-some-window etc.


Currently `display-buffer-maybe-same-window' handles the same-window-*
variables simply as

(defun display-buffer-maybe-same-window (buffer alist)
  (and (same-window-p (buffer-name buffer))
       (display-buffer-same-window buffer alist)))

If you want to convert same-window-* into alist entries, the cleanest
way is probably to add new optional args to `same-window-p' that, if
non-nil, override the values of same-window-*.  Then
`display-buffer-maybe-same-window' can pass the alist values to
`same-window-p' in those arguments.


OTOH we don't need any special handling for `special-display-*',
`display-buffer-reuse-frames', `pop-up-frames', or `pop-up-windows'.
They're currently handled in `display-buffer-reuse-or-pop-window', which
checks those variables and conditionally calls other functions like
`display-buffer-pop-up-frame', etc.  So those variables can be replaced
at a future date, by changing `display-buffer-default-action' and
replacing `display-buffer-reuse-or-pop-window' with the desired
combination of those other functions.



reply via email to

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