auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, simplify-TeX-parse-error, updated. 4ef


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, simplify-TeX-parse-error, updated. 4ef7202625c5cf7a4ec7115950df177dbadd5b1f
Date: Fri, 18 Sep 2015 05:44:02 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, simplify-TeX-parse-error has been updated
       via  4ef7202625c5cf7a4ec7115950df177dbadd5b1f (commit)
       via  327c9734161df5be02206506e28fbae92ab0e9e4 (commit)
       via  62b8dbe8c65286f9382050b55064694f30dd496f (commit)
       via  776a289e952dfb4a4e7f3a6677242bef29acf88b (commit)
       via  f8926c87b2396d1bc33e70bc031da387d0e6f04d (commit)
       via  5ee81625b565fa29230b29477c3307eff1de722d (commit)
       via  57b0cc80bb7106290ff6589404de5cc528dcbe39 (commit)
       via  d8e675198da007065b3db5a07074e24530e2b566 (commit)
       via  ef310fbd852402c15f77a9333c4b7272820933e3 (commit)
       via  a77ad2f796697fda38a28dbece5b4f3ebb3fd8b7 (commit)
       via  05cf5be810abefa37d04fa7443ddfb1ef0edbb50 (commit)
       via  da7419fa25ef30c6ba1f56abe6b438983b720f3e (commit)
       via  4810753449ceae60763d84f56fa793a0c1ff304d (commit)
       via  7b4b894cfa57de01d88f6aff055c43a0ce67cbed (commit)
       via  8359f08793dd7c55cb9c572ea1ed8b26349a22c7 (commit)
       via  2b648fee000ed62c5a9491eb7a710c75a3f95b96 (commit)
       via  f4c5af9a2bfb64fc62a6319c903f7a96dc9052a8 (commit)
       via  066cf5aa198969206e1cfdc58e3ea71f0e69d2f6 (commit)
       via  5dd4f21cf5c044743552232fc01b65932edd9b1a (commit)
      from  c1dcf3a804bbba3db076d6b9c4677532094f3fad (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4ef7202625c5cf7a4ec7115950df177dbadd5b1f
Merge: 327c973 05cf5be
Author: Tassilo Horn <address@hidden>
Date:   Fri Sep 18 07:43:57 2015 +0200

    Merge branch 'master' into simplify-TeX-parse-error


commit 327c9734161df5be02206506e28fbae92ab0e9e4
Author: Arash Esbati <address@hidden>
Date:   Sun Sep 13 20:49:43 2015 +0200

    Append `-list' to `LaTeX-eso-pic-package-options'.
    
    * style/eso-pic.el (LaTeX-eso-pic-package-options-list): Rename
    from `LaTeX-eso-pic-package-options'.
    (LaTeX-eso-pic-package-options): Use renamed variable.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index 0a58a4c..dfe8955 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2015-09-13  Arash Esbati  <address@hidden>
 
+       * style/eso-pic.el (LaTeX-eso-pic-package-options-list): Rename
+       from `LaTeX-eso-pic-package-options'.
+       (LaTeX-eso-pic-package-options): Use renamed variable.
+
        * style/AlegreyaSans.el: New file.
 
        * Makefile.in (STYLESRC): Add new style.
diff --git a/style/eso-pic.el b/style/eso-pic.el
index 8b43535..b1bedb2 100644
--- a/style/eso-pic.el
+++ b/style/eso-pic.el
@@ -72,9 +72,8 @@
     "gridSetup" "LenToUnit"))
  LaTeX-dialect)
 
