GNU bug report logs - #63396
\foreignlanguage in babel style file

Previous Next

Package: auctex;

Reported by: Gustavo Barros <gusbrs.2016 <at> gmail.com>

Date: Tue, 9 May 2023 18:55:02 UTC

Severity: normal

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 63396 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Gustavo Barros <gusbrs.2016 <at> gmail.com>
Cc: 63396 <at> debbugs.gnu.org
Subject: Re: bug#63396: \foreignlanguage in babel style file
Date: Wed, 10 May 2023 09:45:43 +0200
Hi Gustavo,

Gustavo Barros <gusbrs.2016 <at> gmail.com> writes:

> just a quick and simple one.
>
> `\foreignlanguage' specs in `babel.el' are missing the optional
> argument it takes, both in `TeX-add-symbol` and in
> `font-latex-add-keywords`.
>
> Also, `\foreignlanguage' is included in the `function' font-lock
> class. Arguably `textual' would be a much better fit for it.

Thanks for the report.  You were thinking about a change like this?

--8<---------------cut here---------------start------------->8---
diff --git a/style/babel.el b/style/babel.el
index 2483b73b..2110289b 100644
--- a/style/babel.el
+++ b/style/babel.el
@@ -256,6 +256,7 @@
       (TeX-arg-completing-read (LaTeX-babel-active-languages)
                                "Language"))
     '("foreignlanguage"
+      [TeX-arg-completing-read-multiple ("date" "captions")]
       (TeX-arg-completing-read (LaTeX-babel-active-languages)
                                "Language")
       t)
@@ -374,7 +375,6 @@
    (when (and (featurep 'font-latex)
               (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("selectlanguage"     "{")
-                                ("foreignlanguage"    "{{")
                                 ("babeltags"          "{")
                                 ("babelensure"        "{{")
                                 ("shorthandon"        "{")
@@ -394,7 +394,9 @@
      (font-latex-add-keywords '(("defineshorthand"    "[{{")
                                 ("aliasshorthand"     "{{")
                                 ("languageattribute"  "{{"))
-                              'variable)))
+                              'variable)
+     (font-latex-add-keywords '(("foreignlanguage"    "[{{"))
+                              'textual)))
  TeX-dialect)

 (defvar LaTeX-babel-package-options-list
--8<---------------cut here---------------end--------------->8---

Best, Arash




This bug report was last modified 2 years and 15 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.