emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals-release/org fac0787e16: ox-texinfo: Check for math supp


From: ELPA Syncer
Subject: [elpa] externals-release/org fac0787e16: ox-texinfo: Check for math support without warnings and quietly
Date: Sun, 22 Sep 2024 12:58:33 -0400 (EDT)

branch: externals-release/org
commit fac0787e1659b93810bff320a87d81eda98d03a9
Author: Rudolf Adamkovic <rudolf@adamkovic.org>
Commit: Ihor Radchenko <yantar92@posteo.net>

    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 | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
index 6adee9fca3..b11808ed5d 100644
--- a/lisp/ox-texinfo.el
+++ b/lisp/ox-texinfo.el
@@ -2037,9 +2037,12 @@ 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"))
+                   (output-file
+                    (file-name-with-extension
+                     (file-name-sans-extension input-file) "info"))
                    (input-content (string-join
-                                   (list (format "@setfilename %s" input-file)
+                                   (list (format "@setfilename %s" output-file)
                                          "@node Top"
                                          "@displaymath"
                                          math-example
@@ -2050,7 +2053,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))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]