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
This commit is contained in:
Ihor Radchenko 2024-03-19 17:44:00 +03:00
parent 2381c7b882
commit b338a90698
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 1 deletions

View File

@ -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 "<math[^>]*?%s[^>]*?>\\(.\\|\n\\)*</math>"