From: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
To: eliz@gnu.org
Cc: tkk@misasa.okayama-u.ac.jp, emacs-devel@gnu.org
Subject: Re: line-pixel-height beyond eol
Date: Mon, 16 Oct 2017 14:13:03 +0900 (JST) [thread overview]
Message-ID: <20171016.141303.1005939929589882796.tkk@misasa.okayama-u.ac.jp> (raw)
In-Reply-To: <83y3okqwgp.fsf@gnu.org>
Thank you for the response.
>> M-x about-emacs
>> M-<, C-e, C-b
>> (posn-at-point) => (#<window 55 on *About GNU Emacs*> 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?
next prev parent reply other threads:[~2017-10-16 5:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-12 10:12 line-pixel-height beyond eol Tak Kunihiro
2017-09-12 15:13 ` Eli Zaretskii
2017-09-13 0:24 ` Tak Kunihiro
2017-09-13 15:28 ` Eli Zaretskii
2017-09-13 23:14 ` Tak Kunihiro
2017-09-14 17:53 ` Eli Zaretskii
2017-09-15 1:39 ` Tak Kunihiro
2017-09-15 17:35 ` Eli Zaretskii
2017-09-23 12:57 ` Tak Kunihiro
2017-09-23 13:16 ` Eli Zaretskii
2017-10-05 9:50 ` Tak Kunihiro
2017-10-09 13:31 ` Eli Zaretskii
2017-10-16 5:13 ` Tak Kunihiro [this message]
2017-10-16 16:16 ` Eli Zaretskii
2017-10-17 0:29 ` Tak Kunihiro
2017-10-17 16:37 ` 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=20171016.141303.1005939929589882796.tkk@misasa.okayama-u.ac.jp \
--to=tkk@misasa.okayama-u.ac.jp \
--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.