Skip to content

Evil Mode: code-cells-convert-ipynb not always called #24

Open
@tropf

Description

@tropf

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

  1. Open any .ipynb file in emacs with code-cells installed and evil mode enabled
  2. The notebook will be opened and converted with jupytext
  3. (here one would do some work)
  4. 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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions