From: Yuri D'Elia <wavexx@thregr.org>
To: emacs-devel@gnu.org
Subject: Re: Getting column position accounting for overlays
Date: Wed, 5 Aug 2015 11:10:59 +0200 [thread overview]
Message-ID: <55C1D323.50505@thregr.org> (raw)
In-Reply-To: <83a8u6tplx.fsf@gnu.org>
On 05/08/15 04:51, Eli Zaretskii wrote:
>> From: Yuri D'Elia <wavexx@thregr.org>
>> Date: Tue, 4 Aug 2015 22:01:24 +0200
>>
>> Is there a quick way (without iterating through 'display overlays) to
>> get the current column position for the displayed text?
>
> What is "the current column position"? How do you define a "column"
> when text can include variable-size fonts and images?
>
> One answer to your question is posn-at-point, but I'm not sure that is
> what you want.
I expected such question ;)
I'd like the equivalent of (current-column), or character length between
(beginning-of-line) and cursor position [modulus tabs], but using the
actual displayed overlays.
I would almost have expected something to extract the visualized string
between two points, like `buffer-substring' but iterating through
overlays; but couldn't find any (did I miss it?)
(posn-col-row (posn-at-point)) "would" work, but 1) seems inefficient,
especially considering I don't care about variable-pitch fonts and 2)
doesn't work if the point is not visible.
next prev parent reply other threads:[~2015-08-05 9:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-04 20:01 Getting column position accounting for overlays Yuri D'Elia
2015-08-05 2:51 ` Eli Zaretskii
2015-08-05 9:10 ` Yuri D'Elia [this message]
2015-08-05 15:21 ` Eli Zaretskii
2015-08-05 18:44 ` Yuri D'Elia
2015-08-05 19:01 ` Eli Zaretskii
2015-08-07 17:13 ` Yuri D'Elia
2015-08-07 18:19 ` Eli Zaretskii
2015-08-08 14:31 ` Yuri D'Elia
2015-08-08 14:45 ` Eli Zaretskii
2015-08-08 15:19 ` Yuri D'Elia
2015-08-08 15:43 ` Eli Zaretskii
2015-08-08 16:29 ` Yuri D'Elia
2015-08-08 16:48 ` Eli Zaretskii
2015-08-08 17:22 ` Yuri D'Elia
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=55C1D323.50505@thregr.org \
--to=wavexx@thregr.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.