all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Bastien <bzg@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: line-start?
Date: Thu, 06 Feb 2020 20:25:10 +0200	[thread overview]
Message-ID: <83o8ubfu9l.fsf@gnu.org> (raw)
In-Reply-To: <877e0zrhud.fsf@gnu.org> (message from Bastien on Thu, 06 Feb 2020 14:00:26 +0100)

> From: Bastien <bzg@gnu.org>
> 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	other threads:[~2020-02-06 18:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06 10:24 line-start? Bastien
2020-02-06 13:00 ` line-start? Bastien
2020-02-06 18:25   ` Eli Zaretskii [this message]
2020-02-07  6:42     ` line-start? Bastien
2020-02-07  9:20       ` line-start? Eli Zaretskii
2020-02-07 10:11         ` line-start? Bastien
2020-02-07 10:24           ` line-start? Eli Zaretskii
2020-02-07 10:48             ` line-start? Bastien
2020-02-07 13:43               ` line-start? Eli Zaretskii
2020-02-07 14:46                 ` line-start? Bastien
2020-02-07 15:56                   ` line-start? Eli Zaretskii
2020-02-07 17:42                     ` line-start? Bastien

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=83o8ubfu9l.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=bzg@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.