mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-04 23:41:37 -05:00
jupyter-insert-latex: Remove modification-hooks from overlays
The modification-hooks added by `org-format-latex` cause the overlay to be deleted whenever it is modified and this will also happen during text property changes which we want to avoid. Since the buffer is read-only anyways, there is no need for this hook.
This commit is contained in:
parent
87f1acbf86
commit
0579dbcd97
1 changed files with 9 additions and 4 deletions
|
@ -357,13 +357,18 @@ image."
|
|||
:matchers ,(plist-get org-format-latex-options :matchers))))
|
||||
(jupyter-with-insertion-bounds
|
||||
beg end (insert tex)
|
||||
;; FIXME: Best way to cleanup these files? Just delete them by reading
|
||||
;; the image data and using that for the image instead?
|
||||
(org-format-latex
|
||||
org-preview-latex-image-directory
|
||||
beg end org-babel-jupyter-resource-directory
|
||||
'overlays "Creating LaTeX image...%s"
|
||||
'forbuffer
|
||||
"ltximg" beg end org-babel-jupyter-resource-directory
|
||||
'overlays nil 'forbuffer
|
||||
;; Use the default method for creating image files
|
||||
org-preview-latex-default-process)
|
||||
(dolist (o (overlays-in beg end))
|
||||
(when (eq (overlay-get o 'org-overlay-type)
|
||||
'org-latex-overlay)
|
||||
(overlay-put o 'modification-hooks nil)))
|
||||
(overlay-recenter end)
|
||||
(goto-char end))))
|
||||
|
||||
;;; Images
|
||||
|
|
Loading…
Add table
Reference in a new issue