summaryrefslogtreecommitdiff
path: root/lisp/window.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-09-20 19:32:17 +0000
committerGerd Moellmann <gerd@gnu.org>2000-09-20 19:32:17 +0000
commit1ec082d4f7d3ea6afb5d15c85a874e8687a23ba5 (patch)
tree03504c1a498a053ee0fd8af97d16af8b81e0d653 /lisp/window.el
parentb246235beafc86142b3e20d2c5772750293c1147 (diff)
downloademacs-1ec082d4f7d3ea6afb5d15c85a874e8687a23ba5.tar.gz
(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.
Diffstat (limited to 'lisp/window.el')
-rw-r--r--lisp/window.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 81d35cef894..31735c093f5 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -344,8 +344,7 @@ or if the window is the only window of its frame."
(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 @@ or if the window is the only window of its frame."
(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)))