Re: [PATCH] ox-latex.el: fix interpretation of org-latex-pdf-process

2021-01-24 Thread Kyle Meyer
Tara Lorenz writes:

> Hi all,
>
> it seems that the documentation and code for `org-latex-pdf-process' are
> out of sync: Where the documentation mentions "%bib" the code expects
> "%bibtex".  At least, that's how i understand it.

Thanks for catching that.  It seems [1] it's an old regression from
f6187deca (ox-latex: Small refactor, 2015-09-13).

[1] https://orgmode.org/list/877e8p1aej@kyleam.com/

> I resolved that confusing situation by making "%bib" and "%bibtex"
> equally accepted, without touching the documentation.  Thus, old
> configurations work again ("%bib") as well as workarounds (using
> "%bibtex") which might have gotten employed somewhere.

That sounds like a good approach to me.  Applied (13e98e2a1), adding a
TINYCHANGE cookie and a reference to the above commit in the message.

> Subject: [PATCH] ox-latex.el: fix interpretation of org-latex-pdf-process
[...]
>(process (if (functionp org-latex-pdf-process) org-latex-pdf-process
> - ;; Replace "%latex" and "%bibtex" with,
> + ;; Replace "%latex", "%bib" and "%bibtex" with,
>   ;; respectively, "%L" and "%B" so as to adhere to
>   ;; `format-spec' specifications.

I also tweaked this comment a bit because, with the above change, the
elements before and after "respectively" no longer lined up.



[PATCH] ox-latex.el: fix interpretation of org-latex-pdf-process

2021-01-15 Thread Tara Lorenz
Hi all,

it seems that the documentation and code for `org-latex-pdf-process' are
out of sync: Where the documentation mentions "%bib" the code expects
"%bibtex".  At least, that's how i understand it.

I resolved that confusing situation by making "%bib" and "%bibtex"
equally accepted, without touching the documentation.  Thus, old
configurations work again ("%bib") as well as workarounds (using
"%bibtex") which might have gotten employed somewhere.

Cheers, Tara
From 0550f85f733bf81af7d365e81bbd7c1f22e98209 Mon Sep 17 00:00:00 2001
From: Tara Lorenz 
Date: Fri, 15 Jan 2021 16:47:39 +0100
Subject: [PATCH] ox-latex.el: fix interpretation of org-latex-pdf-process

* ox-latex.el (org-latex-export-to-pdf):  The documentation for
`org-latex-pdf-process' states that "%bib" will be expanded into the
current binding of `org-latex-bibtex-compiler'.  However, the
`org-latex-export-to-pdf', where the expansion takes place, expects
"%bibtex" instead.  This fix will accept "%bib" as well as "%bibtex"
as markers for `org-latex-bib-compiler'.
---
 lisp/ox-latex.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index fb9fc3cd6..3b7e67844 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -3666,12 +3666,12 @@ produced."
 		 (match-string 0)))
 	  "pdflatex"))
 	 (process (if (functionp org-latex-pdf-process) org-latex-pdf-process
-		;; Replace "%latex" and "%bibtex" with,
+		;; Replace "%latex", "%bib" and "%bibtex" with,
 		;; respectively, "%L" and "%B" so as to adhere to
 		;; `format-spec' specifications.
 		(mapcar (lambda (command)
 			  (replace-regexp-in-string
-			   "%\\(?:bib\\|la\\)tex\\>"
+   "%\\(?:\\(?:bib\\|la\\)tex\\|bib\\)\\>"
 			   (lambda (m) (upcase (substring m 0 2)))
 			   command))
 			org-latex-pdf-process)))
-- 
2.30.0



signature.asc
Description: PGP signature