diff options
| author | John Shahid | 2019-04-27 12:21:38 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2019-06-07 11:53:17 +0300 |
| commit | ad9eadbe4ab9811d5b4091a18d7a09d325e75fb3 (patch) | |
| tree | 4ebcc90a48e814504015b2c10fa8b3b4642cd610 | |
| parent | 3a1f92d09bbcb4dbd2a2ebe1bee0e564e51c4615 (diff) | |
| download | emacs-ad9eadbe4ab9811d5b4091a18d7a09d325e75fb3.tar.gz emacs-ad9eadbe4ab9811d5b4091a18d7a09d325e75fb3.zip | |
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.
| -rw-r--r-- | lisp/term.el | 2 | ||||
| -rw-r--r-- | lisp/window.el | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lisp/term.el b/lisp/term.el index 553c3a1af4f..dec8f5a3178 100644 --- a/lisp/term.el +++ b/lisp/term.el | |||
| @@ -1032,7 +1032,7 @@ Entry to this mode runs the hooks on `term-mode-hook'." | |||
| 1032 | (setq indent-tabs-mode nil) | 1032 | (setq indent-tabs-mode nil) |
| 1033 | (setq buffer-display-table term-display-table) | 1033 | (setq buffer-display-table term-display-table) |
| 1034 | (set (make-local-variable 'term-home-marker) (copy-marker 0)) | 1034 | (set (make-local-variable 'term-home-marker) (copy-marker 0)) |
| 1035 | (set (make-local-variable 'term-height) (window-text-height)) | 1035 | (set (make-local-variable 'term-height) (floor (window-screen-lines))) |
| 1036 | (set (make-local-variable 'term-width) (window-max-chars-per-line)) | 1036 | (set (make-local-variable 'term-width) (window-max-chars-per-line)) |
| 1037 | (set (make-local-variable 'term-last-input-start) (make-marker)) | 1037 | (set (make-local-variable 'term-last-input-start) (make-marker)) |
| 1038 | (set (make-local-variable 'term-last-input-end) (make-marker)) | 1038 | (set (make-local-variable 'term-last-input-end) (make-marker)) |
diff --git a/lisp/window.el b/lisp/window.el index 2c9d177d0a2..0ca628f0065 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 | |||
| 9573 | the given windows." | 9573 | the given windows." |
| 9574 | (when windows | 9574 | (when windows |
| 9575 | (let ((width (window-max-chars-per-line (car windows))) | 9575 | (let ((width (window-max-chars-per-line (car windows))) |
| 9576 | (height (window-body-height (car windows)))) | 9576 | (height (with-selected-window (car windows) |
| 9577 | (floor (window-screen-lines))))) | ||
| 9577 | (dolist (window (cdr windows)) | 9578 | (dolist (window (cdr windows)) |
| 9578 | (setf width (funcall reducer width (window-max-chars-per-line window))) | 9579 | (setf width (funcall reducer width (window-max-chars-per-line window))) |
| 9579 | (setf height (funcall reducer height (window-body-height window)))) | 9580 | (setf height (funcall reducer height (with-selected-window window |
| 9581 | (floor (window-screen-lines)))))) | ||
| 9580 | (cons width height)))) | 9582 | (cons width height)))) |
| 9581 | 9583 | ||
| 9582 | (defun window-adjust-process-window-size-smallest (_process windows) | 9584 | (defun window-adjust-process-window-size-smallest (_process windows) |