* 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
* [PATCH] Texinfo: Check for math support without warnings and quietly (was: Improve Texinfo math checking)
2024-08-27 9:34 Improve Texinfo math checking Rudolf Adamkovič
@ 2024-08-27 9:41 ` Rudolf Adamkovič
2024-09-01 10:08 ` Rudolf Adamkovič
0 siblings, 1 reply; 5+ messages in thread
From: Rudolf Adamkovič @ 2024-08-27 9:41 UTC (permalink / raw)
To: emacs-orgmode
Rudolf Adamkovič <rudolf@adamkovic.org> writes:
> The attached patch ...
Oops, I again forgot to prefix the subject with "[PATCH]".
Fixed now.
Rudy
--
"If you're thinking without writing, you only think you're thinking."
--- Leslie Lamport
Rudolf Adamkovič <rudolf@adamkovic.org> [he/him]
http://adamkovic.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Texinfo: Check for math support without warnings and quietly (was: Improve Texinfo math checking)
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
0 siblings, 2 replies; 5+ messages in thread
From: Rudolf Adamkovič @ 2024-09-01 10:08 UTC (permalink / raw)
To: emacs-orgmode
[-- 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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Texinfo: Check for math support without warnings and quietly (was: Improve Texinfo math checking)
2024-09-01 10:08 ` Rudolf Adamkovič
@ 2024-09-16 21:11 ` Rudolf Adamkovič
2024-09-22 16:16 ` Ihor Radchenko
1 sibling, 0 replies; 5+ messages in thread
From: Rudolf Adamkovič @ 2024-09-16 21:11 UTC (permalink / raw)
To: emacs-orgmode
A friendly ping. :)
Rudolf Adamkovič <rudolf@adamkovic.org> writes:
> Oops, I found a bug in the patch.
>
> Now fixed.
>
> Rudy
> 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)
>
> --
> "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
--
"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 [flat|nested] 5+ messages in thread
* Re: [PATCH] Texinfo: Check for math support without warnings and quietly (was: Improve Texinfo math checking)
2024-09-01 10:08 ` Rudolf Adamkovič
2024-09-16 21:11 ` Rudolf Adamkovič
@ 2024-09-22 16:16 ` Ihor Radchenko
1 sibling, 0 replies; 5+ messages in thread
From: Ihor Radchenko @ 2024-09-22 16:16 UTC (permalink / raw)
To: Rudolf Adamkovič; +Cc: emacs-orgmode
Rudolf Adamkovič <rudolf@adamkovic.org> writes:
> 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...".
Thanks!
Applied, onto bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=fac0787e16
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [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 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).