emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Improve Texinfo math checking
@ 2024-08-27  9:34 Rudolf Adamkovič
  2024-08-27  9:41 ` [PATCH] Texinfo: Check for math support without warnings and quietly (was: Improve Texinfo math checking) Rudolf Adamkovič
  0 siblings, 1 reply; 4+ messages in thread
From: Rudolf Adamkovič @ 2024-08-27  9:34 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 135 bytes --]

Hello there!

The attached patch improves how the Texinfo exporter checks if Texinfo
supports `@math'.  Please review and merge.

Rudy

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-texinfo-Check-for-math-support-without-warnings-a.patch --]
[-- Type: text/x-patch, Size: 2174 bytes --]

From 49065a3d39dba83669e123297bf87ce76cba38d4 Mon Sep 17 00:00:00 2001
From: Rudolf Adamkovic <rudolf@adamkovic.org>
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)


[-- Attachment #3: Type: text/plain, Size: 229 bytes --]

-- 
"One can begin to reason only when a clear picture has been formed in
the imagination."  --- Walter Warwick Sawyer, Mathematician's Delight,
1943

Rudolf Adamkovič <rudolf@adamkovic.org> [he/him]
http://adamkovic.org

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-16 21:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-27  9:34 Improve Texinfo math checking Rudolf Adamkovič
2024-08-27  9:41 ` [PATCH] Texinfo: Check for math support without warnings and quietly (was: Improve Texinfo math checking) Rudolf Adamkovič
2024-09-01 10:08   ` Rudolf Adamkovič
2024-09-16 21:11     ` Rudolf Adamkovič

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).