Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(Emacs) Text is read only?

Tags:

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?

like image 976
Fderal Avatar asked Jul 04 '14 00:07

Fderal


People also ask

How do I get out of read-only in Emacs?

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.

What is a read-only buffer?

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.


1 Answers

"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) ())) 
like image 86
Devon Avatar answered Sep 20 '22 07:09

Devon