From 49065a3d39dba83669e123297bf87ce76cba38d4 Mon Sep 17 00:00:00 2001 From: Rudolf Adamkovic Date: Tue, 27 Aug 2024 11:10:56 +0200 Subject: [PATCH] ox-texinfo: Check for math support without warnings and quietly * lisp/ox-texinfo.el (org-texinfo-supports-math-p): Two improvements: (1) Fix the incorrect `.info' extension used for the temporary `.texi' file. This removes the warning "makeinfo: warning: input file testXXX.info; did you mean testXXX.texi?" (2) Suppress output when compiling the "Is math supported?" test file. This is to avoid user confusion, as the user cares about their Texinfo file, not implementation details. This removes the message "Processing Texinfo file /var/.../testXXX.info...". --- lisp/ox-texinfo.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 6adee9fca..149ab944f 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -2037,7 +2037,7 @@ Once computed, the results remain cached." (unless (boundp 'org-texinfo-supports-math--cache) (setq org-texinfo-supports-math--cache (let ((math-example "1 + 1 = 2")) - (let* ((input-file (make-temp-file "test" nil ".info")) + (let* ((input-file (make-temp-file "test" nil ".texi")) (input-content (string-join (list (format "@setfilename %s" input-file) "@node Top" @@ -2050,7 +2050,8 @@ Once computed, the results remain cached." (when-let* ((output-file ;; If compilation fails, consider math to ;; be not supported. - (ignore-errors (org-texinfo-compile input-file))) + (ignore-errors (let ((inhibit-message t)) + (org-texinfo-compile input-file)))) (output-content (with-temp-buffer (insert-file-contents output-file) (buffer-string)))) -- 2.39.3 (Apple Git-146)