emacs-jupyter / jupyter

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

Fix jupyter-org--parse-latex-element again #514

Closed akirakyle closed 7 months ago

akirakyle commented 7 months ago

Upstream org commit 4fcdcb4 changed the behavior of org-element-context which now uses org-element-deferred-create which is incompatible with inserting elements created from with-temp-buffer outside its scope.

Note that the first error I ran into which led to this PR was actually

Jupyter: I/O subscriber error: (error "‘org-element-at-point’ cannot be used in non-Org buffer #<buffer  *temp*> (fundamental-mode)")

which at first I thought was related to #492 which is due to upstream org commit f135954, however I realized that that issued seemed to be fixed in master already and simply adding a call to (org-mode) in jupyter-org--parse-latex-element fixed that error but exposed this deeper one which I had missed since I upgraded from a commit prior to 4fcdcb4 past commit f135954.

Note that this is the same as #497, except I wasn't paying attention when I created PR #497 from my fork's master instead of a branch.