Ihor Radchenko writes:

> Can you please add the comments, similar to what I requested earlier.
> These magic length of 4 may be hard to grasp otherwise.

Hi Ihor,

Here is the new patch. I have realized that it is not necessary to put a
cond, since in this case it is only necessary to obtain the name of the
language for the metadata, so this new patch is simpler.

Anyway, I think I'm going to prioritize working on a new
org-latex-language-alist that is a plist, to avoid all this stuff about
numbers and lengths...

Best regards,

Juan Manuel

>From 7f3ddd0d2e6e06becd0d43575be88b77b8d699a4 Mon Sep 17 00:00:00 2001
From: Juan Manuel Macias <maciasch...@posteo.net>
Date: Sun, 24 Jul 2022 13:20:25 +0200
Subject: [PATCH] lisp/ox-latex.el: Fix obsolete variables for babel and
 polyglossia

* (org-latex--format-spec): Use the new variable `org-latex-language-alist'.
---
 lisp/ox-latex.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 6cd751409..aea602982 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1860,10 +1860,11 @@ INFO is a plist used as a communication channel."
 (defun org-latex--format-spec (info)
   "Create a format-spec for document meta-data.
 INFO is a plist used as a communication channel."
-  (let ((language (let ((lang (plist-get info :language)))
-		    (or (cdr (assoc-string lang org-latex-babel-language-alist t))
-			(nth 1 (assoc-string lang org-latex-polyglossia-language-alist t))
-			lang))))
+  (let ((language (let ((lang (plist-get info :language))
+                        ;; Here it would suffice to obtain the second
+                        ;; element, which always returns the name
+                        ;; language name in `org-latex-language-alist'
+			(nth 1 (assoc-string lang org-latex-language-alist t))))))
     `((?a . ,(org-export-data (plist-get info :author) info))
       (?t . ,(org-export-data (plist-get info :title) info))
       (?s . ,(org-export-data (plist-get info :subtitle) info))
-- 
2.37.1

Reply via email to