bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#18385: 24.3.93; posn-at-point doesn't account for tab-width


From: Dmitry Gutov
Subject: bug#18385: 24.3.93; posn-at-point doesn't account for tab-width
Date: Wed, 03 Sep 2014 03:30:10 +0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.93 (gnu/linux)

Hi Eli,

Thanks for the detailed explanation.

Eli Zaretskii <eliz@gnu.org> writes:

> "Character number in that row".  IOW, it counts characters, not visual
> columns.  This function, and the data in its POSITION argument which
> it accesses, are designed to make it easy to find the glyph (or
> "display element") in a screen line, so it simply provides the ordinal
> number of the "thing at point" on its screen line, disregarding the
> screen dimensions of that thing.

Okay, if character widths are "applied" after the glyphs to be displayed
are collected, I guess this makes a certain amount of sense.

Is this value useful, though? Since the visual buffer contents are
inaccessible from Lisp, I believe this value wouldn't be properly
correct in most contexts, even in tty, where the major pitfalls you
described can't happen.

AFAICS, this function is only called in two places in Emacs code:

- From `line-move-partial', where I don't understand what it does.
- From `proced-sort-header', where the caller apparently just assumes
  there are no multiple-width characters on that line.

So, was the decision not to return current-column-like value made due to
performance considerations?

> And you were right to resolve that by using posn-col-row instead.
> That function translates pixel coordinates into row/column units,
> which is much closer to what you want.

Thanks, that's good to know.





reply via email to

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