With glasses-uncapitalize-p, use a display overlay property
authorAugusto Stoffel <arstoffel@gmail.com>
Wed, 17 Apr 2024 18:26:16 +0000 (20:26 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 20 Apr 2024 08:30:13 +0000 (11:30 +0300)
* lisp/progmodes/glasses.el (glasses-make-readable): Use the
'display' property instead of 'after-string', so that one is
able to place the cursor on the uncapitalized character.
(Bug#70441)

lisp/progmodes/glasses.el

index 92de2a2581fc498f8eead7d87bfd142da7a5e35e..18ab4911c89c51f7c0c37242b60335789a8503f4 100644 (file)
@@ -232,8 +232,7 @@ CATEGORY is the overlay category.  If it is nil, use the `glasses' category."
                         (save-match-data
                           (re-search-backward "\\<.")
                           (looking-at glasses-uncapitalize-regexp))))
-             (overlay-put o 'invisible t)
-             (overlay-put o 'after-string (downcase (match-string n))))))
+             (overlay-put o 'display (downcase (match-string n))))))
         ;; Separator change
        (when (and (not (string= glasses-original-separator glasses-separator))
                   (not (string= glasses-original-separator "")))