From 4c01eba265edfb910e926c5559aca5bf7d7a3650 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sun, 19 Mar 2023 13:58:07 +0100 Subject: [PATCH] org-texinfo-supports-math-p: Fix CI test failures * lisp/ox-texinfo.el (org-texinfo-supports-math-p): Consider compilation error as indication that math is not supported. texinfo compiler throws "unknown command `displaymath'" error in such case, causing `org-texinfo-compile' to err as well. Fixes CI tests failures when testing with Texinfo versions with no math support. https://builds.sr.ht/~bzg/job/959487 --- lisp/ox-texinfo.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 4ff482cc3..f822f3d11 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -2037,10 +2037,13 @@ Once computed, the results remain cached." "\n"))) (with-temp-file input-file (insert input-content)) - (let* ((output-file (org-texinfo-compile input-file)) - (output-content (with-temp-buffer - (insert-file-contents output-file) - (buffer-string)))) + (when-let* ((output-file + ;; If compilation fails, consider math to + ;; be not supported. + (ignore-errors (org-texinfo-compile input-file))) + (output-content (with-temp-buffer + (insert-file-contents output-file) + (buffer-string)))) (let ((result (string-match-p (regexp-quote math-example) output-content))) (delete-file input-file)