From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp11.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms5.migadu.com with LMTPS
	id EAIJA6kh4GLBbAAAbAwnHQ
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Tue, 26 Jul 2022 19:17:29 +0200
Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp11.migadu.com with LMTPS
	id EAcdA6kh4GJLIwAA9RJhRA
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Tue, 26 Jul 2022 19:17:29 +0200
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id 51ECF17EBF
	for <larch@yhetil.org>; Tue, 26 Jul 2022 19:17:28 +0200 (CEST)
Received: from localhost ([::1]:46504 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	id 1oGOBT-0001eh-4G
	for larch@yhetil.org; Tue, 26 Jul 2022 13:17:27 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:37334)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <maciaschain@posteo.net>)
 id 1oGNHO-0004SH-R9
 for emacs-orgmode@gnu.org; Tue, 26 Jul 2022 12:19:30 -0400
Received: from mout01.posteo.de ([185.67.36.65]:34111)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <maciaschain@posteo.net>)
 id 1oGNHM-0007EL-44
 for emacs-orgmode@gnu.org; Tue, 26 Jul 2022 12:19:30 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 5FEE6240026
 for <emacs-orgmode@gnu.org>; Tue, 26 Jul 2022 18:19:24 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1658852364; bh=XDSL4Ck81yy5DIYIXtr7l2twGTqg7nfrO9Nv2OWPZNs=;
 h=From:To:Cc:Subject:Date:From;
 b=UOk+7Pierl2DEu6OMiNTDrbOnfOMsHhPWWmqN7YBYQIqM2HOs2T8b4XmTnZu2gSqa
 eM/4MQjWzHVjeawuQDzy2jnbXcSWve1eCvQXtVsE3pJS5WsF+3QsrVmJlUZUbtPGQh
 UvJA78orpLi+uxpxd4XOuqjWKxqEZIyoTZHbt9GvlTpFIyis4GbsD6eiKawh1zNAEm
 Qs3nXVsaU+V7jd2W+LpWknznYeIfCsdjXCoPTlXyfsFCH1Ye/QTB3hHAt9BkiMBmfA
 MNK6QYRDpqf/ZbqJ7UKXurGEr6yZxLvSaCTAmKk4XVBYqI4Lux1o/B9I1Q6EAlxjSo
 LcROPL9g/hSPw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Lshtz6C5gz6tm9;
 Tue, 26 Jul 2022 18:19:21 +0200 (CEST)
From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= <maciaschain@posteo.net>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: BUG Re: [PATCH] ox-latex.el: Unify in one single list Babel and
 Polyglossia languages alists
References: <D78D51FA-6793-423D-939B-E82B0D07636B@mit.edu>
 <87pmhw9bfu.fsf@localhost>
 <B7A54BA2-26B7-4CE3-B9D6-BC133B56ABAB@mit.edu>
 <87mtczaozb.fsf@localhost>
 <4F8FB342-420C-4A76-833F-4186E027655B@mit.edu>
 <87czdvannh.fsf@localhost> <87sfmrq0z2.fsf@posteo.net>
 <87a68zdls1.fsf@localhost> <874jz6rbo7.fsf@posteo.net>
 <87y1wgaxvi.fsf@localhost>
