I want to create a buffer where some parts are editable, but others are not. I'm using the read-only
string property to do this, e.g.:
(with-current-buffer (get-buffer-create "*scratch-demo*")
(insert ";; you can edit me\n")
(insert (propertize
";; but you cannot edit me\n"
'read-only t)))
If I paste the second line into a buffer in fundamental mode, I can edit it.
this buffer is in fundamental mode
;; but you cannot *foo* edit me
However, if I paste the second line into an emacs-lisp-mode buffer, I cannot edit it.
;; this buffer is in emacs-lisp-mode
;; I cannot modify the line below:
;; but you cannot edit me
How can I ensure users can edit text, which has been yanked from read-only portions of my buffer?