diff options
| author | Juri Linkov <juri@jurta.org> | 2014-07-08 11:02:50 +0300 |
|---|---|---|
| committer | Juri Linkov <juri@jurta.org> | 2014-07-08 11:02:50 +0300 |
| commit | f0f70ec0bc55e452ea29b5cf3f532740966b0192 (patch) | |
| tree | e77dfa2fabf062231d851071670138f28d1d2566 /lisp/minibuffer.el | |
| parent | f298de5264c86bbb76ccec727779dabe16e6b9c3 (diff) | |
| download | emacs-f0f70ec0bc55e452ea29b5cf3f532740966b0192.tar.gz | |
* lisp/window.el (with-displayed-buffer-window): New macro.
(with-temp-buffer-window, with-current-buffer-window):
Use `macroexp-let2' to evaluate and bind variables
in the same order as macro arguments.
(display-buffer--action-function-custom-type): Add
`display-buffer-below-selected' and `display-buffer-at-bottom'.
* lisp/minibuffer.el (minibuffer-completion-help): Replace
`with-output-to-temp-buffer' with `with-displayed-buffer-window'
with actions that display *Completions* at-bottom when called
from the minibuffer, or below-selected in a normal buffer.
Associate `window-height' with `fit-window-to-buffer'.
Let-bind `pop-up-windows' to nil.
* lisp/dired.el (dired-mark-pop-up): Use `with-displayed-buffer-window'
instead of `with-current-buffer-window'.
Fixes: debbugs:17809
Diffstat (limited to 'lisp/minibuffer.el')
| -rw-r--r-- | lisp/minibuffer.el | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index e7e08342b47..f8b77cddbc5 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1794,8 +1794,29 @@ variables.") ;; 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*" + (display-buffer-mark-dedicated 'soft) + ;; Disable `pop-up-windows' temporarily to allow + ;; `display-buffer--maybe-pop-up-frame-or-window' + ;; in the display actions below to pop up a frame + ;; if `pop-up-frames' is non-nil, but not to pop up a window. + (pop-up-windows nil)) + (with-displayed-buffer-window + "*Completions*" + ;; This is a copy of `display-buffer-fallback-action' + ;; where `display-buffer-use-some-window' is replaced + ;; with `display-buffer-at-bottom'. + `((display-buffer--maybe-same-window + display-buffer-reuse-window + display-buffer--maybe-pop-up-frame-or-window + ;; Use `display-buffer-below-selected' for inline completions, + ;; but not in the minibuffer (e.g. in `eval-expression') + ;; for which `display-buffer-at-bottom' is used. + ,(if (and completion-in-region-mode-predicate + (not (minibuffer-selected-window))) + 'display-buffer-below-selected + 'display-buffer-at-bottom)) + (window-height . fit-window-to-buffer)) + nil ;; Remove the base-size tail because `sort' requires a properly ;; nil-terminated list. (when last (setcdr last nil)) |
