millejoh / emacs-ipython-notebook

Jupyter notebook client in Emacs
http://millejoh.github.io/emacs-ipython-notebook/
GNU General Public License v3.0
1.47k stars 122 forks source link

error: Text is read-only #721

Closed sam-s closed 4 years ago

sam-s commented 4 years ago

only trivial evaluation (e.g., 1+1) works, anything more complicated results in:

ein:worksheet-execute-cell-km: Text is read-only [2 times]
ein:worksheet-execute-cell-km: Text is read-only
ein:notebook-save-notebook-command-km: Text is read-only

(with the most recent version from elpa, ein-20200531.22)

willthefrog commented 4 years ago

same problem here, seems to be caused by latest exec-path-from-shell, works fine after downgrade it to previous version

sam-s commented 4 years ago

it appears that all newlines inserted into a cell are read-only (or become readonly very quickly). also, restarting emacs does not help

dickmao commented 4 years ago

I don't doubt that it's happening, but until you follow the README for filing a bug, it's impossible for me to help you (since I can't reproduce it).

deactivated commented 4 years ago

I started running into this (or a related issue) recently.

In my case, I traced it back to a recent re-implementation of json-encode-string: https://github.com/emacs-mirror/emacs/blame/81aed7becfdc66af464e54c90680e9507693bdaf/lisp/json.el#L442

The implementation changed from using string/list operations to operating on a persistent temporary buffer. When you attempt to encode a propertized string, it's possible for the temporary buffer to end up read-only. I worked around the issue locally by patching line json.el:442 to be (insert ?\" (substring-no-properties string)).

You can check if you're encountering the same issue by running (switch-to-buffer json--string-buffer).

sam-s commented 4 years ago

@deactivated -- thank you very much, I fixed the bug in Emacs git.