(Emacs) Text is read only?

前端 未结 7 890
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-04 06:56

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?

7条回答
  •  别跟我提以往
    2021-02-04 07:18

    "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) ()))
    

提交回复
热议问题