-(defvar LaTeX-eso-pic-package-options
-  '(;;
-    ("pscoord"      ("true" "false"))
+(defvar LaTeX-eso-pic-package-options-list
+  '(("pscoord"      ("true" "false"))
     ("texcoord"     ("true" "false"))
     ("grid"         ("true" "false"))
     ("gridunit"     ("mm" "in" "bp" "pt"))
@@ -86,6 +85,6 @@
 
 (defun LaTeX-eso-pic-package-options nil
   "Prompt for package options for the eso-pic package."
-  (TeX-read-key-val t LaTeX-eso-pic-package-options))
+  (TeX-read-key-val t LaTeX-eso-pic-package-options-list))
 
 ;;; eso-pic.el ends here

commit 62b8dbe8c65286f9382050b55064694f30dd496f
Author: Arash Esbati <address@hidden>
Date:   Sun Sep 13 20:41:38 2015 +0200

    Add new style AlegreyaSans.el.
    
    * style/AlegreyaSans.el: New file.
    
    * Makefile.in (STYLESRC): Add new style.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index 1b8ef33..0a58a4c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2015-09-13  Arash Esbati  <address@hidden>
 
+       * style/AlegreyaSans.el: New file.
+
        * Makefile.in (STYLESRC): Add new style.
 
        * style/Alegreya.el: New file.
diff --git a/Makefile.in b/Makefile.in
index b6de1e6..bc30c05 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -151,7 +151,8 @@ STYLESRC = style/prosper.el \
           style/newpxtext.el style/newpxmath.el style/pdfpages.el \
           style/mnras.el     style/environ.el   style/polyglossia.el \
           style/vwcol.el     style/textpos.el   style/transparent.el \
-          style/fontenc.el   style/Alegreya.el  style/gloss-italian.el
+          style/fontenc.el   style/Alegreya.el  style/gloss-italian.el \
+          style/AlegreyaSans.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/AlegreyaSans.el b/style/AlegreyaSans.el
new file mode 100644
index 0000000..4d9b497
--- /dev/null
+++ b/style/AlegreyaSans.el
@@ -0,0 +1,112 @@
+;;; AlegreyaSans.el --- AUCTeX style for `AlegreyaSans.sty' (v2015/09/02)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <esbati'at'gmx.de>
+;; Maintainer: address@hidden
+;; Created: 2015-09-12
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+
+;; This file adds support for `AlegreyaSans.sty' (v2015/09/02).
+;; `AlegreyaSans.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "AlegreyaSans"
+ (lambda ()
+
+   ;; Run style hook for packages loaded by AlegreyaSans
+   (TeX-run-style-hooks "textcomp")
+
+   ;; Load `fontaxes' or `fontspec' dep. on `type1' option:
+   (if (or (LaTeX-provided-package-options-member "AlegreyaSans" "type1")
+          (LaTeX-provided-package-options-member "AlegreyaSans" "type1=true"))
+       (TeX-run-style-hooks "fontaxes")
+     (TeX-run-style-hooks "fontspec"))
+
+   (TeX-add-symbols
+    ;; Should be used in preamble only
+    '("useosf")
+    ;; Text commands
+    '("AlegreyaSans"           -1)
+    '("AlegreyaSansLF"         -1)
+    '("AlegreyaSansOsF"        -1)
+    '("AlegreyaSansTLF"        -1)
+    '("AlegreyaSansTOsF"       -1)
+    '("AlegreyaSansThin"       -1)
+    '("AlegreyaSansLight"      -1)
+    '("AlegreyaSansMedium"     -1)
+    '("AlegreyaSansExtraBold"  -1)
+    '("AlegreyaSansBlack"      -1)
+    '("AlegreyaSansSC"         -1)
+    '("textsu"                  t)  ; superior figures
+    '("sufigures"              -1)  ;
+    '("textin"                  t)  ; inferior figures
+    '("infigures"              -1))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("textsu"    "{")
+                               ("textin"    "{"))
+                             'type-command)
+     (font-latex-add-keywords '(("AlegreyaSans"           "")
+                               ("AlegreyaSansLF"         "")
+                               ("AlegreyaSansOsF"        "")
+                               ("AlegreyaSansTLF"        "")
+                               ("AlegreyaSansTOsF"       "")
+                               ("AlegreyaSansLight"      "")
+                               ("AlegreyaSansMedium"     "")
+                               ("AlegreyaSansExtraBold"  "")
+                               ("AlegreyaSansBlack"      "")
+                               ("AlegreyaSansSC"         "")
+                               ("sufigures"              "")
+                               ("infigures"              ""))
+                             'type-declaration)))
+ LaTeX-dialect)
+
+(defvar LaTeX-AlegreyaSans-package-options-list
+  '(("lining"       ("true" "false"))
+    ("lf"           ("true" "false"))
+    ("oldstyle"     ("true" "false"))
+    ("osf"          ("true" "false"))
+    ("tabular"      ("true" "false"))
+    ("tf"           ("true" "false"))
+    ("proportional" ("true" "false"))
+    ("pf"           ("true" "false"))
+    ("black"        ("true" "false"))
+    ("extrabold"    ("true" "false"))
+    ("thin"         ("true" "false"))
+    ("light"        ("true" "false"))
+    ("medium"       ("true" "false"))
+    ("type1"        ("true" "false"))
+    ("sfdefault"    ("true" "false"))
+    ("scaled")
+    ("scale"))
+  "Package options for the AlegreyaSans package.")
+
+(defun LaTeX-AlegreyaSans-package-options ()
+  "Prompt for package options for the AlegreyaSans package."
+  (TeX-read-key-val t LaTeX-AlegreyaSans-package-options-list))
+
+;;; AlegreyaSans.el ends here

commit 776a289e952dfb4a4e7f3a6677242bef29acf88b
Author: Arash Esbati <address@hidden>
Date:   Sun Sep 13 20:38:04 2015 +0200

    Add new style Alegreya.el.
    
    * Makefile.in (STYLESRC): Add new style.
    
    * style/Alegreya.el: New file.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index 51c434b..1b8ef33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
 
        * Makefile.in (STYLESRC): Add new style.
 
+       * style/Alegreya.el: New file.
+
+       * Makefile.in (STYLESRC): Add new style.
+
        * style/fontenc.el: New file.
 
 2015-09-10  Mosè Giordano  <address@hidden>
diff --git a/Makefile.in b/Makefile.in
index 2a11b68..b6de1e6 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -151,7 +151,7 @@ STYLESRC = style/prosper.el \
           style/newpxtext.el style/newpxmath.el style/pdfpages.el \
           style/mnras.el     style/environ.el   style/polyglossia.el \
           style/vwcol.el     style/textpos.el   style/transparent.el \
-          style/fontenc.el   style/gloss-italian.el
+          style/fontenc.el   style/Alegreya.el  style/gloss-italian.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/Alegreya.el b/style/Alegreya.el
new file mode 100644
index 0000000..e2a444f
--- /dev/null
+++ b/style/Alegreya.el
@@ -0,0 +1,100 @@
+;;; Alegreya.el --- AUCTeX style for `Alegreya.sty' (v2015/09/02)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <esbati'at'gmx.de>
+;; Maintainer: address@hidden
+;; Created: 2015-09-12
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+
+;; This file adds support for `Alegreya.sty' (v2015/09/02).
+;; `Alegreya.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "Alegreya"
+ (lambda ()
+
+   ;; Run style hook for packages loaded by Alegreya
+   (TeX-run-style-hooks "textcomp")
+
+   ;; Load `fontaxes' or `fontspec' dep. on `type1' option:
+   (if (or (LaTeX-provided-package-options-member "Alegreya" "type1")
+          (LaTeX-provided-package-options-member "Alegreya" "type1=true"))
+       (TeX-run-style-hooks "fontaxes")
+     (TeX-run-style-hooks "fontspec"))
+
+   (TeX-add-symbols
+    ;; Should be used in preamble only
+    '("useosf")
+    ;; Text commands
+    '("Alegreya"      -1)
+    '("AlegreyaSC"    -1)
+    '("AlegreyaBlack" -1)
+    '("AlegreyaLF"    -1)
+    '("AlegreyaOsF"   -1)
+    '("AlegreyaTLF"   -1)
+    '("AlegreyaTOsF"  -1)
+    '("textsu"         t)  ; superior figures
+    '("sufigures"     -1)  ;
+    '("textin"         t)  ; inferior figures
+    '("infigures"     -1))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("textsu"    "{")
+                               ("textin"    "{"))
+                             'type-command)
+     (font-latex-add-keywords '(("Alegreya"      "")
+                               ("AlegreyaSC"    "")
+                               ("AlegreyaBlack" "")
+                               ("AlegreyaLF"    "")
+                               ("AlegreyaOsF"   "")
+                               ("AlegreyaTLF"   "")
+                               ("AlegreyaTOsF"  "")
+                               ("sufigures"     "")
+                               ("infigures"     ""))
+                             'type-declaration)))
+ LaTeX-dialect)
+
+(defvar LaTeX-Alegreya-package-options-list
+  '(("lining"       ("true" "false"))
+    ("lf"           ("true" "false"))
+    ("oldstyle"     ("true" "false"))
+    ("osf"          ("true" "false"))
+    ("tabular"      ("true" "false"))
+    ("tf"           ("true" "false"))
+    ("proportional" ("true" "false"))
+    ("pf"           ("true" "false"))
+    ("black"        ("true" "false"))
+    ("type1"        ("true" "false"))
+    ("scaled")
+    ("scale"))
+  "Package options for the Alegreya package.")
+
+(defun LaTeX-Alegreya-package-options ()
+  "Prompt for package options for the Alegreya package."
+  (TeX-read-key-val t LaTeX-Alegreya-package-options-list))
+
+;;; Alegreya.el ends here

