Commit 1ec082d4 authored by Gerd Moellmann's avatar Gerd Moellmann

(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.
parent b246235b
2000-09-20 Gerd Moellmann <gerd@gnu.org>
* window.el (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.
* frame.el (frame-notice-user-settings): Add a last parameter nil
to a call to `append', because the last list passed to `append' is
not copied, and so subsequent calls to assq-delete-all will modify
......
......@@ -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)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment