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: Wed, 23 Mar 2022 10:10:46 +0000 Message-ID: <87fsn9f07t.fsf@gmail.com> References: <87bkxzdccp.fsf@gmail.com> <831qyvfpv4.fsf@gnu.org> <83fsnbfd72.fsf@gnu.org> <8735jbc6gj.fsf@gmail.com> <6095582d-7065-8089-e8c7-857f070f8ce2@yandex.ru> <87y212b9nt.fsf@gmail.com> <83a6difahu.fsf@gnu.org> <835yo6f5tu.fsf@gnu.org> <834k3qf48k.fsf@gnu.org> <87r16uavhm.fsf@gmail.com> <83zglidnbs.fsf@gnu.org> <83y212dj2w.fsf@gnu.org> <83mthhe3rp.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="3066"; 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 Wed Mar 23 11:10:38 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 1nWxws-0000au-5e for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Mar 2022 11:10:38 +0100 Original-Received: from localhost ([::1]:34276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWxwq-0003Bo-KM for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Mar 2022 06:10:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWxwJ-0003Be-4o for bug-gnu-emacs@gnu.org; Wed, 23 Mar 2022 06:10:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48907) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nWxwI-0002Pl-QE for bug-gnu-emacs@gnu.org; Wed, 23 Mar 2022 06:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nWxwI-0006ON-L7 for bug-gnu-emacs@gnu.org; Wed, 23 Mar 2022 06:10:02 -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: Wed, 23 Mar 2022 10:10:02 +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.164803019224537 (code B ref 54488); Wed, 23 Mar 2022 10:10:02 +0000 Original-Received: (at 54488) by debbugs.gnu.org; 23 Mar 2022 10:09:52 +0000 Original-Received: from localhost ([127.0.0.1]:42803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWxw7-0006Ng-UH for submit@debbugs.gnu.org; Wed, 23 Mar 2022 06:09:52 -0400 Original-Received: from mail-wm1-f41.google.com ([209.85.128.41]:51727) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWxw6-0006NU-Ca for 54488@debbugs.gnu.org; Wed, 23 Mar 2022 06:09:50 -0400 Original-Received: by mail-wm1-f41.google.com with SMTP id q20so608047wmq.1 for <54488@debbugs.gnu.org>; Wed, 23 Mar 2022 03:09:50 -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=kJesajSsA0PS933x56JEkS0IHBxTSPwgmjY0ykUO7Qg=; b=MFjGkUwUlMAliIy6EkI/8R9uN9QnOayXvVVlhm4o6F6YRzOCiEIGjxRv6M0GOhkWFK eyf1beNvifu3rroOFNGDqW4z2PovxqRD/dQxXEOMb32qm/Xg8f4BOhkMHJGtvknPCn0D gRa6UwdWLiBGzusJp37+01WlgkDseEgztteM+6JvOR8gWs199Rm0jq2pHWTD46xu6mQR DXw8rETF2RvxzGP4ZOg0Xs13COyXOtWFxUzopybi/6z+O7Wb48+uD8okt+cuzmmgMCnw ls1oGg9Fhw+Ojvc58/2ke9JJjA32LShI22fby2dLGiUA7wv6OJLh4iy8b4xjtiE2JYSN 5RWw== 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=kJesajSsA0PS933x56JEkS0IHBxTSPwgmjY0ykUO7Qg=; b=NaEda0nYtxCrvhyd5rjkMXO+b54d6NVoaMXHN6ZaO55VSc7wNYuCefAAqWdltn+td/ zXYbC1/I3h9x7mcpib+AUegJwU70n+zYKdclj/UArDH/UKLnQyR0JuZlJ6llSL0KnU/+ bUmME9OG4uYxwTrcdcKWNnydKrL4nleoXoEjtOJNZUvv31wdX0VgChcScyfRAUX9AufI 4gjuBMw7XdOGrvNUfn3CaZU8yBgHMk6+GiYfZvuxQxC+bwdzUT1RhXv2P5dBEOKnpz6Y 1rZmkr22Ag9HU3Oha4b04xNfKBGJ4y9q6grpaSognXP42kxDOoltl5AKDCgRt2dyXB0V kCbQ== X-Gm-Message-State: AOAM531d6R8DJ8LYCjdVlp85OX5US0CSxslrFgodVIoITcFB7kn8rPWs wGeqoHbhe57Xa7hNieyeKUHARIDzhhvPAQ== X-Google-Smtp-Source: ABdhPJzkF2iCNlFArDVKHtFZPnya8YPQUGgWFD7FSGeTe7Qj3wJu05ApercGpGvG9RGCAcMUPFq1nw== X-Received: by 2002:a05:600c:3482:b0:38c:40:9b30 with SMTP id a2-20020a05600c348200b0038c00409b30mr8494125wmq.68.1648030184334; Wed, 23 Mar 2022 03:09:44 -0700 (PDT) Original-Received: from krug (87-196-72-45.net.novis.pt. [87.196.72.45]) by smtp.gmail.com with ESMTPSA id z12-20020a5d4d0c000000b002057d6f7053sm2614872wrt.47.2022.03.23.03.09.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 03:09:43 -0700 (PDT) In-Reply-To: <83mthhe3rp.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 23 Mar 2022 05:39:22 +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:228794 Archived-At: Eli Zaretskii writes: >> From: Jo=C3=A3o T=C3=A1vora >> Date: Wed, 23 Mar 2022 01:11:21 +0000 >> Cc: Eli Zaretskii , 54488@debbugs.gnu.org >>=20 >> Tabs? >>=20 >> Aha! yup. This idea won't fly. Thanks, Dmitry, I was about to push tha= t=20 >> happily, but people definitely use tabs in their source code.=20=20 > > How do you know to which column to move when tabs are involved? If > clangd assumes a tab is at a multiple of 8, and the user has tab-width > customized to a different value, you will end up in a wrong place > anyway. So this case should already cause problems, and if not, > there's some code somewhere that handles it; let it handle it now with > forward-char as well. As I explained before, move-to-column is only used to obtain an upper bound of a (binary) search backwards. That search is for the "LSP-abiding" column, which is tricky and based on UTF-16 code units even though the file is usually UTF-8 encoded. The gory details are all in this issue https://github.com/joaotavora/eglot/pull/125 from 2018. So if I start using forward-char, my upper bound will be unnecessarily conservative. The whole thing won't be wrong but slower. And because there can be very many diagnostics and things being annotated in positions, it can make a difference. I benchmarked it at the time. I also think you're supposed to agree with the LSP server about tab-width and stuff. I just keep my tabs at 8 like They intended and I don't have that problem, because at least clangd correctly assumes that default. Jo=C3=A3o PS: I do invite you to read that old Eglot issue. Since you're an expert on coding system conversion, maybe you know of a better, faster way to find the correct LSPish column in an Emacs buffer. Maybe the whole search idea is completely overwrought.