commit f8926c87b2396d1bc33e70bc031da387d0e6f04d
Author: Arash Esbati <address@hidden>
Date:   Sun Sep 13 20:34:02 2015 +0200

    Add new style fontenc.el.
    
    * Makefile.in (STYLESRC): Add new style.
    
    * style/fontenc.el: New file.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index 7730d74..51c434b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-09-13  Arash Esbati  <address@hidden>
+
+       * Makefile.in (STYLESRC): Add new style.
+
+       * style/fontenc.el: New file.
+
 2015-09-10  Mosè Giordano  <address@hidden>
 
        * style/gloss-italian.el ("gloss-italian"): Fix "textitalian"
diff --git a/Makefile.in b/Makefile.in
index 68b785a..2a11b68 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -151,7 +151,7 @@ STYLESRC = style/prosper.el \
           style/newpxtext.el style/newpxmath.el style/pdfpages.el \
           style/mnras.el     style/environ.el   style/polyglossia.el \
           style/vwcol.el     style/textpos.el   style/transparent.el \
-          style/gloss-italian.el
+          style/fontenc.el   style/gloss-italian.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/fontenc.el b/style/fontenc.el
new file mode 100644
index 0000000..3df5e5d
--- /dev/null
+++ b/style/fontenc.el
@@ -0,0 +1,52 @@
+;;; fontenc.el --- AUCTeX style for `fontenc.sty' (v1.99g)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <esbati'at'gmx.de>
+;; Maintainer: address@hidden
+;; Created: 2015-09-12
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+
+;; This file adds support for `fontenc.sty' (v1.99g) from 2005/09/27.
+;; `fontenc.sty' is a standard LaTeX package and part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-fontenc-package-options-list
+  '(;; 128+ glyph encodings (text)
+    "OT1" "OT2" "OT3" "OT4" "OT6"
+    ;; 256 glyph encodings (text)
+    "T1" "T2A" "T2B" "T2C" "T3" "T4" "T5"
+    ;; 256 glyph encodings (text extended)
+    "X2"
+    ;; Other encodings
+    "LY1" "LV1" "LGR")
+  "Package options for the fontenc package.")
+
+(defun LaTeX-fontenc-package-options ()
+  "Prompt for package options for the fontenc package."
+  (mapconcat 'identity
+            (TeX-completing-read-multiple
+             "Encoding(s): "
+             LaTeX-fontenc-package-options-list) ","))
+
+;;; fontenc.el ends here

commit 5ee81625b565fa29230b29477c3307eff1de722d
Author: Mosè Giordano <address@hidden>
Date:   Thu Sep 10 13:24:44 2015 +0200

    Fix in Italian language polyglossia style file.
    
    * style/gloss-italian.el ("gloss-italian"): Fix "textitalian"
    macro and "italian" environment arguments.

diff --git a/ChangeLog b/ChangeLog
index 1e95800..7730d74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-09-10  Mosè Giordano  <address@hidden>
 
+       * style/gloss-italian.el ("gloss-italian"): Fix "textitalian"
+       macro and "italian" environment arguments.
+
        * style/polyglossia.el (LaTeX-polyglossia-prepare): Clear
        `LaTeX-polyglossia-lang-list'.
        (LaTeX-polyglossia-cleanup): Remove clearing of
