Subject: Re: bug#17554: 24.3.91; [Regression] re-usage of dired *Marked Files* buffer window

From: Juri Linkov <[email-masked]>
Date: Wed, 18 Jun 2014 11:07:05 +0300

>>> +(add-to-list 'display-buffer-alist '("\\*Completions\\*" display-buffer-at-bottom (nil)))
>>
>> `display-buffer-alist' has to stay nil by default.
>
> This will do the same without changing the default value of `display-buffer-alist':

More changes are needed (for the trunk to better display *Completions*)
to copy all default actions from `display-buffer-fallback-action', but
replace `display-buffer-use-some-window' with `display-buffer-at-bottom':

=== modified file 'lisp/minibuffer.el'
--- lisp/minibuffer.el	2014-06-02 00:18:22 +0000
+++ lisp/minibuffer.el	2014-06-18 08:01:12 +0000
@@ -1796,7 +1796,21 @@ (defun minibuffer-completion-help (&opti
              ;; 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))
+             (display-buffer-mark-dedicated 'soft)
+	     ;; Disable `pop-up-windows' temporarily to allow
+	     ;; `display-buffer--maybe-pop-up-frame-or-window'
+	     ;; in the overridden actions below to pop up a frame
+	     ;; if `pop-up-frames' is non-nil, but not to pop up a window.
+	     ;; Use `display-buffer-at-bottom' to display completions
+	     ;; in a window at the bottom of the selected frame.
+	     (pop-up-windows nil)
+	     (temp-buffer-show-function
+	      (lambda (buffer)
+		(temp-buffer-window-show buffer '((display-buffer--maybe-same-window
+						   display-buffer-reuse-window
+						   display-buffer--maybe-pop-up-frame-or-window
+						   display-buffer-at-bottom)
+						  (window-height . fit-window-to-buffer))))))
         (with-output-to-temp-buffer "*Completions*"
           ;; Remove the base-size tail because `sort' requires a properly
           ;; nil-terminated list.