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: Sun, 28 Aug 2011 10:05:37 +0200
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

I still don't understand how this can DTRT:

  (defun display-buffer (&optional buffer action)
    "Display BUFFER in some window."
    (let* ((user-action
            (assq-regexp (buffer-name buffer) display-buffer-alist))
          (functions (append (car display-buffer-overriding-action)
                             (car user-action)
                             (car action)
                             (car display-buffer-default-action)))
          (alist (append (cdr display-buffer-overriding-action)
                         (cdr user-action)
                         (cdr action)
                         (cdr display-buffer-default-action))))
      (run-with-args-until-success functions buffer alist)))

Suppose `display-buffer-overriding-action' specifies as action to reuse
a window and an alist element to use the lru window like

'(display-buffer-reuse-window . ((window . lru)))

and `user-action' specifies as action to reuse a window and as alist
element to use the largest window like

'(display-buffer-reuse-window . ((window . largest)))

If the lru window cannot be reused, `display-buffer' will nevertheless
try twice to use it and never try to use the largest window.

If `user-action' specifies

'(display-buffer-pop-up-window . ((window . largest)))

`display-buffer' will try to split the lru window.  Shall these
behaviors be considered features or am I missing something?

martin



reply via email to

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