Description
Dear Maintainer,
I stumbled across the following strange behavior when using code-cells with evil mode:
Description
When invoking :e!
(equivalent to revert-buffer
) from evil mode in an .ipynb
file, the raw JSON is opened.
Steps to Reproduce
- Open any
.ipynb
file in emacs with code-cells installed and evil mode enabled - The notebook will be opened and converted with jupytext
- (here one would do some work)
- revert the buffer by typing
:e!
Expected Behavior
The buffer is reverted and the converted (readable) notebook is displayed.
Actual Behavior
The buffer is reverted, and the raw .ipynb
file is opened, in my case in JSON-mode.
It is not human-readable.
Notes
Workaround is to manually call code-cells-convert-ipynb
or use revert-buffer
instead of evil :e!
.
Apparently, calling :e!
is not equivalent to calling emacs native revert-buffer
. With :e!
the hook installed in auto-mode-alist
here is not invoked, whereas with revert-buffer
it is. (wtf)
I am not sure if this is not the right hook, or if evil is weird. (I would not expect such a bug in a large package as evil.)
Unfortunately, I don't know which other hook might be correct. Maybe some emacs wizard can do some digging?
Either way, thanks for the package :)