Subject: bug#4914: completions - remove window after use?

From: martin rudalics <[email-masked]>
Date: Wed, 18 Nov 2009 09:11:40 +0100

>> It's practically impossible to find a solution that satisfies all needs
 >> in this area.  Basically, `display-buffer' would set a special slot for
 >> any window it pops up and `quit-window' would try to delete a window if
 >> it has that slot set and still shows the argument of `display-buffer'.
 >
 > How 'bout the patch below?
 >
 >
 >         Stefan "whose .emacs would have
 >                 (setq display-buffer-mark-dedicated 'soft)"

This reveals a general problem with all `display-buffer' related (and
maybe all) options.  We really should settle on a policy that strictly
separates user provided settings from application provided ones.  In
particular

 > +               ;; If the *Completions* buffer is shown in a new
 > +               ;; window, mark it as softly-dedicated, so bury-buffer in
 > +               ;; minibuffer-hide-completions will know whether to
 > +               ;; delete the window or not.
 > +               (display-buffer-mark-dedicated 'soft))
 > +          (with-output-to-temp-buffer "*Completions*"
 >              ;; Remove the base-size tail because `sort' requires a properly
 >              ;; nil-terminated list.
 >              (when last (setcdr last nil))

overrides the intentions of a user who has an explicit

(setq display-buffer-mark-dedicated nil)

in her .emacs.  Also I suppose that with your .emacs `display-buffer'
won't be able to reuse a window it popped up earlier for displaying
another buffer.  In the case at hand this would prevent the Completions
window's contents getting overwritten by those of some other buffer
which is good.  But in general this might be a bad idea leading to "more
important" windows getting reused and/or new windows and frames popped
up all the time.

Also note that the greater problem is still how to "correctly" quit a
window that has been reused (instead of popped up) by `display-buffer'.

martin