GNU bug report logs - #31966
27.0.50; auto-complete candidates aren't aligned properly

Previous Next

Package: emacs;

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31966 in the body.
You can then email your comments to 31966 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31966; Package emacs. (Mon, 25 Jun 2018 17:10:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to John Shahid <jvshahid <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 25 Jun 2018 17:10:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: John Shahid <jvshahid <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; auto-complete candidates aren't aligned properly
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.


In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu)
 of 2018-06-25 built on 452af4531e9a
Repository revision: 9f6bb1c2d9cac8ccea129242d6977bc848b3f715
System Description: Ubuntu 16.04.4 LTS

Recent messages:
Saving file /home/jvshahid/Maildir/gmail/[Gmail]/Sent Mail/cur/1529945714.3bdcff2f4b643a69.146f2c17b146:2,S...
Wrote /home/jvshahid/Maildir/gmail/[Gmail]/Sent Mail/cur/1529945714.3bdcff2f4b643a69.146f2c17b146:2,S
Sending...done
[mu4e] Message sent
Making completion list...
Quit [3 times]
[mu4e] Found 4 matching messages
Mark set
Quit
Making completion list...

Configured using:
 'configure 'CFLAGS=-O0 -g3' --without-x'

Configured features:
SOUND NOTIFY GNUTLS LIBXML2 ZLIB THREADS

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: mu4e:view

Minor modes in effect:
  global-magit-file-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  global-auto-complete-mode: t
  global-display-line-numbers-mode: t
  show-paren-mode: t
  display-time-mode: t
  display-battery-mode: t
  global-auto-revert-mode: t
  xterm-mouse-mode: t
  winner-mode: t
  flx-ido-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/jvshahid/.emacs.d/straight/build/go-guru/go-guru hides /home/jvshahid/.emacs.d/straight/build/go-mode/go-guru
/home/jvshahid/.emacs.d/straight/build/go-rename/go-rename hides /home/jvshahid/.emacs.d/straight/build/go-mode/go-rename
/home/jvshahid/.emacs.d/straight/build/seq/seq hides /usr/local/share/emacs/27.0.50/lisp/emacs-lisp/seq
/home/jvshahid/.emacs.d/straight/build/cl-lib/cl-lib hides /usr/local/share/emacs/27.0.50/lisp/emacs-lisp/cl-lib

Features:
(shadow emacsbug magit-extras cl-print bug-reference magit-obsolete
magit-blame magit-stash magit-bisect magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-collab ghub url-http url-gw url-auth
magit-files magit-refs magit-status magit package let-alist url-handlers
magit-repos magit-apply magit-wip magit-log which-func magit-diff
smerge-mode magit-core magit-autorevert magit-process magit-margin
magit-mode git-commit recentf tree-widget magit-git magit-section
magit-utils crm magit-popup log-edit pcvs-util add-log with-editor
async-bytecomp async shell vc-git diff-mode cap-words superword subword
yasnippet-snippets yasnippet hideshow imenu ginkgo-mode go-guru
go-rename go-autocomplete go-eldoc go-mode url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
find-file ffap url-parse url-vars etags xref project dired-aux rfc2104
gnutls network-stream nsm mailalias qp mail-extr sort dabbrev eieio-opt
help-fns windmove flyspell ispell face-remap misearch multi-isearch pp
org-mu4e org-element avl-tree generator org org-macro org-footnote
org-pcomplete pcomplete org-list org-faces org-entities noutline outline
org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table
ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs
org-loaddefs mu4e desktop frameset mu4e-speedbar speedbar sb-image
ezimage dframe mu4e-main mu4e-view cal-menu calendar cal-loaddefs
browse-url gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap
gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range
gnus-win gnus nnheader wid-edit mu4e-headers mu4e-compose mu4e-context
mu4e-draft mu4e-actions rfc2368 smtpmail auth-source eieio eieio-core
eieio-loaddefs sendmail mu4e-mark mu4e-message flow-fill mu4e-proc
mu4e-utils doc-view jka-compr image-mode mu4e-lists mu4e-vars message
rmc puny format-spec rfc822 mml mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr
mailabbrev mail-utils gmm-utils mailheader hl-line fringe cl mu4e-meta
pianobar term/screen term/xterm xterm server cl-seq parinfer-ext paredit
parinfer ediff-merg ediff-wind ediff-diff ediff-mult ediff-help
ediff-init ediff-util ediff mode-local parinferlib flycheck json map
find-func dash flymake-proc flymake mwheel warnings auto-complete-config
auto-complete popup rect dired-x dired dired-loaddefs
display-line-numbers time-date paren time image battery cus-start
cus-load autorevert filenotify xt-mouse edmacro kmacro winner flx-ido
advice flx ido seq seq-25 lsp-ui-autoloads dash-functional-autoloads
lsp-java-autoloads lsp-mode-autoloads edit-indirect-autoloads
parinfer-autoloads ginkgo-mode-autoloads pianobar-autoloads
concourse-mode-autoloads hierarchy-autoloads flx-ido-autoloads
flx-autoloads wgrep-autoloads ac-cider-autoloads request-autoloads
helm-autoloads helm-core-autoloads paredit-autoloads
flycheck-clojure-autoloads flycheck-autoloads cider-autoloads
seq-autoloads spinner-autoloads queue-autoloads clojure-mode-autoloads
go-rename-autoloads ace-window-autoloads avy-autoloads
dockerfile-mode-autoloads s-autoloads yasnippet-snippets-autoloads
yasnippet-autoloads go-autocomplete-autoloads auto-complete-autoloads
popup-autoloads go-eldoc-autoloads protobuf-mode-autoloads
markdown-mode-autoloads go-guru-autoloads yaml-mode-autoloads
etags-select-autoloads magit-autoloads magit-popup-autoloads
git-commit-autoloads with-editor-autoloads ghub-autoloads dash-autoloads
async-autoloads projectile-autoloads pkg-info-autoloads epl-autoloads
go-mode-autoloads debbugs-autoloads cl-lib-autoloads finder-inf
straight-autoloads rx compile comint ansi-color ring cl-extra straight
info tool-bar autoload radix-tree lisp-mnt easy-mmode pcase subr-x
checkdoc regexp-opt thingatpt help-mode easymenu straight-compat
byte-opt elec-pair cl-macs gv cl-loaddefs cl-lib bytecomp byte-compile
cconv mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote inotify multi-tty make-network-process emacs)

