From: IRIE Shinsuke <irieshinsuke@yahoo.co.jp>
To: 5615@debbugs.gnu.org
Subject: bug#5615: 23.1.92; [PATCH] term.el: Calculation of window height is bad (new patch)
Date: Fri, 19 Mar 2010 19:25:06 +0900 [thread overview]
Message-ID: <4BA35102.7050506@yahoo.co.jp> (raw)
In-Reply-To: <4B80CB5A.8080306@yahoo.co.jp>
[-- Attachment #1: Type: text/plain, Size: 240 bytes --]
Sorry, the patch I sent with previous mail is bad, because the previous
patch was made without considering `line-spacing' specified by a
floating point number or frame-parameter.
So I wrote the new patch. Please check it.
IRIE Shinsuke
[-- Attachment #2: term-window-height-newpatch.patch --]
[-- Type: text/x-diff, Size: 2034 bytes --]
=== modified file 'lisp/term.el'
*** old/lisp/term.el 2010-03-16 14:48:29 +0000
--- new/lisp/term.el 2010-03-19 09:53:36 +0000
***************
*** 942,947 ****
--- 942,958 ----
(window-width)
(1- (window-width)))))
+ (defun term-window-height ()
+ (if (display-graphic-p)
+ (let ((e (window-inside-pixel-edges))
+ (s (or (with-current-buffer (window-buffer) line-spacing)
+ (frame-parameter nil 'line-spacing)
+ 0)))
+ (if (floatp s)
+ (setq s (truncate (* (frame-char-height) s))))
+ (/ (+ (- (nth 3 e) (cadr e)) s)
+ (+ (frame-char-height) s)))
+ (window-text-height)))
\f
(put 'term-mode 'mode-class 'special)
***************
*** 1039,1045 ****
(make-local-variable 'term-height)
(make-local-variable 'term-width)
(setq term-width (term-window-width))
! (setq term-height (1- (window-height)))
(make-local-variable 'term-terminal-parameter)
(make-local-variable 'term-saved-cursor)
(make-local-variable 'term-last-input-start)
--- 1050,1056 ----
(make-local-variable 'term-height)
(make-local-variable 'term-width)
(setq term-width (term-window-width))
! (setq term-height (term-window-height))
(make-local-variable 'term-terminal-parameter)
(make-local-variable 'term-saved-cursor)
(make-local-variable 'term-last-input-start)
***************
*** 1182,1190 ****
found))
(defun term-check-size (process)
! (when (or (/= term-height (1- (window-height)))
(/= term-width (term-window-width)))
! (term-reset-size (1- (window-height)) (term-window-width))
(set-process-window-size process term-height term-width)))
(defun term-send-raw-string (chars)
--- 1193,1201 ----
found))
(defun term-check-size (process)
! (when (or (/= term-height (term-window-height))
(/= term-width (term-window-width)))
! (term-reset-size (term-window-height) (term-window-width))
(set-process-window-size process term-height term-width)))
(defun term-send-raw-string (chars)
next prev parent reply other threads:[~2010-03-19 10:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4B80CB5A.8080306@yahoo.co.jp>
2010-03-19 10:23 ` bug#5615: 23.1.92; [PATCH] term.el: Calculation of window height is bad (new patch) IRIE Shinsuke
2010-03-19 10:25 ` IRIE Shinsuke [this message]
2016-02-28 6:06 ` Lars Ingebrigtsen
2017-08-11 0:45 ` npostavs
2017-08-11 6:32 ` Eli Zaretskii
2017-08-20 3:34 ` npostavs
2010-03-19 10:38 ` IRIE Shinsuke
2010-05-30 5:23 ` Ken Hori
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=4BA35102.7050506@yahoo.co.jp \
--to=irieshinsuke@yahoo.co.jp \
--cc=5615@debbugs.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.