From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: IRIE Shinsuke Newsgroups: gmane.emacs.bugs 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 Message-ID: <4BA35102.7050506@yahoo.co.jp> References: <4B80CB5A.8080306@yahoo.co.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000004020401050906040209" X-Trace: dough.gmane.org 1268997871 8208 80.91.229.12 (19 Mar 2010 11:24:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 19 Mar 2010 11:24:31 +0000 (UTC) To: 5615@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 19 12:24:27 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NsaIL-0003AG-2z for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Mar 2010 12:24:27 +0100 Original-Received: from localhost ([127.0.0.1]:52315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NsaI7-0007uM-JS for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Mar 2010 07:22:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NsZrG-0008CQ-Kl for bug-gnu-emacs@gnu.org; Fri, 19 Mar 2010 06:55:14 -0400 Original-Received: from [140.186.70.92] (port=33669 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NsZrC-00089p-Po for bug-gnu-emacs@gnu.org; Fri, 19 Mar 2010 06:55:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NsZr2-0007Rb-Nf for bug-gnu-emacs@gnu.org; Fri, 19 Mar 2010 06:55:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53203) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NsZr2-0007RX-Gb for bug-gnu-emacs@gnu.org; Fri, 19 Mar 2010 06:55:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NsZO2-00024E-B8; Fri, 19 Mar 2010 06:25:02 -0400 X-Loop: bug-gnu-emacs@gnu.org In-Reply-To: <4B80CB5A.8080306@yahoo.co.jp> Resent-From: IRIE Shinsuke Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Mar 2010 10:25:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-GNU-PR-Message: followup 5615 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5615-submit@debbugs.gnu.org id=B5615.12689942767923 (code B ref 5615); Fri, 19 Mar 2010 10:25:02 +0000 Original-Received: (at 5615) by debbugs.gnu.org; 19 Mar 2010 10:24:36 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NsZNc-00023k-44 for submit@debbugs.gnu.org; Fri, 19 Mar 2010 06:24:36 -0400 Original-Received: from mail-gy0-f172.google.com ([209.85.160.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NsZNa-00023d-GV for 5615@debbugs.gnu.org; Fri, 19 Mar 2010 06:24:34 -0400 Original-Received: by gyh4 with SMTP id 4so1469045gyh.3 for <5615@debbugs.gnu.org>; Fri, 19 Mar 2010 03:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :reply-to:user-agent:mime-version:to:subject:x-enigmail-version :content-type; bh=NhH2gwkHm8lUa2I8CsV1Ms3s3C4sqr84P4eOtqNsa+E=; b=VrOSFJKJQFBsrQctgAg4XQL4ESBQu+iQW1Hs3Sx0HN4IV44KJ3xH7Ufi+6NPBIIlL+ OTlVgki3Vu8P25FLlyo6AXJiVM68COxnG1sVKKcL3n2Nh3oVwG65KK2CRh7IuSx9w0yN vw4wmqtq03Loi2z7mh7zCQ1nMK39+VpWtj4gg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to :subject:x-enigmail-version:content-type; b=eEzml1En1KN/RAaYwrhbonC4y2s+AyAGjHHa70uH0wtq9Yypw81RaF+Fsi/GEySbOV n2xJMozzuaatME2PCtLtX3KvpioZpuTEGWNESomsfWy8870cTBFxstbIZ+SCe/Bzr1TX AuThsp0nxPQ7H1eVgPNXf0uZQL56YQaDi6/2o= Original-Received: by 10.91.23.19 with SMTP id a19mr302074agj.49.1268994269264; Fri, 19 Mar 2010 03:24:29 -0700 (PDT) Original-Received: from [114.51.18.28] (EM114-51-18-28.pool.e-mobile.ne.jp [114.51.18.28]) by mx.google.com with ESMTPS id 13sm638589gxk.4.2010.03.19.03.24.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 19 Mar 2010 03:24:28 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; ja; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 X-Enigmail-Version: 1.0.1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 19 Mar 2010 06:25:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:35635 Archived-At: This is a multi-part message in MIME format. --------------000004020401050906040209 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit 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 --------------000004020401050906040209 Content-Type: text/x-diff; name="term-window-height-newpatch.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="term-window-height-newpatch.patch" === 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))) (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) --------------000004020401050906040209--