I'm extending an existing Emacs package and I want to make a part of the buffer not editable (read only). In fact, I want to make only one line in the middle of the buffer editable and I use the following snippet for achieving that:
(put-text-property (point-min) point-before-editable-text 'read-only t) ;; (put-text-property point-after-editable-text (point-max) 'read-only t)
However, I can still put cursor at the beginning of buffer and insert some text which is not the desired behavior.
How can I prevent insertions at the beginning of the buffer?