Memory information:
((conses 16 466216 505827)
 (symbols 48 48677 317)
 (miscs 40 3644 11158)
 (strings 32 154669 72840)
 (string-bytes 1 4738720)
 (vectors 16 63035)
 (vector-slots 8 1589552 318804)
 (floats 8 538 5497)
 (intervals 56 6435 8244)
 (buffers 992 77)
 (heap 1024 64670 73639))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31966; Package emacs. (Mon, 25 Jun 2018 17:29:02 GMT) Full text and rfc822 format available.

Message #8 received at 31966 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: John Shahid <jvshahid <at> gmail.com>
Cc: 31966 <at> debbugs.gnu.org
Subject: Re: bug#31966: 27.0.50;
 auto-complete candidates aren't aligned properly
Date: Mon, 25 Jun 2018 20:27:52 +0300
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.

Thanks.




Added tag(s) notabug. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 25 Jun 2018 17:29:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31966; Package emacs. (Mon, 25 Jun 2018 19:11:02 GMT) Full text and rfc822 format available.

Message #13 received at 31966 <at> debbugs.gnu.org (full text, mbox):

From: John Shahid <jvshahid <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 31966 <at> debbugs.gnu.org
Subject: Re: bug#31966: 27.0.50;
 auto-complete candidates aren't aligned properly
Date: Mon, 25 Jun 2018 19:10:45 +0000
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)

Thanks for the explanation. I opened a PR on the popup-el github
repository https://github.com/auto-complete/popup-el/pull/116. The PR
does something similar to the following

     (if (functionp 'line-number-display-width) (setq column ...))

is that an acceptable approach or should I use the emacs-major-version
instead ?

>
> 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.

I read the emacs-26 NEWS file and all of this is making more sense now.

>
> Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31966; Package emacs. (Mon, 25 Jun 2018 19:17:02 GMT) Full text and rfc822 format available.

Message #16 received at 31966 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: John Shahid <jvshahid <at> gmail.com>
Cc: 31966 <at> debbugs.gnu.org
Subject: Re: bug#31966: 27.0.50;
 auto-complete candidates aren't aligned properly
Date: Mon, 25 Jun 2018 22:16:39 +0300
> From: John Shahid <jvshahid <at> gmail.com>
> Cc: 31966 <at> debbugs.gnu.org
> Date: Mon, 25 Jun 2018 19:10:45 +0000
> 
> >   (line-number-display-width 'columns)
> 
> Thanks for the explanation. I opened a PR on the popup-el github
> repository https://github.com/auto-complete/popup-el/pull/116. The PR
> does something similar to the following
> 
>      (if (functionp 'line-number-display-width) (setq column ...))
> 
> is that an acceptable approach or should I use the emacs-major-version
> instead ?

Testing for features is better than testing for Emacs versions.
However, I would also suggest to call line-number-display-width only
of display-line-numbers is non-nil (in addition to the fboundp test).




Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Wed, 21 Aug 2019 02:18:01 GMT) Full text and rfc822 format available.

Notification sent to John Shahid <jvshahid <at> gmail.com>:
bug acknowledged by developer. (Wed, 21 Aug 2019 02:18:02 GMT) Full text and rfc822 format available.

Message #21 received at 31966-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: John Shahid <jvshahid <at> gmail.com>, 31966-done <at> debbugs.gnu.org
Subject: Re: bug#31966: 27.0.50;
 auto-complete candidates aren't aligned properly
Date: Wed, 21 Aug 2019 04:17:05 +0200
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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 18 Sep 2019 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.