Date: Tue, 26 Jul 2022 16:19:20 +0000
In-Reply-To: <87y1wgaxvi.fsf@localhost> (Ihor Radchenko's message of "Tue, 26
 Jul 2022 19:58:57 +0800")
Message-ID: <87edy7zw1j.fsf@posteo.net>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net;
 helo=mout01.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: emacs-orgmode@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
Sender: "Emacs-orgmode" <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
X-Migadu-Flow: FLOW_IN
X-Migadu-To: larch@yhetil.org
X-Migadu-Country: US
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1658855848;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-unsubscribe:
	 list-subscribe:list-post:dkim-signature;
	bh=bimT79R+UkOEiXvjuqDmAWBhWkqx+xbyjNCFbKtHB6Y=;
	b=lOZqUGqk46AG8Q2w/vg1JdOL2Z0NA95z+/PckLoIec+dtkK3KZbRkhOwznALPUv0QtwTdd
	UyTznhkGE5Vipy0+06F4CMSLPRVVVFXU5nsg4+WovYTtfaAicAot+4st4H/Kdg5ghOivc5
	pvZBx0HQUTaoudd4kjkspaFtPsNcpr+UEuU2VmavYns/t0a7mQQ5nXeM03bbsEWcOyOGhq
	db5yuO4/iZ/k/UEFWk/EqHMdZgoyky6F/puKmaBM79Zb0zfh9d/LfzZaJChfgGT1hBHn4P
	4FZMythz9/2vP4HncWFtIlZ6RPjenbvBL7oMjq7RwbBfRbM5rFDMF1m5G1kdKw==
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658855848; a=rsa-sha256; cv=none;
	b=eRi/KDMwCFMs+SOxuL3vgzntAH515rSmGS87it2TygvPVbfKnVYmzVi+oAR+zNnUeLq/kU
	ktiw94dB4/xfFr9sxBIckU1vuKib+ERVXPTog2HriSAOaHIywqQZ7ASociWCxQV8zVtw0R
	M4+WdXXG1nngsYqMd1mF0+09rydU4naQDbgs6O1px7PeV9JhNpPTWXymhRzeOwF1+NRLhE
	ln88dzYMmEGO/6WM7Tpiq+WiR66kY0VVqQxctj8puHOHiwg401GQEL4QszhRe+XYzzqArH
	WbAI1yfWQQpFu2AP+NiiB5G8JQj9M7Xue4PSPGoM8cFpsawTrTQ5mVArSBXmSg==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=posteo.net header.s=2017 header.b=UOk+7Pie;
	dmarc=pass (policy=none) header.from=posteo.net;
	spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"
X-Migadu-Spam-Score: -4.13
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=posteo.net header.s=2017 header.b=UOk+7Pie;
	dmarc=pass (policy=none) header.from=posteo.net;
	spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"
X-Migadu-Queue-Id: 51ECF17EBF
X-Spam-Score: -4.13
X-Migadu-Scanner: scn0.migadu.com
X-TUID: m3elxUKLz8dU

--=-=-=
Content-Type: text/plain

Hi Ihor,

A thousand apologies for my horrible carelessness with the parentheses.
I should have checked the code. Here goes the patch again corrected. I
hope it's alright now.

Ihor Radchenko writes:

> Also, the original code contained the clause:
> (or (get lang from the alist1)
>     (get lang from the alist2)
>     lang ; Fallback to provided language if not known.
>     )
>
> Your variant does not have the fallback part. Is it intentional?

Yes, I removed it because I thought it was not necessary, because after
all the user must put a supported language as the value of #+language.
Anyway, in case it breaks something backwards I have replaced it. Now
the or expression is:

(or (nth 1 (assoc-string lang org-latex-language-alist t))
	lang)

Best regards,

Juan Manuel 


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-lisp-ox-latex.el-Remove-Babel-and-Polyglossia-alists.patch

>From 483cf69e0ca56c560c3bd53db13887a63d529ec9 Mon Sep 17 00:00:00 2001
From: Juan Manuel Macias <maciaschain@posteo.net>
Date: Tue, 26 Jul 2022 18:01:52 +0200
Subject: [PATCH] lisp/ox-latex.el: Remove Babel and Polyglossia alists

* (org-latex--format-spec): The new variable is now `org-latex-language-alist'
---
 lisp/ox-latex.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 121a3f84c..14728f0ba 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1861,8 +1861,10 @@ INFO is a plist used as a communication channel."
   "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))
+                    ;; Here it would suffice to obtain the second
+                    ;; element, which always returns the name
+                    ;; language name in `org-latex-language-alist'
+                    (or (nth 1 (assoc-string lang org-latex-language-alist t))
 			lang))))
     `((?a . ,(org-export-data (plist-get info :author) info))
       (?t . ,(org-export-data (plist-get info :title) info))
-- 
2.37.1


--=-=-=--