-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Evil Mode: code-cells-convert-ipynb not always called #24
Comments
I did some further digging, evil (evil-define-command evil-edit (file &optional bang)
"Open FILE.
If no FILE is specified, reload the current buffer from disk."
:repeat nil
(interactive "<f><!>")
(if file
(find-file file)
(revert-buffer bang (or bang (not (buffer-modified-p))) t))) In particular, it results in a call to
In particular,
Hence (add-hook 'after-revert-hook 'code-cells-convert-ipynb) Now, evil To make both I don't really have experience in that, but will possibly get around to tinkerting. |
Okay, thanks for the extra info. I'm not quite sure what do say about this, and at first sight it seems like a problem in evil. Why would people expect Anyway, how about |
Hi, thanks for the suggestion. Unfortunately, The first |
Dear Maintainer,
I stumbled across the following strange behavior when using code-cells with evil mode:
Description
When invoking
:e!
(equivalent torevert-buffer
) from evil mode in an.ipynb
file, the raw JSON is opened.Steps to Reproduce
.ipynb
file in emacs with code-cells installed and evil mode enabled: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 userevert-buffer
instead of evil:e!
.Apparently, calling
:e!
is not equivalent to calling emacs nativerevert-buffer
. With:e!
the hook installed inauto-mode-alist
here is not invoked, whereas withrevert-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 :)
The text was updated successfully, but these errors were encountered: