From unknown Sun Jun 22 11:45:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22761: Surprising interaction between font-lock, invisible text, and point (self-insert-command and insert behave differently) Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Feb 2016 00:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22761 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22761@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14561003757467 (code B ref -1); Mon, 22 Feb 2016 00:20:02 +0000 Received: (at submit) by debbugs.gnu.org; 22 Feb 2016 00:19:35 +0000 Received: from localhost ([127.0.0.1]:36714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aXeDv-0001wM-0V for submit@debbugs.gnu.org; Sun, 21 Feb 2016 19:19:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43062) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aXeDs-0001w9-NW for submit@debbugs.gnu.org; Sun, 21 Feb 2016 19:19:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXeDm-00044t-CG for submit@debbugs.gnu.org; Sun, 21 Feb 2016 19:19:27 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXeDm-00044p-8p for submit@debbugs.gnu.org; Sun, 21 Feb 2016 19:19:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXeDl-0002M6-AG for bug-gnu-emacs@gnu.org; Sun, 21 Feb 2016 19:19:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXeDh-00044O-Az for bug-gnu-emacs@gnu.org; Sun, 21 Feb 2016 19:19:25 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:52319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXeDh-00044K-16 for bug-gnu-emacs@gnu.org; Sun, 21 Feb 2016 19:19:21 -0500 Received: from [18.189.69.235] ([18.189.69.235]) by mrelayeu.kundenserver.de (mreue005) with ESMTPSA (Nemesis) id 0MXTda-1aTkES442A-00WYXG for ; Mon, 22 Feb 2016 01:19:19 +0100 From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel X-Enigmail-Draft-Status: N1110 Message-ID: <56CA5405.10304@live.com> Date: Sun, 21 Feb 2016 19:19:17 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="t6wVlQPXTI9bMIrhjwfNESbokniVLmdoD" X-Provags-ID: V03:K0:SdmB+Ol20gPeN66Q6+aFL8lUPLY1jwUByEZT/Va/VvRdK1kN9Hu 4LXunBpalyeHAIoq15WK+Ug4ury/mCN9cBCDnQU89KlP3+AA2s6MEWtqXYnJM/37gO+3aUr Ltd0uyfwjxrWpqIW8VieZIW1NOvRP1rbEGMVZgREpWlyK/ZDzUh6YPa8TY6JnQqqgEDi784 1n9//8JkBjJInWN5oMitA== X-UI-Out-Filterresults: notjunk:1;V01:K0:lwKawhM0KsM=:7fVOpYlo4riUcg84lFAcow DZOytFu8c2ZkRvLKHcxu2hRcYaZx6wlqRm2vZBW7peqCzfSI8bDj8i/ZIXh56gi1Zc1o31vIv JBa9ybpvMfhexCUEaUhvnMAJNuPnswN4wHsXNV5hI5fydFsXvDBYL88B4joLU1vOPvNk0ZsNq io2P1keEmAV5hu1hPSSC27Q9zrzV3DE85ieThloJW5FoU9qSa1iTAhS+MC6r6tnyFIVC9tRak aiROeEWC0fzwwL4HHN1ZXeCb1K3zxWPbjtRWtJuMEuJAZtRxib0CpgacglmD41SKUCUq2aKjU nc2nw8ctrKNFhiE7DG+aUNK7fqyhW02pk9DFIz7V6vAC9XDw7hADN3A7KLymSlpc7dxZ8lEDs x4sK2heUHyVvD5y9Kkqou7nAfOrrG55uiJgmmgZ/yrETDnrBQeuHGH7ol/zr0wzM5vbbEhH8p KpVIhjiZAJMLbCBLa1sC76BZiGf3LBOrMYIJfW+86vHCt3rzfpqxH0G//h6zez0B3aAMeet9k 5wqPXy20SrCUDeiMaPn2YILuxeU9xs4MjmUjYPSgKn5i8ucHKyYeHzGdDI3m/SIC8mK4hxm0q vro9qYUKAie6O05ybYzzyiuexLVxrJeoMRicKrXRK3kAlU+WOfcX1VAdO56SlJP2F0jLrxKVY MghL1heim9qOvRLR9Ik5ADashBCiz46VHmEOk3Uf/Tw2ZRUfqAeoobawiL0PgouoB4Ak= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --t6wVlQPXTI9bMIrhjwfNESbokniVLmdoD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, I'm running into problems using font-lock to display certain strings as s= ubscripts. The basic goal is to display =E2=80=98a__b=E2=80=99 as =E2=80=98= ab=E2=80=99 with =E2=80=98b=E2=80=99 vertically offset. Using font-lock t= o make =E2=80=98__=E2=80=99 invisible and to add (display (raise -0.15)) = to =E2=80=98b=E2=80=99 works fine. There is a strange interaction between= self-insert-command and font-lock, however, and the problem does not hap= pen if using =E2=80=98insert=E2=80=99 instead of =E2=80=98self-insert-com= mand=E2=80=99. The problem happens when editing =E2=80=98a_foo_b=E2=80=99 to replace =E2= =80=98foo=E2=80=99 by =E2=80=98bar=E2=80=99 (to get =E2=80=98a_bar_b=E2=80= =99). Removing =E2=80=98foo=E2=80=99 leaves =E2=80=98__=E2=80=99 in the b= uffer, which font-lock recognizes: the whole string gets displayed as =E2= =80=98ab=E2=80=99. Even then, the point is still between the two undersco= res (it hasn't moved after font-lock added the invisible property to the = underscores). Pressing =E2=80=98b=E2=80=99 to start inserting =E2=80=98ba= r=E2=80=99 works fine (I end up with =E2=80=98a_b_c=E2=80=99), except for= one thing: the point gets moved after the second underscore. Thus, press= ing =E2=80=98ar=E2=80=99 to complete =E2=80=98bar=E2=80=99 ends up insert= ing =E2=80=98a_b_arb=E2=80=99. On the other hand, using =E2=80=98M-: (insert ?b)=E2=80=99 to insert the = =E2=80=98b=E2=80=99 of =E2=80=98bar=E2=80=99 leaves the point in the righ= t place. To reproduce: 1. Open a buffer in fundamental-mode 2. Evaluate the following setup code: (progn (setq font-lock-defaults '(nil)) (font-lock-add-keywords nil `((,(concat "[a-z]+\\(__\\)\\([a-z]+\\)= ") (1 '(face nil invisible 'subscript))= (2 '(face nil display (raise -0.25))= )))) (add-to-invisibility-spec 'subscript) (make-local-variable 'font-lock-extra-managed-props) (add-to-list 'font-lock-extra-managed-props 'display) (add-to-list 'font-lock-extra-managed-props 'invisible) (font-lock-mode)) 3. Insert the following text: before_between_after 4. Place the point after =E2=80=98between=E2=80=99; press 7 t= imes, to remove =E2=80=98between=E2=80=99 entirely. 5. Type =E2=80=98between=E2=80=99 (using the key sequence b e t w e e n) Expected result: buffer contains before_between_after Actual result: buffer contains before_b_etweenafter On the other hand, the following protocol works fine: 1-4. Same as before 5. =E2=80=98M-: (insert ?b)=E2=80=99 6. Type =E2=80=98etween=E2=80=99 (using the key sequence e t w e e n) Expected result: buffer contains before_between_after Actual result: buffer contains before_between_after Cheers, Cl=C3=A9ment. --t6wVlQPXTI9bMIrhjwfNESbokniVLmdoD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJWylQFAAoJEPqg+cTm90wj+AwP/jzzaJVZJykcacf1o5hczIR1 MIIC8UwvMMRdfJbNhAlg19pksWPkLY9p3osMP38SjU2SbF+iKDajEfq936FiKtgB 8S9deAipfh4Zih58ejOwueCTH8X4tRHFjotoPhqWey05c3kb9AZz9H9C65qMVU4N 0OV9iD8DuoxGfjJ/04luPOOEtGlW4xXYfAV9072F5F199OWeqyZ69XK+QeUci2gd 6PQC41DvGuiWWNedlDgf5ia1EXBfyNKW9Oc4OL4sxDi3bQTu3IcqLuKEAG2Ey2km vJ0sSMIqW8DGQSoBMhZA4/4lAlwQwSZQdz+Fzk4+wr3T8Peq+aoU41DXKe6pSKSm BTS+XLaUjwSHCLtsqlTbY/9fDBHu/v/tUSi9j0gPYi9GhMv5SEkEVRc2P+l6VOLN uuQRyCuc6ZsyAhSIBWAYTnc98n/JWKT2lfYjKk04l+F5i8Mg0cCe5KPQmvL8uKS1 TpbrLDhFeu+xngrvR9KYxg+x2kcJtLenUrquPQrpe1lyyRVs4opJ8XYOsW1ozTqp 8JSe3tYUpO5fuSZK0yAuOmmfkY3ifINMyQCcHS8BKLkM+8xZOE/+DLEvZMAh0wEq Z3usbiy+LDzp7/zH3DV0pEcagJ8V/Dp1Y1rUqq6jLgOBg1qVBNWcSaXQrhnBtgDn uGGsRMXl9ik4YdRtJvbz =dFQ2 -----END PGP SIGNATURE----- --t6wVlQPXTI9bMIrhjwfNESbokniVLmdoD-- From unknown Sun Jun 22 11:45:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22761: Surprising interaction between font-lock, invisible text, and point (self-insert-command and insert behave differently) Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Feb 2016 15:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22761 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Cc: 22761@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 22761-submit@debbugs.gnu.org id=B22761.145615645421732 (code B ref 22761); Mon, 22 Feb 2016 15:55:01 +0000 Received: (at 22761) by debbugs.gnu.org; 22 Feb 2016 15:54:14 +0000 Received: from localhost ([127.0.0.1]:38222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aXsoP-0005eS-Vs for submit@debbugs.gnu.org; Mon, 22 Feb 2016 10:54:14 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47751) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aXsoO-0005eG-MD for 22761@debbugs.gnu.org; Mon, 22 Feb 2016 10:54:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXsoG-000888-Bz for 22761@debbugs.gnu.org; Mon, 22 Feb 2016 10:54:07 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38331) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXsoG-000884-8U; Mon, 22 Feb 2016 10:54:04 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1178 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aXsoF-0004lG-Ju; Mon, 22 Feb 2016 10:54:03 -0500 Date: Mon, 22 Feb 2016 17:53:55 +0200 Message-Id: <8337skn3l8.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <56CA5405.10304@live.com> (message from =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel on Sun, 21 Feb 2016 19:19:17 -0500) References: <56CA5405.10304@live.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Clément Pit--Claudel > Date: Sun, 21 Feb 2016 19:19:17 -0500 > > The problem happens when editing ‘a_foo_b’ to replace ‘foo’ by ‘bar’ (to get ‘a_bar_b’). Removing ‘foo’ leaves ‘__’ in the buffer, which font-lock recognizes: the whole string gets displayed as ‘ab’. Even then, the point is still between the two underscores (it hasn't moved after font-lock added the invisible property to the underscores). Pressing ‘b’ to start inserting ‘bar’ works fine (I end up with ‘a_b_c’), except for one thing: the point gets moved after the second underscore. Thus, pressing ‘ar’ to complete ‘bar’ ends up inserting ‘a_b_arb’. Did you try binding global-disable-point-adjustment to a non-nil value? From unknown Sun Jun 22 11:45:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22761: Surprising interaction between font-lock, invisible text, and point (self-insert-command and insert behave differently) Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Feb 2016 16:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22761 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 22761@debbugs.gnu.org Received: via spool by 22761-submit@debbugs.gnu.org id=B22761.145615699522776 (code B ref 22761); Mon, 22 Feb 2016 16:04:02 +0000 Received: (at 22761) by debbugs.gnu.org; 22 Feb 2016 16:03:15 +0000 Received: from localhost ([127.0.0.1]:38246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aXsx8-0005vI-Nt for submit@debbugs.gnu.org; Mon, 22 Feb 2016 11:03:14 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:57105) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aXsx7-0005v1-IB for 22761@debbugs.gnu.org; Mon, 22 Feb 2016 11:03:14 -0500 Received: from [18.189.69.235] ([18.189.69.235]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0MORLZ-1ad60l0VAj-005mg6; Mon, 22 Feb 2016 17:03:06 +0100 References: <56CA5405.10304@live.com> <8337skn3l8.fsf@gnu.org> From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Message-ID: <56CB3137.1010300@live.com> Date: Mon, 22 Feb 2016 11:03:03 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <8337skn3l8.fsf@gnu.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IQecTuig8x1MKnL1rnSxxld4E0vl9CE71" X-Provags-ID: V03:K0:tqEpKX+L8+c+9yzHMKgHtoMc2pE2ilFs+uGzMbQGhZjDWOGkw6C nZS1YneuJ7M+Sl05zKav0Yoj9WbEXpdE0c5rgd1uFFEQrriYDVVrDZ9c5xA3xj5HeK7aZW3 HnupKpOsIe+plQGLYjisYb8d9+Wqm3oHl/w6puD31sKoDvrhll98SApiUdOpZzdAggLztU+ 8uNptoV/kZ3HiD3nq/FcA== X-UI-Out-Filterresults: notjunk:1;V01:K0:PCKPJ//gRuc=:djmx6qO3geS9G91MkJOO1v /MKnXErsUktg+meu7qPxS4E/68vk1fGG+L3DyHoAr5var2PX+PO4KHyuWIbilfPcw1ayh2jB5 w3i4OAyG0/eWyVDIne8NYXCPmEHE5Ky5pIda+r+lMPqLOJootNW9mPev87DjyzKpXXYb/AAm7 MBSFn8EvSYNMHCF1wdA3QZiHelE5BzwixhvXTd1SoveM0U6L219RXwXco21EdqctWAPo/6u54 rL5e/IfsSO5+4vfIOVQDP5EmU2TilvsXbcLQjImnyK+Hs1JFNtmIJ/PQTq9t+BJ9OW32nSGEg ydanYtne82XzjHMiUdrhFwooEUCP+IA3WvTFhmcqOLtrxxM/xYo7paAUbPfpxqPYBeoc/0V24 n0r5vjPjXHE9TWYrpowVQO+DIdMAOVBWY3w99heRxbRDprRw11Yod/C3k/jHwgGRcbBPLy2oB Vp708ydbDGRRjDHT5Do4KvTpJN6UQBJYBluzJPH52fnLHDOuVR7ada07CYCl8nbs+6mFboqCx W5BX4FGD38pOMAtESw0QpCrb2+moj+sycd+fqk/csRAMEuFtWNGI9hewmE5Xwa/E5ThGCRq/b qP1NWiXmGo79GQ+9ZiucmsHNAE42g6EfAVw14pPg2fZdmADEWE3+4LIJSndU3v2Sr4hPiaxj6 ArZiqqqK1gaMLxQtbJGHdgp8m//CXNO4j+LSh+FsdNn8t5fT/Zrr5rmu64T2Apsy1Ws4= X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IQecTuig8x1MKnL1rnSxxld4E0vl9CE71 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/22/2016 10:53 AM, Eli Zaretskii wrote: >> From: Cl=C3=A9ment Pit--Claudel Date: Su= n, >> 21 Feb 2016 19:19:17 -0500 >>=20 >> The problem happens when editing =E2=80=98a_foo_b=E2=80=99 to replace = =E2=80=98foo=E2=80=99 by >> =E2=80=98bar=E2=80=99 (to get =E2=80=98a_bar_b=E2=80=99). Removing =E2= =80=98foo=E2=80=99 leaves =E2=80=98__=E2=80=99 in the buffer, >> which font-lock recognizes: the whole string gets displayed as >> =E2=80=98ab=E2=80=99. Even then, the point is still between the two un= derscores (it >> hasn't moved after font-lock added the invisible property to the >> underscores). Pressing =E2=80=98b=E2=80=99 to start inserting =E2=80=98= bar=E2=80=99 works fine (I >> end up with =E2=80=98a_b_c=E2=80=99), except for one thing: the point = gets moved >> after the second underscore. Thus, pressing =E2=80=98ar=E2=80=99 to co= mplete =E2=80=98bar=E2=80=99 >> ends up inserting =E2=80=98a_b_arb=E2=80=99. >=20 > Did you try binding global-disable-point-adjustment to a non-nil=20 > value? I imagine that it would work, but wouldn't it break other parts of Emacs?= The mode to which I'm adding this subscripts feature also uses hideshow,= for example, and I do want the point to be moved out of invisible sectio= ns then. Cl=C3=A9ment. --IQecTuig8x1MKnL1rnSxxld4E0vl9CE71 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJWyzE3AAoJEPqg+cTm90wjupoP/3R356E6IQyfjUkrx5eaaZ55 MiwbuzFOnNk0sL6EP4TXTjaeDz7OxifkbuLVOfjt27IV9kPcNW5fARGcqijGUjGb kPjyZ07b+GTMtuQYASL6VLT1sS9AZ81pDwoJEbTp8Jsj2PTSxOduqqdnlwIyfMiX YKl346YDEYd635znKvzuXiRiiWBlXZq3HYD4y385paRvkm17d0fHyWSOHISoOjqe CY5Ird6cXepm4bms8hn9l/fEL10Xq6mU8IMeTBmvLsnvyTw+iLXMaKCr0jB98S5c JnIXrsV3WOV0gNx4y/FipybMt7qIw0w1FbZTPylfc1JKx1rLbpqBljhUmIEVP0uo /no4zSqjnWOMhJyNIV5aaZjz2e0Ju58qaxJ7R4fy2FolRx7waQowD4d8gQuFGTVR dIN1jgDUjBs9V1S1xbs26hK76XcaPynXKczxDMvt7YbpnGRF/EC7q7Re6wtXxEI0 iS6ulzg8cUbkjCEnd6IB760mxAvEbyCNdwK1UuQSIk++MmXOWWawO8/tcK0akXls DRx7g4zby73gxVBvx1BOXKJHJkA9jlGkMjsy+9vwzxMsB00EsWjg+8LsqXy2mJrZ g3JTO+sUMN+2xFW4Qs4fWpgIDDLtGQddiVgzJSk24qG8Fco77zoQYArwOVyC3/fc m3JMh+nW0SYURo9aMZ7N =L4Rt -----END PGP SIGNATURE----- --IQecTuig8x1MKnL1rnSxxld4E0vl9CE71-- From unknown Sun Jun 22 11:45:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22761: Surprising interaction between font-lock, invisible text, and point (self-insert-command and insert behave differently) Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Feb 2016 16:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22761 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Cc: 22761@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 22761-submit@debbugs.gnu.org id=B22761.145615914226259 (code B ref 22761); Mon, 22 Feb 2016 16:40:02 +0000 Received: (at 22761) by debbugs.gnu.org; 22 Feb 2016 16:39:02 +0000 Received: from localhost ([127.0.0.1]:38271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aXtVm-0006pT-6k for submit@debbugs.gnu.org; Mon, 22 Feb 2016 11:39:02 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39619) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aXtVk-0006p0-I4 for 22761@debbugs.gnu.org; Mon, 22 Feb 2016 11:39:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXtVa-00066y-N4 for 22761@debbugs.gnu.org; Mon, 22 Feb 2016 11:38:55 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXtVa-00066s-Ib; Mon, 22 Feb 2016 11:38:50 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1270 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aXtVZ-0004QW-Gt; Mon, 22 Feb 2016 11:38:50 -0500 Date: Mon, 22 Feb 2016 18:38:41 +0200 Message-Id: <83lh6clmy6.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <56CB3137.1010300@live.com> (message from =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel on Mon, 22 Feb 2016 11:03:03 -0500) References: <56CA5405.10304@live.com> <8337skn3l8.fsf@gnu.org> <56CB3137.1010300@live.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Cc: 22761@debbugs.gnu.org > From: Clément Pit--Claudel > Date: Mon, 22 Feb 2016 11:03:03 -0500 > > On 02/22/2016 10:53 AM, Eli Zaretskii wrote: > >> From: Clément Pit--Claudel Date: Sun, > >> 21 Feb 2016 19:19:17 -0500 > >> > >> The problem happens when editing ‘a_foo_b’ to replace ‘foo’ by > >> ‘bar’ (to get ‘a_bar_b’). Removing ‘foo’ leaves ‘__’ in the buffer, > >> which font-lock recognizes: the whole string gets displayed as > >> ‘ab’. Even then, the point is still between the two underscores (it > >> hasn't moved after font-lock added the invisible property to the > >> underscores). Pressing ‘b’ to start inserting ‘bar’ works fine (I > >> end up with ‘a_b_c’), except for one thing: the point gets moved > >> after the second underscore. Thus, pressing ‘ar’ to complete ‘bar’ > >> ends up inserting ‘a_b_arb’. > > > > Did you try binding global-disable-point-adjustment to a non-nil > > value? > > I imagine that it would work, but wouldn't it break other parts of Emacs? The mode to which I'm adding this subscripts feature also uses hideshow, for example, and I do want the point to be moved out of invisible sections then. If it works, perhaps you could bind disable-point-adjustment (not the global variable) in the insertion commands. In general, insertion in the middle of invisible text is tricky at best. So perhaps you should rethink how you handle this situation -- you could, for example, temporarily remove the entire invisible portion, until the insertion is complete. From unknown Sun Jun 22 11:45:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22761: Surprising interaction between font-lock, invisible text, and point (self-insert-command and insert behave differently) Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Feb 2016 17:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22761 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 22761@debbugs.gnu.org Received: via spool by 22761-submit@debbugs.gnu.org id=B22761.145616261331691 (code B ref 22761); Mon, 22 Feb 2016 17:37:02 +0000 Received: (at 22761) by debbugs.gnu.org; 22 Feb 2016 17:36:53 +0000 Received: from localhost ([127.0.0.1]:38321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aXuPk-0008F5-UA for submit@debbugs.gnu.org; Mon, 22 Feb 2016 12:36:53 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:51007) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aXuPj-0008Es-Gh for 22761@debbugs.gnu.org; Mon, 22 Feb 2016 12:36:52 -0500 Received: from [18.189.69.235] ([18.189.69.235]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0M16aW-1ZezTQ1kGu-00tDu5; Mon, 22 Feb 2016 18:36:44 +0100 References: <56CA5405.10304@live.com> <8337skn3l8.fsf@gnu.org> <56CB3137.1010300@live.com> <83lh6clmy6.fsf@gnu.org> From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Message-ID: <56CB472A.2000608@live.com> Date: Mon, 22 Feb 2016 12:36:42 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <83lh6clmy6.fsf@gnu.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VKe883qL4SAGMa96QbBod2HeEtPmAtL7P" X-Provags-ID: V03:K0:1SWSIAGYFoJJK+lgTrPcOBbaeDtfPfMsJaD+1Abys0c2Rz0tMSO GtTOhdjqdpxc0apd1URS8FMOfplQbvuxGQR+KRC+FS8JOrSu7Sd1brQcn5eIgHTg4puxZj7 IJTYZLty0RBPS4Ee8nTWMli202uoszLESKnTeEaJb8zfc8W6LCuAi9tRzoafdQyYg2ly92p 3cKJ+1+ShDaSbmR6VOL/A== X-UI-Out-Filterresults: notjunk:1;V01:K0:Qo1X9pHfKJ4=:Rw5qxepgWnIo4IzN8n0BcU oACU2w2hdiYq4iw3SwESOBk78arrss4tdc6mdMD7HrfHvEiTor34pDJQScie6iJJsrvQqBhWr e2rMoTREsTRjfZA3d8zXQ5GfWBmkBi60txxOCXid3IhvlW9ue1IpqqCgWryuJBIHLzwS3J1UA oTx4sdm04sls5Di3krW1IleceCWPzodOt8Issep115LH8QfWsF7oM9l+qSB6Vpt94cNYC4efi acOsivopyC7er9NjUPv7ZqGhJM3uOf1meWS+gvMQlwBy7EvJOm7UfLr3MYlFW2YFVu9E1VfEQ oUCtUO/fT4rNz02hcazITnYS94HuG8fcQmJu6sglroHx8K8DY0pEeOslNITmJOsCqn2Jhc4Jk +CsemzvO5e3PQWSIgwYfZtM1WSpSGznmIs+YPsdlRrb9uDop7exZW1/OQl8/7IpWW7GFZvEnu WRKXf8RDNGieWgh9AUtAFUgnEPkqPCzO7EgKdRHSpVEhSuX+Sm1GvQ1Y+GUfFd5glZ8j5Cqqh lh+JUuVPtbPNCtLNy+vb3kjOHorPJhd751NUbAWIy+ozLnt1xjo2lMCI54G4AK11HAMxfzm1O N2SIGnWxNzyIQeTI3JtaUi3pbSw7l1RoHj6aWFjgXv6Ox7Dyl1JeJ7wMpD2uJr+UMmVUlLvw2 wMv/uoGpL5W3azvAAMhJgcZdbHR3ipXY1ALhowewQ+2K8DYM1Rvsau4RMrRjKTENhNuA= X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VKe883qL4SAGMa96QbBod2HeEtPmAtL7P Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/22/2016 11:38 AM, Eli Zaretskii wrote: >> Cc: 22761@debbugs.gnu.org From: Cl=C3=A9ment Pit--Claudel >> Date: Mon, 22 Feb 2016 11:03:03 >> -0500 >>=20 >> On 02/22/2016 10:53 AM, Eli Zaretskii wrote: >>>> From: Cl=C3=A9ment Pit--Claudel Date: >>>> Sun, 21 Feb 2016 19:19:17 -0500 >>>>=20 >>>> The problem happens when editing =E2=80=98a_foo_b=E2=80=99 to replac= e =E2=80=98foo=E2=80=99 by=20 >>>> =E2=80=98bar=E2=80=99 (to get =E2=80=98a_bar_b=E2=80=99). Removing =E2= =80=98foo=E2=80=99 leaves =E2=80=98__=E2=80=99 in the >>>> buffer, which font-lock recognizes: the whole string gets >>>> displayed as =E2=80=98ab=E2=80=99. Even then, the point is still bet= ween the >>>> two underscores (it hasn't moved after font-lock added the >>>> invisible property to the underscores). Pressing =E2=80=98b=E2=80=99= to start >>>> inserting =E2=80=98bar=E2=80=99 works fine (I end up with =E2=80=98a= _b_c=E2=80=99), except for >>>> one thing: the point gets moved after the second underscore. >>>> Thus, pressing =E2=80=98ar=E2=80=99 to complete =E2=80=98bar=E2=80=99= ends up inserting >>>> =E2=80=98a_b_arb=E2=80=99. >>>=20 >>> Did you try binding global-disable-point-adjustment to a non-nil >>> value? >>=20 >> I imagine that it would work, but wouldn't it break other parts of >> Emacs? The mode to which I'm adding this subscripts feature also >> uses hideshow, for example, and I do want the point to be moved out >> of invisible sections then. >=20 > If it works, perhaps you could bind disable-point-adjustment (not > the global variable) in the insertion commands. >=20 > In general, insertion in the middle of invisible text is tricky at=20 > best. So perhaps you should rethink how you handle this situation > -- you could, for example, temporarily remove the entire invisible=20 > portion, until the insertion is complete. Thanks, this is a good idea. It will also be more intuitive for users, pr= obably. I tried to follow the strategy that prettify-symbols-unprettify-at-point = uses, but I kept running into issues; using an overlay seems to work bett= er. The issue described in my OP is still there (when the buffer text is = =E2=80=98__=E2=80=99 and an =E2=80=98a=E2=80=99 is added in the middle (y= ielding =E2=80=98_a_=E2=80=99) the overlay is removed, and Emacs moves th= e point after the second underscore (probably before fontification kicks = in and removes the invisible property?). Still I'm better off, because I = can detect that case and protect against it using disable-point-adjustmen= t. Cheers, Cl=C3=A9ment. --VKe883qL4SAGMa96QbBod2HeEtPmAtL7P Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJWy0cqAAoJEPqg+cTm90wjFAkP/3CCVTQZA6TiTwaXKjqZDG5o ZXRv2yPh1wVo8v1dYfSsbgbL3WxagT/o3DO0hDI7TIrp5eh4swMk3FJtzcgmiCDQ mKid4+TwUsTYfO3zI6DeCoT5D4LNLOVwUKnrmupupgIkIDAMzNZNE7pzyI//b6X/ saDn2YcAx/1KJ1Sj7OwXi9dP4PJAPXttylgWHPuIF5V84B5X6piLy60iLJ6eM0hJ gm4JRU1Ey5xlCWYuHIFWF3zAvQc0E/iOqoRYFAnFOQcLf5jUCZ9gksznzIY1SO4o Y15U9CJkCcznOSQTPZjGwfGz38JgRAXGeN/1HhAmtrZycOd0vtzQ8C+8jq6F3ZKq Z1fOXxi9Qy+O0X5e2oZgTWXg5HD24W1X0xmphnK7Y2Pg5HsFRUghzjyE6lU3Hx6L NaVviZjCvzoAsDu0trpTlJvOjGpBq6FlC8D1pJp9elYdnEiParVV5HUyQ/EE2kWY dKziVZzx7j26YXVfU2al61dbqgmA9O1F6uSQyQCguAyfKNdoMkRbPZhF2EcHXrJv xwR+c++YeiVketDjm165ZWIapWdUgkLWek9UuJ+sggOzkZlH+pO24Vkrpcf8mJ4b kS781G99M7Y8SNtpFyuQ4yFByHL2wE1NmNrD4h+DGsJ8kCXFfZ7p/08J/DHAjrhY lwium2WhJbprexrCZAc8 =BaqF -----END PGP SIGNATURE----- --VKe883qL4SAGMa96QbBod2HeEtPmAtL7P-- From unknown Sun Jun 22 11:45:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22761: Surprising interaction between font-lock, invisible text, and point (self-insert-command and insert behave differently) Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Oct 2019 15:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22761 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Cc: Eli Zaretskii , 22761@debbugs.gnu.org Received: via spool by 22761-submit@debbugs.gnu.org id=B22761.1572450936943 (code B ref 22761); Wed, 30 Oct 2019 15:56:01 +0000 Received: (at 22761) by debbugs.gnu.org; 30 Oct 2019 15:55:36 +0000 Received: from localhost ([127.0.0.1]:51272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iPqJr-0000F9-K2 for submit@debbugs.gnu.org; Wed, 30 Oct 2019 11:55:35 -0400 Received: from quimby.gnus.org ([80.91.231.51]:58754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iPqJq-0000F1-6O for 22761@debbugs.gnu.org; Wed, 30 Oct 2019 11:55:34 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iPqJm-0000Jp-Rb; Wed, 30 Oct 2019 16:55:33 +0100 From: Lars Ingebrigtsen References: <56CA5405.10304@live.com> <8337skn3l8.fsf@gnu.org> <56CB3137.1010300@live.com> <83lh6clmy6.fsf@gnu.org> <56CB472A.2000608@live.com> Date: Wed, 30 Oct 2019 16:55:30 +0100 In-Reply-To: <56CB472A.2000608@live.com> ("=?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel"'s message of "Mon, 22 Feb 2016 12:36:42 -0500") Message-ID: <87lft2rzwt.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel writes: > Still I'm better off, because I can detect that case and protect > against it using disable-point-adjustment. If I skim this thread correctly, I think the conclusion was that there was nothing to fix here, so I'm closing this bug report. Please reopen if that's incorrect. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Cl=C3=A9ment Pit--Claudel writes: > Still I'm better off, because I can detect that case and protect > against it using disable-point-adjustment. If I skim this thread correctly, I think the conclusion was that there was nothing to fix here, so I'm closing this bug report. Please reopen if that's incorrect. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 30 11:55:40 2019 Received: (at control) by debbugs.gnu.org; 30 Oct 2019 15:55:40 +0000 Received: from localhost ([127.0.0.1]:51275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iPqJv-0000FS-Tf for submit@debbugs.gnu.org; Wed, 30 Oct 2019 11:55:40 -0400 Received: from quimby.gnus.org ([80.91.231.51]:58770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iPqJu-0000FI-HB for control@debbugs.gnu.org; Wed, 30 Oct 2019 11:55:38 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iPqJr-0000Jy-OV for control@debbugs.gnu.org; Wed, 30 Oct 2019 16:55:37 +0100 Date: Wed, 30 Oct 2019 16:55:35 +0100 Message-Id: <87k18mrzwo.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #22761 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 22761 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 22761 quit