From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tak Kunihiro Newsgroups: gmane.emacs.devel Subject: Re: line-pixel-height beyond eol Date: Fri, 15 Sep 2017 10:39:53 +0900 (JST) Message-ID: <20170915.103953.1793873179442462342.tkk@misasa.okayama-u.ac.jp> References: <83shfqobxv.fsf@gnu.org> <20170914.081426.783469864848954364.tkk@misasa.okayama-u.ac.jp> <83poatmaja.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1505439653 17440 195.159.176.226 (15 Sep 2017 01:40:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 15 Sep 2017 01:40:53 +0000 (UTC) Cc: tkk@misasa.okayama-u.ac.jp, emacs-devel@gnu.org To: eliz@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 15 03:40:47 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dsfcd-0004MY-18 for ged-emacs-devel@m.gmane.org; Fri, 15 Sep 2017 03:40:47 +0200 Original-Received: from localhost ([::1]:50741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsfck-00042j-8b for ged-emacs-devel@m.gmane.org; Thu, 14 Sep 2017 21:40:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsfc6-0003wl-HD for emacs-devel@gnu.org; Thu, 14 Sep 2017 21:40:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dsfc5-00025W-Mr for emacs-devel@gnu.org; Thu, 14 Sep 2017 21:40:14 -0400 Original-Received: from mxl069v66.mxlogic.net ([208.81.69.66]:17728 helo=s18p02o143.mxlogic.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dsfc0-0001pv-JU; Thu, 14 Sep 2017 21:40:09 -0400 Original-Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s18p02o143.mxlogic.net(mxl_mta-8.5.0-1834) over TLS secured channel with ESMTP id d6f2bb95.0.474385.00-399.936837.s18p02o143.mxlogic.net (envelope-from ); Thu, 14 Sep 2017 19:39:58 -0600 (MDT) X-MXL-Hash: 59bb2f6e2614fce0-7dbea9f6e28be2cb5c0cda0efb2cc8d8db50ed41 Original-Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 6d54_7e03_802079ef_c682_4f10_bb34_291488bfc8ec; Fri, 15 Sep 2017 10:39:54 +0900 Original-Received: from localhost (vesta.misasa.okayama-u.ac.jp [150.46.48.154]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id AF49B4C08C0; Fri, 15 Sep 2017 10:39:54 +0900 (JST) In-Reply-To: <83poatmaja.fsf@gnu.org> X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 4 Rules triggered EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV6116=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6116> : inlines <6069> : streams <1763049> : uri <2500517> X-AnalysisOut: [v=2.2 cv=E6K9neVl c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=kj9zAlcOel0A:10 a=2JC] X-AnalysisOut: [JgTwv5E4A:10 a=9KZdnMPu0sWKRjxrmrYA:9 a=qVpjO1CM8xXrPIbb:2] X-AnalysisOut: [1 a=UGy8Moj3cQsF7S6V:21 a=CjuIK1q_8ugA:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017091424); S=0.462(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 208.81.69.66 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:218307 Archived-At: >> (progn (vertical-motion 1) >> (dolist (vs (number-sequence 1 (1- (save-excursion >> (goto-char (window-start)) >> (line-pixel-height))))) >> (set-window-vscroll nil vs t) (sit-for 0.01)) >> (scroll-up 1)) >> >> Let's assume a line with image of height 144 pixel is located on the >> top line. When auto-hscroll-mode is off and (current-column) is large >> (the 144 pixel image is scrolled left), the top line looks 27 pixel >> height but (line-pixel-height) returns 144 pixel. The inconsistency >> results in jump. > > Would it help not to use the height of the top window line, but > instead simply use the value returned by frame-char-height? That > takes its value from the frame's default font, and so should be > independent on what's in the window. That is a good idea! I want to scroll that way. To scroll pixels by frame-char-height, a line should be flushed by (scroll-up 1) when (window-vscroll nil t) is very close to height of pixel on the top window line. If this flush does not happened on the right timing, screen jumps unexpectedly as demonstrated below. M-x about-emacs M-: (progn (dolist (vs (number-sequence 1 (1- (frame-char-height)))) (set-window-vscroll nil vs t) (sit-for 0.01)) (scroll-up 1)) Thus I have to know height of pixel on the top window line.