From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#54488: 29.0.50; move-to-column/overlay-related regression in latest master, perhaps 28? Date: Mon, 21 Mar 2022 21:59:40 +0000 Message-ID: <8735jbc6gj.fsf@gmail.com> References: <87bkxzdccp.fsf@gmail.com> <831qyvfpv4.fsf@gnu.org> <83fsnbfd72.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7765"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 54488@debbugs.gnu.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 21 22:59:10 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nWQ3R-0001rp-Kn for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Mar 2022 22:59:09 +0100 Original-Received: from localhost ([::1]:38804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWQ3Q-0001He-As for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Mar 2022 17:59:08 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWQ3K-0001HS-2u for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2022 17:59:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44759) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nWQ3J-0005XA-Q8 for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2022 17:59:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nWQ3J-0003VV-Q6 for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2022 17:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Mar 2022 21:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54488 X-GNU-PR-Package: emacs Original-Received: via spool by 54488-submit@debbugs.gnu.org id=B54488.164789992913462 (code B ref 54488); Mon, 21 Mar 2022 21:59:01 +0000 Original-Received: (at 54488) by debbugs.gnu.org; 21 Mar 2022 21:58:49 +0000 Original-Received: from localhost ([127.0.0.1]:38656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWQ37-0003V4-Fj for submit@debbugs.gnu.org; Mon, 21 Mar 2022 17:58:49 -0400 Original-Received: from mail-wm1-f46.google.com ([209.85.128.46]:35821) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWQ35-0003Uq-9d for 54488@debbugs.gnu.org; Mon, 21 Mar 2022 17:58:47 -0400 Original-Received: by mail-wm1-f46.google.com with SMTP id v2-20020a7bcb42000000b0037b9d960079so400979wmj.0 for <54488@debbugs.gnu.org>; Mon, 21 Mar 2022 14:58:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=K9LxXlqSDTS0C7IQAmBFV6xQzUeWoqvxOXgWWStlF34=; b=gD1cFxP/mpcKkBUI+dxIYTTDO2699qIgExzQbd7osZtrN5vrHU1AdNQ1jpqyfgUUEf rmcmMxVBXk2qmJKhGTSIauQ582rnqMt+05/IAjM0NMLSWryacsREP/nqH6Jr9Flb0lzG 9XegbXBrQTmi4fcdo1KRRF2/UZlGqQ8txX7AzeYn7g2SpAMXCStRyx8TR4pBsUmY9xMK t1GlnMUAA8F0iqfNtL6T3iCAlgR40oXBVgrK9738V/HXExCPNJQhFJabfkO0e4NSJyps pTJUGaIRgXSbyv1g/Rxr249FpWR/u1ZC3aAD3ByRC4jW+3wYTetvJOiA89kVWPUAfDYG s4PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=K9LxXlqSDTS0C7IQAmBFV6xQzUeWoqvxOXgWWStlF34=; b=UfjuKh0+0GOmX3NFhSekSv7kePYNCCGR1/eqAYivtSJG0biHcfIhgHo4UwxWqZuzYI bUrwfhAnyARCammRRLq79WXUp5ijOYuFJr3wwtZmCvYvb4F37uR2xGjwzKUbxDLQe9zE 5gv7yD+3Q3zt8nHIcRCmgi7KePRwesTPrTnUbeyCMF/b1k+f4soX9jMj2UhmW5PDULu9 7BZMTUCOqLt80Bij9dCYnny5AuIv+STeBX9ypwnHOPHCZxHqwkeYGJtfoI7cA/2Y1Bsw TMc+w1QVDTsplCqiJi5b/xX+X2+jWPwCTz7m4DWDM6NjjUvPKGd9zNIj4OTG6HbuB8sW RQ7Q== X-Gm-Message-State: AOAM533rLlAlkANchD3AOqXym6BXJNTfeR0tvDwrKgf3+d5hqA40NUp8 MqPfxjWXOdrlJR8X1HJQW5k= X-Google-Smtp-Source: ABdhPJzDSE2lyPZIA9MAmqbOn+TniXSXC0GNSnUFro9mHmNlBJomWNUe7TkVDvNPjKGwAvn5mHQK2w== X-Received: by 2002:a05:600c:1c1e:b0:38c:b393:b355 with SMTP id j30-20020a05600c1c1e00b0038cb393b355mr985322wms.92.1647899920936; Mon, 21 Mar 2022 14:58:40 -0700 (PDT) Original-Received: from krug ([87.196.73.141]) by smtp.gmail.com with ESMTPSA id q11-20020adfcd8b000000b001e320028660sm14002166wrj.92.2022.03.21.14.58.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 14:58:40 -0700 (PDT) In-Reply-To: <83fsnbfd72.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 21 Mar 2022 19:05:53 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228724 Archived-At: Eli Zaretskii writes: >> From: Jo=C3=A3o T=C3=A1vora >> Date: Mon, 21 Mar 2022 16:37:18 +0000 >> Cc: 54488@debbugs.gnu.org, Dmitry Gutov >>=20 >> If you are aware of the behaviour change , then I don't see the point=20 >> with coming up with a simpler repro: I'd just be showing what you=20 >> confirmed: that move-to-column now is affected by overlays such >> as company's whereas before (emacs 27.2/28) it didn't. > The questions is: does current-column, move-to-column, etc. on master > indeed report the column number and move to the place whose column > number _on_display_ is as you ask them? If they do, then this is the > correct behavior, and features that expect something else should > adapt. I agree, though bug-compatibility is a thing sometimes :-) Anyway, since you seem to know what changed in Emacs, can you show a snippet which worked in some (presumably wrong) way in 27.1 and now works correctly in master? Maybe that holds some valuable clue.. > But if move-to-column moves to a column that is visually incorrect, > I'd still like a simple reproducer. Hmmm. I tried, but couldn't (with-current-buffer (generate-new-buffer "**test**") (insert "foofoofoo\nbarbarbar\nbazbazbaz") (forward-line -1) (goto-char (line-beginning-position)) (prog1 (let ((o (make-overlay (+ 3 (point)) (+ 6 (point))))) (overlay-put o 'invisible t) (overlay-put o 'display (propertize "BAR" 'face 'highlight)) (goto-char (line-beginning-position)) (let ((p (point))) (move-to-column 3) (buffer-substring-no-properties p (point)))) (pop-to-buffer (current-buffer)))) This constructs an overlay that hides/replaces some text and eventually returns "barbar". If the overlay weren't there it would return "bar", obviously. I don't now if "barbar" is correct. It doesn't look especially correct, but I wouldn't know what to return here either, since the text below is invisible and has probably been skipped over. At any rate, it's exactly the same that 27.1 does, so it's not the problem we're after, I think. So maybe Dmitry has some valuable insight as to how exactly company constructs its overlay or overlays. > Even if one must use company-mode and eglot, can you post a recipe > that doesn't involve their installation via package.el? Suppose I > download the relevant *.el files to my system and manually load them > as needed, can you show a recipe that loads whatever is needed and > then reproduces the issue? Yes, I can do that. But note you still need the clangd executable somewhere in your system to provide the completions. In my system it was just: sudo pacman -S clang but packages exist for most (all?) GNU/Linux distributions and OSs. Then, assuming: ~/Source/Emacs/emacs is a checkout of master Emacs ~/Source/Emacs/company-mode is a checkout of git@github.com:company-mode/= company-mode.git ~/Source/Emacs/eglot is a checkout of git@github.com:joaotavora/eglot.git IMPORTANT: You need Eglot to be checked out at d5c7c40b, before the Eglot "defensive" fix. Then finally, this should set you up and should show you the differences beween 27.2 and master Emacs, where the former works and the latter errors. Obviously in the master version you don't need these 5 loads. $ some-version-of-emacs -Q \ -l ~/Source/Emacs/emacs/lisp/emacs-lisp/eldoc.el \ -l ~/Source/Emacs/emacs/lisp/progmodes/xref.el \ -l ~/Source/Emacs/emacs/lisp/progmodes/flymake.el \ -l ~/Source/Emacs/emacs/lisp/progmodes/project.el \ -l ~/Source/Emacs/emacs/lisp/jsonrpc.el \ -L ~/Source/Emacs/company-mode -l company -f global-company-mode \ -L ~/Source/Emacs/eglot -l eglot.el \ ~/tmp/issue-860/args_out_of_range.c \ -f eglot \ -f display-line-numbers-mode \ -f toggle-debug-on-error=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 The args_out_of_range.c file's contents are ------BEGIN // args_out_of_range.c struct Book { int id; char title[50] } book =3D { 1024, "C" }; int main(int argc, char *argv[]) { // Master errors when typing "book." i.e. // typing the dot after book book return 0; } ------END Hope this helps,=20 Jo=C3=A3o