From: Eli Zaretskii <eliz@gnu.org>
To: emacs-devel@gnu.org, Yuan Fu <casouri@gmail.com>,
Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: Alternative to current-column that counts from visual line beginning
Date: Tue, 29 Dec 2020 08:21:06 +0200 [thread overview]
Message-ID: <9CF22BD8-B889-4859-9119-A054B1084840@gnu.org> (raw)
In-Reply-To: <DEC79EA1-6FDF-43BC-ABEA-E78EFFC0A53C@gmail.com>
On December 29, 2020 7:01:16 AM GMT+02:00, Yuan Fu <casouri@gmail.com> wrote:
>
>
> > On Dec 28, 2020, at 9:40 PM, Stefan Monnier
> <monnier@iro.umontreal.ca> wrote:
> >
> >> to get the column number counting from the visual line beginning.
> Is
> >> there a function that does what I want? If not, maybe we should add
> >> one, or add an argument to current-column.
> >
> > `posn-at-point`?
> >
>
> That works, albeit a bit convoluted comparing to current-column and
> only works when point is visible. Another less legit point is that
> posn-at-point is a bit far-fetched semantically: for me it is more
> about GUI pixel positions than text-based column and line positions.
> All things considered, I still prefer a dedicated function or an
> additional argument to current-column.
>
> Yuan
The concept of "visual line" of some buffer position only makes sense in the context of displaying the buffer in some window. That's because window dimensions and other window-specific aspects, such as faces and overlays, have direct and prominent effect on how physical lines are divided into visual lines.
Therefore, I don't think I understand how can a function exist that reports the "visual column" of a buffer position without telling it the window in which to display that buffer. Could you perhaps outline the algorithm for such a function? Perhaps there is some misunderstanding.
next prev parent reply other threads:[~2020-12-29 6:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-29 2:19 Alternative to current-column that counts from visual line beginning Yuan Fu
2020-12-29 2:40 ` Stefan Monnier
2020-12-29 5:01 ` Yuan Fu
2020-12-29 6:21 ` Eli Zaretskii [this message]
2020-12-29 21:05 ` Yuan Fu
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=9CF22BD8-B889-4859-9119-A054B1084840@gnu.org \
--to=eliz@gnu.org \
--cc=casouri@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.