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: Mon, 16 Oct 2017 14:13:03 +0900 (JST) Message-ID: <20171016.141303.1005939929589882796.tkk@misasa.okayama-u.ac.jp> References: <83y3p5a71w.fsf@gnu.org> <20171005.185038.2275302121797407783.tkk@misasa.okayama-u.ac.jp> <83y3okqwgp.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 1508132115 29236 195.159.176.226 (16 Oct 2017 05:35:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Oct 2017 05:35:15 +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 Mon Oct 16 07:35:07 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 1e3y3E-0004ql-RF for ged-emacs-devel@m.gmane.org; Mon, 16 Oct 2017 07:34:57 +0200 Original-Received: from localhost ([::1]:59407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3y3I-0005mr-Jp for ged-emacs-devel@m.gmane.org; Mon, 16 Oct 2017 01:35:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3y2i-0005mk-U4 for emacs-devel@gnu.org; Mon, 16 Oct 2017 01:34:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3y2f-0004qM-PO for emacs-devel@gnu.org; Mon, 16 Oct 2017 01:34:24 -0400 Original-Received: from mxl065v67.mxlogic.net ([208.81.65.67]:50734 helo=s14p02o144.mxlogic.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3y2f-0004eK-AU for emacs-devel@gnu.org; Mon, 16 Oct 2017 01:34:21 -0400 Original-Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s14p02o144.mxlogic.net(mxl_mta-8.5.0-1883) with ESMTP id dd444e95.7f60209e0700.128705.00-593.275829.s14p02o144.mxlogic.net (envelope-from ); Sun, 15 Oct 2017 23:34:21 -0600 (MDT) X-MXL-Hash: 59e444dd7b429563-f91ba4e045464911a9a0d51be7831020a43ea05f Original-Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s14p02o144.mxlogic.net(mxl_mta-8.5.0-1883) over TLS secured channel with ESMTP id 2ef34e95.0.128293.00-394.274843.s14p02o144.mxlogic.net (envelope-from ); Sun, 15 Oct 2017 23:13:07 -0600 (MDT) X-MXL-Hash: 59e43fe36fc0050b-8aa2ce94becb3c89a89035f398c75263d7ea5d3a Original-Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 4d36_5566_2011554b_6651_4de3_aa6e_56070bb601e4; Mon, 16 Oct 2017 14:13:05 +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 7FF384C0971; Mon, 16 Oct 2017 14:13:05 +0900 (JST) In-Reply-To: <83y3okqwgp.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-Level: X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0.8 X-NAI-Spam-Rules: 7 Rules triggered TS_MSG_REP_20=0.6, GEN_SPAM_FEATRE=0.1, TRK_NCM1=0.1, EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV6136=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6136> : inlines <6133> : streams <1767445> : uri <2517255> X-AnalysisOut: [v=2.2 cv=ReTgMxlv c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=kj9zAlcOel0A:10 a=02M] X-AnalysisOut: [-m0pO-4AA:10 a=mDV3o1hIAAAA:8 a=oIPwcUfwmNGIC4NCOn4A:9 a=C] X-AnalysisOut: [juIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017101512); S=0.488(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.65.67 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:219565 Archived-At: Thank you for the response. >> M-x about-emacs >> M-<, C-e, C-b >> (posn-at-point) => (# 2 (152 . 0) 0 nil 2 (1 . 0) (image :type png :file "splash.png") (0 . 0) (333 . 233)) >> (set-window-hscroll nil 28) >> (posn-at-point) => nil >> >> This case, I want to estimate height of a line as height of the image >> thus frame-char-height does not work. >> > You can go to end of line and call posn-at-point there, no? Here's a > snippet that works in your case: > > M-: (global-set-key [f5] (lambda () (interactive) (save-excursion (end-of-line) (message "%s" (posn-at-point))))) RET > > Then press F5, and you will see what you need, no? Yes, however, it is not guaranteed if end-of-line is always shown on a screen. I have to know a char that is shown on the screen in advance. I think I can find it by (pos-visible-in-window-p xxx nil t). When a char is shown in the screen, I can get height by (line-pixel-height). When no char is shown, I can assume height as (frame-char-height). Now I see height of the top line remains tall even an image is off. emacs 26.0.90 emacs -Q M-x eww www.gnu.org C-n x 16 (to move to GNU picture) M-: (set-window-hscroll nil 100) M-: (line-pixel-height) ; => 144 (but visually nominal) C-l C-l (locate line of GNU picture to the top of the screen) M-: (line-pixel-height) ; => 144 (visually tall) Is this expected behavior?