I have a read-only file that I open in Emacs. I have created a keyboard shortcut to hide some regions of the file. For example:
(defun hide-beginning ()
(interactive)
(setq buffer-read-only nil)
(put-text-property 1 10 'invisible t)
(setq buffer-read-only t)
)
However, when I exit the buffer with kill-buffer
or rather ido-kill-buffer
, I get the question
Buffer myfile.txt modified; kill anyway? (yes or no)
How can this question be avoided?