emacs-devel
[Top][All Lists]
Advanced

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

Re: line-start?


From: Eli Zaretskii
Subject: Re: line-start?
Date: Thu, 06 Feb 2020 20:25:10 +0200

> From: Bastien <address@hidden>
> Date: Thu, 06 Feb 2020 14:00:26 +0100
> 
> > Something similar to (window-start) but for the current line.
> 
> FWIW, I've found (window-hscroll) which gives me what I want.

If you need a buffer position, then window-hscroll is not what you
want, because it returns the number of columns the window is
hscrolled.  Also, when auto-hscroll-mode is 'current-line', the value
returned by window-hscroll is only correct for the current line,
i.e. the line which includes point.

If you need a buffer position of the first (leftmost) visible
character, then I think you want this instead:

  (nth 1 (posn-at-x-y 0 (cdr (posn-x-y (posn-at-point)))))



reply via email to

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