emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Rudolf Adamkovič" <rudolf@adamkovic.org>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Texinfo: Check for math support without warnings and quietly (was: Improve Texinfo math checking)
Date: Sun, 01 Sep 2024 12:08:41 +0200	[thread overview]
Message-ID: <m234mjsn2u.fsf@adamkovic.org> (raw)
In-Reply-To: <m2o75expya.fsf@adamkovic.org>

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

Oops, I found a bug in the patch.

Now fixed.

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: 2523 bytes --]

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

diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
index 6adee9fca..b11808ed5 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))))
-- 
2.39.3 (Apple Git-146)


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

-- 
"I love deadlines.  I love the whooshing noise they make as they go by."
--- Douglas Adams, The Salmon of Doubt, 2002

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

  reply	other threads:[~2024-09-01 10:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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č [this message]
2024-09-16 21:11     ` Rudolf Adamkovič
2024-09-22 16:16     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m234mjsn2u.fsf@adamkovic.org \
    --to=rudolf@adamkovic.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).