So I was working in emacs and the suddenly, the slime-repl sbcl says text is read only. Well that's great because now I can't type anything into it. How do I fix?
To change the read-only status of a buffer, use C-x C-q (toggle read-only-mode ). To change file permissions, you can run dired on the file's directory ( C-x d ), search for the file by C-s and use M to change its mode.
If a buffer is read-only, then you cannot change its contents, although you may change your view of the contents by scrolling and narrowing. Read-only buffers are used in two kinds of situations: A buffer visiting a write-protected file is normally read-only.
"Buffer is read-only" can be cured by C-x C-q
but as Drew & phils said,
"Text is read-only" is very different -- it means some part of the buffer has a read-only property.
Try moving away from the read-only part, e.g., to the end of the buffer.
Emacs Lisp Manual > elisp.info > Text > Text Properties > Special Properties
Since changing properties counts as modifying the buffer, it is not possible to remove a `read-only' property unless you know the special trick: bind `inhibit-read-only' to a non-`nil' value and then remove the property. *Note Read Only Buffers::.
thus to erase the entire buffer regardless:
M-: (let ((inhibit-read-only t)) (erase-buffer)) RET
or to remove all properties:
(let ((inhibit-read-only t)) (set-text-properties (point-min) (point-max) ()))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With