From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Moving point around empty overlays with 'after-text Date: Tue, 11 Apr 2023 16:41:00 +0700 Message-ID: References: <9b1654ec-1ac6-4936-860b-2d77dcc4dac7@app.fastmail.com> <28954f0d-205d-b322-4a43-cf4481d1266e@gmail.com> <3a1bb709-d00f-49b8-a2c5-d0ac5b6a82c4@app.fastmail.com> <22b315db-39eb-80b6-1a7c-127f5e703dc1@gmail.com> <83o7nwl4ig.fsf@gnu.org> <571d4b51-a29f-23a6-5b29-ca5870af1c8f@gmail.com> 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="32164"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , help-gnu-emacs@gnu.org To: Platon Pronko Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 11 11:41:53 2023 Return-path: Envelope-to: geh-help-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 1pmAVd-0008DW-H6 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 11 Apr 2023 11:41:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pmAV4-0005xY-K8; Tue, 11 Apr 2023 05:41:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pmAV3-0005xN-2N for help-gnu-emacs@gnu.org; Tue, 11 Apr 2023 05:41:17 -0400 Original-Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pmAUz-0004Op-O1; Tue, 11 Apr 2023 05:41:16 -0400 Original-Received: by mail-wr1-x435.google.com with SMTP id l18so6814047wrb.9; Tue, 11 Apr 2023 02:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681206071; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=S2bm2+hkI00/JRJYulURtwjLZtps6R/EuvVzyqNmfBk=; b=TgoIYbl0XT9yOlKYh17rZ3Na1HjIgUqa9KUWJQVFNAX9QQCGx/I0mls0EdsuN9+TDf eLqerl//3xtc9dEKwHPvOLidve+EPUvVcQStSCq7YbJz8Cezwt9qSvnuvRk9sDl1Xt6N JSju9K24LvlZlMxZL/aEU+JSOppMmfLjxE33KFsJm0UZUfWs4y0NZSu9yhXlSMLTE3g0 uhCoSFH+XHfL67MDFQiXfcDE/WJzihQxBcwGX1SHD00VpcqoLfTgB9KWiu6c/Z9EUEXM 9pZdwSNbKgBGYZkU00c4o4VXN9n16ThZ2v2Y+e6Atpgi77glgF6t4npy4h7LnTkyqrq8 rpIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681206071; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S2bm2+hkI00/JRJYulURtwjLZtps6R/EuvVzyqNmfBk=; b=bA59613vlSr/la1O2m/Mk0qyk0dGWmPG3rzcBF1eKsifKo+aPpaUFdCdJnuaFpTpIt F1MxkVBnXzo/CFSrw7TBndWJZ0M/Q8/+a8iij+4KoGMQFxqhsM4VXDzzHHqZQmK+Gxb0 uqa9bxrcdgScVaAmFyxIlU/rqQYRtZ1bgZa8oVk9TT1rXd20dQ7I2IJw0iKbjE6b9GgN LarLyPOwD/Te/122sgEzMGRq3KH9L3e4Vfnvk6AV5Ucg51qKE8vi2kY2Y2b98cwBE9qG ua2cWl/3TKYzyeuDJ7aOoVGxYIiJXS9WYfEHeUEQ9q/mjCWemHxzXa4/ikvtBsci/OFL /6Vw== X-Gm-Message-State: AAQBX9dOoAnhUEDIx6+cS2Ql0t+7PN/0VLEFSFE29CqVhKOTwInxHf/U MUZGhZOKwcy1FvxJVTOwmWXitW/yqlPka6H52Hb58gnFbNr6FddM X-Google-Smtp-Source: AKy350ZKlBeJ5AuueLIuCQn5NTWzKU0KzNXXejoVpfbKwOacqrPwhjvsGha/Xy1gvKy+JG2yBzsDlFdLNqVwTCLZc7w= X-Received: by 2002:a5d:4942:0:b0:2f1:9b7e:5ad6 with SMTP id r2-20020a5d4942000000b002f19b7e5ad6mr1187167wrs.11.1681206071429; Tue, 11 Apr 2023 02:41:11 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=yurivkhan@gmail.com; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143253 Archived-At: On Tue, 11 Apr 2023 at 15:49, Platon Pronko wrote= : > I'm talking more about the user intention, before he actually types anyth= ing, and consequently the confusion he will temporarily experience when he = will try to execute this intention. We here in Emacs mailing list understan= d the internals quite well and thus can understand that the overlay is zero= -width and cursor position is actually the same on both sides. Less-enlight= ened user won't - for him the inlay is something tangible, present in the b= uffer the same way as the characters are present in the buffer. Then the less-enlightened user is screwed, because treating the inlay text as ordinary code may teach them wrong syntax. Example 1: C++ does not have named arguments, but inlays will still show them. And, presumably, not in /* comment markers */. Example 2: In Python, named arguments are allowed only after all the positional arguments. If a user sees test(a1=3D42) and does not realize =E2=80=9Ca1=3D=E2=80=9D is an inlay, they may try to prepend an explicitly = named a0=3D3.14 argument and be stumped at a syntax error message for =E2=80=9Ctest(a0=3D3.= 14, 42)=E2=80=9D. > And in the discussed example the user can have two different intentions: > > [=E2=80=A6] > > Intention 2: prepending another argument. In this case he will want to po= sition the cursor before the overlay: > > test(a1=3D42) Yes, but in order to consistently act on this intention, the editor must insert the argument separator as soon as a character is inserted before the inlay, and also be prepared to deal with the user typing it in manually after the argument value. > // User tries to type "a0=3D1," (let's imagine there was such an argument= ) > test(aa1=3D42) > // More typing > test(a0=3D1,a1=3D42) All that said, I think it may be considered an argument in favor of suppressing the inlay when the point is adjacent to it, the same way prettify-symbols-unprettify-at-point does for prettify-symbols-mode.