all messages for Emacs-related lists mirrored at yhetil.org
 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; 5+ 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] 5+ messages in thread

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

Thread overview: 5+ 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č
2024-09-22 16:16     ` Ihor Radchenko

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.