(Emacs) Text is read only?

前端 未结 7 1043
爱一瞬间的悲伤
爱一瞬间的悲伤 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:19

    I can't offer any insight into why you ended up with undesirable read-only text properties, but I occasionally encounter similar situations and so find the following command useful.

    Select the region in question (or C-xh for the entire buffer), and run M-x set-region-writeable to remove the read-only text properties.

    (defun set-region-writeable (begin end)
      "Removes the read-only text property from the marked region."
      ;; See http://stackoverflow.com/questions/7410125
      (interactive "r")
      (let ((modified (buffer-modified-p))
            (inhibit-read-only t))
        (remove-text-properties begin end '(read-only t))
        (set-buffer-modified-p modified)))
    

提交回复
热议问题