all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Shahid <jvshahid@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Using window-screen-lines in window-adjust-process-window-size (was: Re: using window-screen-lines in window-adjust-process-window-size)
Date: Mon, 29 Apr 2019 15:45:31 -0400	[thread overview]
Message-ID: <87imuw8uk2.fsf@gmail.com> (raw)
In-Reply-To: <83wojfvi0p.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]


Eli Zaretskii <eliz@gnu.org> writes:

[...]

> I think you are on the right track, so please show a patch to do that,
> and let's take it from there.

Thanks for getting back to me.  I attached the patch below.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Consider-line-spacing-and-font-height-when-deriving-.patch --]
[-- Type: text/x-patch, Size: 2081 bytes --]

From e9cefa049b6c709e728109eb07cfb186024ef581 Mon Sep 17 00:00:00 2001
From: John Shahid <jvshahid@gmail.com>
Date: Sat, 27 Apr 2019 12:21:38 -0400
Subject: [PATCH] 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 586a887a29..b5949c4600 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -1024,7 +1024,7 @@ term-mode
   (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) (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 b4f5ac5cc4..c8fc1248ab 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -9425,10 +9425,12 @@ window-adjust-process-window-size
 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)
-- 
2.21.0


  reply	other threads:[~2019-04-29 19:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-14 14:54 using window-screen-lines in window-adjust-process-window-size John Shahid
2019-01-16 14:10 ` John Shahid
2019-04-27 10:43   ` Using window-screen-lines in window-adjust-process-window-size (was: Re: using window-screen-lines in window-adjust-process-window-size) John Shahid
2019-04-27 10:50     ` Eli Zaretskii
2019-04-29 19:45       ` John Shahid [this message]
2019-04-30 22:26         ` John Shahid
2019-05-13 12:03           ` John Shahid
2019-06-07  9:10             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87imuw8uk2.fsf@gmail.com \
    --to=jvshahid@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.