]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid duplicate calls of window-height in with-displayed-buffer-window
authorJuri Linkov <juri@linkov.net>
Sat, 27 Dec 2014 00:54:56 +0000 (02:54 +0200)
committerJuri Linkov <juri@linkov.net>
Sat, 27 Dec 2014 00:54:56 +0000 (02:54 +0200)
* 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
lisp/ChangeLog
lisp/minibuffer.el
lisp/window.el

index 0c321732918a41b677f282344e05d1b95e61fe35..5a42e506d35e0e46c3f8d068e263c5bf47438a01 100644 (file)
@@ -1,3 +1,13 @@
+2014-12-27  Juri Linkov  <juri@linkov.net>
+
+       * 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  <juri@linkov.net>
 
        Support subdirectories when saving places in dired.
index e1e6b0ee9073f73d19a9512551389bc07ef408da..919890160675d1af9ec92bbe0d6c3e109e49983a 100644 (file)
@@ -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
index 2b593c35a54e85366a6f2aca89eba94beb90a21c..21bd2c5829b14e279e89ace4c19ec23e4f764dba 100644 (file)
@@ -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))