emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: line-pixel-height beyond eol


From: Tak Kunihiro
Subject: Re: line-pixel-height beyond eol
Date: Thu, 05 Oct 2017 18:50:38 +0900 (JST)

>> > Can you use vertical-motion for that?
>> 
>> After try and error, I learned how to get height of pixel on
>> visual-line using `vertical-motion' and `posn-x-y' as shown below.
>> 
>> However, when (window-hscroll) is large, I cannot get y location of
>> cursor using `posn-x-y'.  Can you give me suggestion how to get y
>> location of cursor even when when (window-hscroll) is large?
> 
> I need to see an example of a situation where you cannot get the Y
> coordinate of the cursor due to a large window-hscroll.  Is it at all
> an interesting situation, or just a theoretical one?  Also, if you
> just use frame-char-height in that case, does that solve the problem?

That happens when I scroll a buffer with an image.  When point in an
image and left edger of the image is out of screen by window-hscroll,
I cannot get (posn-at-point).

Here is an example of a situation.

  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.

Please give me suggestion to get y location of a cursor on the
situation!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]