[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BUG Re: [PATCH] ox-latex.el: Unify in one single list Babel and Poly

From: Ihor Radchenko
Subject: Re: BUG Re: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists
Date: Tue, 26 Jul 2022 19:58:57 +0800

Juan Manuel Macías <maciaschain@posteo.net> writes:

> 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.

Thanks for the update!

The patch has some misplaced parenthesis.

> -  (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))))))

Your (nth 1 ...) sexp is inside the let definition:
(let ((lang ...)
      (nth 1 ..))

Please pay attention to the compiler warnings.

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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]