From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id EOGNDW/c02LawwAAbAwnHQ (envelope-from ) for ; Sun, 17 Jul 2022 11:54:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id cLFFDG/c02JjzwAAG6o9tA (envelope-from ) for ; Sun, 17 Jul 2022 11:54:55 +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 C38DA21759 for ; Sun, 17 Jul 2022 11:54:54 +0200 (CEST) Received: from localhost ([::1]:37540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oD0zF-0007p8-8l for larch@yhetil.org; Sun, 17 Jul 2022 05:54:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oD0yo-0007oi-0p for emacs-orgmode@gnu.org; Sun, 17 Jul 2022 05:54:26 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:40938) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oD0ym-0006zX-2W for emacs-orgmode@gnu.org; Sun, 17 Jul 2022 05:54:25 -0400 Received: by mail-pj1-x102e.google.com with SMTP id q13-20020a17090a304d00b001f1af9a18a2so1443325pjl.5 for ; Sun, 17 Jul 2022 02:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=LupDaP3zRWSMTw97QAF1XlRuKbPzY2ZwZLrBjLDuJOM=; b=fjyF7ylgCuulx++iYkCg2H2fYmy2r6TVI6SJ/P2lBZXnfq3kwU8i4TNQFdNJ6Z8LiF G2uAG66RifuDzZK+ad4fV51h/j3PfUkDENm/zDwt3ql5hphV192Hw0N/ChPUgLihmauU +3X/L9JW+Sv1Dv/vjn7CN9HhvDRwOJ2JV7nVwbsTrQkxVQXUU6ac8esbAqT0IaHFsPIr IkXRLpc4Wfg1tXg9ZYTjXdQgoYwEO/I0ujEVCoDliUxV3ReNARf3z39P2YNGW3Y1JZxm qigWVtlgF1nWK6MXdppiqtPUlgCQA/3U1TkB6Tskmy0ncmh+xLMIKh8+niqmN8U9vwbk GToQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=LupDaP3zRWSMTw97QAF1XlRuKbPzY2ZwZLrBjLDuJOM=; b=QfIRAnFIUGpdA3Y9XZYI0Jkvkv3LcA6xkIFqvL4fuGhS8Jp3BhQtdUxJUh60U4yjin uveap0mhTo/P0/gUgaXaQGmu4X8SWaob2gVBg8OyXtEcX/guYcd5/HkMljmI4zTyhu4y yQKEHx0y5QBzXHq62UzO7UI0aFv/BNXCiA/rwYx1dijRZRtpaa2PT0Oo0JdlFYH5aaIf giC28ruk6N8VLI31rf5TH5eQa38pYEJq+O6mLhrn+BWLm4X2/aoIMN/qPY7jwu9exdRD KNvXN0kFE2cb323cjt6mJgFAkFKfB++39GQEkjmJjoi38H5nyUjxFEoyZ3bbAYD9eGig 5KwQ== X-Gm-Message-State: AJIora/6klG8T3WdY1NUPoBSQAGStSyYFRnYGhpTujwY5ztkM5T+HDO/ tABqLAlOYYANNXMCNdoS/2U= X-Google-Smtp-Source: AGRyM1vvC2kEeecHoulo4IU6ZCKqmH5Acl0s/fuHFjHftvTvAfI564bEQOR3VZaBh72f5SX2NcY57w== X-Received: by 2002:a17:902:db03:b0:16c:3eff:b503 with SMTP id m3-20020a170902db0300b0016c3effb503mr22306648plx.151.1658051662373; Sun, 17 Jul 2022 02:54:22 -0700 (PDT) Received: from localhost ([2409:8a70:2bd:4d0:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id a10-20020aa7970a000000b0052513b5d078sm7088298pfg.31.2022.07.17.02.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jul 2022 02:54:21 -0700 (PDT) From: Ihor Radchenko To: Juan Manuel =?utf-8?Q?Mac=C3=ADas?= Cc: orgmode Subject: Re: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists In-Reply-To: <87lesvlvos.fsf@posteo.net> References: <87sfxiw2jp.fsf@posteo.net> <87czeduxnz.fsf@localhost> <87lesvlvos.fsf@posteo.net> Date: Sun, 17 Jul 2022 17:55:24 +0800 Message-ID: <87bkto83n7.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" 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=1658051694; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=LupDaP3zRWSMTw97QAF1XlRuKbPzY2ZwZLrBjLDuJOM=; b=f7j8xJAo8bMqhsX9GrGxtzGimzx05frUf4kzt4M3Q0nORInZEKjdgbfrmBISMxo6Vqel+x C5XHf74g1YMomd8o3hoaOoIpmwReJUVaqvaeb3Fpe2/5dLcX00DM02Ep3GgZEzCFpBlkdQ iUS1lMfcLOKo1jTvMwtlOFreJ9VOmK/bQOu4rNFx7ga6pwfLw7eI9PWHFY8ryvQRcznotn AssZ4E3l1PDb8EW1euuvpkyuW4Eg6FkMb2gRG0VSPBVWi9tsE3DcdGDKpV1mqaMFPwyJHi z6TcwSB1mNIG0rl3jkT1dgO1sUU+DGRRBMQ+f41pnweTUZXMMsdBzb79OnKT9w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658051694; a=rsa-sha256; cv=none; b=fG+VYFSTJIycrTr4D+pN3CBIUCWnCorZTuioh9ygYq/YCt0LOf8WiEDwM3whiXZBrGRCqC Yz5SCxYPSOfgUuUMQeK3NNvVuomNVFCsqyxQ0Af2ipVrGkWpa3puyHIHZQTyjpmAtTLWLr e5mXyEuMdV9UabMsb2OqgciA4iYQk9uidagcvROr3UpmZNA3pLukh1GdVDRpu/0XWN0NYZ ecspqO9dkfKOsdbaxLFNAByqPgwtiPts7YBukRA1uzOsJ9zr5/xM7nwtv5M+bGklacnZ06 yPWj7cj3Pfm/mwk37YIl0etnSDQkWIl0sQh3ITs8DtzppiuIeq5SE4oBSr3OWg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=fjyF7ylg; dmarc=pass (policy=none) header.from=gmail.com; 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.93 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=fjyF7ylg; dmarc=pass (policy=none) header.from=gmail.com; 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: C38DA21759 X-Spam-Score: -4.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: ByiHL0vtZULO Juan Manuel Mac=C3=ADas writes: > I attach the new version of the patch with both variables declared > obsolete. Thanks! We usually declare obsolete variables in org-compat.el. > If everything is ok, I can add what is necessary to NEWS and to the Org M= anual. I have some minor comments. You can address them and then go ahead with NEWS and manual. For Max's comment, using plist/alist would make things more clear code-wise for future developers. I always find it annoying when I need to go back and forth checking which element should be second or third or forth in the list. Especially if the variable is used all around the codebase. Though this particular case is not such - `org-latex-language-alist' is used just in few places. > +(make-obsolete-variable 'org-latex-babel-language-alist > + "set `org-latex-language-alist' instead." "9.6") > + > +(make-obsolete-variable 'org-latex-polyglossia-language-alist > + "set `org-latex-language-alist' instead." "9.6") > + As I mentioned earlier, please move the obsoletion statements to org-compat. > - "Alist between language code and corresponding Polyglossia option.") > + "Alist between language code and corresponding Babel/Polyglossia optio= n. > + > +For the names of the languages, the Babel nomenclature is > +preferred to that of Polyglossia, in those cases where both > +coincide. > + > +The alist supports three types of members: > + > +- Members with two elements: CODE BABEL/POLYGLOSSIA OPTION. > + > +- Members with three elements: CODE BABEL/POLYGLOSSIA OPTION > +ASTERISK (the presence of the asterisk indicates that this > +language is not loaded in Babel using the old method of ldf > +files but using ini files. If Babel is loaded in an Org > +document with these languages, the \"AUTO \" argument is just > +removed, to avoid compilation errors). Two spaces between sentences please, as in https://orgmode.org/worg/org-contribute.html > ;; If LANGUAGE is already loaded, return header without AUTO. > ;; Otherwise, replace AUTO with language or append language if > ;; AUTO is not present. > (replace-match > (mapconcat (lambda (option) (if (equal "AUTO" option) language option)) > (cond ((member language options) (delete "AUTO" options)) > + ((let ((l (assoc language-code org-latex-language-alist))) > + (and (consp l) (=3D (length l) 3))) (delete "AUTO" options)) A comment explaining why "3" would be useful. > - (if (and (consp l) (=3D (length l) 3)) > - (format "[variant=3D%s]" (nth 2 l)) > + (if (and (consp l) (=3D (length l) 4)) > + (format "[variant=3D%s]" (nth 3 l)) > "") > - (nth 1 l)))) > + (if (and (consp l) (=3D (length l) 4)) > + (nth 2 l) > + (nth 1 l))))) Again, comment explaining all these 2,3,4 would help. Best, Ihor