From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 IL/iLhMO0GLyAAAAbAwnHQ (envelope-from ) for ; Thu, 14 Jul 2022 14:37:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 6L6sLhMO0GJqtQAAauVa8A (envelope-from ) for ; Thu, 14 Jul 2022 14:37:39 +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 C865FED48 for ; Thu, 14 Jul 2022 14:37:38 +0200 (CEST) Received: from localhost ([::1]:49208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBy65-0005bW-4J for larch@yhetil.org; Thu, 14 Jul 2022 08:37:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBy3A-0004Sg-V9 for emacs-orgmode@gnu.org; Thu, 14 Jul 2022 08:34:36 -0400 Received: from mout01.posteo.de ([185.67.36.65]:43103) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBy38-0005Yp-E2 for emacs-orgmode@gnu.org; Thu, 14 Jul 2022 08:34:36 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 07BCF240026 for ; Thu, 14 Jul 2022 14:34:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1657802071; bh=UZwzPXuhrGkCjuifx9O0N/lB5udXcb50sH72XCtqj4g=; h=From:To:Cc:Subject:Date:From; b=Y0nWFESfZ3LgQqsSzlNWBhpefle7GqESsr9jwnC7VeVE0GjUROOak5vYDPTMf0x7g dF+jiRoQt9zrDP+nhZqipEoXT6DaKJtQfieo1R9JtjMcHRlKNX8P06oZNVC0/4TUTv 60f0J6PEPRkdPLSU9KfJhozLbgxP5MoqUR+eSqIjM6KESpjnCrRVq4DerFp7ksK5ca 53pg7Ftw+QeA2Ron7pSRIL4M9ikp1looL21v4lgF+NvgJLbnLJaVAy5rtGHoRULr/I pbkqRlN4OB+P28oBWIXOB+Uc1DOptaF09hWFk3ZZFeaINRocQoo3K14b4cPv8ja7X2 PxCe60kmri8Bw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LkDT21V0dz9rxs; Thu, 14 Jul 2022 14:34:29 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Ihor Radchenko Cc: orgmode Subject: Re: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists References: <87sfxiw2jp.fsf@posteo.net> <87czeduxnz.fsf@localhost> Date: Thu, 14 Jul 2022 12:34:27 +0000 In-Reply-To: <87czeduxnz.fsf@localhost> (Ihor Radchenko's message of "Sun, 10 Jul 2022 17:25:36 +0800") Message-ID: <87lesvlvos.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." 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=1657802259; 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=dVV8KIfV7dOSnSnOClKQ/PfK8Z+4dlrzCCPCSiJfQ8s=; b=sEqCP/18K1s5i4id30kDOgNaaUwKN3Fvu2X/+7vJOxHdOKqeHP4aMJcENS3tZRG4lEZf3J sNU5Sy8ZsTCsc+ptV8T7H3/SQtZ5phjezv8VZrxcowS17Hx53uXAvM9CNUTkcG/9aNjUVi xInc+pQ/iMFome8m54i9wW+4luaMoYqRepxmRDJdhc50wHJI4+w8ALyEAaQCpDrsRZEjix PvMEGJtiNbRKxYoAmds5RVCDTRtQAxN0ajAw/L8RC7Kan+q6qJyqu18QKl9QWTQBuXTurv +e1qPu6RxhDrXBzo0mV8hetgdoxC18g3/20OR859ZfW1Q4hUW57ZOrN+yr+z5Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657802259; a=rsa-sha256; cv=none; b=Sail+k0zi+0Ex2cu1t+I9KaJ4402JxTQRDq7h5zGCGRfS/GfhGxZR5WAUYSEV/rBPPjSBd gxjBDR33BHDucMXgXInpB3F4FGQnN+jcAf0HuRSdlUAVCSz3kFKa3J3P4jNZQxABmum8qz gXGepo34bEJZtHzE/TdDGCNk5pgBAkfneqLr9TnixA4Uf8YfrWdeMqFxQw14uI/QR+CNz0 rTMV38vrZ+W8R/+KH51j8gYsYzRYKqxdMbnYeqSwy5lXVAx6QNYU6cyd6Fl9Z5yCJQ2HdU LTrIKamWbZBvcMc2Dbw5RwyupSQMevhgf+YWoaE6JftXE1E6P0yoHpN5w4v+LA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Y0nWFESf; 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: -8.95 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Y0nWFESf; 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: C865FED48 X-Spam-Score: -8.95 X-Migadu-Scanner: scn0.migadu.com X-TUID: pE6kcLpwQ8jR --=-=-= Content-Type: text/plain Ihor Radchenko writes: > Thanks! > This looks like an improvement. > However, we may need to preserve the old defconsts for the time being > and declare them obsolete. Hi, Ihor, I attach the new version of the patch with both variables declared obsolete. If everything is ok, I can add what is necessary to NEWS and to the Org Manual. Best regards, Juan Manuel --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-ox-latex.el-New-variable-org-latex-language-ali.patch >From 9ff77e71a8cd89b883d5ead37909c887178e4402 Mon Sep 17 00:00:00 2001 From: Juan Manuel Macias Date: Thu, 14 Jul 2022 13:42:50 +0200 Subject: [PATCH] * lisp/ox-latex.el: New variable `org-latex-language-alist' (org-latex-language-alist): Unify in a single list `org-latex-polyglossia-language-alist' and `org-latex-babel-language-alist', and make the two variables obsolete. --- lisp/ox-latex.el | 173 ++++++++++++++++++++--------------------------- 1 file changed, 74 insertions(+), 99 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 1aab8ffd5..9e97f38db 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -172,144 +172,115 @@ ;;; Internal Variables -(defconst org-latex-babel-language-alist - '(("af" . "afrikaans") - ("bg" . "bulgarian") - ("ca" . "catalan") - ("cs" . "czech") - ("cy" . "welsh") - ("da" . "danish") - ("de" . "germanb") - ("de-at" . "naustrian") - ("de-de" . "ngerman") - ("el" . "greek") - ("en" . "english") - ("en-au" . "australian") - ("en-ca" . "canadian") - ("en-gb" . "british") - ("en-ie" . "irish") - ("en-nz" . "newzealand") - ("en-us" . "american") - ("es" . "spanish") - ("et" . "estonian") - ("eu" . "basque") - ("fi" . "finnish") - ("fr" . "french") - ("fr-ca" . "canadien") - ("gl" . "galician") - ("hr" . "croatian") - ("hu" . "hungarian") - ("id" . "indonesian") - ("is" . "icelandic") - ("it" . "italian") - ("la" . "latin") - ("ms" . "malay") - ("nl" . "dutch") - ("nb" . "norsk") - ("nn" . "nynorsk") - ("no" . "norsk") - ("pl" . "polish") - ("pt" . "portuguese") - ("pt-br" . "brazilian") - ("ro" . "romanian") - ("ru" . "russian") - ("sa" . "sanskrit") - ("sb" . "uppersorbian") - ("sk" . "slovak") - ("sl" . "slovene") - ("sq" . "albanian") - ("sr" . "serbian") - ("sv" . "swedish") - ("ta" . "tamil") - ("tr" . "turkish") - ("uk" . "ukrainian")) - "Alist between language code and corresponding Babel option.") - -(defconst org-latex-polyglossia-language-alist - '(("am" "amharic") +(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") + +(defconst org-latex-language-alist + '(("am" "amharic" "*") ("ar" "arabic") - ("ast" "asturian") + ("ast" "asturian" "*") ("bg" "bulgarian") - ("bn" "bengali") - ("bo" "tibetan") + ("bn" "bengali" "*") + ("bo" "tibetan" "*") ("br" "breton") ("ca" "catalan") - ("cop" "coptic") + ("cop" "coptic" "*") ("cs" "czech") ("cy" "welsh") ("da" "danish") - ("de" "german" "german") - ("de-at" "german" "austrian") - ("de-de" "german" "german") - ("dsb" "lsorbian") - ("dv" "divehi") + ("de" "ngerman" "german" "german") + ("de-at" "naustrian" "german" "austrian") + ("dsb" "lsorbian" "*") + ("dv" "divehi" "*") ("el" "greek") - ("en" "english" "usmax") - ("en-au" "english" "australian") - ("en-gb" "english" "uk") - ("en-nz" "english" "newzealand") - ("en-us" "english" "usmax") + ("el-polyton" "polutonikogreek" "greek" "polytonic") + ("en" "american" "english" "usmax") + ("en-au" "australian" "english" "australian") + ("en-gb" "british" "english" "uk") + ("en-nz" "newzealand" "english" "newzealand") + ("en-us" "american" "english" "usmax") ("eo" "esperanto") ("es" "spanish") + ("es-mx" "spanishmx" "spanish" "mexican") ("et" "estonian") ("eu" "basque") ("fa" "farsi") ("fi" "finnish") ("fr" "french") - ("fu" "friulan") + ("fr-ca" "canadien" "french" "canadian") + ("fur" "friulan") ("ga" "irish") ("gd" "scottish") ("gl" "galician") ("he" "hebrew") ("hi" "hindi") ("hr" "croatian") - ("hsb" "usorbian") + ("hsb" "uppersorbian" "sorbian" "upper") ("hu" "magyar") - ("hy" "armenian") + ("hy" "armenian" "*") ("ia" "interlingua") - ("id" "bahasai") + ("id" "bahasai" "*") ("is" "icelandic") ("it" "italian") - ("kn" "kannada") - ("la" "latin" "modern") - ("la-classic" "latin" "classic") - ("la-medieval" "latin" "medieval") - ("la-modern" "latin" "modern") - ("lo" "lao") + ("kn" "kannada" "*") + ("la" "latin") + ("la-classic" "classiclatin" "latin" "classic") + ("la-medieval" "medievallatin" "latin" "medieval") + ("la-ecclesiastic" "ecclesiasticlatin" "latin" "ecclesiastic") + ("lo" "lao" "*") ("lt" "lithuanian") ("lv" "latvian") - ("ml" "malayalam") - ("mr" "maranthi") - ("nb" "norsk") - ("nko" "nko") + ("ml" "malayalam" "*") + ("mr" "maranthi" "*") + ("nb" "norsk" "norwegian" "bokmal") ("nl" "dutch") - ("nn" "nynorsk") + ("nn" "nynorsk" "norwegian" "nynorsk") ("no" "norsk") ("oc" "occitan") ("pl" "polish") ("pms" "piedmontese") ("pt" "portuges") ("pt-br" "brazilian") - ("rm" "romansh") + ("rm" "romansh" "*") ("ro" "romanian") ("ru" "russian") - ("sa" "sanskrit") - ("se" "samin") + ("sa" "sanskrit" "*") ("sk" "slovak") - ("sl" "slovenian") + ("sl" "slovene") ("sq" "albanian") ("sr" "serbian") ("sv" "swedish") - ("syr" "syriac") - ("ta" "tamil") - ("te" "telugu") + ("syr" "syriac" "*") + ("ta" "tamil" "*") + ("te" "telugu" "*") ("th" "thai") ("tk" "turkmen") ("tr" "turkish") ("uk" "ukrainian") - ("ur" "urdu") + ("ur" "urdu" "*") ("vi" "vietnamese")) - "Alist between language code and corresponding Polyglossia option.") + "Alist between language code and corresponding Babel/Polyglossia option. + +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). + +- Members with four elements (for variants of languages): CODE +BABEL-OPTION POLYGLOSSIA-OPTION POLYGLOSSIA-VARIANT") (defconst org-latex-table-matrix-macros '(("bordermatrix" . "\\cr") ("qbordermatrix" . "\\cr") @@ -1657,14 +1628,16 @@ Return the new header." header (let ((options (save-match-data (org-split-string (match-string 1 header) ",[ \t]*"))) - (language (cdr (assoc-string language-code - org-latex-babel-language-alist t)))) + (language (nth 1 (assoc language-code + org-latex-language-alist)))) ;; 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) (= (length l) 3))) (delete "AUTO" options)) ((member "AUTO" options) options) (t (append options (list language)))) ", ") @@ -1710,15 +1683,17 @@ Return the new header." (concat "\\usepackage{polyglossia}\n" (mapconcat (lambda (l) - (let ((l (or (assoc l org-latex-polyglossia-language-alist) + (let ((l (or (assoc l org-latex-language-alist) l))) (format (if main-language-set "\\setotherlanguage%s{%s}\n" (setq main-language-set t) "\\setmainlanguage%s{%s}\n") - (if (and (consp l) (= (length l) 3)) - (format "[variant=%s]" (nth 2 l)) + (if (and (consp l) (= (length l) 4)) + (format "[variant=%s]" (nth 3 l)) "") - (nth 1 l)))) + (if (and (consp l) (= (length l) 4)) + (nth 2 l) + (nth 1 l))))) languages "")) t t header 0))))) -- 2.36.1 --=-=-=--