From: Juri Linkov Date: Sat, 27 Dec 2014 00:54:56 +0000 (+0200) Subject: Avoid duplicate calls of window-height in with-displayed-buffer-window X-Git-Tag: emacs-25.0.90~2631^2~15^2~24 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=162660c3639a68a7b71439bdd713d54f940274b8;p=emacs.git Avoid duplicate calls of window-height in with-displayed-buffer-window * lisp/minibuffer.el (minibuffer-completion-help): Use shrink-window-if-larger-than-buffer in window-height when temp-buffer-resize-mode is nil. * lisp/window.el (with-displayed-buffer-window): Remove window-height from the action alist in the temp-buffer-window-show call when window-height is handled explicitly afterwards. Fixes: debbugs:19355 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0c321732918..5a42e506d35 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2014-12-27 Juri Linkov + + * minibuffer.el (minibuffer-completion-help): + Use shrink-window-if-larger-than-buffer in window-height + when temp-buffer-resize-mode is nil. + + * window.el (with-displayed-buffer-window): Remove window-height + from the action alist in the temp-buffer-window-show call + when window-height is handled explicitly afterwards (bug#19355). + 2014-12-27 Juri Linkov Support subdirectories when saving places in dired. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index e1e6b0ee907..91989016067 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1818,8 +1818,9 @@ variables.") ,(if (eq (selected-window) (minibuffer-window)) 'display-buffer-at-bottom 'display-buffer-below-selected)) - ,(when temp-buffer-resize-mode - '(window-height . resize-temp-buffer-window)) + ,(if temp-buffer-resize-mode + '(window-height . resize-temp-buffer-window) + '(window-height . shrink-window-if-larger-than-buffer)) ,(when temp-buffer-resize-mode '(preserve-size . (nil . t)))) nil diff --git a/lisp/window.el b/lisp/window.el index 2b593c35a54..21bd2c5829b 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -237,7 +237,12 @@ displays the buffer specified by BUFFER-OR-NAME before running BODY." (standard-output ,buffer) ,window ,value) (with-current-buffer ,buffer - (setq ,window (temp-buffer-window-show ,buffer ,vaction))) + (setq ,window (temp-buffer-window-show + ,buffer + ;; Remove window-height when it's handled below. + (if (functionp (cdr (assq 'window-height (cdr ,vaction)))) + (assq-delete-all 'window-height (copy-sequence ,vaction)) + ,vaction)))) (let ((inhibit-read-only t) (inhibit-modification-hooks t))