From b338a906982eb53b390a436d2fb2a5f53288a454 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Tue, 19 Mar 2024 17:44:00 +0300 Subject: [PATCH] org-create-math-formula: Do not run file-related hooks when checking output * lisp/org.el (org-create-math-formula): Avoid using `find-file-noselect' to check contents of the generated mathml formula. `find-file-noselect' runs a number of hooks, which are not necessary and may sometimes throw errors. Link: https://orgmode.org/list/ut96a7$i6d$1@ciao.gmane.io --- lisp/org.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 0ca0d2f7d..81635366c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -16225,7 +16225,8 @@ inspection." (setq shell-command-output (shell-command-to-string cmd)) (setq mathml (when (file-readable-p tmp-out-file) - (with-current-buffer (find-file-noselect tmp-out-file t) + (with-temp-buffer + (insert-file-contents tmp-out-file) (goto-char (point-min)) (when (re-search-forward (format "]*?%s[^>]*?>\\(.\\|\n\\)*"