diff --git a/style/gloss-italian.el b/style/gloss-italian.el
index a93049a..c786bb4 100644
--- a/style/gloss-italian.el
+++ b/style/gloss-italian.el
@@ -36,9 +36,10 @@
  "gloss-italian"
  (lambda ()
    (TeX-add-symbols
-    '("textitalian" [TeX-arg-key-val LaTeX-polyglossia-italian-options-list]))
+    '("textitalian" [TeX-arg-key-val LaTeX-polyglossia-italian-options-list] 
t))
    (LaTeX-add-environments
-    '("italian" [TeX-arg-key-val LaTeX-polyglossia-italian-options-list]))
+    '("italian"
+      LaTeX-env-args [TeX-arg-key-val LaTeX-polyglossia-italian-options-list]))
 
    (when (or (LaTeX-polyglossia-lang-option-member "italian" 
"babelshorthands=true")
             (LaTeX-polyglossia-lang-option-member "italian" "babelshorthands"))

commit 57b0cc80bb7106290ff6589404de5cc528dcbe39
Author: Mosè Giordano <address@hidden>
Date:   Thu Sep 10 12:52:30 2015 +0200

    Remove one TODO in style/polyglossia.el.

diff --git a/style/polyglossia.el b/style/polyglossia.el
index 86d0add..6e902a4 100644
--- a/style/polyglossia.el
+++ b/style/polyglossia.el
@@ -32,8 +32,6 @@
 ;;  -- Create language specific styles with names `gloss-<lang>.el'.  They
 ;;     should add `text<lang>' macros, `<lang>' environments (`Arabic' for
 ;;     `arabic' language), and the others language-specific commands.
-;;
-;;  -- Make autoloading of these style files really work.
 
 ;;; Code:
 

commit d8e675198da007065b3db5a07074e24530e2b566
Author: Mosè Giordano <address@hidden>
Date:   Thu Sep 10 12:13:34 2015 +0200

    Fix loading of polyglossia language style files.
    
    * style/polyglossia.el (LaTeX-polyglossia-prepare): Clear
    `LaTeX-polyglossia-lang-list'.
    (LaTeX-polyglossia-cleanup): Remove clearing of
    `LaTeX-polyglossia-lang-list'.
    (TeX-update-style-hook): Append
    `LaTeX-polyglossia-load-languages'.
    ("polyglossia"): Remove `LaTeX-polyglossia-load-languages' from
    here.

diff --git a/ChangeLog b/ChangeLog
index 085a926..1e95800 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-09-10  Mosè Giordano  <address@hidden>
+
+       * style/polyglossia.el (LaTeX-polyglossia-prepare): Clear
+       `LaTeX-polyglossia-lang-list'.
+       (LaTeX-polyglossia-cleanup): Remove clearing of
+       `LaTeX-polyglossia-lang-list'.
+       (TeX-update-style-hook): Append
+       `LaTeX-polyglossia-load-languages'.
+       ("polyglossia"): Remove `LaTeX-polyglossia-load-languages' from
+       here.
+
 2015-09-09  Mosè Giordano  <address@hidden>
 
        * style/polyglossia.el: Remove
diff --git a/style/polyglossia.el b/style/polyglossia.el
index 1254f28..86d0add 100644
--- a/style/polyglossia.el
+++ b/style/polyglossia.el
@@ -59,9 +59,10 @@
   "Temporary for parsing polyglossia language options.")
 
 (defun LaTeX-polyglossia-prepare ()
-  "Clear `LaTex-auto-polyglossia-lang' before use."
+  "Clear some polyglossia variables before use."
   (setq LaTeX-auto-polyglossia-lang nil
-       LaTeX-auto-polyglossia-setkeys nil))
+       LaTeX-auto-polyglossia-setkeys nil
+       LaTeX-polyglossia-lang-list nil))
 
 (defun LaTeX-polyglossia-cleanup ()
   "Move languages and their options from
@@ -84,7 +85,6 @@
   ;; the polyglossia command which set the language, the rest of values is the
   ;; list of options given to the language.
   (let (opts otheropts)
-    (setq LaTeX-polyglossia-lang-list nil)
     (mapc
      (lambda (elt)
        (mapc
@@ -109,6 +109,9 @@
 (add-hook 'TeX-auto-prepare-hook #'LaTeX-polyglossia-prepare)
 (add-hook 'TeX-auto-cleanup-hook #'LaTeX-polyglossia-cleanup)
 (add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+;; Run style hooks for every active language.  This *has* to be done after
+;; `TeX-auto-parse'.
+(add-hook 'TeX-update-style-hook #'LaTeX-polyglossia-load-languages t)
 
 (defvar LaTeX-polyglossia-language-list
   '("albanian" "amharic" "arabic" "armenian" "asturian" "bahasai" "bahasam"
@@ -230,10 +233,6 @@ argument, otherwise as a mandatory one."
     `(,LaTeX-polyglossia-lang-regexp (3 1 2) LaTeX-auto-polyglossia-lang))
    (TeX-auto-add-regexp
     `(,LaTeX-polyglossia-setkeys-regexp (1 2) LaTeX-auto-polyglossia-setkeys))
-   ;; Run style hooks for every active language.  FIXME: actually
-   ;; `LaTeX-polyglossia-active-languages' returns nil here, so no style hook 
is
-   ;; automatically loaded.
-   (LaTeX-polyglossia-load-languages)
    (TeX-run-style-hooks "etoolbox" "makecmds" "xkeyval" "fontspec")
    (TeX-add-symbols
     '("setdefaultlanguage" (LaTeX-arg-polyglossia-lang  t  nil nil))

commit ef310fbd852402c15f77a9333c4b7272820933e3
Author: Mosè Giordano <address@hidden>
Date:   Wed Sep 9 18:06:09 2015 +0200

    Create Italian style file for polyglossia.
    
    * style/polyglossia.el: Remove
    `LaTeX-polyglossia-italian-options-list', moved to
    gloss-italian.el.
    (LaTeX-polyglossia-setkeys-regexp): Fix regexp.
    (LaTeX-polyglossia-cleanup): Remove useless let-bound variables
    and set `LaTeX-polyglossia-lang-list'.
    (LaTeX-polyglossia-active-languages)
    (LaTeX-polyglossia-lang-option-member): Use
    `LaTeX-polyglossia-lang-list' variable instead of function.
    (LaTeX-polyglossia-load-languages): New function.
    ("polyglossia"): Use it.
    
    * style/gloss-italian.el: New style file.
    
    * Makefile.in (STYLESRC): Activate it.

diff --git a/ChangeLog b/ChangeLog
index 7433b95..085a926 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2015-09-09  Mosè Giordano  <address@hidden>
 
+       * style/polyglossia.el: Remove
+       `LaTeX-polyglossia-italian-options-list', moved to
+       gloss-italian.el.
+       (LaTeX-polyglossia-setkeys-regexp): Fix regexp.
+       (LaTeX-polyglossia-cleanup): Remove useless let-bound variables
+       and set `LaTeX-polyglossia-lang-list'.
+       (LaTeX-polyglossia-active-languages)
+       (LaTeX-polyglossia-lang-option-member): Use
+       `LaTeX-polyglossia-lang-list' variable instead of function.
+       (LaTeX-polyglossia-load-languages): New function.
+       ("polyglossia"): Use it.
+
+       * style/gloss-italian.el: New style file.
+
+       * Makefile.in (STYLESRC): Activate it.
+
        * style/polyglossia.el: New style file.
 
        * Makefile.in (STYLESRC): Activate it.
diff --git a/Makefile.in b/Makefile.in
index d080257..68b785a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -150,7 +150,8 @@ STYLESRC = style/prosper.el \
           style/mn2e.el      style/colortbl.el  style/attachfile.el \
           style/newpxtext.el style/newpxmath.el style/pdfpages.el \
           style/mnras.el     style/environ.el   style/polyglossia.el \
-          style/vwcol.el     style/textpos.el   style/transparent.el
+          style/vwcol.el     style/textpos.el   style/transparent.el \
+          style/gloss-italian.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/gloss-italian.el b/style/gloss-italian.el
new file mode 100644
index 0000000..a93049a
--- /dev/null
+++ b/style/gloss-italian.el
@@ -0,0 +1,67 @@
+;;; gloss-italian.el --- Italian support for polyglossia package.
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Maintainer: address@hidden
+;; Author: Mosè Giordano <address@hidden>
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+
+;; This is based on italian.el style file, adapted to polyglossia package.
+
+;;; Code:
+
+(defvar TeX-language-it-hook nil
+  "Hook run for Italian texts.")
+
+(TeX-add-style-hook
+ "gloss-italian"
+ (lambda ()
+   (TeX-add-symbols
+    '("textitalian" [TeX-arg-key-val LaTeX-polyglossia-italian-options-list]))
+   (LaTeX-add-environments
+    '("italian" [TeX-arg-key-val LaTeX-polyglossia-italian-options-list]))
+
+   (when (or (LaTeX-polyglossia-lang-option-member "italian" 
"babelshorthands=true")
+            (LaTeX-polyglossia-lang-option-member "italian" "babelshorthands"))
+     (unless (eq (car TeX-quote-language) 'override)
+       (let ((open-quote (if (and (boundp 'LaTeX-italian-open-quote)
+                                 LaTeX-italian-open-quote)
+                            LaTeX-italian-open-quote
+                          "\"<"))
+            (close-quote (if (and (boundp 'LaTeX-italian-close-quote)
+                                  LaTeX-italian-close-quote)
+                             LaTeX-italian-close-quote
+                           "\">")))
+        (setq TeX-quote-language
+              `("italian" ,open-quote ,close-quote ,TeX-quote-after-quote))))
+
+     ;; Fontification of quotation marks.
+     (when (fboundp 'font-latex-add-quotes)
+       (font-latex-add-quotes '("\"<" "\">" french))))
+   (run-hooks 'TeX-language-it-hook))
+ LaTeX-dialect)
+
+(defvar LaTeX-polyglossia-italian-options-list
+  '(("babelshorthands" ("true" "false")))
+  "Italian language options for the polyglossia package.")
+
+;;; gloss-italian.el ends here
diff --git a/style/polyglossia.el b/style/polyglossia.el
index 20249f0..1254f28 100644
--- a/style/polyglossia.el
+++ b/style/polyglossia.el
@@ -29,9 +29,11 @@
 
 ;;; TODO:
 
-;; Create language specific styles with names `gloss-<lang>.el'.  They should
-;; add `text<lang>' macros, `<lang>' environments (`Arabic' for `arabic'
-;; language), and the others language-specific commands.
+;;  -- Create language specific styles with names `gloss-<lang>.el'.  They
+;;     should add `text<lang>' macros, `<lang>' environments (`Arabic' for
+;;     `arabic' language), and the others language-specific commands.
+;;
+;;  -- Make autoloading of these style files really work.
 
 ;;; Code:
 
@@ -47,7 +49,7 @@
 
 (defvar LaTeX-polyglossia-setkeys-regexp
   (concat "\\\\setkeys"
-         "[ \t\n\r]*{\\([A-Za-z]+\\)}[ \t\n\r]*{\\([^}]\\)}")
+         "[ \t\n\r]*{\\([A-Za-z]+\\)}[ \t\n\r]*{\\([^}]*\\)}")
   "Matches polyglossia languages options set using \"\setkeys\".")
 
 (defvar LaTeX-auto-polyglossia-lang nil
@@ -81,7 +83,8 @@
   ;; In each element of the alist, the key is the language, the second value is
   ;; the polyglossia command which set the language, the rest of values is the
   ;; list of options given to the language.
-  (let (tmp newelt opts otheropts)
+  (let (opts otheropts)
+    (setq LaTeX-polyglossia-lang-list nil)
     (mapc
      (lambda (elt)
        (mapc
@@ -93,17 +96,15 @@
          ;; "\setkeys".
          (setq otheropts
                (car (cdr (assoc language LaTeX-auto-polyglossia-setkeys))))
-         (setq newelt
-               (append
-                (list language) (list (nth 1 elt))
-                (unless (equal opts '(""))
-                  (LaTeX-listify-package-options (car opts)))
-                (if otheropts (LaTeX-listify-package-options otheropts))))
-         (add-to-list 'LaTeX-polyglossia-lang-list newelt t)
-         (add-to-list 'tmp newelt t))
+         (add-to-list
+          'LaTeX-polyglossia-lang-list
+          (append
+           (list language) (list (nth 1 elt))
+           (unless (equal opts '(""))
+             (LaTeX-listify-package-options (car opts)))
+           (if otheropts (LaTeX-listify-package-options otheropts))) t))
        (LaTeX-listify-package-options (car elt))))
-     LaTeX-auto-polyglossia-lang)
-    (setq LaTeX-auto-polyglossia-lang tmp)))
+     LaTeX-auto-polyglossia-lang)))
 
 (add-hook 'TeX-auto-prepare-hook #'LaTeX-polyglossia-prepare)
 (add-hook 'TeX-auto-cleanup-hook #'LaTeX-polyglossia-cleanup)
@@ -133,13 +134,13 @@ The last language is the default one."
                         (string-equal "mainlanguage" (nth 1 elt))))
        ;; Append the language to the list if it's the default one.
        (add-to-list 'active-languages (car elt) default))
-     (LaTeX-polyglossia-lang-list))
+     LaTeX-polyglossia-lang-list)
     active-languages))
 
 (defun LaTeX-polyglossia-lang-option-member (language option)
   "Return non-nil if OPTION has been given to polyglossia LANGUAGE.
 The value is actually the tail of the list of options given to LANGUAGE."
-  (member option (cdr (cdr (assoc language (LaTeX-polyglossia-lang-list))))))
+  (member option (cdr (cdr (assoc language LaTeX-polyglossia-lang-list)))))
 
 (defun LaTeX-arg-polyglossia-lang (_optional default multiple setkeys)
   "Prompt for language and its options with completion and insert them
@@ -216,6 +217,11 @@ argument, otherwise as a mandatory one."
                     ;; ("localnumber")
                     )))
 
+(defun LaTeX-polyglossia-load-languages ()
+  "Load style files of babel active languages."
+  (mapc (lambda (elt) (TeX-run-style-hooks (concat "gloss-" elt)))
+       (LaTeX-polyglossia-active-languages)))
+
 (TeX-add-style-hook
  "polyglossia"
  (lambda ()
@@ -224,9 +230,10 @@ argument, otherwise as a mandatory one."
     `(,LaTeX-polyglossia-lang-regexp (3 1 2) LaTeX-auto-polyglossia-lang))
    (TeX-auto-add-regexp
     `(,LaTeX-polyglossia-setkeys-regexp (1 2) LaTeX-auto-polyglossia-setkeys))
-   ;; Run style hooks for every active language.
-   (mapc (lambda (elt) (TeX-run-style-hooks (concat "gloss-" elt)))
-        (LaTeX-polyglossia-active-languages))
+   ;; Run style hooks for every active language.  FIXME: actually
+   ;; `LaTeX-polyglossia-active-languages' returns nil here, so no style hook 
is
+   ;; automatically loaded.
+   (LaTeX-polyglossia-load-languages)
    (TeX-run-style-hooks "etoolbox" "makecmds" "xkeyval" "fontspec")
    (TeX-add-symbols
     '("setdefaultlanguage" (LaTeX-arg-polyglossia-lang  t  nil nil))
@@ -319,10 +326,6 @@ argument, otherwise as a mandatory one."
   '(("numerals" ("Western" "Devanagari")))
   "Hindi language options for the polyglossia package.")
 
-(defvar LaTeX-polyglossia-italian-options-list
-  '(("babelshorthands" ("true" "false")))
-  "Italian language options for the polyglossia package.")
-
 (defvar LaTeX-polyglossia-lao-options-list
   '(("numerals" ("lao" "arabic")))
   "Lao language options for the polyglossia package.")

commit a77ad2f796697fda38a28dbece5b4f3ebb3fd8b7
Author: Mosè Giordano <address@hidden>
Date:   Wed Sep 9 12:07:47 2015 +0200

    Style file for polyglossia package.
    
    * style/polyglossia.el: New style file.
    
    * Makefile.in (STYLESRC): Activate it.

diff --git a/ChangeLog b/ChangeLog
index 94d0da0..7433b95 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-09-09  Mosè Giordano  <address@hidden>
+
+       * style/polyglossia.el: New style file.
+
+       * Makefile.in (STYLESRC): Activate it.
+
 2015-09-08  Arash Esbati  <address@hidden>
 
        * style/hyperref.el ("hyperref"): Add completion for starred
diff --git a/Makefile.in b/Makefile.in
index 9a3b859..d080257 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -149,8 +149,8 @@ STYLESRC = style/prosper.el \
           style/geometry.el  style/ltablex.el   style/ltxtable.el \
           style/mn2e.el      style/colortbl.el  style/attachfile.el \
           style/newpxtext.el style/newpxmath.el style/pdfpages.el \
-          style/mnras.el     style/environ.el   style/textpos.el \
-          style/vwcol.el     style/transparent.el
+          style/mnras.el     style/environ.el   style/polyglossia.el \
+          style/vwcol.el     style/textpos.el   style/transparent.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/polyglossia.el b/style/polyglossia.el
new file mode 100644
index 0000000..20249f0
--- /dev/null
+++ b/style/polyglossia.el
@@ -0,0 +1,355 @@
+;;; polyglossia.el --- AUCTeX style for `polyglossia.sty' version 1.42.0.
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Maintainer: address@hidden
+;; Author: Mosè Giordano <address@hidden>
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+
+;; This file adds support for `polyglossia.sty' version 1.42.0.
+
+;;; TODO:
+
+;; Create language specific styles with names `gloss-<lang>.el'.  They should
+;; add `text<lang>' macros, `<lang>' environments (`Arabic' for `arabic'
+;; language), and the others language-specific commands.
+
+;;; Code:
+
+(require 'tex) ;Indispensable when compiling the call to `TeX-auto-add-type'.
+
+(TeX-auto-add-type "polyglossia-lang" "LaTeX")
+
+;; Self Parsing -- see (info "(auctex)Hacking the Parser").
+(defvar LaTeX-polyglossia-lang-regexp
+  (concat "\\\\set\\(defaultlanguage\\|mainlanguage\\|otherlanguages?\\)"
+         "[ \t\n\r]*\\(?:\\[\\(.*\\)\\]\\)?[ \t\n\r]*{\\([A-Za-z, ]+\\)}")
+  "Matches languages set with polyglossia macros.")
+
+(defvar LaTeX-polyglossia-setkeys-regexp
+  (concat "\\\\setkeys"
+         "[ \t\n\r]*{\\([A-Za-z]+\\)}[ \t\n\r]*{\\([^}]\\)}")
+  "Matches polyglossia languages options set using \"\setkeys\".")
+
+(defvar LaTeX-auto-polyglossia-lang nil
+  "Temporary for parsing polyglossia languages.")
+
+(defvar LaTeX-auto-polyglossia-setkeys nil
+  "Temporary for parsing polyglossia language options.")
+
+(defun LaTeX-polyglossia-prepare ()
+  "Clear `LaTex-auto-polyglossia-lang' before use."
+  (setq LaTeX-auto-polyglossia-lang nil
+       LaTeX-auto-polyglossia-setkeys nil))
+
+(defun LaTeX-polyglossia-cleanup ()
+  "Move languages and their options from
+`LaTeX-auto-polyglossia-lang' to `LaTeX-polyglossia-lang-list'."
+  ;; Example: now the value of `LaTeX-auto-polyglossia-lang' is something like
+  ;;   '(("danish" "defaultlanguage" "")
+  ;;     ("arabic" "otherlanguage" "locale=tunisia,numerals=maghrib")
+  ;;     ("german" "otherlanguage" "spelling=new,script=latin")
+  ;;     ("icelandic,brazil,sanskrit" "otherlanguages" ""))
+  ;; We want to end up with a list like
+  ;;   '(("danish" "defaultlanguage")
+  ;;     ("arabic" "otherlanguage" "locale=tunisia" "numerals=maghrib")
+  ;;     ("german" "otherlanguage" "spelling=new" "script=latin")
+  ;;     ("icelandic" "otherlanguages")
+  ;;     ("brazil" "otherlanguages")
+  ;;     ("sanskrit" "otherlanguages" "script=Devanagari"))
+  ;; with "script=Devanagari" option to "sanskrit" language set using
+  ;; "\setkeys".
+  ;; In each element of the alist, the key is the language, the second value is
+  ;; the polyglossia command which set the language, the rest of values is the
+  ;; list of options given to the language.
+  (let (tmp newelt opts otheropts)
+    (mapc
+     (lambda (elt)
+       (mapc
+       (lambda (language)
+         ;; `opts' is the string of options for `language', set using
+         ;; "\setdefaultlanguage" or "\setotherlanguage".
+         (setq opts (cdr (cdr elt)))
+         ;; `otheropts' is the string of options for `language' set using
+         ;; "\setkeys".
+         (setq otheropts
+               (car (cdr (assoc language LaTeX-auto-polyglossia-setkeys))))
+         (setq newelt
+               (append
+                (list language) (list (nth 1 elt))
+                (unless (equal opts '(""))
+                  (LaTeX-listify-package-options (car opts)))
+                (if otheropts (LaTeX-listify-package-options otheropts))))
+         (add-to-list 'LaTeX-polyglossia-lang-list newelt t)
+         (add-to-list 'tmp newelt t))
+       (LaTeX-listify-package-options (car elt))))
+     LaTeX-auto-polyglossia-lang)
+    (setq LaTeX-auto-polyglossia-lang tmp)))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-polyglossia-prepare)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-polyglossia-cleanup)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(defvar LaTeX-polyglossia-language-list
+  '("albanian" "amharic" "arabic" "armenian" "asturian" "bahasai" "bahasam"
+    "basque" "bengali" "brazil" "breton" "bulgarian" "catalan" "coptic"
+    "croatian" "czech" "danish" "divehi" "dutch" "english" "esperanto"
+    "estonian" "farsi" "finnish" "french" "friulan" "galician" "german" "greek"
+    "hebrew" "hindi" "icelandic" "interlingua" "irish" "italian" "kannada"
+    "khmer" "korean" "lao" "latin" "latvian" "lithuanian" "lsorbian" "magyar"
+    "malayalam" "marathi" "nko" "norsk" "nynorsk" "occitan" "piedmontese"
+    "polish" "portuges" "romanian" "romansh" "russian" "samin" "sanskrit"
+    "scottish" "serbian" "slovak" "slovenian" "spanish" "swedish" "syriac"
+    "tamil" "telugu" "thai" "tibetan" "turkish" "turkmen" "ukrainian" "urdu"
+    "usorbian" "vietnamese" "welsh")
+  "List of languages supported by the polyglossia LaTeX package.")
+
+(defun LaTeX-polyglossia-active-languages ()
+  "Return a list of polyglossia languages used in the document.
+The last language is the default one."
+  (let (active-languages default)
+    (mapc
+     (lambda (elt)
+       (setq default (or (string-equal "defaultlanguage" (nth 1 elt))
+                        (string-equal "mainlanguage" (nth 1 elt))))
+       ;; Append the language to the list if it's the default one.
+       (add-to-list 'active-languages (car elt) default))
+     (LaTeX-polyglossia-lang-list))
+    active-languages))
+
+(defun LaTeX-polyglossia-lang-option-member (language option)
+  "Return non-nil if OPTION has been given to polyglossia LANGUAGE.
+The value is actually the tail of the list of options given to LANGUAGE."
+  (member option (cdr (cdr (assoc language (LaTeX-polyglossia-lang-list))))))
+
+(defun LaTeX-arg-polyglossia-lang (_optional default multiple setkeys)
+  "Prompt for language and its options with completion and insert them
+as arguments.
+
+This function is triggered by \"\setdefaultlanguage\",
+\"\setotherlanguage\", \"\setotherlanguages\", and \"\setkeys\"
+macros by polyglossia package.
+
+OPTIONAL is ignored, if DEFAULT is non-nil treat inserted
+language as default, if MULTIPLE is non-nil prompt for multiple
+languages, if SETKEYS is non-nil insert options as second
+mandatory argument."
+  ;; DEFAULT =  t , MULTIPLE = nil, SETKEYS = nil: "\setdefaultlanguage".
+  ;; DEFAULT = nil, MULTIPLE = nil, SETKEYS = nil: "\setotherlanguage".
+  ;; DEFAULT = nil, MULTIPLE =  t , SETKEYS = nil: "\setotherlanguages".
+  ;; DEFAULT = nil, MULTIPLE = nil, SETKEYS =  t : "\setkeys".
+  (let ((language (funcall
+                  (if multiple
+                      'TeX-completing-read-multiple
+                    'completing-read)
+                  (if multiple "Languages: " "Language: ")
+                  (if setkeys
+                      (LaTeX-polyglossia-active-languages)
+                    LaTeX-polyglossia-language-list)))
+       var  options)
+    (if multiple
+       (mapc (lambda (elt) (TeX-run-style-hooks (concat "gloss-" elt)))
+             language)
+      (TeX-run-style-hooks (concat "gloss-" language)))
+    ;; "\setotherlanguages" doesn't take options, don't prompt for them.
+    (setq options
+         (if multiple ""
+           (setq var (intern (format "LaTeX-polyglossia-%s-options-list" 
language)))
+           (if (and (boundp var) (symbol-value var))
+               ;; "\setdefaultlanguage" and "\setotherlanguage" use `options'
+               ;; as first optional argument; "\setkeys" uses `options' as
+               ;; second mandatory argument.
+               (TeX-read-key-val (not setkeys) (symbol-value var))
+             ;; When `LaTeX-polyglossia-<lang>-options-list' is nil or not
+             ;; defined, don't prompt for options.
+             "")))
+    (unless setkeys
+      (let ((TeX-arg-opening-brace LaTeX-optop)
+           (TeX-arg-closing-brace LaTeX-optcl))
+       (TeX-argument-insert options t)))
+    (if multiple
+       (setq language (mapconcat 'identity language ",")))
+    (TeX-argument-insert language nil)
+    (if setkeys
+       (TeX-argument-insert options nil))))
+
+(defun LaTeX-arg-polyglossiasetup-options (optional)
+  "Prompt for setup options of polyglossia package.
+If OPTIONAL is non-nil, insert the resulting value as an optional
+argument, otherwise as a mandatory one."
+  (TeX-arg-key-val optional
+                  '(("language") ;; TODO: add completion in `fontspec.el', see
+                                 ;; "\newfontlanguage"s in 
`fontspec-xetex.sty'.
+                    ("hyphennames")
+                    ("script") ;; TODO: add completion in `fontspec.el', see
+                               ;; "\newfontscript"s in `fontspec-xetex.sty'.
+                    ("direction" ("RL" "LR"))
+                    ("scripttag")
+                    ("langtag")
+                    ("hyphenmins")
+                    ("frenchspacing" ("true" "false"))
+                    ("indentfirst" ("true" "false"))
+                    ("fontsetup" ("true" "false"))
+                    ;; The following options aren't already implemented but are
+                    ;; present in `polyglossia.sty' comments.
+                    ;; ("nouppercase" ("true" "false"))
+                    ;; ("localalph")
+                    ;; ("localnumber")
+                    )))
+
+(TeX-add-style-hook
+ "polyglossia"
+ (lambda ()
+   (TeX-check-engine-add-engines 'luatex 'xetex)
+   (TeX-auto-add-regexp
+    `(,LaTeX-polyglossia-lang-regexp (3 1 2) LaTeX-auto-polyglossia-lang))
+   (TeX-auto-add-regexp
+    `(,LaTeX-polyglossia-setkeys-regexp (1 2) LaTeX-auto-polyglossia-setkeys))
+   ;; Run style hooks for every active language.
+   (mapc (lambda (elt) (TeX-run-style-hooks (concat "gloss-" elt)))
+        (LaTeX-polyglossia-active-languages))
+   (TeX-run-style-hooks "etoolbox" "makecmds" "xkeyval" "fontspec")
+   (TeX-add-symbols
+    '("setdefaultlanguage" (LaTeX-arg-polyglossia-lang  t  nil nil))
+    '("setmainlanguage"    (LaTeX-arg-polyglossia-lang  t  nil nil))
+    '("setotherlanguage"   (LaTeX-arg-polyglossia-lang nil nil nil))
+    '("setotherlanguages"  (LaTeX-arg-polyglossia-lang nil  t  nil))
+    '("setkeys"            (LaTeX-arg-polyglossia-lang nil nil  t ))
+    '("PolyglossiaSetup"   (TeX-arg-eval completing-read "Language: "
+                                        (LaTeX-polyglossia-active-languages))
+      LaTeX-arg-polyglossiasetup-options)
+    "selectbackgroundlanguage"
+    '("resetdefaultlanguage" ["argument"] 1)
+    "normalfontlatin"
+    "rmfamilylatin"
+    "sffamilylatin"
+    "ttfamilylatin"
+    "selectlanguage"
+    "foreignlanguage")
+
+   (TeX-declare-expert-macros
+    "polyglossia"
+    "PolyglossiaSetup" "selectbackgroundlanguage" "resetdefaultlanguage"
+    "normalfontlatin" "rmfamilylatin" "sffamilylatin" "ttfamilylatin"
+    "selectlanguage" "foreignlanguage")
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("setdefaultlanguage" "[{")
+                               ("setmainlanguage" "[{")
+                               ("setotherlanguage" "[{")
+                               ("setotherlanguages" "{")
+                               ("setkeys" "{{"))
+                             'function)))
+ LaTeX-dialect)
+
+;; TODO: move each option variable in its specific `gloss-<lang>.el' file.
+(defvar LaTeX-polyglossia-arabic-options-list
+  '(("calendar" ("gregorian" "islamic"))
+    ("locale" ("default" "mashriq" "libya" "algeria" "tunisia" "morocco" 
"mauritania"))
+    ("numerals" ("mashriq" "maghrib"))
+    ("abjadjimnotail" ("false" "true")))
+  "Arabic language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-bengali-options-list
+  '(("numerals" ("Western" "Devanagari"))
+    ("changecounternumbering" ("true" "false")))
+  "Bengali language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-catalan-options-list
+  '(("babelshorthands" ("true" "false")))
+  "Catalan language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-dutch-options-list
+  '(("babelshorthands" ("true" "false")))
+  "Dutch language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-english-options-list
+  '(("variant" ("american" "usmax" "british" "australian" "newzealand"))
+    ("ordinalmonthday" ("true" "false")))
+  "English language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-farsi-options-list
+  '(("numerals" ("western" "eastern"))
+    ;; ("locale") ;; not yet implemented
+    ;; ("calendar") ;; not yet implemented
+    )
+  "Farsi language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-german-options-list
+  '(("variant" ("german" "austrian" "swiss"))
+    ("spelling" ("new" "old"))
+    ("latesthyphen" ("true" "false"))
+    ("babelshorthands" ("true" "false"))
+    ("script" ("latin" "fraktur")))
+  "German language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-greek-options-list
+  '(("variant" ("monotonic" "polytonic" "ancient"))
+    ("numerals" ("greek" "arabic"))
+    ("attic" ("true" "false")))
+  "Greek language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-hebrew-options-list
+  '(("numerals" ("hebrew" "arabic"))
+    ("calendar" ("hebrew" "gregorian")))
+  "Hebrew language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-hindi-options-list
+  '(("numerals" ("Western" "Devanagari")))
+  "Hindi language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-italian-options-list
+  '(("babelshorthands" ("true" "false")))
+  "Italian language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-lao-options-list
+  '(("numerals" ("lao" "arabic")))
+  "Lao language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-russian-options-list
+  '(("spelling" ("modern" "old"))
+    ("babelshorthands" ("true" "false")))
+  "Russian language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-sanskrit-options-list
+  '(("Script" ("Devanagari")))
+  "Sanskrit language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-serbian-options-list
+  '(("script" ("cyrillic" "latin")))
+  "Serbian language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-syriac-options-list
+  '(("numerals" ("western" "eastern" "abjad")))
+  "Syriac language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-thai-options-list
+  '(("numerals" ("thai" "arabic")))
+  "Thai language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-package-options
+  '("babelshorthands" "localmarks" "nolocalmarks" "quiet")
+  "Package options for the polyglossia package.")
+
+;;; polyglossia.el ends here

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                         |   52 ++++++
 Makefile.in                       |    6 +-
 style/Alegreya.el                 |  100 +++++++++++
 style/AlegreyaSans.el             |  112 ++++++++++++
 style/eso-pic.el                  |    7 +-
 style/{ltxtable.el => fontenc.el} |   47 +++---
 style/gloss-italian.el            |   68 +++++++
 style/polyglossia.el              |  355 +++++++++++++++++++++++++++++++++++++
 8 files changed, 718 insertions(+), 29 deletions(-)
 create mode 100644 style/Alegreya.el
 create mode 100644 style/AlegreyaSans.el
 copy style/{ltxtable.el => fontenc.el} (51%)
 create mode 100644 style/gloss-italian.el
 create mode 100644 style/polyglossia.el


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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