GNU bug report logs -
#31966
27.0.50; auto-complete candidates aren't aligned properly
Previous Next
Reported by: John Shahid <jvshahid <at> gmail.com>
Date: Mon, 25 Jun 2018 17:10:02 UTC
Severity: minor
Tags: notabug
Found in version 27.0.50
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
Message #21 received at 31966-done <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> tags 31966 notabug
> thanks
>
>> From: John Shahid <jvshahid <at> gmail.com>
>> Date: Mon, 25 Jun 2018 17:08:50 +0000
>>
>> The candidates in the auto-complete popup aren't aligned properly. The
>> left margin appears to be shifted to the right relative to the
>> point. This seems to be caused by `vertical-motion' behavior changing on
>> master.
>>
>> when display-line-numbers is turned on I expect the following to move
>> the point to the following line while keeping the point's column fixed
>> (assuming of course that the following line is long enough):
>>
>> (vertical-motion (cons (car (posn-col-row (posn-at-point))) 1))
>>
>> This isn't the case anymore with current master. Point will move to the
>> right by the number of characters used to display the line numbers.
>
> (The emacs-26 branch behaves like master now, btw.)
>
> This is not a bug. posn-at-point doesn't measure columns, it measures
> the X coordinate relative to the window edge, and just expresses it in
> columns, so the result includes the width taken by the line-number
> display. If you need to get at the column number relative to the
> leftmost text character, use current-column. And if you want the
> result in canonical columns, i.e. in units of width of the frame's
> default face's font (as opposed to the font used by buffer text near
> point), then subtract from what posn-at-point returns the value
> returned by the following function call:
>
> (line-number-display-width 'columns)
>
> The code you show used to work because there was a bug which masked
> this issue, and that bug is now fixed on both master and the emacs-26
> branch.
This was tagged notabug over a year ago, and indeed doesn't seem to be
a bug. I'm therefore now closing this bug report.
Thanks,
Stefan Kangas
This bug report was last modified 5 years and 279 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.