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: 2011年7月31日 15:48:28 +0200
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

> In defface specs parameters like `min-width 10' are specified in the
> condition part of `defface' like `min-colors 88' as a list.
> For non-conditional parameters I agree that the plist syntax is better.
> And defface spec merges plist attributes from inherited faces.
Sorry. I'm a bit lost here. Is this what is done in the filter parts
of this form
 (:inherit
 (repeat :tag "Inherit"
in `custom-face-attributes'? If so, then this specifies inheritance
explicitly. The inheritance mechanism used by `display-buffer-alist' is
implicit.
Let's consider the following example setup:
(setq
 display-buffer-alist
 '((((regexp . ".*")) (pop-up-window (largest) (lru)))
 (((regexp . "^\\*Help\\*$")) (pop-up-window-set-height . 
fit-window-to-buffer))
 (((regexp . "^\\*.+\\*$")) (pop-up-window-set-height . 20))
 (((regexp . ".*")) (pop-up-window-min-height . 15))))
This currently means that a user wants to
(1) Pop up a window for any buffer either below the largest or least
 recently used window. The minimum height is 15 lines; if Emacs
 can't make a window that large, don't bother popping up a window.
(2) For "*...*" buffers try setting the window height to 20 lines. If
 this is not possible, leave the height alone.
(3) For *Help* buffers try fitting the window to the height of the
 buffer.
So the minimum height of the popped up window is inherited for all
"*...*" buffers.
Now the questions are whether (1) writing such specifications is useful
in the first place, and (2) whether such implicit inheritance is useful.
If they are, I don't see a way to _explicitly_ specify that *Help*
buffers should inherit the minimum window height from the specifier for
all buffers.
> I also want to note that tags like `reuse-window' and `pop-up-window'
> are redundant in plists. Their meaning can be expressed as plists like
> `:window same', `:window other', `:buffer same'.
These tags are mainly used to group items together for the customization
interface: A user caring about how to display a buffer on a separate
frame shouldn't be concerned with specifiers that describe how to pop up
a new window for that buffer. On the "top level" :window is ambiguous
because it can mean the window to reuse or the window to split. So we
would have to write ":window-to-reuse same" and ":window-to-split lru"
or something the like.
> This would bring
> them closer to the syntax of defface specs that is proven to be flexible
> and easy to configure.
If I leave in inheritance, the form above could be simplified to say
(setq
 display-buffer-alist
 '((".*" :pop-up-window largest)
 (".*" :pop-up-window lru)
 ("^\\*Help\\*$" :pop-up-window-set-height fit-window-to-buffer)
 ("^\\*.+\\*$" :pop-up-window-set-height 20)
 (".*" :pop-up-window-min-height 15)))
If we don't want inheritance, we'd probably have to write a thing like
(setq
 display-buffer-alist
 '(("^\\*Help\\*$"
 :pop-up-window largest
 :pop-up-window-set-height fit-window-to-buffer
 :pop-up-window-min-height 15)
 ("^\\*Help\\*$"
 :pop-up-window lru
 :pop-up-window-set-height fit-window-to-buffer
 :pop-up-window-min-height 15)
 ("^\\*.+\\*$"
 :pop-up-window largest
 :pop-up-window-set-height 20
 :pop-up-window-min-height 15)
 ("^\\*.+\\*$"
 :pop-up-window lru
 :pop-up-window-set-height 20
 :pop-up-window-min-height 15)
 (".*"
 :pop-up-window largest
 :pop-up-window-min-height 15)
 ("^\\*.+\\*$"
 :pop-up-window lru
 :pop-up-window-min-height 15)))
instead.
martin

reply via email to

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

AltStyle によって変換されたページ (->オリジナル) /