[Top][All Lists]

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

RE: display-buffer-alist simplifications

From: Drew Adams
Subject: RE: display-buffer-alist simplifications
Date: Tue, 2 Aug 2011 09:41:16 -0700

> `special-display-buffer-names' had only one serious user,
> namely Drew Adams.  I know that because my rewrite had a
> number of bugs which we eliminated in a period of two
> weeks mostly by trial and error.  In all that time no one else
> complained.  I suppose you use it as well but since you apparently
> advice `display-buffer' (or some subset of its routines) you
> were not hit by these bugs.
> `special-display-buffer-names' is complex because it prescribes
> behavior for reusing the same window, reusing some other window
> on the same frame, popping up a new window, reusing a window on
> another frame and popping up a new frame.  That's the kind of
> expressiveness Drew needs because he's got no other choice.
> It's far too expressive for all other users.

A comment, since my case has been identified as unique -

1. `special-display-buffer-names' is _very_, very old.  It has been in GNU Emacs
as far back as the introduction of frames, I believe.  Someone can check the
origin and the original design arguments; I'm no expert on this.  

2. AFAIK, from the outset it has been just as "complex" as it is today - all of
the possibilities have been there since Day One.  They were not added
incrementally because someone thought that it would be neat to add a bell here
or a whistle there.  They were thought to be important by the _original
designers_, many, many moon ago.

3. The point is that I did not invent `special-display-buffer-names', and it was
not invented for me. ;-)  I have made use of it for decades (since at least
Emacs 19, maybe 18, IIRC), and I have always made the _same_ use of it.

4. Here is the _only_ use I make of it - Drew's weirdo use case.  I use only the
form (BUFFER FUNCTION OTHER-ARGS...), and only for two buffers: *Help* and
*Completions*.  This is my value of `special-display-buffer-names':

(("*Completions*" 1on1-display-*Completions*-frame
  ((background-color . "LavenderBlush2")
   (mouse-color . "VioletRed")
   (cursor-color . "VioletRed")
   (menu-bar-lines . 0)
   (tool-bar-lines . 0)
   (width . 100)))
 ("*Help*" 1on1-display-*Help*-frame
  ((background-color . "Thistle")
   (mouse-color . "Blue Violet")
   (cursor-color . "Blue Violet")
   (height . 40))))

5. How does it work?  Per the definition of `special-display-buffer-names', the
alist entry for *Help* or *Completions* is used by `special-display-popup-frame'
(the default value of `special-display-function') to display the buffer.  That's

IOW, *Help* is displayed by calling `1on1-display-*Help*-frame', passing the
associated background-color, etc.  Similarly, *Completions* is shown by

6. In sum, my use of `special-display-buffer-names' is to provide a function and
associated frame parameters for displaying buffer *Help*, likewise *Completions.
Nothing more.  No big deal, IMO.

7. For buffer *Completions*, for example, the special-display function
`1on1-display-*Completions*-frame' does all of this:

a. Display the buffer in a separate frame with the given frame parameters.  This
also includes positioning it (left or right) per a user option.

b. Zoom the buffer text per a user option (typically to show more candidates by
reducing the text size).

c. Raise the frame to the front.

d. Redirect the frame's keyboard input focus to the standalone minibuffer frame,
if there is one.

HTH.  Personally, I do not consider my use of `special-display-buffer-names' to
be strange or outlandish - it seems pretty simple to me.

If it is true that I am the only one to use this feature, so be it.  But that in
itself does not make this feature or my use of it "complex".  And I would even
guess that if more things worked better in GNU Emacs wrt frames (as opposed to
just windows) then you might see more people using this feature.

FWIW, my code for this works in Emacs 20 through 23, and it also works with
Emacs 24 after Martin's efforts to fix some initial bugs (thank you, Martin!).
And it works cross-platform, AFAIK.  Not so far out, really.

[FWIW2: IIRC, my use of a standalone minibuffer and *Help* and *Completions*
frames predates my code in GNU Emacs.  IIRC (and no, I don't remember this very
well), I had the same thing in Epoch.  And in Epoch (IIRC) it _just worked_ out
of the box to have a standalone minibuffer frame: no fiddling, no "special"
frames, no input redirection, nada!

Again, that was long ago and I do not remember it well, but I'm pretty sure that
I had the same kind of setup as now, and I did not have to jump through any
hoops to get it.  When I moved back again to GNU Emacs I tried to reproduce some
of the nice setup I had in Epoch - with difficulty.  And, IIUC, some of Epoch's
fine features are still missing from GNU Emacs...  On n'arrete pas le progres.]

reply via email to

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