Subject: bug#76445: 31.0.50; `eww' makes display property sticky

From: Manuel Giraud <[email-masked]>
Date: Fri, 21 Feb 2025 11:04:38 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Manuel Giraud <[email-masked]>
>> Date: Thu, 20 Feb 2025 20:01:04 +0100
>> 
>> Here is a recipe that makes characters typed into a bug report
>> invisible.
>> 
>>    - emacs -Q
>>    - M-x eww <RET> gnu.org <RET>
>>    - M-x report-emacs-bug <RET> foo <RET>
>> 
>> Now in the message buffer for the report, any character you type won't
>> appear.  A previous discussion with Eli on help-gnu-emacs shows that
>> this comes from an incorrect value of `text-property-default-nonsticky'.
>
> Could you see if making this part in eww-mode:
>
>   (setq text-property-default-nonsticky '((face . t) (eww-form . t)
>                                           (field . t))))
>
> set only the buffer-local value of text-property-default-nonsticky
> solves the problem without any regressions in eww-mode itself?

I have lightly tested with the attached patch.  This fixes the issue and
EWW seems to work as usual.  Thanks.
>From 9f56644db64929004cd967f6b8d49c8357286874 Mon Sep 17 00:00:00 2001
From: Manuel Giraud <[email-masked]>
Date: Fri, 21 Feb 2025 11:01:10 +0100
Subject: [PATCH] Fix "disappearing chars" bug#76445

* lisp/net/eww.el (eww-mode): Set the buffer local value of
`text-property-default-nonsticky'
---
 lisp/net/eww.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 18a72e97fcb..1ed1b491c71 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1416,8 +1416,8 @@ eww-mode
   (setq buffer-read-only t)
   ;; Insertion at the first character of a field should inherit the
   ;; field's face, form and field, not the previous character's.
-  (setq text-property-default-nonsticky '((face . t) (eww-form . t)
-                                          (field . t))))
+  (setq-local text-property-default-nonsticky '((face . t) (eww-form . t)
+                                                (field . t))))
 
 (declare-function imagep "image.c")
 (defvar text-scale-mode)
-- 
2.48.1

-- 
Manuel Giraud