Subject: [PATCH] With glasses-uncapitalize-p, use a display overlay property
From: Augusto Stoffel <[email-masked]>
To: [email-masked]
Date: Wed, 17 Apr 2024 20:29:56 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

From 5c0e40abb970c2b638f765679d133b1ea307a68e Mon Sep 17 00:00:00 2001
From: Augusto Stoffel <[email-masked]>
Date: Wed, 17 Apr 2024 20:26:16 +0200
Subject: [PATCH] With glasses-uncapitalize-p, use a display overlay property

* 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.
---
 lisp/progmodes/glasses.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/progmodes/glasses.el b/lisp/progmodes/glasses.el
index 92de2a2581f..18ab4911c89 100644
--- a/lisp/progmodes/glasses.el
+++ b/lisp/progmodes/glasses.el
@@ -232,8 +232,7 @@ glasses-make-readable
 			 (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 "")))
-- 
2.44.0