unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: John Shahid <jvshahid@gmail.com>
Cc: 31966@debbugs.gnu.org
Subject: bug#31966: 27.0.50; auto-complete candidates aren't aligned properly
Date: Mon, 25 Jun 2018 20:27:52 +0300	[thread overview]
Message-ID: <83vaa6rd2f.fsf@gnu.org> (raw)
In-Reply-To: <87muvirdy5.fsf@gmail.com> (message from John Shahid on Mon, 25 Jun 2018 17:08:50 +0000)

tags 31966 notabug
thanks

> From: John Shahid <jvshahid@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.

Thanks.





  reply	other threads:[~2018-06-25 17:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-25 17:08 bug#31966: 27.0.50; auto-complete candidates aren't aligned properly John Shahid
2018-06-25 17:27 ` Eli Zaretskii [this message]
2018-06-25 19:10   ` John Shahid
2018-06-25 19:16     ` Eli Zaretskii
2019-08-21  2:17 ` Stefan Kangas

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83vaa6rd2f.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=31966@debbugs.gnu.org \
    --cc=jvshahid@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).