Open jkitchin opened 6 years ago
Truly interesting bug! I'm way behind on my GH issues but will try to get to this one.
The great report makes it easier.
I don't know if this helps, but I have tracked this down to this line:
(set (make-local-variable 'comint-prompt-read-only) t)
in the call to (inferior-python-mode) in L2746 of python-shell-make-comint, which is eventually called when you try to get the repl from an org src block.
It is really weird. before I make a button, that line is run, the variable is set, and seems to have no effect as I get an interactive repl I can type in. But after I make a button, I get a read-only repl. It is interactive until that line gets run, and after that, it becomes read-only.
Same problem. Very confusing.
In my case I opened ielm
after setting a button in another buffer *ielm*
became readonly.
Setting :rear-sticky t
does not cause this.
I think button-lock-set-button is interacting with org-mode in a strange, and undesirable way.
The issue is that in org-mode, if I have a python src block that uses a session, I can type C-c C-v C-z to access the REPL for that session. However, if I have called a button-lock-set-button command before starting the session, then the REPL buffer is read-only, and unusable. I don't know why button-lock does that since there is no obvious read-only code in button-lock, but if I don't use it then everything is fine.
Steps to reproduce:
Use this init.el file:
Create these two org files:
test.org:
test2.org
Launch emacs: emacs -Q -l init.el test.org
the first block in the first file works as expected. When you add the hook function though, the block in the second file gives a read-only repl. I don't know why.