Subject: bug#71405: 30.0.50; separator line in string-edit's *edit string* buffer can be deleted

From: Eli Zaretskii <[email-masked]>
Date: Sat, 08 Jun 2024 16:02:54 +0300

> From: Nicholas Vollmer <[email-masked]>
> Date: Thu, 06 Jun 2024 11:55:01 -0400
> 
> 
> 1. emacs -q
> 2. eval (string-edit "test" "" #'ignore :abort-callback #'ignore)
> 3. In the "*edit string*" buffer delete-backward-char
> 
> Observe the separator line has been deleted.
> Attempting to insert a character will user-error "Text is 
> read-only".

Does the patch below give good results?

diff --git a/lisp/textmodes/string-edit.el b/lisp/textmodes/string-edit.el
index 03be426..2a96289 100644
--- a/lisp/textmodes/string-edit.el
+++ b/lisp/textmodes/string-edit.el
@@ -58,7 +58,8 @@ string-edit
                              (list 'intangible t
                                    'face 'string-edit-prompt
                                    'read-only t))
-        (insert (propertize (make-separator-line) 'rear-nonsticky t))
+        (insert (propertize (make-separator-line)
+                            'read-only t 'rear-nonsticky t))
         (add-text-properties (point-min) (point)
                              (list 'string-edit--prompt t))))
     (let ((start (point)))