changeset 31790:c31d17444869

(shrink-window-if-larger-than-buffer): If face `mode-line' has a :box, and we're on a graphical frame, add 1 to the needed window height.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 20 Sep 2000 19:31:56 +0000
parents ff5eb810214a
children 0ac4efb76ef6
files lisp/window.el
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/window.el	Wed Sep 20 17:08:54 2000 +0000
+++ b/lisp/window.el	Wed Sep 20 19:31:56 2000 +0000
@@ -344,8 +344,7 @@
     (if window
 	(select-window window)
       (setq window (selected-window)))
-    (let* ((params (frame-parameters))
-           (mini (cdr (assq 'minibuffer params)))
+    (let* ((mini (frame-parameter nil 'minibuffer))
            (edges (window-edges)))
       (if (and (< 1 (count-windows))
                (= (window-width) (frame-width))
@@ -353,12 +352,19 @@
                (not (eq mini 'only))
                (or (not mini)
                    (< (nth 3 edges) (nth 1 (window-edges mini)))
-                   (> (nth 1 edges) (cdr (assq 'menu-bar-lines params)))))
+                   (> (nth 1 edges) (frame-parameter nil 'menu-bar-lines))))
           ;; `count-screen-lines' always works on the current buffer, so
           ;; make sure it is the buffer displayed by WINDOW.
           (let ((text-height (with-current-buffer (window-buffer window)
                                (count-screen-lines)))
                 (window-height (window-height)))
+	    ;; This is a workaround that adds 1 line to the window
+	    ;; if windows have a 3D mode-line.  What's really needed
+	    ;; is to get rid of the line-based computations.  We don't
+	    ;; have the infrastructure for doing so, yet.
+	    (when (and (display-graphic-p)
+		       (face-attribute 'mode-line :box))
+	      (setq text-height (1+ text-height)))
 	    ;; Don't try to redisplay with the cursor at the end
 	    ;; on its own line--that would force a scroll and spoil things.
 	    (when (and (eobp) (bolp) (not (bobp)))