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, created. a3c


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, simplify-TeX-parse-error, created. a3cf163db35f797c00ab464135cac9256af6f418
Date: Fri, 26 May 2017 09:31:26 -0400 (EDT)

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 created
        at  a3cf163db35f797c00ab464135cac9256af6f418 (commit)

- Log -----------------------------------------------------------------
commit a3cf163db35f797c00ab464135cac9256af6f418
Merge: fbc5165 d9f61d5
Author: Tassilo Horn <address@hidden>
Date:   Sun Jan 31 08:17:25 2016 +0100

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


commit fbc5165daa3dcb5d6d2fc9c947e9633dc4ef1467
Merge: f000a0b 255efa3
Author: Tassilo Horn <address@hidden>
Date:   Sun Jan 24 06:32:22 2016 +0100

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


commit f000a0bb3c5de2bfedbfff7b99c748549c68feba
Merge: 0de9c08 d2c7bb3
Author: Tassilo Horn <address@hidden>
Date:   Sat Jan 23 10:28:18 2016 +0100

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


commit 0de9c08c7755368e1296070559a669d23677c541
Merge: db7c849 bafe761
Author: Tassilo Horn <address@hidden>
Date:   Thu Jan 14 19:38:08 2016 +0100

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


commit db7c8490709733bdb6d9ef3e17c34c0eccacf648
Merge: a650874 2ebd71d
Author: Tassilo Horn <address@hidden>
Date:   Wed Dec 30 08:05:48 2015 +0100

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


commit a650874164299cd8c8b3f24623e363ac4c799934
Merge: 3cdd61e 23612ac
Author: Tassilo Horn <address@hidden>
Date:   Fri Dec 4 21:21:53 2015 +0100

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


commit 3cdd61ef8d674daa913dbfab871affb1ce3ce278
Merge: afca361 15ebec9
Author: Tassilo Horn <address@hidden>
Date:   Tue Nov 24 06:09:09 2015 +0100

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


commit afca3618d4faf22fa329b5c5448d8a9a15f5b250
Merge: 5bce504 d68a089
Author: Tassilo Horn <address@hidden>
Date:   Mon Nov 23 20:08:51 2015 +0100

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


commit 5bce50433c39c4c095f7a3de5dd783b906867b61
Merge: 05e901a fac521d
Author: Tassilo Horn <address@hidden>
Date:   Sat Nov 21 07:35:24 2015 +0100

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


commit 05e901a599163213b7365103cb8c8a34b6baa0aa
Merge: 153c71f 7427d62
Author: Tassilo Horn <address@hidden>
Date:   Fri Nov 13 17:29:16 2015 +0100

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


commit 153c71fb73bed52fb9240034b7f7bd62653e1abc
Merge: 2fe789a 3aa4bdb
Author: Tassilo Horn <address@hidden>
Date:   Tue Nov 10 21:06:52 2015 +0100

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


commit 2fe789ae71ea440d043f59e4e07a3c16ecd39e29
Merge: a24965a b3153ec
Author: Tassilo Horn <address@hidden>
Date:   Tue Nov 10 21:00:49 2015 +0100

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


commit a24965a44241b5099575065d48475a80407b667e
Merge: 5fd0f6f c39c63f
Author: Tassilo Horn <address@hidden>
Date:   Mon Nov 9 18:14:00 2015 +0100

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


commit 5fd0f6f921ded158e2f3b014c9df248229aa155a
Merge: cee95c4 a2f8bc6
Author: Tassilo Horn <address@hidden>
Date:   Wed Oct 28 10:25:46 2015 +0100

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


commit cee95c47edbaa84cc0099dc4a5205e42b58f3f75
Merge: a28b1d5 b4f95f9
Author: Tassilo Horn <address@hidden>
Date:   Wed Oct 28 09:01:37 2015 +0100

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

diff --cc ChangeLog
index 40f899d,ca1d4e3..2bc19b2
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,5 -1,8 +1,10 @@@
  2015-10-28  Tassilo Horn  <address@hidden>
  
+       * latex.el (LaTeX-fill-break-at-separators): Default to nil
+       because many users don't like that special filling.
+ 
++2015-10-28  Tassilo Horn  <address@hidden>
++
        * tex-info.el (Texinfo-make-node-list): Warn about duplicate
        nodes.  Return nodes in order instead of reversed.
  

commit a28b1d5b05cf356943736469de05ac944d82fd13
Merge: 56339a8 fb09c26
Author: Tassilo Horn <address@hidden>
Date:   Wed Oct 28 08:41:08 2015 +0100

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


commit 56339a8f39d7f7aa917b672264c4def444f3a443
Merge: e6969ac d56502e
Author: Tassilo Horn <address@hidden>
Date:   Mon Oct 26 09:42:04 2015 +0100

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


commit e6969ac630f81f1f01d308ad9503af4d88d0f3f0
Merge: 8dc84d6 dbeb71f
Author: Tassilo Horn <address@hidden>
Date:   Sun Oct 25 11:52:37 2015 +0100

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


commit 8dc84d60c7f2b182a8489cb6197fbbf1db8ac76b
Merge: 26c409d b072f9c
Author: Tassilo Horn <address@hidden>
Date:   Mon Oct 19 11:19:00 2015 +0200

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


commit 26c409d8fd848870aedf23a742e239d1604176a3
Merge: f12a9d5 1f116b8
Author: Tassilo Horn <address@hidden>
Date:   Fri Oct 9 07:57:23 2015 +0200

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


commit f12a9d5eaeada5bc1daed4488e41958f2fb7dcaa
Merge: 5f29c4c ce8981a
Author: Tassilo Horn <address@hidden>
Date:   Sun Oct 4 20:47:33 2015 +0200

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


commit 5f29c4c63276de5af82f2a2dfd508ebeed5b29d2
Merge: feda63b 0c4e740
Author: Tassilo Horn <address@hidden>
Date:   Wed Sep 30 10:42:56 2015 +0200

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


commit feda63babfd07cf17210f1a8622e6c206b4b751a
Merge: 4e7b965 5ee567c
Author: Tassilo Horn <address@hidden>
Date:   Tue Sep 29 07:57:34 2015 +0200

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


commit 4e7b9650e7ca2618ea2145c54f29fb4eb6819f2c
Merge: 956e6a3 3bb1cbe
Author: Tassilo Horn <address@hidden>
Date:   Sat Sep 26 07:45:12 2015 +0200

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


commit 956e6a3e96f9237853cf81495764e1a0f3ea620b
Merge: bff417c a864241
Author: Tassilo Horn <address@hidden>
Date:   Sat Sep 26 06:55:25 2015 +0200

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


commit bff417c597c25222d7f10676c5240c1f2d24b07f
Merge: c4b8724 9cfd5d8
Author: Tassilo Horn <address@hidden>
Date:   Tue Sep 22 15:35:34 2015 +0200

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


commit c4b87247f141f0291ed9b1bc25521b3b39137058
Author: Tassilo Horn <address@hidden>
Date:   Sat Sep 19 13:59:52 2015 +0200

    FiX TeX error parsing.
    
    * tex-buf.el (TeX-TeX-sentinel): Fix error parsing.

diff --git a/ChangeLog b/ChangeLog
index 358b5d8..823f041 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2015-09-19  Tassilo Horn  <address@hidden>
 
        * tex-buf.el (TeX-error-overview): Fix typo in error message.
+       (TeX-TeX-sentinel): Fix error parsing.
 
 2015-09-13  Arash Esbati  <address@hidden>
 
diff --git a/tex-buf.el b/tex-buf.el
index b5725d4..a03f5fd 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -1267,12 +1267,12 @@ Open the error overview if
 `TeX-error-overview-open-after-TeX-run' is non-nil and there are
 errors or warnings to show."
   (if (TeX-TeX-sentinel-check process name)
-      ()
+      (progn
+       (if TeX-parse-all-errors
+           (TeX-parse-all-errors))
+       (if (and TeX-error-overview-open-after-TeX-run TeX-error-list)
+           (TeX-error-overview)))
     (message (concat name ": formatted " (TeX-current-pages)))
-    (if TeX-parse-all-errors
-       (TeX-parse-all-errors))
-    (if (and TeX-error-overview-open-after-TeX-run TeX-error-list)
-       (TeX-error-overview))
     (if (with-current-buffer TeX-command-buffer
          (and TeX-PDF-via-dvips-ps2pdf TeX-PDF-mode))
        (setq TeX-command-next "Dvips")

commit dde22742b9743adb408b01c5349816ac6c76faba
Merge: 4ef7202 9b5827c
Author: Tassilo Horn <address@hidden>
Date:   Sat Sep 19 13:29:05 2015 +0200

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


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

commit c1dcf3a804bbba3db076d6b9c4677532094f3fad
Merge: 4cf2749 29261e3
Author: Tassilo Horn <address@hidden>
Date:   Wed Sep 9 08:08:44 2015 +0200

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


commit 4cf274972cd2a81a97c7427a096923cc98323b7b
Merge: 6f365c5 69004bc
Author: Tassilo Horn <address@hidden>
Date:   Tue Sep 8 13:35:52 2015 +0200

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


commit 6f365c53646728de857796bbf96cabe5a121cffa
Merge: 0719b3d d4ba585
Author: Tassilo Horn <address@hidden>
Date:   Sat Sep 5 01:07:11 2015 +0200

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


commit 0719b3db936ad7eddbbd6bd083fb02c72f04a9e6
Merge: 9ee4f28 647a8fc
Author: Tassilo Horn <address@hidden>
Date:   Fri Sep 4 11:00:05 2015 +0200

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


commit 9ee4f28a47e433836829ff3f1b028f3376f34101
Merge: 0a0eb3e 22c7d9f
Author: Tassilo Horn <address@hidden>
Date:   Fri Sep 4 09:40:06 2015 +0200

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


commit 0a0eb3eea718b5b4aaa07e7b04add24d9b2e7cc3
Author: Tassilo Horn <address@hidden>
Date:   Fri Sep 4 09:29:01 2015 +0200

    Implement "run-all" for regions and sections
    
    * tex.el: Add autoloads for the new commands.
    
    * tex-buf.el (TeX-region-update): New function.
    (TeX-command-region): Use it.
    (LaTeX-command-section-boundaries): New function.
    (LaTeX-command-section): Use it.
    (TeX-command-run-all-region): New command.
    (LaTeX-command-run-all-section): New command.
    (TeX-command-run-all): Move it here from tex.el.

diff --git a/ChangeLog b/ChangeLog
index 771f6f4..8a60c7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2015-09-04  Tassilo Horn  <address@hidden>
 
+       * tex.el: Add autoloads for the new commands.
+
+       * tex-buf.el (TeX-region-update): New function.
+       (TeX-command-region): Use it.
+       (LaTeX-command-section-boundaries): New function.
+       (LaTeX-command-section): Use it.
+       (TeX-command-run-all-region): New command.
+       (LaTeX-command-run-all-section): New command.
+       (TeX-command-run-all): Move it here from tex.el.
+
        * tex.el (TeX-command-run-all): Rename from TeX-update.
        (TeX-mode-map): Bind TeX-command-run-all to C-c C-a.
 
diff --git a/tex-buf.el b/tex-buf.el
index 23060bb..a670ee4 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -142,6 +142,21 @@ pinned region will get unpinned and vice versa."
     (setq TeX-command-region-end nil)
     (message "TeX region unpinned.")))
 
+(defun TeX-region-update ()
+  "Update the TeX-region file."
+  ;; Note that TeX-command-region-begin is not a marker when called
+  ;; from TeX-command-buffer.
+  (and (or (null TeX-command-region-begin)
+          (markerp TeX-command-region-begin))
+       (TeX-active-mark)
+       (TeX-pin-region (region-beginning) (region-end)))
+  (let ((begin (or TeX-command-region-begin (region-beginning)))
+       (end (or TeX-command-region-end (region-end))))
+    (TeX-region-create (TeX-region-file TeX-default-extension)
+                      (buffer-substring begin end)
+                      (file-name-nondirectory (buffer-file-name))
+                      (TeX-current-offset begin))))
+
 (defun TeX-command-region (&optional override-confirm)
   "Run TeX on the current region.
 
@@ -163,18 +178,7 @@ If the master file for the document has a trailer, it is 
written to
 the temporary file before the region itself.  The document's trailer is
 all text after `TeX-trailer-start'."
   (interactive "P")
