emacs-jupyter / jupyter

An interface to communicate with Jupyter kernels.
GNU General Public License v3.0
914 stars 89 forks source link

`org-element-cache` warnings when displaying text with ANSI colours #522

Open MasonProtter opened 5 months ago

MasonProtter commented 5 months ago

MWE on my system:

#+begin_src jupyter-julia :session foo
@info "hi"
#+end_src

#+RESULTS:
: [ Info: hi

After doing this, the *Warnings* buffer pops open and says:

⛔ Warning (org-element-cache): org-element--cache: Unregistered buffer modifications detected (20051 != 19994). Resetting.
If this warning appears regularly, please report the warning text to Org mode mailing list (M-x org-submit-bug-report).
The buffer is: myinit.org
 Current command: nil
 Backtrace:
nil

This only happens if the output has colour codes in it (so far as I can tell at least). I was able to reproduce by restarting my system with emacs -Q and just installing jupyter, not including any special hooks or whatever.

For now, I'm supressing these warnings with

(setq warning-suppress-types (append warning-suppress-types '((org-element-cache))))

This seems to be related to, but slightly(?) distinct from https://github.com/emacs-jupyter/jupyter/issues/522