From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Shahid Newsgroups: gmane.emacs.bugs Subject: bug#31966: 27.0.50; auto-complete candidates aren't aligned properly Date: Mon, 25 Jun 2018 19:10:45 +0000 Message-ID: <87k1qmr8ay.fsf@gmail.com> References: <87muvirdy5.fsf@gmail.com> <83vaa6rd2f.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1529953753 7780 195.159.176.226 (25 Jun 2018 19:09:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 25 Jun 2018 19:09:13 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: 31966@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 25 21:09:09 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fXWrN-0001vc-73 for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Jun 2018 21:09:09 +0200 Original-Received: from localhost ([::1]:48837 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXWtU-0000vI-GS for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Jun 2018 15:11:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXWtG-0000tG-RE for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2018 15:11:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXWtC-0002Yq-NS for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2018 15:11:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXWtC-0002YP-JE for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2018 15:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fXWtC-0004hR-DN for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2018 15:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: John Shahid Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Jun 2018 19:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31966 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 31966-submit@debbugs.gnu.org id=B31966.152995386118051 (code B ref 31966); Mon, 25 Jun 2018 19:11:02 +0000 Original-Received: (at 31966) by debbugs.gnu.org; 25 Jun 2018 19:11:01 +0000 Original-Received: from localhost ([127.0.0.1]:35171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fXWtA-0004h4-Vk for submit@debbugs.gnu.org; Mon, 25 Jun 2018 15:11:01 -0400 Original-Received: from mail-qk0-f179.google.com ([209.85.220.179]:36204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fXWt9-0004gp-Bt for 31966@debbugs.gnu.org; Mon, 25 Jun 2018 15:10:59 -0400 Original-Received: by mail-qk0-f179.google.com with SMTP id a132-v6so1200477qkg.3 for <31966@debbugs.gnu.org>; Mon, 25 Jun 2018 12:10:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=bYJpAk7wLPfHeqp922cySRuTZWxxExjQZmGusrFsdiY=; b=Y8CY3ThsYzrddamr0iIA/thkeObze3/ZGj6jjHfvwu2sSbARh2KYJBj3Bok8vx9a0/ BufCmP1VlYkLfeq98khMpJJYlpZQKM1MWhC9MSf1166DpYgRpoljidGW4abOu2/33e/C PRCyRe+OEsQchfduR2vF7zd5EDfYlSJcfnyhY69hUi9algLrPgdeNKlBXyqxkc41T8uA N76uVi5NwPwjsrL36yzOEo3Zh3JyBEDM6rEKaPxmHG0piTt5ZnOWEzgfyMGnsJYuq+uG 7AF893vrlAWUMAWNJDzBMm/ZEpBtMkN6vc1p7fEUIaDNygA7fRUcGlTG3Jy4T2jeFODH Oy/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=bYJpAk7wLPfHeqp922cySRuTZWxxExjQZmGusrFsdiY=; b=qwF+JZufARy4LfP9a58JmLjH0rgcnlm8BHTVM785eg6SupQCix8IwC0Qe3euO0VM8V UjkPn98HGjmxo3/PYxzTXMkMFGXDqHDkAVLjopijfdcTEPgvwDfC2l+vDzkoICVA9Zov 3G6jQGrVhXLp52WAtM9YNBg/gMTHczJVmXkTqSfJE2sn94OA348O3BYApP1Eoqy7oFiW oFXQVMipN7lW7LVYezkl/IuCwf7j4YvDwkh3kBhH/rr7BIJ+ld0dm7yZSLkxSSwEF2Tf sAiLSj9IameLiDFpkM1pG73xYpE4+DIsCiO9u14bbflRMvV4Yh4UKGUK7DXBmteKZqrt rU7w== X-Gm-Message-State: APt69E3IFAJM5D4wUlz9NJcbtF1dqnHCD5rIFGFbVOF+9I//pXhxfeQb ZjpUp43F/TDmr+GmUi0Zp8sNNXrJ X-Google-Smtp-Source: AAOMgpeidyXPZ1HAwOmJrz72TNDiONUmy384rpMwGkRE2h3Ar9p0+Brc6WCeSzBBouKXnFU1Sieu1A== X-Received: by 2002:ae9:f449:: with SMTP id z9-v6mr2360473qkl.410.1529953853170; Mon, 25 Jun 2018 12:10:53 -0700 (PDT) Original-Received: from 146f2c17b146 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id g57-v6sm13021168qte.52.2018.06.25.12.10.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 12:10:52 -0700 (PDT) In-reply-to: <83vaa6rd2f.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:147817 Archived-At: Eli Zaretskii writes: > tags 31966 notabug > thanks > >> From: John Shahid >> 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.