-  ;; Note that TeX-command-region-begin is not a marker when called
-  ;; from TeX-command-buffer.
-  (and (or (null TeX-command-region-begin)
-          (markerp TeX-command-region-begin))
-       (TeX-active-mark)
-       (TeX-pin-region (region-beginning) (region-end)))
-  (let ((begin (or TeX-command-region-begin (region-beginning)))
-       (end (or TeX-command-region-end (region-end))))
-    (TeX-region-create (TeX-region-file TeX-default-extension)
-                      (buffer-substring begin end)
-                      (file-name-nondirectory (buffer-file-name))
-                      (TeX-current-offset begin)))
+  (TeX-region-update)
   (TeX-command (TeX-command-query (TeX-region-file nil t)) 'TeX-region-file
               override-confirm))
 
@@ -511,7 +515,7 @@ without further expansion."
                               ;; Advance past the file name in order to
                               ;; prevent expanding any substring of it.
                               (setq pos (+ pos (length expansion-res))))
-                              expansion-res)
+                           expansion-res)
                           (t
                            (error "Nonexpansion %s" expansion)))))
       (if (stringp string)
@@ -634,7 +638,7 @@ omitted) and `TeX-region-file'."
        (setq cmd (funcall command)
              TeX-command-sequence-command command))
        (t
-       (setq cmd (TeX-command-default (funcall file-fn))
+       (setq cmd (TeX-command-default (funcall file-fn nil t))
              TeX-command-sequence-command t)))
       (TeX-command cmd file-fn 0)
       (when reset
@@ -1867,6 +1871,27 @@ levels are defined by `LaTeX-section-list'."
                 old-level (car (rassoc (list LaTeX-command-section-level)
                                        LaTeX-section-list)))))))
 
