[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master ad9eadb 1/2: Consider line spacing and font height
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] master ad9eadb 1/2: Consider line spacing and font height when deriving proc window size |
Date: |
Fri, 7 Jun 2019 05:02:00 -0400 (EDT) |
branch: master
commit ad9eadbe4ab9811d5b4091a18d7a09d325e75fb3
Author: John Shahid <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Consider line spacing and font height when deriving proc window size
* lisp/window.el (window-adjust-process-window-size): Use
window-screen-lines instead of window-body-height.
* lisp/term.el (term-mode): Use window-screen-lines to set the initial
window height.
---
lisp/term.el | 2 +-
lisp/window.el | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lisp/term.el b/lisp/term.el
index 553c3a1..dec8f5a 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -1032,7 +1032,7 @@ Entry to this mode runs the hooks on `term-mode-hook'."
(setq indent-tabs-mode nil)
(setq buffer-display-table term-display-table)
(set (make-local-variable 'term-home-marker) (copy-marker 0))
- (set (make-local-variable 'term-height) (window-text-height))
+ (set (make-local-variable 'term-height) (floor (window-screen-lines)))
(set (make-local-variable 'term-width) (window-max-chars-per-line))
(set (make-local-variable 'term-last-input-start) (make-marker))
(set (make-local-variable 'term-last-input-end) (make-marker))
diff --git a/lisp/window.el b/lisp/window.el
index 2c9d177..0ca628f 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -9573,10 +9573,12 @@ a two-argument function used to combine the widths and
heights of
the given windows."
(when windows
(let ((width (window-max-chars-per-line (car windows)))
- (height (window-body-height (car windows))))
+ (height (with-selected-window (car windows)
+ (floor (window-screen-lines)))))
(dolist (window (cdr windows))
(setf width (funcall reducer width (window-max-chars-per-line window)))
- (setf height (funcall reducer height (window-body-height window))))
+ (setf height (funcall reducer height (with-selected-window window
+ (floor
(window-screen-lines))))))
(cons width height))))
(defun window-adjust-process-window-size-smallest (_process windows)