+(defun LaTeX-command-section-boundaries ()
+  "Return the boundaries of the current section as (start . end).
+The section is determined by `LaTeX-command-section-level'."
+  (let* ((case-fold-search nil)
+        (rx (concat "\\\\" (regexp-opt
+                            (mapcar
+                             (lambda (level)
+                               (car (rassoc (list level) LaTeX-section-list)))
+                             (let (r)
+                               (dotimes (i (1+ (LaTeX-command-section-level)))
+                                 (push i r))
+                               r)))
+                    "{")))
+    (cons (save-excursion
+           (re-search-backward rx nil t)
+           (point))
+         (save-excursion
+           (re-search-forward rx nil t)
+           (forward-line 0)
+           (point)))))
+
 (defun LaTeX-command-section (&optional override-confirm)
   "Run a command on the current section.
 
@@ -1882,25 +1907,39 @@ If a prefix argument OVERRIDE-CONFIRM is given, 
confirmation will
 depend on it being positive instead of the entry in
 `TeX-command-list'."
   (interactive "P")
-  (let* ((case-fold-search t)
-        (rx (concat "\\\\" (regexp-opt
-                            (mapcar
-                             (lambda (level)
-                               (car (rassoc (list level) LaTeX-section-list)))
-                             (let (r)
-                               (dotimes (i (1+ (LaTeX-command-section-level)))
-                                 (push i r))
-                               r)))
-                    "{"))
-        (TeX-command-region-begin (save-excursion
-                                    (re-search-backward rx nil t)
-                                    (point)))
-        (TeX-command-region-end (save-excursion
-                                  (re-search-forward rx nil t)
-                                  (forward-line 0)
-                                  (point))))
+  (let* ((bounds (LaTeX-command-section-boundaries))
+        (TeX-command-region-begin (car bounds))
+        (TeX-command-region-end (cdr bounds)))
     (TeX-command-region override-confirm)))
 
+(defun TeX-command-run-all-region ()
+  "Compile the current region until an error occurs or it is finished."
+  (interactive)
+  (TeX-region-update)
+  (TeX-command-sequence t t #'TeX-region-file))
+
+(defun LaTeX-command-run-all-section ()
+  "Compile the current section until an error occurs or it is finished."
+  (interactive)
+  (let* ((bounds (LaTeX-command-section-boundaries))
+        (TeX-command-region-begin (car bounds))
+        (TeX-command-region-end (cdr bounds)))
+    (TeX-region-update))
+  (TeX-command-sequence t t #'TeX-region-file))
+
+(defun TeX-command-run-all (arg)
+  "Compile the current document until an error occurs or it is finished.
+With a prefix ARG (`C-u \\[TeX-command-run-all]'), compile the
+current region instead, e.g, call `TeX-command-run-all-region'.
+With multiple prefix arguments (`C-u C-u
+\\[TeX-command-run-all]'), compile the current section instead,
+e.g. call `LaTeX-command-run-all-section'."
+  (interactive "P")
+  (cond
+   ((null arg)       (TeX-command-sequence t t))
+   ((= 4 (car arg))  (TeX-command-run-all-region))
+   (t                (LaTeX-command-run-all-section))))
+
 ;;; Parsing
 
 ;;; - Global Parser Variables
@@ -2424,40 +2463,40 @@ a bad box."
 
 (defcustom TeX-error-description-list
   '(("\\(?:Package Preview Error\\|Preview\\):.*" .
-"The `auctex' option to `preview' should not be applied manually.
+     "The `auctex' option to `preview' should not be applied manually.
 If you see this error message outside of a preview run, either
 you did something too clever, or AUCTeX something too stupid.")
 
     ("Bad \\\\line or \\\\vector argument.*" .
-"The first argument of a \\line or \\vector command, which specifies the
+     "The first argument of a \\line or \\vector command, which specifies the
 slope, is illegal\.")
 
     ("Bad math environment delimiter.*" .
-"TeX has found either a math-mode-starting command such as \\[ or \\(
+     "TeX has found either a math-mode-starting command such as \\[ or \\(
 when it is already in math mode, or else a math-mode-ending command
 such as \\) or \\] while in LR or paragraph mode.  The problem is caused
 by either unmatched math mode delimiters or unbalanced braces\.")
 
     ("Bad use of \\\\\\\\.*" .
-"A \\\\ command appears between paragraphs, where it makes no sense. This
+     "A \\\\ command appears between paragraphs, where it makes no sense. This
 error message occurs when the \\\\ is used in a centering or flushing
 environment or else in the scope of a centering or flushing
 declaration.")
 
     ("\\\\begin{[^ ]*} ended by \\\\end{[^ ]*}." .
-"LaTeX has found an \\end command that doesn't match the corresponding
+     "LaTeX has found an \\end command that doesn't match the corresponding
 \\begin command. You probably misspelled the environment name in the
 \\end command, have an extra \\begin, or else forgot an \\end.")
 
     ("Can be used only in preamble." .
-"LaTeX has encountered, after the \\begin{document}, one of the
+     "LaTeX has encountered, after the \\begin{document}, one of the
 following commands that should appear only in the preamble:
 \\documentclass, \\nofiles, \\includeonly, \\makeindex, or
 \\makeglossary.  The error is also caused by an extra \\begin{document}
 command.")
 
     ("Command name [^ ]* already used.*" .
-"You are using \\newcommand, \\newenvironment, \\newlength, \\newsavebox,
+     "You are using \\newcommand, \\newenvironment, \\newlength, \\newsavebox,
 or \\newtheorem to define a command or environment name that is
 already defined, or \\newcounter to define a counter that already
 exists. (Defining an environment named gnu automatically defines the
@@ -2465,7 +2504,7 @@ command \\gnu.) You'll have to choose a new name or, in 
the case of
 \\newcommand or \\newenvironment, switch to the \\renew ...  command.")
 
     ("Counter too large." .
-"1. Some object that is numbered with letters, probably an item in a
+     "1. Some object that is numbered with letters, probably an item in a
 enumerated list, has received a number greater than 26. Either you're
 making a very long list or you've been resetting counter values.
 
@@ -2474,11 +2513,11 @@ and LaTeX has run out of letters or symbols. This is 
probably caused
 by too many \\thanks commands.")
 
     ("Environment [^ ]* undefined." .
-"LaTeX has encountered a \\begin command for a nonexistent environment.
+     "LaTeX has encountered a \\begin command for a nonexistent environment.
 You probably misspelled the environment name. ")
 
     ("Float(s) lost." .
-"You put a figure or table environment or a \\marginpar command inside a
+     "You put a figure or table environment or a \\marginpar command inside a
 parbox---either one made with a minipage environment or \\parbox
 command, or one constructed by LaTeX in making a footnote, figure,
 etc. This is an outputting error, and the offending environment or
@@ -2487,70 +2526,70 @@ the problem. One or more figures, tables, and/or 
marginal notes have
 been lost, but not necessarily the one that caused the error.")
 
     ("Illegal character in array arg." .
-"There is an illegal character in the argument of an array or tabular
+     "There is an illegal character in the argument of an array or tabular
 environment, or in the second argument of a \\multicolumn command.")
 
     ("Missing \\\\begin{document}." .
-"LaTeX produced printed output before encountering a \\begin{document}
+     "LaTeX produced printed output before encountering a \\begin{document}
 command. Either you forgot the \\begin{document} command or there is
 something wrong in the preamble. The problem may be a stray character
 or an error in a declaration---for example, omitting the braces around
 an argument or forgetting the \\ in a command name.")
 
     ("Missing p-arg in array arg.*" .
-"There is a p that is not followed by an expression in braces in the
+     "There is a p that is not followed by an expression in braces in the
 argument of an array or tabular environment, or in the second argument
 of a \\multicolumn command.")
 
     ("Missing @-exp in array arg." .
-"There is an @ character not followed by an @-expression in the
+     "There is an @ character not followed by an @-expression in the
 argument of an array or tabular environment, or in the second argument
 of a \\multicolumn command.")
 
     ("No such counter." .
-"You have specified a nonexistent counter in a \\setcounter or
+     "You have specified a nonexistent counter in a \\setcounter or
 \\addtocounter command. This is probably caused by a simple typing
 error.  However, if the error occurred while a file with the extension
 aux is being read, then you probably used a \\newcounter command
 outside the preamble.")
 
     ("Not in outer par mode." .
-"You had a figure or table environment or a \\marginpar command in math
+     "You had a figure or table environment or a \\marginpar command in math
 mode or inside a parbox.")
 
     ("\\\\pushtabs and \\\\poptabs don't match." .
-"LaTeX found a \\poptabs with no matching \\pushtabs, or has come to the
+     "LaTeX found a \\poptabs with no matching \\pushtabs, or has come to the
 \\end{tabbing} command with one or more unmatched \\pushtabs commands.")
 
     ("Something's wrong--perhaps a missing \\\\item." .
-"The most probable cause is an omitted \\item command in a list-making
+     "The most probable cause is an omitted \\item command in a list-making
 environment. It is also caused by forgetting the argument of a
 thebibliography environment.")
 
     ("Tab overflow." .
-"A \\= command has exceeded the maximum number of tab stops that LaTeX
+     "A \\= command has exceeded the maximum number of tab stops that LaTeX
 permits.")
 
     ("There's no line here to end." .
-"A \\newline or \\\\ command appears between paragraphs, where it makes no
+     "A \\newline or \\\\ command appears between paragraphs, where it makes no
 sense. If you're trying to ``leave a blank line'', use a \\vspace
 command.")
 
     ("This may be a LaTeX bug." .
-"LaTeX has become thoroughly confused. This is probably due to a
+     "LaTeX has become thoroughly confused. This is probably due to a
 previously detected error, but it is possible that you have found an
 error in LaTeX itself. If this is the first error message produced by
 the input file and you can't find anything wrong, save the file and
 contact the person listed in your Local Guide.")
 
     ("Too deeply nested." .
-"There are too many list-making environments nested within one another.
+     "There are too many list-making environments nested within one another.
 How many levels of nesting are permitted may depend upon what computer
 you are using, but at least four levels are provided, which should be
 enough.")
 
     ("Too many unprocessed floats." .
-"While this error can result from having too many \\marginpar commands
+     "While this error can result from having too many \\marginpar commands
 on a page, a more likely cause is forcing LaTeX to save more figures
 and tables than it has room for.  When typesetting its continuous
 scroll, LaTeX saves figures and tables separately and inserts them as
@@ -2566,38 +2605,38 @@ argument says it must go. This is likely to happen if 
the argument
 does not contain a p option.")
 
     ("Undefined tab position." .
-"A \\>, \\+, \\-, or \\< command is trying to go to a nonexistent tab
+     "A \\>, \\+, \\-, or \\< command is trying to go to a nonexistent tab
 position---one not defined by a \\= command.")
 
     ("\\\\< in mid line." .
-"A \\< command appears in the middle of a line in a tabbing environment.
+     "A \\< command appears in the middle of a line in a tabbing environment.
 This command should come only at the beginning of a line.")
 
     ("Double subscript." .
-"There are two subscripts in a row in a mathematical
+     "There are two subscripts in a row in a mathematical
 formula---something like x_{2}_{3}, which makes no sense.")
 
     ("Double superscript." .
-"There are two superscripts in a row in a mathematical
+     "There are two superscripts in a row in a mathematical
 formula---something like x^{2}^{3}, which makes no sense.")
 
     ("Extra alignment tab has been changed to \\\\cr." .
-"There are too many separate items (column entries) in a single row of
+     "There are too many separate items (column entries) in a single row of
 an array or tabular environment. In other words, there were too many &
 's before the end of the row. You probably forgot the \\\\ at the end of
 the preceding row.")
 
     ("Extra \\}, or forgotten \\$." .
-"The braces or math mode delimiters don't match properly. You probably
+     "The braces or math mode delimiters don't match properly. You probably
 forgot a {, \\[, \\(, or $.")
 
     ("Font [^ ]* not loaded: Not enough room left." .
-"The document uses more fonts than TeX has room for. If different parts
+     "The document uses more fonts than TeX has room for. If different parts
 of the document use different fonts, then you can get around the
 problem by processing it in parts.")
 
     ("I can't find file `.*'." .
-"TeX can't find a file that it needs. If the name of the missing file
+     "TeX can't find a file that it needs. If the name of the missing file
 has the extension tex, then it is looking for an input file that you
 specified---either your main file or another file inserted with an
 \\input or \\include command. If the missing file has the extension sty
@@ -2605,7 +2644,7 @@ specified---either your main file or another file 
inserted with an
 option.")
 
     ("Illegal parameter number in definition of .*" .
-"This is probably caused by a \\newcommand, \\renewcommand,
+     "This is probably caused by a \\newcommand, \\renewcommand,
 \\newenvironment, or \\renewenvironment command in which a # is used
 incorrectly.  A # character, except as part of the command name \\#,
 can be used only to indicate an argument parameter, as in #2, which
@@ -2615,7 +2654,7 @@ like #2 in the last argument of a \\newenvironment or 
\\renewenvironment
 command.")
 
     ("Illegal unit of measure ([^ ]* inserted)." .
-"If you just got a
+     "If you just got a
 
       ! Missing number, treated as zero.
 
@@ -2627,16 +2666,16 @@ should result in correct output. However, the error can 
also be caused
 by omitting a command argument.")
 
     ("Misplaced alignment tab character \\&." .
-"The special character &, which should be used only to separate items
+     "The special character &, which should be used only to separate items
 in an array or tabular environment, appeared in ordinary text. You
 probably meant to type \\&.")
 
     ("Missing control sequence inserted." .
-"This is probably caused by a \\newcommand, \\renewcommand, \\newlength,
+     "This is probably caused by a \\newcommand, \\renewcommand, \\newlength,
 or \\newsavebox command whose first argument is not a command name.")
 
     ("Missing number, treated as zero." .
-"This is usually caused by a LaTeX command expecting but not finding
+     "This is usually caused by a LaTeX command expecting but not finding
 either a number or a length as an argument. You may have omitted an
 argument, or a square bracket in the text may have been mistaken for
 the beginning of an optional argument. This error is also caused by
@@ -2644,11 +2683,11 @@ putting \\protect in front of either a length command 
or a command such
 as \\value that produces a number.")
 
     ("Missing [{}] inserted." .
-"TeX has become confused. The position indicated by the error locator
+     "TeX has become confused. The position indicated by the error locator
 is probably beyond the point where the incorrect input is.")
 
     ("Missing \\$ inserted." .
-"TeX probably found a command that can be used only in math mode when
+     "TeX probably found a command that can be used only in math mode when
 it wasn't in math mode.  Remember that unless stated otherwise, all
 all the commands of Section 3.3 in LaTeX Book (Lamport) can be used
 only in math mode. TeX is not in math mode when it begins processing
@@ -2657,28 +2696,28 @@ math environment. This error also occurs if TeX 
encounters a blank
 line when it is in math mode.")
 
     ("Not a letter." .
-"Something appears in the argument of a \\hyphenation command that
+     "Something appears in the argument of a \\hyphenation command that
 doesn't belong there.")
 
     ("Paragraph ended before [^ ]* was complete." .
-"A blank line occurred in a command argument that shouldn't contain
+     "A blank line occurred in a command argument that shouldn't contain
 one. You probably forgot the right brace at the end of an argument.")
 
     ("\\\\[^ ]*font [^ ]* is undefined .*" .
-"These errors occur when an uncommon font is used in math mode---for
+     "These errors occur when an uncommon font is used in math mode---for
 example, if you use a \\sc command in a formula inside a footnote,
 calling for a footnote-sized small caps font.  This problem is solved
 by using a \\load command.")
 
     ("Font .* not found." .
-"You requested a family/series/shape/size combination that is totally
+     "You requested a family/series/shape/size combination that is totally
 unknown.  There are two cases in which this error can occur:
   1) You used the \\size macro to select a size that is not available.
   2) If you did not do that, go to your local `wizard' and
      complain fiercely that the font selection tables are corrupted!")
 
     ("TeX capacity exceeded, sorry .*" .
-"TeX has just run out of space and aborted its execution. Before you
+     "TeX has just run out of space and aborted its execution. Before you
 panic, remember that the least likely cause of this error is TeX not
 having the capacity to process your document.  It was probably an
 error in your input file that caused TeX to run out of room. The
@@ -2779,14 +2818,14 @@ turn has a \\footnotesize declaration whose scope 
contains a \\multiput
 command containing a ....")
 
     ("Text line contains an invalid character." .
-"The input contains some strange character that it shouldn't. A mistake
+     "The input contains some strange character that it shouldn't. A mistake
 when creating the file probably caused your text editor to insert this
 character. Exactly what could have happened depends upon what text
 editor you used. If examining the input file doesn't reveal the
 offending character, consult the Local Guide for suggestions.")
 
     ("Undefined control sequence."   .
-"TeX encountered an unknown command name. You probably misspelled the
+     "TeX encountered an unknown command name. You probably misspelled the
 name. If this message occurs when a LaTeX command is being processed,
 the command is probably in the wrong place---for example, the error
 can be produced by an \\item command that's not inside a list-making
@@ -2794,43 +2833,43 @@ environment. The error can also be caused by a missing 
\\documentclass
 command.")
 
     ("Use of [^ ]* doesn't match its definition." .
-"It's probably one of the picture-drawing commands, and you have used
+     "It's probably one of the picture-drawing commands, and you have used
 the wrong syntax for specifying an argument. If it's address@hidden that
 doesn't match its definition, then there is something wrong in an
 @-expression in the argument of an array or tabular
 environment---perhaps a fragile command that is not \\protect'ed.")
 
     ("You can't use `macro parameter character \\#' in [^ ]* mode." .
-"The special character # has appeared in ordinary text. You probably
+     "The special character # has appeared in ordinary text. You probably
 meant to type \\#.")
 
     ("Overfull \\\\hbox .*" .
-"Because it couldn't find a good place for a line break, TeX put more
+     "Because it couldn't find a good place for a line break, TeX put more
 on this line than it should.")
 
     ("Overfull \\\\vbox .*" .
-"Because it couldn't find a good place for a page break, TeX put more
+     "Because it couldn't find a good place for a page break, TeX put more
 on the page than it should. ")
 
     ("Underfull \\\\hbox .*" .
-"Check your output for extra vertical space.  If you find some, it was
+     "Check your output for extra vertical space.  If you find some, it was
 probably caused by a problem with a \\\\ or \\newline command---for
 example, two \\\\ commands in succession. This warning can also be
 caused by using the sloppypar environment or \\sloppy declaration, or
 by inserting a \\linebreak command.")
 
     ("Underfull \\\\vbox .*" .
-"TeX could not find a good place to break the page, so it produced a
+     "TeX could not find a good place to break the page, so it produced a
 page without enough text on it. ")
 
-;; New list items should be placed here
-;;
-;; ("err-regexp" . "context")
-;;
-;; the err-regexp item should match anything
+    ;; New list items should be placed here
+    ;;
+    ;; ("err-regexp" . "context")
+    ;;
+    ;; the err-regexp item should match anything
 
     (".*" . "No help available"))      ; end definition
-"A list of the form (\"err-regexp\" . \"context\") used by function
+  "A list of the form (\"err-regexp\" . \"context\") used by function
 `TeX-help-error' to display help-text on an error message or warning.
 err-regexp should be a regular expression matching the error message
 given from TeX/LaTeX, and context should be some lines describing that
@@ -3049,7 +3088,7 @@ forward, if negative)."
   "List of errors to be used in the error overview.")
 
 (define-derived-mode TeX-error-overview-mode tabulated-list-mode
-  "TeX errors"
+                    "TeX errors"
   "Major mode for listing TeX errors."
   (setq tabulated-list-format [("File" 25 nil)
                                ("Line" 4 nil :right-align t)
@@ -3185,13 +3224,13 @@ forward, if negative)."
   "Keymap for `TeX-output-mode'.")
 
 (define-derived-mode TeX-output-mode TeX-special-mode "TeX Output"
-    "Major mode for viewing TeX output.
+  "Major mode for viewing TeX output.
 \\{TeX-output-mode-map} "
-    :syntax-table nil
-    (set (make-local-variable 'revert-buffer-function)
-        #'TeX-output-revert-buffer)
-    ;; special-mode makes it read-only which prevents input from TeX.
-    (setq buffer-read-only nil))
+  :syntax-table nil
+  (set (make-local-variable 'revert-buffer-function)
+       #'TeX-output-revert-buffer)
+  ;; special-mode makes it read-only which prevents input from TeX.
+  (setq buffer-read-only nil))
 
 (defun TeX-output-revert-buffer (ignore-auto noconfirm)
   "Rerun the TeX command which of which this buffer was the output."
diff --git a/tex.el b/tex.el
index 67e94a7..fa2c475 100644
--- a/tex.el
+++ b/tex.el
@@ -575,6 +575,10 @@ the name of the file being processed, with an optional 
extension."
 (autoload 'TeX-command-region "tex-buf" nil t)
 (autoload 'TeX-command-buffer "tex-buf" nil t)
 (autoload 'TeX-command-master "tex-buf" nil t)
+(autoload 'LaTeX-command-section "tex-buf" nil t)
+(autoload 'TeX-command-run-all "tex-buf" nil t)
+(autoload 'TeX-command-run-all-region "tex-buf" nil t)
+(autoload 'LaTeX-command-run-all-section "tex-buf" nil t)
 (autoload 'TeX-command "tex-buf" nil nil)
 (autoload 'TeX-kill-job "tex-buf" nil t)
 (autoload 'TeX-recenter-output-buffer "tex-buf" nil t)
@@ -2086,11 +2090,6 @@ output files."
            (delete-file (concat master-dir file))))
       (message "No files to be deleted"))))
 
-(defun TeX-command-run-all ()
-  "Compile the current document until an error occurs or it is finished."
-  (interactive)
-  (TeX-command-sequence t t))
-
 ;;; Master File
 
 (defcustom TeX-master t

commit 6f0534769e1e468479a785b595e470362cb2b8a1
Merge: 6a5107a c3cb0ff
Author: Tassilo Horn <address@hidden>
Date:   Fri Sep 4 06:49:44 2015 +0200

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


commit 6a5107a556dfd45cc688180aea3b61caeb1570ea
Merge: 7cda7ab 76eb240
Author: Tassilo Horn <address@hidden>
Date:   Thu Sep 3 19:52:21 2015 +0200

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


commit 7cda7abf94628631c1dc6db9f5674dbaaf27120d
Merge: 3342477 57338ec
Author: Tassilo Horn <address@hidden>
Date:   Thu Sep 3 19:37:09 2015 +0200

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


commit 334247756d898a0503b11dd36c5d81d33bb13973
Merge: 4641da3 08ab3c1
Author: Tassilo Horn <address@hidden>
Date:   Thu Sep 3 13:43:23 2015 +0200

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


commit 4641da37777f2d56eefd42436c6e72b147f64c99
Merge: 92d2bd4 513490f
Author: Tassilo Horn <address@hidden>
Date:   Thu Sep 3 12:49:02 2015 +0200

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


commit 92d2bd4bdb2521df9db7b767923341726fbdfbb5
Merge: 4953229 dd9adef
Author: Tassilo Horn <address@hidden>
Date:   Thu Sep 3 08:28:03 2015 +0200

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


commit 4953229027702c721de9d6a65688766844cc1423
Merge: 99ef8ac 66b97ff
Author: Tassilo Horn <address@hidden>
Date:   Wed Sep 2 14:50:30 2015 +0200

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


commit 99ef8acd0b01b5a8f8314073d15049818c661bd6
Merge: d5e444e 400609e
Author: Tassilo Horn <address@hidden>
Date:   Tue Sep 1 08:22:58 2015 +0200

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


commit d5e444ecc32bca9ec9288c5bd3fd973126b1fbd7
Merge: ecd76ca dbc87df
Author: Tassilo Horn <address@hidden>
Date:   Tue Sep 1 07:54:25 2015 +0200

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


commit ecd76caf1710d4b3c84568fc845f7034a0e90d4c
Merge: 7279f82 eff71a7
Author: Tassilo Horn <address@hidden>
Date:   Fri Aug 28 10:48:08 2015 +0200

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


commit 7279f82aac4e666532d5ee2a0df4350e7a48c8be
Merge: 191ac7b 30be9cc
Author: Tassilo Horn <address@hidden>
Date:   Mon Aug 24 08:09:23 2015 +0200

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


commit 191ac7bb8c97357a7fa543951e0b0a090e72c7ab
Merge: a953960 e88f11f
Author: Tassilo Horn <address@hidden>
Date:   Mon Aug 10 08:35:18 2015 +0200

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

diff --cc ChangeLog
index 3ed7345,5ccb448..1f85545
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,5 -1,8 +1,10 @@@
  2015-08-10  Tassilo Horn  <address@hidden>
  
+       * latex.el (TeX-latex-mode): Call LaTeX-preview-setup only if its
+       bound.
+ 
++2015-08-10  Tassilo Horn  <address@hidden>
++
        * preview.el.in (LaTeX-preview-setup): Setup menu and keymap only
        once.
  

commit a953960741f5f0127bf8b19cb1d4648d6bb2131d
Merge: 617fb70 5b0b215
Author: Tassilo Horn <address@hidden>
Date:   Mon Aug 10 07:31:37 2015 +0200

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


commit 617fb70b5fb02f28dc48120c5a7eac4b077ec391
Merge: 4d062d9 3fdeb4b
Author: Tassilo Horn <address@hidden>
Date:   Fri Aug 7 17:56:13 2015 +0200

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


commit 4d062d92ba36cad5d17f481a546a470e8c80fd0a
Merge: 9b43419 e351a3a
Author: Tassilo Horn <address@hidden>
Date:   Fri Aug 7 17:41:30 2015 +0200

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


commit 9b43419be547cd8c6230fc710049420a6c856773
Merge: 6e03b6a 5178ba6
Author: Tassilo Horn <address@hidden>
Date:   Sun Jun 28 18:40:30 2015 +0200

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


commit 6e03b6a7b17d8fabd3d0ca6af9b0688f851fb819
Merge: 90ff3fc 8426ca5
Author: Tassilo Horn <address@hidden>
Date:   Fri Jun 12 08:40:03 2015 +0200

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


commit 90ff3fc0288a474d95d655aa138b9c285475a6e3
Merge: 4d017ce b9eddc9
Author: Tassilo Horn <address@hidden>
Date:   Tue Jun 9 17:05:03 2015 +0200

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


commit 4d017ce7af8cd3c13ea77908d63bdd25ed4fa0cc
Merge: 8353f97 7a0d85f
Author: Tassilo Horn <address@hidden>
Date:   Mon Jun 8 13:22:36 2015 +0200

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


commit 8353f977ede40302352fdaca9364622f7ddacaf8
Merge: 47d589c 3cd3e72
Author: Tassilo Horn <address@hidden>
Date:   Fri Jun 5 16:30:42 2015 +0200

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


commit 47d589c556ad3002526303daaf923611bed0cd8b
Merge: f3f2e0d 0b85713
Author: Tassilo Horn <address@hidden>
Date:   Tue Jun 2 13:25:33 2015 +0200

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


commit f3f2e0d3a283ae1e1e714c79cfb24aa2230e7a5c
Merge: 453de87 b1e4d46
Author: Tassilo Horn <address@hidden>
Date:   Mon Jun 1 17:11:38 2015 +0200

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


commit 453de8792beaebf8b282601c1634c9d2c3a40ab3
Merge: c0a5e50 752171a
Author: Tassilo Horn <address@hidden>
Date:   Fri May 29 08:03:20 2015 +0200

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


commit c0a5e505f5730888732db1845629e2f182db2c62
Merge: 7388517 4e84c98
Author: Tassilo Horn <address@hidden>
Date:   Mon May 18 17:08:09 2015 +0200

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

diff --cc ChangeLog
index c40352f,6458c8c..0755ce0
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,7 -1,24 +1,26 @@@
+ 2015-05-18  Orlando Iovino  <address@hidden>  (tiny change)
+ 
+       * style/beamer.el ("beamer"): Add `subtitle' to the `slide-title'
+       class.
+ 
+ 2015-05-16  Arash Esbati  <address@hidden>
+ 
+       * Makefile.in (STYLESRC): Add new styles.
+ 
+       * style/newpxmath.el: New file.
+ 
+       * style/newpxtext.el: New file.
+ 
+       * font-latex.el (font-latex-set-syntactic-keywords): Allow for
+       multiple mandatory argument for a verbatim environment.
+ 
+       * style/listings.el ("listings"): Add support for parsing new
+       env's defined with `\lstnewenvironment' command.
+ 
  2015-05-08  Tassilo Horn  <address@hidden>
  
 +2015-05-08  Tassilo Horn  <address@hidden>
 +
        * tex.el (TeX-mode-syntax-table): Use paired delimiter syntax for
        character |.
        (TeX-tree-expand): Fix docstring.

commit 738851782a6f2bc23546717bf527200f84708cec
Merge: a78ca1c 1f9edc5
Author: Tassilo Horn <address@hidden>
Date:   Fri May 8 08:25:57 2015 +0200

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

diff --cc ChangeLog
index f611b38,9be6aab..c40352f
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,7 -1,8 +1,10 @@@
  2015-05-08  Tassilo Horn  <address@hidden>
  
++2015-05-08  Tassilo Horn  <address@hidden>
++
        * tex.el (TeX-mode-syntax-table): Use paired delimiter syntax for
        character |.
+       (TeX-tree-expand): Fix docstring.
  
  2015-05-07  Mosè Giordano  <address@hidden>
  

commit a78ca1c62ff5485057d0876f4e6df0ed2d624e8d
Merge: 71ca4df 100759f
Author: Tassilo Horn <address@hidden>
Date:   Fri May 8 08:06:27 2015 +0200

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


commit 71ca4dfd38166f4d6b8032e3bac46466d58c7725
Merge: edb7cb2 1af53df
Author: Tassilo Horn <address@hidden>
Date:   Thu May 7 12:50:58 2015 +0200

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


commit edb7cb29fd5a7a43c1b4aa62b191c242d522b8d6
Merge: 57410f3 26f8ce1
Author: Tassilo Horn <address@hidden>
Date:   Fri May 1 10:49:33 2015 +0200

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


commit 57410f3394ba4b3739f319b9797701de7ce7d68c
Merge: 96bc206 563f0e6
Author: Tassilo Horn <address@hidden>
Date:   Wed Apr 29 08:19:22 2015 +0200

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


commit 96bc20639a17a58f6609c0324957fc39aa259472
Merge: b7780dd 7c120b0
Author: Tassilo Horn <address@hidden>
Date:   Sat Apr 25 20:35:05 2015 +0200

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


commit b7780dd667811f27d30cbf4a5aacd6513b124549
Author: Tassilo Horn <address@hidden>
Date:   Sun Apr 19 08:20:37 2015 +0200

    Complete last commit

diff --git a/tex.el b/tex.el
index 82ddf95..8447d6c 100644
--- a/tex.el
+++ b/tex.el
@@ -2015,7 +2015,7 @@ output files."
         (master-dir (file-name-directory master))
         (regexp (concat "\\("
                         (regexp-quote (file-name-nondirectory master)) "\\|"
-                        (TeX-region-file nil t)
+                        (regexp-quote (TeX-region-file nil t))
                         "\\)"
                         "\\("
                         (mapconcat 'identity suffixes "\\|")

commit 6934e32276910391f14ce847f5bd847ebdfec055
Merge: 7cace3f e80221c
Author: Tassilo Horn <address@hidden>
Date:   Sun Apr 19 08:16:11 2015 +0200

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


commit 7cace3f26dd1b5d4f54b9a670b1b496cd8518b56
Merge: 8c44159 f4c405b
Author: Tassilo Horn <address@hidden>
Date:   Fri Apr 17 21:18:42 2015 +0200

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


commit 8c44159942bfb7ae4ae7b83dc326859e0197a192
Merge: 5b3de5e 07c2d23
Author: Tassilo Horn <address@hidden>
Date:   Sat Apr 11 21:51:15 2015 +0200

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


commit 5b3de5ea38b81a569d827f42fe933292a844559d
Merge: f020d92 bf5f55b
Author: Tassilo Horn <address@hidden>
Date:   Sat Apr 11 13:57:01 2015 +0200

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


commit f020d929f4fe7b2f2f50d0b84de0db05ac7294d1
Merge: 29f1348 c2f6e9c
Author: Tassilo Horn <address@hidden>
Date:   Tue Mar 31 07:26:15 2015 +0200

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


commit 29f1348011028d6b6156428ab692a980a8a32ae1
Merge: 5dd7eaf b91b203
Author: Tassilo Horn <address@hidden>
Date:   Mon Mar 23 13:47:06 2015 +0100

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


commit 5dd7eaf8324e48d6222938beb1c5ac97c599bd8f
Merge: 53623fd 8af05de
Author: Tassilo Horn <address@hidden>
Date:   Mon Mar 23 13:41:45 2015 +0100

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


commit 53623fd4484f21820287e45a8a96f801c5a5c5be
Merge: e7dcdf3 ca40c6a
Author: Tassilo Horn <address@hidden>
Date:   Sun Mar 22 10:13:43 2015 +0100

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


commit e7dcdf3a10a7a09695f0b6c675ed2c9e74eed6b5
Merge: 6e235a8 fd04166
Author: Tassilo Horn <address@hidden>
Date:   Mon Mar 16 08:11:27 2015 +0100

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


commit 6e235a8aad327be86bd63237408813c8103f4af4
Merge: 68e2d07 59f9440
Author: Tassilo Horn <address@hidden>
Date:   Tue Mar 10 12:50:22 2015 +0100

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

diff --cc ChangeLog
index dcbd39c,a53574a..b5a5cd2
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,5 -1,8 +1,10 @@@
  2015-03-10  Tassilo Horn  <address@hidden>
  
+       * tex.el (TeX-style-path): Replace `pushnew' with equivalent code
+       since defcustom init-forms don't seem to get compiled.
+ 
++2015-03-10  Tassilo Horn  <address@hidden>
++
        * doc/auctex.texi (Modes and Hooks): Document
        TeX-after-TeX-LaTeX-command-finished-hook.
  

commit 68e2d07ca4c1c464e6f04fc09c07a69242c5bdd7
Merge: 9e71d23 a2a4777
Author: Tassilo Horn <address@hidden>
Date:   Tue Mar 10 10:15:27 2015 +0100

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


commit 9e71d23bfb79aefef0b40c75fe8286b0a4d5c086
Merge: fd1e0fd 41c5f9a
Author: Tassilo Horn <address@hidden>
Date:   Tue Mar 10 08:03:31 2015 +0100

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


commit fd1e0fdef0b6ce7083b1c64a3b46ed1fcdee41bd
Merge: 48f2926 69b02a0
Author: Tassilo Horn <address@hidden>
Date:   Mon Mar 9 08:48:18 2015 +0100

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


commit 48f2926f23a9f5637865320022107b48a0354654
Merge: e941f8c 61ed48c
Author: Tassilo Horn <address@hidden>
Date:   Sun Mar 8 20:58:15 2015 +0100

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

diff --cc ChangeLog
index cf1176e,52f31c2..664fbff
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,5 -1,8 +1,10 @@@
  2015-03-08  Tassilo Horn  <address@hidden>
  
+       * tex.el (TeX-style-path): Replace add-to-list on local with
+       pushnew.
+ 
++2015-03-08  Tassilo Horn  <address@hidden>
++
        * style/bidibeamer.el: New style.
  
        * Makefile.in (STYLESRC): Activate new bidibeamer style.

commit e941f8c57650408658f14811c25dde91967c2100
Merge: 89b2737 d23de0a
Author: Tassilo Horn <address@hidden>
Date:   Sun Mar 8 20:35:15 2015 +0100

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


commit 89b27372c19ad5334a3eb93741403f70df23e223
Merge: 20b96e7 074af82
Author: Tassilo Horn <address@hidden>
Date:   Tue Mar 3 11:33:23 2015 +0100

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

diff --cc ChangeLog
index f02a0a8,b9e1a84..47abfbe
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,5 -1,7 +1,9 @@@
  2015-03-03  Tassilo Horn  <address@hidden>
  
+       * doc/auctex.texi (Filling): Document LaTeX-fill-excluded-macros.
+ 
++2015-03-03  Tassilo Horn  <address@hidden>
++
        * latex.el (LaTeX-fill-excluded-macros): New defcustom for
        excluding macro arguments from filling.
        (LaTeX-fill-region-as-paragraph): Use it.

commit 20b96e74494e41e9879c9dc5875a6979e22213d6
Merge: 510181b 39badf0
Author: Tassilo Horn <address@hidden>
Date:   Tue Mar 3 11:11:37 2015 +0100

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


commit 510181b0bbe6333f52aa4d7a1b63c631792bd6e0
Merge: 31c9abc 3cf92fc
Author: Tassilo Horn <address@hidden>
Date:   Mon Mar 2 08:56:19 2015 +0100

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

diff --cc ChangeLog
index 7a6d03c,e81c6bb..1db9674
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,14 -1,19 +1,30 @@@
+ 2015-03-02  Tassilo Horn  <address@hidden>
+ 
+       * font-latex.el (font-latex-match-command-with-arguments): Fix
+       error introduced in the last change.
+ 
+ 2015-02-24  Tassilo Horn  <address@hidden>
+ 
+       * style/expl3.el: New style for the wrapper package for
+       experimental LaTeX 3.
+ 
+       * Makefile.in (STYLESRC): Activate new style.
+ 
+       * font-latex.el (font-latex-match-simple-command)
+       (font-latex-match-command-with-arguments): Use \s_ and \sw regexp
+       classes instead of hard-coding address@hidden as LaTeX macro chars.
+ 
 +2015-02-24  Tassilo Horn  <address@hidden>
 +
 +      * style/expl3.el: New style for the wrapper package for
 +      experimental LaTeX 3.
 +
 +      * Makefile.in (STYLESRC): Activate new style.
 +
 +      * font-latex.el (font-latex-match-simple-command)
 +      (font-latex-match-command-with-arguments): Use \s_ and \sw regexp
 +      classes instead of hard-coding address@hidden as LaTeX macro chars.
 +
  2015-02-17  Tassilo Horn  <address@hidden>
  
        * latex.el (LaTeX-after-insert-env-hook): Rename from

commit 31c9abc7ad79b9f228d0355d50671b2277ba8edc
Author: Tassilo Horn <address@hidden>
Date:   Tue Feb 24 21:00:58 2015 +0100

    Add some expl3 support
    
    * style/expl3.el: New style for the wrapper package for
    experimental LaTeX 3.
    
    * Makefile.in (STYLESRC): Activate new style.
    
    * font-latex.el (font-latex-match-simple-command)
    (font-latex-match-command-with-arguments): Use \s_ and \sw regexp
    classes instead of hard-coding address@hidden as LaTeX macro chars.

diff --git a/ChangeLog b/ChangeLog
index d3ba7df..7a6d03c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-02-24  Tassilo Horn  <address@hidden>
+
+       * style/expl3.el: New style for the wrapper package for
+       experimental LaTeX 3.
+
+       * Makefile.in (STYLESRC): Activate new style.
+
+       * font-latex.el (font-latex-match-simple-command)
+       (font-latex-match-command-with-arguments): Use \s_ and \sw regexp
+       classes instead of hard-coding address@hidden as LaTeX macro chars.
+
 2015-02-17  Tassilo Horn  <address@hidden>
 
        * latex.el (LaTeX-after-insert-env-hook): Rename from
diff --git a/Makefile.in b/Makefile.in
index 7a0851c..9320db2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -144,7 +144,7 @@ STYLESRC = style/prosper.el \
           style/fbb.el       style/newtxmath.el style/newtxsf.el \
           style/newtxtext.el style/newtxttt.el  style/minted.el \
           style/wrapfig.el   style/relsize.el   style/currvita.el \
-          style/tcolorbox.el style/color.el
+          style/tcolorbox.el style/color.el     style/expl3.el
 STYLEELC = $(STYLESRC:.el=.elc)
 
 ifeq (@preview_enabled@,yes)
diff --git a/font-latex.el b/font-latex.el
index 0a1b8ad..c2f6536 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1494,7 +1494,8 @@ Returns nil if none of KEYWORDS is found."
                             (list (point)
                                   (progn
                                     (forward-char)
-                                    (if (zerop (skip-chars-forward "A-Za-z@"))
+                                    (if (zerop (skip-chars-forward
+                                                "\\\\\\(?:\\s_\\|\\sw\\)+"))
                                         (forward-char) ; Single-char macro.
                                       (skip-chars-forward "*"))
                                     (point))))
@@ -1634,7 +1635,8 @@ marks boundaries for searching for group ends."
 
 (defun font-latex-match-simple-command (limit)
   "Search for command like \\foo before LIMIT."
-  (TeX-re-search-forward-unescaped "address@hidden" limit t))
+  ;; \s_ matches chars with symbol syntax, \sw chars with word syntax
+  (TeX-re-search-forward-unescaped "\\\\\\(?:\\s_\\|\\sw\\)+" limit t))
 
 (defun font-latex-match-math-env (limit)
   "Match math pattern up to LIMIT.
diff --git a/style/expl3.el b/style/expl3.el
new file mode 100644
index 0000000..6293b87
--- /dev/null
+++ b/style/expl3.el
@@ -0,0 +1,51 @@
+;;; expl3.el --- AUCTeX style for `expl3.sty'
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Tassilo Horn <address@hidden>
+;; Maintainer: address@hidden
+;; Created: 2015-02-22
+;; 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 `expl3.sty'.
+
+;;; Code:
+
+(defvar LaTeX-expl3-syntax-table
+  (let ((st (copy-syntax-table LaTeX-mode-syntax-table)))
+    ;; Make _ and : symbol chars
+    (modify-syntax-entry ?\_ "_" st)
+    (modify-syntax-entry ?\: "_" st)
+    st))
+
+(TeX-add-style-hook
+ "expl3"
+ (lambda ()
+   (set-syntax-table LaTeX-expl3-syntax-table)
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     ;; For syntactic fontification, e.g. verbatim constructs.
+     (font-latex-set-syntactic-keywords)
+     ;; Tell font-lock about the update.
+     (setq font-lock-set-defaults nil)
+     (font-lock-set-defaults)))
+ LaTeX-dialect)

commit 5f112a88f7eeca5348c5eafb5a313b8c21906ff6
Merge: f8a500d 86f4a1e
Author: Tassilo Horn <address@hidden>
Date:   Tue Feb 17 09:10:48 2015 +0100

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


commit f8a500d33345ac56488875c004ee9999c04ce216
Merge: 34d3d0b b2957c8
Author: Tassilo Horn <address@hidden>
Date:   Fri Feb 13 09:45:05 2015 +0100

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


commit 34d3d0bc9418b6c0c8249ec17c20206bd3b3b1e5
Merge: ed00818 b858aae
Author: Tassilo Horn <address@hidden>
Date:   Mon Feb 9 10:16:34 2015 +0100

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


commit ed0081804316178546ca60010c27867bb4aff7c5
Merge: d55b7c5 adf90e9
Author: Tassilo Horn <address@hidden>
Date:   Mon Feb 9 09:30:57 2015 +0100

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


commit d55b7c595bb65c615d7beb36eb1d385bafec10f7
Merge: f4be2fc 566426b
Author: Tassilo Horn <address@hidden>
Date:   Mon Feb 9 09:02:26 2015 +0100

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


commit f4be2fccb4e9f51430a6106718b6797147d6f3e7
Merge: ec2553d 51e3aa8
Author: Tassilo Horn <address@hidden>
Date:   Sat Feb 7 21:22:40 2015 +0100

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


commit ec2553d66d6e39cec53aef43ca0fd22edaabeb64
Merge: 12631af cc9c060
Author: Tassilo Horn <address@hidden>
Date:   Fri Feb 6 15:49:53 2015 +0100

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


commit 12631afc2f36d66cd41f9e75009179d80afe90ed
Merge: 448f7cb cef38f9
Author: Tassilo Horn <address@hidden>
Date:   Fri Feb 6 11:08:09 2015 +0100

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


commit 448f7cb7906cb48600f7a925687cc99de1a4e7b0
Merge: bd6452a 5276f35
Author: Tassilo Horn <address@hidden>
Date:   Thu Feb 5 09:52:04 2015 +0100

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


commit bd6452a620a5e89e5c9196da99b7dc4001c73769
Merge: ea4eacc 061d8cd
Author: Tassilo Horn <address@hidden>
Date:   Wed Feb 4 10:32:23 2015 +0100

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


commit ea4eacc699f40fc83d652cbde16d30f88e3c90dc
Merge: 1539ffd 4b2587d
Author: Tassilo Horn <address@hidden>
Date:   Sun Feb 1 10:15:37 2015 +0100

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


commit 1539ffd0e18541df1c0614899781316798be0d02
Merge: e127e46 4b43c80
Author: Tassilo Horn <address@hidden>
Date:   Tue Jan 27 12:45:22 2015 +0100

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


commit e127e46c82bfec29e9d6e36da3606b8bfc0dcb0b
Merge: c6b3c40 81512a2
Author: Tassilo Horn <address@hidden>
Date:   Tue Jan 27 09:21:33 2015 +0100

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


commit c6b3c4056c141b18a26b18550c4993f9de599900
Merge: 8983d2e 53838b3
Author: Tassilo Horn <address@hidden>
Date:   Sun Jan 25 09:05:17 2015 +0100

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


commit 8983d2ee401a3b3bc6704a5a03753a96a9b009d0
Merge: 35b418b 8cd2b07
Author: Tassilo Horn <address@hidden>
Date:   Mon Jan 19 09:31:46 2015 +0100

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


commit 35b418b1d9cc6a281a0ce7eac6931883a6631478
Merge: 8092a0f f3cf79d
Author: Tassilo Horn <address@hidden>
Date:   Fri Jan 2 08:45:15 2015 +0100

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


commit 8092a0f308074344409b028e5beefc58f6864dce
Author: Tassilo Horn <address@hidden>
Date:   Mon Dec 22 09:31:38 2014 +0100

    Fix doc build
    
    Don't reference info node when generating CHANGES.

diff --git a/doc/changes.texi b/doc/changes.texi
index 17a5683..5483c84 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -14,8 +14,11 @@
 @item
 Commands such as LaTeX and View can now be executed conveniently on the
 current section (or part, chapter, subsection, etc).  See
address@hidden, @code{LaTeX-command-section-change-level},
-and @xref{Starting a Command}.
address@hidden and
address@hidden
address@hidden rawfile
+Also see the documentation at @xref{Starting a Command}.
address@hidden ifclear
 
 @item
 Forward and backward search with Evince now also work when only a region

commit 497442cd8aaaa664be563257672a06959e4782bd
Author: Tassilo Horn <address@hidden>
Date:   Mon Dec 22 09:24:16 2014 +0100

    Update changes.texi
    
    * doc/changes.texi: Document addition of LaTeX-command-section and
    forward/backward search enhancements with Evince.

diff --git a/ChangeLog b/ChangeLog
index 285d073..d874f66 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-12-22  Tassilo Horn  <address@hidden>
 
+       * doc/changes.texi: Document addition of LaTeX-command-section and
+       forward/backward search enhancements with Evince.
+
        * latex.el (auto-mode-alist): Add latex-mode association for HeVeA
        files.
 
diff --git a/doc/changes.texi b/doc/changes.texi
index a4b2e76..17a5683 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -12,6 +12,16 @@
 
 @itemize @bullet
 @item
+Commands such as LaTeX and View can now be executed conveniently on the
+current section (or part, chapter, subsection, etc).  See
address@hidden, @code{LaTeX-command-section-change-level},
+and @xref{Starting a Command}.
+
address@hidden
+Forward and backward search with Evince now also work when only a region
+of the document is compiled/viewed.
+
address@hidden
 New option @code{TeX-file-line-error} allows to select file:line:error
 style for error messages.
 

commit 3fb3540df0c3ee9314327c2d1bac374e296949b6
Merge: 298ce69 fff9412
Author: Tassilo Horn <address@hidden>
Date:   Mon Dec 22 08:35:42 2014 +0100

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


commit 298ce6989a559b98bf67a2514ca14d938109513b
Merge: 3056640 df97f94
Author: Tassilo Horn <address@hidden>
Date:   Sun Dec 21 09:28:03 2014 +0100

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


commit 30566404d51eddaee0bb0f0d5713af5423db3abc
Author: Tassilo Horn <address@hidden>
Date:   Sun Dec 21 09:19:17 2014 +0100

    Improve minted style.
    
    * tex.el (TeX-parse-macro): Enclose arg in
    LaTeX-default-verb-delimiter if macro is in
    LaTeX-verbatim-macros-with-delims and there's only one argument.
    (TeX-auto-store): Check if LaTeX-verbatim-environments,
    LaTeX-verbatim-macros-with-delims, and
    LaTeX-verbatim-macros-with-braces are bound before using them.
    
    * style/minted.el (LaTeX-minted-newminted-regexp)
    (LaTeX-minted-newmint-regexp, LaTeX-minted-newmintinline-regexp)
    (LaTeX-minted-newmintedfile-regexp, LaTeX-minted-auto-cleanup):
    Extend to recognize optional env/macro name.
    ("minted"): Add \newminted, \newmint, \newmintinline, and
    \newmintedfile macros.

diff --git a/ChangeLog b/ChangeLog
index 641764b..429c6af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2014-12-21  Tassilo Horn  <address@hidden>
+
+       * tex.el (TeX-parse-macro): Enclose arg in
+       LaTeX-default-verb-delimiter if macro is in
+       LaTeX-verbatim-macros-with-delims and there's only one argument.
+       (TeX-auto-store): Check if LaTeX-verbatim-environments,
+       LaTeX-verbatim-macros-with-delims, and
+       LaTeX-verbatim-macros-with-braces are bound before using them.
+
+       * style/minted.el (LaTeX-minted-newminted-regexp)
+       (LaTeX-minted-newmint-regexp, LaTeX-minted-newmintinline-regexp)
+       (LaTeX-minted-newmintedfile-regexp, LaTeX-minted-auto-cleanup):
+       Extend to recognize optional env/macro name.
+       ("minted"): Add \newminted, \newmint, \newmintinline, and
+       \newmintedfile macros.
+
 2014-12-20  Tassilo Horn  <address@hidden>
 
        * tex.el (TeX-auto-store): Write LaTeX-verbatim-*-local variables
diff --git a/style/minted.el b/style/minted.el
index dce725b..83d4764 100644
--- a/style/minted.el
+++ b/style/minted.el
@@ -108,19 +108,23 @@
 ;; environments are fifi and fifi* rather than cppcode and cppcode*.
 (defvar LaTeX-minted-auto-newminted nil)
 (defvar LaTeX-minted-newminted-regexp
-  '("\\\\newminted{\\([^}]+\\)}{[^}]*}" 1 LaTeX-minted-auto-newminted))
+  '("\\\\newminted\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
+    (1 2) LaTeX-minted-auto-newminted))
 
 (defvar LaTeX-minted-auto-newmint nil)
 (defvar LaTeX-minted-newmint-regexp
-  '("\\\\newmint{\\([^}]+\\)}{[^}]*}" 1 LaTeX-minted-auto-newmint))
+  '("\\\\newmint\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
+    (1 2) LaTeX-minted-auto-newmint))
 
 (defvar LaTeX-minted-auto-newmintinline nil)
 (defvar LaTeX-minted-newmintinline-regexp
-  '("\\\\newmintinline{\\([^}]+\\)}{[^}]*}" 1 LaTeX-minted-auto-newmintinline))
+  '("\\\\newmintinline\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
+    (1 2) LaTeX-minted-auto-newmintinline))
 
 (defvar LaTeX-minted-auto-newmintedfile nil)
 (defvar LaTeX-minted-newmintedfile-regexp
-  '("\\\\newmintedfile{\\([^}]+\\)}{[^}]*}" 1 LaTeX-minted-auto-newmintedfile))
+  '("\\\\newmintedfile\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
+    (1 2) LaTeX-minted-auto-newmintedfile))
 
 (defun LaTeX-minted-auto-prepare ()
   (setq LaTeX-minted-auto-newminted     nil
@@ -130,8 +134,11 @@
 
 (defun LaTeX-minted-auto-cleanup ()
   ;; \newminted{lang}{opts} => new langcode and langcode* envs.
-  (dolist (lang LaTeX-minted-auto-newminted)
-    (let* ((env (concat lang "code"))
+  ;; \newminted[envname]{lang}{opts} => new envname/envname* envs.
+  (dolist (name-lang LaTeX-minted-auto-newminted)
+    (let* ((env (if (> (length (car name-lang)) 0)
+                   (car name-lang)
+                 (cadr name-lang)))
           (env* (concat env "*")))
       (add-to-list 'LaTeX-auto-environment (list env))
       (add-to-list 'LaTeX-auto-environment
@@ -142,16 +149,28 @@
       (add-to-list 'LaTeX-verbatim-environments-local env)
       (add-to-list 'LaTeX-verbatim-environments-local env*)))
   ;; \newmint{foo}{opts} => \foo|code|
-  (dolist (lang LaTeX-minted-auto-newmint)
-    (add-to-list 'TeX-auto-symbol lang)
-    (add-to-list 'LaTeX-verbatim-macros-with-delims-local lang))
+  ;; \newmint[macname]{foo}{opts} => \macname|code|
+  (dolist (name-lang LaTeX-minted-auto-newmint)
+    (let ((lang (if (> (length (car name-lang)) 0)
+                   (car name-lang)
+                 (cadr name-lang))))
+      (add-to-list 'TeX-auto-symbol lang)
+      (add-to-list 'LaTeX-verbatim-macros-with-delims-local lang)))
   ;; \newmintinline{foo}{opts} => \fooinline|code|
-  (dolist (lang LaTeX-minted-auto-newmintinline)
-    (add-to-list 'TeX-auto-symbol lang)
-    (add-to-list 'LaTeX-verbatim-macros-with-delims-local (concat lang 
"inline")))
+  ;; \newmintinline[macname]{foo}{opts} => \macname|code|
+  (dolist (name-lang LaTeX-minted-auto-newmintinline)
+    (let ((lang (if (> (length (car name-lang)) 0)
+                   (car name-lang)
+                 (cadr name-lang))))
+      (add-to-list 'TeX-auto-symbol lang)
+      (add-to-list 'LaTeX-verbatim-macros-with-delims-local (concat lang 
"inline"))))
   ;; \newmintedfile{foo}{opts} => \foofile{file-name}
-  (dolist (lang LaTeX-minted-auto-newmintedfile)
-    (add-to-list 'TeX-auto-symbol (list lang 'TeX-arg-file)))
+  ;; \newmintedfile[macname]{foo}{opts} => \macname{file-name}
+  (dolist (name-lang LaTeX-minted-auto-newmintedfile)
+    (let ((lang (if (> (length (car name-lang)) 0)
+                   (car name-lang)
+                 (cadr name-lang))))
+      (add-to-list 'TeX-auto-symbol (list lang 'TeX-arg-file))))
   (when (and (fboundp 'font-latex-add-keywords)
             (fboundp 'font-latex-set-syntactic-keywords)
             (eq TeX-install-font-lock 'font-latex-setup))
@@ -170,7 +189,15 @@
    (TeX-add-symbols
     '("mint" LaTeX-arg-minted-language TeX-arg-verb)
     '("mintinline" LaTeX-arg-minted-language TeX-arg-verb)
-    '("listoflistings"))
+    '("listoflistings")
+    '("newminted" ["Environment Name"] LaTeX-arg-minted-language
+      (TeX-arg-key-val LaTeX-minted-key-val-options))
+    '("newmint" ["Macro Name"] LaTeX-arg-minted-language
+      (TeX-arg-key-val LaTeX-minted-key-val-options))
+    '("newmintinline" ["Macro Name"] LaTeX-arg-minted-language
+      (TeX-arg-key-val LaTeX-minted-key-val-options))
+    '("newmintedfile" ["Macro Name"] LaTeX-arg-minted-language
+      (TeX-arg-key-val LaTeX-minted-key-val-options)))
 
    ;; New environments
    (LaTeX-add-environments
diff --git a/tex.el b/tex.el
index 713a476..ac404e0 100644
--- a/tex.el
+++ b/tex.el
@@ -3031,42 +3031,51 @@ type of ARGS:
   parse it as a list, otherwise parse the only element as above.
   Use square brackets instead of curly braces, and is not inserted
   on empty user input."
-
-  (if (and (TeX-active-mark)
-          (> (point) (mark)))
-      (exchange-point-and-mark))
-  (insert TeX-esc symbol)
-  (let ((exit-mark (make-marker))
-       (position (point)))
-    (TeX-parse-arguments args)
-    (cond ((marker-position exit-mark)
-          (goto-char (marker-position exit-mark))
-          (set-marker exit-mark nil))
-         ((let ((element (assoc symbol TeX-insert-braces-alist)))
-            ;; If in `TeX-insert-braces-alist' there is an element associated
-            ;; to the current macro, use its value to decide whether inserting
-            ;; a pair of braces, otherwise use the standard criterion.
-            (if element
-                (cdr element)
-              (and TeX-insert-braces
-                   ;; Do not add braces if the argument is 0 or -1.
-                   (not (and (= (safe-length args) 1)
-                             (numberp (car args))
-                             (<= (car args) 0)))
-                   (equal position (point))
-                   (string-match "[a-zA-Z]+" symbol))))
-          (if (texmathp)
-              (when (TeX-active-mark)
-                (insert TeX-grop)
-                (exchange-point-and-mark)
-                (insert TeX-grcl))
-            (insert TeX-grop)
-            (if (TeX-active-mark)
-                (progn
+  (let ((TeX-grop (if (and (or (atom args) (= (length args) 1))
+                          (fboundp 'LaTeX-verbatim-macros-with-delims)
+                          (member symbol (LaTeX-verbatim-macros-with-delims)))
+                     LaTeX-default-verb-delimiter
+                   TeX-grop))
+       (TeX-grcl (if (and (or (atom args) (= (length args) 1))
+                          (fboundp 'LaTeX-verbatim-macros-with-delims)
+                          (member symbol (LaTeX-verbatim-macros-with-delims)))
+                     LaTeX-default-verb-delimiter
+                   TeX-grcl)))
+    (if (and (TeX-active-mark)
+            (> (point) (mark)))
+       (exchange-point-and-mark))
+    (insert TeX-esc symbol)
+    (let ((exit-mark (make-marker))
+         (position (point)))
+      (TeX-parse-arguments args)
+      (cond ((marker-position exit-mark)
+            (goto-char (marker-position exit-mark))
+            (set-marker exit-mark nil))
+           ((let ((element (assoc symbol TeX-insert-braces-alist)))
+              ;; If in `TeX-insert-braces-alist' there is an element associated
+              ;; to the current macro, use its value to decide whether 
inserting
+              ;; a pair of braces, otherwise use the standard criterion.
+              (if element
+                  (cdr element)
+                (and TeX-insert-braces
+                     ;; Do not add braces if the argument is 0 or -1.
+                     (not (and (= (safe-length args) 1)
+                               (numberp (car args))
+                               (<= (car args) 0)))
+                     (equal position (point))
+                     (string-match "[a-zA-Z]+" symbol))))
+            (if (texmathp)
+                (when (TeX-active-mark)
+                  (insert TeX-grop)
                   (exchange-point-and-mark)
                   (insert TeX-grcl))
-              (insert TeX-grcl)
-              (backward-char)))))))
+              (insert TeX-grop)
+              (if (TeX-active-mark)
+                  (progn
+                    (exchange-point-and-mark)
+                    (insert TeX-grcl))
+                (insert TeX-grcl)
+                (backward-char))))))))
 
 (defun TeX-arg-string (optional &optional prompt initial-input)
   "Prompt for a string.
@@ -3700,9 +3709,12 @@ If TEX is a directory, generate style files for all 
files in the directory."
                            LaTeX-provided-class-options))
            (pkg-opts (if (boundp 'LaTeX-provided-package-options)
                          LaTeX-provided-package-options))
-           (verb-envs          LaTeX-verbatim-environments-local)
-           (verb-macros-delims LaTeX-verbatim-macros-with-delims-local)
-           (verb-macros-braces LaTeX-verbatim-macros-with-braces-local))
+           (verb-envs (when (boundp 'LaTeX-verbatim-environments-local)
+                        LaTeX-verbatim-environments-local))
+           (verb-macros-delims (when (boundp 
'LaTeX-verbatim-macros-with-delims-local)
+                                 LaTeX-verbatim-macros-with-delims-local))
+           (verb-macros-braces (when (boundp 
'LaTeX-verbatim-macros-with-braces-local)
+                                 LaTeX-verbatim-macros-with-braces-local)))
        (TeX-unload-style style)
        (with-current-buffer (generate-new-buffer file)
          (erase-buffer)

commit 0adaf4e1bfe298bd8e8ff184d0e7611323b4f032
Merge: 0d5b5c1 d3d05d4
Author: Tassilo Horn <address@hidden>
Date:   Sat Dec 20 09:24:30 2014 +0100

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


commit 0d5b5c1ceeeef1ab50095577b31cc52aa2d6ddb3
Merge: d9dd50d fc9a240
Author: Tassilo Horn <address@hidden>
Date:   Thu Dec 18 08:38:10 2014 +0100

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


commit d9dd50d86ae7eb170e456472f6e444b9cfd5d58e
Merge: d1dc593 49ee91a
Author: Tassilo Horn <address@hidden>
Date:   Mon Dec 8 20:57:55 2014 +0100

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


commit d1dc59383a3acd9b25eb7fa0bdfdf1cd4d39a788
Merge: 6f13797 6a756a6
Author: Tassilo Horn <address@hidden>
Date:   Tue Dec 2 08:47:24 2014 +0100

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


commit 6f137977375d2b8c35248e1d2632a9808cef4533
Merge: 40169de 8b44b4f
Author: Tassilo Horn <address@hidden>
Date:   Mon Dec 1 08:01:27 2014 +0100

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


commit 40169de60d95a425af0eb8fc781f6caa9ae09f0b
Merge: 25f08d1 7b427a7
Author: Tassilo Horn <address@hidden>
Date:   Fri Nov 28 09:43:03 2014 +0100

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


commit 25f08d19c86cdcffa80cea169e80987e2db4b53f
Merge: b1c832a acf1c76
Author: Tassilo Horn <address@hidden>
Date:   Fri Nov 21 15:08:00 2014 +0100

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


commit b1c832a396a764e1bfad65fd28ac71458cd6a693
Merge: 5f25271 a3f4cac
Author: Tassilo Horn <address@hidden>
Date:   Fri Nov 21 11:04:43 2014 +0100

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


commit 5f252719b74ca36996e00d2c72585094f39713f2
Merge: d4fc22e 0cb3759
Author: Tassilo Horn <address@hidden>
Date:   Wed Nov 19 12:47:24 2014 +0100

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


commit d4fc22ee7e27e4afeeec651e1cd9d06186b47988
Merge: eebb0d7 e4101ed
Author: Tassilo Horn <address@hidden>
Date:   Wed Nov 19 11:08:42 2014 +0100

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


commit eebb0d79bb26ea99d953a16ca51dc8746a57707e
Merge: 9375198 deb1a64
Author: Tassilo Horn <address@hidden>
Date:   Tue Nov 18 10:35:52 2014 +0100

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


commit 9375198615cb04c221a7f757c6d008ee17af9b7a
Merge: 24aaf1d 15edd9b
Author: Tassilo Horn <address@hidden>
Date:   Tue Nov 18 09:36:37 2014 +0100

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


commit 24aaf1d972317337312e588147637089dd0130f7
Merge: 672ddee 622c054
Author: Tassilo Horn <address@hidden>
Date:   Tue Nov 18 08:28:28 2014 +0100

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


commit 672ddee733a4053138fb70a49efe3a38e683c7db
Merge: 8a93a48 c72f8a8
Author: Tassilo Horn <address@hidden>
Date:   Tue Nov 4 20:23:21 2014 +0100

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


commit 8a93a484601bd87ac6660eb969bf889a95cb5ff6
Merge: 3a8a534 10de62b
Author: Tassilo Horn <address@hidden>
Date:   Tue Nov 4 09:17:38 2014 +0100

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


commit 3a8a534fa249780899d599165cf10f979379fe64
Merge: f94fc6c 3909e4c
Author: Tassilo Horn <address@hidden>
Date:   Tue Nov 4 09:02:39 2014 +0100

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


commit f94fc6c4a0612ad4ddc79c1c7ac4734455ca1f3e
Merge: 10502c5 022873b
Author: Tassilo Horn <address@hidden>
Date:   Tue Nov 4 07:56:12 2014 +0100

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


commit 10502c5523e8caa9ab59f67f9bcd4bd3a374530b
Merge: d93eebe f9611ad
Author: Tassilo Horn <address@hidden>
Date:   Mon Nov 3 20:19:31 2014 +0100

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


commit d93eebebe680629b445692fea9db925164e906b4
Merge: c95bfb0 c2d3585
Author: Tassilo Horn <address@hidden>
Date:   Sun Nov 2 20:36:48 2014 +0100

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


commit c95bfb03d0cce7c366d54274714dffb1f62dc808
Merge: fc4d8f9 5211b5e
Author: Tassilo Horn <address@hidden>
Date:   Sat Nov 1 07:18:18 2014 +0100

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


commit fc4d8f98ad90ddfccf4bad3f9669aac165ddde05
Merge: 1950012 6c60d80
Author: Tassilo Horn <address@hidden>
Date:   Thu Oct 23 07:50:38 2014 +0200

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


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


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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