auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] [elpa] externals/auctex b41e063 62/62: Merge remote-track


From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex b41e063 62/62: Merge remote-tracking branch 'origin/master' into externals/auctex
Date: Sun, 20 Dec 2020 10:40:08 -0500 (EST)

branch: externals/auctex
commit b41e0636b178faa187aa64c3932d434c0c152fbf
Merge: a18be78 a5c2dd9
Author: Tassilo Horn <tsdh@gnu.org>
Commit: Tassilo Horn <tsdh@gnu.org>

    Merge remote-tracking branch 'origin/master' into externals/auctex
---
 .gitignore                       |   2 +
 Makefile.in                      |  12 +-
 bib-cite.el                      |   2 +
 context.el                       | 146 ++++----
 doc/auctex.texi                  |  35 +-
 doc/changes.texi                 |  47 +++
 font-latex.el                    |   1 -
 latex.el                         | 779 ++++++++++++++++++++-------------------
 lpath.el                         |   9 +-
 preview.el                       |  47 +--
 style/Alegreya.el                |   9 +-
 style/AlegreyaSans.el            |   9 +-
 style/AnonymousPro.el            |   8 +-
 style/CJK.el                     |   9 +-
 style/CJKutf8.el                 |   8 +-
 style/FiraMono.el                |   9 +-
 style/FiraSans.el                |   9 +-
 style/MinionPro.el               |  10 +-
 style/MyriadPro.el               |   9 +-
 style/XCharter.el                |   8 +-
 style/acro.el                    |   9 +-
 style/acronym.el                 |   7 +-
 style/afterpage.el               |   9 +-
 style/algorithm.el               |   7 +-
 style/algpseudocode.el           |   7 +-
 style/alltt.el                   |   7 +-
 style/alphanum.el                |  18 +-
 style/amsart.el                  |  10 +-
 style/amsbook.el                 |  17 +-
 style/amsbsy.el                  |  20 +-
 style/amsfonts.el                |   9 +-
 style/amsmath.el                 |   7 +-
 style/amsopn.el                  |  37 +-
 style/amssymb.el                 |   9 +-
 style/amstex.el                  |  16 +-
 style/amstext.el                 |  17 +-
 style/amsthm.el                  |  58 ++-
 style/appendix.el                |  79 ++++
 style/arabxetex.el               |  18 +-
 style/array.el                   |   7 +-
 style/article.el                 |   7 +-
 style/attachfile.el              |   8 +-
 style/australian.el              |   8 +-
 style/austrian.el                |   8 +-
 style/babel.el                   |  28 +-
 style/baskervaldx.el             |   8 +-
 style/beamer.el                  |   9 +-
 style/beamerarticle.el           |   6 +-
 style/beamerswitch.el            |   6 +-
 style/biblatex.el                |   9 +-
 style/bicaption.el               |  10 +-
 style/bidi.el                    |  10 +-
 style/bidibeamer.el              |   8 +-
 style/bigdelim.el                |   8 +-
 style/bigstrut.el                |   8 +-
 style/bm.el                      |   8 +-
 style/book.el                    |   7 +-
 style/booktabs.el                |  10 +-
 style/breqn.el                   |   4 +-
 style/bulgarian.el               |   9 +-
 style/canadian.el                |   8 +-
 style/captcont.el                |   8 +-
 style/caption.el                 |  12 +-
 style/changelog.el               |  10 +-
 style/cleveref.el                |   9 +-
 style/color.el                   |  10 +-
 style/colortbl.el                |   9 +-
 style/commath.el                 |   8 +-
 style/comment.el                 |   7 +-
 style/csquotes.el                |   7 +-
 style/currvita.el                |  11 +-
 style/czech.el                   |   6 +-
 style/danish.el                  |   7 +-
 style/dashundergaps.el           |   9 +-
 style/dcolumn.el                 |   8 +-
 style/dinbrief.el                |   5 +-
 style/dk-bib.el                  |   6 +-
 style/dk.el                      |  13 +-
 style/doc.el                     |  15 +-
 style/dutch.el                   |  13 +-
 style/emp.el                     |   9 +-
 style/empheq.el                  |  11 +-
 style/english.el                 |   6 +-
 style/enumitem.el                |  19 +-
 style/environ.el                 |   9 +-
 style/epigraph.el                |   9 +-
 style/epsf.el                    |   8 +-
 style/erewhon.el                 |   8 +-
 style/eso-pic.el                 |   9 +-
 style/everysel.el                |   8 +-
 style/exam.el                    |  70 ++--
 style/exercise.el                |   9 +-
 style/expl3.el                   |   7 +-
 style/fancyhdr.el                |   7 +-
 style/fancynum.el                |   8 +-
 style/fancyref.el                | 157 ++++----
 style/fancyvrb.el                | 237 ++++++++++--
 style/fbb.el                     |   8 +-
 style/fbox.el                    |   8 +-
 style/filecontents.el            |   9 +-
 style/flashcards.el              |   9 +-
 style/floatrow.el                |  32 +-
 style/foils.el                   |   8 +-
 style/fontaxes.el                |   6 +-
 style/fontenc.el                 |   6 +-
 style/fontspec.el                |  20 +-
 style/footmisc.el                |   8 +-
 style/framed.el                  |   9 +-
 style/francais.el                |   8 +-
 style/french.el                  |  10 +-
 style/frenchb.el                 |  36 +-
 style/fvextra.el                 |   9 +-
 style/geometry.el                |  12 +-
 style/german.el                  |   7 +-
 style/gloss-italian.el           |   9 +-
 style/graphics.el                |   7 +-
 style/graphicx.el                |  49 ++-
 style/harvard.el                 | 167 ++++-----
 style/hologo.el                  |  12 +-
 style/hyperref.el                |   7 +-
 style/icelandic.el               |   9 +-
 style/ifluatex.el                |  57 +--
 style/imakeidx.el                |   9 +-
 style/index.el                   | 113 +++---
 style/inputenc.el                |   8 +-
 style/italian.el                 |   8 +-
 style/j-article.el               |   7 +-
 style/j-book.el                  |   7 +-
 style/j-report.el                |   7 +-
 style/jarticle.el                |   7 +-
 style/jbook.el                   |   7 +-
 style/jreport.el                 |   7 +-
 style/jsarticle.el               |   7 +-
 style/jsbook.el                  |   7 +-
 style/jsreport.el                |   9 +-
 style/jura.el                    |   8 +-
 style/jurabib.el                 |   9 +-
 style/kantlipsum.el              |   8 +-
 style/kpfonts.el                 |   7 +-
 style/latexinfo.el               |   9 +-
 style/letter.el                  |   7 +-
 style/lettrine.el                |   9 +-
 style/lipsum.el                  |   8 +-
 style/listings.el                |   4 +-
 style/longtable.el               |   9 +-
 style/lscape.el                  |   9 +-
 style/ltablex.el                 |   8 +-
 style/ltugboat.el                |  16 +-
 style/ltx-base.el                | 101 ++---
 style/ltxdoc.el                  |   8 +-
 style/ltxguide.el                |   7 +-
 style/ltxtable.el                |   9 +-
 style/luacode.el                 |   9 +-
 style/luatextra.el               |  20 +-
 style/makeidx.el                 |  37 +-
 style/marginnote.el              |   8 +-
 style/mathtools.el               |   5 +-
 style/mdframed.el                |  25 +-
 style/mdsymbol.el                |   9 +-
 style/mdwlist.el                 |   9 +-
 style/memoir.el                  |   9 +-
 style/menukeys.el                | 133 +++----
 style/metalogo.el                |   8 +-
 style/mflogo.el                  |   8 +-
 style/minted.el                  |   5 +-
 style/mn2e.el                    |   9 +-
 style/mnras.el                   |   7 +-
 style/moodle.el                  |  11 +-
 style/multicol.el                |   9 +-
 style/multido.el                 |  29 +-
 style/multind.el                 |  70 ++--
 style/multirow.el                |   8 +-
 style/multitoc.el                |   8 +-
 style/nameref.el                 |   8 +-
 style/natbib.el                  |  11 +-
 style/naustrian.el               |   8 +-
 style/newfloat.el                |   7 +-
 style/newpxmath.el               |   8 +-
 style/newpxtext.el               |   8 +-
 style/newtxmath.el               |   8 +-
 style/newtxsf.el                 |   8 +-
 style/newtxtext.el               |   8 +-
 style/newtxttt.el                |   8 +-
 style/newzealand.el              |   8 +-
 style/ngerman.el                 |   7 +-
 style/nicefrac.el                |   9 +-
 style/nomencl.el                 |   8 +-
 style/ntheorem.el                |  34 +-
 style/ocg-p.el                   |   7 +-
 style/ocgx.el                    |   8 +-
 style/overpic.el                 |   7 +-
 style/paracol.el                 |  17 +-
 style/paralist.el                |   9 +-
 style/pdflscape.el               |   8 +-
 style/pdfpages.el                |   8 +-
 style/pdfsync.el                 |   8 +-
 style/placeins.el                |   8 +-
 style/plext.el                   |   9 +-
 style/plfonts.el                 |  14 +-
 style/plhb.el                    |  14 +-
 style/polish.el                  |   9 +-
 style/polski.el                  |   8 +-
 style/polyglossia.el             |   8 +-
 style/preview.el                 |   9 +-
 style/prosper.el                 |   7 +-
 style/psfig.el                   |  63 ++--
 style/pst-grad.el                |   8 +-
 style/pst-node.el                |   9 +-
 style/pst-plot.el                |   8 +-
 style/pst-slpe.el                |  41 ++-
 style/pstricks.el                |   6 +-
 style/pythontex.el               | 100 ++---
 style/ragged2e.el                |   9 +-
 style/relsize.el                 |   8 +-
 style/report.el                  |   7 +-
 style/revtex4-2.el               |   7 +-
 style/ruby.el                    |   8 +-
 style/{erewhon.el => scholax.el} |  86 +++--
 style/scrartcl.el                |  23 +-
 style/scrbase.el                 |   9 +-
 style/scrbook.el                 |  11 +-
 style/scrlttr2.el                | 212 +++++------
 style/scrpage2.el                |   6 +-
 style/scrreprt.el                |   9 +-
 style/setspace.el                |   9 +-
 style/shortvrb.el                |   7 +-
 style/siunitx.el                 |   7 +-
 style/slides.el                  |   9 +-
 style/slovak.el                  |   6 +-
 style/sourcecodepro.el           |   9 +-
 style/splitidx.el                |  25 +-
 style/subcaption.el              |   9 +-
 style/subfigure.el               |   9 +-
 style/subfiles.el                |  34 +-
 style/swedish.el                 |   7 +-
 style/tabularx.el                |   9 +-
 style/tabulary.el                |   9 +-
 style/tarticle.el                |   8 +-
 style/tbook.el                   |   8 +-
 style/tcolorbox.el               |  16 +-
 style/tcolorboxlib-raster.el     |   9 +-
 style/tex-live.el                |  13 +-
 style/textcomp.el                |   2 +-
 style/textpos.el                 |   9 +-
 style/theorem.el                 |  13 +-
 style/thm-restate.el             |   7 +-
 style/thmtools.el                |  14 +-
 style/tikz.el                    |   5 +-
 style/titleps.el                 |  23 +-
 style/titlesec.el                |  23 +-
 style/titletoc.el                |  22 +-
 style/transparent.el             |   8 +-
 style/treport.el                 |   8 +-
 style/ulem.el                    |   8 +-
 style/unicode-math.el            |   9 +-
 style/units.el                   |   8 +-
 style/url.el                     |   7 +-
 style/varioref.el                |   9 +-
 style/verbatim.el                |   7 +-
 style/virtex.el                  | 155 ++++----
 style/vwcol.el                   |   9 +-
 style/wrapfig.el                 |   7 +-
 style/xcolor.el                  |  68 ++--
 style/xkcdcolors.el              |   8 +-
 style/xltabular.el               |  11 +-
 style/xparse.el                  |  10 +-
 style/xspace.el                  |   8 +-
 style/zlmtt.el                   |   8 +-
 tests/japanese/preview-latex.el  |   6 +-
 tests/tex/command-expansion.el   |  75 ++--
 tex-bar.el                       |   6 +-
 tex-buf.el                       | 182 ++++-----
 tex-info.el                      |   6 +-
 tex-ispell.el                    |   4 +-
 tex-jp.el                        |  11 +-
 tex-site.el.in                   |   1 -
 tex.el                           | 227 ++++++------
 texmathp.el                      |  15 +-
 278 files changed, 3480 insertions(+), 2542 deletions(-)

diff --git a/.gitignore b/.gitignore
index d185fdb..658ce83 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,3 +47,5 @@ PROBLEMS.preview
 auctex-pkg.el
 auctex-autoloads.el
 tests/*/auto/*
+*.dynvars
+auctex-dynvars
diff --git a/Makefile.in b/Makefile.in
index 63234c1..e83c74c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -172,7 +172,8 @@ STYLESRC = style/prosper.el \
           style/changelog.el style/ltugboat.el  style/beamerswitch.el \
           style/multitoc.el  style/fbox.el      style/xkcdcolors.el \
           style/ltxguide.el  style/revtex4-2.el style/overpic.el \
-          style/tex-live.el  style/algorithm.el style/algpseudocode.el
+          style/tex-live.el  style/algorithm.el style/algpseudocode.el \
+          style/appendix.el  style/scholax.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
@@ -359,9 +360,16 @@ uninstall:
        rm -rf $(DESTDIR)$(packagelispdir)
        (cd latex ; $(MAKE) DESTDIR=$(DESTDIR) uninstall)
 
-.el.elc:
+%.elc: %.el
        $(ELCC) -f batch-byte-compile $<
 
+dynvars-check:
+       rm -f $(AUCELC) $(STYLEELC) *.dynvars style/*.dynvars auctex-dynvars
+       EMACS_GENERATE_DYNVARS=1 make some > /dev/null 2>&1
+       cat *.dynvars style/*.dynvars > auctex-dynvars
+       rm -f $(AUCELC) $(STYLEELC)
+       EMACS_DYNVARS_FILE=auctex-dynvars make some
+
 clean: doc/Makefile latex/Makefile
        rm -f $(CLEANFILES)
        cd doc && $(MAKE) clean
diff --git a/bib-cite.el b/bib-cite.el
index 8d346c3..1447888 100644
--- a/bib-cite.el
+++ b/bib-cite.el
@@ -589,6 +589,8 @@
 ;; ----------------------------------------------------------------------------
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
 (eval-when-compile
   (require 'cl-lib))
 
diff --git a/context.el b/context.el
index 626da22..bde604f 100644
--- a/context.el
+++ b/context.el
@@ -1,4 +1,4 @@
-;;; context.el --- Support for ConTeXt documents.
+;;; context.el --- Support for ConTeXt documents.  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2003-2006, 2008, 2010, 2012, 2014-2020
 ;;   Free Software Foundation, Inc.
@@ -64,24 +64,6 @@
   :group 'ConTeXt
   :group 'TeX-macro)
 
-
-;;; variables
-
-;; Dynamically scoped vars used in certain macro's.
-;; BEWARE: We used to give them a global nil value, but this can mess up poor
-;; unrelated packages using those same vars but expecting them to be
-;; lexically scoped.
-;; So don't give them a global value, which makes sure the effect of `defvar'
-;; localized to this file!
-;; N.B.: These forms are commented out since they produce a "lack of
-;; prefix" warning during byte-compilation.  This way they produce
-;; only a "reference to free variable" one.
-;; (defvar done-mark) ; Position of point afterwards, default nil (meaning end)
-;; (defvar reference) ; Used by `ConTeXt-section-ref' and 
`ConTeXt-section-section'.
-;; (defvar title) ; Used by `ConTeXt-section-title' and 
`ConTeXt-section-section'.
-;; (defvar name)
-;; (defvar level)
-
 ;; others
 
 (defvar ConTeXt-known-interfaces '("cz" "de" "en" "it" "nl" "ro" "uk"))
@@ -271,6 +253,13 @@
 
 ;;; Sections
 
+;; Declare dynamically scoped vars.
+(defvar ConTeXt-title nil "Dynamically bound by `ConTeXt-section'.")
+(defvar ConTeXt-name nil "Dynamically bound by `ConTeXt-section'.")
+(defvar ConTeXt-level nil "Dynamically bound by `ConTeXt-section'.")
+(defvar ConTeXt-done-mark nil "Dynamically bound by `ConTeXt-section'.")
+(defvar ConTeXt-reference nil "Dynamically bound by `ConTeXt-section'.")
+
 (defun ConTeXt-section (arg)
   "Insert a template for a ConTeXt section.
 Determinate the type of section to be inserted, by the argument ARG.
@@ -301,23 +290,23 @@ The following variables can be set to customize:
 
   (interactive "*P")
   (let* ((val (prefix-numeric-value arg))
-        (level (cond ((null arg)
-                      (ConTeXt-current-section))
-                     ((listp arg)
-                      (ConTeXt-down-section))
-                     ((< val 0)
-                      (ConTeXt-up-section (- val)))
-                     (t val)))
-        (name (ConTeXt-numbered-section-name level))
-        (title "")
-         (reference nil)
-        (done-mark (make-marker)))
+        (ConTeXt-level (cond ((null arg)
+                              (ConTeXt-current-section))
+                             ((listp arg)
+                              (ConTeXt-down-section))
+                             ((< val 0)
+                              (ConTeXt-up-section (- val)))
+                             (t val)))
+        (ConTeXt-name (ConTeXt-numbered-section-name ConTeXt-level))
+        (ConTeXt-title "")
+         (ConTeXt-reference nil)
+        (ConTeXt-done-mark (make-marker)))
     (newline)
     (run-hooks 'ConTeXt-numbered-section-hook)
     (newline)
-    (if (marker-position done-mark)
-       (goto-char (marker-position done-mark)))
-    (set-marker done-mark nil)))
+    (if (marker-position ConTeXt-done-mark)
+       (goto-char (marker-position ConTeXt-done-mark)))
+    (set-marker ConTeXt-done-mark nil)))
 
 ;; LaTeX has a max function here, which makes no sense.
 ;; I think you want to insert a section that is max ConTeXt-largest-level
@@ -417,22 +406,24 @@ section."
 
 The following variables are set before the hooks are run
 
-`level' - numeric section level, see the documentation of `ConTeXt-section'.
-`name' - name of the sectioning command, derived from `level'.
-`title' - The title of the section, default to an empty string.
-`done-mark' - Position of point afterwards, default nil (meaning end).
+`ConTeXt-level' - numeric section level, see the documentation of 
`ConTeXt-section'.
+`ConTeXt-name' - name of the sectioning command, derived from `level'.
+`ConTeXt-title' - The title of the section, default to an empty string.
+`ConTeXt-done-mark' - Position of point afterwards, default nil (meaning end).
 
 The following standard hook exist -
 
-ConTeXt-section-heading: Query the user about the name of the
-sectioning command.  Modifies `level' and `name'.
+ConTeXt-numbered-section-heading: Query the user about the name
+of the sectioning command.  Modifies `ConTeXt-level' and
+`ConTeXt-name'.
 
 ConTeXt-section-title: Query the user about the title of the
-section.  Modifies `title'.
+section.  Modifies `ConTeXt-title'.
 
-ConTeXt-section-section: Insert ConTeXt section command according to
-`name', `title', and `reference'.  If `title' is an empty string,
-`done-mark' will be placed at the point they should be inserted.
+ConTeXt-section-section: Insert ConTeXt section command according
+to `ConTeXt-name', `ConTeXt-title', and `ConTeXt-reference'.  If
+`ConTeXt-title' is an empty string, `ConTeXt-done-mark' will be
+placed at the point they should be inserted.
 
 ConTeXt-section-ref: Insert a reference for this section command.
 
@@ -463,22 +454,24 @@ in your .emacs file."
 
 The following variables are set before the hooks are run
 
-`level' - numeric section level, see the documentation of `ConTeXt-section'.
-`name' - name of the sectioning command, derived from `level'.
-`title' - The title of the section, default to an empty string.
-`done-mark' - Position of point afterwards, default nil (meaning end).
+`ConTeXt-level' - numeric section level, see the documentation of 
`ConTeXt-section'.
+`ConTeXt-name' - name of the sectioning command, derived from `ConTeXt-level'.
+`ConTeXt-title' - The title of the section, default to an empty string.
+`ConTeXt-done-mark' - Position of point afterwards, default nil (meaning end).
 
 The following standard hook exist -
 
-ConTeXt-section-heading: Query the user about the name of the
-sectioning command.  Modifies `level' and `name'.
+ConTeXt-unnumbered-section-heading: Query the user about the name
+of the sectioning command.  Modifies `ConTeXt-level' and
+`ConTeXt-name'.
 
 ConTeXt-section-title: Query the user about the title of the
-section.  Modifies `title'.
+section.  Modifies `ConTeXt-title'.
 
-ConTeXt-section-section: Insert ConTeXt section command according to
-`name', `title', and `reference'.  If `title' is an empty string,
-`done-mark' will be placed at the point they should be inserted.
+ConTeXt-section-section: Insert ConTeXt section command according
+to `ConTeXt-name', `ConTeXt-title', and `ConTeXt-reference'.  If
+`ConTeXt-title' is an empty string, `ConTeXt-done-mark' will be
+placed at the point they should be inserted.
 
 ConTeXt-section-ref: Insert a reference for this section command.
 
@@ -512,48 +505,49 @@ in your .emacs file."
 Insert this hook into `ConTeXt-numbered-section-hook' to allow the user to 
change
 the name of the sectioning command inserted with `\\[ConTeXt-section]'."
   (let ((string (completing-read
-                (concat "Select level (default " name "): ")
+                (concat "Select level (default " ConTeXt-name "): ")
                 ConTeXt-numbered-section-list
                 nil nil nil)))
     ;; Update name
     (if (not (zerop (length string)))
-       (setq name string))))
+       (setq ConTeXt-name string))))
 
 (defun ConTeXt-unnumbered-section-heading ()
   "Hook to prompt for ConTeXt section name.
 Insert this hook into `ConTeXt-unnumbered-section-hook' to allow the user to 
change
 the name of the sectioning command inserted with `\\[ConTeXt-section]'."
   (let ((string (completing-read
-                (concat "Select level (default " name "): ")
+                (concat "Select level (default " ConTeXt-name "): ")
                 ConTeXt-unnumbered-section-list
                 nil nil nil)))
     ;; Update name
     (if (not (zerop (length string)))
-       (setq name string))))
+       (setq ConTeXt-name string))))
 
 (defun ConTeXt-section-title ()
   "Hook to prompt for ConTeXt section title.
 Insert this hook into `ConTeXt-(un)numbered-section-hook' to allow the user to 
change
 the title of the section inserted with `\\[ConTeXt-section]."
-  (setq title (TeX-read-string "What title: ")))
+  (setq ConTeXt-title (TeX-read-string "What title: ")))
 
 (defun ConTeXt-section-section ()
   "Hook to insert ConTeXt section command into the file.
-Insert this hook into `ConTeXt-section-hook' after those hooks which sets
-the `name', `title', and `reference' variables, but before those hooks which
+Insert this hook into `ConTeXt-section-hook' after those hooks
+which sets the `ConTeXt-name', `ConTeXt-title', and
+`ConTeXt-reference' variables, but before those hooks which
 assumes the section already is inserted."
-  (insert TeX-esc name)
-  (cond ((null reference))
-       ((zerop (length reference))
+  (insert TeX-esc ConTeXt-name)
+  (cond ((null ConTeXt-reference))
+       ((zerop (length ConTeXt-reference))
         (insert ConTeXt-optop)
-        (set-marker done-mark (point))
+        (set-marker ConTeXt-done-mark (point))
         (insert ConTeXt-optcl))
        (t
-        (insert ConTeXt-optop reference ConTeXt-optcl)))
+        (insert ConTeXt-optop ConTeXt-reference ConTeXt-optcl)))
   (insert TeX-grop)
-  (if (zerop (length title))
-      (set-marker done-mark (point)))
-  (insert title TeX-grcl)
+  (if (zerop (length ConTeXt-title))
+      (set-marker ConTeXt-done-mark (point)))
+  (insert ConTeXt-title TeX-grcl)
   (newline)
   ;; If RefTeX is available, tell it that we've just made a new section
   (and (fboundp 'reftex-notice-new-section)
@@ -563,13 +557,14 @@ assumes the section already is inserted."
   "Hook to insert a reference after the sectioning command.
 Insert this hook into `ConTeXt-section-hook' to prompt for a label to be
 inserted after the sectioning command."
-  (setq reference (completing-read
-                  (TeX-argument-prompt t nil
-                                       "Comma separated list of references")
-                  (LaTeX-label-list) nil nil))
+  (setq ConTeXt-reference
+        (completing-read
+        (TeX-argument-prompt t nil
+                             "Comma separated list of references")
+        (LaTeX-label-list) nil nil))
   ;; No reference or empty string entered?
-  (if (string-equal "" reference)
-      (setq reference nil)))
+  (if (string-equal "" ConTeXt-reference)
+      (setq ConTeXt-reference nil)))
 
 
 ;; Various
@@ -1147,7 +1142,8 @@ An optional fourth (or sixth) element means always 
replace if t."
 (defun ConTeXt-imenu-create-index-function ()
   "Imenu support function for ConTeXt."
   (TeX-update-style)
-  (let (entries level (regexp (ConTeXt-outline-regexp)))
+  (let (entries
+        (regexp (ConTeXt-outline-regexp)))
     (goto-char (point-max))
     (while (re-search-backward regexp nil t)
       (let* ((name (ConTeXt-outline-name))
diff --git a/doc/auctex.texi b/doc/auctex.texi
index b19b60d..717ee4b 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -770,16 +770,16 @@ List of hooks to run when a new section is inserted.
 The following variables are set before the hooks are run
 
 @table @var
-@item level
+@item LaTeX-level
 Numeric section level, default set by prefix arg to
 @code{LaTeX-section}.
-@item name
+@item LaTeX-name
 Name of the sectioning command, derived from @var{level}.
-@item title
+@item LaTeX-title
 The title of the section, default to an empty string.
-@item toc
+@item LaTeX-toc
 Entry for the table of contents list, default nil.
-@item done-mark
+@item LaTeX-done-mark
 Position of point afterwards, default nil meaning after the inserted
 text.
 @end table
@@ -790,16 +790,17 @@ get the desired functionality by choosing from these 
hooks.
 @ftable @code
 @item LaTeX-section-heading
 Query the user about the name of the sectioning command.  Modifies
-@var{level} and @var{name}.
+@var{LaTeX-level} and @var{LaTeX-name}.
 @item LaTeX-section-title
-Query the user about the title of the section. Modifies @var{title}.
+Query the user about the title of the section. Modifies @var{LaTeX-title}.
 @item LaTeX-section-toc
-Query the user for the toc entry.  Modifies @var{toc}.
+Query the user for the toc entry.  Modifies @var{LaTeX-toc}.
 @item LaTeX-section-section
-Insert @LaTeX{} section command according to @var{name}, @var{title},
-and @var{toc}.  If @var{toc} is nil, no toc entry is inserted.  If
-@var{toc} or @var{title} are empty strings, @var{done-mark} will be
-placed at the point they should be inserted.
+Insert @LaTeX{} section command according to @var{LaTeX-name},
+@var{LaTeX-title}, and @var{LaTeX-toc}.  If @var{LaTeX-toc} is nil, no
+toc entry is inserted.  If @var{LaTeX-toc} or @var{LaTeX-title} are
+empty strings, @var{LaTeX-done-mark} will be placed at the point they
+should be inserted.
 @item LaTeX-section-label
 Insert a label after the section command.  Controlled by the variable
 @code{LaTeX-section-label}.
@@ -5000,7 +5001,7 @@ Here is a simple example of a style file.
  "book"
  (lambda () 
    (LaTeX-largest-level-set "chapter"))
- LaTeX-dialect)
+ TeX-dialect)
 @end lisp
 
 The example is from the @AUCTeX{} sources and is loaded for any @LaTeX{}
@@ -5069,10 +5070,10 @@ relatively to the set of all supported dialects
 
 In case of adding a style hook for @LaTeX{}, when calling function
 @code{TeX-add-style-hook} it is thought more futureproof for argument
-@var{dialect-expr} to pass constant @code{LaTeX-dialect} currently
+@var{dialect-expr} to pass constant @code{TeX-dialect} currently
 defined to @code{:latex}, rather than passing @code{:latex} directly.
 
-@defvr Constant LaTeX-dialect
+@defvr Constant TeX-dialect
 Default dialect for use with function @code{TeX-add-style-hook} for
 argument @var{dialect-expr} when the hook is to be run only on LaTeX
 file, or any mode derived thereof.
@@ -5354,8 +5355,8 @@ If you add new hooks, you can assume that point is placed 
directly after
 the previous argument, or after the macro name if this is the first
 argument.  Please leave point located after the argument you are
 inserting.  If you want point to be located somewhere else after all
-hooks have been processed, set the value of @code{exit-mark}.  It will
-point nowhere, until the argument hook sets it.
+hooks have been processed, set the value of @code{TeX-exit-mark}.  It
+will point nowhere, until the argument hook sets it.
 
 Some packages provide macros that are rarely useful to non-expert users.
 Those should be marked as expert macros using
diff --git a/doc/changes.texi b/doc/changes.texi
index febe9ce..be0d1cd 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -8,6 +8,53 @@
 
 @end ifset
 
+@heading News in 13.0
+
+@itemize @bullet
+@item
+@AUCTeX{} now uses lexical binding which has been introduced in Emacs
+24.  This change should have no user-visible effect and require no
+manual adaptions except in the following cases.
+
+@itemize @bullet
+@item
+Entries added to the customization variable @code{TeX-expand-list} also
+had access to variables @code{command} and @code{pos}.  Those are now
+properly declared and named @code{TeX-expand-command} and
+@code{TeX-expand-pos}.
+
+@item
+Entries added to the customization variable @code{TeX-expand-list} had
+access to a variable @code{file} which was bound to
+@code{TeX-active-master}, i.e., it evaluated to either the master or
+region file.  This usage must be replaced with either
+@code{TeX-active-master} or @code{TeX-active-master-with-quotes}.
+
+@item
+Viewer entries in @code{TeX-view-program-list} also had access to a
+variable @code{file} which was bound to the name of the master or region
+file without extension.  Instead, the function @code{TeX-active-master}
+has to be used now.
+
+@item
+Macro argument parsing functions could set a variable @code{exit-mark}
+to the buffer position where point should be left after all arguments
+have been read.  This variable is now named @code{TeX-exit-mark}.
+
+@item
+The functions in @code{LaTeX-section-hook} had access or modified the
+previously undeclared variables @code{title}, @code{name}, @code{level},
+@code{done-mark}, and @code{toc}.  These variables are now properly
+declared and have the @code{LaTeX-} prefix, e.g.,
+@code{LaTeX-done-mark}.
+@end itemize
+
+@item
+The constant @code{LaTeX-dialect} has been renamed to @code{TeX-dialect}
+and moved from @file{latex.el} to @file{tex.el}.  @code{LaTeX-dialect}
+now is an obsolete alias.
+@end itemize
+
 @heading News in 12.3
 
 @itemize @bullet
diff --git a/font-latex.el b/font-latex.el
index f8edf91..6c1110f 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1788,7 +1788,6 @@ Set by `font-latex--update-math-env' and used in
 
 (defun font-latex-update-math-env ()
   "Update regexp to search for math environments.
-Helper function for style files such as amsmath.el.
 Extract environments marked as `env-on' in
 `texmathp-tex-commands1' except starred variants. Then build
 `font-latex--match-math-envII-regexp' from them, appending the
diff --git a/latex.el b/latex.el
index 923d27a..32e51c3 100644
--- a/latex.el
+++ b/latex.el
@@ -1,4 +1,4 @@
-;;; latex.el --- Support for LaTeX documents.
+;;; latex.el --- Support for LaTeX documents.  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1991, 1993-2020 Free Software Foundation, Inc.
 
@@ -127,14 +127,11 @@ This depends on `LaTeX-insert-into-comments'."
 ;;; Sections
 
 ;; Declare dynamically scoped vars.
-;; N.B.: These forms are commented out since they produce a "lack of
-;; prefix" warning during byte-compilation.  This way they produce
-;; only a "reference to free variable" one.
-;; (defvar title)
-;; (defvar name)
-;; (defvar level)
-;; (defvar done-mark)
-;; (defvar toc)
+(defvar LaTeX-title nil "Dynamically bound by `LaTeX-section'.")
+(defvar LaTeX-name nil "Dynamically bound by `LaTeX-section'.")
+(defvar LaTeX-level nil "Dynamically bound by `LaTeX-section'.")
+(defvar LaTeX-done-mark nil "Dynamically bound by `LaTeX-section'.")
+(defvar LaTeX-toc nil "Dynamically bound by `LaTeX-section'.")
 
 (defun LaTeX-section (arg)
   "Insert a template for a LaTeX section.
@@ -160,25 +157,25 @@ The following variables can be set to customize:
 
   (interactive "*P")
   (let* ((val (prefix-numeric-value arg))
-        (level (cond ((null arg)
-                      (LaTeX-current-section))
-                     ((listp arg)
-                      (LaTeX-down-section))
-                     ((< val 0)
-                      (LaTeX-up-section (- val)))
-                     (t val)))
-        (name (LaTeX-section-name level))
-        (toc nil)
-        (title (if (TeX-active-mark)
-                   (buffer-substring (region-beginning)
-                                     (region-end))
-                 ""))
-        (done-mark (make-marker)))
+        (LaTeX-level (cond ((null arg)
+                            (LaTeX-current-section))
+                           ((listp arg)
+                            (LaTeX-down-section))
+                           ((< val 0)
+                            (LaTeX-up-section (- val)))
+                           (t val)))
+        (LaTeX-name (LaTeX-section-name LaTeX-level))
+        (LaTeX-toc nil)
+        (LaTeX-title (if (TeX-active-mark)
+                         (buffer-substring (region-beginning)
+                                           (region-end))
+                       ""))
+        (LaTeX-done-mark (make-marker)))
     (run-hooks 'LaTeX-section-hook)
     (LaTeX-newline)
-    (if (marker-position done-mark)
-       (goto-char (marker-position done-mark)))
-    (set-marker done-mark nil)))
+    (if (marker-position LaTeX-done-mark)
+       (goto-char (marker-position LaTeX-done-mark)))
+    (set-marker LaTeX-done-mark nil)))
 
 (defun LaTeX-current-section ()
   "Return the level of the section that contain point.
@@ -231,6 +228,9 @@ section."
                             ("subparagraph" 6))
   "List which elements is the names of the sections used by LaTeX.")
 
+(defvar LaTeX-section-menu nil)
+(make-variable-buffer-local 'LaTeX-section-menu)
+
 (defun LaTeX-section-list-add-locally (sections &optional clean)
   "Add SECTIONS to `LaTeX-section-list'.
 SECTIONS can be a single list containing the section macro name
@@ -339,6 +339,16 @@ If so, return the second element, otherwise return nil."
       (nth 1 (car list))
     nil))
 
+(defvar LaTeX-header-end
+  (concat "^[^%\n]*" (regexp-quote TeX-esc) "begin *"
+         TeX-grop "document" TeX-grcl)
+  "Default end of header marker for LaTeX documents.")
+
+(defvar LaTeX-trailer-start
+  (concat "^[^%\n]*" (regexp-quote TeX-esc) "end *"
+         TeX-grop "document" TeX-grcl)
+  "Default start of trailer marker for LaTeX documents.")
+
 (defun LaTeX-outline-level ()
   "Find the level of current outline heading in an LaTeX document."
   (cond ((looking-at LaTeX-header-end) 1)
@@ -348,15 +358,15 @@ If so, return the second element, otherwise return nil."
                   (LaTeX-outline-offset))))
        (t
         (save-excursion
-         (skip-chars-forward " \t")
-         (forward-char 1)
-         (cond ((looking-at "appendix") 1)
-               ((looking-at "documentstyle") 1)
-               ((looking-at "documentclass") 1)
-               ((TeX-look-at LaTeX-section-list)
-                (max 1 (+ (TeX-look-at LaTeX-section-list)
-                          (LaTeX-outline-offset))))
-               (t (outline-level)))))))
+          (skip-chars-forward " \t")
+          (forward-char 1)
+          (cond ((looking-at "appendix") 1)
+                ((looking-at "documentstyle") 1)
+                ((looking-at "documentclass") 1)
+                ((TeX-look-at LaTeX-section-list)
+                 (max 1 (+ (TeX-look-at LaTeX-section-list)
+                           (LaTeX-outline-offset))))
+                (t (outline-level)))))))
 
 (defun LaTeX-outline-name ()
   "Guess a name for the current header line."
@@ -371,34 +381,35 @@ If so, return the second element, otherwise return nil."
 (defcustom LaTeX-section-hook
   '(LaTeX-section-heading
     LaTeX-section-title
-;; LaTeX-section-toc           ; Most people won't want this
+    ;; LaTeX-section-toc               ; Most people won't want this
     LaTeX-section-section
     LaTeX-section-label)
   "List of hooks to run when a new section is inserted.
 
 The following variables are set before the hooks are run
 
-level - numeric section level, see the documentation of `LaTeX-section'.
-name - name of the sectioning command, derived from `level'.
-title - The title of the section, default to an empty string.
-toc - Entry for the table of contents list, default nil.
-done-mark - Position of point afterwards, default nil (meaning end).
+LaTeX-level - numeric section level, see the documentation of `LaTeX-section'.
+LaTeX-name - name of the sectioning command, derived from `LaTeX-level'.
+LaTeX-title - The title of the section, default to an empty string.
+LaTeX-toc - Entry for the table of contents list, default nil.
+LaTeX-done-mark - Position of point afterwards, default nil (meaning end).
 
 The following standard hook exist -
 
 LaTeX-section-heading: Query the user about the name of the
-sectioning command.  Modifies `level' and `name'.
+sectioning command.  Modifies `LaTeX-level' and `LaTeX-name'.
 
 LaTeX-section-title: Query the user about the title of the
-section.  Modifies `title'.
+section.  Modifies `LaTeX-title'.
 
 LaTeX-section-toc: Query the user for the toc entry.  Modifies
-`toc'.
+`LaTeX-toc'.
 
 LaTeX-section-section: Insert LaTeX section command according to
-`name', `title', and `toc'.  If `toc' is nil, no toc entry is
-inserted.  If `toc' or `title' are empty strings, `done-mark' will be
-placed at the point they should be inserted.
+`LaTeX-name', `LaTeX-title', and `LaTeX-toc'.  If `LaTeX-toc' is
+nil, no toc entry is inserted.  If `LaTeX-toc' or `LaTeX-title'
+are empty strings, `LaTeX-done-mark' will be placed at the point
+they should be inserted.
 
 LaTeX-section-label: Insert a label after the section command.
 Controled by the variable `LaTeX-section-label'.
@@ -458,20 +469,20 @@ no label is inserted."
 Insert this hook into `LaTeX-section-hook' to allow the user to change
 the name of the sectioning command inserted with `\\[LaTeX-section]'."
   (let ((string (completing-read
-                (concat "Level (default " name "): ")
+                (concat "Level (default " LaTeX-name "): ")
                 LaTeX-section-list
-                nil nil nil nil name)))
-    ;; Update name
+                nil nil nil nil LaTeX-name)))
+    ;; Update LaTeX-name
     (if (not (zerop (length string)))
-       (setq name string))
+       (setq LaTeX-name string))
     ;; Update level
-    (setq level (LaTeX-section-level name))))
+    (setq LaTeX-level (LaTeX-section-level LaTeX-name))))
 
 (defun LaTeX-section-title ()
   "Hook to prompt for LaTeX section title.
 Insert this hook into `LaTeX-section-hook' to allow the user to change
 the title of the section inserted with `\\[LaTeX-section]."
-  (setq title (TeX-read-string "Title: " title))
+  (setq LaTeX-title (TeX-read-string "Title: " LaTeX-title))
   (let ((region (and (TeX-active-mark)
                     (cons (region-beginning) (region-end)))))
     (when region (delete-region (car region) (cdr region)))))
@@ -480,15 +491,16 @@ the title of the section inserted with 
`\\[LaTeX-section]."
   "Hook to prompt for the LaTeX section entry in the table of content .
 Insert this hook into `LaTeX-section-hook' to allow the user to insert
 a different entry for the section in the table of content."
-  (setq toc (TeX-read-string "Toc Entry: "))
-  (if (zerop (length toc))
-      (setq toc nil)))
+  (setq LaTeX-toc (TeX-read-string "Toc Entry: "))
+  (if (zerop (length LaTeX-toc))
+      (setq LaTeX-toc nil)))
 
 (defun LaTeX-section-section ()
   "Hook to insert LaTeX section command into the file.
-Insert this hook into `LaTeX-section-hook' after those hooks that set
-the `name', `title', and `toc' variables, but before those hooks that
-assume that the section is already inserted."
+Insert this hook into `LaTeX-section-hook' after those hooks that
+set the `LaTeX-name', `LaTeX-title', and `LaTeX-toc' variables,
+but before those hooks that assume that the section is already
+inserted."
   ;; insert a new line if the current line and the previous line are
   ;; not empty (except for whitespace), with one exception: do not
   ;; insert a new line if the previous (or current, sigh) line starts
@@ -499,18 +511,18 @@ assume that the section is already inserted."
                     "begin")
             (line-beginning-position 0) t))
     (LaTeX-newline))
-  (insert TeX-esc name)
-  (cond ((null toc))
-       ((zerop (length toc))
+  (insert TeX-esc LaTeX-name)
+  (cond ((null LaTeX-toc))
+       ((zerop (length LaTeX-toc))
         (insert LaTeX-optop)
-        (set-marker done-mark (point))
+        (set-marker LaTeX-done-mark (point))
         (insert LaTeX-optcl))
        (t
-        (insert LaTeX-optop toc LaTeX-optcl)))
+        (insert LaTeX-optop LaTeX-toc LaTeX-optcl)))
   (insert TeX-grop)
-  (if (zerop (length title))
-      (set-marker done-mark (point)))
-  (insert title TeX-grcl)
+  (if (zerop (length LaTeX-title))
+      (set-marker LaTeX-done-mark (point)))
+  (insert LaTeX-title TeX-grcl)
   (LaTeX-newline)
   ;; If RefTeX is available, tell it that we've just made a new section
   (and (fboundp 'reftex-notice-new-section)
@@ -522,7 +534,7 @@ Insert this hook into `LaTeX-section-hook' to prompt for a 
label to be
 inserted after the sectioning command.
 
 The behaviour of this hook is controlled by variable `LaTeX-section-label'."
-  (and (LaTeX-label name 'section)
+  (and (LaTeX-label LaTeX-name 'section)
        (LaTeX-newline)))
 
 ;;; Environments
@@ -665,6 +677,8 @@ With prefix-argument, reopen environment afterwards."
 
 (define-obsolete-variable-alias 'LaTeX-after-insert-env-hooks 
'LaTeX-after-insert-env-hook "11.89")
 
+(defvar LaTeX-indent-environment-list) ;; Defined further below.
+
 (defvar LaTeX-after-insert-env-hook nil
   "List of functions to be run at the end of `LaTeX-insert-environment'.
 Each function is called with three arguments: the name of the
@@ -854,6 +868,8 @@ position just before \\begin and the position just before
                            (save-excursion (funcall goto-begin))
                            (progn (funcall goto-end) (point)))))))
 
+(defvar LaTeX-syntactic-comments) ;; Defined further below.
+
 (defun LaTeX-current-environment (&optional arg)
   "Return the name (a string) of the enclosing LaTeX environment.
 With optional ARG>=1, find that outer level.
@@ -1063,6 +1079,8 @@ corresponding entry."
 
 (make-variable-buffer-local 'LaTeX-label-alist)
 
+(defvar TeX-read-label-prefix) ;; Defined further below.
+
 (defun LaTeX-label (name &optional type no-insert)
   "Insert a label for NAME at point.
 The optional TYPE argument can be either environment or section:
@@ -1317,9 +1335,8 @@ Just like array and tabular."
   (save-excursion
     (LaTeX-find-matching-begin)
     (end-of-line)
-    (let ((exit-mark (if (boundp 'exit-mark)
-                        exit-mark
-                      (make-marker))))
+    (let ((TeX-exit-mark (or TeX-exit-mark
+                            (make-marker))))
       (TeX-parse-arguments args))))
 
 (defun LaTeX-env-label-as-keyval (_optional &optional keyword keyvals 
environment)
@@ -1412,7 +1429,7 @@ You may use `LaTeX-item-list' to change the routines used 
to insert the item."
       (TeX-insert-macro "item"))
     (indent-according-to-mode)))
 
-(defvar TeX-arg-item-label-p)
+(defvar TeX-arg-item-label-p) ;; Defined further below.
 
 (defun LaTeX-item-argument ()
   "Insert a new item with an optional argument."
@@ -1942,6 +1959,11 @@ The value is actually the tail of the list of options 
given to PACKAGE."
 
 ;;; BibTeX
 
+(defvar BibTeX-auto-regexp-list
+  '(("@[Ss][Tt][Rr][Ii][Nn][Gg]" 1 ignore)
+    ("@[a-zA-Z]+[{(][ \t]*\\([^, \n\r\t%\"#'()={}]*\\)" 1 LaTeX-auto-bibitem))
+  "List of regexp-list expressions matching BibTeX items.")
+
 ;;;###autoload
 (defun BibTeX-auto-store ()
   "This function should be called from `bibtex-mode-hook'.
@@ -1956,21 +1978,14 @@ It will setup BibTeX to store keys in an auto file."
   (set (make-local-variable 'TeX-auto-regexp-list) BibTeX-auto-regexp-list)
   (set (make-local-variable 'TeX-master) t))
 
-(defvar BibTeX-auto-regexp-list
-  '(("@[Ss][Tt][Rr][Ii][Nn][Gg]" 1 ignore)
-    ("@[a-zA-Z]+[{(][ \t]*\\([^, \n\r\t%\"#'()={}]*\\)" 1 LaTeX-auto-bibitem))
-  "List of regexp-list expressions matching BibTeX items.")
-
 ;;; Macro Argument Hooks
 
-(defun TeX-arg-conditional (optional expr then else)
+(defun TeX-arg-conditional (_optional expr then else)
   "Implement if EXPR THEN ELSE.
 
-If OPTIONAL is non-nil, insert the resulting value as an optional
-argument, otherwise as a mandatory one.
-
-If EXPR evaluate to true, parse THEN as an argument list, else parse
-ELSE as an argument list."
+If EXPR evaluate to true, parse THEN as an argument list, else
+parse ELSE as an argument list.  The compatibility argument
+OPTIONAL is ignored."
   (TeX-parse-arguments (if (eval expr) then else)))
 
 (defun TeX-arg-eval (optional &rest args)
@@ -2055,7 +2070,7 @@ string.  ARGS is unused."
   (TeX-argument-insert
    (TeX-read-string (TeX-argument-prompt optional prompt "Index tag")) 
optional))
 
-(defun TeX-arg-index (optional &optional prompt &rest args)
+(defun TeX-arg-index (optional &optional prompt &rest _args)
   "Prompt for an index entry completing with known entries.
 If OPTIONAL is non-nil, insert the resulting value as an optional
 argument, otherwise as a mandatory one.  Use PROMPT as the prompt
@@ -2099,7 +2114,7 @@ the list of defined environments."
     (TeX-argument-insert environment optional)))
 
 ;; Why is DEFINITION unused?
-(defun TeX-arg-cite (optional &optional prompt definition)
+(defun TeX-arg-cite (optional &optional prompt _definition)
   "Prompt for a BibTeX citation with completion.
 If OPTIONAL is non-nil, insert the resulting value as an optional
 argument, otherwise as a mandatory one.  Use PROMPT as the prompt
@@ -2302,6 +2317,18 @@ and this variable will be ignored."
 Initialized once at the first time you prompt for a LaTeX class.
 May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
 
+(defcustom TeX-arg-input-file-search t
+  "If `TeX-arg-input-file' should search for files.
+If the value is t, files in TeX's search path are searched for
+and provided for completion.  The file name is then inserted
+without directory and extension.  If the value is nil, the file
+name can be specified manually and is inserted with a path
+relative to the directory of the current buffer's file and with
+extension.  If the value is `ask', you are asked for the method
+to use every time `TeX-arg-input-file' is called."
+  :group 'LaTeX-macro
+  :type '(choice (const t) (const nil) (const ask)))
+
 (defvar TeX-after-document-hook nil
   "List of functions to be run at the end of `TeX-arg-document'.
 
@@ -2364,6 +2391,11 @@ OPTIONAL and IGNORE are ignored."
 
 To insert a hook here, you must insert it in the appropiate style file.")
 
+(defvar TeX-global-input-files nil
+  "List of the non-local TeX input files.
+Initialized once at the first time you prompt for an input file.
+May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+
 (defun LaTeX-arg-usepackage-read-packages-with-options ()
   "Read the packages and the options for the usepackage macro.
 
@@ -2482,23 +2514,6 @@ Reset the mode for a change of this variable to take 
effect."
                       (choice :tag "Extensions"
                               variable (repeat string)))))
 
-(defcustom TeX-arg-input-file-search t
-  "If `TeX-arg-input-file' should search for files.
-If the value is t, files in TeX's search path are searched for
-and provided for completion.  The file name is then inserted
-without directory and extension.  If the value is nil, the file
-name can be specified manually and is inserted with a path
-relative to the directory of the current buffer's file and with
-extension.  If the value is `ask', you are asked for the method
-to use every time `TeX-arg-input-file' is called."
-  :group 'LaTeX-macro
-  :type '(choice (const t) (const nil) (const ask)))
-
-(defvar TeX-global-input-files nil
-  "List of the non-local TeX input files.
-Initialized once at the first time you prompt for an input file.
-May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
-
 (defun TeX-arg-input-file (optional &optional prompt local)
   "Prompt for a tex or sty file.
 If OPTIONAL is non-nil, insert the resulting value as an optional
@@ -2675,10 +2690,9 @@ the list of defined pagestyles."
   :group 'LaTeX-macro
   :type 'character)
 
-(defun TeX-arg-verb (optional &optional _ignore)
+(defun TeX-arg-verb (_optional &optional _ignore)
   "Prompt for delimiter and text.
-If OPTIONAL is non-nil, insert the resulting value as an optional
-argument, otherwise as a mandatory one.  IGNORE is ignored."
+The compatibility argument OPTIONAL and IGNORE are ignored."
   (let ((del (read-quoted-char
              (concat "Delimiter (default "
                      (char-to-string LaTeX-default-verb-delimiter) "): "))))
@@ -2723,16 +2737,13 @@ argument in delimiters like \"\| \|\" or braces \"\{ 
\}\"."
     (unless (= del ?\{)
       (setq LaTeX-default-verb-delimiter del))))
 
-(defun TeX-arg-pair (optional first second)
+(defun TeX-arg-pair (_optional first second)
   "Insert a pair of number, prompted by FIRST and SECOND.
 
 The numbers are surounded by parenthesizes and separated with a
-comma.
-
-If OPTIONAL is non-nil, insert the resulting value as an optional
-argument, otherwise as a mandatory one."
+comma.  The compatibility argument OPTIONAL is ignored."
   (insert "(" (TeX-read-string (concat first  ": ")) ","
-             (TeX-read-string (concat second ": ")) ")"))
+         (TeX-read-string (concat second ": ")) ")"))
 
 (defun TeX-arg-size (optional)
   "Insert width and height as a pair.
@@ -2831,6 +2842,8 @@ string."
         (indent-according-to-mode))
       (indent-according-to-mode))))
 
+(defvar TeX-arg-right-insert-p) ;; Defined further below.
+
 (defun TeX-arg-insert-right-brace-maybe (optional)
   "Insert the suitable right brace macro such as \\rangle.
 Insertion is done when `TeX-arg-right-insert-p' is non-nil.
@@ -2854,8 +2867,6 @@ supply the corresponding macro such as \\right before the 
right brace macro."
        (LaTeX-insert-corresponding-right-macro-and-brace
         left-macro left-brace optional)))))
 
-(defvar TeX-arg-right-insert-p)
-
 (defun LaTeX-insert-left-brace (arg)
   "Insert typed left brace ARG times and possibly a correspondig right brace.
 Automatic right brace insertion is done only if no prefix ARG is given and
@@ -2871,36 +2882,36 @@ Normally bound to keys \(, { and [."
        (exchange-point-and-mark))
     (self-insert-command (prefix-numeric-value arg))
     (if auto-p
-      (let ((lbrace (char-to-string last-command-event)) lmacro skip-p)
-        (save-excursion
-          (backward-char)
-         ;; The brace "{" is exceptional in two aspects.
-         ;; 1. "\{" should be considered as a single brace
-         ;;    like "(" and "[".
-         ;; 2. "\left{" is nonsense while "\left\{" and
-         ;;    "\left(" are not.
-         (if (string= lbrace TeX-grop)
-             ;; If "{" follows "\", set lbrace to "\{".
-             (if (TeX-escaped-p)
-                 (progn
-                   (backward-char)
-                   (setq lbrace (concat TeX-esc TeX-grop)))
-               ;; Otherwise, don't search for left macros.
-               (setq skip-p t)))
-         (unless skip-p
-           ;; Obtain the name of preceding left macro, if any,
-           ;; such as "left", "bigl" etc.
-           (setq lmacro (LaTeX--find-preceding-left-macro-name))))
-        (let ((TeX-arg-right-insert-p t)
-              ;; "{" and "}" are paired temporally so that typing
-             ;; a single "{" should insert a pair "{}".
-              (TeX-braces-association
-               (cons (cons TeX-grop TeX-grcl) TeX-braces-association)))
-         (save-excursion
-           (if (TeX-active-mark)
-               (goto-char (mark)))
-           (LaTeX-insert-corresponding-right-macro-and-brace
-            lmacro lbrace)))))))
+        (let ((lbrace (char-to-string last-command-event)) lmacro skip-p)
+          (save-excursion
+            (backward-char)
+           ;; The brace "{" is exceptional in two aspects.
+           ;; 1. "\{" should be considered as a single brace
+           ;;    like "(" and "[".
+           ;; 2. "\left{" is nonsense while "\left\{" and
+           ;;    "\left(" are not.
+           (if (string= lbrace TeX-grop)
+               ;; If "{" follows "\", set lbrace to "\{".
+               (if (TeX-escaped-p)
+                   (progn
+                     (backward-char)
+                     (setq lbrace (concat TeX-esc TeX-grop)))
+                 ;; Otherwise, don't search for left macros.
+                 (setq skip-p t)))
+           (unless skip-p
+             ;; Obtain the name of preceding left macro, if any,
+             ;; such as "left", "bigl" etc.
+             (setq lmacro (LaTeX--find-preceding-left-macro-name))))
+          (let ((TeX-arg-right-insert-p t)
+                ;; "{" and "}" are paired temporally so that typing
+               ;; a single "{" should insert a pair "{}".
+                (TeX-braces-association
+                 (cons (cons TeX-grop TeX-grcl) TeX-braces-association)))
+           (save-excursion
+             (if (TeX-active-mark)
+                 (goto-char (mark)))
+             (LaTeX-insert-corresponding-right-macro-and-brace
+              lmacro lbrace)))))))
 ;; Cater for `delete-selection-mode' (bug#36385)
 ;; See the header comment of delsel.el for detail.
 (put #'LaTeX-insert-left-brace 'delete-selection
@@ -4479,10 +4490,10 @@ environments."
     ;; Only change point and mark after beginning and end were found.
     ;; Point should not end up in the middle of nowhere if the search fails.
     (save-excursion
-      (dotimes (c count) (LaTeX-find-matching-end))
+      (dotimes (_ count) (LaTeX-find-matching-end))
       (setq end (line-beginning-position 2))
       (goto-char cur)
-      (dotimes (c count) (LaTeX-find-matching-begin))
+      (dotimes (_ count) (LaTeX-find-matching-begin))
       (setq beg (point)))
     (push-mark end)
     (goto-char beg)
@@ -4555,6 +4566,8 @@ value of NO-SUBSECTIONS."
     "newpage" "clearpage")
   "Internal list of LaTeX macros that should have their own line.")
 
+(defvar LaTeX-paragraph-commands)
+
 (defun LaTeX-paragraph-commands-regexp-make ()
   "Return a regular expression matching defined paragraph commands.
 Regexp part containing TeX control words is postfixed with `\\b'
@@ -4572,6 +4585,8 @@ to avoid ambiguities (e.g. \\par vs. \\parencite)."
            (regexp-opt symbs)
            "\\)")))
 
+(defvar LaTeX-paragraph-commands-regexp)
+
 (defcustom LaTeX-paragraph-commands nil
   "List of LaTeX macros that should have their own line.
 The list should contain macro names without the leading backslash."
@@ -4583,7 +4598,7 @@ The list should contain macro names without the leading 
backslash."
               (LaTeX-paragraph-commands-regexp-make))))
 
 (defvar LaTeX-paragraph-commands-regexp (LaTeX-paragraph-commands-regexp-make)
-    "Regular expression matching LaTeX macros that should have their own 
line.")
+  "Regular expression matching LaTeX macros that should have their own line.")
 
 (defun LaTeX-set-paragraph-start ()
   "Set `paragraph-start'."
@@ -4592,8 +4607,8 @@ The list should contain macro names without the leading 
backslash."
         "[ \t]*%*[ \t]*\\("
         LaTeX-paragraph-commands-regexp "\\|"
         (regexp-quote TeX-esc) "\\(" LaTeX-item-regexp "\\)\\|"
-        "\\$\\$\\|" ; Plain TeX display math (Some people actually
-                    ; use this with LaTeX.  Yuck.)
+        "\\$\\$\\|"    ; Plain TeX display math (Some people actually use this
+                                        ; with LaTeX.  Yuck.)
         "$\\)")))
 
 (defun LaTeX-paragraph-commands-add-locally (commands)
@@ -4615,7 +4630,7 @@ convenience function which can be used in style files."
   "Move forward to end of paragraph.
 If COUNT is non-nil, do it COUNT times."
   (or count (setq count 1))
-  (dotimes (i count)
+  (dotimes (_ count)
     (let* ((macro-start (TeX-find-macro-start))
           (paragraph-command-start
            (cond
@@ -4668,7 +4683,7 @@ If COUNT is non-nil, do it COUNT times."
   "Move backward to beginning of paragraph.
 If COUNT is non-nil, do it COUNT times."
   (or count (setq count 1))
-  (dotimes (i count)
+  (dotimes (_ count)
     (let* ((macro-start (TeX-find-macro-start)))
       (if (and macro-start
               ;; Point really has to be inside of the macro, not before it.
@@ -4760,28 +4775,6 @@ of verbatim constructs are not considered."
 (defvar LaTeX-math-keymap (make-sparse-keymap)
   "Keymap used for `LaTeX-math-mode' commands.")
 
-(defun LaTeX-math-abbrev-prefix ()
-  "Make a key definition from the variable `LaTeX-math-abbrev-prefix'."
-  (if (stringp LaTeX-math-abbrev-prefix)
-      (read-kbd-macro LaTeX-math-abbrev-prefix)
-    LaTeX-math-abbrev-prefix))
-
-(defvar LaTeX-math-menu
-  '("Math"
-    ("Greek Uppercase") ("Greek Lowercase") ("Binary Op") ("Relational")
-    ("Arrows") ("Punctuation") ("Misc Symbol") ("Var Symbol") ("Log-like")
-    ("Delimiters") ("Constructs") ("Accents") ("AMS"))
-  "Menu containing LaTeX math commands.
-The menu entries will be generated dynamically, but you can specify
-the sequence by initializing this variable.")
-
-(defcustom LaTeX-math-menu-unicode
-  (or (string-match "\\<GTK\\>" (emacs-version))
-      (eq window-system 'w32))
-  "Whether the LaTeX menu should try using Unicode for effect."
-  :type 'boolean
-  :group 'LaTeX-math)
-
 (defcustom LaTeX-math-abbrev-prefix "`"
   "Prefix key for use in `LaTeX-math-mode'.
 This has to be a string representing a key sequence in a format
@@ -4799,72 +4792,20 @@ use \\[customize]."
            (LaTeX-math-abbrev-prefix) LaTeX-math-keymap))
   :type '(string :tag "Key sequence"))
 
-(defun LaTeX-math-initialize ()
-  (let ((math (reverse (append LaTeX-math-list LaTeX-math-default)))
-       (map LaTeX-math-keymap)
-       (unicode (and LaTeX-math-menu-unicode (fboundp 'decode-char))))
-    (while math
-      (let* ((entry (car math))
-            (key (nth 0 entry))
-            (prefix
-             (and unicode
-                  (nth 3 entry)))
-            value menu name)
-       (setq math (cdr math))
-       (if (and prefix
-                (setq prefix (decode-char 'ucs (nth 3 entry))))
-           (setq prefix (concat (string prefix) " \\"))
-         (setq prefix "\\"))
-       (if (listp (cdr entry))
-           (setq value (nth 1 entry)
-                 menu (nth 2 entry))
-         (setq value (cdr entry)
-               menu nil))
-       (if (stringp value)
-           (progn
-             (setq name (intern (concat "LaTeX-math-" value)))
-             (fset name (list 'lambda (list 'arg) (list 'interactive "*P")
-                              (list 'LaTeX-math-insert value 'arg))))
-         (setq name value))
-       (if key
-           (progn
-             (setq key (cond ((numberp key) (char-to-string key))
-                             ((stringp key) (read-kbd-macro key))
-                             (t (vector key))))
-             (define-key map key name)))
-       (if menu
-           (let ((parent LaTeX-math-menu))
-             (if (listp menu)
-                 (progn
-                   (while (cdr menu)
-                     (let ((sub (assoc (car menu) LaTeX-math-menu)))
-                       (if sub
-                           (setq parent sub)
-                         (setcdr parent (cons (list (car menu)) (cdr parent))))
-                       (setq menu (cdr menu))))
-                   (setq menu (car menu))))
-             (let ((sub (assoc menu parent)))
-               (if sub
-                   (if (stringp value)
-                       (setcdr sub (cons (vector (concat prefix value)
-                                                 name t)
-                                         (cdr sub)))
-                     (error "Cannot have multiple special math menu items"))
-                 (setcdr parent
-                         (cons (if (stringp value)
-                                   (list menu (vector (concat prefix value)
-                                                      name t))
-                                 (vector menu name t))
-                               (cdr parent)))))))))
-    ;; Make the math prefix char available if it has not been used as a prefix.
-    (unless (lookup-key map (LaTeX-math-abbrev-prefix))
-      (define-key map (LaTeX-math-abbrev-prefix) 'self-insert-command))))
+(defun LaTeX-math-abbrev-prefix ()
+  "Make a key definition from the variable `LaTeX-math-abbrev-prefix'."
+  (if (stringp LaTeX-math-abbrev-prefix)
+      (read-kbd-macro LaTeX-math-abbrev-prefix)
+    LaTeX-math-abbrev-prefix))
 
-(defconst LaTeX-dialect :latex
-  "Default dialect for use with function `TeX-add-style-hook' for
-argument DIALECT-EXPR when the hook is to be run only on LaTeX
-file, or any mode derived thereof. See variable
-`TeX-style-hook-dialect'." )
+(defvar LaTeX-math-menu
+  '("Math"
+    ("Greek Uppercase") ("Greek Lowercase") ("Binary Op") ("Relational")
+    ("Arrows") ("Punctuation") ("Misc Symbol") ("Var Symbol") ("Log-like")
+    ("Delimiters") ("Constructs") ("Accents") ("AMS"))
+  "Menu containing LaTeX math commands.
+The menu entries will be generated dynamically, but you can specify
+the sequence by initializing this variable.")
 
 (defconst LaTeX-math-default
   '((?a "alpha" "Greek Lowercase" 945) ;; #X03B1
@@ -5394,6 +5335,76 @@ file, or any mode derived thereof. See variable
 Each entry should be a list with upto four elements, KEY, VALUE,
 MENU and CHARACTER, see `LaTeX-math-list' for details.")
 
+(defcustom LaTeX-math-menu-unicode
+  (or (string-match "\\<GTK\\>" (emacs-version))
+      (eq window-system 'w32))
+  "Whether the LaTeX menu should try using Unicode for effect."
+  :type 'boolean
+  :group 'LaTeX-math)
+
+(defvar LaTeX-math-list) ;; Defined further below.
+
+(defun LaTeX-math-initialize ()
+  (let ((math (reverse (append LaTeX-math-list LaTeX-math-default)))
+       (map LaTeX-math-keymap)
+       (unicode (and LaTeX-math-menu-unicode (fboundp 'decode-char))))
+    (while math
+      (let* ((entry (car math))
+            (key (nth 0 entry))
+            (prefix
+             (and unicode
+                  (nth 3 entry)))
+            value menu name)
+       (setq math (cdr math))
+       (if (and prefix
+                (setq prefix (decode-char 'ucs (nth 3 entry))))
+           (setq prefix (concat (string prefix) " \\"))
+         (setq prefix "\\"))
+       (if (listp (cdr entry))
+           (setq value (nth 1 entry)
+                 menu (nth 2 entry))
+         (setq value (cdr entry)
+               menu nil))
+       (if (stringp value)
+           (progn
+             (setq name (intern (concat "LaTeX-math-" value)))
+             (fset name (list 'lambda (list 'arg) (list 'interactive "*P")
+                              (list 'LaTeX-math-insert value 'arg))))
+         (setq name value))
+       (if key
+           (progn
+             (setq key (cond ((numberp key) (char-to-string key))
+                             ((stringp key) (read-kbd-macro key))
+                             (t (vector key))))
+             (define-key map key name)))
+       (if menu
+           (let ((parent LaTeX-math-menu))
+             (if (listp menu)
+                 (progn
+                   (while (cdr menu)
+                     (let ((sub (assoc (car menu) LaTeX-math-menu)))
+                       (if sub
+                           (setq parent sub)
+                         (setcdr parent (cons (list (car menu)) (cdr parent))))
+                       (setq menu (cdr menu))))
+                   (setq menu (car menu))))
+             (let ((sub (assoc menu parent)))
+               (if sub
+                   (if (stringp value)
+                       (setcdr sub (cons (vector (concat prefix value)
+                                                 name t)
+                                         (cdr sub)))
+                     (error "Cannot have multiple special math menu items"))
+                 (setcdr parent
+                         (cons (if (stringp value)
+                                   (list menu (vector (concat prefix value)
+                                                      name t))
+                                 (vector menu name t))
+                               (cdr parent)))))))))
+    ;; Make the math prefix char available if it has not been used as a prefix.
+    (unless (lookup-key map (LaTeX-math-abbrev-prefix))
+      (define-key map (LaTeX-math-abbrev-prefix) 'self-insert-command))))
+
 (defcustom LaTeX-math-list nil
   "Alist of your personal LaTeX math symbols.
 
@@ -5436,6 +5447,8 @@ See also `LaTeX-math-menu'."
                                (const :tag "none" nil)
                                (integer :tag "Number")))))
 
+(defvar LaTeX-math-mode-menu)
+(defvar LaTeX-math-mode-map)
 (define-minor-mode LaTeX-math-mode
   "A minor mode with easy access to TeX math macros.
 
@@ -5452,8 +5465,8 @@ commands are defined:
 (defalias 'latex-math-mode 'LaTeX-math-mode)
 
 (easy-menu-define LaTeX-math-mode-menu
-    LaTeX-math-mode-map
-    "Menu used in math minor mode."
+  LaTeX-math-mode-map
+  "Menu used in math minor mode."
   LaTeX-math-menu)
 
 (defcustom LaTeX-math-insert-function 'TeX-insert-macro
@@ -5557,10 +5570,10 @@ environments."
     (widen)
     (let ((opoint (point))
          beg end)
-      (dotimes (c count) (LaTeX-find-matching-end))
+      (dotimes (_ count) (LaTeX-find-matching-end))
       (setq end (point))
       (goto-char opoint)
-      (dotimes (c count) (LaTeX-find-matching-begin))
+      (dotimes (_ count) (LaTeX-find-matching-begin))
       (setq beg (point))
       (narrow-to-region beg end))))
 (put 'LaTeX-narrow-to-environment 'disabled t)
@@ -5699,8 +5712,6 @@ the last entry in the menu."
            (if (= rest outer) (setq inner (1+ inner)))))
        result))))
 
-(defvar LaTeX-section-menu nil)
-(make-variable-buffer-local 'LaTeX-section-menu)
 (defun LaTeX-section-menu-filter (ignored)
   "Filter function for the section submenu in the mode menu.
 The argument IGNORED is not used in any way."
@@ -6027,6 +6038,8 @@ This happens when \\left is inserted."
 
 (declare-function LaTeX-preview-setup "preview")
 
+(defvar TeX-sentinel-default-function) ;; Defined in tex-buf.el.
+
 ;;;###autoload
 (defun TeX-latex-mode ()
   "Major mode in AUCTeX for editing LaTeX files.
@@ -6129,16 +6142,6 @@ i.e. you do _not_ have to cater for this yourself by 
adding \\\\' or $."
   :type '(repeat regexp)
   :group 'TeX-command)
 
-(defvar LaTeX-header-end
-  (concat "^[^%\n]*" (regexp-quote TeX-esc) "begin *"
-         TeX-grop "document" TeX-grcl)
-  "Default end of header marker for LaTeX documents.")
-
-(defvar LaTeX-trailer-start
-  (concat "^[^%\n]*" (regexp-quote TeX-esc) "end *"
-         TeX-grop "document" TeX-grcl)
-  "Default start of trailer marker for LaTeX documents.")
-
 (defcustom LaTeX-clean-intermediate-suffixes
   (append TeX-clean-default-intermediate-suffixes
          ;; These are extensions of files created by makeglossaries.
@@ -6185,7 +6188,7 @@ function would return non-nil and `(match-string 1)' 
would return
 
   (setq TeX-header-end LaTeX-header-end
        TeX-trailer-start LaTeX-trailer-start)
-  (set (make-local-variable 'TeX-style-hook-dialect) LaTeX-dialect)
+  (set (make-local-variable 'TeX-style-hook-dialect) TeX-dialect)
 
   (require 'outline)
   (set (make-local-variable 'outline-level) 'LaTeX-outline-level)
@@ -6531,133 +6534,133 @@ function would return non-nil and `(match-string 1)' 
would return
      ;; With the advent of LaTeX2e release 2020-02-02, all symbols
      ;; provided by textcomp.sty are available out of the box by the
      ;; kernel.  The next block is moved here from textcomp.el:
-     '("capitalgrave"             0)     ; Type: Accent -- Slot: 0
-     '("capitalacute"             0)     ; Type: Accent -- Slot: 1
-     '("capitalcircumflex"        0)     ; Type: Accent -- Slot: 2
-     '("capitaltilde"             0)     ; Type: Accent -- Slot: 3
-     '("capitaldieresis"          0)     ; Type: Accent -- Slot: 4
-     '("capitalhungarumlaut"      0)     ; Type: Accent -- Slot: 5
-     '("capitalring"              0)     ; Type: Accent -- Slot: 6
-     '("capitalcaron"             0)     ; Type: Accent -- Slot: 7
-     '("capitalbreve"             0)     ; Type: Accent -- Slot: 8
-     '("capitalmacron"            0)     ; Type: Accent -- Slot: 9
-     '("capitaldotaccent"         0)     ; Type: Accent -- Slot: 10
-     '("textquotestraightbase"    0)     ; Type: Symbol -- Slot: 13
-     '("textquotestraightdblbase" 0)     ; Type: Symbol -- Slot: 18
-     '("texttwelveudash"          0)     ; Type: Symbol -- Slot: 21
-     '("textthreequartersemdash"  0)     ; Type: Symbol -- Slot: 22
-     '("textcapitalcompwordmark"  0)     ; Type: Symbol -- Slot: 23
-     '("textleftarrow"            0)     ; Type: Symbol -- Slot: 24
-     '("textrightarrow"           0)     ; Type: Symbol -- Slot: 25
-     '("t"                        0)     ; Type: Accent -- Slot: 26
-     '("capitaltie"               0)     ; Type: Accent -- Slot: 27
-     '("newtie"                   0)     ; Type: Accent -- Slot: 28
-     '("capitalnewtie"            0)     ; Type: Accent -- Slot: 29
-     '("textascendercompwordmark" 0)     ; Type: Symbol -- Slot: 31
-     '("textblank"                0)     ; Type: Symbol -- Slot: 32
-     '("textdollar"               0)     ; Type: Symbol -- Slot: 36
-     '("textquotesingle"          0)     ; Type: Symbol -- Slot: 39
-     '("textasteriskcentered"     0)     ; Type: Symbol -- Slot: 42
-     '("textdblhyphen"            0)     ; Type: Symbol -- Slot: 45
-     '("textfractionsolidus"      0)     ; Type: Symbol -- Slot: 47
-     '("textzerooldstyle"         0)     ; Type: Symbol -- Slot: 48
-     '("textoneoldstyle"          0)     ; Type: Symbol -- Slot: 49
-     '("texttwooldstyle"          0)     ; Type: Symbol -- Slot: 50
-     '("textthreeoldstyle"        0)     ; Type: Symbol -- Slot: 51
-     '("textfouroldstyle"         0)     ; Type: Symbol -- Slot: 52
-     '("textfiveoldstyle"         0)     ; Type: Symbol -- Slot: 53
-     '("textsixoldstyle"          0)     ; Type: Symbol -- Slot: 54
-     '("textsevenoldstyle"        0)     ; Type: Symbol -- Slot: 55
-     '("texteightoldstyle"        0)     ; Type: Symbol -- Slot: 56
-     '("textnineoldstyle"         0)     ; Type: Symbol -- Slot: 57
-     '("textlangle"               0)     ; Type: Symbol -- Slot: 60
-     '("textminus"                0)     ; Type: Symbol -- Slot: 61
-     '("textrangle"               0)     ; Type: Symbol -- Slot: 62
-     '("textmho"                  0)     ; Type: Symbol -- Slot: 77
-     '("textbigcircle"            0)     ; Type: Symbol -- Slot: 79
-     '("textohm"                  0)     ; Type: Symbol -- Slot: 87
-     '("textlbrackdbl"            0)     ; Type: Symbol -- Slot: 91
-     '("textrbrackdbl"            0)     ; Type: Symbol -- Slot: 93
-     '("textuparrow"              0)     ; Type: Symbol -- Slot: 94
-     '("textdownarrow"            0)     ; Type: Symbol -- Slot: 95
-     '("textasciigrave"           0)     ; Type: Symbol -- Slot: 96
-     '("textborn"                 0)     ; Type: Symbol -- Slot: 98
-     '("textdivorced"             0)     ; Type: Symbol -- Slot: 99
-     '("textdied"                 0)     ; Type: Symbol -- Slot: 100
-     '("textleaf"                 0)     ; Type: Symbol -- Slot: 108
-     '("textmarried"              0)     ; Type: Symbol -- Slot: 109
-     '("textmusicalnote"          0)     ; Type: Symbol -- Slot: 110
-     '("texttildelow"             0)     ; Type: Symbol -- Slot: 126
-     '("textdblhyphenchar"        0)     ; Type: Symbol -- Slot: 127
-     '("textasciibreve"           0)     ; Type: Symbol -- Slot: 128
-     '("textasciicaron"           0)     ; Type: Symbol -- Slot: 129
-     '("textacutedbl"             0)     ; Type: Symbol -- Slot: 130
-     '("textgravedbl"             0)     ; Type: Symbol -- Slot: 131
-     '("textdagger"               0)     ; Type: Symbol -- Slot: 132
-     '("textdaggerdbl"            0)     ; Type: Symbol -- Slot: 133
-     '("textbardbl"               0)     ; Type: Symbol -- Slot: 134
-     '("textperthousand"          0)     ; Type: Symbol -- Slot: 135
-     '("textbullet"               0)     ; Type: Symbol -- Slot: 136
-     '("textcelsius"              0)     ; Type: Symbol -- Slot: 137
-     '("textdollaroldstyle"       0)     ; Type: Symbol -- Slot: 138
-     '("textcentoldstyle"         0)     ; Type: Symbol -- Slot: 139
-     '("textflorin"               0)     ; Type: Symbol -- Slot: 140
-     '("textcolonmonetary"        0)     ; Type: Symbol -- Slot: 141
-     '("textwon"                  0)     ; Type: Symbol -- Slot: 142
-     '("textnaira"                0)     ; Type: Symbol -- Slot: 143
-     '("textguarani"              0)     ; Type: Symbol -- Slot: 144
-     '("textpeso"                 0)     ; Type: Symbol -- Slot: 145
-     '("textlira"                 0)     ; Type: Symbol -- Slot: 146
-     '("textrecipe"               0)     ; Type: Symbol -- Slot: 147
-     '("textinterrobang"          0)     ; Type: Symbol -- Slot: 148
-     '("textinterrobangdown"      0)     ; Type: Symbol -- Slot: 149
-     '("textdong"                 0)     ; Type: Symbol -- Slot: 150
-     '("texttrademark"            0)     ; Type: Symbol -- Slot: 151
-     '("textpertenthousand"       0)     ; Type: Symbol -- Slot: 152
-     '("textpilcrow"              0)     ; Type: Symbol -- Slot: 153
-     '("textbaht"                 0)     ; Type: Symbol -- Slot: 154
-     '("textnumero"               0)     ; Type: Symbol -- Slot: 155
-     '("textdiscount"             0)     ; Type: Symbol -- Slot: 156
-     '("textestimated"            0)     ; Type: Symbol -- Slot: 157
-     '("textopenbullet"           0)     ; Type: Symbol -- Slot: 158
-     '("textservicemark"          0)     ; Type: Symbol -- Slot: 159
-     '("textlquill"               0)     ; Type: Symbol -- Slot: 160
-     '("textrquill"               0)     ; Type: Symbol -- Slot: 161
-     '("textcent"                 0)     ; Type: Symbol -- Slot: 162
-     '("textsterling"             0)     ; Type: Symbol -- Slot: 163
-     '("textcurrency"             0)     ; Type: Symbol -- Slot: 164
-     '("textyen"                  0)     ; Type: Symbol -- Slot: 165
-     '("textbrokenbar"            0)     ; Type: Symbol -- Slot: 166
-     '("textsection"              0)     ; Type: Symbol -- Slot: 167
-     '("textasciidieresis"        0)     ; Type: Symbol -- Slot: 168
-     '("textcopyright"            0)     ; Type: Symbol -- Slot: 169
-     '("textordfeminine"          0)     ; Type: Symbol -- Slot: 170
-     '("textcopyleft"             0)     ; Type: Symbol -- Slot: 171
-     '("textlnot"                 0)     ; Type: Symbol -- Slot: 172
-     '("textcircledP"             0)     ; Type: Symbol -- Slot: 173
-     '("textregistered"           0)     ; Type: Symbol -- Slot: 174
-     '("textasciimacron"          0)     ; Type: Symbol -- Slot: 175
-     '("textdegree"               0)     ; Type: Symbol -- Slot: 176
-     '("textpm"                   0)     ; Type: Symbol -- Slot: 177
-     '("texttwosuperior"          0)     ; Type: Symbol -- Slot: 178
-     '("textthreesuperior"        0)     ; Type: Symbol -- Slot: 179
-     '("textasciiacute"           0)     ; Type: Symbol -- Slot: 180
-     '("textmu"                   0)     ; Type: Symbol -- Slot: 181
-     '("textparagraph"            0)     ; Type: Symbol -- Slot: 182
-     '("textperiodcentered"       0)     ; Type: Symbol -- Slot: 183
-     '("textreferencemark"        0)     ; Type: Symbol -- Slot: 184
-     '("textonesuperior"          0)     ; Type: Symbol -- Slot: 185
-     '("textordmasculine"         0)     ; Type: Symbol -- Slot: 186
-     '("textsurd"                 0)     ; Type: Symbol -- Slot: 187
-     '("textonequarter"           0)     ; Type: Symbol -- Slot: 188
-     '("textonehalf"              0)     ; Type: Symbol -- Slot: 189
-     '("textthreequarters"        0)     ; Type: Symbol -- Slot: 190
-     '("texteuro"                 0)     ; Type: Symbol -- Slot: 191
-     '("texttimes"                0)     ; Type: Symbol -- Slot: 214
-     '("textdiv"                  0)     ; Type: Symbol -- Slot: 246
-     '("textcircled"              1)     ; Type: Command -- Slot: N/A
-     '("capitalcedilla"           1)     ; Type: Command -- Slot: N/A
-     '("capitalogonek"            1)     ; Type: Command -- Slot: N/A
+     '("capitalgrave"             0)    ; Type: Accent -- Slot: 0
+     '("capitalacute"             0)    ; Type: Accent -- Slot: 1
+     '("capitalcircumflex"        0)    ; Type: Accent -- Slot: 2
+     '("capitaltilde"             0)    ; Type: Accent -- Slot: 3
+     '("capitaldieresis"          0)    ; Type: Accent -- Slot: 4
+     '("capitalhungarumlaut"      0)    ; Type: Accent -- Slot: 5
+     '("capitalring"              0)    ; Type: Accent -- Slot: 6
+     '("capitalcaron"             0)    ; Type: Accent -- Slot: 7
+     '("capitalbreve"             0)    ; Type: Accent -- Slot: 8
+     '("capitalmacron"            0)    ; Type: Accent -- Slot: 9
+     '("capitaldotaccent"         0)    ; Type: Accent -- Slot: 10
+     '("textquotestraightbase"    0)    ; Type: Symbol -- Slot: 13
+     '("textquotestraightdblbase" 0)    ; Type: Symbol -- Slot: 18
+     '("texttwelveudash"          0)    ; Type: Symbol -- Slot: 21
+     '("textthreequartersemdash"  0)    ; Type: Symbol -- Slot: 22
+     '("textcapitalcompwordmark"  0)    ; Type: Symbol -- Slot: 23
+     '("textleftarrow"            0)    ; Type: Symbol -- Slot: 24
+     '("textrightarrow"           0)    ; Type: Symbol -- Slot: 25
+     '("t"                        0)    ; Type: Accent -- Slot: 26
+     '("capitaltie"               0)    ; Type: Accent -- Slot: 27
+     '("newtie"                   0)    ; Type: Accent -- Slot: 28
+     '("capitalnewtie"            0)    ; Type: Accent -- Slot: 29
+     '("textascendercompwordmark" 0)    ; Type: Symbol -- Slot: 31
+     '("textblank"                0)    ; Type: Symbol -- Slot: 32
+     '("textdollar"               0)    ; Type: Symbol -- Slot: 36
+     '("textquotesingle"          0)    ; Type: Symbol -- Slot: 39
+     '("textasteriskcentered"     0)    ; Type: Symbol -- Slot: 42
+     '("textdblhyphen"            0)    ; Type: Symbol -- Slot: 45
+     '("textfractionsolidus"      0)    ; Type: Symbol -- Slot: 47
+     '("textzerooldstyle"         0)    ; Type: Symbol -- Slot: 48
+     '("textoneoldstyle"          0)    ; Type: Symbol -- Slot: 49
+     '("texttwooldstyle"          0)    ; Type: Symbol -- Slot: 50
+     '("textthreeoldstyle"        0)    ; Type: Symbol -- Slot: 51
+     '("textfouroldstyle"         0)    ; Type: Symbol -- Slot: 52
+     '("textfiveoldstyle"         0)    ; Type: Symbol -- Slot: 53
+     '("textsixoldstyle"          0)    ; Type: Symbol -- Slot: 54
+     '("textsevenoldstyle"        0)    ; Type: Symbol -- Slot: 55
+     '("texteightoldstyle"        0)    ; Type: Symbol -- Slot: 56
+     '("textnineoldstyle"         0)    ; Type: Symbol -- Slot: 57
+     '("textlangle"               0)    ; Type: Symbol -- Slot: 60
+     '("textminus"                0)    ; Type: Symbol -- Slot: 61
+     '("textrangle"               0)    ; Type: Symbol -- Slot: 62
+     '("textmho"                  0)    ; Type: Symbol -- Slot: 77
+     '("textbigcircle"            0)    ; Type: Symbol -- Slot: 79
+     '("textohm"                  0)    ; Type: Symbol -- Slot: 87
+     '("textlbrackdbl"            0)    ; Type: Symbol -- Slot: 91
+     '("textrbrackdbl"            0)    ; Type: Symbol -- Slot: 93
+     '("textuparrow"              0)    ; Type: Symbol -- Slot: 94
+     '("textdownarrow"            0)    ; Type: Symbol -- Slot: 95
+     '("textasciigrave"           0)    ; Type: Symbol -- Slot: 96
+     '("textborn"                 0)    ; Type: Symbol -- Slot: 98
+     '("textdivorced"             0)    ; Type: Symbol -- Slot: 99
+     '("textdied"                 0)    ; Type: Symbol -- Slot: 100
+     '("textleaf"                 0)    ; Type: Symbol -- Slot: 108
+     '("textmarried"              0)    ; Type: Symbol -- Slot: 109
+     '("textmusicalnote"          0)    ; Type: Symbol -- Slot: 110
+     '("texttildelow"             0)    ; Type: Symbol -- Slot: 126
+     '("textdblhyphenchar"        0)    ; Type: Symbol -- Slot: 127
+     '("textasciibreve"           0)    ; Type: Symbol -- Slot: 128
+     '("textasciicaron"           0)    ; Type: Symbol -- Slot: 129
+     '("textacutedbl"             0)    ; Type: Symbol -- Slot: 130
+     '("textgravedbl"             0)    ; Type: Symbol -- Slot: 131
+     '("textdagger"               0)    ; Type: Symbol -- Slot: 132
+     '("textdaggerdbl"            0)    ; Type: Symbol -- Slot: 133
+     '("textbardbl"               0)    ; Type: Symbol -- Slot: 134
+     '("textperthousand"          0)    ; Type: Symbol -- Slot: 135
+     '("textbullet"               0)    ; Type: Symbol -- Slot: 136
+     '("textcelsius"              0)    ; Type: Symbol -- Slot: 137
+     '("textdollaroldstyle"       0)    ; Type: Symbol -- Slot: 138
+     '("textcentoldstyle"         0)    ; Type: Symbol -- Slot: 139
+     '("textflorin"               0)    ; Type: Symbol -- Slot: 140
+     '("textcolonmonetary"        0)    ; Type: Symbol -- Slot: 141
+     '("textwon"                  0)    ; Type: Symbol -- Slot: 142
+     '("textnaira"                0)    ; Type: Symbol -- Slot: 143
+     '("textguarani"              0)    ; Type: Symbol -- Slot: 144
+     '("textpeso"                 0)    ; Type: Symbol -- Slot: 145
+     '("textlira"                 0)    ; Type: Symbol -- Slot: 146
+     '("textrecipe"               0)    ; Type: Symbol -- Slot: 147
+     '("textinterrobang"          0)    ; Type: Symbol -- Slot: 148
+     '("textinterrobangdown"      0)    ; Type: Symbol -- Slot: 149
+     '("textdong"                 0)    ; Type: Symbol -- Slot: 150
+     '("texttrademark"            0)    ; Type: Symbol -- Slot: 151
+     '("textpertenthousand"       0)    ; Type: Symbol -- Slot: 152
+     '("textpilcrow"              0)    ; Type: Symbol -- Slot: 153
+     '("textbaht"                 0)    ; Type: Symbol -- Slot: 154
+     '("textnumero"               0)    ; Type: Symbol -- Slot: 155
+     '("textdiscount"             0)    ; Type: Symbol -- Slot: 156
+     '("textestimated"            0)    ; Type: Symbol -- Slot: 157
+     '("textopenbullet"           0)    ; Type: Symbol -- Slot: 158
+     '("textservicemark"          0)    ; Type: Symbol -- Slot: 159
+     '("textlquill"               0)    ; Type: Symbol -- Slot: 160
+     '("textrquill"               0)    ; Type: Symbol -- Slot: 161
+     '("textcent"                 0)    ; Type: Symbol -- Slot: 162
+     '("textsterling"             0)    ; Type: Symbol -- Slot: 163
+     '("textcurrency"             0)    ; Type: Symbol -- Slot: 164
+     '("textyen"                  0)    ; Type: Symbol -- Slot: 165
+     '("textbrokenbar"            0)    ; Type: Symbol -- Slot: 166
+     '("textsection"              0)    ; Type: Symbol -- Slot: 167
+     '("textasciidieresis"        0)    ; Type: Symbol -- Slot: 168
+     '("textcopyright"            0)    ; Type: Symbol -- Slot: 169
+     '("textordfeminine"          0)    ; Type: Symbol -- Slot: 170
+     '("textcopyleft"             0)    ; Type: Symbol -- Slot: 171
+     '("textlnot"                 0)    ; Type: Symbol -- Slot: 172
+     '("textcircledP"             0)    ; Type: Symbol -- Slot: 173
+     '("textregistered"           0)    ; Type: Symbol -- Slot: 174
+     '("textasciimacron"          0)    ; Type: Symbol -- Slot: 175
+     '("textdegree"               0)    ; Type: Symbol -- Slot: 176
+     '("textpm"                   0)    ; Type: Symbol -- Slot: 177
+     '("texttwosuperior"          0)    ; Type: Symbol -- Slot: 178
+     '("textthreesuperior"        0)    ; Type: Symbol -- Slot: 179
+     '("textasciiacute"           0)    ; Type: Symbol -- Slot: 180
+     '("textmu"                   0)    ; Type: Symbol -- Slot: 181
+     '("textparagraph"            0)    ; Type: Symbol -- Slot: 182
+     '("textperiodcentered"       0)    ; Type: Symbol -- Slot: 183
+     '("textreferencemark"        0)    ; Type: Symbol -- Slot: 184
+     '("textonesuperior"          0)    ; Type: Symbol -- Slot: 185
+     '("textordmasculine"         0)    ; Type: Symbol -- Slot: 186
+     '("textsurd"                 0)    ; Type: Symbol -- Slot: 187
+     '("textonequarter"           0)    ; Type: Symbol -- Slot: 188
+     '("textonehalf"              0)    ; Type: Symbol -- Slot: 189
+     '("textthreequarters"        0)    ; Type: Symbol -- Slot: 190
+     '("texteuro"                 0)    ; Type: Symbol -- Slot: 191
+     '("texttimes"                0)    ; Type: Symbol -- Slot: 214
+     '("textdiv"                  0)    ; Type: Symbol -- Slot: 246
+     '("textcircled"              1)    ; Type: Command -- Slot: N/A
+     '("capitalcedilla"           1)    ; Type: Command -- Slot: N/A
+     '("capitalogonek"            1)    ; Type: Command -- Slot: N/A
 
      "rmfamily" "sffamily" "ttfamily"
      '("mdseries" -1) '("bfseries" -1)
@@ -6704,13 +6707,13 @@ function would return non-nil and `(match-string 1)' 
would return
      '("RequirePackage" LaTeX-arg-usepackage)
      '("ProvidesPackage" (TeX-arg-file-name-sans-extension "Package name")
        [ TeX-arg-conditional (y-or-n-p "Insert version? ")
-                            ([ TeX-arg-version ]) nil])
+        ([ TeX-arg-version ]) nil])
      '("ProvidesClass" (TeX-arg-file-name-sans-extension "Class name")
        [ TeX-arg-conditional (y-or-n-p "Insert version? ")
-                            ([ TeX-arg-version ]) nil])
+        ([ TeX-arg-version ]) nil])
      '("ProvidesFile" (TeX-arg-file-name "File name")
        [ TeX-arg-conditional (y-or-n-p "Insert version? ")
-                            ([ TeX-arg-version ]) nil ])
+        ([ TeX-arg-version ]) nil ])
      '("documentclass" TeX-arg-document)))
 
   (TeX-add-style-hook "latex2e"
@@ -6719,7 +6722,7 @@ function would return non-nil and `(match-string 1)' 
would return
                        (setq TeX-font-list LaTeX-font-list)
                        (setq TeX-font-replace-function 'TeX-font-replace-macro)
                        (run-hooks 'LaTeX2e-hook))
-                     LaTeX-dialect)
+                     TeX-dialect)
 
   (TeX-add-style-hook "latex2"
                      ;; Use old fonts for `\documentstyle' documents.
@@ -6728,7 +6731,7 @@ function would return non-nil and `(match-string 1)' 
would return
                        (setq TeX-font-replace-function
                              (default-value 'TeX-font-replace-function))
                        (run-hooks 'LaTeX2-hook))
-                     LaTeX-dialect)
+                     TeX-dialect)
 
   ;; There must be something better-suited, but I don't understand the
   ;; parsing properly.  -- dak
@@ -6794,7 +6797,7 @@ function would return non-nil and `(match-string 1)' 
would return
 (defun LaTeX-imenu-create-index-function ()
   "Imenu support function for LaTeX."
   (TeX-update-style)
-  (let (entries level
+  (let (entries
        (regexp (LaTeX-outline-regexp)))
     (goto-char (point-max))
     (while (re-search-backward regexp nil t)
@@ -6930,7 +6933,7 @@ functions `TeX-arg-color' (style/color.el) or
                   (equal current-prefix-arg '(4)))
              (and (eq TeX-insert-macro-default-style 'mandatory-args-only)
                   (null (equal current-prefix-arg '(4))))
-             last-optional-rejected))
+             TeX-last-optional-rejected))
      ,@body))
 
 (defun LaTeX-extract-key-value-label (&optional key num)
diff --git a/lpath.el b/lpath.el
index 2a4354c..5613683 100644
--- a/lpath.el
+++ b/lpath.el
@@ -5,6 +5,9 @@
 ;;; It is not a part of AUCTeX itself.
 
 ;; Make sure we get the right files.
-(setq load-path (cons "." load-path)
-      TeX-lisp-directory "<none>"
-      TeX-auto-global "<none>")
+
+(let ((auctex-dir (file-name-directory load-file-name)))
+  (add-to-list 'load-path auctex-dir)
+  (add-to-list 'load-path (expand-file-name "style" auctex-dir))
+  (setq TeX-lisp-directory "<none>"
+        TeX-auto-global "<none>"))
diff --git a/preview.el b/preview.el
index 81c9997..bc2aa3d 100644
--- a/preview.el
+++ b/preview.el
@@ -945,9 +945,9 @@ Pure borderless black-on-white will return an empty string."
           (funcall (car gsfile) "dvi" t))))
     (file-error nil))
   (when preview-ps-file
-      (condition-case nil
-         (preview-delete-file preview-ps-file)
-       (file-error nil)))
+    (condition-case nil
+       (preview-delete-file preview-ps-file)
+      (file-error nil)))
   (setq TeX-sentinel-function nil))
 
 (defalias 'preview-dvipng-abort 'preview-dvips-abort)
@@ -3671,8 +3671,7 @@ The fourth value is the transparent border thickness."
         (colors (preview-dvipng-color-string preview-colors res))
         (command (with-current-buffer TeX-command-buffer
                    (prog1
-                       (concat (TeX-command-expand preview-dvipng-command
-                                                   (car file))
+                       (concat (TeX-command-expand preview-dvipng-command)
                                " " colors resolution)
                      (setq tempdir TeX-active-tempdir))))
         (name "Preview-DviPNG"))
@@ -3710,8 +3709,7 @@ If FAST is set, do a fast conversion."
                    (prog1
                        (TeX-command-expand (if fast
                                                preview-fast-dvips-command
-                                             preview-dvips-command)
-                                           (car file))
+                                             preview-dvips-command))
                      (setq tempdir TeX-active-tempdir))))
         (name "Preview-DviPS"))
     (setq TeX-active-tempdir tempdir)
@@ -3751,8 +3749,7 @@ If FAST is set, do a fast conversion."
         pdfsource
         (command (with-current-buffer TeX-command-buffer
                    (prog1
-                       (TeX-command-expand preview-pdf2dsc-command
-                                           (car file))
+                       (TeX-command-expand preview-pdf2dsc-command)
                      (setq tempdir TeX-active-tempdir
                            pdfsource (funcall (car file) "pdf" t)))))
         (name "Preview-PDF2DSC"))
@@ -3930,8 +3927,7 @@ If FORMAT-CONS is non-nil, a previous format may get 
reused."
         (master-file (expand-file-name (TeX-master-file t)))
         (command (preview-do-replacements
                   (TeX-command-expand
-                   (preview-string-expand preview-LaTeX-command)
-                   'TeX-master-file)
+                   (preview-string-expand preview-LaTeX-command))
                   preview-dump-replacements))
         (preview-auto-cache-preamble nil))
     (unless (and (consp (cdr format-cons))
@@ -3952,10 +3948,8 @@ If FORMAT-CONS is non-nil, a previous format may get 
reused."
 \\def\\AUCTEXINPUT##1{\\catcode`/ 12\\relax\\catcode`\\ 
9\\relax\\input\\detokenize{##1}\\relax}%
 \\let\\dump\\PREVIEWdump\\dump}\\input mylatex.ltx \\relax%\n" nil dump-file)
       (TeX-save-document master)
-      (prog1
-         (preview-generate-preview
-          nil master
-          command)
+      (setq TeX-current-process-region-p nil)
+      (prog1 (preview-generate-preview master command)
        (add-hook 'kill-emacs-hook #'preview-cleanout-tempfiles t)
        (setq TeX-sentinel-function
              `(lambda (process string)
@@ -4003,11 +3997,11 @@ stored in `preview-dumped-alist'."
                            (save-excursion
                              (goto-char begin)
                              (if (bolp) 0 -1))))))
-  (preview-generate-preview t (TeX-region-file)
+  (setq TeX-current-process-region-p t)
+  (preview-generate-preview (TeX-region-file)
                            (preview-do-replacements
                             (TeX-command-expand
-                             (preview-string-expand preview-LaTeX-command)
-                             'TeX-region-file)
+                             (preview-string-expand preview-LaTeX-command))
                             preview-LaTeX-command-replacements)))
 
 (defun preview-buffer ()
@@ -4042,12 +4036,12 @@ stored in `preview-dumped-alist'."
   "Run preview on master document."
   (interactive)
   (TeX-save-document (TeX-master-file))
+  (setq TeX-current-process-region-p nil)
   (preview-generate-preview
-   nil (TeX-master-file)
+   (TeX-master-file)
    (preview-do-replacements
     (TeX-command-expand
-     (preview-string-expand preview-LaTeX-command)
-     'TeX-master-file)
+     (preview-string-expand preview-LaTeX-command))
     preview-LaTeX-command-replacements)))
 
 (defun preview-environment (count)
@@ -4080,19 +4074,16 @@ environments is selected."
     (preview-region (region-beginning) (region-end))))
 
 
-(defun preview-generate-preview (region-p file command)
+(defun preview-generate-preview (file command)
   "Generate a preview.
-REGION-P is the region flag, FILE the file (without default
-extension), COMMAND is the command to use.
+FILE the file (without default extension), COMMAND is the command
+to use.
 
 It returns the started process."
-  (setq TeX-current-process-region-p region-p)
   (let* ((geometry (preview-get-geometry))
         (commandbuff (current-buffer))
         (pr-file (cons
-                  (if TeX-current-process-region-p
-                      'TeX-region-file
-                    'TeX-master-file)
+                  'TeX-active-master
                   (file-name-nondirectory file)))
         (master (TeX-master-file))
         (master-file (expand-file-name master))
diff --git a/style/Alegreya.el b/style/Alegreya.el
index 5459a01..61034b3 100644
--- a/style/Alegreya.el
+++ b/style/Alegreya.el
@@ -1,6 +1,6 @@
-;;; Alegreya.el --- AUCTeX style for `Alegreya.sty' (v2015/10/22)
+;;; Alegreya.el --- AUCTeX style for `Alegreya.sty' (v2015/10/22)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -79,7 +82,7 @@
                                ("sufigures"     "")
                                ("infigures"     ""))
                              'type-declaration)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-Alegreya-package-options-list
   '(("lining"       ("true" "false"))
diff --git a/style/AlegreyaSans.el b/style/AlegreyaSans.el
index eeaec06..653442e 100644
--- a/style/AlegreyaSans.el
+++ b/style/AlegreyaSans.el
@@ -1,6 +1,6 @@
-;;; AlegreyaSans.el --- AUCTeX style for `AlegreyaSans.sty' (v2015/10/22)
+;;; AlegreyaSans.el --- AUCTeX style for `AlegreyaSans.sty' (v2015/10/22)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -86,7 +89,7 @@
                                ("sufigures"              "")
                                ("infigures"              ""))
                              'type-declaration)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-AlegreyaSans-package-options-list
   '(("lining"       ("true" "false"))
diff --git a/style/AnonymousPro.el b/style/AnonymousPro.el
index c88a917..778c703 100644
--- a/style/AnonymousPro.el
+++ b/style/AnonymousPro.el
@@ -1,6 +1,6 @@
-;;; AnonymousPro.el --- AUCTeX style for `AnonymousPro.sty' (v2.2)
+;;; AnonymousPro.el --- AUCTeX style for `AnonymousPro.sty' (v2.2)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014, 2019 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2019, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "AnonymousPro"
  (lambda ()
@@ -81,7 +83,7 @@
     "ANPDelta"
     "ANPverticaltab"
     "ANPNumeroSign"))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-AnonymousPro-package-options
   '("ttdefault" "scale" "scaled")
diff --git a/style/CJK.el b/style/CJK.el
index c63ceb7..c676c7c 100644
--- a/style/CJK.el
+++ b/style/CJK.el
@@ -1,6 +1,6 @@
-;;; CJK.el --- AUCTeX style for the CJK package.
+;;; CJK.el --- AUCTeX style for the CJK package.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2009, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-CJK-package-options
   '("lowercase" "global" "local" "active" "encapsulated")
   "Package options for the CJK package.")
@@ -89,6 +92,6 @@ The function can be used for CJK and CJK* environments."
    (LaTeX-add-environments
     '("CJK" LaTeX-env-CJK)
     '("CJK*" LaTeX-env-CJK)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; CJK.el ends here
diff --git a/style/CJKutf8.el b/style/CJKutf8.el
index c9e16b6..d522015 100644
--- a/style/CJKutf8.el
+++ b/style/CJKutf8.el
@@ -1,6 +1,6 @@
-;;; CJKutf8.el --- AUCTeX style for the CJKutf8 package.
+;;; CJKutf8.el --- AUCTeX style for the CJKutf8 package.  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,10 +30,12 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "CJKutf8"
  (lambda ()
    (TeX-run-style-hooks "CJK"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; CJKutf8.el ends here
diff --git a/style/FiraMono.el b/style/FiraMono.el
index febcbea..1cdb871 100644
--- a/style/FiraMono.el
+++ b/style/FiraMono.el
@@ -1,6 +1,6 @@
-;;; FiraMono.el --- AUCTeX style for `FiraMono.sty' (v2016/02/13)
+;;; FiraMono.el --- AUCTeX style for `FiraMono.sty' (v2016/02/13)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -62,7 +65,7 @@
                                ("firamonolining"   "")
                                ("firamonomedium"   ""))
                              'type-declaration)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-FiraMono-package-options '("scaled" "scale"
                                         "type1"
diff --git a/style/FiraSans.el b/style/FiraSans.el
index d9bb41d..ff5ce51 100644
--- a/style/FiraSans.el
+++ b/style/FiraSans.el
@@ -1,6 +1,6 @@
-;;; FiraSans.el --- AUCTeX style for `FiraSans.sty' (v2016/11/20)
+;;; FiraSans.el --- AUCTeX style for `FiraSans.sty' (v2016/11/20)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -82,7 +85,7 @@
                                ("firaextrabold"    "")
                                ("firaheavy"        ""))
                              'type-declaration)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-FiraSans-package-options
   '("scaled" "scale"
diff --git a/style/MinionPro.el b/style/MinionPro.el
index 11a461b..7dc5546 100644
--- a/style/MinionPro.el
+++ b/style/MinionPro.el
@@ -1,6 +1,6 @@
-;;; MinionPro.el -- AUCTeX style for MinionPro.sty
+;;; MinionPro.el -- AUCTeX style for MinionPro.sty  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2005, 2014, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2014, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mark Trettin <Mark.Trettin@gmx.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -24,7 +24,7 @@
 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 ;; 02110-1301, USA.
 
-;;; Commentary: 
+;;; Commentary:
 
 ;; This file adds support for `MinionPro.sty' (v2.3) from 2012/08/03.
 ;; The latest version of MinionPro is available as part of FontPro
@@ -32,6 +32,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -55,7 +57,7 @@
      (font-latex-add-keywords '(("smallfrac" "{{")
                                ("slantfrac" "{{"))
                              'textual)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-MinionPro-package-options
   '("smallfamily" "medfamily" "fullfamily" "noopticals" "opticals"
diff --git a/style/MyriadPro.el b/style/MyriadPro.el
index 215aa7d..ff76fe0 100644
--- a/style/MyriadPro.el
+++ b/style/MyriadPro.el
@@ -1,6 +1,6 @@
-;;; MyriadPro.el --- AUCTeX style for `MyriadPro.sty' (v0.5)
+;;; MyriadPro.el --- AUCTeX style for `MyriadPro.sty' (v0.5)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -33,6 +33,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -71,7 +74,7 @@
                              'textual)
      (font-latex-add-keywords '(("mathversion" "{"))
                              'variable)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-MyriadPro-package-options
   '(;; Font selection
diff --git a/style/XCharter.el b/style/XCharter.el
index 50f1ed0..9c1bd39 100644
--- a/style/XCharter.el
+++ b/style/XCharter.el
@@ -1,6 +1,6 @@
-;;; XCharter.el --- AUCTeX style for `XCharter.sty' (v1.094)
+;;; XCharter.el --- AUCTeX style for `XCharter.sty' (v1.094)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014, 2017, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2017, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -85,7 +87,7 @@
                                 ("lfstyle"   "")
                                 ("osfstyle"  ""))
                               'type-declaration)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-XCharter-package-options
   '("lining" "lf" "oldstyle" "osf" "oldstyleI" "osfI"
diff --git a/style/acro.el b/style/acro.el
index caa4899..a39221a 100644
--- a/style/acro.el
+++ b/style/acro.el
@@ -1,6 +1,6 @@
-;;; acro.el --- AUCTeX style for `acro.sty' version 1.2a.
+;;; acro.el --- AUCTeX style for `acro.sty' version 1.2a.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2013-2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <giordano.mose@libero.it>
@@ -29,7 +29,8 @@
 
 ;;; Code:
 
-(require 'tex) ;Indispensable when compiling the call to `TeX-auto-add-type'.
+(require 'tex)
+(require 'latex)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
@@ -290,7 +291,7 @@ be a list with strings to be used as values for the key."
                                ("Iacflike" "*{")
                                ("acuse" "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-acro-package-options ()
   "Prompt for package options for the acro package."
diff --git a/style/acronym.el b/style/acronym.el
index 368c35e..d86debe 100644
--- a/style/acronym.el
+++ b/style/acronym.el
@@ -1,6 +1,6 @@
-;;; acronym.el --- AUCTeX style for `acronym.sty' version 1.38.
+;;; acronym.el --- AUCTeX style for `acronym.sty' version 1.38.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2013-2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <giordano.mose@libero.it>
@@ -30,6 +30,7 @@
 ;;; Code:
 
 (require 'tex) ;Indispensable when compiling the call to `TeX-auto-add-type'.
+(require 'latex)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
@@ -175,7 +176,7 @@ string."
                                ("acrodefplural" "{[{")
                                ("newacroplural" "{[{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-acronym-package-options
   '("footnote" "nohyperlinks" "printonlyused" "withpage" "smaller" "dua" 
"nolist")
diff --git a/style/afterpage.el b/style/afterpage.el
index ec0d320..1601885 100644
--- a/style/afterpage.el
+++ b/style/afterpage.el
@@ -1,6 +1,6 @@
-;;; afterpage.el --- AUCTeX style for `afterpage.sty'
+;;; afterpage.el --- AUCTeX style for `afterpage.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2013 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,12 +30,15 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "afterpage"
  (lambda ()
    (TeX-add-symbols
     '("afterpage" t)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-afterpage-package-options nil
   "Package options for afterpage.")
diff --git a/style/algorithm.el b/style/algorithm.el
index 8004002..10e8530 100644
--- a/style/algorithm.el
+++ b/style/algorithm.el
@@ -1,4 +1,4 @@
-;;; algorithm.el --- AUCTeX style for the (LaTeX) algorithm package
+;;; algorithm.el --- AUCTeX style for the (LaTeX) algorithm package  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2020 Free Software Foundation, Inc.
 
@@ -28,6 +28,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-algorithm-package-options
   '("section")
   "Package options for the algorithm package.")
@@ -74,7 +77,7 @@
     '("algorithm"  LaTeX-env-algorithm ))
    (TeX-add-symbols
     '("listofalgorithms" 0))
-      LaTeX-dialect))
+      TeX-dialect))
 
 
 ;;; algorithm.el ends here
diff --git a/style/algpseudocode.el b/style/algpseudocode.el
index eaae318..b0c455f 100644
--- a/style/algpseudocode.el
+++ b/style/algpseudocode.el
@@ -1,4 +1,4 @@
-;;; algpseudocode.el --- AUCTeX style for the (LaTeX) algpseudocode package
+;;; algpseudocode.el --- AUCTeX style for the (LaTeX) algpseudocode package  
-*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2020 Free Software Foundation, Inc.
 
@@ -28,6 +28,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-algpseudocode-package-options
   '("compatible" "nocompatible")
   "Package options for the algpseudocode package.")
@@ -68,6 +71,6 @@
     '("Call" 0))
    (LaTeX-add-environments
     '("algorithmic" [ "Number" ]))
-   LaTeX-dialect))
+   TeX-dialect))
 
 ;;; algpseudocode.el ends here
diff --git a/style/alltt.el b/style/alltt.el
index c7e232d..2b9af53 100644
--- a/style/alltt.el
+++ b/style/alltt.el
@@ -1,4 +1,4 @@
-;;; alltt.el --- AUCTeX style for `alltt.sty'
+;;; alltt.el --- AUCTeX style for `alltt.sty'  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2004, 2005, 2014, 2016, 2018, 2020 Free Software Foundation, 
Inc.
 
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-set-syntactic-keywords
                  "font-latex")
@@ -46,7 +49,7 @@
              (eq TeX-install-font-lock 'font-latex-setup))
      ;; Tell font-lock about the update.
      (font-latex-set-syntactic-keywords)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-alltt-package-options nil
   "Package options for the alltt package.")
diff --git a/style/alphanum.el b/style/alphanum.el
index 6bd5a5e..b198128 100644
--- a/style/alphanum.el
+++ b/style/alphanum.el
@@ -1,6 +1,6 @@
-;;; alphanum.el --- AUCTeX style for `alphanum.sty'
+;;; alphanum.el --- AUCTeX style for `alphanum.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2004, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Frank Küster <frank@kuesterei.ch>
 ;; Maintainer: auctex-devel@gnu.org
@@ -34,13 +34,13 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function reftex-match-string "reftex" (n))
 (defvar reftex-section-regexp)
 
-(defun TeX-arg-none (arg)
-  (insert " "))
-
 (defun reftex-get-section-level-alphanum ()
   (save-excursion                      ; preserve position
     (save-match-data            ; preserve matching data (important!)
@@ -76,13 +76,15 @@
  "alphanum"
  (lambda ()
    (LaTeX-largest-level-set "chapter")
-   (TeX-add-symbols '("levelup" TeX-arg-none))
+   (TeX-add-symbols
+    '("levelup" (TeX-arg-literal " ")))
    (make-local-variable 'LaTeX-section-list)
    (LaTeX-section-list-add-locally
     '(("part" 0)
       ;; the levels don't make sense with alphanum, I randomly chose 0...
       ("toc" 0)
-      ("sub" 0)) t)
+      ("sub" 0))
+    t)
    (setq LaTeX-section-label
         '(("part" . "part:")
           ("toc" . "sec:")
@@ -96,7 +98,7 @@
        (reftex-add-section-levels
        '(("toc" .  reftex-get-section-level-alphanum)
          ("sub" .  reftex-get-section-level-alphanum)))))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;; Local Variables:
 ;; coding: utf-8
diff --git a/style/amsart.el b/style/amsart.el
index 26a054c..7f93f1a 100644
--- a/style/amsart.el
+++ b/style/amsart.el
@@ -1,12 +1,16 @@
-;;; amsart.el --- Style hook for the AMS-LaTeX article document class.
+;;; amsart.el --- Style hook for the AMS-LaTeX article document class.  -*- 
lexical-binding: t; -*-
 
 ;;; Code:
 
-(TeX-add-style-hook "amsart"
+(require 'tex)
+(require 'latex)
+
+(TeX-add-style-hook
+ "amsart"
  (function
   (lambda ()
     (TeX-run-style-hooks "amsmath" "amsthm")
     (LaTeX-add-environments "abstract")))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; amsart.el ends here.
diff --git a/style/amsbook.el b/style/amsbook.el
index 0bdbe3a..c645767 100644
--- a/style/amsbook.el
+++ b/style/amsbook.el
@@ -1,12 +1,15 @@
-;;; amsbook.el --- Style hook for the AMS-LaTeX book document class.
+;;; amsbook.el --- Style hook for the AMS-LaTeX book document class.  -*- 
lexical-binding: t; -*-
 
 ;;; Code:
 
-(TeX-add-style-hook "amsbook"
- (function
-  (lambda ()
-    (TeX-run-style-hooks "amsmath" "amsthm")
-    (LaTeX-add-environments "abstract")))
- LaTeX-dialect)
+(require 'tex)
+(require 'latex)
+
+(TeX-add-style-hook
+ "amsbook"
+ (lambda ()
+   (TeX-run-style-hooks "amsmath" "amsthm")
+   (LaTeX-add-environments "abstract"))
+ TeX-dialect)
 
 ;;; amsbook.el ends here.
diff --git a/style/amsbsy.el b/style/amsbsy.el
index 3302a8b..dce3825 100644
--- a/style/amsbsy.el
+++ b/style/amsbsy.el
@@ -1,17 +1,19 @@
-;;; amsbsy.el --- Style hook for the AMS-LaTeX amsbsy package.
+;;; amsbsy.el --- Style hook for the AMS-LaTeX amsbsy package.  -*- 
lexical-binding: t; -*-
 ;;;
 ;;; AUTHOR: Carsten Dominik <dominik@strw.leidenuniv.nl>
 
 ;;; Code:
 
-(TeX-add-style-hook "amsbsy"
- (function
-  (lambda ()
-    (TeX-add-symbols
-     '("boldsymbol" "Symbol")
-     '("pmb"        "Symbol")
-     )))
- LaTeX-dialect)
+(require 'tex)
+(require 'latex)
+
+(TeX-add-style-hook
+ "amsbsy"
+ (lambda ()
+   (TeX-add-symbols
+    '("boldsymbol" "Symbol")
+    '("pmb"        "Symbol")))
+ TeX-dialect)
 
 (defvar LaTeX-amsbsy-package-options nil
   "Package options for the amsbsy package.")
diff --git a/style/amsfonts.el b/style/amsfonts.el
index e7328ab..eb4c2e5 100644
--- a/style/amsfonts.el
+++ b/style/amsfonts.el
@@ -1,6 +1,6 @@
-;;; amsfonts.el --- AUCTeX style for `amsfonts.sty' version 3.01
+;;; amsfonts.el --- AUCTeX style for `amsfonts.sty' version 3.01  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <mose@gnu.org>
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -49,7 +52,7 @@
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("bold" "{"))
                              'bold-command)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;; The `psamsfonts' option is obsolete in AMSFonts v3
 (defvar LaTeX-amsfonts-package-options nil
diff --git a/style/amsmath.el b/style/amsmath.el
index ebae233..4cde128 100644
--- a/style/amsmath.el
+++ b/style/amsmath.el
@@ -1,4 +1,4 @@
-;;; amsmath.el --- Style hook for the AMS-LaTeX amsmath package.
+;;; amsmath.el --- Style hook for the AMS-LaTeX amsmath package.  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2002, 2005-2007, 2012-2014, 2017-2020
 ;;      Free Software Foundation, Inc.
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Fontification
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -184,7 +187,7 @@
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("boxed" "{"))
                              'math-command)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-amsmath-env-alignat (env)
   "Insert ENV with column number specifications.
diff --git a/style/amsopn.el b/style/amsopn.el
index 85e3f17..fd2c5fc 100644
--- a/style/amsopn.el
+++ b/style/amsopn.el
@@ -1,6 +1,6 @@
-;;; amsopn.el --- AUCTeX style for the `amsnopn.sty' AMS-LaTeX package
+;;; amsopn.el --- AUCTeX style for the `amsnopn.sty' AMS-LaTeX package  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1997, 2002, 2005, 2013 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2002, 2005, 2013, 2020 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@strw.leidenuniv.nl>
 ;;         Mads Jensen <mje@inducks.org>
@@ -28,23 +28,26 @@
 
 ;; This file adds support for `amsnopn.sty'
 
+(require 'tex)
+(require 'latex)
+
 ;;; Code:
 
-(TeX-add-style-hook "amsopn"
- (function
-  (lambda ()
-    (TeX-add-symbols
-     '("DeclareMathOperator"  (TeX-arg-define-macro "Math Operator: \\")
-       "Expansion text for the math operator")
-     '("DeclareMathOperator*" (TeX-arg-define-macro "Math Operator: \\")
-       "Expansion text for the math operator")
-     '("operatorname" t)
-     '("operatorname*" t))
-
-    (add-to-list 'LaTeX-auto-regexp-list
-                '("\\\\DeclareMathOperator\\*?{?\\\\\\([A-Za-z0-9]+\\)}?"
-                  1 TeX-auto-symbol))))
- LaTeX-dialect
+(TeX-add-style-hook
+ "amsopn"
+ (lambda ()
+   (TeX-add-symbols
+    '("DeclareMathOperator"  (TeX-arg-define-macro "Math Operator: \\")
+      "Expansion text for the math operator")
+    '("DeclareMathOperator*" (TeX-arg-define-macro "Math Operator: \\")
+      "Expansion text for the math operator")
+    '("operatorname" t)
+    '("operatorname*" t))
+
+   (add-to-list 'LaTeX-auto-regexp-list
+               '("\\\\DeclareMathOperator\\*?{?\\\\\\([A-Za-z0-9]+\\)}?"
+                 1 TeX-auto-symbol)))
+ TeX-dialect
  )
 
 (defvar LaTeX-amsopn-package-options '("namelimits" "nonamelimits")
diff --git a/style/amssymb.el b/style/amssymb.el
index c53a52f..5fdb82c 100644
--- a/style/amssymb.el
+++ b/style/amssymb.el
@@ -1,6 +1,6 @@
-;;; amssymb.el --- AUCTeX style for `amssymb.sty'
+;;; amssymb.el --- AUCTeX style for `amssymb.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2012 Free Software Foundation, Inc.
+;; Copyright (C) 2012, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -33,6 +33,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "amssymb"
  (lambda ()
@@ -242,7 +245,7 @@
     "Bbbk"
     "hslash"
     "backepsilon"))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-amssymb-package-options '("psamsfonts")
   "Package options for the amssymb package.")
diff --git a/style/amstex.el b/style/amstex.el
index 97a8b70..c9c1b9b 100644
--- a/style/amstex.el
+++ b/style/amstex.el
@@ -1,6 +1,6 @@
-;;; amstex.el --- AMS-LaTeX support.
+;;; amstex.el --- AMS-LaTeX support.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Keywords: tex
@@ -40,13 +40,15 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "amstex"
- (function
-  (lambda ()
-    (unless (memq major-mode '(plain-tex-mode ams-tex-mode))
-      (TeX-run-style-hooks "amsmath"))))
- LaTeX-dialect)
+ (lambda ()
+   (unless (memq major-mode '(plain-tex-mode ams-tex-mode))
+     (TeX-run-style-hooks "amsmath")))
+ TeX-dialect)
 
 (defvar LaTeX-amstex-package-options '("noamsfonts" "psamsfonts" 
                                       "intlimits" "nointlimits"
diff --git a/style/amstext.el b/style/amstext.el
index d0a8e87..96f1dd1 100644
--- a/style/amstext.el
+++ b/style/amstext.el
@@ -1,15 +1,18 @@
-;;; amstext.el --- Style hook for the AMS-LaTeX amstext package.
+;;; amstext.el --- Style hook for the AMS-LaTeX amstext package.  -*- 
lexical-binding: t; -*-
 ;;;
 ;;; AUTHOR: Carsten Dominik <dominik@strw.leidenuniv.nl>
 
 ;;; Code:
 
-(TeX-add-style-hook "amstext"
- (function
-  (lambda ()
-    (TeX-add-symbols
-     '("text" t))))
- LaTeX-dialect)
+(require 'tex)
+(require 'latex)
+
+(TeX-add-style-hook
+ "amstext"
+ (lambda ()
+   (TeX-add-symbols
+    '("text" t)))
+ TeX-dialect)
 
 (defvar LaTeX-amstext-package-options nil
   "Package options for the amstext package.")
diff --git a/style/amsthm.el b/style/amsthm.el
index d04c4c2..a71feda 100644
--- a/style/amsthm.el
+++ b/style/amsthm.el
@@ -1,6 +1,6 @@
-;;; amsthm.el --- Style hook for the AMS-LaTeX amsthm package.
+;;; amsthm.el --- Style hook for the AMS-LaTeX amsthm package.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1997, 2013--2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2013--2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@strw.leidenuniv.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -39,11 +42,6 @@
 (defvar LaTeX-amsthm-package-options nil
   "Package options for the amsthm package.")
 
-(defvar LaTeX-amsthm-theoremstyle-list
-  '(("plain") ("definition") ("remark"))
-  "List of theorem styles provided by `amsthm.el' and new ones
-defined with \"\\newtheoremstyle\".")
-
 (defvar LaTeX-amsthm-fontdecl
   '(;; family
     "rmfamily" "sffamily" "ttfamily"
@@ -63,15 +61,16 @@ defined with \"\\newtheoremstyle\".")
   "Prompt for font declaration commands in \"\\newtheoremstyle\".
 If OPTIONAL is non-nil, insert the resulting value as an optional
 argument.  Use PROMPT as the prompt string."
-  ;; `INITIAL-INPUT' (5th argument to `TeX-completing-read-multiple')
-  ;; is hard-coded to `TeX-esc'.
   (let* ((crm-separator (regexp-quote TeX-esc))
-        (fontdecl (mapconcat 'identity
+        (fontdecl (mapconcat #'identity
                              (TeX-completing-read-multiple
-                              (TeX-argument-prompt optional prompt "Font")
-                              LaTeX-amsthm-fontdecl nil nil TeX-esc)
+                              (TeX-argument-prompt optional prompt "Font: \\" 
t)
+                              LaTeX-amsthm-fontdecl)
                              TeX-esc)))
-    (TeX-argument-insert fontdecl optional)))
+    (TeX-argument-insert fontdecl
+                        optional
+                        (when (and fontdecl (not (string= fontdecl "")))
+                          TeX-esc))))
 
 (defun LaTeX-amsthm-env-label (environment)
   "Insert ENVIRONMENT, query for an optional argument and prompt
@@ -97,9 +96,6 @@ RefTeX users should customize or add ENVIRONMENT to
     (LaTeX-newline)
     (indent-according-to-mode)))
 
-;; Needed for auto-parsing
-(require 'tex)
-
 ;; Setup parsing for \newtheorem
 (TeX-auto-add-type "amsthm-newtheorem" "LaTeX")
 
@@ -114,14 +110,9 @@ RefTeX users should customize or add ENVIRONMENT to
 
 (defun LaTeX-amsthm-auto-cleanup ()
   "Move parsed results from `LaTeX-auto-amsthm-newtheorem' and
-make them available as new environments.  Update
-`LaTeX-amsthm-theoremstyle-list' with styles defined with
-\"\\newtheoremstyle\"."
-  (dolist (newthm (mapcar 'car (LaTeX-amsthm-newtheorem-list)))
-    (LaTeX-add-environments (list newthm 'LaTeX-amsthm-env-label)))
-  (dolist (newthmstyle (LaTeX-amsthm-newtheoremstyle-list))
-    (add-to-list (make-local-variable 'LaTeX-amsthm-theoremstyle-list)
-                newthmstyle)))
+make them available as new environments."
+  (dolist (newthm (mapcar #'car (LaTeX-amsthm-newtheorem-list)))
+    (LaTeX-add-environments (list newthm 'LaTeX-amsthm-env-label))))
 
 (add-hook 'TeX-auto-prepare-hook #'LaTeX-amsthm-auto-prepare t)
 (add-hook 'TeX-auto-cleanup-hook #'LaTeX-amsthm-auto-cleanup t)
@@ -130,8 +121,14 @@ make them available as new environments.  Update
 (TeX-add-style-hook
  "amsthm"
  (lambda ()
+   ;; Add the pre-defined styles:
+   (LaTeX-add-amsthm-newtheoremstyles "definition"
+                                     "plain"
+                                     "remark")
+
    (LaTeX-add-environments
     '("proof" LaTeX-amsthm-env-label))
+
    (TeX-add-symbols
     ;; Overrule the defintion in `latex.el':
     '("newtheorem"
@@ -163,8 +160,9 @@ make them available as new environments.  Update
           (format "%s" heading)))))
 
     '("theoremstyle"
-      (TeX-arg-eval completing-read "Style: "
-                   LaTeX-amsthm-theoremstyle-list))
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt nil nil "Style")
+                   (LaTeX-amsthm-newtheoremstyle-list)))
     "qedhere"
     "swapnumbers"
 
@@ -174,14 +172,12 @@ make them available as new environments.  Update
         (let ((nthmstyle (TeX-read-string
                           (TeX-argument-prompt nil nil "Style name"))))
           (LaTeX-add-amsthm-newtheoremstyles nthmstyle)
-          (add-to-list (make-local-variable 'LaTeX-amsthm-theoremstyle-list)
-                       (list nthmstyle))
           (format "%s" nthmstyle))))
       (TeX-arg-length "Space above")
       (TeX-arg-length "Space below")
-      (LaTeX-arg-amsthm-fontdecl "Body font")
+      (LaTeX-arg-amsthm-fontdecl "Body font: \\")
       "Indent amount"
-      (LaTeX-arg-amsthm-fontdecl "Theorem head font")
+      (LaTeX-arg-amsthm-fontdecl "Theorem head font: \\")
       "Punctuation after head"
       (TeX-arg-length "Space after head")
       "Theorem head spec"))
@@ -200,6 +196,6 @@ make them available as new environments.  Update
                                ("theoremstyle"    "{")
                                ("newtheoremstyle" "{{{{{{{{{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; amsthm.el ends here
diff --git a/style/appendix.el b/style/appendix.el
new file mode 100644
index 0000000..1df68a6
--- /dev/null
+++ b/style/appendix.el
@@ -0,0 +1,79 @@
+;;; appendix.el --- AUCTeX style for `appendix.sty' (v1.2c)  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2020 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2020-10-10
+;; 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 `appendix.sty' version 1.2c from
+;; 2020/02/08.
+
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+
+(TeX-add-style-hook
+ "appendix"
+ (lambda ()
+
+   (TeX-add-symbols
+    "appendixpage"
+    "addappheadtotoc"
+    "noappendicestocpagenum"
+    "appendicestocpagenum"
+    "appendixname"
+    "appendixtocname"
+    "appendixpagename"
+
+    "appendixtocon"
+    "appendixtocoff"
+    "appendixpageon"
+    "appendixpageoff"
+    "appendixtitleon"
+    "appendixtitleoff"
+    "appendixtitletocon"
+    "appendixtitletocoff"
+    "appendixheaderon"
+    "appendixheaderoff"
+    "restoreapp"
+
+    "setthesection"
+    "setthesubsection")
+
+   (LaTeX-add-environments
+    '("appendices")
+    '("subappendices"))
+
+   ;; Don't indent the content inside \(sub\)?appendices environments:
+   (unless (string-match "appendices" LaTeX-document-regexp)
+     (set (make-local-variable 'LaTeX-document-regexp)
+         (concat LaTeX-document-regexp "\\|\\(?:sub\\)?appendices"))))
+ TeX-dialect)
+
+(defvar LaTeX-appendix-package-options '("toc" "page" "title"
+                                        "titletoc" "header")
+  "Package options for the appendix package.")
+
+;;; appendix.el ends here
diff --git a/style/arabxetex.el b/style/arabxetex.el
index 2dd9fc2..ed4cd03 100644
--- a/style/arabxetex.el
+++ b/style/arabxetex.el
@@ -1,6 +1,6 @@
-;;; arabxetex.el --- AUCTeX style for `arabxetex.sty' (v1.2.1)
+;;; arabxetex.el --- AUCTeX style for `arabxetex.sty' (v1.2.1)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2017, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2017--2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,10 +31,16 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
                  (keywords class))
+(declare-function TeX-check-engine-add-engines
+                  "tex-buf"
+                  (&rest engines))
 
 (TeX-add-style-hook
  "arabxetex"
@@ -65,7 +71,7 @@
            (lambda (symbol)
              (list symbol
                    [ TeX-arg-eval completing-read
-                                  (TeX-argument-prompt optional nil "Mode")
+                                  (TeX-argument-prompt t nil "Mode")
                                   LaTeX-arabxetex-package-options ]
                    t))
            (mapcar (lambda (lang) (concat "text" lang)) langs)))
@@ -77,7 +83,7 @@
              (list environment
                    #'LaTeX-env-args
                    [ TeX-arg-eval completing-read
-                                  (TeX-argument-prompt optional nil "Mode")
+                                  (TeX-argument-prompt t nil "Mode")
                                   LaTeX-arabxetex-package-options ]))
            langs))
      ;;
@@ -97,7 +103,7 @@
     ;; 3.3 Transliteration
     '("SetTranslitConvention"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Mapping")
+                   (TeX-argument-prompt nil nil "Mapping")
                    '("dmg" "loc")))
     '("SetTranslitStyle" "Style"))
 
@@ -111,7 +117,7 @@
      (font-latex-add-keywords '(("SetTranslitConvention" "{")
                                ("SetTranslitStyle"      "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-arabxetex-package-options
   '("novoc" "voc" "fullvoc" "trans" "utf")
diff --git a/style/array.el b/style/array.el
index d6df2eb..4b3f1d4 100644
--- a/style/array.el
+++ b/style/array.el
@@ -1,6 +1,6 @@
-;;; array.el --- AUCTeX style for `array.sty'
+;;; array.el --- AUCTeX style for `array.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2013, 2015, 2018, 2019 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2015, 2018--2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,7 @@
 ;;; Code:
 
 (require 'tex)
+(require 'latex)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
@@ -102,7 +103,7 @@ and make it buffer local. "
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("newcolumntype" "{[{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-array-package-options nil
   "Package options for array.")
diff --git a/style/article.el b/style/article.el
index 4bfd881..aa4d764 100644
--- a/style/article.el
+++ b/style/article.el
@@ -1,7 +1,10 @@
-;;; article.el - Special code for article style.
+;;; article.el - Special code for article style.  -*- lexical-binding: t; -*-
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-article-class-options
   '("a4paper" "a5paper" "b5paper" "letterpaper" "legalpaper" "executivepaper"
     "landscape" "10pt" "11pt" "12pt" "oneside" "twoside" "draft" "final"
@@ -16,6 +19,6 @@
                       "subparagraph" "figure" "table")
    (LaTeX-add-pagestyles "headings" "myheadings")
    (LaTeX-add-environments "abstract"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; article.el ends here
diff --git a/style/attachfile.el b/style/attachfile.el
index a51cdf2..8f077be 100644
--- a/style/attachfile.el
+++ b/style/attachfile.el
@@ -1,6 +1,6 @@
-;;; attachfile.el --- AUCTeX style for `attachfile.sty' (v1.6)
+;;; attachfile.el --- AUCTeX style for `attachfile.sty' (v1.6)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -117,7 +119,7 @@
                                ("textattachfile"   "[{{")
                                ("notextattachfile" "[{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-attachfile-package-options nil
   "Prompt for package options for the attachfile package.")
diff --git a/style/australian.el b/style/australian.el
index a11b2f1..7d9d830 100644
--- a/style/australian.el
+++ b/style/australian.el
@@ -1,6 +1,6 @@
-;;; australian.el --- AUCTeX style for the `australian' babel option.
+;;; australian.el --- AUCTeX style for the `australian' babel option.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2017 Free Software Foundation, Inc.
+;; Copyright (C) 2017, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,10 +31,12 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "australian"
  (lambda ()
    (TeX-run-style-hooks "english"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; australian.el ends here
diff --git a/style/austrian.el b/style/austrian.el
index fce8906..98305fd 100644
--- a/style/austrian.el
+++ b/style/austrian.el
@@ -1,6 +1,6 @@
-;;; austrian.el --- AUCTeX style for the `austrian' babel option.
+;;; austrian.el --- AUCTeX style for the `austrian' babel option.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,10 +31,12 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "austrian"
  (lambda ()
    (TeX-run-style-hooks "german"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; austrian.el ends here
diff --git a/style/babel.el b/style/babel.el
index 24d6cbb..43f19ab 100644
--- a/style/babel.el
+++ b/style/babel.el
@@ -1,6 +1,6 @@
-;;; babel.el --- AUCTeX style for `babel.sty' version 3.31.
+;;; babel.el --- AUCTeX style for `babel.sty' version 3.31.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2005, 2007, 2013-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007, 2013-2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,12 +30,12 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (eval-when-compile
   (require 'cl-lib))
 
-;; Needed for auto-parsing.
-(require 'tex)
-
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -288,7 +288,7 @@
     '("defineshorthand"
       [ TeX-arg-eval mapconcat #'identity
                     (TeX-completing-read-multiple
-                     (TeX-argument-prompt optional nil "Language(s)")
+                     (TeX-argument-prompt t nil "Language(s)")
                      (LaTeX-babel-active-languages)) ""]
       t nil)
     '("aliasshorthand"   "Original" "Alias")
@@ -299,7 +299,7 @@
     ;; 1.12 The base option
     '("AfterBabelLanguage"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Language")
+                   (TeX-argument-prompt nil nil "Language")
                    LaTeX-babel-language-list)
       t)
 
@@ -307,11 +307,11 @@
     '("babelfont"
       [ TeX-arg-eval mapconcat #'identity
                     (TeX-completing-read-multiple
-                     (TeX-argument-prompt optional nil "Language(s)")
+                     (TeX-argument-prompt t nil "Language(s)")
                      LaTeX-babel-language-list)
                     "," ]
       (TeX-arg-eval let ((fontfam (completing-read
-                                  (TeX-argument-prompt optional nil "font 
family")
+                                  (TeX-argument-prompt nil nil "font family")
                                   '("rm" "sf" "tt"))))
                    ;; Make sure `tex-buf.el' is also loaded otherwise
                    ;; `TeX-check-engine-add-engines' is not defined.
@@ -332,7 +332,7 @@
     '("babelprovide"
       [ TeX-arg-key-val LaTeX-babel-babelprovide-key-val-options ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Language")
+                   (TeX-argument-prompt nil nil "Language")
                    LaTeX-babel-language-list))
 
     ;; 1.18 Getting the current language name
@@ -342,17 +342,17 @@
     ;; 1.19 Hyphenation and line breaking
     '("babelhyphen"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Type/Text")
+                   (TeX-argument-prompt nil nil "Type/Text")
                    '("soft" "hard" "repeat" "empty")))
     '("babelhyphen*"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Type/Text")
+                   (TeX-argument-prompt nil nil "Type/Text")
                    '("soft" "hard" "repeat" "empty")))
 
     '("babelhyphenation"
       [ TeX-arg-eval mapconcat #'identity
                     (TeX-completing-read-multiple
-                     (TeX-argument-prompt optional nil "Language(s)")
+                     (TeX-argument-prompt nil nil "Language(s)")
                      LaTeX-babel-language-list)
                     "," ]
       t)
@@ -394,7 +394,7 @@
                                ("aliasshorthand"     "{{")
                                ("languageattribute"  "{{"))
                              'variable)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-babel-package-options ()
   "Prompt for package options for the babel package."
diff --git a/style/baskervaldx.el b/style/baskervaldx.el
index 16b4a5c..ed347d9 100644
--- a/style/baskervaldx.el
+++ b/style/baskervaldx.el
@@ -1,6 +1,6 @@
-;;; baskervaldx.el --- AUCTeX style for `baskervaldx.sty' (v1.07)
+;;; baskervaldx.el --- AUCTeX style for `baskervaldx.sty' (v1.07)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014, 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -79,7 +81,7 @@
                              'type-declaration)
      (font-latex-add-keywords '(("swshape"   ""))
                              'bold-declaration)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-baskervaldx-package-options
   '("lining" "lf" "oldstyle" "osf" "tabular" "proportional" "p"
diff --git a/style/beamer.el b/style/beamer.el
index 5323ec7..d84d275 100644
--- a/style/beamer.el
+++ b/style/beamer.el
@@ -1,4 +1,4 @@
-;;; beamer.el --- AUCTeX style for the latex-beamer class
+;;; beamer.el --- AUCTeX style for the latex-beamer class  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2003-2005, 2008, 2013-2016, 2018, 2020 Free Software 
Foundation, Inc.
 
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -62,7 +65,7 @@
 (TeX-add-style-hook
  "beamer"
  (lambda ()
-   (add-hook 'LaTeX-after-insert-env-hooks 'LaTeX-beamer-after-insert-env nil 
t)
+   (add-hook 'LaTeX-after-insert-env-hook 'LaTeX-beamer-after-insert-env nil t)
 
    (TeX-run-style-hooks "amsmath" "amssymb" "amsthm" "color" "geometry"
                        "hyperref" "inputenc" "translator" "xcolor")
@@ -186,7 +189,7 @@
                                ("author" "[{")
                                ("date" "[{")
                                ("frametitle" "<[{")) 'slide-title)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun TeX-arg-beamer-overlay-spec (optional &optional prompt)
   "Prompt for overlay specification.
diff --git a/style/beamerarticle.el b/style/beamerarticle.el
index 3704e61..136947a 100644
--- a/style/beamerarticle.el
+++ b/style/beamerarticle.el
@@ -1,6 +1,6 @@
-;;; beamerarticle.el --- AUCTeX style for the latex-beamerarticle class
+;;; beamerarticle.el --- AUCTeX style for the latex-beamerarticle class  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019 Free Software Foundation, Inc.
+;; Copyright (C) 2019, 2020 Free Software Foundation, Inc.
 
 ;; Keywords: tex
 
@@ -27,6 +27,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "beamerarticle"
  (lambda ()
diff --git a/style/beamerswitch.el b/style/beamerswitch.el
index 501b375..d565523 100644
--- a/style/beamerswitch.el
+++ b/style/beamerswitch.el
@@ -1,6 +1,6 @@
-;;; beamerswitch.el --- AUCTeX style for the latex-beamerswitch class
+;;; beamerswitch.el --- AUCTeX style for the latex-beamerswitch class  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019 Free Software Foundation, Inc.
+;; Copyright (C) 2019, 2020 Free Software Foundation, Inc.
 
 ;; Keywords: tex
 
@@ -27,6 +27,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "beamerswitch"
  (lambda ()
diff --git a/style/biblatex.el b/style/biblatex.el
index f38fee5..e1e803d 100644
--- a/style/biblatex.el
+++ b/style/biblatex.el
@@ -1,6 +1,6 @@
-;;; biblatex.el --- AUCTeX style for `biblatex.sty' version 2.8a.
+;;; biblatex.el --- AUCTeX style for `biblatex.sty' version 2.8a.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2012-2014, 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2014, 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -591,7 +594,7 @@ for citation keys."
            (?y    . "\\citeyear{%l}")
            (?Y    . "\\citeyear*{%l}")
            (?n    . "\\nocite{%l}")))))))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-biblatex-package-options-list
   (append
diff --git a/style/bicaption.el b/style/bicaption.el
index 8622cd5..0918b56 100644
--- a/style/bicaption.el
+++ b/style/bicaption.el
@@ -1,4 +1,4 @@
-;;; bicaption.el --- AUCTeX style for `bicaption.sty' (v1.1-158)
+;;; bicaption.el --- AUCTeX style for `bicaption.sty' (v1.1-158)  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2016--2020 Free Software Foundation, Inc.
 
@@ -117,13 +117,13 @@ arguments."
     (when cap-box
       (let* ((TeX-arg-opening-brace "[")
             (TeX-arg-closing-brace "]")
-            (last-optional-rejected nil)
+            (TeX-last-optional-rejected nil)
             (width (LaTeX-check-insert-macro-default-style
                     (completing-read (TeX-argument-prompt t nil "Width")
                                      (mapcar (lambda (elt) (concat TeX-esc 
(car elt)))
                                              (LaTeX-length-list)))))
-            (last-optional-rejected (or (not width)
-                                        (and width (string= width ""))))
+            (TeX-last-optional-rejected (or (not width)
+                                            (and width (string= width ""))))
             (inpos (LaTeX-check-insert-macro-default-style
                     (if (and width (not (string-equal width "")))
                         (completing-read (TeX-argument-prompt t nil "Inner 
position")
@@ -185,7 +185,7 @@ square brackets."
                                ("bisubcaption"    "*[{[{")
                                ("bisubcaptionbox" "*[{[{[["))
                              'textual)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-bicaption-package-options ()
   "Prompt for package options for the bicaption package."
diff --git a/style/bidi.el b/style/bidi.el
index 0638482..287bbfd 100644
--- a/style/bidi.el
+++ b/style/bidi.el
@@ -1,4 +1,4 @@
-;;; bidi.el --- AUCTeX style for the (XeLaTeX) bidi package
+;;; bidi.el --- AUCTeX style for the (XeLaTeX) bidi package  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2016--2020 Free Software Foundation, Inc.
 
@@ -29,10 +29,16 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
                  (keywords class))
+(declare-function TeX-check-engine-add-engines
+                  "tex-buf"
+                  (&rest engines))
 
 (defvar LaTeX-bidi-package-options
   '("RTLdocument" "rldocument" "extrafootnotefeatures")
@@ -189,6 +195,6 @@
                                ("XeLaTeX" "")
                                ("SepMark" "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; bidi.el ends here
diff --git a/style/bidibeamer.el b/style/bidibeamer.el
index 767a647..f6d2e3a 100644
--- a/style/bidibeamer.el
+++ b/style/bidibeamer.el
@@ -1,6 +1,6 @@
-;;; bidibeamer.el --- AUCTeX style for the bidibeamer class
+;;; bidibeamer.el --- AUCTeX style for the bidibeamer class  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015 Free Software Foundation
+;; Copyright (C) 2015, 2020 Free Software Foundation
 
 ;; Author: Tassilo Horn <tsdh@gnu.org>
 ;; Created: 2015-03-08
@@ -31,10 +31,12 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "bidibeamer"
  (lambda ()
    (TeX-run-style-hooks "beamer"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; bidibeamer.el ends here
diff --git a/style/bigdelim.el b/style/bigdelim.el
index 085185b..30938d3 100644
--- a/style/bigdelim.el
+++ b/style/bigdelim.el
@@ -1,6 +1,6 @@
-;;; bigdelim.el --- AUCTeX style for `bigdelim.sty'
+;;; bigdelim.el --- AUCTeX style for `bigdelim.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2011, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "bigdelim"
  (lambda ()
@@ -38,7 +40,7 @@
       "Width in multirow" [ "Text in multirow" ])
     '("rdelim" TeX-arg-bigdelim-brace "Number of rows for multirow"
       "Width in multirow" [ "Text in multirow" ])))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun TeX-arg-bigdelim-brace (optional &optional prompt)
   "Prompt for a single brace, and do not insert the matching
diff --git a/style/bigstrut.el b/style/bigstrut.el
index 3ece300..71ea835 100644
--- a/style/bigstrut.el
+++ b/style/bigstrut.el
@@ -1,6 +1,6 @@
-;;; bigstrut.el --- AUCTeX style for `bigstrut.sty'
+;;; bigstrut.el --- AUCTeX style for `bigstrut.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2012, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2012, 2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,13 +29,15 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "bigstrut"
  (lambda ()
    (TeX-add-symbols
     "bigstrutsetup"
     '("bigstrut" [ TeX-arg-bigstrut ])))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun TeX-arg-bigstrut (optional &optional _prompt)
   "Prompt for the optional argument in \\bigstrut."
diff --git a/style/bm.el b/style/bm.el
index 9e7dc6d..5ded3ac 100644
--- a/style/bm.el
+++ b/style/bm.el
@@ -1,6 +1,6 @@
-;;; bm.el --- AUCTeX style for `bm.sty'.
+;;; bm.el --- AUCTeX style for `bm.sty'.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2012, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2012, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <giordano.mose@libero.it>
@@ -29,6 +29,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -52,7 +54,7 @@
                                ("bmdefine" "|{\\{")
                                ("hmdefine" "|{\\{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-bm-package-options nil
   "Package options for the bm package.")
diff --git a/style/book.el b/style/book.el
index c9571cb..cdc754a 100644
--- a/style/book.el
+++ b/style/book.el
@@ -1,7 +1,10 @@
-;;; book.el - Special code for book style.
+;;; book.el - Special code for book style.  -*- lexical-binding: t; -*-
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-book-class-options
   '("a4paper" "a5paper" "b5paper" "letterpaper" "legalpaper" "executivepaper"
     "landscape" "10pt" "11pt" "12pt" "oneside" "twoside" "draft" "final"
@@ -16,6 +19,6 @@
    (LaTeX-add-counters "part" "chapter" "section" "subsection" "subsubsection"
                       "paragraph" "subparagraph" "figure" "table")
    (LaTeX-add-pagestyles "headings" "myheadings"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; book.el ends here
diff --git a/style/booktabs.el b/style/booktabs.el
index 5a58b28..7abecc1 100644
--- a/style/booktabs.el
+++ b/style/booktabs.el
@@ -1,6 +1,6 @@
-;;; booktabs.el -- AUCTeX style for booktabs.sty
+;;; booktabs.el -- AUCTeX style for booktabs.sty  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2003, 2004, 2013, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2013, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author:   Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -57,7 +59,7 @@ PROMPT is the value of the prompt to be shown."
     '("toprule" [ "Thickness" ])
     '("midrule" [ "Thickness" ])
     '("bottomrule" [ "Thickness" ])
-    ;; The `ignore' resets `last-optional-rejected' to nil so that the trim
+    ;; The `ignore' resets `TeX-last-optional-rejected' to nil so that the trim
     ;; argument is prompted also when the thickness is skipped.
     '("cmidrule" [ "Thickness" ] (ignore) [ LaTeX-booktabs-arg-paren "Trim" ]
       "Column(s)")
@@ -76,7 +78,7 @@ PROMPT is the value of the prompt to be shown."
                                ("morecmidrules" "")
                                ("specialrule" "{{{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-booktabs-package-options nil
   "Package options for the booktabs package.")
diff --git a/style/breqn.el b/style/breqn.el
index cef8519..b5d4138 100644
--- a/style/breqn.el
+++ b/style/breqn.el
@@ -1,4 +1,4 @@
-;;; breqn.el --- AUCTeX style for `breqn.sty' (v0.98j)
+;;; breqn.el --- AUCTeX style for `breqn.sty' (v0.98j)  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 2017--2020 Free Software Foundation, Inc.
 
@@ -133,7 +133,7 @@ Keys offered for key=val query depend on ENV.  \"label\" and
     '("condition"  [ "Punctuation mark (default ,)" ] t)
     '("condition*" [ "Punctuation mark (default ,)" ] t)
     '("hiderel" t)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-breqn-package-options nil
   "Package options for the breqn package.")
diff --git a/style/bulgarian.el b/style/bulgarian.el
index 4280ab6..c7437db 100644
--- a/style/bulgarian.el
+++ b/style/bulgarian.el
@@ -1,6 +1,6 @@
-;;; bulgarian.el --- AUCTeX style for the `bulgarian' babel option.
+;;; bulgarian.el --- AUCTeX style for the `bulgarian' babel option.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2008, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2008, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-quotes
                  "font-latex"
@@ -55,6 +58,6 @@
      (font-latex-add-quotes '("\"`" "\"'"))
      (font-latex-add-quotes '("\"<" "\">" french)))
    (run-hooks 'TeX-language-bg-hook))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; bulgarian.el ends here
diff --git a/style/canadian.el b/style/canadian.el
index f66e86f..9066fc2 100644
--- a/style/canadian.el
+++ b/style/canadian.el
@@ -1,6 +1,6 @@
-;;; canadian.el --- AUCTeX style for the `canadian' babel option.
+;;; canadian.el --- AUCTeX style for the `canadian' babel option.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2017 Free Software Foundation, Inc.
+;; Copyright (C) 2017, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,10 +31,12 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "canadian"
  (lambda ()
    (TeX-run-style-hooks "english"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; canadian.el ends here
diff --git a/style/captcont.el b/style/captcont.el
index d19b0c9..d68babd 100644
--- a/style/captcont.el
+++ b/style/captcont.el
@@ -1,6 +1,6 @@
-;; captcont.el --- AUCTeX style file for captcont.sty
+;; captcont.el --- AUCTeX style file for captcont.sty  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2003, 2005, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2005, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Reiner Steib <Reiner.Steib@gmx.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,6 +29,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -43,7 +45,7 @@
    ;; Fontification
    (when (featurep 'font-latex)
      (font-latex-add-keywords '(("captcont" "*[{")) 'textual)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-captcont-package-options '("figbotcap" "figtopcap" "tabbotcap"
                                         "tabtopcap")
diff --git a/style/caption.el b/style/caption.el
index fb9ddbe..19c225d 100644
--- a/style/caption.el
+++ b/style/caption.el
@@ -1,6 +1,6 @@
-;;; caption.el --- AUCTeX style for `caption.sty' (v3.4a)
+;;; caption.el --- AUCTeX style for `caption.sty' (v3.4a)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015--2019 Free Software Foundation, Inc.
+;; Copyright (C) 2015--2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -269,13 +269,13 @@ caption, insert only a caption."
     (insert TeX-grcl))
   (let* ((TeX-arg-opening-brace "[")
         (TeX-arg-closing-brace "]")
-        (last-optional-rejected nil)
+        (TeX-last-optional-rejected nil)
         (width (LaTeX-check-insert-macro-default-style
                 (completing-read (TeX-argument-prompt t nil "Width")
                                  (mapcar (lambda (elt) (concat TeX-esc (car 
elt)))
                                          (LaTeX-length-list)))))
-        (last-optional-rejected (or (not width)
-                                    (and width (string= width ""))))
+        (TeX-last-optional-rejected (or (not width)
+                                        (and width (string= width ""))))
         (inpos (LaTeX-check-insert-macro-default-style
                 (if (and width (not (string-equal width "")))
                     (completing-read (TeX-argument-prompt t nil "Inner 
position")
@@ -467,7 +467,7 @@ STAR is non-nil, do not query for a short-caption and a 
label."
                                ("DeclareCaptionStyle"           "{[{")
                                ("DeclareCaptionTextFormat"      "{{"))
                              'function)) )
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-caption-package-options ()
   "Prompt for package options for the caption package."
diff --git a/style/changelog.el b/style/changelog.el
index feaa9dd..efd1afe 100644
--- a/style/changelog.el
+++ b/style/changelog.el
@@ -1,6 +1,6 @@
-;;; changelog.el --- AUCTeX style for `changelog.sty' (v2.0.0)
+;;; changelog.el --- AUCTeX style for `changelog.sty' (v2.0.0)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019 Free Software Foundation, Inc.
+;; Copyright (C) 2019, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,10 +31,14 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
                  (keywords class))
+(defvar reftex-label-alist)
 
 (defvar LaTeX-changelog-env-key-val-options
   '(("section" ("true" "false"))
@@ -151,7 +155,7 @@ The keys sectioncmd and label are added in the function
                                ("security"     "")
                                ("shortversion" "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-changelog-package-options nil
   "Package options for the changelog package.")
diff --git a/style/cleveref.el b/style/cleveref.el
index 290bc2f..6545f17 100644
--- a/style/cleveref.el
+++ b/style/cleveref.el
@@ -1,6 +1,6 @@
-;;; cleveref.el --- AUCTeX style for `cleveref.sty' (v0.21.4)
+;;; cleveref.el --- AUCTeX style for `cleveref.sty' (v0.21.4)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014--2019 Free Software Foundation, Inc.
+;; Copyright (C) 2014--2020 Free Software Foundation, Inc.
 
 ;; Author: Matthew Leach <matthew@mattleach.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,9 @@
 
 ;;; Code
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -193,7 +196,7 @@ Use PROMPT as the prompt string."
    (and LaTeX-reftex-ref-style-auto-activate
        (fboundp 'reftex-ref-style-activate)
        (reftex-ref-style-activate "Cleveref")))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-cleveref-package-options
   '("capitalise" "nameinlink" "noabbrev" "poorman")
diff --git a/style/color.el b/style/color.el
index f8f850a..501698e 100644
--- a/style/color.el
+++ b/style/color.el
@@ -1,6 +1,6 @@
-;;; color.el --- AUCTeX style for `color.sty' (v1.1a)
+;;; color.el --- AUCTeX style for `color.sty' (v1.1a)  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2015--2019 Free Software Foundation, Inc.
+;; Copyright (C) 2015--2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -131,7 +131,7 @@
   ;; `TeX-insert-macro-default-style' and if `current-prefix-arg'.
   ;; `named' is removed here from completion if package option is not
   ;; given.
-  (let* ((last-optional-rejected nil)
+  (let* ((TeX-last-optional-rejected nil)
          (model (LaTeX-check-insert-macro-default-style
                  (completing-read
                   (TeX-argument-prompt t prompt "Color model")
@@ -181,7 +181,7 @@
   ;; First, ask for <model> depending on
   ;; `TeX-insert-macro-default-style' and `current-prefix-arg'.
   ;; Remove `named' if necessary.
-  (let* ((last-optional-rejected nil)
+  (let* ((TeX-last-optional-rejected nil)
         (model (LaTeX-check-insert-macro-default-style
                  (completing-read
                   (TeX-argument-prompt t prompt "Color model")
@@ -300,7 +300,7 @@
                                'type-command)
        (font-latex-add-keywords '(("definecolor"    "{{{"))
                                'function))))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-color-package-options
   '("debugshow" "dvipdf" "dvipdfm" "dvipdfmx" "dvips" "dvipsnames"
diff --git a/style/colortbl.el b/style/colortbl.el
index c878842..e4ba824 100644
--- a/style/colortbl.el
+++ b/style/colortbl.el
@@ -1,6 +1,6 @@
-;;; colortbl.el --- AUCTeX style for `colortbl.sty' (v1.0a)
+;;; colortbl.el --- AUCTeX style for `colortbl.sty' (v1.0a)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -86,7 +89,7 @@
                                ("arrayrulecolor"     "[{")
                                ("doublerulesepcolor" "[{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;; colortbl.sty has one option `debugshow'.  I ignore that since it
 ;; would only take more time during insertation in a buffer and I
diff --git a/style/commath.el b/style/commath.el
index 71a4713..dda6528 100644
--- a/style/commath.el
+++ b/style/commath.el
@@ -1,6 +1,6 @@
-;;; commath.el --- AUCTeX style for `commath.sty' (v0.3)
+;;; commath.el --- AUCTeX style for `commath.sty' (v0.3)  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -99,7 +101,7 @@
                                ("appref"  "{")
                                ("assref"  "{"))
                              'reference)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-commath-package-options nil
   "Package options for the commath package.")
diff --git a/style/comment.el b/style/comment.el
index dcac6e1..996ca9a 100644
--- a/style/comment.el
+++ b/style/comment.el
@@ -1,4 +1,4 @@
-;;; comment.el --- AUCTeX style for `comment.sty'
+;;; comment.el --- AUCTeX style for `comment.sty'  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2007, 2018, 2020 Free Software Foundation, Inc.
 
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'tex-style)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -73,6 +76,6 @@
                              'variable)
      ;; Tell font-lock about the update.
      (font-latex-set-syntactic-keywords)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; comment.el ends here
diff --git a/style/csquotes.el b/style/csquotes.el
index 8f64627..9dae9b1 100644
--- a/style/csquotes.el
+++ b/style/csquotes.el
@@ -1,4 +1,4 @@
-;;; csquotes.el --- AUCTeX style for `csquotes.sty' (v5.2j)
+;;; csquotes.el --- AUCTeX style for `csquotes.sty' (v5.2j)  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2004, 2005, 2006, 2014, 2018, 2020 Free Software Foundation, 
Inc.
 
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -314,7 +317,7 @@ PROMPT replaces the standard one \"Language\"."
                                  ("SetBlockEnvironment"   "{")
                                  ("SetCiteCommand"        "{"))
                                'variable))))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-csquotes-package-options ()
   "Prompt for package options for the csquotes package."
diff --git a/style/currvita.el b/style/currvita.el
index 127d68e..7b693d9 100644
--- a/style/currvita.el
+++ b/style/currvita.el
@@ -1,6 +1,6 @@
-;;; currvita.el --- AUCTeX style for `currvita.sty' (v0.9i)
+;;; currvita.el --- AUCTeX style for `currvita.sty' (v0.9i)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2016 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2016, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,13 +31,16 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; This is a modified version of `LaTeX-env-item'.
 (defun LaTeX-currvita-env-with-label (env)
   "Insert ENV, a mandatory label and the first item."
   (LaTeX-insert-environment
    env
    (let ((heading (TeX-read-string "Heading of list: ")))
-       (format "{%s}" heading)))
+     (format "{%s}" heading)))
   (if (TeX-active-mark)
       (progn
        (LaTeX-find-matching-begin)
@@ -85,7 +88,7 @@
 
    ;; Add new lengths defined by currvita.sty
    (LaTeX-add-lengths "cvlabelwidth" "cvlabelskip" "cvlabelsep"))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-currvita-package-options
   '("LabelsAligned" "TextAligned" "openbib" "ManyBibs" "NoDate")
diff --git a/style/czech.el b/style/czech.el
index 7d709ed..d000fe6 100644
--- a/style/czech.el
+++ b/style/czech.el
@@ -1,4 +1,6 @@
-;;; czech.el --- Setup AUCTeX for editing Czech text.
+;;; czech.el --- Setup AUCTeX for editing Czech text.  -*- lexical-binding: t; 
-*-
+
+(require 'tex)
 
 (TeX-add-style-hook
  "czech"
@@ -6,4 +8,4 @@
    (unless (eq (car TeX-quote-language) 'override)
      (setq TeX-quote-language `("czech" "\\uv{" "}" ,TeX-quote-after-quote)))
    (run-hooks 'TeX-language-cz-hook))
- LaTeX-dialect)
+ TeX-dialect)
diff --git a/style/danish.el b/style/danish.el
index a70772a..4f3a1cc 100644
--- a/style/danish.el
+++ b/style/danish.el
@@ -1,7 +1,10 @@
-;;; danish.el --- Setup AUCTeX for editing Danish text.
+;;; danish.el --- Setup AUCTeX for editing Danish text.  -*- lexical-binding: 
t; -*-
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-quotes
                  "font-latex"
@@ -18,6 +21,6 @@
      (font-latex-add-quotes '("\"`" "\"'"))
      (font-latex-add-quotes '("\">" "\"<" german)))
    (run-hooks 'TeX-language-dk-hook))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; danish.el ends here
diff --git a/style/dashundergaps.el b/style/dashundergaps.el
index 8a59f0c..dfe5077 100644
--- a/style/dashundergaps.el
+++ b/style/dashundergaps.el
@@ -1,6 +1,6 @@
-;;; dashundergaps.el --- AUCTeX style for `dashundergaps.sty' (v2.0d)
+;;; dashundergaps.el --- AUCTeX style for `dashundergaps.sty' (v2.0d)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -95,7 +98,7 @@
                                ("TeacherModeOn"      "")
                                ("TeacherModeOff"     ""))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-dashundergaps-package-options nil
   "Package options for the dashundergaps package.")
diff --git a/style/dcolumn.el b/style/dcolumn.el
index 29725ac..778fc1f 100644
--- a/style/dcolumn.el
+++ b/style/dcolumn.el
@@ -1,6 +1,6 @@
-;;; dcolumn.el --- AUCTeX style for `dcolumn.sty' (v1.06)
+;;; dcolumn.el --- AUCTeX style for `dcolumn.sty' (v1.06)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016 Free Software Foundation, Inc.
+;; Copyright (C) 2016, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "dcolumn"
  (lambda ()
@@ -41,7 +43,7 @@
 
    ;; Also run style hook for `array':
    (TeX-run-style-hooks "array"))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-dcolumn-package-options nil
   "Package options for the dcolumn package.")
diff --git a/style/dinbrief.el b/style/dinbrief.el
index 6375afd..7e2e8db 100644
--- a/style/dinbrief.el
+++ b/style/dinbrief.el
@@ -1,4 +1,4 @@
-;;; dinbrief.el --- Special code for LaTeX-Style dinbrief.
+;;; dinbrief.el --- Special code for LaTeX-Style dinbrief.  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1994, 2013, 2014, 2018, 2020 Free Software Foundation, Inc.
 
@@ -32,6 +32,7 @@
 ;;; Code:
 
 (require 'tex)
+(require 'latex)
 
 (TeX-add-style-hook
  "dinbrief"
@@ -63,7 +64,7 @@
     '("signature" "Unterschrift")
     '("opening" "Anrede")
     '("closing" "Schluss")))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defmacro LaTeX-dinbrief-insert (&rest args)
   "Insert text ignoring active markers."
diff --git a/style/dk-bib.el b/style/dk-bib.el
index 9c35a16..4db937d 100644
--- a/style/dk-bib.el
+++ b/style/dk-bib.el
@@ -1,6 +1,6 @@
-;;; dk-bib.el --- AUCTeX style for `dk-bib.sty'
+;;; dk-bib.el --- AUCTeX style for `dk-bib.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2005, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arne Jørgensen <arne@arnested.dk>
 ;; Keywords: tex
@@ -28,6 +28,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (defun LaTeX-dk-bib-package-options nil
   "Prompt for package options for the dk-bib package."
   (let ((options
diff --git a/style/dk.el b/style/dk.el
index 01a7411..2d7d783 100644
--- a/style/dk.el
+++ b/style/dk.el
@@ -1,10 +1,13 @@
-;;; dk.el - Setup AUCTeX for editing Danish text.
+;;; dk.el - Setup AUCTeX for editing Danish text.  -*- lexical-binding: t; -*-
 
 ;;; Code:
 
-(TeX-add-style-hook "dk"
- (function (lambda ()
-            (run-hooks 'TeX-language-dk-hook)))
- LaTeX-dialect)
+(require 'tex)
+
+(TeX-add-style-hook
+ "dk"
+ (lambda ()
+   (run-hooks 'TeX-language-dk-hook))
+ TeX-dialect)
 
 ;;; dk.el ends here
diff --git a/style/doc.el b/style/doc.el
index b6f3060..2eabef0 100644
--- a/style/doc.el
+++ b/style/doc.el
@@ -1,6 +1,6 @@
-;;; doc.el --- AUCTeX style for `doc.sty'
+;;; doc.el --- AUCTeX style for `doc.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2004, 2008, 2016 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2008, 2016, 2020 Free Software Foundation, Inc.
 
 ;; Author: Frank Küster <frank@kuesterei.ch>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defun LaTeX-env-no-comment (environment)
   "Insert ENVIRONMENT and make sure there is no commented empty line inside."
   (LaTeX-insert-environment environment
@@ -69,7 +72,7 @@
                '("macrocode*" current-indentation) t)
    (add-to-list 'LaTeX-indent-environment-list
                '("macro" current-indentation) t)
-   (add-hook 'LaTeX-after-insert-env-hooks 'LaTeX-doc-after-insert-macrocode
+   (add-hook 'LaTeX-after-insert-env-hook 'LaTeX-doc-after-insert-macrocode
             nil t)
    (LaTeX-add-environments
     "theglossary"
@@ -86,7 +89,7 @@
     '("DescribeMacro" (TeX-arg-eval
                       (lambda ()
                         (let ((name (TeX-read-string
-                                     (TeX-argument-prompt optional nil "Macro")
+                                     (TeX-argument-prompt nil nil "Macro")
                                      TeX-esc)))
                           (format "%s" name)))))
     '("DescribeEnv" "Environment")
@@ -100,7 +103,7 @@
     '("cmd" (TeX-arg-eval
             (lambda ()
               (let ((name (TeX-read-string
-                           (TeX-argument-prompt optional nil "Name")
+                           (TeX-argument-prompt nil nil "Name")
                            TeX-esc)))
                 (format "%s" name)))))
     "makelabel"
@@ -186,7 +189,7 @@
     "fileinfo")
    (TeX-run-style-hooks "shortvrb")
    (LaTeX-add-lengths "MacrocodeTopsep" "MacroTopsep" "MacroIndent"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;; Local Variables:
 ;; coding: utf-8
diff --git a/style/dutch.el b/style/dutch.el
index c2c56a5..47da9ca 100644
--- a/style/dutch.el
+++ b/style/dutch.el
@@ -1,10 +1,13 @@
-;;; dutch.el - Setup AUCTeX for editing Dutch text.
+;;; dutch.el - Setup AUCTeX for editing Dutch text.  -*- lexical-binding: t; 
-*-
 
 ;;; Code:
 
-(TeX-add-style-hook "dutch"
- (function (lambda ()
-            (run-hooks 'TeX-language-nl-hook)))
- LaTeX-dialect)
+(require 'tex)
+
+(TeX-add-style-hook
+ "dutch"
+ (lambda ()
+   (run-hooks 'TeX-language-nl-hook))
+ TeX-dialect)
 
 ;;; dutch.el ends here
diff --git a/style/emp.el b/style/emp.el
index 79ce9f0..13b754e 100644
--- a/style/emp.el
+++ b/style/emp.el
@@ -1,6 +1,6 @@
-;;; emp.el --- AUCTeX support for emp.sty
+;;; emp.el --- AUCTeX support for emp.sty  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2004, 2005, 2014  Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Yvon Henel aka TeXnicien de surface <Yvon.Henel@wanadoo.fr>
 ;; Maintainer: auctex-devel@gnu.org
@@ -25,6 +25,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "emp"
  (lambda ()
@@ -36,7 +39,7 @@
     '("empdef" LaTeX-env-emp-gen)
     '("empgraph" LaTeX-env-emp-gen)
     '("empcmds")))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-env-emp-gen (environment-name)
    "Ask for file, width and length. Insert environment-name environment
diff --git a/style/empheq.el b/style/empheq.el
index 749964a..fc1716a 100644
--- a/style/empheq.el
+++ b/style/empheq.el
@@ -1,4 +1,4 @@
-;;; empheq.el --- AUCTeX style for `empheq.sty' (v2.14)
+;;; empheq.el --- AUCTeX style for `empheq.sty' (v2.14)  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
 
@@ -31,12 +31,11 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
 (eval-when-compile
   (require 'cl-lib))
 
-;; Needed for auto-parsing:
-(require 'tex)
-
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -192,7 +191,7 @@
       TeX-grop
       (if (and ncols (not (string= ncols "")))
          (concat amsenv "=" ncols)
-       (symbol-value 'amsenv))
+       amsenv)
       TeX-grcl))
     (when (and (assoc amsenv LaTeX-label-alist)
               (LaTeX-label amsenv 'environment))
@@ -489,6 +488,6 @@ number of ampersands if possible."
                                ("DeclareLeftDelimiter"  "[{")
                                ("DeclareRightDelimiter" "[{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; empheq.el ends here
diff --git a/style/english.el b/style/english.el
index 33e05e8..f8477bb 100644
--- a/style/english.el
+++ b/style/english.el
@@ -1,13 +1,15 @@
-;;; english.el --- Setup AUCTeX for editing English text.
+;;; english.el --- Setup AUCTeX for editing English text.  -*- 
lexical-binding: t; -*-
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "english"
  (lambda ()
    (unless (eq (car TeX-quote-language) 'override)
      (setq TeX-quote-language nil))
    (run-hooks 'TeX-language-en-hook))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; english.el ends here
diff --git a/style/enumitem.el b/style/enumitem.el
index 06a44d2..bdc6c5c 100644
--- a/style/enumitem.el
+++ b/style/enumitem.el
@@ -1,6 +1,6 @@
-;;; enumitem.el --- AUCTeX style for `enumitem.sty' (v3.6)
+;;; enumitem.el --- AUCTeX style for `enumitem.sty' (v3.6)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -38,12 +38,11 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
 (eval-when-compile
   (require 'cl-lib))
 
-;; Needed for auto-parsing:
-(require 'tex)
-
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -384,8 +383,8 @@ in `enumitem'-completions."
           (LaTeX-add-environments `(,name LaTeX-enumitem-env-with-opts))
           (LaTeX-add-enumitem-newlists (list name type))
           (TeX-ispell-skip-setcdr `((,name ispell-tex-arg-end 0)))
-          (TeX-argument-insert name optional)
-          (TeX-argument-insert type optional)
+          (TeX-argument-insert name nil)
+          (TeX-argument-insert type nil)
           (format "%s" depth)))))
 
     ;; \renewlist{<name>}{<type>}{<max-depth>}
@@ -401,7 +400,7 @@ in `enumitem'-completions."
     '("setlist"
       [TeX-arg-eval mapconcat #'identity
                    (TeX-completing-read-multiple
-                    (TeX-argument-prompt optional nil "Environment(s), 
level(s)")
+                    (TeX-argument-prompt t nil "Environment(s), level(s)")
                     (append
                      (when (LaTeX-provided-package-options-member "enumitem"
                                                                   
"includedisplayed")
@@ -418,7 +417,7 @@ in `enumitem'-completions."
     '("setlist*"
       [TeX-arg-eval mapconcat #'identity
                    (TeX-completing-read-multiple
-                    (TeX-argument-prompt optional nil "Environment(s), 
level(s)")
+                    (TeX-argument-prompt t nil "Environment(s), level(s)")
                     (append
                      (when (LaTeX-provided-package-options-member "enumitem"
                                                                   
"includedisplayed")
@@ -497,7 +496,7 @@ in `enumitem'-completions."
                                ("setlistdepth"           "{" )
                                ("SetEnumerateShortLabel" "{{"))
                              'variable)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-enumitem-package-options
   '("inline" "shortlabels" "loadonly" "sizes"
diff --git a/style/environ.el b/style/environ.el
index c5255b7..6b7f465 100644
--- a/style/environ.el
+++ b/style/environ.el
@@ -1,6 +1,6 @@
-;;; environ.el --- AUCTeX style for `environ.sty' version v0.3
+;;; environ.el --- AUCTeX style for `environ.sty' version v0.3  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -45,6 +45,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -132,7 +135,7 @@ from `environ.sty'.")
                                ("RenewEnviron"    "{[[{[")
                                ("environbodyname" "|{\\"))
                              'function)))
-  LaTeX-dialect)
+  TeX-dialect)
 
 (defvar LaTeX-environ-package-options nil
   "Package options for the environ package.")
diff --git a/style/epigraph.el b/style/epigraph.el
index c607f21..93a555e 100644
--- a/style/epigraph.el
+++ b/style/epigraph.el
@@ -1,6 +1,6 @@
-;;; epigraph.el --- AUCTeX style for `epigraph.sty' v1.5c
+;;; epigraph.el --- AUCTeX style for `epigraph.sty' v1.5c  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2012, 2017, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2012, 2017, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -90,7 +93,7 @@
                              'variable)
      (font-latex-add-keywords '("cleartoevenpage")
                              'warning)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-epigraph-package-options nil
   "Package options for the epigraph package.")
diff --git a/style/epsf.el b/style/epsf.el
index ab5b022..bfe6279 100644
--- a/style/epsf.el
+++ b/style/epsf.el
@@ -1,11 +1,13 @@
-;;; epsf.el - Support for the epsf style option.
+;;; epsf.el - Support for the epsf style option.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2014, 2020 Free Software Foundation, Inc.
 
 ;; Contributed by Marc Gemis <makke@wins.uia.ac.be>
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "epsf"
  (lambda ()
@@ -17,7 +19,7 @@
     "epsfnormal" "epsfgetbb" "other" "epsfsetgraph"
     "PsFragSpecialArgs" "epsfaux" "testit" "epsfgrab"
     "epsfllx" "epsflly" "epsfury" "epsfverbosetrue"))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun TeX-arg-epsfsize (_optional &optional _prompt _definition)
   "Create a line that print epsf figures at a certain percentage"
diff --git a/style/erewhon.el b/style/erewhon.el
index 58b2f06..66acf53 100644
--- a/style/erewhon.el
+++ b/style/erewhon.el
@@ -1,6 +1,6 @@
-;;; erewhon.el --- AUCTeX style for `erewhon.sty' (v1.04)
+;;; erewhon.el --- AUCTeX style for `erewhon.sty' (v1.04)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014, 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -86,7 +88,7 @@
                              'type-declaration)
      (font-latex-add-keywords '(("textfrac"  "{{"))
                              'textual)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-erewhon-package-options
   '("lining" "lf" "oldstyle" "osf" "tabular" "p" "proportional"
diff --git a/style/eso-pic.el b/style/eso-pic.el
index 7d56133..1136fad 100644
--- a/style/eso-pic.el
+++ b/style/eso-pic.el
@@ -1,6 +1,6 @@
-;;; eso-pic.el --- AUCTeX style for `eso-pic.sty' (v2.0d)
+;;; eso-pic.el --- AUCTeX style for `eso-pic.sty' (v2.0d)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "eso-pic"
  (lambda ()
@@ -70,7 +73,7 @@
    (TeX-declare-expert-macros
     "eso-pic"
     "gridSetup" "LenToUnit"))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-eso-pic-package-options-list
   '(("pscoord"      ("true" "false"))
diff --git a/style/everysel.el b/style/everysel.el
index 05c1432..f500078 100644
--- a/style/everysel.el
+++ b/style/everysel.el
@@ -1,6 +1,6 @@
-;;; everysel.el --- AUCTeX style for `everysel.sty'
+;;; everysel.el --- AUCTeX style for `everysel.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2012, 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2012, 2015, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Created: 2012-12-25
@@ -29,6 +29,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "everysel"
  (lambda ()
@@ -37,7 +39,7 @@
     '("EverySelectfont" 1)
     ;; adds a hook to be called after the next \\selectfont
     '("AtNextSelectfont" 1)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-everysel-package-options nil
   "Package options for the everysel package.")
diff --git a/style/exam.el b/style/exam.el
index 76bff4b..2431522 100644
--- a/style/exam.el
+++ b/style/exam.el
@@ -1,4 +1,4 @@
-;;; exam.el --- AUCTeX style for the (LaTeX) exam class
+;;; exam.el --- AUCTeX style for the (LaTeX) exam class  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 2016--2020 Free Software Foundation, Inc.
 
@@ -32,6 +32,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -49,22 +52,23 @@
   (add-to-list 'LaTeX-exam-class-options opt))
 
 (defun LaTeX-exam-insert-item ()
-  "Insert a new item in an environment from exam class.
+  "Insert a new item in the current environment from exam class.
 Item inserted depends on the environment."
-  (TeX-insert-macro
-   (cond ((string= environment "questions")
-          "question")
-         ((string= environment "parts")
-          "part")
-         ((string= environment "subparts")
-          "subpart")
-         ((string= environment "subsubparts")
-          "subsubpart")
-        ((member environment '("choices" "oneparchoices"
-                               "checkboxes" "oneparcheckboxes"))
-         "choice")
-         ;; Fallback
-         (t "item"))))
+  (let ((env (LaTeX-current-environment)))
+    (TeX-insert-macro
+     (cond ((string= env "questions")
+            "question")
+           ((string= env "parts")
+            "part")
+           ((string= env "subparts")
+            "subpart")
+           ((string= env "subsubparts")
+            "subsubpart")
+          ((member env '("choices" "oneparchoices"
+                         "checkboxes" "oneparcheckboxes"))
+           "choice")
+           ;; Fallback
+           (t "item")))))
 
 (defun LaTeX-exam-insert-label (_optional &optional name type)
   "Indent the line and query/insert a label incl. the \"\\label\" macro.
@@ -139,59 +143,59 @@ Arguments NAME and TYPE are the same as for the function
     '("subpart" [ "Points" ] (TeX-arg-literal " "))
     '("gradetable"
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Orientation")
+                     (TeX-argument-prompt t nil "Orientation")
                      '("v" "h") ]
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Table index")
+                     (TeX-argument-prompt t nil "Table index")
                      '("questions" "pages") ] )
     '("bonusgradetable"
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Orientation")
+                     (TeX-argument-prompt t nil "Orientation")
                      '("v" "h") ]
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Table index")
+                     (TeX-argument-prompt t nil "Table index")
                      '("questions" "pages") ] )
     '("bonuspointtable"
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Orientation")
+                     (TeX-argument-prompt t nil "Orientation")
                      '("v" "h") ]
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Table index")
+                     (TeX-argument-prompt t nil "Table index")
                      '("questions" "pages") ] )
     '("partialgradetable"
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Orientation")
+                     (TeX-argument-prompt t nil "Orientation")
                      '("v" "h") ]
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Table index")
+                     (TeX-argument-prompt t nil "Table index")
                      '("questions" "pages") ] )
     '("partialbonusgradetable"
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Orientation")
+                     (TeX-argument-prompt t nil "Orientation")
                      '("v" "h") ]
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Table index")
+                     (TeX-argument-prompt t nil "Table index")
                      '("questions" "pages") ] )
     '("partialbonuspointtable"
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Orientation")
+                     (TeX-argument-prompt t nil "Orientation")
                      '("v" "h") ]
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Table index")
+                     (TeX-argument-prompt t nil "Table index")
                      '("questions" "pages") ] )
     '("pointtable"
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Orientation")
+                     (TeX-argument-prompt t nil "Orientation")
                      '("v" "h") ]
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Table index")
+                     (TeX-argument-prompt t nil "Table index")
                      '("questions" "pages") ] )
     '("partialpointtable"
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Orientation")
+                     (TeX-argument-prompt t nil "Orientation")
                      '("v" "h") ]
       [ TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Table index")
+                     (TeX-argument-prompt t nil "Table index")
                      '("questions" "pages") ] )
 
     '("subsubpart" [ "Points" ] (TeX-arg-literal " "))
@@ -395,6 +399,6 @@ Arguments NAME and TYPE are the same as for the function
                                 ("subpart"         "[")
                                 ("subsubpart"      "["))
                               'textual)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; exam.el ends here
diff --git a/style/exercise.el b/style/exercise.el
index 5fe3092..98ea7da 100644
--- a/style/exercise.el
+++ b/style/exercise.el
@@ -1,6 +1,6 @@
-;;; exercise.el --- AUCTeX style for `exercise.sty'
+;;; exercise.el --- AUCTeX style for `exercise.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Richard <theonewiththeevillook@yahoo.fr>
 ;; Created: 2014-03-17
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "exercise"
  (lambda ()
@@ -55,7 +58,7 @@
     '("listofexercises")
     '("ListOfExerciseInToc")
     '("ExerciseLevelInToc")))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-exercise-package-options '("noexercise" "noanswer" 
"exerciseonly" "answeronly" "nothing" "answerdelayed" "exercisedelayed" 
"lastexercise")
   "Package options for the exercise package.")
diff --git a/style/expl3.el b/style/expl3.el
index 18b1f28..1b732a1 100644
--- a/style/expl3.el
+++ b/style/expl3.el
@@ -1,4 +1,4 @@
-;;; expl3.el --- AUCTeX style for `expl3.sty'
+;;; expl3.el --- AUCTeX style for `expl3.sty'  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2015, 2017-2020 Free Software Foundation, Inc.
 
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar font-latex-match-simple-include-list)
 
 (defvar LaTeX-expl3-syntax-table
@@ -47,7 +50,7 @@
      ;; Fontify _ and : as part of macros.
      (add-to-list 'font-latex-match-simple-include-list "_" t)
      (add-to-list 'font-latex-match-simple-include-list ":" t)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-expl3-package-options ()
   "Read the expl3 package options from the user."
diff --git a/style/fancyhdr.el b/style/fancyhdr.el
index 46253e2..0ec2ee0 100644
--- a/style/fancyhdr.el
+++ b/style/fancyhdr.el
@@ -1,4 +1,4 @@
-;;; fancyhdr.el --- AUCTeX style for `fancyhdr.sty'
+;;; fancyhdr.el --- AUCTeX style for `fancyhdr.sty'  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 2012, 2013, 2018, 2020 Free Software Foundation, Inc.
 
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -85,7 +88,7 @@
                                 ("footrulewidth" "")
                                 ("plainheadrulewidth" "")
                                 ("plainfootrulewidth" "")) 'variable)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;; Because there can be many positions, `TeX-completing-read-multiple' is used
 ;; instead of just `completing-read', and a `collection' argument is provided 
as
diff --git a/style/fancynum.el b/style/fancynum.el
index a04be76..52ba702 100644
--- a/style/fancynum.el
+++ b/style/fancynum.el
@@ -1,6 +1,6 @@
-;;; fancynum.el --- AUCTeX style for `fancynum.sty'
+;;; fancynum.el --- AUCTeX style for `fancynum.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2013 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,6 +29,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "fancynum"
  (lambda ()
@@ -37,7 +39,7 @@
     '("setfnumdsym" t)
     '("setfnummsym" t)
     '("setfnumgsym" t)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-fancynum-package-options
   '("english" "french" "tight" "loose" "commas" "thinspaces" "plain")
diff --git a/style/fancyref.el b/style/fancyref.el
index 6b9198a..cf6555f 100644
--- a/style/fancyref.el
+++ b/style/fancyref.el
@@ -1,6 +1,6 @@
-;;; fancyref.el --- AUCTeX style file with support for fancyref.sty
+;;; fancyref.el --- AUCTeX style file with support for fancyref.sty  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1999, 2014, 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2014, 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@strw.leidenuniv.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -24,86 +24,89 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
                  (keywords class))
 
-(TeX-add-style-hook "fancyref"
-   (lambda ()
-     
-     (TeX-add-symbols
-
-      ;; The macros with label arguments
-      '("fref" [ TeX-arg-fancyref-format ] TeX-arg-ref)
-      '("Fref" [ TeX-arg-fancyref-format ] TeX-arg-ref)
-
-      ;; The macros which define new prefixes and formats
-      '("fancyrefchangeprefix" TeX-arg-macro "Prefix")
-      '("Frefformat" TeX-arg-fancyref-format TeX-arg-macro "Output")
-      '("frefformat" TeX-arg-fancyref-format TeX-arg-macro "Output")
-
-      ;; The delimiter
-      "fancyrefargdelim"
-
-      ;; All those names and abbreviations.
-      ;; Part
-      "fancyrefpartlabelprefix" 
-      "Frefpartname" "frefpartname"   
-      ;; Chapter
-      "fancyrefchalabelprefix"
-      "Frefchaname" "frefchaname"   
-      ;; Section
-      "fancyrefseclabelprefix"
-      "Frefsecname" "frefsecname"
-      ;; Equation
-      "fancyrefeqlabelprefix"
-      "Frefeqname" "frefeqname"   
-      ;; Figure
-      "fancyreffiglabelprefix"
-      "Freffigname" "freffigname" "Freffigshortname"
-      ;; Footnote
-      "fancyreffnlabelprefix"
-      "Freffnname" "freffnname"   
-      ;; Item
-      "fancyrefitemlabelprefix"
-      "Frefitemname" "frefitemname" 
-      ;; Table
-      "fancyreftablabelprefix"
-      "Freftabname" "freftabname" "Freftabshortname"
-      ;; Page
-      "Frefpgname" "frefpgname" "Frefpgshortname"
-      ;; On
-      "Frefonname" "frefonname" 
-      ;; See
-      "Frefseename" "frefseename"
-
-      ;; The spacing macros
-      "fancyrefloosespacing" "fancyreftightspacing" "fancyrefdefaultspacing"
-
-      ;; And the hook
-      "fancyrefhook")
-
-     ;; Insatall completion for labels and formats
-     (setq TeX-complete-list
-          (append
-           '(("\\\\[fF]ref\\(\\[[^]]*\\]\\)?{\\([^{}\n\r\\%,]*\\)" 
-              2 LaTeX-label-list "}")
-             ("\\\\[fF]ref\\[\\([^{}\n\r\\%,]*\\)" 
-              1 LaTeX-fancyref-formats "]")
-             ("\\\\[fF]refformat{\\([^{}\n\r\\%,]*\\)"
-              1 LaTeX-fancyref-formats "}"))
-           TeX-complete-list))
-     ;; Fontification
-     (when (and (featurep 'font-latex)
-               (eq TeX-install-font-lock 'font-latex-setup))
-       (font-latex-add-keywords '(("fref" "[{") ("Fref" "[{")) 'reference))
-
-     ;; Activate RefTeX reference style.
-     (and LaTeX-reftex-ref-style-auto-activate
-         (fboundp 'reftex-ref-style-activate)
-         (reftex-ref-style-activate "Fancyref")))
-   LaTeX-dialect)
+(TeX-add-style-hook
+ "fancyref"
+ (lambda ()
+   (TeX-add-symbols
+
+    ;; The macros with label arguments
+    '("fref" [ TeX-arg-fancyref-format ] TeX-arg-ref)
+    '("Fref" [ TeX-arg-fancyref-format ] TeX-arg-ref)
+
+    ;; The macros which define new prefixes and formats
+    '("fancyrefchangeprefix" TeX-arg-macro "Prefix")
+    '("Frefformat" TeX-arg-fancyref-format TeX-arg-macro "Output")
+    '("frefformat" TeX-arg-fancyref-format TeX-arg-macro "Output")
+
+    ;; The delimiter
+    "fancyrefargdelim"
+
+    ;; All those names and abbreviations.
+    ;; Part
+    "fancyrefpartlabelprefix" 
+    "Frefpartname" "frefpartname"   
+    ;; Chapter
+    "fancyrefchalabelprefix"
+    "Frefchaname" "frefchaname"   
+    ;; Section
+    "fancyrefseclabelprefix"
+    "Frefsecname" "frefsecname"
+    ;; Equation
+    "fancyrefeqlabelprefix"
+    "Frefeqname" "frefeqname"   
+    ;; Figure
+    "fancyreffiglabelprefix"
+    "Freffigname" "freffigname" "Freffigshortname"
+    ;; Footnote
+    "fancyreffnlabelprefix"
+    "Freffnname" "freffnname"   
+    ;; Item
+    "fancyrefitemlabelprefix"
+    "Frefitemname" "frefitemname" 
+    ;; Table
+    "fancyreftablabelprefix"
+    "Freftabname" "freftabname" "Freftabshortname"
+    ;; Page
+    "Frefpgname" "frefpgname" "Frefpgshortname"
+    ;; On
+    "Frefonname" "frefonname" 
+    ;; See
+    "Frefseename" "frefseename"
+
+    ;; The spacing macros
+    "fancyrefloosespacing" "fancyreftightspacing" "fancyrefdefaultspacing"
+
+    ;; And the hook
+    "fancyrefhook")
+
+   ;; Insatall completion for labels and formats
+   (setq TeX-complete-list
+        (append
+         '(("\\\\[fF]ref\\(\\[[^]]*\\]\\)?{\\([^{}\n\r\\%,]*\\)" 
+            2 LaTeX-label-list "}")
+           ("\\\\[fF]ref\\[\\([^{}\n\r\\%,]*\\)" 
+            1 LaTeX-fancyref-formats "]")
+           ("\\\\[fF]refformat{\\([^{}\n\r\\%,]*\\)"
+            1 LaTeX-fancyref-formats "}"))
+         TeX-complete-list))
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("fref" "[{") ("Fref" "[{")) 'reference))
+
+   ;; Activate RefTeX reference style.
+   (and LaTeX-reftex-ref-style-auto-activate
+       (fboundp 'reftex-ref-style-activate)
+       (reftex-ref-style-activate "Fancyref")))
+ TeX-dialect)
 
 ;; The following list keeps a list of available format names
 ;; Note that this list is only updated when a format is used, not
diff --git a/style/fancyvrb.el b/style/fancyvrb.el
index ee046b7..69fe18b 100644
--- a/style/fancyvrb.el
+++ b/style/fancyvrb.el
@@ -1,4 +1,4 @@
-;;; fancyvrb.el --- AUCTeX style for `fancyvrb.sty' version 3.0.
+;;; fancyvrb.el --- AUCTeX style for `fancyvrb.sty' version 3.6.  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2013, 2014, 2016-2018, 2020 Free Software Foundation, Inc.
 
@@ -25,7 +25,7 @@
 
 ;;; Commentary:
 
-;; This file adds support for `fancyvrb.sty' version 3.0.
+;; This file adds support for `fancyvrb.sty' version 3.6.
 
 ;; This style has some capabilities to parse user defined macros,
 ;; environments and saved blocks with `SaveVerbatim' environments and
@@ -41,6 +41,18 @@
 ;; The entries in `LaTeX-fancyvrb-key-val-options' cover also some
 ;; keys which are not mentioned in the manual of the package.
 
+;; Starting with version 3.6, fancyvrb.sty provides a `reflabel' key
+;; in the optional arguments which acts like a `\label' macro.  This
+;; key makes mostly sense for `\pageref'; referencing number of
+;; missing \caption's with `\ref' in a fancyvrb environment isn't
+;; useful.  This style provides support for AUCTeX and RefTeX in order
+;; to add and reference these labels.  When inserting an environment
+;; with `C-c C-e', choose `reflabel' key during the completion.  If
+;; you're using RefTeX and want to pass the label insertion job to it,
+;; simply leave the key value-less and proceed.  Otherwise enter the
+;; label value by yourself.  AUCTeX and RefTeX will parse the value
+;; and offer it for completion once a referencing macros is used.
+
 ;;; Code:
 
 ;; Needed for auto-parsing:
@@ -59,8 +71,7 @@
   `(("commentchar" ("none"))
     ("gobble")
     ("formatcom")
-    ;; Undocumented key
-    ("formatcom*")
+    ("formatcom*")    ; Undocumented key
     ("fontfamily" ("tt" "courier" "helvetica"))
     ("fontsize"   ("auto" "\\tiny" "\\scriptsize"
                   "\\footnotesize" "\\small" "\\normalsize"
@@ -93,11 +104,10 @@
     ("hfuzz")
     ("samepage" ("true" "false"))
     ("codes")
-    ;; Undocumented key
-    ("codes*")
+    ("codes*")        ; Undocumented key
     ("defineactive")
-    ;; Undocumented key
-    ("defineactive*")
+    ("defineactive*") ; Undocumented key
+    ("reflabel")
     ;; Undocumented key and introduced in version 2.81 2011/04/06
     ("vspace" ,(mapcar (lambda (x)
                         (concat TeX-esc (car x)))
@@ -257,7 +267,7 @@ RECUSTOM is non-nil, delete macros from the variable
                (TeX-arg-eval
                 (lambda ()
                   (let ((name (TeX-read-string
-                               (TeX-argument-prompt optional nil "Save 
name"))))
+                               (TeX-argument-prompt nil nil "Save name"))))
                     (LaTeX-add-fancyvrb-saveverbs name)
                     (format "%s" name))))
                TeX-arg-verb))
@@ -271,7 +281,7 @@ RECUSTOM is non-nil, delete macros from the variable
              `(,mac-name
                (TeX-arg-eval
                 completing-read
-                (TeX-argument-prompt optional nil "Saved name")
+                (TeX-argument-prompt nil nil "Saved name")
                 (LaTeX-fancyvrb-saveverb-list))))
             (when (and (fboundp 'font-latex-add-keywords)
                        (eq TeX-install-font-lock 'font-latex-setup))
@@ -355,16 +365,61 @@ update only various AUCTeX variables for verbatim 
environments."
             ;; (cond ...):
             (LaTeX-add-environments
              `(,env LaTeX-env-args
-                    [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ]))
+                    [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ]
+                    LaTeX-fancyvrb-env-reflabel-key-val))
             (LaTeX-add-environments
              `(,(concat env "*") LaTeX-env-args
-               [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ]))
+               [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ]
+               LaTeX-fancyvrb-env-reflabel-key-val))
             (add-to-list 'LaTeX-verbatim-environments-local (concat env "*"))
             (add-to-list 'LaTeX-indent-environment-list
-                         `(,(concat env "*") current-indentation) t)))
+                         `(,(concat env "*") current-indentation) t)
+            ;; Tell AUCTeX about label values to reflabel key:
+            (add-to-list 'LaTeX-label-alist
+                         (cons env 'LaTeX-listing-label) t)
+            (add-to-list 'LaTeX-label-alist
+                         (cons (concat env "*") 'LaTeX-listing-label) t)
+            (TeX-auto-add-regexp
+             `(,(concat  (regexp-quote TeX-esc)
+                         "begin[[:space:]]*"
+                         (regexp-quote TeX-grop)
+                         env
+                         "\\*?"
+                         (regexp-quote TeX-grcl)
+                         "[[:space:]]*"
+                         (LaTeX-extract-key-value-label "reflabel"))
+               1 LaTeX-auto-label))
+            ;; Tell RefTeX:
+            (when (and (fboundp 'reftex-add-label-environments)
+                       (boundp 'reftex-label-regexps))
+              (reftex-add-label-environments
+               `((,env
+                  ?l ,LaTeX-listing-label "~\\pageref{%s}"
+                  LaTeX-fancyvrb-reftex-label-context-function
+                  (regexp "[Ll]isting" "[Vv]erbatim"
+                          "[Cc]ode"    "Quell\\(code\\|text\\)"))
+
+                 (,(concat env "*")
+                  ?l ,LaTeX-listing-label "~\\pageref{%s}"
+                  LaTeX-fancyvrb-reftex-label-context-function
+                  (regexp "[Ll]isting" "[Vv]erbatim"
+                          "[Cc]ode"    "Quell\\(code\\|text\\)"))))
+              (add-to-list 'reftex-label-regexps
+                           (concat
+                            (regexp-quote TeX-esc)
+                            "begin[[:space:]]*"
+                            (regexp-quote TeX-grop)
+                            (concat env "\\*?")
+                            (regexp-quote TeX-grcl)
+                            "[[:space:]]*"
+                            (LaTeX-extract-key-value-label "reflabel" 1))
+                           t))))
       ;; These apply for all environments defined:
       (add-to-list 'LaTeX-verbatim-environments-local env)
       (add-to-list 'LaTeX-indent-environment-list `(,env current-indentation) 
t)))
+  ;; Update RefTeX:
+  (when (fboundp 'reftex-compile-variables)
+    (reftex-compile-variables))
   ;; Update font-lock:
   (when (and (fboundp 'font-latex-set-syntactic-keywords)
             (eq TeX-install-font-lock 'font-latex-setup))
@@ -379,6 +434,84 @@ If OPTIONAL is non-nil, insert the file name in brackets."
     (TeX-master-directory))
    optional))
 
+(defun LaTeX-fancyvrb-env-reflabel-key-val (_optional)
+  "Add a label value to reflabel key.
+This function checks if the reflabel key is given in the optional
+argument of a fancyvrb environment and then adds a label as value
+to that key.  The label value is inserted only if the key is
+value-less; user entered label values are recognized and
+respected.  OPTIONAL is ignored."
+  (let ((p (point-marker))
+       (s (make-marker)))
+    (set-marker s (save-excursion
+                   (LaTeX-find-matching-begin)
+                   (re-search-forward (regexp-quote LaTeX-optop)
+                                      (line-end-position)
+                                      t)))
+    ;; Search for the reflabel and a potential value:
+    (when (marker-position s)
+      (re-search-backward
+       (concat
+       "\\(\\<reflabel\\>\\)"
+       ;; Check if the key already has a label value:
+       "\\("
+       "[[:space:]]*=[[:space:]]*"
+       (regexp-quote TeX-grop)
+       "?"
+       "[[:alnum:]:._-]"
+       "\\)?")
+       s t)
+      ;; Insert a label value only if the key is value-less:
+      (when (and (not (match-string 2))
+                (match-string 1))
+       (goto-char (match-end 1))
+       (insert "="
+               TeX-grop
+               (format "%s" (LaTeX-label (LaTeX-current-environment)
+                                         'environment
+                                         t))
+               TeX-grcl)))
+    ;; At any rate, go to where we started and clean up:
+    (goto-char p)
+    (set-marker p nil)
+    (set-marker s nil)))
+
+(defun LaTeX-fancyvrb-reftex-label-context-function (env)
+  "Extract and return a context string for RefTeX.
+The context string is the first line of the verbatim environment.
+If no reflabel key is found, an error is issued.
+ENV is the name of current environment as a string."
+  (let* ((envstart (save-excursion
+                    (re-search-backward (concat "\\\\begin[[:space:]]*{"
+                                                env
+                                                "}")
+                                        nil t)))
+        (label-key (save-excursion
+                     (re-search-backward "\\<reflabel[ \t\n\r%]*=[ \t\n\r%]*"
+                                         envstart t))))
+    (if label-key
+       (save-excursion
+         (goto-char envstart)
+         (re-search-forward (regexp-quote LaTeX-optop) label-key t)
+         (up-list)
+         (forward-line)
+         ;; Return the first line of verbatim env:
+         (buffer-substring-no-properties (point)
+                                         (line-end-position)))
+      (error "No label found"))))
+
+(defvar LaTeX-fancyvrb-key-val-label-regexp
+  `(,(concat
+      (regexp-quote TeX-esc)
+      "begin[[:space:]]*"
+      (regexp-quote TeX-grop)
+      "[BL]?Verbatim\\*?"
+      (regexp-quote TeX-grcl)
+      "[[:space:]]*"
+      (LaTeX-extract-key-value-label "reflabel"))
+    1 LaTeX-auto-label)
+  "Matches the label inside an optional argument of fancyvrb environments.")
+
 (TeX-add-style-hook
  "fancyvrb"
  (lambda ()
@@ -386,6 +519,7 @@ If OPTIONAL is non-nil, insert the file name in brackets."
    (TeX-auto-add-regexp LaTeX-fancyvrb-environment-regexp)
    (TeX-auto-add-regexp LaTeX-fancyvrb-saveverb-regexp)
    (TeX-auto-add-regexp LaTeX-fancyvrb-saveverbatim-regexp)
+   (TeX-auto-add-regexp LaTeX-fancyvrb-key-val-label-regexp)
    (TeX-run-style-hooks
     "keyval")
 
@@ -402,11 +536,11 @@ If OPTIONAL is non-nil, insert the file name in brackets."
     '("Verb*" [TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local] 
TeX-arg-verb)
     '("DefineShortVerb" (TeX-arg-eval
                         TeX-read-string
-                        (TeX-argument-prompt optional nil "Character")
+                        (TeX-argument-prompt nil nil "Character")
                         TeX-esc))
     '("UndefineShortVerb" (TeX-arg-eval
                           TeX-read-string
-                          (TeX-argument-prompt optional nil "Character")
+                          (TeX-argument-prompt nil nil "Character")
                           TeX-esc))
     ;; Verbatim environments
     '("fvset" (TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local))
@@ -423,10 +557,10 @@ If OPTIONAL is non-nil, insert the file name in brackets."
       LaTeX-fancyvrb-arg-define-environment)
     '("RecustomVerbatimEnvironment"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Verbatim environment")
+                   (TeX-argument-prompt nil nil "Verbatim environment")
                    LaTeX-fancyvrb-base-environments)
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Based on environment")
+                   (TeX-argument-prompt nil nil "Based on environment")
                    LaTeX-fancyvrb-base-environments)
       (TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local))
 
@@ -441,22 +575,22 @@ If OPTIONAL is non-nil, insert the file name in brackets."
       (TeX-arg-eval
        (lambda ()
         (let ((name (TeX-read-string
-                     (TeX-argument-prompt optional nil "Save name"))))
+                     (TeX-argument-prompt nil nil "Save name"))))
           (LaTeX-add-fancyvrb-saveverbs name)
           (format "%s" name))))
       TeX-arg-verb)
     '("UseVerb" (TeX-arg-eval
                 completing-read
-                (TeX-argument-prompt optional nil "Saved name")
+                (TeX-argument-prompt nil nil "Saved name")
                 (LaTeX-fancyvrb-saveverb-list)))
     '("UseVerbatim" (TeX-arg-eval completing-read
-                                 (TeX-argument-prompt optional nil "Saved 
name")
+                                 (TeX-argument-prompt nil nil "Saved name")
                                  (LaTeX-fancyvrb-saveverbatim-list)))
     '("LUseVerbatim" (TeX-arg-eval completing-read
-                                  (TeX-argument-prompt optional nil "Saved 
name")
+                                  (TeX-argument-prompt nil nil "Saved name")
                                   (LaTeX-fancyvrb-saveverbatim-list)))
     '("BUseVerbatim" (TeX-arg-eval completing-read
-                                  (TeX-argument-prompt optional nil "Saved 
name")
+                                  (TeX-argument-prompt nil nil "Saved name")
                                   (LaTeX-fancyvrb-saveverbatim-list)))
 
     ;; Writing and reading verbatim files
@@ -469,17 +603,23 @@ If OPTIONAL is non-nil, insert the file name in brackets."
 
    (LaTeX-add-environments
     '("Verbatim" LaTeX-env-args
-      [TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local])
+      [TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local]
+      LaTeX-fancyvrb-env-reflabel-key-val)
     '("Verbatim*" LaTeX-env-args
-      [TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local])
+      [TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local]
+      LaTeX-fancyvrb-env-reflabel-key-val)
     '("BVerbatim" LaTeX-env-args
-      [TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local])
+      [TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local]
+      LaTeX-fancyvrb-env-reflabel-key-val)
     '("BVerbatim*" LaTeX-env-args
-      [TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local])
+      [TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local]
+      LaTeX-fancyvrb-env-reflabel-key-val)
     '("LVerbatim" LaTeX-env-args
-      [TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local])
+      [TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local]
+      LaTeX-fancyvrb-env-reflabel-key-val)
     '("LVerbatim*" LaTeX-env-args
-      [TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local])
+      [TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local]
+      LaTeX-fancyvrb-env-reflabel-key-val)
     '("SaveVerbatim"
       (lambda (env)
        (let ((options (TeX-read-key-val t 
LaTeX-fancyvrb-key-val-options-local))
@@ -501,6 +641,41 @@ If OPTIONAL is non-nil, insert the file name in brackets."
                     (concat LaTeX-optop options LaTeX-optcl))
                   (concat TeX-grop file TeX-grcl)))))))
 
+   (let ((envs '("BVerbatim" "BVerbatim*"
+                "LVerbatim" "LVerbatim*"
+                "Verbatim"  "Verbatim*")))
+     ;; Add pre-defined environments to `LaTeX-label-alist':
+     (dolist (env envs)
+       (add-to-list 'LaTeX-label-alist (cons env 'LaTeX-listing-label) t))
+
+     ;; Tell RefTeX
+     (when (and (fboundp 'reftex-add-label-environments)
+               (fboundp 'reftex-compile-variables)
+               (boundp 'reftex-label-regexps))
+       (dolist (env envs)
+        (reftex-add-label-environments
+         `((,env ?l ,LaTeX-listing-label "~\\pageref{%s}"
+                 LaTeX-fancyvrb-reftex-label-context-function
+                 (regexp "[Ll]isting" "[Vv]erbatim"
+                         "[Cc]ode"    "Quell\\(code\\|text\\)")))))
+
+       (unless (string-match "\\<reflabel"
+                            (mapconcat #'identity
+                                       reftex-label-regexps
+                                       "|"))
+        (make-local-variable 'reftex-label-regexps)
+        (add-to-list 'reftex-label-regexps
+                     (concat
+                      (regexp-quote TeX-esc)
+                      "begin[[:space:]]*"
+                      (regexp-quote TeX-grop)
+                      "[BL]?Verbatim\\*?"
+                      (regexp-quote TeX-grcl)
+                      "[[:space:]]*"
+                      (LaTeX-extract-key-value-label "reflabel" 1))
+                     t)
+        (reftex-compile-variables))))
+
    (LaTeX-add-counters
     "FancyVerbLine")
 
@@ -527,6 +702,7 @@ If OPTIONAL is non-nil, insert the file name in brackets."
 
    ;; Fontification
    (when (and (fboundp 'font-latex-add-keywords)
+             (fboundp 'font-latex-set-syntactic-keywords)
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("CustomVerbatimCommand"       "|{\\{{")
                                ("RecustomVerbatimCommand"     "|{\\{{")
@@ -546,8 +722,9 @@ If OPTIONAL is non-nil, insert the file name in brackets."
                                ("UseVerbatim"  "{")
                                ("LUseVerbatim" "{")
                                ("BUseVerbatim" "{"))
-                             'textual)))
- LaTeX-dialect)
+                             'textual)
+     (font-latex-set-syntactic-keywords)))
+ TeX-dialect)
 
 (defvar LaTeX-fancyvrb-package-options nil
   "Package options for the fancyvrb package.")
diff --git a/style/fbb.el b/style/fbb.el
index 62d6bd4..e1f5796 100644
--- a/style/fbb.el
+++ b/style/fbb.el
@@ -1,6 +1,6 @@
-;;; fbb.el --- AUCTeX style for `fbb.sty' (v1.07)
+;;; fbb.el --- AUCTeX style for `fbb.sty' (v1.07)  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2014, 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2014--2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -76,7 +78,7 @@
                                ("tosfstyle" "")
                                ("sufigures" ""))
                              'type-declaration)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-fbb-package-options
   '("lining" "osf" "oldstyle" "tabular" "p" "proportional"
diff --git a/style/fbox.el b/style/fbox.el
index 1ff1b69..367d042 100644
--- a/style/fbox.el
+++ b/style/fbox.el
@@ -1,4 +1,4 @@
-;;; fbox.el --- AUCTeX style for `fbox.sty' (v0.04)
+;;; fbox.el --- AUCTeX style for `fbox.sty' (v0.04)  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 2019--2020 Free Software Foundation, Inc.
 
@@ -29,6 +29,10 @@
 ;; This file adds support for `fbox.sty' (v0.04) from 2020/01/03.
 ;; `fbox.sty' is part of TeXLive.
 
+;;; Code
+
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -49,6 +53,6 @@
      (font-latex-add-keywords '(("fbox"    "*[{")
                                ("fparbox" "*[{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; fbox.el ends here
diff --git a/style/filecontents.el b/style/filecontents.el
index 639e1f4..cb4ac56 100644
--- a/style/filecontents.el
+++ b/style/filecontents.el
@@ -1,6 +1,6 @@
-;;; filecontents.el --- AUCTeX style for `filecontents.sty'
+;;; filecontents.el --- AUCTeX style for `filecontents.sty'  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2013--2016 Free Software Foundation, Inc.
+;; Copyright (C) 2013--2016, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -33,6 +33,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "filecontents"
  (lambda ()
@@ -45,7 +48,7 @@
                '("filecontents" current-indentation) t)
    (add-to-list 'LaTeX-indent-environment-list
                '("filecontents*" current-indentation) t))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-env-filecontents (environment)
   "Insert ENVIRONMENT with filename for contents."
diff --git a/style/flashcards.el b/style/flashcards.el
index 4dab852..0df4cbf 100644
--- a/style/flashcards.el
+++ b/style/flashcards.el
@@ -1,6 +1,6 @@
-;;; flashcards.el --- AUCTeX style for the flashcards class.
+;;; flashcards.el --- AUCTeX style for the flashcards class.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2007, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -61,6 +64,6 @@
                                ("cardfrontheadstyle" "[{")
                                ("cardfrontfootstyle" "[{"))
                              'variable)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; flashcards.el ends here
diff --git a/style/floatrow.el b/style/floatrow.el
index 57f58c7..6523f71 100644
--- a/style/floatrow.el
+++ b/style/floatrow.el
@@ -1,6 +1,6 @@
-;;; floatrow.el --- AUCTeX style for `floatrow.sty' (v0.3b)
+;;; floatrow.el --- AUCTeX style for `floatrow.sty' (v0.3b)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2017--2019 Free Software Foundation, Inc.
+;; Copyright (C) 2017--2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -349,21 +349,21 @@ If OPTIONAL is non-nil, indicate optional argument during 
query."
   ;; `TeX-argument-insert':
   (let* ((TeX-arg-opening-brace "[")
         (TeX-arg-closing-brace "]")
-        (last-optional-rejected nil)
+        (TeX-last-optional-rejected nil)
         (width (LaTeX-check-insert-macro-default-style
                 (completing-read
                  (TeX-argument-prompt t nil "Width")
                  (mapcar (lambda (x) (concat TeX-esc (car x)))
                          (LaTeX-length-list)))))
-        (last-optional-rejected (or (not width)
-                                    (and width (string= width ""))))
+        (TeX-last-optional-rejected (or (not width)
+                                        (and width (string= width ""))))
         (height (LaTeX-check-insert-macro-default-style
                  (completing-read
                   (TeX-argument-prompt t nil "Height")
                   (mapcar (lambda (x) (concat TeX-esc (car x)))
                           (LaTeX-length-list)))))
-        (last-optional-rejected (or (not height)
-                                    (and height (string= height ""))))
+        (TeX-last-optional-rejected (or (not height)
+                                        (and height (string= height ""))))
         (vertpos (LaTeX-check-insert-macro-default-style
                   (if (string= height "")
                       ""
@@ -557,10 +557,10 @@ only the parsed items."
     ;; \floatbox[<preamble>]{<captype>}[<width>][<height>][<vert 
pos>]{<caption>}{<object>}
     '("floatbox"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Preamble")
+                    (TeX-argument-prompt t nil "Preamble")
                     '("\\capbeside" "\\nocapbeside" "\\captop") ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Float type")
+                   (TeX-argument-prompt nil nil "Float type")
                    LaTeX-floatrow-supported-float-types)
       LaTeX-floatrow-arg-floatbox)
 
@@ -569,22 +569,22 @@ only the parsed items."
       (TeX-arg-eval
        (lambda ()
         (let ((cmd (TeX-read-string
-                    (TeX-argument-prompt optional nil "Command"))))
+                    (TeX-argument-prompt nil nil "Command"))))
           (LaTeX-add-floatrow-newfloatcommands cmd)
           (TeX-add-symbols
            `(,cmd LaTeX-floatrow-arg-floatbox))
           (format "%s" cmd))))
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Float type")
+                   (TeX-argument-prompt nil nil "Float type")
                    '("figure" "table"))
       [ 2 ])
 
     '("renewfloatcommand"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Command")
+                   (TeX-argument-prompt nil nil "Command")
                    (LaTeX-floatrow-newfloatcommand-list))
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Float type")
+                   (TeX-argument-prompt nil nil "Float type")
                    '("figure" "table"))
       [ 2 ])
 
@@ -609,7 +609,7 @@ only the parsed items."
     ;; 3 Float Layout Settings
     '("floatsetup"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Float type")
+                    (TeX-argument-prompt t nil "Float type")
                     LaTeX-floatrow-supported-float-types ]
       (TeX-arg-key-val LaTeX-floatrow-key-val-options-local))
 
@@ -620,7 +620,7 @@ only the parsed items."
     ;; 3.3 Clearing of Settings for Current Float Type
     '("clearfloatsetup"
       (TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Float type")
+                    (TeX-argument-prompt nil nil "Float type")
                     LaTeX-floatrow-supported-float-types))
 
     ;; 3.4 Temporary Clearing of All Float Settings
@@ -739,7 +739,7 @@ only the parsed items."
                                ("DeclareNewFloatType"       "{{")
                                ("RawFloats"                 ""))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-floatrow-package-options nil
   "Prompt for package options for the floatrow package.")
diff --git a/style/foils.el b/style/foils.el
index 299e3af..15b940c 100644
--- a/style/foils.el
+++ b/style/foils.el
@@ -1,6 +1,6 @@
-;;; foils.el - Special code for FoilTeX.
+;;; foils.el - Special code for FoilTeX.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1994-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Maintainer: auctex-devel@gnu.org
@@ -23,6 +23,8 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
 (require 'timezone)
 
 (TeX-add-style-hook "foils"
@@ -33,7 +35,7 @@
     (setq LaTeX-default-options '("landscape"))
     (TeX-add-symbols
      '("foilhead" [ "Rubric-body separation" ] "Foil rubric"))))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-style-foils nil
   "Prompt for and insert foiltex options."
diff --git a/style/fontaxes.el b/style/fontaxes.el
index 232dd18..1765dfc 100644
--- a/style/fontaxes.el
+++ b/style/fontaxes.el
@@ -1,4 +1,4 @@
-;;; fontaxes.el --- AUCTeX style for `fontaxes.sty' version v1.0d
+;;; fontaxes.el --- AUCTeX style for `fontaxes.sty' version v1.0d  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2014, 2018, 2020 Free Software Foundation, Inc.
 
@@ -34,6 +34,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -106,7 +108,7 @@
                               'type-command)
      (font-latex-add-keywords '(("figureversion"       "{"))
                               'variable)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-fontaxes-package-options nil
   "Package options for the fontaxes package.")
diff --git a/style/fontenc.el b/style/fontenc.el
index e84aa5a..6bb6132 100644
--- a/style/fontenc.el
+++ b/style/fontenc.el
@@ -1,6 +1,6 @@
-;;; fontenc.el --- AUCTeX style for `fontenc.sty' (v1.99g)
+;;; fontenc.el --- AUCTeX style for `fontenc.sty' (v1.99g)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (defvar LaTeX-fontenc-package-options-list
   '(;; 128+ glyph encodings (text)
     "OT1" "OT2" "OT3" "OT4" "OT6"
diff --git a/style/fontspec.el b/style/fontspec.el
index 44bc167..cd3cd40 100644
--- a/style/fontspec.el
+++ b/style/fontspec.el
@@ -1,4 +1,4 @@
-;;; fontspec.el --- AUCTeX style for `fontspec.sty' version 2.6a.
+;;; fontspec.el --- AUCTeX style for `fontspec.sty' version 2.6a.  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2013, 2017, 2018, 2020 Free Software Foundation, Inc.
 
@@ -34,6 +34,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -41,6 +44,7 @@
 
 (declare-function LaTeX-color-definecolor-list "color" ())
 (declare-function LaTeX-xcolor-definecolor-list "xcolor" ())
+(declare-function TeX-check-engine-add-engines "tex-buf" (&rest engines))
 
 (defvar LaTeX-fontspec-font-features
   '(;; 5 Font selection
@@ -332,13 +336,13 @@ to retrieve the list of fonts."
     ;; 23 Defining new features
     '("newAATfeature"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Existing feature")
+                   (TeX-argument-prompt nil nil "Existing feature")
                    LaTeX-fontspec-font-features-local)
       "New option" 2)
 
     '("newopentypefeature"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Existing feature")
+                   (TeX-argument-prompt nil nil "Existing feature")
                    LaTeX-fontspec-font-features-local)
       "New option" t)
 
@@ -351,7 +355,7 @@ to retrieve the list of fonts."
     ;; 26 Renaming existing features & options
     '("aliasfontfeature"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Existing feature")
+                   (TeX-argument-prompt nil nil "Existing feature")
                    LaTeX-fontspec-font-features-local)
       "New name")
 
@@ -359,12 +363,12 @@ to retrieve the list of fonts."
       (TeX-arg-eval
        (lambda ()
         (let* ((key (completing-read
-                     (TeX-argument-prompt optional nil "Feature")
+                     (TeX-argument-prompt nil nil "Feature")
                      LaTeX-fontspec-font-features-local))
                (val (completing-read
-                     (TeX-argument-prompt optional nil "Existing name")
+                     (TeX-argument-prompt nil nil "Existing name")
                      (cadr (assoc key LaTeX-fontspec-font-features-local)))))
-          (TeX-argument-insert key optional)
+          (TeX-argument-insert key nil)
           (format "%s" val))))
       "New name") )
 
@@ -402,7 +406,7 @@ to retrieve the list of fonts."
                              'type-command)
      (font-latex-add-keywords '(("strong"    "{"))
                              'bold-command)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-fontspec-package-options
   '("tuenc" "euenc" "math" "no-math" "config" "no-config" "quiet" "silent")
diff --git a/style/footmisc.el b/style/footmisc.el
index ebe80f8..49ce381 100644
--- a/style/footmisc.el
+++ b/style/footmisc.el
@@ -1,6 +1,6 @@
-;;; footmisc.el --- AUCTeX style for `footmisc.sty'
+;;; footmisc.el --- AUCTeX style for `footmisc.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2011, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2011, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Created: 2011-04-08
@@ -29,6 +29,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -66,7 +68,7 @@
                                 ("DefineFNsymbolsTM*" "{{")
                                ("setfnsymbol" "{")) 'function)
      (font-latex-add-keywords '(("footnoteref")) 'reference)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-footmisc-package-options '("perpage" "side" "ragged"
                                          "para" "symbol" "symbol*"
diff --git a/style/framed.el b/style/framed.el
index 91fa0a5..03160ba 100644
--- a/style/framed.el
+++ b/style/framed.el
@@ -1,6 +1,6 @@
-;;; framed.el --- AUCTeX style for `framed.sty' (v0.96)
+;;; framed.el --- AUCTeX style for `framed.sty' (v0.96)  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2016 Free Software Foundation, Inc.
+;; Copyright (C) 2016, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "framed"
  (lambda ()
@@ -44,7 +47,7 @@
     '("snugshade*")
     '("leftbar")
     '("titled-frame" "Title")))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-framed-package-options nil
   "Package options for the framed package.")
diff --git a/style/francais.el b/style/francais.el
index 1723b59..53da6f3 100644
--- a/style/francais.el
+++ b/style/francais.el
@@ -1,6 +1,6 @@
-;;; francais.el --- AUCTeX style for the `francais' babel option.
+;;; francais.el --- AUCTeX style for the `francais' babel option.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -33,10 +33,12 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "francais"
  (lambda ()
    (TeX-run-style-hooks "frenchb"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; francais.el ends here
diff --git a/style/french.el b/style/french.el
index 7aefe3d..f664f83 100644
--- a/style/french.el
+++ b/style/french.el
@@ -1,6 +1,6 @@
-;;; french.el --- AUCTeX style for the `french' babel option.
+;;; french.el --- AUCTeX style for the `french' babel option.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2010, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,13 +29,15 @@
 ;; Set up AUCTeX for editing French text in connection with the
 ;; `french' babel option.  The file basically loads the style file for
 ;; the `frenchb' babel option.
-;; 
+;;
 ;; Support for the FrenchPro package by Bernard Gaulle is _not_
 ;; included.  If the presence of FrenchPro is detected, the `frenchb'
 ;; support is not loaded.
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "french"
  (lambda ()
@@ -44,6 +46,6 @@
              (not (member "frenchle" TeX-active-styles))
              (not (member "mlp" TeX-active-styles)))
      (TeX-run-style-hooks "frenchb")))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; french.el ends here
diff --git a/style/frenchb.el b/style/frenchb.el
index 71ef1f4..a59432d 100644
--- a/style/frenchb.el
+++ b/style/frenchb.el
@@ -1,6 +1,6 @@
-;;; frenchb.el --- AUCTeX style for the `frenchb' babel option.
+;;; frenchb.el --- AUCTeX style for the `frenchb' babel option.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -38,6 +38,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "frenchb"
  (lambda ()
@@ -52,20 +54,20 @@
     "ieme"
     "iemes"
     '("bsc" t)
-     "primo"
-     "secundo"
-     "tertio"
-     "quarto"
-     "No"
-     "no"
-     "degre"
-     "degres"
-     "DecimalMathComma"
-     "StandardMathComma"
-     '("nombre" "Nombre")
-     "ThinSpaceInFrenchNumbers"
-     "FrenchLayout"
-     "StandardLayout")
+    "primo"
+    "secundo"
+    "tertio"
+    "quarto"
+    "No"
+    "no"
+    "degre"
+    "degres"
+    "DecimalMathComma"
+    "StandardMathComma"
+    '("nombre" "Nombre")
+    "ThinSpaceInFrenchNumbers"
+    "FrenchLayout"
+    "StandardLayout")
    (unless (eq (car TeX-quote-language) 'override)
      (setq TeX-quote-language
           `("french" "\\og "
@@ -74,6 +76,6 @@
                       (unless (member "xspace" TeX-active-styles) "{}")))
             ,TeX-quote-after-quote)))
    (run-hooks 'TeX-language-fr-hook))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; frenchb.el ends here
diff --git a/style/fvextra.el b/style/fvextra.el
index 77b7d90..71a4ab8 100644
--- a/style/fvextra.el
+++ b/style/fvextra.el
@@ -1,6 +1,6 @@
-;;; fvextra.el --- AUCTeX style for `fvextra.sty' (v1.4)
+;;; fvextra.el --- AUCTeX style for `fvextra.sty' (v1.4)  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2017, 2019 Free Software Foundation, Inc.
+;; Copyright (C) 2017--2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Needed for compiling `cl-pushnew':
 (eval-when-compile
   (require 'cl-lib))
@@ -187,7 +190,7 @@
                              'function)
      (font-latex-add-keywords '(("EscVerb"     "*["))
                              'textual)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-fvextra-package-options nil
   "Package options for the fvextra package.")
diff --git a/style/geometry.el b/style/geometry.el
index 3022418..7a2fb49 100644
--- a/style/geometry.el
+++ b/style/geometry.el
@@ -1,6 +1,6 @@
-;;; geometry.el --- AUCTeX style for `geometry.sty' (v5.6)
+;;; geometry.el --- AUCTeX style for `geometry.sty' (v5.6)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -85,9 +88,6 @@
     ("mag") ("truedimen") ("pass") ("showframe") ("showcrop"))
   "Key=value options allowed only in the preamble for geometry macros.")
 
-;; Needed for auto-parsing.
-(require 'tex)
-
 ;; Setup for \savegeometry:
 (TeX-auto-add-type "geometry-savegeometry" "LaTeX" "geometry-savegeometries")
 
@@ -148,7 +148,7 @@ package.")
    (if (and (LaTeX-provided-package-options-member "geometry" "dvipdfmx")
            (not (eq TeX-engine 'xetex)))
        (setq TeX-PDF-from-DVI "Dvipdfmx")))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-geometry-package-options ()
   "Prompt for package options for the geometry package."
diff --git a/style/german.el b/style/german.el
index 688e5bf..74df22b 100644
--- a/style/german.el
+++ b/style/german.el
@@ -1,4 +1,4 @@
-;;; german.el --- Setup AUCTeX for editing German text.
+;;; german.el --- Setup AUCTeX for editing German text.  -*- lexical-binding: 
t; -*-
 
 ;;; Commentary:
 ;;
@@ -8,6 +8,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-quotes
                  "font-latex"
@@ -54,6 +57,6 @@
      ;; Prevent "| from leading to color bleed.
      (font-latex-add-to-syntax-alist (list (cons ?\" "\\"))))
    (run-hooks 'TeX-language-de-hook))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; german.el ends here
diff --git a/style/gloss-italian.el b/style/gloss-italian.el
index dd3ec07..6c328b9 100644
--- a/style/gloss-italian.el
+++ b/style/gloss-italian.el
@@ -1,6 +1,6 @@
-;;; gloss-italian.el --- Italian support for polyglossia package.
+;;; gloss-italian.el --- Italian support for polyglossia package.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <mose@gnu.org>
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-quotes
                  "font-latex"
@@ -67,7 +70,7 @@
      (when (fboundp 'font-latex-add-quotes)
        (font-latex-add-quotes '("\"<" "\">" french))))
    (run-hooks 'TeX-language-it-hook))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-polyglossia-italian-options-list
   '(("babelshorthands" ("true" "false")))
diff --git a/style/graphics.el b/style/graphics.el
index b74cd4d..4cdd31c 100644
--- a/style/graphics.el
+++ b/style/graphics.el
@@ -1,10 +1,13 @@
-;;; graphics.el --- Handle graphical commands in LaTeX 2e.
+;;; graphics.el --- Handle graphical commands in LaTeX 2e.  -*- 
lexical-binding: t; -*-
 
 ;;; Code:
 
 ;; Load "graphicx" explicitly to access `LaTeX-graphicx-package-options'
 ;; before running style hook "graphics".  This is necessary to have
 ;; support for completion of package options of "usepackage".
+
+(require 'tex)
+
 (TeX-load-style "graphicx")
 (defvar LaTeX-graphics-package-options LaTeX-graphicx-package-options)
 
@@ -12,6 +15,6 @@
  (function
   (lambda ()
     (TeX-run-style-hooks "graphicx")))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; graphics.el ends here.
diff --git a/style/graphicx.el b/style/graphicx.el
index c27cfac..42087bf 100644
--- a/style/graphicx.el
+++ b/style/graphicx.el
@@ -1,6 +1,6 @@
-;;; graphicx.el --- AUCTeX style file for graphicx.sty
+;;; graphicx.el --- AUCTeX style file for graphicx.sty  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2000, 2004, 2005, 2014--2018 by Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2004, 2005, 2014--2020 by Free Software Foundation, Inc.
 
 ;; Author: Ryuichi Arafune <arafune@debian.org>
 ;; Created: 1999/3/20
@@ -28,10 +28,14 @@
 ;; Acknowledgements
 ;;  Dr. Thomas Baumann <thomas.baumann@ch.tum.de>
 ;;  David Kastrup <David.Kastrup@t-online.de>
-;;  Masayuki Akata <ataka@milk.freemail.ne.jp>
+;;  Masayuki Ataka <masayuki.ataka@gmail.com>
 
 ;;; Code:
 
+(require 'crm)
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -171,7 +175,7 @@ Optional argument LIST if non-nil is used as list of 
regexps of
 extensions to be matched."
   (unless list
     (setq list (LaTeX-includegraphics-extensions-list)))
-  (concat "\\." (mapconcat #'identity list "$\\|\\.") "$"))
+  (concat "\\." (mapconcat #'identity list "\\'\\|\\.") "\\'"))
 
 (defvar LaTeX-includegraphics-global-files nil
   "List of the non-local graphic files to include in LaTeX documents.
@@ -213,21 +217,16 @@ subdirectories and inserts the relative file name.  See
          (string-match (LaTeX-includegraphics-extensions) fname))))
    (TeX-master-directory)))
 
-(defun LaTeX-arg-includegraphics (_prefix)
+(defun LaTeX-arg-includegraphics (optional)
   "Ask for mandantory argument for the \\includegraphics command."
-  (let* ((image-file (funcall LaTeX-includegraphics-read-file)))
-    (TeX-insert-braces 0)
-    (insert
+  (let ((image-file (funcall LaTeX-includegraphics-read-file)))
+    (TeX-argument-insert
      (if LaTeX-includegraphics-strip-extension-flag
-        ;; We don't have `replace-regexp-in-string' in all (X)Emacs versions:
-        (with-temp-buffer
-          (insert image-file)
-          (goto-char (point-max))
-          (when (search-backward-regexp (LaTeX-includegraphics-extensions)
-                                        nil t 1)
-            (replace-match ""))
-          (buffer-string))
-       image-file))))
+        (replace-regexp-in-string (LaTeX-includegraphics-extensions)
+                                  ""
+                                  image-file)
+       image-file)
+     optional)))
 
 (TeX-add-style-hook
  "graphicx"
@@ -237,13 +236,13 @@ subdirectories and inserts the relative file name.  See
 
     '("resizebox"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Width")
+                   (TeX-argument-prompt nil nil "Width")
                    (append '("\\width" "!")
                            (mapcar
                             (lambda (x) (concat TeX-esc (car x)))
                             (LaTeX-length-list))))
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Height")
+                   (TeX-argument-prompt nil nil "Height")
                    (append '("\\height" "\\totalheight" "\\depth" "!")
                            (mapcar
                             (lambda (x) (concat TeX-esc (car x)))
@@ -252,13 +251,13 @@ subdirectories and inserts the relative file name.  See
 
     '("resizebox*"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Width")
+                   (TeX-argument-prompt nil nil "Width")
                    (append '("\\width" "!")
                            (mapcar
                             (lambda (x) (concat TeX-esc (car x)))
                             (LaTeX-length-list))))
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Height")
+                   (TeX-argument-prompt nil nil "Height")
                    (append '("\\height" "\\totalheight" "\\depth" "!")
                            (mapcar
                             (lambda (x) (concat TeX-esc (car x)))
@@ -267,19 +266,19 @@ subdirectories and inserts the relative file name.  See
 
     '("rotatebox" (TeX-arg-conditional (member "graphics" (TeX-style-list))
                                       ()
-                                    ([ TeX-arg-key-val (("x") ("y") ("origin") 
("units")) ]))
+                                      ([ TeX-arg-key-val (("x") ("y") 
("origin") ("units")) ]))
       "Angle" "Argument")
 
     '("scalebox" "Horizontal scale" [ "Vertical scale" ] "Argument")
 
     '("includegraphics" (TeX-arg-conditional (member "graphics" 
(TeX-style-list))
                                             (["llx,lly"] ["urx,ury"])
-                                          ([ 
LaTeX-arg-graphicx-includegraphics-key-val ]))
+                                            ([ 
LaTeX-arg-graphicx-includegraphics-key-val ]))
       LaTeX-arg-includegraphics)
 
     '("includegraphics*" (TeX-arg-conditional (member "graphics" 
(TeX-style-list))
                                              (["llx,lly"] ["urx,ury"])
-                                           ([ 
LaTeX-arg-graphicx-includegraphics-key-val ]))
+                                             ([ 
LaTeX-arg-graphicx-includegraphics-key-val ]))
       LaTeX-arg-includegraphics)
 
     '("graphicspath" t)
@@ -307,7 +306,7 @@ subdirectories and inserts the relative file name.  See
    (if (and (LaTeX-provided-package-options-member "graphicx" "dvipdfmx")
            (not (eq TeX-engine 'xetex)))
        (setq TeX-PDF-from-DVI "Dvipdfmx")))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-graphicx-package-options
   '("draft"       "final"         "debugshow"
diff --git a/style/harvard.el b/style/harvard.el
index 9a97e71..fdd3233 100644
--- a/style/harvard.el
+++ b/style/harvard.el
@@ -1,6 +1,6 @@
-;;; harvard.el --- Support for Harvard Citation style package for AUCTeX.
+;;; harvard.el --- Support for Harvard Citation style package for AUCTeX.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1994, 1997, 2005, 2012, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1997, 2005, 2012, 2014, 2020 Free Software Foundation, 
Inc.
 
 ;; Author: Berwin Turlach <statba@nus.edu.sg>
 ;; Maintainer: auctex-devel@gnu.org
@@ -25,88 +25,91 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "harvard"
- #'(lambda ()
-
-     (LaTeX-add-environments
-      '("thebibliography" LaTeX-env-harvardbib ignore))
-
-     (TeX-add-symbols
-      "harvardand"
-      '("citeasnoun"
-       (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
-       TeX-arg-cite)
-      '("possessivecite"
-       (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
-       TeX-arg-cite)
-      '("citeaffixed"
-       (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
-       TeX-arg-cite "Affix")
-      '("citeyear"
-       (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
-       TeX-arg-cite)
-      '("citename"
-       (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
-       TeX-arg-cite)
-      '("citationstyle"
-       (TeX-arg-eval completing-read "Citation style: " '(("agsm") ("dcu"))))
-      '("citationmode"
-       (TeX-arg-eval completing-read "Citation mode: "
-                     '(("full") ("abbr") ("default"))))
-      '("harvardparenthesis"
-       (TeX-arg-eval completing-read "Harvardparenthesis: "
-                     '(("round") ("curly") ("angle") ("square"))))
-      '("bibliographystyle"
-       (TeX-arg-eval
-        completing-read "Bibliography style: "
-        '(("agsm") ("apsr") ("dcu") ("jmr") ("jphysicsB") ("kluwer") 
("nederlands") ("econometrica")))
-       ignore)
-      '("harvarditem" [ "Short citation" ]
-       "Complete citation" "Year" TeX-arg-define-cite))
-
-     (setq TeX-complete-list
-          (append '(("\\\\citeasnoun\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)"
-                     1 LaTeX-bibitem-list "}")
-                    ("\\\\citeasnoun{\\([^{}\n\r\\%,]*\\)" 1
-                     LaTeX-bibitem-list "}")
-                    
("\\\\possessivecite\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)"
-                     1 LaTeX-bibitem-list "}")
-                    ("\\\\possessivecite{\\([^{}\n\r\\%,]*\\)" 1
-                     LaTeX-bibitem-list "}")
-                    ("\\\\citename\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)"
-                     1 LaTeX-bibitem-list "}")
-                    ("\\\\citename{\\([^{}\n\r\\%,]*\\)" 1
-                     LaTeX-bibitem-list "}")
-                    ("\\\\citeaffixed\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)"
-                     1 LaTeX-bibitem-list "}")
-                    ("\\\\citeaffixed{\\([^{}\n\r\\%,]*\\)" 1
-                     LaTeX-bibitem-list "}")
-                    ("\\\\citeaffixed{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)"
-                     2 LaTeX-bibitem-list)
-                    ("\\\\citeyear\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)"
-                     1 LaTeX-bibitem-list "}")
-                    ("\\\\citeyear{\\([^{}\n\r\\%,]*\\)" 1
-                     LaTeX-bibitem-list "}")
-                    ("\\\\citeyear{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)"
-                     2 LaTeX-bibitem-list))
-                  TeX-complete-list))
-
-     (setq LaTeX-auto-regexp-list
-          (append '(("\\\\harvarditem{\\([a-zA-Z][^%#'()={}]*\\)}{\\([0-9][^, 
%\"#'()={}]*\\)}{\\([a-zA-Z][^, %\"#'()={}]*\\)}" 3 LaTeX-auto-bibitem)
-                    
("\\\\harvarditem\\[[^][\n\r]+\\]{\\([a-zA-Z][^%#'()={}]*\\)}{\\([0-9][^, 
%\"#'()={}]*\\)}{\\([a-zA-Z][^, %\"#'()={}]*\\)}" 3 LaTeX-auto-bibitem)
-                    )
-                  LaTeX-auto-regexp-list))
-
-     (setq LaTeX-item-list
-          (cons '("thebibliography" . LaTeX-item-harvardbib)
-                LaTeX-item-list))
-
-     ;; Tell RefTeX
-     (when (and LaTeX-reftex-cite-format-auto-activate
-               (fboundp 'reftex-set-cite-format))
-       (reftex-set-cite-format 'harvard)))
- LaTeX-dialect)
+ (lambda ()
+
+   (LaTeX-add-environments
+    '("thebibliography" LaTeX-env-harvardbib ignore))
+
+   (TeX-add-symbols
+    "harvardand"
+    '("citeasnoun"
+      (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
+      TeX-arg-cite)
+    '("possessivecite"
+      (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
+      TeX-arg-cite)
+    '("citeaffixed"
+      (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
+      TeX-arg-cite "Affix")
+    '("citeyear"
+      (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
+      TeX-arg-cite)
+    '("citename"
+      (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
+      TeX-arg-cite)
+    '("citationstyle"
+      (TeX-arg-eval completing-read "Citation style: " '(("agsm") ("dcu"))))
+    '("citationmode"
+      (TeX-arg-eval completing-read "Citation mode: "
+                   '(("full") ("abbr") ("default"))))
+    '("harvardparenthesis"
+      (TeX-arg-eval completing-read "Harvardparenthesis: "
+                   '(("round") ("curly") ("angle") ("square"))))
+    '("bibliographystyle"
+      (TeX-arg-eval
+       completing-read "Bibliography style: "
+       '(("agsm") ("apsr") ("dcu") ("jmr") ("jphysicsB") ("kluwer") 
("nederlands") ("econometrica")))
+      ignore)
+    '("harvarditem" [ "Short citation" ]
+      "Complete citation" "Year" TeX-arg-define-cite))
+
+   (setq TeX-complete-list
+        (append '(("\\\\citeasnoun\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)"
+                   1 LaTeX-bibitem-list "}")
+                  ("\\\\citeasnoun{\\([^{}\n\r\\%,]*\\)" 1
+                   LaTeX-bibitem-list "}")
+                  ("\\\\possessivecite\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)"
+                   1 LaTeX-bibitem-list "}")
+                  ("\\\\possessivecite{\\([^{}\n\r\\%,]*\\)" 1
+                   LaTeX-bibitem-list "}")
+                  ("\\\\citename\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)"
+                   1 LaTeX-bibitem-list "}")
+                  ("\\\\citename{\\([^{}\n\r\\%,]*\\)" 1
+                   LaTeX-bibitem-list "}")
+                  ("\\\\citeaffixed\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)"
+                   1 LaTeX-bibitem-list "}")
+                  ("\\\\citeaffixed{\\([^{}\n\r\\%,]*\\)" 1
+                   LaTeX-bibitem-list "}")
+                  ("\\\\citeaffixed{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)"
+                   2 LaTeX-bibitem-list)
+                  ("\\\\citeyear\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)"
+                   1 LaTeX-bibitem-list "}")
+                  ("\\\\citeyear{\\([^{}\n\r\\%,]*\\)" 1
+                   LaTeX-bibitem-list "}")
+                  ("\\\\citeyear{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)"
+                   2 LaTeX-bibitem-list))
+                TeX-complete-list))
+
+   (setq LaTeX-auto-regexp-list
+        (append '(("\\\\harvarditem{\\([a-zA-Z][^%#'()={}]*\\)}{\\([0-9][^, 
%\"#'()={}]*\\)}{\\([a-zA-Z][^, %\"#'()={}]*\\)}" 3 LaTeX-auto-bibitem)
+                  
("\\\\harvarditem\\[[^][\n\r]+\\]{\\([a-zA-Z][^%#'()={}]*\\)}{\\([0-9][^, 
%\"#'()={}]*\\)}{\\([a-zA-Z][^, %\"#'()={}]*\\)}" 3 LaTeX-auto-bibitem)
+                  )
+                LaTeX-auto-regexp-list))
+
+   (setq LaTeX-item-list
+        (cons '("thebibliography" . LaTeX-item-harvardbib)
+              LaTeX-item-list))
+
+   ;; Tell RefTeX
+   (when (and LaTeX-reftex-cite-format-auto-activate
+             (fboundp 'reftex-set-cite-format))
+     (reftex-set-cite-format 'harvard)))
+ TeX-dialect)
 
 (defun LaTeX-env-harvardbib (environment &optional _ignore)
   "Insert ENVIRONMENT with label for harvarditem."
diff --git a/style/hologo.el b/style/hologo.el
index 61bcb4e..d1cbdbe 100644
--- a/style/hologo.el
+++ b/style/hologo.el
@@ -1,6 +1,6 @@
-;;; hologo.el --- AUCTeX style for `hologo.sty' (v1.10)
+;;; hologo.el --- AUCTeX style for `hologo.sty' (v1.10)  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -140,7 +142,7 @@
                                        LaTeX-hologo-key-val-options-global))
                               (t
                                LaTeX-hologo-key-val-options-global)))))
-          (TeX-argument-insert logo optional)
+          (TeX-argument-insert logo nil)
           (format "%s" keyval)))))
 
     '("hologoDriverSetup" (TeX-arg-eval completing-read
@@ -184,7 +186,7 @@
                                '(("logo")))
                               (t
                                nil)))))
-          (TeX-argument-insert logo optional)
+          (TeX-argument-insert logo nil)
           (format "%s" keyval)))))
 
     ;; Additional user macros
@@ -230,7 +232,7 @@
                                ("hologoList"          "")
                                ("hologoEntry"         "{{{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-hologo-package-options nil
   "Package options for the hologo package.")
diff --git a/style/hyperref.el b/style/hyperref.el
index e412120..b2dfa0a 100644
--- a/style/hyperref.el
+++ b/style/hyperref.el
@@ -1,4 +1,4 @@
-;;; hyperref.el --- AUCTeX style for `hyperref.sty' v6.83m
+;;; hyperref.el --- AUCTeX style for `hyperref.sty' v6.83m  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2008, 2013-2020 Free Software Foundation, Inc.
 
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -326,7 +329,7 @@
    (and LaTeX-reftex-ref-style-auto-activate
        (fboundp 'reftex-ref-style-activate)
        (reftex-ref-style-activate "Hyperref")))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-hyperref-package-options ()
   "Read the hyperref package options from the user."
diff --git a/style/icelandic.el b/style/icelandic.el
index b7efd3b..622b00a 100644
--- a/style/icelandic.el
+++ b/style/icelandic.el
@@ -1,6 +1,6 @@
-;;; icelandic.el --- AUCTeX style for the `icelandic' babel option.
+;;; icelandic.el --- AUCTeX style for the `icelandic' babel option.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2007, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-quotes
                  "font-latex"
@@ -54,6 +57,6 @@
      (font-latex-add-quotes '("\"`" "\"'"))
      (font-latex-add-quotes '("\"<" "\">" french)))
    (run-hooks 'TeX-language-is-hook))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; icelandic.el ends here
diff --git a/style/ifluatex.el b/style/ifluatex.el
index 246bc22..3986fdd 100644
--- a/style/ifluatex.el
+++ b/style/ifluatex.el
@@ -1,4 +1,4 @@
-;;; ifluatex.el --- AUCTeX style for `ifluatex.sty' version 1.3.
+;;; ifluatex.el --- AUCTeX style for `ifluatex.sty' version 1.3.  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2014, 2016, 2018, 2020 Free Software Foundation, Inc.
 
@@ -29,40 +29,43 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'tex-buf)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
                  (keywords class))
 
-(defun LaTeX-ifluatex-set-exit-mark (_optional)
-  "Discard OPTIONAL and set exit-mark to current point."
-  (set-marker exit-mark (point)))
+(defun LaTeX-ifluatex-set-TeX-exit-mark (_optional)
+  "Discard OPTIONAL and set `TeX-exit-mark' to current point."
+  (set-marker TeX-exit-mark (point)))
 
 (TeX-add-style-hook
+ "ifluatex"
+ (lambda ()
+   (TeX-add-symbols
+    '("ifluatex"
+      (TeX-arg-literal "%\n")
+      LaTeX-ifluatex-set-TeX-exit-mark
+      (TeX-arg-literal "\n\\else%\n\\fi%"))
+    '("luatexversion" 0)
+    '("luatexrevision" 0))
+   (TeX-declare-expert-macros
     "ifluatex"
-  (lambda ()
-    (TeX-add-symbols
-     '("ifluatex"
-       (TeX-arg-literal "%\n")
-       LaTeX-ifluatex-set-exit-mark
-       (TeX-arg-literal "\n\\else%\n\\fi%"))
-     '("luatexversion" 0)
-     '("luatexrevision" 0))
-    (TeX-declare-expert-macros
-     "ifluatex"
-     "ifluatex" "luatexversion" "luatexrevision")
-
-    ;; This package is used to make it possible to compile a document with both
-    ;; LuaTeX and base TeX engines.  By setting `TeX-check-engine-list' to nil
-    ;; we ignore engine restrictions posed by other packages.
-    (setq TeX-check-engine-list nil)
-
-    (when (and (featurep 'font-latex)
-              (eq TeX-install-font-lock 'font-latex-setup))
-      (font-latex-add-keywords '(("luatexversion")
-                                ("luatexrevision"))
-                              'function)))
-  LaTeX-dialect)
+    "ifluatex" "luatexversion" "luatexrevision")
+
+   ;; This package is used to make it possible to compile a document with both
+   ;; LuaTeX and base TeX engines.  By setting `TeX-check-engine-list' to nil
+   ;; we ignore engine restrictions posed by other packages.
+   (setq TeX-check-engine-list nil)
+
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("luatexversion")
+                               ("luatexrevision"))
+                             'function)))
+ TeX-dialect)
 
 (defvar LaTeX-ifluatex-package-options nil
   "Package options for the ifluatex package.")
diff --git a/style/imakeidx.el b/style/imakeidx.el
index d361cbd..f14cfeb 100644
--- a/style/imakeidx.el
+++ b/style/imakeidx.el
@@ -1,6 +1,6 @@
-;;; imakeidx.el --- AUCTeX style for `imakeidx.sty'.
+;;; imakeidx.el --- AUCTeX style for `imakeidx.sty'.  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2012-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2013, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <giordano.mose@libero.it>
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-imakeidx-makeindex-options
   '(("name")
     ("title")
@@ -90,7 +93,7 @@
          TeX-complete-list))
    (and (fboundp 'reftex-add-index-macros)
        (reftex-add-index-macros '(default))))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-imakeidx-package-options
   '("makeindex" "xindy" "texindy" "truexindy" "noautomatic" "nonewpage" "quiet"
diff --git a/style/index.el b/style/index.el
index 66e52da..d541341 100644
--- a/style/index.el
+++ b/style/index.el
@@ -1,6 +1,6 @@
-;;; index.el --- AUCTeX support for indices with index.sty.
+;;; index.el --- AUCTeX support for indices with index.sty.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2020 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@strw.leidenuniv.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -24,59 +24,62 @@
 
 ;;; Code:
 
-(TeX-add-style-hook "index"
-  (lambda ()
-
-    (TeX-add-symbols
-
-     ;; New indices
-     '("newindex" [ "Counter" ] "Tag"
-       "Extension of raw index" "Extension of processed index" "Index title")
-     '("renewindex" [ "Counter" ] "Tag" 
-       "Extension of raw index" "Extension of processed index" "Index title")
-     "makeindex"
-     '("disableindex" "Tag[,tag...]")
-
-     ;; Printing the index
-     '("printindex" [ "Indextag" ] [ "Prologue" ])
-     "indexspace"
-
-     ;; Index entries
-     '("index" [ TeX-arg-index-tag ] TeX-arg-index)
-     '("index*" [ TeX-arg-index-tag ] TeX-arg-index)
-
-     ;; Showidx-like stuff
-     "proofmodetrue" "proofmodefalse" '("indexproofstyle" "Style")
-
-     ;; Shortcuts (THESE ARE DEPRECATED AND SHOULD NOT BE USED
-     "shortindexingon" "shortindexinoff")
-
-    ;; Parsing index macros
-    (setq LaTeX-auto-regexp-list
-         (append
-
-          ;; The first regexp is faster, but less accurate
-          ;;'(("\\\\index\\*?\\[[^{}]*\\]{\\([^}]*\\)"
-          ;;   1 LaTeX-auto-index-entry))
-
-          ;; The second regexp is very good, but slower.
-          
'(("\\\\index\\*?\\[[^{}]*\\]{\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*}[^}{]*\\)*}[^}{]*\\)*\\)}"
-             1 LaTeX-auto-index-entry))
-
-          LaTeX-auto-regexp-list))
-
-    ;; Completion for the index entries in \index and |see commands
-    (setq TeX-complete-list
-         (append
-          '(("\\\\index\\*?\\(\\[[^][{}]*\\]\\)?{\\([^{}\n\r]*\\)" 
-             2 LaTeX-index-entry-list)
-            ("|see{\\([^}]*\\)" 1 LaTeX-index-entry-list))
-          TeX-complete-list))
-
-    ;; RefTeX support
-    (and (fboundp 'reftex-add-index-macros)
-        (reftex-add-index-macros '(index))))
-  LaTeX-dialect)
+(require 'tex)
+(require 'latex)
+
+(TeX-add-style-hook
+ "index"
+ (lambda ()
+
+   (TeX-add-symbols
+    ;; New indices
+    '("newindex" [ "Counter" ] "Tag"
+      "Extension of raw index" "Extension of processed index" "Index title")
+    '("renewindex" [ "Counter" ] "Tag"
+      "Extension of raw index" "Extension of processed index" "Index title")
+    "makeindex"
+    '("disableindex" "Tag[,tag...]")
+
+    ;; Printing the index
+    '("printindex" [ "Indextag" ] [ "Prologue" ])
+    "indexspace"
+
+    ;; Index entries
+    '("index" [ TeX-arg-index-tag ] TeX-arg-index)
+    '("index*" [ TeX-arg-index-tag ] TeX-arg-index)
+
+    ;; Showidx-like stuff
+    "proofmodetrue" "proofmodefalse" '("indexproofstyle" "Style")
+
+    ;; Shortcuts (THESE ARE DEPRECATED AND SHOULD NOT BE USED
+    "shortindexingon" "shortindexinoff")
+
+   ;; Parsing index macros
+   (setq LaTeX-auto-regexp-list
+        (append
+
+         ;; The first regexp is faster, but less accurate
+         ;;'(("\\\\index\\*?\\[[^{}]*\\]{\\([^}]*\\)"
+         ;;   1 LaTeX-auto-index-entry))
+
+         ;; The second regexp is very good, but slower.
+         
'(("\\\\index\\*?\\[[^{}]*\\]{\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*}[^}{]*\\)*}[^}{]*\\)*\\)}"
+            1 LaTeX-auto-index-entry))
+
+         LaTeX-auto-regexp-list))
+
+   ;; Completion for the index entries in \index and |see commands
+   (setq TeX-complete-list
+        (append
+         '(("\\\\index\\*?\\(\\[[^][{}]*\\]\\)?{\\([^{}\n\r]*\\)" 
+            2 LaTeX-index-entry-list)
+           ("|see{\\([^}]*\\)" 1 LaTeX-index-entry-list))
+         TeX-complete-list))
+
+   ;; RefTeX support
+   (and (fboundp 'reftex-add-index-macros)
+       (reftex-add-index-macros '(index))))
+ TeX-dialect)
 
 (defvar LaTeX-index-package-options nil
   "Package options for the index package.")
diff --git a/style/inputenc.el b/style/inputenc.el
index 42a99e3..613f2dc 100644
--- a/style/inputenc.el
+++ b/style/inputenc.el
@@ -1,6 +1,6 @@
-;;; inputenc.el --- AUCTeX style for `inputenc.sty'
+;;; inputenc.el --- AUCTeX style for `inputenc.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2005, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arne Jørgensen <arne@arnested.dk>
 ;; Keywords: tex
@@ -28,6 +28,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (defun LaTeX-inputenc-package-options nil
   "Prompt for package options for the inputenc package."
   ;; separate the condition in three to silence the byte compiler
@@ -78,7 +80,7 @@
    ;; New symbols
    (TeX-add-symbols
     '("inputencoding" LaTeX-arg-inputenc-inputenc)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;; Local Variables:
 ;; coding: utf-8
diff --git a/style/italian.el b/style/italian.el
index 8a69c65..6a6a996 100644
--- a/style/italian.el
+++ b/style/italian.el
@@ -1,6 +1,6 @@
-;;; italian.el --- Setup AUCTeX for editing Italian text.
+;;; italian.el --- Setup AUCTeX for editing Italian text.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2004, 2005, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Davide G. M. Salvetti <salve@debian.org>
 ;; Maintainer: Davide G. M. Salvetti <salve@debian.org>
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-quotes
                  "font-latex"
@@ -60,6 +62,6 @@
    (when (fboundp 'font-latex-add-quotes)
      (font-latex-add-quotes '("\"<" "\">" french)))
    (run-hooks 'TeX-language-it-hook))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; italian.el ends here
diff --git a/style/j-article.el b/style/j-article.el
index 5a26de5..44571f3 100644
--- a/style/j-article.el
+++ b/style/j-article.el
@@ -1,11 +1,14 @@
-;;; j-article.el - Special code for j-article style.
+;;; j-article.el - Special code for j-article style.  -*- lexical-binding: t; 
-*-
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "j-article"
  (lambda ()
    (LaTeX-largest-level-set "section"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; j-article.el ends here
diff --git a/style/j-book.el b/style/j-book.el
index 1df4bb0..1aeda40 100644
--- a/style/j-book.el
+++ b/style/j-book.el
@@ -1,11 +1,14 @@
-;;; j-book.el - Special code for j-book style.
+;;; j-book.el - Special code for j-book style.  -*- lexical-binding: t; -*-
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "j-book"
  (lambda ()
    (LaTeX-largest-level-set "part"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; j-book.el ends here
diff --git a/style/j-report.el b/style/j-report.el
index 07dfcb5..969b4f7 100644
--- a/style/j-report.el
+++ b/style/j-report.el
@@ -1,11 +1,14 @@
-;;; j-report.el - Special code for j-report style.
+;;; j-report.el - Special code for j-report style.  -*- lexical-binding: t; -*-
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "j-report"
  (lambda ()
    (LaTeX-largest-level-set "chapter"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; j-report.el ends here
diff --git a/style/jarticle.el b/style/jarticle.el
index f62bc02..16f897d 100644
--- a/style/jarticle.el
+++ b/style/jarticle.el
@@ -1,7 +1,10 @@
-;;; jarticle.el - Special code for jarticle class.
+;;; jarticle.el - Special code for jarticle class.  -*- lexical-binding: t; -*-
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-jarticle-class-options
   '("a4paper" "a5paper" "b4paper" "b5paper" "a4j" "a5j" "b4j" "b5j"
     "a4p" "b4p" "b5p" "10pt" "11pt" "12pt" "landscape" "tombow" "tombo"
@@ -18,6 +21,6 @@
                       "subparagraph" "figure" "table")
    (LaTeX-add-pagestyles "headings" "myheadings")
    (LaTeX-add-environments "abstract"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; jarticle.el ends here
diff --git a/style/jbook.el b/style/jbook.el
index bdb3dad..831aa9a 100644
--- a/style/jbook.el
+++ b/style/jbook.el
@@ -1,7 +1,10 @@
-;;; jbook.el - Special code for jbook class.
+;;; jbook.el - Special code for jbook class.  -*- lexical-binding: t; -*-
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-jbook-class-options
   '("a4paper" "a5paper" "b4paper" "b5paper" "a4j" "a5j" "b4j" "b5j"
     "a4p" "b4p" "b5p" "10pt" "11pt" "12pt" "landscape" "tombow" "tombo"
@@ -17,6 +20,6 @@
    (LaTeX-add-counters "part" "chapter" "section" "subsection" "subsubsection"
                       "paragraph" "subparagraph" "figure" "table")
    (LaTeX-add-pagestyles "headings" "myheadings"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; jbook.el ends here
diff --git a/style/jreport.el b/style/jreport.el
index 77aac32..9f8a333 100644
--- a/style/jreport.el
+++ b/style/jreport.el
@@ -1,7 +1,10 @@
-;;; jreport.el - Special code for jreport class.
+;;; jreport.el - Special code for jreport class.  -*- lexical-binding: t; -*-
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-jreport-class-options
   '("a4paper" "a5paper" "b4paper" "b5paper" "a4j" "a5j" "b4j" "b5j"
     "a4p" "b4p" "b5p" "10pt" "11pt" "12pt" "landscape" "tombow" "tombo"
@@ -18,6 +21,6 @@
                       "paragraph" "subparagraph" "figure" "table")
    (LaTeX-add-pagestyles "headings" "myheadings")
    (LaTeX-add-environments "abstract"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; jreport.el ends here
diff --git a/style/jsarticle.el b/style/jsarticle.el
index d951cef..7a3aac7 100644
--- a/style/jsarticle.el
+++ b/style/jsarticle.el
@@ -1,7 +1,10 @@
-;;; jsarticle.el - Special code for jsarticle class.
+;;; jsarticle.el - Special code for jsarticle class.  -*- lexical-binding: t; 
-*-
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-jsarticle-class-options
   '("a3paper" "a4paper" "a5paper" "a6paper" "b4paper" "b5paper" "b6paper"
     "a4j" "a5j" "b4j" "b5j" "a4var" "b5var" "letterpaper" "legalpaper"
@@ -22,6 +25,6 @@
                       "subparagraph" "figure" "table")
    (LaTeX-add-pagestyles "headings" "myheadings")
    (LaTeX-add-environments "abstract"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; jsarticle.el ends here
diff --git a/style/jsbook.el b/style/jsbook.el
index 350e8af..28530fb 100644
--- a/style/jsbook.el
+++ b/style/jsbook.el
@@ -1,7 +1,10 @@
-;;; jsbook.el - Special code for jsbook class.
+;;; jsbook.el - Special code for jsbook class.  -*- lexical-binding: t; -*-
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-jsbook-class-options
   '("a3paper" "a4paper" "a5paper" "a6paper" "b4paper" "b5paper" "b6paper"
     "a4j" "a5j" "b4j" "b5j" "a4var" "b5var" "letterpaper" "legalpaper"
@@ -26,6 +29,6 @@
    (LaTeX-add-counters "part" "chapter" "section" "subsection" "subsubsection"
                       "paragraph" "subparagraph" "figure" "table")
    (LaTeX-add-pagestyles "headings" "myheadings"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; jsbook.el ends here
diff --git a/style/jsreport.el b/style/jsreport.el
index 4603647..0c05c20 100644
--- a/style/jsreport.el
+++ b/style/jsreport.el
@@ -1,6 +1,6 @@
-;;; jsreport.el - Special code for jsreport class.
+;;; jsreport.el - Special code for jsreport class.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2017 Free Software Foundation, Inc.
+;; Copyright (C) 2017, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ikumi Keita <ikumi@ikumi.que.jp>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-jsreport-class-options
   '("a3paper" "a4paper" "a5paper" "a6paper" "b4paper" "b5paper" "b6paper"
     "a4j" "a5j" "b4j" "b5j" "a4var" "b5var" "letterpaper" "legalpaper"
@@ -51,6 +54,6 @@
                       "paragraph" "subparagraph" "figure" "table")
    (LaTeX-add-pagestyles "headings" "myheadings")
    (LaTeX-add-environments "abstract"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; jsreport.el ends here
diff --git a/style/jura.el b/style/jura.el
index 236f2ce..920db7f 100644
--- a/style/jura.el
+++ b/style/jura.el
@@ -1,6 +1,6 @@
-;;; jura.el --- AUCTeX style for `jura.cls'
+;;; jura.el --- AUCTeX style for `jura.cls'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2020 Free Software Foundation, Inc.
 
 ;; Author: Frank Küster <frank@kuesterei.ch>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,11 +29,13 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "jura"
  (lambda ()
    (TeX-run-style-hooks "alphanum"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;; Local Variables:
 ;; coding: utf-8
diff --git a/style/jurabib.el b/style/jurabib.el
index 077af4a..64e4ee3 100644
--- a/style/jurabib.el
+++ b/style/jurabib.el
@@ -1,6 +1,6 @@
-;;; jurabib.el --- AUCTeX style for the `jurabib' package
+;;; jurabib.el --- AUCTeX style for the `jurabib' package  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2004, 2007, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2007, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -35,6 +35,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'tex-style)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -636,6 +639,6 @@
     "volname"
     "volumename"
     "volumeofname"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; jurabib.el ends here
diff --git a/style/kantlipsum.el b/style/kantlipsum.el
index cdf510f..ce33062 100644
--- a/style/kantlipsum.el
+++ b/style/kantlipsum.el
@@ -1,6 +1,6 @@
-;;; kantlipsum.el --- AUCTeX style for `kantlipsum.sty'.
+;;; kantlipsum.el --- AUCTeX style for `kantlipsum.sty'.  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2013 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <giordano.mose@libero.it>
@@ -29,6 +29,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "kantlipsum"
  (lambda ()
@@ -37,7 +39,7 @@
     '("kant*" [ "Range of paragraph (max: 164)" ])
     '("kantdef" TeX-arg-define-macro "Paragraph number"))
    (TeX-run-style-hooks "xparse"))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-kantlipsum-package-options
   '("par" "nopar" "numbers" "index")
diff --git a/style/kpfonts.el b/style/kpfonts.el
index 4938416..22e0d60 100644
--- a/style/kpfonts.el
+++ b/style/kpfonts.el
@@ -1,4 +1,4 @@
-;;; kpfonts.el --- AUCTeX style for `kpfonts.sty' version 3.31.
+;;; kpfonts.el --- AUCTeX style for `kpfonts.sty' version 3.31.  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2013, 2018, 2020 Free Software Foundation, Inc.
 
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -579,7 +582,7 @@ following commands are defined:
      (font-latex-add-keywords '(("scslshape")
                                ("otherscslshape"))
                              'italic-declaration)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-kpfonts-package-options
   '(;; Main global options
diff --git a/style/latexinfo.el b/style/latexinfo.el
index bbe6e6c..b79ef38 100644
--- a/style/latexinfo.el
+++ b/style/latexinfo.el
@@ -1,6 +1,6 @@
-;;; latexinfo.el - Support for LaTeXinfo files.
+;;; latexinfo.el - Support for LaTeXinfo files.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1993 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 2020 Free Software Foundation, Inc.
 
 ;; Author: Marc Gemis <makke@wins.uia.ac.be>
 
@@ -21,6 +21,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;;; LaTeXinfo mode
 
 (defvar TeX-latexinfo-node-regexp
@@ -177,6 +180,6 @@ This fails when the user types in the label of something 
else"
     ;; need the following stuff to let xref and pxref work
     (make-local-variable 'LaTeX-section-label)
     (setq LaTeX-section-label "")))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; latexinfo.el ends here
diff --git a/style/letter.el b/style/letter.el
index e2cc8be..a76a9d1 100644
--- a/style/letter.el
+++ b/style/letter.el
@@ -1,4 +1,4 @@
-;;; letter.el - Special code for letter style.
+;;; letter.el - Special code for letter style.  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1993, 2012, 2013, 2014, 2018, 2020 Free Software Foundation, 
Inc.
 
@@ -25,6 +25,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -86,7 +89,7 @@
                                ("encl" "{")
                                ("ps" "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-env-recipient (environment)
   "Insert ENVIRONMENT and prompt for recipient and address."
diff --git a/style/lettrine.el b/style/lettrine.el
index 9b3c60e..a342793 100644
--- a/style/lettrine.el
+++ b/style/lettrine.el
@@ -1,6 +1,6 @@
-;;; lettrine.el --- AUCTeX style for `lettrine.sty' (v2.21)
+;;; lettrine.el --- AUCTeX style for `lettrine.sty' (v2.21)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2011, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2011, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -87,7 +90,7 @@
    (when (and (fboundp 'font-latex-add-keywords)
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("lettrine" "[{{")) 'textual)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-lettrine-package-options nil
   "Package options for the lettrine package.")
diff --git a/style/lipsum.el b/style/lipsum.el
index e198480..7378bc7 100644
--- a/style/lipsum.el
+++ b/style/lipsum.el
@@ -1,6 +1,6 @@
-;;; lipsum.el --- AUCTeX style for `lipsum.sty'.
+;;; lipsum.el --- AUCTeX style for `lipsum.sty'.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2013 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <giordano.mose@libero.it>
@@ -29,6 +29,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "lipsum"
  (lambda ()
@@ -37,7 +39,7 @@
     '("lipsum*" [ "Range of paragraph (max: 150)" ])
     '("setlipsumdefault" [ "Default range of paragraph (max: 150)" ])
     '("ChangeLipsumPar" 0)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-lipsum-package-options
   '("nopar")
diff --git a/style/listings.el b/style/listings.el
index f4ae693..c5012b1 100644
--- a/style/listings.el
+++ b/style/listings.el
@@ -1,4 +1,4 @@
-;;; listings.el --- AUCTeX style for `listings.sty'
+;;; listings.el --- AUCTeX style for `listings.sty'  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 2004, 2005, 2009, 2013-2020 Free Software Foundation, Inc.
 
@@ -459,7 +459,7 @@ caption key is found, an error is issued."
                                ("lstdefinestyle" "{{")
                                ("lstset" "{"))
                              'variable)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-listings-package-options '("draft" "final" "savemem"
                                         "noaspects"
diff --git a/style/longtable.el b/style/longtable.el
index 0c6b881..27b6195 100644
--- a/style/longtable.el
+++ b/style/longtable.el
@@ -1,6 +1,6 @@
-;;; longtable.el --- AUCTeX style for `longtable.sty'.
+;;; longtable.el --- AUCTeX style for `longtable.sty'.  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2013--2018  Free Software Foundation, Inc.
+;; Copyright (C) 2013--2020  Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <mose@gnu.org>
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -129,7 +132,7 @@ insert line break macro."
      ;; to fontify correctly also the standard `\caption[]{}' macro.
      (font-latex-add-keywords '(("caption" "*[{"))
                              'textual)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;; `longtable.sty' has two options "errorshow" and "pausing", both for
 ;; debugging purposes.  We ignore them both in order to make package
diff --git a/style/lscape.el b/style/lscape.el
index 8079c63..e60cc17 100644
--- a/style/lscape.el
+++ b/style/lscape.el
@@ -1,6 +1,6 @@
-;;; lscape.el --- AUCTeX style for `lscape.sty'
+;;; lscape.el --- AUCTeX style for `lscape.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2011, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "lscape"
  (lambda ()
@@ -37,7 +40,7 @@
     "landscape")
    ;; lscape uses graphics internally to handle the work
    (TeX-run-style-hooks "graphics"))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-lscape-package-options '("pdftex")
   "Package options for the lscape package.")
diff --git a/style/ltablex.el b/style/ltablex.el
index 29a21b5..1a6c014 100644
--- a/style/ltablex.el
+++ b/style/ltablex.el
@@ -1,6 +1,6 @@
-;;; ltablex.el --- AUCTeX style for `ltablex.sty' (v1.1)
+;;; ltablex.el --- AUCTeX style for `ltablex.sty' (v1.1)  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -34,6 +34,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "ltablex"
  (lambda ()
@@ -41,7 +43,7 @@
    (TeX-add-symbols
     '("keepXColumns" 0)
     '("convertXColumns" 0)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-ltablex-package-options nil
   "Package options for the ltablex package.")
diff --git a/style/ltugboat.el b/style/ltugboat.el
index 5521487..3499d6d 100644
--- a/style/ltugboat.el
+++ b/style/ltugboat.el
@@ -1,6 +1,6 @@
-;;; ltugboat.el --- AUCTeX style for `ltugboat.cls' (v2.22)
+;;; ltugboat.el --- AUCTeX style for `ltugboat.cls' (v2.22)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019 Free Software Foundation, Inc.
+;; Copyright (C) 2019, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,10 @@
 
 ;;; Code:
 
+(require 'crm)
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -238,12 +242,12 @@
     ;; 10.2 Other special typesetting
     '("Dash" 0)
     '("cs" (TeX-arg-eval let ((macro (completing-read
-                                     (TeX-argument-prompt optional nil
+                                     (TeX-argument-prompt nil nil
                                                           "Command")
                                      (TeX-symbol-list))))
                         (format "%s" macro)))
     '("env" (TeX-arg-eval let ((env (completing-read
-                                    (TeX-argument-prompt optional nil
+                                    (TeX-argument-prompt nil nil
                                                          "Environment")
                                     (LaTeX-environment-list))))
                          (format "%s" env)))
@@ -254,7 +258,7 @@
     ;; 12 Bibliography
     '("SetBibJustification"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Justification")
+                   (TeX-argument-prompt nil nil "Justification")
                    '("\\raggedright"  "\\sloppy"))))
 
    ;; Fontification
@@ -278,7 +282,7 @@
                              'function)
      (font-latex-add-keywords '(("nameref" "{"))
                              'reference)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-ltugboat-class-options
   '("draft" "final" "preprint"
diff --git a/style/ltx-base.el b/style/ltx-base.el
index 1237afb..20b79b6 100644
--- a/style/ltx-base.el
+++ b/style/ltx-base.el
@@ -1,6 +1,6 @@
-;;; ltx-base.el --- AUCTeX style for basic LaTeX commands.
+;;; ltx-base.el --- AUCTeX style for basic LaTeX commands.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2004, 2016 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2016, 2020 Free Software Foundation, Inc.
 
 ;; Author: Frank Küster <frank@kuesterei.ch>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,56 +31,57 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "ltx-base"
- (function
-  (lambda ()
-    (TeX-add-symbols
-     '("DeclareRobustCommand" TeX-arg-define-macro [ "Number of arguments" ] t)
-     '("CheckCommand" TeX-arg-define-macro [ "Number of arguments" ] t)
-     '("@addtoreset" TeX-arg-counter "Within counter" "counter")
-     '("addvspace" "space")
-     '("addpenalty" "penalty")
-     '("ProvidesClass" "name" [ "release information" ])
-     '("ProvidesPackage" "name" [ "release information" ])
-     '("ProvidesFile" "filename" [ "release information" ])
-     '("NeedsTeXFormat" "format" [ "release" ])
-     '("DeclareOption" "option" t)
-     ;; would be great if DeclareOption RET * RET would give
-     ;; \DeclareOption*!
-     '("DeclareOption*" t)
-     '("CurrentOption" 0)
-     '("PassOptionsToPackage" "option list" "package")
-     '("ExecuteOptions" "option list")
-     '("ProcessOptions" (TeX-arg-literal "\\relax"))
-     "ProcessOptions*"
-     '("OptionNotUsed" 0)
-      ;; candidate for opt/mand toggling
-     '("RequirePackage" [ "option list" ] "package" [ "release" ])
-     '("LoadClass" [ "option list" ] "class" [ "release" ])
-     '("AtEndOfPackage" t)
-     '("AtEndOfClass" t)
-     '("AtBeginDocument" t)
-     '("AtEndDocument" t)
-     '("IfFileExists" "filename" 2)
-     '("InputIfFileExists" "filename" 2)
-     '("PackageWarning" "name" t)
-     '("PackageWarningNoLine" "name" t)
-     '("PackageInfo" "name" t)
-     '("PackageError" "name" "short text" t)
-     '("ClassWarning" "name" t)
-     '("ClassWarningNoLine" "name" t)
-     '("ClassInfo" "name" t)
-     '("ClassError" "name" "short text" t)
-     '("MessageBreak" 0)
-     '("@ifpackageloaded" "package" 2)
-     '("@ifpackagelater" "package" "date" 2)
-     '("@ifpackagewith" "package" "options" 2)
-     '("message" "Log Message")
-     '("@ifundefined" "Macro Name" 2)
-     '("@ifnextchar" (TeX-arg-literal " ") (TeX-arg-free "character") 2 )
-     "expandafter")))
- LaTeX-dialect)
+ (lambda ()
+   (TeX-add-symbols
+    '("DeclareRobustCommand" TeX-arg-define-macro [ "Number of arguments" ] t)
+    '("CheckCommand" TeX-arg-define-macro [ "Number of arguments" ] t)
+    '("@addtoreset" TeX-arg-counter "Within counter" "counter")
+    '("addvspace" "space")
+    '("addpenalty" "penalty")
+    '("ProvidesClass" "name" [ "release information" ])
+    '("ProvidesPackage" "name" [ "release information" ])
+    '("ProvidesFile" "filename" [ "release information" ])
+    '("NeedsTeXFormat" "format" [ "release" ])
+    '("DeclareOption" "option" t)
+    ;; would be great if DeclareOption RET * RET would give
+    ;; \DeclareOption*!
+    '("DeclareOption*" t)
+    '("CurrentOption" 0)
+    '("PassOptionsToPackage" "option list" "package")
+    '("ExecuteOptions" "option list")
+    '("ProcessOptions" (TeX-arg-literal "\\relax"))
+    "ProcessOptions*"
+    '("OptionNotUsed" 0)
+    ;; candidate for opt/mand toggling
+    '("RequirePackage" [ "option list" ] "package" [ "release" ])
+    '("LoadClass" [ "option list" ] "class" [ "release" ])
+    '("AtEndOfPackage" t)
+    '("AtEndOfClass" t)
+    '("AtBeginDocument" t)
+    '("AtEndDocument" t)
+    '("IfFileExists" "filename" 2)
+    '("InputIfFileExists" "filename" 2)
+    '("PackageWarning" "name" t)
+    '("PackageWarningNoLine" "name" t)
+    '("PackageInfo" "name" t)
+    '("PackageError" "name" "short text" t)
+    '("ClassWarning" "name" t)
+    '("ClassWarningNoLine" "name" t)
+    '("ClassInfo" "name" t)
+    '("ClassError" "name" "short text" t)
+    '("MessageBreak" 0)
+    '("@ifpackageloaded" "package" 2)
+    '("@ifpackagelater" "package" "date" 2)
+    '("@ifpackagewith" "package" "options" 2)
+    '("message" "Log Message")
+    '("@ifundefined" "Macro Name" 2)
+    '("@ifnextchar" (TeX-arg-literal " ") (TeX-arg-free "character") 2 )
+    "expandafter"))
+ TeX-dialect)
 
 ;; Local Variables:
 ;; coding: utf-8
diff --git a/style/ltxdoc.el b/style/ltxdoc.el
index c645a8b..8c8bbc5 100644
--- a/style/ltxdoc.el
+++ b/style/ltxdoc.el
@@ -1,6 +1,6 @@
-;;; ltxdoc.el --- AUCTeX style for `ltxdoc.cls'
+;;; ltxdoc.el --- AUCTeX style for `ltxdoc.cls'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2020 Free Software Foundation, Inc.
 
 ;; Author: Frank Küster <frank@kuesterei.ch>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,12 +29,14 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "ltxdoc"
  (lambda ()
    (TeX-run-style-hooks "doc")
    (TeX-run-style-hooks "ltx-base"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;; Local Variables:
 ;; coding: utf-8
diff --git a/style/ltxguide.el b/style/ltxguide.el
index 8145f6e..8c4bdbd 100644
--- a/style/ltxguide.el
+++ b/style/ltxguide.el
@@ -1,4 +1,4 @@
-;;; ltxguide.el --- AUCTeX style for `ltxguide.cls' (2001/05/28)
+;;; ltxguide.el --- AUCTeX style for `ltxguide.cls' (2001/05/28)  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2020 Free Software Foundation, Inc.
 
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -110,7 +113,7 @@ For decl environment provided by ltxguide.cls."
                              'textual)
      (font-latex-add-keywords '(("URL" ""))
                              'reference)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-ltxguide-class-options
   (progn
diff --git a/style/ltxtable.el b/style/ltxtable.el
index 233ffeb..5b3d49c 100644
--- a/style/ltxtable.el
+++ b/style/ltxtable.el
@@ -1,6 +1,6 @@
-;;; ltxtable.el --- AUCTeX style for `ltxtable.sty' (v0.2)
+;;; ltxtable.el --- AUCTeX style for `ltxtable.sty' (v0.2)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -84,7 +87,7 @@ The regexp for the 2. argument is the same as for \"input\" 
and
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("LTXtable"  "{{"))
                              'textual)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-ltxtable-package-options nil
   "Package options for the ltxtable package.")
diff --git a/style/luacode.el b/style/luacode.el
index 8632163..d544424 100644
--- a/style/luacode.el
+++ b/style/luacode.el
@@ -1,6 +1,6 @@
-;;; luacode.el --- AUCTeX style for `luacode.sty' version 1.2a.
+;;; luacode.el --- AUCTeX style for `luacode.sty' version 1.2a.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2013, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <giordano.mose@libero.it>
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -60,7 +63,7 @@
                                ("LuaCodeDebugOn")
                                ("LuaCodeDebugOff"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-luacode-package-options nil
   "Package options for the luacode package.")
diff --git a/style/luatextra.el b/style/luatextra.el
index 4286979..5ce6f11 100644
--- a/style/luatextra.el
+++ b/style/luatextra.el
@@ -1,6 +1,6 @@
-;;; luatextra.el --- AUCTeX style for `luatextra.sty' version 1.0.
+;;; luatextra.el --- AUCTeX style for `luatextra.sty' version 1.0.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Davide G. M. Salvetti <salve@debian.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,14 +29,16 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
-    "luatextra"
-  (lambda ()
-    (TeX-run-style-hooks "ifluatex" "fontspec"
-                        ;; FIXME: yet to be written:
-                        ;; "luatexbase"
-                        "metalogo" "luacode"))
-  LaTeX-dialect)
+ "luatextra"
+ (lambda ()
+   (TeX-run-style-hooks "ifluatex" "fontspec"
+                       ;; FIXME: yet to be written:
+                       ;; "luatexbase"
+                       "metalogo" "luacode"))
+ TeX-dialect)
 
 (defvar LaTeX-luatextra-package-options nil
   "Package options for the ifluatex package.")
diff --git a/style/makeidx.el b/style/makeidx.el
index b80ee47..f233cc0 100644
--- a/style/makeidx.el
+++ b/style/makeidx.el
@@ -1,6 +1,6 @@
-;;; makeidx.el --- AUCTeX support for makeidx.sty
+;;; makeidx.el --- AUCTeX support for makeidx.sty  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2020 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@strw.leidenuniv.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -24,24 +24,27 @@
 
 ;;; Code:
 
-(TeX-add-style-hook "makeidx"
-  (lambda ()
-    (TeX-add-symbols 
-     "printindex" "indexspace")
+(require 'tex)
 
-    ;; Parsing the default index macro is defined in latex.el
-    ;; The same is true form completion in the index macro
+(TeX-add-style-hook
+ "makeidx"
+ (lambda ()
+   (TeX-add-symbols
+    "printindex" "indexspace")
 
-    ;; Completion for the |see macro
-    (setq TeX-complete-list
-         (append
-          '(("|see{\\([^{}\n\r]*\\)" 1 LaTeX-index-entry-list))
-          TeX-complete-list))
+   ;; Parsing the default index macro is defined in latex.el
+   ;; The same is true form completion in the index macro
 
-    ;; RefTeX support
-    (and (fboundp 'reftex-add-index-macros)
-        (reftex-add-index-macros '(default))))
-  LaTeX-dialect)
+   ;; Completion for the |see macro
+   (setq TeX-complete-list
+        (append
+         '(("|see{\\([^{}\n\r]*\\)" 1 LaTeX-index-entry-list))
+         TeX-complete-list))
+
+   ;; RefTeX support
+   (and (fboundp 'reftex-add-index-macros)
+       (reftex-add-index-macros '(default))))
+ TeX-dialect)
 
 (defvar LaTeX-makeidx-package-options nil
   "Package options for the makeidx package.")
diff --git a/style/marginnote.el b/style/marginnote.el
index 9d3410e..d11927b 100644
--- a/style/marginnote.el
+++ b/style/marginnote.el
@@ -1,6 +1,6 @@
-;;; marginnote.el --- AUCTeX style for `marginnote.sty' (v1.4)
+;;; marginnote.el --- AUCTeX style for `marginnote.sty' (v1.4)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -59,7 +61,7 @@
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("marginnote"  "[{["))
                              'reference)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-marginnote-package-options
   '("fulladjust" "heightadjust" "depthadjust" "noadjust"
diff --git a/style/mathtools.el b/style/mathtools.el
index 5ee9c96..d4b266c 100644
--- a/style/mathtools.el
+++ b/style/mathtools.el
@@ -1,4 +1,4 @@
-;;; mathtools.el --- Style hook for the LaTeX package `mathtools'.
+;;; mathtools.el --- Style hook for the LaTeX package `mathtools'.  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
@@ -38,6 +38,7 @@
 
 ;; Needed for auto-parsing:
 (require 'tex)
+(require 'latex)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
@@ -486,6 +487,6 @@ Put line break macro on the last line.  Next, insert an 
ampersand."
      (font-latex-add-keywords '(("refeq"   "{")
                                ("noeqref" "{"))
                              'reference)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; mathtools.el ends here
diff --git a/style/mdframed.el b/style/mdframed.el
index ec5e73a..e4483e2 100644
--- a/style/mdframed.el
+++ b/style/mdframed.el
@@ -1,6 +1,6 @@
-;;; mdframed.el --- AUCTeX style for `mdframed.sty' (v1.9b)
+;;; mdframed.el --- AUCTeX style for `mdframed.sty' (v1.9b)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016--2018 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -37,13 +37,12 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
 ;; Needed for compiling `cl-pushnew':
 (eval-when-compile
   (require 'cl-lib))
 
-;; Needed for auto-parsing:
-(require 'tex)
-
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -302,7 +301,7 @@
       (TeX-arg-eval
        (lambda ()
         (let ((env (TeX-read-string
-                    (TeX-argument-prompt optional nil "Environment"))))
+                    (TeX-argument-prompt nil nil "Environment"))))
           (LaTeX-add-environments
            `(,env LaTeX-env-args [ TeX-arg-key-val 
LaTeX-mdframed-key-val-options-local ]))
           ;; Add new env's to `ispell-tex-skip-alist': skip the optional 
argument
@@ -312,7 +311,7 @@
     '("renewmdenv"
       [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Environment")
+                   (TeX-argument-prompt nil nil "Environment")
                    (LaTeX-mdframed-newmdenv-list)))
 
     '("surroundwithmdframed"
@@ -321,7 +320,7 @@
 
     '("mdflength"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Length")
+                   (TeX-argument-prompt nil nil "Length")
                    '(("skipabove")
                      ("skipbelow")
                      ("leftmargin")
@@ -340,7 +339,7 @@
       (TeX-arg-eval
        (lambda ()
         (let ((style (TeX-read-string
-                      (TeX-argument-prompt optional nil "Style name"))))
+                      (TeX-argument-prompt nil nil "Style name"))))
           (LaTeX-add-mdframed-mdfdefinestyles style)
           (LaTeX-mdframed-update-style-key)
           (format "%s" style))))
@@ -348,7 +347,7 @@
 
     '("mdfapptodefinestyle"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Style name")
+                   (TeX-argument-prompt nil nil "Style name")
                    (LaTeX-mdframed-mdfdefinestyle-list))
       (TeX-arg-key-val LaTeX-mdframed-key-val-options-local))
 
@@ -363,7 +362,7 @@
       (TeX-arg-eval
        (lambda ()
         (let ((nthm (TeX-read-string
-                     (TeX-argument-prompt optional nil "Environment"))))
+                     (TeX-argument-prompt nil nil "Environment"))))
           (LaTeX-add-environments (list nthm (vector "Heading")))
           (format "%s" nthm))))
       [ TeX-arg-environment "Numbered like" ]
@@ -379,7 +378,7 @@
       (TeX-arg-eval
        (lambda ()
         (let ((nthm (TeX-read-string
-                     (TeX-argument-prompt optional nil "Environment"))))
+                     (TeX-argument-prompt nil nil "Environment"))))
           (LaTeX-add-environments (list nthm (vector "Heading"))
                                   (list (concat nthm "*") (vector "Heading")))
           (format "%s" nthm))))
@@ -412,7 +411,7 @@
                              'sectioning-5)
      (font-latex-add-keywords '(("mdflength"            "{"))
                              'variable)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-mdframed-package-options-list
   '(("xcolor")
diff --git a/style/mdsymbol.el b/style/mdsymbol.el
index 6ca690b..d82f87e 100644
--- a/style/mdsymbol.el
+++ b/style/mdsymbol.el
@@ -1,6 +1,6 @@
-;;; mdsymbol.el --- AUCTeX style for `mdsymbol.sty' (v0.5)
+;;; mdsymbol.el --- AUCTeX style for `mdsymbol.sty' (v0.5)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -32,6 +32,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "mdsymbol"
  (lambda ()
@@ -80,7 +83,7 @@
       '("circledS")
       '("lambdabar")
       '("lambdaslash"))))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-mdsymbol-package-options
   '(;;
diff --git a/style/mdwlist.el b/style/mdwlist.el
index 13245a2..2c4b067 100644
--- a/style/mdwlist.el
+++ b/style/mdwlist.el
@@ -1,6 +1,6 @@
-;;; mdwlist.el --- AUCTeX style for `mdwlist.sty'
+;;; mdwlist.el --- AUCTeX style for `mdwlist.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2004, 2005, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Keywords: tex
@@ -28,6 +28,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -61,7 +64,7 @@
                                ("suspend" "[{")
                                ("resume" "[{["))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-mdwlist-package-options nil
   "Package options for the mdwlist package.")
diff --git a/style/memoir.el b/style/memoir.el
index 563adbe..7945bc0 100644
--- a/style/memoir.el
+++ b/style/memoir.el
@@ -1,6 +1,6 @@
-;;; memoir.el --- AUCTeX style for `memoir.cls'
+;;; memoir.el --- AUCTeX style for `memoir.cls'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2012 Free Software Foundation, Inc.
+;; Copyright (C) 2012, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -32,6 +32,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "memoir"
  (lambda ()
@@ -80,6 +83,6 @@
     "verbatim" "verse")
 
    (LaTeX-largest-level-set "chapter"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; memoir.el ends here
diff --git a/style/menukeys.el b/style/menukeys.el
index 8134b7c..7d68097 100644
--- a/style/menukeys.el
+++ b/style/menukeys.el
@@ -1,6 +1,6 @@
-;;; menukeys.el --- AUCTeX style for `menukeys.sty' (v1.4)
+;;; menukeys.el --- AUCTeX style for `menukeys.sty' (v1.4)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -33,6 +33,7 @@
 
 ;; Needed for auto-parsing:
 (require 'tex)
+(require 'latex)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
@@ -113,7 +114,7 @@ from the variable `TeX-symbol-list' before being re-added."
              (assq-delete-all (car (assoc macro (TeX-symbol-list))) 
TeX-symbol-list)))
       (TeX-add-symbols
        `(,macro [ TeX-arg-eval completing-read
-                              (TeX-argument-prompt optional nil
+                              (TeX-argument-prompt t nil
                                                    ,(concat "Input separator "
                                                             "(default "
                                                             (if (and sep (not 
(string= sep "")))
@@ -158,7 +159,7 @@ macro.  If RENEW is non-nil, query for an already defined 
macro."
            (assq-delete-all (car (assoc macro (TeX-symbol-list))) 
TeX-symbol-list)))
     (TeX-add-symbols
      `(,macro [ TeX-arg-eval completing-read
-                            (TeX-argument-prompt optional nil
+                            (TeX-argument-prompt t nil
                                                  ,(concat "Input separator "
                                                          "(default "
                                                          (if (and sep (not 
(string= sep "")))
@@ -197,19 +198,19 @@ macro.  If RENEW is non-nil, query for an already defined 
macro."
       ;; \keys      [<separator>]{keystrokes}
       '("menu"
        [ TeX-arg-eval completing-read
-                      (TeX-argument-prompt optional nil "Input separator")
+                      (TeX-argument-prompt t nil "Input separator")
                       LaTeX-menukeys-input-separators-list ]
        t)
 
       '("directory"
        [ TeX-arg-eval completing-read
-                      (TeX-argument-prompt optional nil "Input separator")
+                      (TeX-argument-prompt t nil "Input separator")
                       LaTeX-menukeys-input-separators-list ]
        t)
 
       '("keys"
        [ TeX-arg-eval completing-read
-                      (TeX-argument-prompt optional nil "Input separator")
+                      (TeX-argument-prompt t nil "Input separator")
                       LaTeX-menukeys-input-separators-list ]
        t)))
 
@@ -218,10 +219,10 @@ macro.  If RENEW is non-nil, query for an already defined 
macro."
     ;; \drawtikzfolder[<front fill>][<draw>]
     '("drawtikzfolder"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Front color")
+                    (TeX-argument-prompt t nil "Front color")
                     (LaTeX-xcolor-definecolor-list) ]
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Line color")
+                    (TeX-argument-prompt t nil "Line color")
                     (LaTeX-xcolor-definecolor-list) ] )
 
     ;; 4.2.2 Declaring styles
@@ -230,24 +231,24 @@ macro.  If RENEW is non-nil, query for an already defined 
macro."
       (TeX-arg-eval
        (lambda ()
         (let ((name (TeX-read-string
-                     (TeX-argument-prompt optional nil "Name"))))
+                     (TeX-argument-prompt nil nil "Name"))))
           (LaTeX-add-menukeys-newmenustyles name)
           (format "%s" name))))
       [ t ] nil [ nil ] [ nil ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Color theme")
+                   (TeX-argument-prompt nil nil "Color theme")
                    (LaTeX-menukeys-newmenucolortheme-list)))
 
     '("newmenustylesimple*"
       (TeX-arg-eval
        (lambda ()
         (let ((name (TeX-read-string
-                     (TeX-argument-prompt optional nil "Name"))))
+                     (TeX-argument-prompt nil nil "Name"))))
           (LaTeX-add-menukeys-newmenustyles name)
           (format "%s" name))))
       [ t ] nil [ nil ] [ nil ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Color theme")
+                   (TeX-argument-prompt nil nil "Color theme")
                    (LaTeX-menukeys-newmenucolortheme-list)))
 
     ;; 
\newmenustyle*{<name>}[<pre>]{<first>}[<sep>]{<mid>}{<last>}{<single>}[<post>]{<theme>}
@@ -255,24 +256,24 @@ macro.  If RENEW is non-nil, query for an already defined 
macro."
       (TeX-arg-eval
        (lambda ()
         (let ((name (TeX-read-string
-                     (TeX-argument-prompt optional nil "Name"))))
+                     (TeX-argument-prompt nil nil "Name"))))
           (LaTeX-add-menukeys-newmenustyles name)
           (format "%s" name))))
       [ t ] nil [ nil ] nil nil nil [ nil ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Color theme")
+                   (TeX-argument-prompt nil nil "Color theme")
                    (LaTeX-menukeys-newmenucolortheme-list)))
 
     '("newmenustyle*"
       (TeX-arg-eval
        (lambda ()
         (let ((name (TeX-read-string
-                     (TeX-argument-prompt optional nil "Name"))))
+                     (TeX-argument-prompt nil nil "Name"))))
           (LaTeX-add-menukeys-newmenustyles name)
           (format "%s" name))))
       [ t ] nil [ nil ] nil nil nil [ nil ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Color theme")
+                   (TeX-argument-prompt nil nil "Color theme")
                    (LaTeX-menukeys-newmenucolortheme-list)))
 
     '("CurrentMenuElement" 0)
@@ -282,70 +283,70 @@ macro.  If RENEW is non-nil, query for an already defined 
macro."
       (TeX-arg-eval
        (lambda ()
         (let ((copy (TeX-read-string
-                     (TeX-argument-prompt optional nil "Copy")))
+                     (TeX-argument-prompt nil nil "Copy")))
               (orig (completing-read
-                     (TeX-argument-prompt optional nil "Original")
+                     (TeX-argument-prompt nil nil "Original")
                      (LaTeX-menukeys-newmenustyle-list))))
           (LaTeX-add-menukeys-newmenustyles copy)
-          (TeX-argument-insert copy optional)
+          (TeX-argument-insert copy nil)
           (format "%s" orig)))))
 
     ;; 4.2.4 Changing styles
     ;; \changemenuelement*{name}{element}{definition}
     '("changemenuelement"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Name")
+                   (TeX-argument-prompt nil nil "Name")
                    (LaTeX-menukeys-newmenustyle-list))
       2)
 
     '("changemenuelement*"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Name")
+                   (TeX-argument-prompt nil nil "Name")
                    (LaTeX-menukeys-newmenustyle-list))
       2)
 
     ;; Same arguments as \newmenustylesimple
     '("renewmenustylesimple"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Name")
+                   (TeX-argument-prompt nil nil "Name")
                    (LaTeX-menukeys-newmenustyle-list))
       [ t ] nil [ nil ] [ nil ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Color theme")
+                   (TeX-argument-prompt nil nil "Color theme")
                    (LaTeX-menukeys-newmenucolortheme-list)))
 
     '("providemenustylesimple"
       (TeX-arg-eval
        (lambda ()
         (let ((name (TeX-read-string
-                     (TeX-argument-prompt optional nil "Name"))))
+                     (TeX-argument-prompt nil nil "Name"))))
           (LaTeX-add-menukeys-newmenustyles name)
           (format "%s" name))))
       [ t ] nil [ nil ] [ nil ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Color theme")
+                   (TeX-argument-prompt nil nil "Color theme")
                    (LaTeX-menukeys-newmenucolortheme-list)))
 
     ;; Same arguments as \newmenustyle
     '("providemenustyle"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Name")
+                   (TeX-argument-prompt nil nil "Name")
                    (LaTeX-menukeys-newmenustyle-list))
       [ t ] nil [ nil ] nil nil nil [ nil ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Color theme")
+                   (TeX-argument-prompt nil nil "Color theme")
                    (LaTeX-menukeys-newmenucolortheme-list)))
 
     '("renewmenustyle"
       (TeX-arg-eval
        (lambda ()
         (let ((name (TeX-read-string
-                     (TeX-argument-prompt optional nil "Name"))))
+                     (TeX-argument-prompt nil nil "Name"))))
           (LaTeX-add-menukeys-newmenustyles name)
           (format "%s" name))))
       [ t ] nil [ nil ] nil nil nil [ nil ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Color theme")
+                   (TeX-argument-prompt nil nil "Color theme")
                    (LaTeX-menukeys-newmenucolortheme-list)))
 
     ;; 4.3 Color themes
@@ -355,36 +356,36 @@ macro.  If RENEW is non-nil, query for an already defined 
macro."
       (TeX-arg-eval
        (lambda ()
         (let ((name (TeX-read-string
-                     (TeX-argument-prompt optional nil "Name"))))
+                     (TeX-argument-prompt nil nil "Name"))))
           (LaTeX-add-menukeys-newmenucolorthemes name)
           (format "%s" name))))
       (TeX-arg-eval
        (lambda ()
         (let ((model (completing-read
-                      (TeX-argument-prompt optional nil "Model")
+                      (TeX-argument-prompt nil nil "Model")
                       (LaTeX-xcolor-color-models))))
-          (TeX-argument-insert model optional)
+          (TeX-argument-insert model nil)
           (if (string= model "named")
               (let ((bg (completing-read
-                         (TeX-argument-prompt optional nil "Node background 
color")
+                         (TeX-argument-prompt nil nil "Node background color")
                          (LaTeX-xcolor-definecolor-list)))
                     (br (completing-read
-                         (TeX-argument-prompt optional nil "Node border color")
+                         (TeX-argument-prompt nil nil "Node border color")
                          (LaTeX-xcolor-definecolor-list)))
                     (txt (completing-read
-                          (TeX-argument-prompt optional nil "Node text color")
+                          (TeX-argument-prompt nil nil "Node text color")
                           (LaTeX-xcolor-definecolor-list))))
-                (TeX-argument-insert bg optional)
-                (TeX-argument-insert br optional)
+                (TeX-argument-insert bg nil)
+                (TeX-argument-insert br nil)
                 (format "%s" txt))
             (let ((bg (TeX-read-string
-                       (TeX-argument-prompt optional nil "Node background 
color spec")))
+                       (TeX-argument-prompt nil nil "Node background color 
spec")))
                   (br (TeX-read-string
-                       (TeX-argument-prompt optional nil "Node border color 
spec")))
+                       (TeX-argument-prompt nil nil "Node border color spec")))
                   (txt (TeX-read-string
-                        (TeX-argument-prompt optional nil "Node text color 
spec"))))
-              (TeX-argument-insert bg optional)
-              (TeX-argument-insert br optional)
+                        (TeX-argument-prompt nil nil "Node text color spec"))))
+              (TeX-argument-insert bg nil)
+              (TeX-argument-insert br nil)
               (format "%s" txt))))))
       (TeX-arg-conditional (y-or-n-p "With additional optional arguments? ")
                           ( [ 3 ] )
@@ -395,35 +396,35 @@ macro.  If RENEW is non-nil, query for an already defined 
macro."
       (TeX-arg-eval
        (lambda ()
         (let ((copy (TeX-read-string
-                     (TeX-argument-prompt optional nil "Copy")))
+                     (TeX-argument-prompt nil nil "Copy")))
               (orig (completing-read
-                     (TeX-argument-prompt optional nil "Original")
+                     (TeX-argument-prompt nil nil "Original")
                      (LaTeX-menukeys-newmenucolortheme-list))))
           (LaTeX-add-menukeys-newmenucolorthemes copy)
-          (TeX-argument-insert copy optional)
+          (TeX-argument-insert copy nil)
           (format "%s" orig)))))
 
     ;; 4.3.4 Change a theme
     '("changemenucolor"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Name")
+                   (TeX-argument-prompt nil nil "Name")
                    (LaTeX-menukeys-newmenucolortheme-list))
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Element")
+                   (TeX-argument-prompt nil nil "Element")
                    '("bg" "br" "txt"))
       (TeX-arg-eval
        (lambda ()
         (let ((model (completing-read
-                      (TeX-argument-prompt optional nil "Model")
+                      (TeX-argument-prompt nil nil "Model")
                       (LaTeX-xcolor-color-models))))
-          (TeX-argument-insert model optional)
+          (TeX-argument-insert model nil)
           (if (string= model "named")
               (let ((color (completing-read
-                            (TeX-argument-prompt optional nil "Color")
+                            (TeX-argument-prompt nil nil "Color")
                             (LaTeX-xcolor-definecolor-list))))
                 (format "%s" color))
             (let ((color (TeX-read-string
-                          (TeX-argument-prompt optional nil "Color spec"))))
+                          (TeX-argument-prompt nil nil "Color spec"))))
               (format "%s" color)))))))
 
     ;; Same arguments as \newmenucolortheme
@@ -431,36 +432,36 @@ macro.  If RENEW is non-nil, query for an already defined 
macro."
       (TeX-arg-eval
        (lambda ()
         (let ((name (TeX-read-string
-                     (TeX-argument-prompt optional nil "Name"))))
+                     (TeX-argument-prompt nil nil "Name"))))
           (LaTeX-add-menukeys-newmenucolorthemes name)
           (format "%s" name))))
       (TeX-arg-eval
        (lambda ()
         (let ((model (completing-read
-                      (TeX-argument-prompt optional nil "Model")
+                      (TeX-argument-prompt nil nil "Model")
                       (LaTeX-xcolor-color-models))))
-          (TeX-argument-insert model optional)
+          (TeX-argument-insert model nil)
           (if (string= model "named")
               (let ((bg (completing-read
-                         (TeX-argument-prompt optional nil "Node background 
color")
+                         (TeX-argument-prompt nil nil "Node background color")
                          (LaTeX-xcolor-definecolor-list)))
                     (br (completing-read
-                         (TeX-argument-prompt optional nil "Node border color")
+                         (TeX-argument-prompt nil nil "Node border color")
                          (LaTeX-xcolor-definecolor-list)))
                     (txt (completing-read
-                          (TeX-argument-prompt optional nil "Node text color")
+                          (TeX-argument-prompt nil nil "Node text color")
                           (LaTeX-xcolor-definecolor-list))))
-                (TeX-argument-insert bg optional)
-                (TeX-argument-insert br optional)
+                (TeX-argument-insert bg nil)
+                (TeX-argument-insert br nil)
                 (format "%s" txt))
             (let ((bg (TeX-read-string
-                       (TeX-argument-prompt optional nil "Node background 
color spec")))
+                       (TeX-argument-prompt nil nil "Node background color 
spec")))
                   (br (TeX-read-string
-                       (TeX-argument-prompt optional nil "Node border color 
spec")))
+                       (TeX-argument-prompt nil nil "Node border color spec")))
                   (txt (TeX-read-string
-                        (TeX-argument-prompt optional nil "Node text color 
spec"))))
-              (TeX-argument-insert bg optional)
-              (TeX-argument-insert br optional)
+                        (TeX-argument-prompt nil nil "Node text color spec"))))
+              (TeX-argument-insert bg nil)
+              (TeX-argument-insert br nil)
               (format "%s" txt))))))
       (TeX-arg-conditional (y-or-n-p "With additional optional arguments? ")
                           ( [ 3 ] )
@@ -530,7 +531,7 @@ macro.  If RENEW is non-nil, query for an already defined 
macro."
                                ("providemenumacro"         "|{\\[{")
                                ("renewmenumacro"           "|{\\[{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-menukeys-package-options-list
   '(("definemenumacros" ("true" "false"))
diff --git a/style/metalogo.el b/style/metalogo.el
index a5bb1f0..04d2cfb 100644
--- a/style/metalogo.el
+++ b/style/metalogo.el
@@ -1,6 +1,6 @@
-;;; metalogo.el --- AUCTeX style for `metalogo.sty' version 0.12.
+;;; metalogo.el --- AUCTeX style for `metalogo.sty' version 0.12.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2013, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <giordano.mose@libero.it>
@@ -29,6 +29,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -82,7 +84,7 @@
                                ("seteverylogo" "{")
                                ("everylogo" "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-metalogo-package-options nil
   "Package options for the metalogo package.")
diff --git a/style/mflogo.el b/style/mflogo.el
index 52fa44b..f7b1c5e 100644
--- a/style/mflogo.el
+++ b/style/mflogo.el
@@ -1,6 +1,6 @@
-;;; mflogo.el --- AUCTeX style for `mflogo.sty'
+;;; mflogo.el --- AUCTeX style for `mflogo.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2012, 2019 Free Software Foundation, Inc.
+;; Copyright (C) 2012, 2019, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -51,7 +53,7 @@
                              'type-command)
      (font-latex-add-keywords '(("logofamily" ""))
                              'type-declaration)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-mflogo-package-options nil
   "Package options for the mflogo package.")
diff --git a/style/minted.el b/style/minted.el
index ad849e7..7c7c33e 100644
--- a/style/minted.el
+++ b/style/minted.el
@@ -1,4 +1,4 @@
-;;; minted.el --- AUCTeX style for `minted.sty' (v2.5)
+;;; minted.el --- AUCTeX style for `minted.sty' (v2.5)  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 2014-2018, 2020 Free Software Foundation, Inc.
 
@@ -31,6 +31,7 @@
 ;;; Code:
 
 (require 'tex)
+(require 'latex)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
@@ -472,7 +473,7 @@ a list of strings."
                                                '("mint" "mintinline"))
      ;; Tell font-lock about the update.
      (font-latex-set-syntactic-keywords)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-minted-package-options '("chapter"     "cache"
                                       "cachedir"    "finalizecache"
diff --git a/style/mn2e.el b/style/mn2e.el
index 14a449c..2aa6937 100644
--- a/style/mn2e.el
+++ b/style/mn2e.el
@@ -1,6 +1,6 @@
-;;; mn2e.el --- AUCTeX style for `mn2e.cls' version 2.2.
+;;; mn2e.el --- AUCTeX style for `mn2e.cls' version 2.2.  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <mose@gnu.org>
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -170,7 +173,7 @@
                                ("journal")
                                ("bsp"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-mn2e-class-options
   '("useAMS" "usegraphicx" "usenatbib" "usedcolumn"
diff --git a/style/mnras.el b/style/mnras.el
index e3abfc1..95294bc 100644
--- a/style/mnras.el
+++ b/style/mnras.el
@@ -1,6 +1,6 @@
-;;; mnras.el --- AUCTeX style for `mnras.cls' version 3.0.
+;;; mnras.el --- AUCTeX style for `mnras.cls' version 3.0.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <mose@gnu.org>
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
diff --git a/style/moodle.el b/style/moodle.el
index f13d891..c7dfeec 100644
--- a/style/moodle.el
+++ b/style/moodle.el
@@ -1,6 +1,6 @@
-;;; moodle.el --- AUCTeX style for `moodle.sty' (v0.5)
+;;; moodle.el --- AUCTeX style for `moodle.sty' (v0.5)  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2017, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2017, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -35,6 +35,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -188,7 +191,7 @@
     '("moodleset"
       (TeX-arg-eval
        (lambda ()
-        (let ((opts (TeX-read-key-val optional
+        (let ((opts (TeX-read-key-val nil
                                       (append '(("ppi")) 
LaTeX-moodle-key-val-options))))
           (format "%s" opts)))))
 
@@ -209,7 +212,7 @@
                                ;; Cater for a fontified starred \item
                                ("item"   "*["))
                              'textual)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-moodle-package-options
   '("draft")
diff --git a/style/multicol.el b/style/multicol.el
index f57f609..46b476c 100644
--- a/style/multicol.el
+++ b/style/multicol.el
@@ -1,6 +1,6 @@
-;;; multicol.el --- AUCTeX style for `multicol.sty'
+;;; multicol.el --- AUCTeX style for `multicol.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2011, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "multicol"
  (lambda ()
@@ -54,7 +57,7 @@
     '("raggedcolumns" 0)
     '("flushcolumns" 0)
     "columnbreak"))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-multicol-package-options
   '("errorshow" "infoshow" "balancingshow" "markshow" "debugshow" "grid")
diff --git a/style/multido.el b/style/multido.el
index c9c3a6a..ec92edc 100644
--- a/style/multido.el
+++ b/style/multido.el
@@ -1,6 +1,6 @@
-;;; multido.el --- AUCTeX style for `multido.sty'
+;;; multido.el --- AUCTeX style for `multido.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2020 Free Software Foundation, Inc.
 
 ;; Author: Holger Sparr <holger.sparr@gmx.net>
 ;; Created: 21 Jun 2007
@@ -35,19 +35,20 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "multido"
- (function
-  (lambda ()
-    (TeX-add-symbols
-     '("multido" "\var=<start value>+-<inc>" "Repititions" t)
-     '("Multido" "\var=<start value>+-<inc>" "Repititions" t)
-     '("mmultido" "\var=<start value>+-<inc>" "Repititions" t)
-     '("MMultido" "\var=<start value>+-<inc>" "Repititions" t)
-     "multidostop"
-     "multidocount"
-     '("fpAdd" "Summand 1" "Summand 2" "Register")
-     '("fpSub" "Minuend" "Subtrahend" "Register"))))
- LaTeX-dialect)
+ (lambda ()
+   (TeX-add-symbols
+    '("multido" "\var=<start value>+-<inc>" "Repititions" t)
+    '("Multido" "\var=<start value>+-<inc>" "Repititions" t)
+    '("mmultido" "\var=<start value>+-<inc>" "Repititions" t)
+    '("MMultido" "\var=<start value>+-<inc>" "Repititions" t)
+    "multidostop"
+    "multidocount"
+    '("fpAdd" "Summand 1" "Summand 2" "Register")
+    '("fpSub" "Minuend" "Subtrahend" "Register")))
+ TeX-dialect)
 
 ;;; multido.el ends here
diff --git a/style/multind.el b/style/multind.el
index 76eabfe..e602253 100644
--- a/style/multind.el
+++ b/style/multind.el
@@ -1,6 +1,6 @@
-;;; multind.el --- AUCTeX support for multiple indices with multind.sty.
+;;; multind.el --- AUCTeX support for multiple indices with multind.sty.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2020 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@strw.leidenuniv.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -24,37 +24,41 @@
 
 ;;; Code:
 
-(TeX-add-style-hook "multind"
-  (lambda ()
-
-    ;; Commands
-    (TeX-add-symbols
-     '("makeindex" "Indextag")
-     '("index" TeX-arg-index-tag TeX-arg-index)
-     '("printindex" TeX-arg-index-tag "Title")
-     "printindex" "indexspace")
-
-    ;; Parsing index macros
-    (setq LaTeX-auto-regexp-list
-         (append
-          ;; The first regexp is faster, but less accurate
-          ;; '(("\\\\index\\*?{[^{}]*}{\\([^}]*\\)" 1 LaTeX-auto-index-entry))
-          ;; The second regexp is very good, but slower
-          
'(("\\\\index\\*?{[^{}]*}{\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*}[^}{]*\\)*}[^}{]*\\)*\\)}"
-             1 LaTeX-auto-index-entry))
-          LaTeX-auto-regexp-list))
-
-    ;; Completion for index entries in the |see and \index commands
-    (setq TeX-complete-list 
-         (append
-          '(("\\\\index{[^{}]*}{\\([^{}\n\r]*\\)" 1 LaTeX-index-entry-list)
-            ("|see{\\([^}]*\\)" 1 LaTeX-index-entry-list))
-          TeX-complete-list))
-
-    ;; RefTeX support
-    (and (fboundp 'reftex-add-index-macros)
-        (reftex-add-index-macros '(multind))))
-  LaTeX-dialect)
+(require 'tex)
+(require 'latex)
+
+(TeX-add-style-hook
+ "multind"
+ (lambda ()
+
+   ;; Commands
+   (TeX-add-symbols
+    '("makeindex" "Indextag")
+    '("index" TeX-arg-index-tag TeX-arg-index)
+    '("printindex" TeX-arg-index-tag "Title")
+    "printindex" "indexspace")
+
+   ;; Parsing index macros
+   (setq LaTeX-auto-regexp-list
+        (append
+         ;; The first regexp is faster, but less accurate
+         ;; '(("\\\\index\\*?{[^{}]*}{\\([^}]*\\)" 1 LaTeX-auto-index-entry))
+         ;; The second regexp is very good, but slower
+         
'(("\\\\index\\*?{[^{}]*}{\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*}[^}{]*\\)*}[^}{]*\\)*\\)}"
+            1 LaTeX-auto-index-entry))
+         LaTeX-auto-regexp-list))
+
+   ;; Completion for index entries in the |see and \index commands
+   (setq TeX-complete-list 
+        (append
+         '(("\\\\index{[^{}]*}{\\([^{}\n\r]*\\)" 1 LaTeX-index-entry-list)
+           ("|see{\\([^}]*\\)" 1 LaTeX-index-entry-list))
+         TeX-complete-list))
+
+   ;; RefTeX support
+   (and (fboundp 'reftex-add-index-macros)
+       (reftex-add-index-macros '(multind))))
+ TeX-dialect)
 
 (defvar LaTeX-multind-package-options nil
   "Package options for the multind package.")
diff --git a/style/multirow.el b/style/multirow.el
index 771cea4..6b7155f 100644
--- a/style/multirow.el
+++ b/style/multirow.el
@@ -1,6 +1,6 @@
-;;; multirow.el --- AUCTeX style for `multirow.sty'
+;;; multirow.el --- AUCTeX style for `multirow.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2011, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2011, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,6 +29,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -49,7 +51,7 @@
    (when (and (featurep 'font-latex)
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("multirow" "{[{")) 'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-multirow-package-options nil
   "Package options for the multirow package.")
diff --git a/style/multitoc.el b/style/multitoc.el
index 43fa817..fb06c83 100644
--- a/style/multitoc.el
+++ b/style/multitoc.el
@@ -1,6 +1,6 @@
-;;; multitoc.el --- AUCTeX style for `multitoc.sty' (v2.01)
+;;; multitoc.el --- AUCTeX style for `multitoc.sty' (v2.01)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019 Free Software Foundation, Inc.
+;; Copyright (C) 2019, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "multitoc"
  (lambda ()
@@ -39,7 +41,7 @@
     "multicolumntoc"
     "multicolumnlot"
     "multicolumnlof"))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-multitoc-package-options
   '("toc" "lof" "lot")
diff --git a/style/nameref.el b/style/nameref.el
index 8421b75..8535522 100644
--- a/style/nameref.el
+++ b/style/nameref.el
@@ -1,6 +1,6 @@
-;;; nameref.el --- AUCTeX style for `nameref.sty'
+;;; nameref.el --- AUCTeX style for `nameref.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2013, 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,6 +29,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -54,7 +56,7 @@
      (font-latex-add-keywords '(("nameref" "*{")
                                ("Nameref" "{"))
                              'reference)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-nameref-package-options nil
   "Package options for nameref.")
diff --git a/style/natbib.el b/style/natbib.el
index 596c86d..42c6416 100644
--- a/style/natbib.el
+++ b/style/natbib.el
@@ -1,6 +1,6 @@
-;;; natbib.el --- AUCTeX style for `natbib.sty' version 8.31b
+;;; natbib.el --- AUCTeX style for `natbib.sty' version 8.31b  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1997, 1998, 2004, 2007, 2014--2018 Free Software Foundation, 
Inc.
+;; Copyright (C) 1997, 1998, 2004, 2007, 2014--2020 Free Software Foundation, 
Inc.
 
 ;; Authors: Berwin Turlach <statba@nus.edu.sg>
 ;;          Carsten Dominik <dominik@strw.leidenuniv.nl>
@@ -26,6 +26,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -116,7 +119,7 @@
       "Punctuation between years for common authors")
 
     '("citestyle" (TeX-arg-eval completing-read
-                               (TeX-argument-prompt optional nil "Style")
+                               (TeX-argument-prompt nil nil "Style")
                                '("plain" "plainnat" "agu" "egu"
                                  "agms" "dcu" "kluwer" "cospar" "nature")))
 
@@ -167,7 +170,7 @@
    (when (and LaTeX-reftex-cite-format-auto-activate
              (fboundp 'reftex-set-cite-format))
      (reftex-set-cite-format 'natbib)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-arg-natbib-notes (optional)
   "Prompt for two note arguments a natbib citation command.
diff --git a/style/naustrian.el b/style/naustrian.el
index 99a7e30..63ca440 100644
--- a/style/naustrian.el
+++ b/style/naustrian.el
@@ -1,6 +1,6 @@
-;;; naustrian.el --- AUCTeX style for the `naustrian' babel option.
+;;; naustrian.el --- AUCTeX style for the `naustrian' babel option.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,10 +31,12 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "naustrian"
  (lambda ()
    (TeX-run-style-hooks "ngerman"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; naustrian.el ends here
diff --git a/style/newfloat.el b/style/newfloat.el
index 9f88a2d..e34e02e 100644
--- a/style/newfloat.el
+++ b/style/newfloat.el
@@ -1,6 +1,6 @@
-;;; newfloat.el --- AUCTeX style for `newfloat.sty' (v1.1-109)
+;;; newfloat.el --- AUCTeX style for `newfloat.sty' (v1.1-109)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -56,6 +56,7 @@
 
 ;; Needed for auto-parsing:
 (require 'tex)
+(require 'latex)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
@@ -207,7 +208,7 @@ If `caption.el' is loaded, add the new floating environment 
to
                                ("PrepareListOf"               "{{")
                                ("newfloatsetup"               "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-newfloat-package-options ()
   "Prompt for package options for the newfloat package."
diff --git a/style/newpxmath.el b/style/newpxmath.el
index df0abab..8e8c0ac 100644
--- a/style/newpxmath.el
+++ b/style/newpxmath.el
@@ -1,6 +1,6 @@
-;;; newpxmath.el --- AUCTeX style for `newpxmath.sty' (v1.232)
+;;; newpxmath.el --- AUCTeX style for `newpxmath.sty' (v1.232)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "newpxmath"
  (lambda ()
@@ -54,7 +56,7 @@
     '("varmathbb"      "Character")
     '("vmathbb"        "Character")
     '("vvmathbb"       "Character")))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-newpxmath-package-options
   '("varg"
diff --git a/style/newpxtext.el b/style/newpxtext.el
index 4112be9..d0929ca 100644
--- a/style/newpxtext.el
+++ b/style/newpxtext.el
@@ -1,6 +1,6 @@
-;;; newpxtext.el --- AUCTeX style for `newpxtext.sty' (v1.232)
+;;; newpxtext.el --- AUCTeX style for `newpxtext.sty' (v1.232)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -73,7 +75,7 @@
                                ("tosfstyle" "")
                                ("sustyle"   ""))
                               'type-declaration)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-newpxtext-package-options
   '("defaultsups" "scosf" "largesc"
diff --git a/style/newtxmath.el b/style/newtxmath.el
index 6ae898b..cf09156 100644
--- a/style/newtxmath.el
+++ b/style/newtxmath.el
@@ -1,6 +1,6 @@
-;;; newtxmath.el --- AUCTeX style for `newtxmath.sty' (v1.321)
+;;; newtxmath.el --- AUCTeX style for `newtxmath.sty' (v1.321)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "newtxmath"
  (lambda ()
@@ -55,7 +57,7 @@
     '("existsAlt"      0)
     '("nexistsAlt"     0)
     '("vvmathbb"       "Character")))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-newtxmath-package-options
   '("varg"
diff --git a/style/newtxsf.el b/style/newtxsf.el
index 236a2ad..901c83b 100644
--- a/style/newtxsf.el
+++ b/style/newtxsf.el
@@ -1,6 +1,6 @@
-;;; newtxsf.el --- AUCTeX style for `newtxsf.sty' (v1.0)
+;;; newtxsf.el --- AUCTeX style for `newtxsf.sty' (v1.0)  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "newtxsf"
  (lambda ()
@@ -41,7 +43,7 @@
    (TeX-add-symbols
     '("upimath"  0)
     '("upjmath"  0)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-newtxsf-package-options
   '("scaled"
diff --git a/style/newtxtext.el b/style/newtxtext.el
index 5f9c14f..578eb77 100644
--- a/style/newtxtext.el
+++ b/style/newtxtext.el
@@ -1,6 +1,6 @@
-;;; newtxtext.el --- AUCTeX style for `newtxtext.sty' (v1.434)
+;;; newtxtext.el --- AUCTeX style for `newtxtext.sty' (v1.434)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014, 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -73,7 +75,7 @@
                                ("tosfstyle" "")
                                ("sustyle"   ""))
                               'type-declaration)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-newtxtext-package-options
   '("defaultsups" "helvratio" "osf" "scaled" "scosf"
diff --git a/style/newtxttt.el b/style/newtxttt.el
index 1cfae90..f9ea0b9 100644
--- a/style/newtxttt.el
+++ b/style/newtxttt.el
@@ -1,6 +1,6 @@
-;;; newtxtt.el --- AUCTeX style for `newtxtt.sty' (v1.05)
+;;; newtxtt.el --- AUCTeX style for `newtxtt.sty' (v1.05)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -57,7 +59,7 @@
      (font-latex-add-keywords '(("ttzfamily"  "")
                                ("ttz"        ""))
                              'type-declaration)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-newtxtt-package-options
   '("scaled" "zerostyle" "nomono" "straightquotes"
diff --git a/style/newzealand.el b/style/newzealand.el
index c24a265..9acead5 100644
--- a/style/newzealand.el
+++ b/style/newzealand.el
@@ -1,6 +1,6 @@
-;;; newzealand.el --- AUCTeX style for the `newzealand' babel option.
+;;; newzealand.el --- AUCTeX style for the `newzealand' babel option.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2017 Free Software Foundation, Inc.
+;; Copyright (C) 2017, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,10 +31,12 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "newzealand"
  (lambda ()
    (TeX-run-style-hooks "english"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; newzealand.el ends here
diff --git a/style/ngerman.el b/style/ngerman.el
index 814688a..174eca2 100644
--- a/style/ngerman.el
+++ b/style/ngerman.el
@@ -1,4 +1,4 @@
-;;; ngerman.el --- Setup AUCTeX for editing German text.
+;;; ngerman.el --- Setup AUCTeX for editing German text.  -*- lexical-binding: 
t; -*-
 
 ;;; Commentary:
 ;;
@@ -8,6 +8,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-quotes
                  "font-latex"
@@ -54,6 +57,6 @@
      ;; Prevent "| from leading to color bleed.
      (font-latex-add-to-syntax-alist (list (cons ?\" "\\"))))
    (run-hooks 'TeX-language-de-hook))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; ngerman.el ends here
diff --git a/style/nicefrac.el b/style/nicefrac.el
index 4d68329..2c69a56 100644
--- a/style/nicefrac.el
+++ b/style/nicefrac.el
@@ -1,6 +1,6 @@
-;;; nicefrac.el --- AUCTeX style for the LaTeX package `nicefrac.sty' (v0.9b)
+;;; nicefrac.el --- AUCTeX style for the LaTeX package `nicefrac.sty' (v0.9b)  
-*- lexical-binding: t; -*-
 
-;; Copyright (C) 2004, 2005, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Christian Schlauer <cschl@arcor.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -43,7 +46,7 @@
    (when (and (featurep 'font-latex)
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("nicefrac" "[{{")) 'textual)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-nicefrac-package-options '("nice" "ugly")
   "Package options for the nicefrac package.")
diff --git a/style/nomencl.el b/style/nomencl.el
index b74405b..3cfc5f8 100644
--- a/style/nomencl.el
+++ b/style/nomencl.el
@@ -1,6 +1,6 @@
-;;; nomencl.el --- AUCTeX style for the nomencl class.
+;;; nomencl.el --- AUCTeX style for the nomencl class.  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2007, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2018; 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -71,6 +73,6 @@
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("nomenclature" "[{{"))
                              'reference)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; nomencl.el ends here
diff --git a/style/ntheorem.el b/style/ntheorem.el
index 19e0dbf..8a125d8 100644
--- a/style/ntheorem.el
+++ b/style/ntheorem.el
@@ -1,6 +1,6 @@
-;;; ntheorem.el --- AUCTeX style for `ntheorem.sty' (v1.33)
+;;; ntheorem.el --- AUCTeX style for `ntheorem.sty' (v1.33)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -36,6 +36,10 @@
 
 ;;; Code
 
+(require 'crm)
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -77,18 +81,19 @@ defined with \"\\newtheoremlisttype\".")
   "List of font declaration commands for \"\\newtheoremstyle\".")
 
 (defun LaTeX-arg-ntheorem-fontdecl (optional &optional prompt)
-  "Prompt for font declaration commands in \"\\theorem(body\|header)font\".
+  "Prompt for font declaration commands in \"\\theorem(body|header)font\".
 If OPTIONAL is non-nil, insert the resulting value as an optional
 argument.  Use PROMPT as the prompt string."
-  ;; `INITIAL-INPUT' (5th argument to `TeX-completing-read-multiple')
-  ;; is hard-coded to `TeX-esc'.
   (let* ((crm-separator (regexp-quote TeX-esc))
-        (fontdecl (mapconcat 'identity
+        (fontdecl (mapconcat #'identity
                              (TeX-completing-read-multiple
-                              (TeX-argument-prompt optional prompt "Font 
declaration")
-                              LaTeX-ntheorem-fontdecl nil nil TeX-esc)
+                              (TeX-argument-prompt optional prompt "Font 
declaration: \\" t)
+                              LaTeX-ntheorem-fontdecl)
                              TeX-esc)))
-    (TeX-argument-insert fontdecl optional)))
+    (TeX-argument-insert fontdecl
+                        optional
+                        (when (and fontdecl (not (string= fontdecl "")))
+                          TeX-esc))))
 
 (defun LaTeX-ntheorem-env-label (environment)
   "Insert ENVIRONMENT, query for an optional argument and prompt
@@ -114,9 +119,6 @@ RefTeX users should customize or add ENVIRONMENT to
     (LaTeX-newline)
     (indent-according-to-mode)))
 
-;; Needed for auto-parsing
-(require 'tex)
-
 ;; Setup parsing for \newtheorem
 (TeX-auto-add-type "ntheorem-newtheorem" "LaTeX")
 
@@ -223,7 +225,7 @@ make them available as new environments.  Update
 
     '("theoremnumbering"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Numbering scheme")
+                   (TeX-argument-prompt nil nil "Numbering scheme")
                    '("arabic" "roman" "Roman" "alph" "Alph"
                      "greek" "Greek" "fnsymbol")))
 
@@ -349,7 +351,7 @@ make them available as new environments.  Update
       (TeX-arg-eval
        (lambda ()
         (let ((style (TeX-read-string
-                      (TeX-argument-prompt optional nil "Style name"))))
+                      (TeX-argument-prompt nil nil "Style name"))))
           (LaTeX-add-ntheorem-newtheoremstyles style)
           (add-to-list (make-local-variable 'LaTeX-ntheorem-theoremstyle-list)
                        (list style))
@@ -366,7 +368,7 @@ make them available as new environments.  Update
       (TeX-arg-eval
        (lambda ()
         (let ((layout (TeX-read-string
-                      (TeX-argument-prompt optional nil "List layout name"))))
+                      (TeX-argument-prompt nil nil "List layout name"))))
           (LaTeX-add-ntheorem-newtheoremlisttypes layout)
           (add-to-list (make-local-variable 'LaTeX-ntheorem-listtype-list)
                        (list layout))
@@ -432,7 +434,7 @@ make them available as new environments.  Update
                              'function)
      (font-latex-add-keywords '(("thref"                  "{"))
                              'reference)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-ntheorem-package-options
   '("standard" "noconfig" "framed" "thmmarks" "thref" "amsmath" "hyperref")
diff --git a/style/ocg-p.el b/style/ocg-p.el
index 3ebd41e..3f48d84 100644
--- a/style/ocg-p.el
+++ b/style/ocg-p.el
@@ -1,6 +1,6 @@
-;;; ocg-p.el --- AUCTeX style for `ocg-p.sty' (v0.4)
+;;; ocg-p.el --- AUCTeX style for `ocg-p.sty' (v0.4)  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -33,6 +33,7 @@
 
 ;; Needed for auto-parsing.
 (require 'tex)
+(require 'latex)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
@@ -187,7 +188,7 @@ Just like array and tabular."
                                ("hideocgs"            "[{{")
                                ("setocgs"             "[{{{{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-ocg-p-package-options '("ocgtabular")
   "Package options for the ocg-p package.")
diff --git a/style/ocgx.el b/style/ocgx.el
index 0e8d5c3..ee2af56 100644
--- a/style/ocgx.el
+++ b/style/ocgx.el
@@ -1,6 +1,6 @@
-;;; ocgx.el --- AUCTeX style for `ocgx.sty' (v0.5)
+;;; ocgx.el --- AUCTeX style for `ocgx.sty' (v0.5)  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -65,7 +67,7 @@
                                ("hideocg"    "{{")
                                ("actionsocg" "{{{{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-ocgx-package-options nil
   "Package options for the ocgx package.")
diff --git a/style/overpic.el b/style/overpic.el
index b44e8d1..2d48c9b 100644
--- a/style/overpic.el
+++ b/style/overpic.el
@@ -1,4 +1,4 @@
-;;; overpic.el --- AUCTeX style for `overpic.sty' (v1.3)
+;;; overpic.el --- AUCTeX style for `overpic.sty' (v1.3)  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 2020 Free Software Foundation, Inc.
 
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -106,7 +109,7 @@ ones provided by `LaTeX-graphicx-key-val-options'."
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("setOverpic" "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-overpic-package-options
   (progn
diff --git a/style/paracol.el b/style/paracol.el
index 3eef88a..943f09a 100644
--- a/style/paracol.el
+++ b/style/paracol.el
@@ -1,6 +1,6 @@
-;;; paracol.el --- AUCTeX style for `paracol.sty' (v1.35)
+;;; paracol.el --- AUCTeX style for `paracol.sty' (v1.35)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016--2019 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -46,6 +46,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -155,7 +158,7 @@ If OPTIONAL is non-nil, insert the result in square 
brackets."
     ;; 7.6 Page-Wise Footnotes
     '("footnotelayout"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Layout")
+                   (TeX-argument-prompt nil nil "Layout")
                    '("c" "m" "p")))
 
     ;; \footnote*[num]{text}
@@ -204,7 +207,7 @@ If OPTIONAL is non-nil, insert the result in square 
brackets."
     ;; \backgroundcolor{region(x0,y0)(x1,y1)}[mode]{color}
     '("backgroundcolor"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Region")
+                   (TeX-argument-prompt nil nil "Region")
                    '("c" "g" "s" "f" "n" "p" "t" "b" "l" "r"
                      "C" "G" "S" "F" "N" "P" "T" "B" "L" "R"))
       (TeX-arg-conditional (member "xcolor" (TeX-style-list))
@@ -214,7 +217,7 @@ If OPTIONAL is non-nil, insert the result in square 
brackets."
     ;; \nobackgroundcolor{region}
     '("nobackgroundcolor"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Region")
+                   (TeX-argument-prompt nil nil "Region")
                    '("c" "g" "s" "f" "n" "p" "t" "b" "l" "r"
                      "C" "G" "S" "F" "N" "P" "T" "B" "L" "R")))
 
@@ -225,7 +228,7 @@ If OPTIONAL is non-nil, insert the result in square 
brackets."
     ;; \addcontentsonly{file}{col}
     '("addcontentsonly"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Content file")
+                   (TeX-argument-prompt nil nil "Content file")
                    '("toc" "lof" "lot"))
       "Column")
 
@@ -283,7 +286,7 @@ If OPTIONAL is non-nil, insert the result in square 
brackets."
                                ("resetbackgroundcolor"         "")
                                ("addcontentsonly"              "{{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-paracol-package-options nil
   "Package options for the paracol package.")
diff --git a/style/paralist.el b/style/paralist.el
index d25a9a6..7ca772c 100644
--- a/style/paralist.el
+++ b/style/paralist.el
@@ -1,6 +1,6 @@
-;;; paralist.el -- AUCTeX style for paralist.sty
+;;; paralist.el -- AUCTeX style for paralist.sty  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2003-2005, 2014, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2005, 2014, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author:   Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -98,7 +101,7 @@
                                ("setdefaultenum" "{{{{")
                                ("setdefaultleftmargin" "{{{{{{"))
                              'variable)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-paralist-package-options '("newitem" "olditem" "newenum"
                                         "oldenum" "alwaysadjust"
diff --git a/style/pdflscape.el b/style/pdflscape.el
index 1cf6e1f..8511663 100644
--- a/style/pdflscape.el
+++ b/style/pdflscape.el
@@ -1,6 +1,6 @@
-;;; pdflscape.el --- AUCTeX style for `pdflscape.sty' (v0.11)
+;;; pdflscape.el --- AUCTeX style for `pdflscape.sty' (v0.11)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016 Free Software Foundation, Inc.
+;; Copyright (C) 2016, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,12 +31,14 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "pdflscape"
  (lambda ()
    ;; Load lscape.el and we are done
    (TeX-run-style-hooks "lscape"))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-pdflscape-package-options nil
   "Package options for the pdflscape package.")
diff --git a/style/pdfpages.el b/style/pdfpages.el
index f32441b..ee267d1 100644
--- a/style/pdfpages.el
+++ b/style/pdfpages.el
@@ -1,6 +1,6 @@
-;;; pdfpages.el --- AUCTeX style for `pdfpages.sty' (v0.4v)
+;;; pdfpages.el --- AUCTeX style for `pdfpages.sty' (v0.4v)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -34,6 +34,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -132,7 +134,7 @@
      (font-latex-add-keywords '(("includepdf"       "[{")
                                ("includepdfmerge"  "[{"))
                              'reference)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-pdfpages-package-options
   '("final" "draft" "enable-survey")
diff --git a/style/pdfsync.el b/style/pdfsync.el
index fd64421..d4f7629 100644
--- a/style/pdfsync.el
+++ b/style/pdfsync.el
@@ -1,6 +1,6 @@
-;;; pdfsync.el --- AUCTeX style for `pdfsync.sty'
+;;; pdfsync.el --- AUCTeX style for `pdfsync.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2005, 2008, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2008, 2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (defun LaTeX-pdfsync-output-page ()
   "Return page number in output file corresponding to buffer position."
   (let* ((line (line-number-at-pos))
@@ -85,6 +87,6 @@
  "pdfsync"
  (lambda ()
    (setq TeX-source-correlate-output-page-function 'LaTeX-pdfsync-output-page))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; pdfsync.el ends here
diff --git a/style/placeins.el b/style/placeins.el
index cb4fb33..1eee1b8 100644
--- a/style/placeins.el
+++ b/style/placeins.el
@@ -1,6 +1,6 @@
-;;; placeins.el --- AUCTeX style for `placeins.sty'
+;;; placeins.el --- AUCTeX style for `placeins.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2013 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,12 +29,14 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-add-style-hook
  "placeins"
  (lambda ()
    (TeX-add-symbols
     '("FloatBarrier" 0)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-placeins-package-options 
   '("section" "above" "below" "verbose")
diff --git a/style/plext.el b/style/plext.el
index 30765a7..c686792 100644
--- a/style/plext.el
+++ b/style/plext.el
@@ -1,6 +1,6 @@
-;;; plext.el --- AUCTeX style for the plext package.
+;;; plext.el --- AUCTeX style for the plext package.  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ikumi Keita <ikumi@ikumi.que.jp>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "plext"
  (lambda ()
@@ -47,7 +50,7 @@
    (set (make-local-variable 'LaTeX-tabular*-skipping-regexp)
        (concat "\\(?:<[tyz]>\\)?[ \t]*{[^}]*}[ \t]*"
                (regexp-opt '("[t]" "[b]" "")))))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-plext-env-array (env)
   (let ((dir (TeX-read-string "(Optional) Direction (t or y or z): "))
diff --git a/style/plfonts.el b/style/plfonts.el
index 9df8739..51c0a81 100644
--- a/style/plfonts.el
+++ b/style/plfonts.el
@@ -1,4 +1,4 @@
-;;; plfonts.el - Setup AUC TeX for editing Polish text with plfonts.sty
+;;; plfonts.el - Setup AUC TeX for editing Polish text with plfonts.sty  -*- 
lexical-binding: t; -*-
 
 ;;; Commentary:
 ;;
@@ -7,14 +7,18 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-plfonts-mode-syntax-table
   (copy-syntax-table LaTeX-mode-syntax-table)
   "Syntax table used in LaTeX mode when using `plfonts.sty'.")
 
 (modify-syntax-entry ?\"  "w"  LaTeX-plfonts-mode-syntax-table)
 
-(TeX-add-style-hook "plfonts"
- (function (lambda ()
+(TeX-add-style-hook
+ "plfonts"
+ (lambda ()
    (set-syntax-table LaTeX-plfonts-mode-syntax-table)
    (make-local-variable 'TeX-open-quote)
    (make-local-variable 'TeX-close-quote)
@@ -24,7 +28,7 @@
    (setq TeX-close-quote "\">")
    (setq TeX-quote-after-quote t)
    (setq TeX-command-default "plLaTeX")
-   (run-hooks 'TeX-language-pl-hook)))
- LaTeX-dialect)
+   (run-hooks 'TeX-language-pl-hook))
+ TeX-dialect)
 
 ;;; plfonts.el ends here
diff --git a/style/plhb.el b/style/plhb.el
index 0705550..14d86ab 100644
--- a/style/plhb.el
+++ b/style/plhb.el
@@ -1,4 +1,4 @@
-;;; plhb.el - Setup AUC TeX for editing Polish text with plhb.sty
+;;; plhb.el - Setup AUC TeX for editing Polish text with plhb.sty  -*- 
lexical-binding: t; -*-
 
 ;;; Commentary:
 ;;
@@ -7,14 +7,18 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-plhb-mode-syntax-table
   (copy-syntax-table LaTeX-mode-syntax-table)
   "Syntax table used in LaTeX mode when using `plhb.sty'.")
 
 (modify-syntax-entry ?\"  "w"  LaTeX-plhb-mode-syntax-table)
 
-(TeX-add-style-hook "plhb"
- (function (lambda ()
+(TeX-add-style-hook
+ "plhb"
+ (lambda ()
    (set-syntax-table LaTeX-plhb-mode-syntax-table)
    (make-local-variable 'TeX-open-quote)
    (make-local-variable 'TeX-close-quote)
@@ -24,7 +28,7 @@
    (setq TeX-close-quote "\">")
    (setq TeX-quote-after-quote t)
    (setq TeX-command-default "plLaTeX")
-   (run-hooks 'TeX-language-pl-hook)))
- LaTeX-dialect)
+   (run-hooks 'TeX-language-pl-hook))
+ TeX-dialect)
 
 ;;; plhb.el ends here
diff --git a/style/polish.el b/style/polish.el
index 31397f0..ab7936c 100644
--- a/style/polish.el
+++ b/style/polish.el
@@ -1,6 +1,6 @@
-;;; polish.el --- AUCTeX style for the `polish' babel option.
+;;; polish.el --- AUCTeX style for the `polish' babel option.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-polish-mode-syntax-table
   (copy-syntax-table LaTeX-mode-syntax-table)
   "Syntax table used in LaTeX mode when using `polish.sty'.")
@@ -48,6 +51,6 @@
      (font-latex-add-quotes '("\"`" "\"'"))
      (font-latex-add-quotes '("\"<" "\">" french)))
    (run-hooks 'TeX-language-pl-hook))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; polish.el ends here
diff --git a/style/polski.el b/style/polski.el
index 249d48c..83c4840 100644
--- a/style/polski.el
+++ b/style/polski.el
@@ -1,6 +1,6 @@
-;;; polski.el --- AUCTeX style for `polski.sty'.
+;;; polski.el --- AUCTeX style for `polski.sty'.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2007, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-quotes
                  "font-latex"
@@ -56,6 +58,6 @@
    (when (fboundp 'font-latex-add-quotes)
      (font-latex-add-quotes '(",," "''")))
    (run-hooks 'TeX-language-pl-hook))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; polski.el ends here
diff --git a/style/polyglossia.el b/style/polyglossia.el
index aaa688d..e52d54e 100644
--- a/style/polyglossia.el
+++ b/style/polyglossia.el
@@ -1,6 +1,6 @@
-;;; polyglossia.el --- AUCTeX style for `polyglossia.sty' version 1.42.0.
+;;; polyglossia.el --- AUCTeX style for `polyglossia.sty' version 1.42.0.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <mose@gnu.org>
@@ -36,6 +36,8 @@
 ;;; Code:
 
 (require 'tex) ;Indispensable when compiling the call to `TeX-auto-add-type'.
+(require 'latex)
+(require 'tex-buf)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
@@ -274,7 +276,7 @@ argument, otherwise as a mandatory one."
                                ("setotherlanguages" "{")
                                ("setkeys" "{{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;; TODO: move each option variable in its specific `gloss-<lang>.el' file.
 (defvar LaTeX-polyglossia-arabic-options-list
diff --git a/style/preview.el b/style/preview.el
index 5093f57..f36ca6c 100644
--- a/style/preview.el
+++ b/style/preview.el
@@ -1,6 +1,6 @@
-;;; preview.el --- AUCTeX style for `preview.sty' (v2010/02/14)
+;;; preview.el --- AUCTeX style for `preview.sty' (v2010/02/14)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2017, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2017, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -94,7 +97,7 @@ OPTIONAL is ignored."
                                ("PreviewEnvironment"      "*[[{")
                                ("PreviewSnarfEnvironment" "[{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-preview-package-options
   '("active"      "noconfig"   "psfixbb"
diff --git a/style/prosper.el b/style/prosper.el
index cfc9797..85e9e2e 100644
--- a/style/prosper.el
+++ b/style/prosper.el
@@ -1,4 +1,4 @@
-;;; prosper.el --- Prosper style file for AUCTeX
+;;; prosper.el --- Prosper style file for AUCTeX  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2001, 2002, 2014, 2020 Free Software Foundation, Inc.
 
@@ -59,7 +59,8 @@
 ;; auctex. I shall have to download the latest version, and see if
 ;; its already been fixed.
 
-
+(require 'tex)
+(require 'latex)
 
 (defconst LaTeX-prosper-version "2008-05-25"
   "prosper.el version.")
@@ -184,6 +185,6 @@
     '("onlyInPS" t)
     '("onlyInPDF" t)
     '("FromSlide" "Number")))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; prosper.el ends here
diff --git a/style/psfig.el b/style/psfig.el
index b0b6b94..d8cf78b 100644
--- a/style/psfig.el
+++ b/style/psfig.el
@@ -1,45 +1,44 @@
-;;; psfig.el - Support for the psfig style option.
+;;; psfig.el - Support for the psfig style option.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2014, 2020 Free Software Foundation, Inc.
 
 ;; Contributed by Marc Gemis <makke@wins.uia.ac.be>
 ;; Please direct comments to him.
 
 ;;; Code:
 
-(TeX-add-style-hook "psfig"
- (function
-  (lambda ()
-       ;; probable some of the following symbols may be removed
-    (TeX-add-symbols "protect" "figurepath"  "fbox"
-                    "other" "letter" "other" "then" "Sine" "Cosine"
-                    "psdraft" "psfull" "psscalefirst" "psrotatefirst"
-                    "psnodraftbox" "psdraftbox" "pssilent" "psnoisy"
-                    "minmaxtest"
-     '("psfig" TeX-arg-psfig)
-     '("psfigurepath" t)
-                    )
-    (LaTeX-add-environments
-     '("psfigure" LaTeX-env-psfigure)
-     )
-    ))
- LaTeX-dialect)
+(require 'tex)
+(require 'latex)
+
+(TeX-add-style-hook
+ "psfig"
+ (lambda ()
+   ;; probable some of the following symbols may be removed
+   (TeX-add-symbols "protect" "figurepath"  "fbox"
+                   "other" "letter" "other" "then" "Sine" "Cosine"
+                   "psdraft" "psfull" "psscalefirst" "psrotatefirst"
+                   "psnodraftbox" "psdraftbox" "pssilent" "psnoisy"
+                   "minmaxtest"
+                    '("psfig" TeX-arg-psfig)
+                    '("psfigurepath" t)
+                   )
+   (LaTeX-add-environments
+    '("psfigure" LaTeX-env-psfigure)))
+ TeX-dialect)
 
 (defun TeX-arg-psfig (_optional)
-   "Ask for file, width and length. Insert psfig macro"
-   (let ((psfile (read-file-name "PS-file: " "" "" nil))
-        (figwidth (TeX-read-string "Figure width: "))
-        (figheight (TeX-read-string "Figure height: "))
-        )
+  "Ask for file, width and length. Insert psfig macro"
+  (let ((psfile (read-file-name "PS-file: " "" "" nil))
+       (figwidth (TeX-read-string "Figure width: "))
+       (figheight (TeX-read-string "Figure height: "))
+       )
 
-     (insert TeX-grop "figure=" psfile)
-     (if (not (zerop (length figwidth)))
-        (insert ",width=" figwidth))
-     (if (not (zerop (length figheight)))
-        (insert ",height=" figheight))
-     (insert TeX-grcl)
-     )
-   )
+    (insert TeX-grop "figure=" psfile)
+    (if (not (zerop (length figwidth)))
+       (insert ",width=" figwidth))
+    (if (not (zerop (length figheight)))
+       (insert ",height=" figheight))
+    (insert TeX-grcl)))
 
 
 (defun LaTeX-env-psfigure (_environment)
diff --git a/style/pst-grad.el b/style/pst-grad.el
index 829e190..0426a73 100644
--- a/style/pst-grad.el
+++ b/style/pst-grad.el
@@ -1,6 +1,6 @@
-;;; pst-grad.el --- AUCTeX style for `pst-grad.sty'
+;;; pst-grad.el --- AUCTeX style for `pst-grad.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2020 Free Software Foundation, Inc.
 
 ;; Author: Holger Sparr <holger.sparr@gmx.net>
 ;; Created: 21 Jun 2007
@@ -33,6 +33,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (defvar LaTeX-pst-fillstyle-list)
 (defvar LaTeX-pst-parameters-completion-regexp)
@@ -66,6 +68,6 @@
     (setq LaTeX-pst-parameters-name-list
           (append LaTeX-pstgrad-parameters-name-list
                   LaTeX-pst-parameters-name-list))))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; pst-grad.el ends here
diff --git a/style/pst-node.el b/style/pst-node.el
index 7b174cd..be28fb0 100644
--- a/style/pst-node.el
+++ b/style/pst-node.el
@@ -1,6 +1,6 @@
-;;; pst-node.el --- AUCTeX style for `pst-node.sty'
+;;; pst-node.el --- AUCTeX style for `pst-node.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2007, 2013, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2013, 2014, 2020 Free Software Foundation, Inc.
 
 ;; Author: Holger Sparr <holger.sparr@gmx.net>
 ;; Created: 21 Jun 2007
@@ -35,6 +35,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function LaTeX-package-parameter-value
                  "pstricks" (param pname))
@@ -199,6 +202,6 @@
      '("pscolhook" t))
     (TeX-run-style-hooks
      "pstricks")))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; pst-node.el ends here
diff --git a/style/pst-plot.el b/style/pst-plot.el
index 0942c6e..bcbeb9d 100644
--- a/style/pst-plot.el
+++ b/style/pst-plot.el
@@ -1,6 +1,6 @@
-;;; pst-plot.el --- AUCTeX style for `pst-plot.sty'
+;;; pst-plot.el --- AUCTeX style for `pst-plot.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2007, 2014, 2015, 2019 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2014, 2015, 2019, 2020 Free Software Foundation, Inc.
 
 ;; Author: Holger Sparr <holger.sparr@gmx.net>
 ;; Created: 21 Jun 2007
@@ -35,6 +35,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function LaTeX-pst-arrows "pstricks" ())
 (declare-function LaTeX-pst-point  "pstricks" ())
@@ -143,6 +145,6 @@
     (setq LaTeX-pst-parameters-name-list
           (append LaTeX-pstplot-parameters-name-list
                   LaTeX-pst-parameters-name-list))))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; pst-plot.el ends here
diff --git a/style/pst-slpe.el b/style/pst-slpe.el
index 6efed09..e9f78e6 100644
--- a/style/pst-slpe.el
+++ b/style/pst-slpe.el
@@ -1,6 +1,6 @@
-;;; pst-slpe.el --- AUCTeX style for `pst-slpe.sty'
+;;; pst-slpe.el --- AUCTeX style for `pst-slpe.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2020 Free Software Foundation, Inc.
 
 ;; Author: Holger Sparr <holger.sparr@gmx.net>
 ;; Created: 21 Jun 2007
@@ -33,6 +33,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (defvar LaTeX-pst-fillstyle-list)
 (defvar LaTeX-pst-parameters-completion-regexp)
@@ -51,23 +53,22 @@
 ;;; Define hook
 (TeX-add-style-hook
  "pst-slpe"
- (function
-  (lambda ()
-    (TeX-run-style-hooks
-     "pstricks")
-    (unless (member "slope" LaTeX-pst-fillstyle-list)
-      (setq LaTeX-pst-fillstyle-list
-            (append LaTeX-pst-fillstyle-list
-                    '("slope" "slopes" "ccslope" "ccslopes" "radslope"
-                    "radslopes")))
-      (setq LaTeX-pst-parameters-completion-regexp
-            (concat
-             (substring LaTeX-pst-parameters-completion-regexp 0 -2)
-             "\\|slopebegin\\|slopeend\\)")))
-    (make-local-variable 'LaTeX-pst-parameters-name-list)
-    (setq LaTeX-pst-parameters-name-list
-          (append LaTeX-pstslpe-parameters-name-list
-                  LaTeX-pst-parameters-name-list))))
- LaTeX-dialect)
+ (lambda ()
+   (TeX-run-style-hooks
+    "pstricks")
+   (unless (member "slope" LaTeX-pst-fillstyle-list)
+     (setq LaTeX-pst-fillstyle-list
+           (append LaTeX-pst-fillstyle-list
+                   '("slope" "slopes" "ccslope" "ccslopes" "radslope"
+                     "radslopes")))
+     (setq LaTeX-pst-parameters-completion-regexp
+           (concat
+            (substring LaTeX-pst-parameters-completion-regexp 0 -2)
+            "\\|slopebegin\\|slopeend\\)")))
+   (make-local-variable 'LaTeX-pst-parameters-name-list)
+   (setq LaTeX-pst-parameters-name-list
+         (append LaTeX-pstslpe-parameters-name-list
+                 LaTeX-pst-parameters-name-list)))
+ TeX-dialect)
 
 ;;; pst-slpe.el ends here
diff --git a/style/pstricks.el b/style/pstricks.el
index 1a24767..7b40256 100644
--- a/style/pstricks.el
+++ b/style/pstricks.el
@@ -1,4 +1,4 @@
-;;; pstricks.el --- AUCTeX style for the `pstricks' package.
+;;; pstricks.el --- AUCTeX style for the `pstricks' package.  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2007, 2009, 2013-2015, 2018, 2020
 ;;                Free Software Foundation, Inc.
@@ -61,6 +61,8 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
 (eval-when-compile
   (require 'cl-lib))
 
@@ -870,7 +872,7 @@ comma separated list. Point has to be within the sexp to 
modify."
     '("uput" LaTeX-pst-macro-uput t)
     '("multirput" (LaTeX-pst-macro-multirputps t) t)
     '("multips" (LaTeX-pst-macro-multirputps nil) t)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-pstricks-package-options
   '("97" "plain" "DIA" "vtex" "distiller" "noxcolor")
diff --git a/style/pythontex.el b/style/pythontex.el
index 206c32d..b6aa70d 100644
--- a/style/pythontex.el
+++ b/style/pythontex.el
@@ -1,4 +1,4 @@
-;;; pythontex.el --- AUCTeX style for `pythontex.sty' (v0.16)
+;;; pythontex.el --- AUCTeX style for `pythontex.sty' (v0.16)  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2018, 2020 Free Software Foundation, Inc.
 
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 ;; `LaTeX-fancyvrb-key-val-options-local' will be defined after
 ;; loading `fvextra.el' which loads `fancyvrb.el' in return:
@@ -51,9 +54,6 @@
 (declare-function LaTeX-newfloat-auto-cleanup
                  "newfloat" ())
 
-;; Needed for auto-parsing:
-(require 'tex)
-
 (defvar LaTeX-pythontex-pygmentize-program (executable-find "pygmentize")
   "Path to pygmentize executable.")
 
@@ -294,10 +294,10 @@ a list of strings."
     ;; pythontexcustomc[<position>]{<family>}{<code>}
     '("pythontexcustomc"
       [ TeX-arg-eval completing-read
-       (TeX-argument-prompt optional nil "Position")
-       '("begin" "end") ]
+                    (TeX-argument-prompt t nil "Position")
+                    '("begin" "end") ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Family")
+                   (TeX-argument-prompt nil nil "Family")
                    LaTeX-pythontex-family-list)
       t)
 
@@ -305,33 +305,33 @@ a list of strings."
     ;; \setpythontexfv[<family>]{<fancyvrb settings>}
     '("setpythontexfv"
       [ TeX-arg-eval completing-read
-       (TeX-argument-prompt optional nil "Family")
-       LaTeX-pythontex-family-list ]
+                    (TeX-argument-prompt t nil "Family")
+                    LaTeX-pythontex-family-list ]
       (TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local))
 
     ;; \setpythontexprettyprinter[<family>]{<printer>}
     '("setpythontexprettyprinter"
       [ TeX-arg-eval completing-read
-       (TeX-argument-prompt optional nil "Family")
-       (cons "auto" LaTeX-pythontex-family-list) ]
+                    (TeX-argument-prompt t nil "Family")
+                    (cons "auto" LaTeX-pythontex-family-list) ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Printer")
+                   (TeX-argument-prompt nil nil "Printer")
                    '("text" "bw" "fancyvrb" "pygments")))
 
     ;; \setpythontexpyglexer[<family>]{<pygments lexer>}
     '("setpythontexpyglexer"
       [ TeX-arg-eval completing-read
-       (TeX-argument-prompt optional nil "Family")
-       LaTeX-pythontex-family-list ]
+                    (TeX-argument-prompt t nil "Family")
+                    LaTeX-pythontex-family-list ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Pygments lexer")
+                   (TeX-argument-prompt nil nil "Pygments lexer")
                    (LaTeX-pythontex-language-list)))
 
     ;; \setpythontexpygopt[<family>]{<pygments options>}
     '("setpythontexpygopt"
       [ TeX-arg-eval completing-read
-       (TeX-argument-prompt optional nil "Family")
-       LaTeX-pythontex-family-list ]
+                    (TeX-argument-prompt t nil "Family")
+                    LaTeX-pythontex-family-list ]
       (TeX-arg-key-val
        (("style") ("texcomments") ("mathescape"))))
 
@@ -339,22 +339,22 @@ a list of strings."
     ;; \printpythontex[<mode>][<options>]
     '("printpythontex"
       [ TeX-arg-eval completing-read
-       (TeX-argument-prompt optional nil "Mode")
-       '("raw" "verb" "verbatim") ]
+                    (TeX-argument-prompt t nil "Mode")
+                    '("raw" "verb" "verbatim") ]
       [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ] )
 
     ;; \stdoutpythontex[<mode>][<options>]
     '("stdoutpythontex"
       [ TeX-arg-eval completing-read
-       (TeX-argument-prompt optional nil "Mode")
-       '("raw" "verb" "verbatim") ]
+                    (TeX-argument-prompt t nil "Mode")
+                    '("raw" "verb" "verbatim") ]
       [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ] )
 
     ;;\saveprintpythontex{<name>}
     '("saveprintpythontex"
       (TeX-arg-eval (lambda ()
                      (let ((name (TeX-read-string
-                                  (TeX-argument-prompt optional nil "Name"))))
+                                  (TeX-argument-prompt nil nil "Name"))))
                        (LaTeX-add-pythontex-savecontents name)
                        (format "%s" name)))))
 
@@ -362,7 +362,7 @@ a list of strings."
     '("savestdoutpythontex"
       (TeX-arg-eval (lambda ()
                      (let ((name (TeX-read-string
-                                  (TeX-argument-prompt optional nil "Name"))))
+                                  (TeX-argument-prompt nil nil "Name"))))
                        (LaTeX-add-pythontex-savecontents name)
                        (format "%s" name)))))
 
@@ -370,29 +370,29 @@ a list of strings."
     ;; I assume <verbatim options> is meant to be <mode>
     '("useprintpythontex"
       [ TeX-arg-eval completing-read
-       (TeX-argument-prompt optional nil "Mode")
-       '("raw" "verb" "verbatim") ]
+                    (TeX-argument-prompt t nil "Mode")
+                    '("raw" "verb" "verbatim") ]
       [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Name")
+                   (TeX-argument-prompt nil nil "Name")
                    (LaTeX-pythontex-savecontent-list)))
 
     ;; \usestdoutpythontex[<verbatim options>][<fancyvrb options>]{<name>}
     ;; I assume <verbatim options> is meant to be <mode>
     '("usestdoutpythontex"
       [ TeX-arg-eval completing-read
-       (TeX-argument-prompt optional nil "Mode")
-       '("raw" "verb" "verbatim") ]
+                    (TeX-argument-prompt t nil "Mode")
+                    '("raw" "verb" "verbatim") ]
       [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Name")
+                   (TeX-argument-prompt nil nil "Name")
                    (LaTeX-pythontex-savecontent-list)))
 
     ;; \stderrpythontex[<mode>][<fancyvrb options>]
     '("stderrpythontex"
       [ TeX-arg-eval completing-read
-       (TeX-argument-prompt optional nil "Mode")
-       '("raw" "verb" "verbatim") ]
+                    (TeX-argument-prompt t nil "Mode")
+                    '("raw" "verb" "verbatim") ]
       [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ] )
 
 
@@ -400,37 +400,37 @@ a list of strings."
     '("savestderrpythontex"
       (TeX-arg-eval (lambda ()
                      (let ((name (TeX-read-string
-                                  (TeX-argument-prompt optional nil "Name"))))
+                                  (TeX-argument-prompt nil nil "Name"))))
                        (LaTeX-add-pythontex-savecontents name)
                        (format "%s" name)))))
 
     ;; \usestderrpythontex[<mode>][<fancyvrb options>]{<name>}
     '("usestderrpythontex"
       [ TeX-arg-eval completing-read
-       (TeX-argument-prompt optional nil "Mode")
-       '("raw" "verb" "verbatim") ]
+                    (TeX-argument-prompt t nil "Mode")
+                    '("raw" "verb" "verbatim") ]
       [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Name")
+                   (TeX-argument-prompt nil nil "Name")
                    (LaTeX-pythontex-savecontent-list)))
 
     ;;\setpythontexautoprint{<boolean>}
     '("setpythontexautoprint"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Boolean value")
+                   (TeX-argument-prompt nil nil "Boolean value")
                    '("true" "false")))
 
     ;; \setpythontexautostdout{<boolean>}
     '("setpythontexautostdout"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Boolean value")
+                   (TeX-argument-prompt nil nil "Boolean value")
                    '("true" "false")))
 
     ;; 4.3 Pygments commands and environments
     ;; \pygment{<lexer>}<opening delim><code><closing delim>
     '("pygment"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Lexer")
+                   (TeX-argument-prompt nil nil "Lexer")
                    (LaTeX-pythontex-language-list))
       TeX-arg-verb-delim-or-brace)
 
@@ -438,29 +438,29 @@ a list of strings."
     '("inputpygments"
       [ TeX-arg-eval LaTeX-fancyvrb-key-val-options-local ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Lexer")
+                   (TeX-argument-prompt nil nil "Lexer")
                    (LaTeX-pythontex-language-list))
       TeX-arg-file-name)
 
     ;; \setpygmentsfv[<lexer>]{<fancyvrb settings>}
     '("setpygmentsfv"
       [ TeX-arg-eval completing-read
-       (TeX-argument-prompt optional nil "Lexer")
-       (LaTeX-pythontex-language-list) ]
+                    (TeX-argument-prompt t nil "Lexer")
+                    (LaTeX-pythontex-language-list) ]
       (TeX-arg-eval LaTeX-fancyvrb-key-val-options-local))
 
     ;; \setpygmentspygopt[<lexer>]{<pygments options>}
     '("setpygmentspygopt"
       [ TeX-arg-eval completing-read
-       (TeX-argument-prompt optional nil "Lexer")
-       (LaTeX-pythontex-language-list) ]
+                    (TeX-argument-prompt t nil "Lexer")
+                    (LaTeX-pythontex-language-list) ]
       (TeX-arg-key-val
        (("style") ("texcomments") ("mathescape"))))
 
     ;; \setpygmentsprettyprinter{<printer>}
     '("setpygmentsprettyprinter"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Printer")
+                   (TeX-argument-prompt nil nil "Printer")
                    '("text" "bw" "fancyvrb" "pygments")))
 
     ;; 4.5  Advanced PythonTeX usage
@@ -494,7 +494,7 @@ a list of strings."
       (TeX-arg-eval
        (lambda ()
         (let ((name (TeX-read-string
-                     (TeX-argument-prompt optional nil "Listing environment 
name"))))
+                     (TeX-argument-prompt nil nil "Listing environment 
name"))))
           (LaTeX-add-newfloat-DeclareFloatingEnvironments `(,name "verbatim"))
           (LaTeX-newfloat-auto-cleanup)
           (format "%s" name))))))
@@ -503,17 +503,17 @@ a list of strings."
     ;; 4.2.5 Custom code
     '("pythontexcustomcode" LaTeX-env-args
       [ TeX-arg-eval completing-read
-       (TeX-argument-prompt optional nil "Position")
-       '("begin" "end") ]
+                    (TeX-argument-prompt t nil "Position")
+                    '("begin" "end") ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Family")
+                   (TeX-argument-prompt nil nil "Family")
                    LaTeX-pythontex-family-list))
 
     ;; \begin{pygments}[<fancyvrb settings>]{<lexer>}
     '("pygments" LaTeX-env-args
       [ TeX-arg-eval LaTeX-fancyvrb-key-val-options-local ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Lexer")
+                   (TeX-argument-prompt nil nil "Lexer")
                    (LaTeX-pythontex-language-list))) )
 
    ;; Filling
@@ -563,6 +563,6 @@ a list of strings."
      (LaTeX-pythontex-add-syntactic-keywords-extra 'delim "pygment")
      ;; Tell font-lock about the update.
      (font-latex-set-syntactic-keywords)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; pythontex.el ends here
diff --git a/style/ragged2e.el b/style/ragged2e.el
index 3f8932b..56750fb 100644
--- a/style/ragged2e.el
+++ b/style/ragged2e.el
@@ -1,6 +1,6 @@
-;;; ragged2e.el --- AUCTeX style for `ragged2e.sty'
+;;; ragged2e.el --- AUCTeX style for `ragged2e.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2011, 2015, 2019 Free Software Foundation, Inc.
+;; Copyright (C) 2011, 2015, 2019, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Created: 2011-04-16
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -69,7 +72,7 @@
                                ("RaggedRight"  "")
                                ("RaggedLeft"   ""))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-ragged2e-package-options
   '("originalcommands" "newcommands" "originalparameters" "document"
diff --git a/style/relsize.el b/style/relsize.el
index 131a152..d9724ac 100644
--- a/style/relsize.el
+++ b/style/relsize.el
@@ -1,6 +1,6 @@
-;;; relsize.el --- AUCTeX style for `relsize.sty' version v4.1
+;;; relsize.el --- AUCTeX style for `relsize.sty' version v4.1  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -66,7 +68,7 @@
                                ("textsmaller"        "[{")
                                ("textscale"          "{{"))
                              'type-command)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-relsize-package-options nil
   "Package options for the relsize package.")
diff --git a/style/report.el b/style/report.el
index 7fa96b2..125f199 100644
--- a/style/report.el
+++ b/style/report.el
@@ -1,7 +1,10 @@
-;;; report.el - Special code for report style.
+;;; report.el - Special code for report style.  -*- lexical-binding: t; -*-
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-report-class-options
   '("a4paper" "a5paper" "b5paper" "letterpaper" "legalpaper" "executivepaper"
     "landscape" "10pt" "11pt" "12pt" "oneside" "twoside" "draft" "final"
@@ -17,6 +20,6 @@
                       "paragraph" "subparagraph" "figure" "table")
    (LaTeX-add-pagestyles "headings" "myheadings")
    (LaTeX-add-environments "abstract"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; report.el ends here
diff --git a/style/revtex4-2.el b/style/revtex4-2.el
index dd516b1..63daeb0 100644
--- a/style/revtex4-2.el
+++ b/style/revtex4-2.el
@@ -1,4 +1,4 @@
-;;; revtex4-2.el --- AUCTeX style for `revtex4-2.cls' (v4.2c)
+;;; revtex4-2.el --- AUCTeX style for `revtex4-2.cls' (v4.2c)  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2020 Free Software Foundation, Inc.
 
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -209,7 +212,7 @@ provided by REVTeX class."
                              'reference)
      (font-latex-add-keywords '(("appendix*" ""))
                              'warning)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-revtex4-2-class-options
   (progn
diff --git a/style/ruby.el b/style/ruby.el
index 38451f9..9c18fa3 100644
--- a/style/ruby.el
+++ b/style/ruby.el
@@ -1,6 +1,6 @@
-;;; ruby.el --- AUCTeX style for the ruby package.
+;;; ruby.el --- AUCTeX style for the ruby package.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (defvar LaTeX-ruby-package-options
   '("overlap" "nooverlap" "CJK" "latin")
   "Package options for the ruby package.")
@@ -45,6 +47,6 @@
     '("rubysize" 0)
     '("rubysep" 0)
     '("ruby" t nil)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; ruby.el ends here
diff --git a/style/erewhon.el b/style/scholax.el
similarity index 55%
copy from style/erewhon.el
copy to style/scholax.el
index 58b2f06..46fb4a6 100644
--- a/style/erewhon.el
+++ b/style/scholax.el
@@ -1,10 +1,10 @@
-;;; erewhon.el --- AUCTeX style for `erewhon.sty' (v1.04)
+;;; scholax.el --- AUCTeX style for `scholax.sty' (v1.027)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014, 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
-;; Created: 2014-11-18
+;; Created: 2020-11-29
 ;; Keywords: tex
 
 ;; This file is part of AUCTeX.
@@ -26,21 +26,23 @@
 
 ;;; Commentary:
 
-;; This file adds support for `erewhon.sty' (v1.04) from 2015/04/07.
-;; `erewhon.sty' is part of TeXLive.
+;; This file adds support for `scholax.sty' (v1.027) from 2020/11/30.
+;; `scholax.sty' is part of TeXLive.
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
                  (keywords class))
 
 (TeX-add-style-hook
- "erewhon"
+ "scholax"
  (lambda ()
 
-   ;; Run style hook for various packages loaded by erewhon
+   ;; Run style hook for various packages loaded by scholax
    (TeX-run-style-hooks "textcomp" "fontaxes")
 
    ;; New symbols
@@ -49,48 +51,56 @@
     ;; Only preamble commands
     '("useosf"  0)
     '("useproportional" 0)
+    '("thfamily" 0)
 
     ;; Text commands
-    '("lfstyle"   -1)   ; lf declaration
-    '("tlfstyle"  -1)   ; tlf declaration
-    '("osfstyle"  -1)   ; osf declaration
-    '("tosfstyle" -1)   ; tosf declaration
-    '("sufigures" -1)   ; superior figures declaration
-    '("textlf"     t)   ; proportional lining figures
-    '("texttlf"    t)   ; tabular lining figures
-    '("textosf"    t)   ; proportional oldstyle figures
-    '("texttosf"   t)   ; tabular oldstyle figures
     '("textsu"     t)   ; superior figures
+    '("sustyle"   -1)
     '("textin"     t)   ; inferior figures
-    '("textnu"     t)   ; numerator figures
-    '("textde"     t)   ; denominator figures
-    '("textfrac" "Numerator" "Denominator"))
+    '("instyle"   -1)
+
+    '("textlf"     t)   ; lining figures
+    '("lfstyle"   -1)
+
+    '("texttlf"    t)   ; tabular lining figures
+    '("tlfstyle"  -1)
+
+    '("textosf"    t)   ; oldstyle figures
+    '("osfstyle"  -1)
+
+    '("texttosf"   t)   ; tabular oldstyle figures
+    '("tosfstyle" -1)
+
+    '("textfrac"  "Numerator" "Denominator"))
 
    ;; Fontification
    (when (and (featurep 'font-latex)
              (eq TeX-install-font-lock 'font-latex-setup))
-     (font-latex-add-keywords '(("textlf"    "{")
+     (font-latex-add-keywords '(("textsu"    "{")
+                               ("textin"    "{")
+                               ("textlf"    "{")
                                ("texttlf"   "{")
                                ("textosf"   "{")
                                ("texttosf"  "{")
-                               ("textsu"    "{")
-                               ("textin"    "{")
-                               ("textnu"    "{")
-                               ("textde"    "{"))
+                               ("textfrac"  "{{"))
                              'type-command)
-     (font-latex-add-keywords '(("lfstyle"   "")
+     (font-latex-add-keywords '(("sustyle"   "")
+                               ("instyle"   "")
+                               ("lfstyle"   "")
                                ("tlfstyle"  "")
                                ("osfstyle"  "")
-                               ("tosfstyle" "")
-                               ("sufigures" ""))
-                             'type-declaration)
-     (font-latex-add-keywords '(("textfrac"  "{{"))
-                             'textual)))
- LaTeX-dialect)
-
-(defvar LaTeX-erewhon-package-options
-  '("lining" "lf" "oldstyle" "osf" "tabular" "p" "proportional"
-    "scale" "scaled" "scosf" "space" "sups")
-  "Package options for the erewhon package.")
-
-;;; erewhon.el ends here
+                               ("tosfstyle" ""))
+                             'type-declaration)))
+ TeX-dialect)
+
+(defvar LaTeX-scholax-package-options
+  '("scale"       "scaled"
+    "spacing"     "stretch"    "shrink"
+    "foresolidus" "aftsolidus" "raisefrac"
+    "theoremfont"
+    "scosf"    "sups" "lining"  "lf"
+    "oldstyle" "osf"  "tabular" "p" "proportional"
+    "looser"   "loosest")
+  "Package options for the scholax package.")
+
+;;; scholax.el ends here
diff --git a/style/scrartcl.el b/style/scrartcl.el
index 101ce1c..49509fb 100644
--- a/style/scrartcl.el
+++ b/style/scrartcl.el
@@ -1,7 +1,6 @@
-;;; -*- emacs-lisp -*-
-;;; scrartcl.el -- AUCTeX style for scrartcl.cls
+;;; scrartcl.el -- AUCTeX style for scrartcl.cls  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2002, 2005 Free Software Foundation
+;; Copyright (C) 2002, 2005, 2020 Free Software Foundation
 ;; License: GPL, see the file COPYING in the base directory of AUCTeX
 
 ;; Author: Mark Trettin <Mark.Trettin@gmx.de>
@@ -15,13 +14,17 @@
 
 ;; This file is part of  AUCTeX.
 
+(require 'tex)
+(require 'latex)
+
 ;;; Code:
-(TeX-add-style-hook "scrartcl"
-   (lambda ()
-     (LaTeX-largest-level-set "section")
-     ;; load basic definitons
-     (TeX-run-style-hooks "scrbase")
-     (LaTeX-add-environments "abstract"))
-   LaTeX-dialect)
+(TeX-add-style-hook
+ "scrartcl"
+ (lambda ()
+   (LaTeX-largest-level-set "section")
+   ;; load basic definitons
+   (TeX-run-style-hooks "scrbase")
+   (LaTeX-add-environments "abstract"))
+ TeX-dialect)
 
 ;;; scrartcl.el ends here
diff --git a/style/scrbase.el b/style/scrbase.el
index e55d2bb..e288e34 100644
--- a/style/scrbase.el
+++ b/style/scrbase.el
@@ -1,6 +1,6 @@
-;;; scrbase.el --- AUCTeX style for the KOMA-Script bundle.
+;;; scrbase.el --- AUCTeX style for the KOMA-Script bundle.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2002, 2004, 2005, 2007, 2014, 2018 Free Software Foundation, 
Inc.
+;; Copyright (C) 2002, 2004, 2005, 2007, 2014, 2018, 2020 Free Software 
Foundation, Inc.
 
 ;; Author: Mark Trettin <Mark.Trettin@gmx.de>
 ;; Created: 2002-09-26
@@ -32,6 +32,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -189,7 +192,7 @@
       (font-latex-add-keywords '(("addpart" "[{")) 'sectioning-1)
       (font-latex-add-keywords '(("addsec" "[{")) 'sectioning-2)
       (font-latex-add-keywords '(("minisec" "[{")) 'sectioning-4)))
-  LaTeX-dialect)
+  TeX-dialect)
 
 (defun TeX-arg-KOMA-setpreamble (optional &optional prompt)
   "Prompt for KOMA-Script's \\set*preamble position with completion."
diff --git a/style/scrbook.el b/style/scrbook.el
index 2e10cf0..3b4586f 100644
--- a/style/scrbook.el
+++ b/style/scrbook.el
@@ -1,6 +1,6 @@
-;;; scrbook.el --- AUCTeX style for scrbook.cls
+;;; scrbook.el --- AUCTeX style for scrbook.cls  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2002, 2005, 2018 Free Software Foundation
+;; Copyright (C) 2002, 2005, 2018, 2020 Free Software Foundation
 
 ;; Author: Mark Trettin <Mark.Trettin@gmx.de>
 ;; Created: 2002-09-26
@@ -23,13 +23,16 @@
 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 ;; 02110-1301, USA.
 
-;;; Commentary: 
+;;; Commentary:
 
 ;; This file adds support for `scrbook.cls'. This file needs
 ;; `scrbase.el'.
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -63,6 +66,6 @@
                               'textual)
       ;; Sectioning keywords
       (font-latex-add-keywords '(("addchap" "[{")) 'sectioning-1)))
-  LaTeX-dialect)
+  TeX-dialect)
 
 ;;; scrbook.el ends here
diff --git a/style/scrlttr2.el b/style/scrlttr2.el
index 28e3ea9..4e168c9 100644
--- a/style/scrlttr2.el
+++ b/style/scrlttr2.el
@@ -1,6 +1,6 @@
-;;; scrlttr2.el --- AUCTeX style for scrlttr2.cls.
+;;; scrlttr2.el --- AUCTeX style for scrlttr2.cls.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2002, 2007, 2014, 2018 Free Software Foundation
+;; Copyright (C) 2002, 2007, 2014, 2018, 2020 Free Software Foundation
 
 ;; Author: Mark Trettin <Mark.Trettin@gmx.de>
 ;; Created: 2002-10-26
@@ -23,7 +23,7 @@
 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 ;; 02110-1301, USA.
 
-;;; Commentary: 
+;;; Commentary:
 
 ;; This file adds support for `scrlttr2.cls'.
 
@@ -37,111 +37,115 @@
 
 ;;; Code
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
                  (keywords class))
 
-(TeX-add-style-hook "scrlttr2"
-  (lambda ()
-    (TeX-add-symbols
-     '("AtBeginLetter" t)
-     '("KOMAoptions" t)
-     '("LetterOptionNeedsPapersize" "Name of lco file" "Paper size")
-     '("LoadLetterOption" "Name of lco file")
-     '("addrchar" "Initial letter")
-     '("addrentry" "Lastname" "Firstname" "Address" "Telephone" "F1"
-       "F2" "F3" "F4" "Key")
-     '("addtokomafont" TeX-arg-KOMA-scrlttr-fontelements t)
-     '("addtolengthplength" [ "Factor" ] "Name of length"
-       "Name of pseudo length")
-     '("addtoreffields" TeX-arg-KOMA-scrlttr-vars)
-     '("adrchar" "Initial letter")
-     '("adrentry" "Lastname" "Firstname" "Address" "Telephone" "F1"
-       "F2" "Comment" "Key")
-     '("bankname" t)
-     '("captionsUKenglish" nil)
-     '("captionsUSenglish" nil)
-     '("captionsamerican" nil)
-     '("captionsaustrian" nil)
-     '("captionsbritish" nil)
-     '("captionscroatian" nil)
-     '("captionsdutch" nil)
-     '("captionsenglish" nil)
-     '("captionsfrench" nil)
-     '("captionsgerman" nil)
-     '("captionsitalian" nil)
-     '("captionsngerman" nil)
-     '("captionsspanish" nil)
-     '("cc" t)
-     '("ccname" t)
-     '("cleardoubleemptypage")
-     '("cleardoubleplainpage")
-     '("cleardoublestandardpage")
-     '("closing" "Closing Phrase")
-     '("customername" t)
-     '("dateUKenglish" nil)
-     '("dateUSenglish" nil)
-     '("dateamerican" nil)
-     '("dateaustrian" nil)
-     '("datebritish" nil)
-     '("datecroatian" nil)
-     '("datedutch" nil)
-     '("dateenglish" nil)
-     '("datefrench" nil)
-     '("dategerman" nil)
-     '("dateitalian" nil)
-     '("datename" t)
-     '("datengerman" nil)
-     '("datespanish" nil)
-     '("emailname" t)
-     '("encl" t)
-     '("enclname" t)
-     '("faxname" t)
-     '("firstfoot" t)
-     '("firsthead" t)
-     '("headfromname" t)
-     '("headtoname" t)
-     '("ifkomavarempty" TeX-arg-KOMA-scrlttr-vars 2)
-     '("ifkomavarempty*" TeX-arg-KOMA-scrlttr-vars 2)
-     '("invoicename" t)
-     '("myrefname" t)
-     '("newcaptionname" "Language" "Term" "Definition")
-     '("newkomavar" [ "Description" ] "Name")
-     '("newkomavar*" [ "Description" ] "Name")
-     '("nextfoot" t)
-     '("nexthead" t)
-     '("opening" "Opening")
-     '("pagename" t)
-     '("phonename" t)
-     '("providecaptionname" "Language" "Term" "Definition")
-     '("ps")
-     '("raggedsignature" nil)
-     '("renewcaptionname" "Language" "Term" "Definition")
-     '("setkomafont" TeX-arg-KOMA-scrlttr-fontelements t)
-     '("setkomavar" TeX-arg-KOMA-scrlttr-vars [ "Description" ] t)
-     '("setkomavar*" TeX-arg-KOMA-scrlttr-vars "Description")
-     '("setlengthtoplength" [ "Factor" ] "Name of length"
-       "Name of pseudo length")
-     '("subjectname" t)
-     '("usekomafont" TeX-arg-KOMA-scrlttr-fontelements)
-     '("usekomavar" [ "Command" ] TeX-arg-KOMA-scrlttr-vars)
-     '("usekomavar*" [ "Command" ] TeX-arg-KOMA-scrlttr-vars)
-     '("useplength" "Name")
-     '("wwwname" t)
-     '("yourmailname" t)
-     '("yourrefname" t))
-    (LaTeX-add-environments
-     '("letter" (lambda (env &rest ignore)
-                 (LaTeX-insert-environment
-                  env
-                  (let ((options (TeX-read-string "Optional options: "))
-                        (recip (TeX-read-string "Recipient: ")))
-                    (concat
-                     (if (not (zerop (length options)))
-                         (format "[%s]" options))
-                     (format "{%s}" recip)))))))
-    ;; Definitions for font-latex
+(TeX-add-style-hook
+ "scrlttr2"
+ (lambda ()
+   (TeX-add-symbols
+    '("AtBeginLetter" t)
+    '("KOMAoptions" t)
+    '("LetterOptionNeedsPapersize" "Name of lco file" "Paper size")
+    '("LoadLetterOption" "Name of lco file")
+    '("addrchar" "Initial letter")
+    '("addrentry" "Lastname" "Firstname" "Address" "Telephone" "F1"
+      "F2" "F3" "F4" "Key")
+    '("addtokomafont" TeX-arg-KOMA-scrlttr-fontelements t)
+    '("addtolengthplength" [ "Factor" ] "Name of length"
+      "Name of pseudo length")
+    '("addtoreffields" TeX-arg-KOMA-scrlttr-vars)
+    '("adrchar" "Initial letter")
+    '("adrentry" "Lastname" "Firstname" "Address" "Telephone" "F1"
+      "F2" "Comment" "Key")
+    '("bankname" t)
+    '("captionsUKenglish" nil)
+    '("captionsUSenglish" nil)
+    '("captionsamerican" nil)
+    '("captionsaustrian" nil)
+    '("captionsbritish" nil)
+    '("captionscroatian" nil)
+    '("captionsdutch" nil)
+    '("captionsenglish" nil)
+    '("captionsfrench" nil)
+    '("captionsgerman" nil)
+    '("captionsitalian" nil)
+    '("captionsngerman" nil)
+    '("captionsspanish" nil)
+    '("cc" t)
+    '("ccname" t)
+    '("cleardoubleemptypage")
+    '("cleardoubleplainpage")
+    '("cleardoublestandardpage")
+    '("closing" "Closing Phrase")
+    '("customername" t)
+    '("dateUKenglish" nil)
+    '("dateUSenglish" nil)
+    '("dateamerican" nil)
+    '("dateaustrian" nil)
+    '("datebritish" nil)
+    '("datecroatian" nil)
+    '("datedutch" nil)
+    '("dateenglish" nil)
+    '("datefrench" nil)
+    '("dategerman" nil)
+    '("dateitalian" nil)
+    '("datename" t)
+    '("datengerman" nil)
+    '("datespanish" nil)
+    '("emailname" t)
+    '("encl" t)
+    '("enclname" t)
+    '("faxname" t)
+    '("firstfoot" t)
+    '("firsthead" t)
+    '("headfromname" t)
+    '("headtoname" t)
+    '("ifkomavarempty" TeX-arg-KOMA-scrlttr-vars 2)
+    '("ifkomavarempty*" TeX-arg-KOMA-scrlttr-vars 2)
+    '("invoicename" t)
+    '("myrefname" t)
+    '("newcaptionname" "Language" "Term" "Definition")
+    '("newkomavar" [ "Description" ] "Name")
+    '("newkomavar*" [ "Description" ] "Name")
+    '("nextfoot" t)
+    '("nexthead" t)
+    '("opening" "Opening")
+    '("pagename" t)
+    '("phonename" t)
+    '("providecaptionname" "Language" "Term" "Definition")
+    '("ps")
+    '("raggedsignature" nil)
+    '("renewcaptionname" "Language" "Term" "Definition")
+    '("setkomafont" TeX-arg-KOMA-scrlttr-fontelements t)
+    '("setkomavar" TeX-arg-KOMA-scrlttr-vars [ "Description" ] t)
+    '("setkomavar*" TeX-arg-KOMA-scrlttr-vars "Description")
+    '("setlengthtoplength" [ "Factor" ] "Name of length"
+      "Name of pseudo length")
+    '("subjectname" t)
+    '("usekomafont" TeX-arg-KOMA-scrlttr-fontelements)
+    '("usekomavar" [ "Command" ] TeX-arg-KOMA-scrlttr-vars)
+    '("usekomavar*" [ "Command" ] TeX-arg-KOMA-scrlttr-vars)
+    '("useplength" "Name")
+    '("wwwname" t)
+    '("yourmailname" t)
+    '("yourrefname" t))
+   (LaTeX-add-environments
+    '("letter" (lambda (env &rest ignore)
+                (LaTeX-insert-environment
+                 env
+                 (let ((options (TeX-read-string "Optional options: "))
+                       (recip (TeX-read-string "Recipient: ")))
+                   (concat
+                    (if (not (zerop (length options)))
+                        (format "[%s]" options))
+                    (format "{%s}" recip)))))))
+   ;; Definitions for font-latex
    (when (and (featurep 'font-latex)
              (eq TeX-install-font-lock 'font-latex-setup))
      ;; Textual keywords
@@ -203,7 +207,7 @@
                                "cleardoubleplainpage"
                                "cleardoubleemptypage")
                              'warning)))
-  LaTeX-dialect)
+ TeX-dialect)
 
 (defun TeX-arg-KOMA-scrlttr-vars (optional &optional prompt)
   "Prompt for KOMA-Script's scrlttr2 predefined variables with completion."
diff --git a/style/scrpage2.el b/style/scrpage2.el
index 841a8c9..8ad4249 100644
--- a/style/scrpage2.el
+++ b/style/scrpage2.el
@@ -1,4 +1,4 @@
-;;; scrpage2.el --- AUCTeX style for scrpage2.sty.
+;;; scrpage2.el --- AUCTeX style for scrpage2.sty.  -*- lexical-binding: t; -*-
 
 ;; Author:   Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Created:  2003-11-01
@@ -27,6 +27,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -116,7 +118,7 @@
                                ("renewpagestyle" "{{{")
                                ("providepagestyle" "{{{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-scrpage2-package-options '("headinclude" "headexclude"
                                         "footinclude" "footexclude"
diff --git a/style/scrreprt.el b/style/scrreprt.el
index 2507960..3b7120f 100644
--- a/style/scrreprt.el
+++ b/style/scrreprt.el
@@ -1,6 +1,6 @@
-;;; scrreprt.el --- AUCTeX style for scrreprt.cls.
+;;; scrreprt.el --- AUCTeX style for scrreprt.cls.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2002, 2005, 2018 Free Software Foundation
+;; Copyright (C) 2002, 2005, 2018, 2020 Free Software Foundation
 
 ;; Author: Mark Trettin <Mark.Trettin@gmx.de>
 ;; Created: 2002-09-26
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -65,6 +68,6 @@
                              'textual)
      ;; Sectioning keywords
      (font-latex-add-keywords '(("addchap" "[{")) 'sectioning-1)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; scrreprt.el ends here
diff --git a/style/setspace.el b/style/setspace.el
index 4e32044..39cf153 100644
--- a/style/setspace.el
+++ b/style/setspace.el
@@ -1,6 +1,6 @@
-;;; setspace.el --- AUCTeX style for `setspace.sty'
+;;; setspace.el --- AUCTeX style for `setspace.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2011, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2011, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Created: 2011-04-16
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -58,7 +61,7 @@
                                ("doublespacing" "")
                                ("onehalfspacing" ""))
                               'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-setspace-package-options 
   '("doublespacing" "onehalfspacing" "singlespacing" "nodisplayskipstretch")
diff --git a/style/shortvrb.el b/style/shortvrb.el
index 932df29..822c84b 100644
--- a/style/shortvrb.el
+++ b/style/shortvrb.el
@@ -1,4 +1,4 @@
-;;; shortvrb.el --- AUCTeX style for `shortvrb.sty'
+;;; shortvrb.el --- AUCTeX style for `shortvrb.sty'  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 2009, 2014, 2018, 2020 Free Software Foundation, Inc.
 
@@ -41,6 +41,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'tex-style)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-to-syntax-alist
                  "font-latex"
@@ -65,6 +68,6 @@
      (font-latex-add-to-syntax-alist
       (mapcar (lambda (char) (cons char "|"))
              LaTeX-shortvrb-chars))))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; shortvrb.el ends here
diff --git a/style/siunitx.el b/style/siunitx.el
index 85fef14..bcda14a 100644
--- a/style/siunitx.el
+++ b/style/siunitx.el
@@ -1,6 +1,6 @@
-;;; siunitx.el --- AUCTeX style for `siunitx.sty' version 2.5s.
+;;; siunitx.el --- AUCTeX style for `siunitx.sty' version 2.5s.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2012-2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <giordano.mose@libero.it>
@@ -30,6 +30,7 @@
 ;;; Code:
 
 (require 'tex) ;Indispensable when compiling the call to `TeX-auto-add-type'.
+(require 'latex)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
@@ -627,7 +628,7 @@ string."
                                ("DeclareSIQualifier" "|{\\{")
                                ("highlight" "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-siunitx-package-options nil
   "Prompt for package options for the siunitx package."
diff --git a/style/slides.el b/style/slides.el
index e73826a..fabdb23 100644
--- a/style/slides.el
+++ b/style/slides.el
@@ -1,6 +1,6 @@
-;;; slides.el --- AUCTeX style for the `slides' document class
+;;; slides.el --- AUCTeX style for the `slides' document class  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2004, 2013 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2013, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-slides-class-options
   '("a4paper" "a5paper" "b5paper" "letterpaper" "legalpaper" "executivepaper"
     "landscape" "clock" "draft" "final" "titlepage" "notitlepage" "onecolumn"
@@ -46,6 +49,6 @@
    (LaTeX-add-counters "minutes" "seconds")
    (LaTeX-add-pagestyles "headings" "slide" "overlay" "note")
    (setq LaTeX-default-document-environment "slide"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; slides.el ends here
diff --git a/style/slovak.el b/style/slovak.el
index dacf6c5..705ef5d 100644
--- a/style/slovak.el
+++ b/style/slovak.el
@@ -1,4 +1,6 @@
-;;; slovak.el --- Setup AUCTeX for editing Slovak text.
+;;; slovak.el --- Setup AUCTeX for editing Slovak text.  -*- lexical-binding: 
t; -*-
+
+(require 'tex)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-quotes
@@ -14,4 +16,4 @@
      (font-latex-add-quotes '("\"`" "\"'"))
      (font-latex-add-quotes '("\"<" "\">" french)))
    (run-hooks 'TeX-language-sk-hook))
- LaTeX-dialect)
+ TeX-dialect)
diff --git a/style/sourcecodepro.el b/style/sourcecodepro.el
index 289906d..ff308e8 100644
--- a/style/sourcecodepro.el
+++ b/style/sourcecodepro.el
@@ -1,6 +1,6 @@
-;;; sourcecodepro.el --- AUCTeX style for `sourcecodepro.sty' (v2.6)
+;;; sourcecodepro.el --- AUCTeX style for `sourcecodepro.sty' (v2.6)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2017, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2017, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -68,7 +71,7 @@
                                ("sourcecodeproextreme" "")
                                ("sourcecodeprolf"      ""))
                              'type-declaration)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-sourcecodepro-package-options
   '("lining" "nf" "lf"
diff --git a/style/splitidx.el b/style/splitidx.el
index 41141b9..ccd9863 100644
--- a/style/splitidx.el
+++ b/style/splitidx.el
@@ -1,6 +1,6 @@
-;;; splitidx.el --- AUCTeX style for `splitidx.sty' (v1.2a)
+;;; splitidx.el --- AUCTeX style for `splitidx.sty' (v1.2a)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -90,6 +90,7 @@
 
 ;; Needed for auto-parsing:
 (require 'tex)
+(require 'latex)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
@@ -152,7 +153,7 @@
       (TeX-arg-eval
        (lambda ()
         (let ((shortcut (TeX-read-string
-                         (TeX-argument-prompt optional nil "Short cut"))))
+                         (TeX-argument-prompt nil nil "Short cut"))))
           (LaTeX-add-splitidx-newindices shortcut)
           (format "%s" shortcut)))))
 
@@ -160,20 +161,20 @@
     '("sindex"
       ;; I don't use `[ TeX-arg-index-tag ]' here
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Short cut")
+                    (TeX-argument-prompt t nil "Short cut")
                     (LaTeX-splitidx-newindex-list) ]
       TeX-arg-index)
 
     ;; 3.4 Customizing index entries
     '("AtWriteToIndex"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Short cut")
+                   (TeX-argument-prompt nil nil "Short cut")
                    (LaTeX-splitidx-newindex-list))
       t)
 
     '("AtNextWriteToIndex"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Short cut")
+                   (TeX-argument-prompt nil nil "Short cut")
                    (LaTeX-splitidx-newindex-list))
       t)
 
@@ -183,14 +184,14 @@
       (TeX-arg-eval
        (lambda ()
         (let ((shortcut (TeX-read-string
-                         (TeX-argument-prompt optional nil "Short cut"))))
+                         (TeX-argument-prompt nil nil "Short cut"))))
           (LaTeX-add-splitidx-newindices shortcut)
           (format "%s" shortcut)))))
 
     ;; 3.7 Including the generated indices in your document
     '("printindex"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Short cut")
+                    (TeX-argument-prompt t nil "Short cut")
                     (LaTeX-splitidx-newindex-list) ]
       [ "Index name" ])
 
@@ -198,7 +199,7 @@
 
     '("printsubindex"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Short cut")
+                    (TeX-argument-prompt t nil "Short cut")
                     (LaTeX-splitidx-newindex-list) ]
       [ "Index name" ])
 
@@ -206,7 +207,7 @@
 
     '("setindexpreamble"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Short cut")
+                    (TeX-argument-prompt t nil "Short cut")
                     (LaTeX-splitidx-newindex-list) ]
       t)
 
@@ -246,7 +247,7 @@
        (TeX-add-symbols
        '("index"
          [TeX-arg-eval completing-read
-                       (TeX-argument-prompt optional nil "Short cut")
+                       (TeX-argument-prompt t nil "Short cut")
                        (LaTeX-splitidx-newindex-list) ]
          (TeX-arg-index)))
        ;; Tell RefTeX to look in the optional arg. for the index short cut
@@ -300,7 +301,7 @@
                              'function)
      (font-latex-add-keywords '(("sindex"             "[{"))
                              'reference)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-splitidx-package-options
   '("makeindex"
diff --git a/style/subcaption.el b/style/subcaption.el
index 4a2beab..0780523 100644
--- a/style/subcaption.el
+++ b/style/subcaption.el
@@ -1,6 +1,6 @@
-;;; subcaption.el --- AUCTeX style for `subcaption.sty' (v1.3)
+;;; subcaption.el --- AUCTeX style for `subcaption.sty' (v1.3)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015--2019 Free Software Foundation, Inc.
+;; Copyright (C) 2015--2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -184,7 +187,7 @@ caption, insert only a caption."
                              'reference)
      (font-latex-add-keywords '(("DeclareCaptionSubType" "*[{"))
                              'function)) )
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-subcaption-package-options ()
   "Prompt for package options for the subcaption package."
diff --git a/style/subfigure.el b/style/subfigure.el
index 9d96655..d967ed1 100644
--- a/style/subfigure.el
+++ b/style/subfigure.el
@@ -1,6 +1,6 @@
-;;; subfigure.el --- AUCTeX style file for subfigure.sty
+;;; subfigure.el --- AUCTeX style file for subfigure.sty  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2003, 2005, 2013, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2005, 2013, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Reiner Steib  <Reiner.Steib@gmx.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -64,7 +67,7 @@
      (font-latex-add-keywords '(("Subref" "{")
                                ("subref" "{"))
                              'reference)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-subfigure-package-options '("normal" "hang" "center"
                                          "centerlast" "nooneline"
diff --git a/style/subfiles.el b/style/subfiles.el
index 4937bc4..5434f99 100644
--- a/style/subfiles.el
+++ b/style/subfiles.el
@@ -1,6 +1,6 @@
-;;; subfiles.el --- AUCTeX style for the subfiles package.
+;;; subfiles.el --- AUCTeX style for the subfiles package.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Uwe Brauer <oub@mat.ucm.es>
 ;; Created: 07 Nov 2016
@@ -33,6 +33,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -51,7 +54,7 @@
    (read-file-name
     "Main file: " nil nil nil nil
     (lambda (texfiles)
-      (string-match "\\.tex$" texfiles)))
+      (string-match "\\.tex\\'" texfiles)))
    (TeX-master-directory)))
 
 (TeX-add-style-hook
@@ -67,31 +70,38 @@
        (file-name-sans-extension master-file))))
 
    (TeX-add-symbols
-    '("subfile" TeX-arg-file))
+    '("subfile" TeX-arg-file)
+    '("subfileinclude" TeX-arg-file))
 
-   ;; Ensure that \subfile stays in one line
-   (LaTeX-paragraph-commands-add-locally "subfile")
+   ;; Ensure that \subfile and \subfileinclude stay in one line
+   (LaTeX-paragraph-commands-add-locally '("subfile" "subfileinclude"))
 
    ;; Tell AUCTeX that \subfile loads a file.  regexp is the same as
    ;; for \input or \include.  This will run `TeX-run-style-hooks' on
    ;; subfile(s) when master file is loaded.
    (TeX-auto-add-regexp
     `(,(concat
-       "\\\\subfile"
+       "\\\\subfile\\(?:include\\)?"
        "{\\(\\.*[^#}%\\\\\\.\n\r]+\\)\\(\\.[^#}%\\\\\\.\n\r]+\\)?}")
       1 TeX-auto-file))
 
    ;; Tell RefTeX the same thing.
    (when (and (boundp 'reftex-include-file-commands)
-             (not (member "subfile" reftex-include-file-commands)))
-     (add-to-list 'reftex-include-file-commands "subfile" t)
+             (not (string-match "subfile"
+                                (mapconcat #'identity
+                                           reftex-include-file-commands
+                                           "|"))))
+     (make-local-variable 'reftex-include-file-commands)
+     (add-to-list 'reftex-include-file-commands "subfile\\(?:include\\)?" t)
      (reftex-compile-variables))
 
-   ;; The following code will fontify `\subfile{}' like \input.
+   ;; The following code will fontify \subfile{} and
+   ;; \subfileinclude{} like \input.
    (when (and (featurep 'font-latex)
              (eq TeX-install-font-lock 'font-latex-setup))
-     (font-latex-add-keywords '(("subfile" "{"))
+     (font-latex-add-keywords '(("subfile"        "{")
+                               ("subfileinclude" "{"))
                              'reference)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; subfiles.el ends here
diff --git a/style/swedish.el b/style/swedish.el
index adbfdda..0cef29e 100644
--- a/style/swedish.el
+++ b/style/swedish.el
@@ -1,9 +1,12 @@
-;;; swedish.el --- Setup AUCTeX for editing Swedish text.
+;;; swedish.el --- Setup AUCTeX for editing Swedish text.  -*- 
lexical-binding: t; -*-
 
 ;;; Commentary:
 ;;
 ;; Apparently the Swedes use ''this style'' quotations.
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "swedish"
  (lambda ()
@@ -12,4 +15,4 @@
           `("swedish" "''" ,TeX-close-quote ,TeX-quote-after-quote)))
    (setq LaTeX-babel-hyphen-language "swedish")
    (run-hooks 'TeX-language-sv-hook))
- LaTeX-dialect)
+ TeX-dialect)
diff --git a/style/tabularx.el b/style/tabularx.el
index 2d484db..274ad4f 100644
--- a/style/tabularx.el
+++ b/style/tabularx.el
@@ -1,6 +1,6 @@
-;;; tabularx.el --- AUCTeX style for the tabularx package.
+;;; tabularx.el --- AUCTeX style for the tabularx package.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2009, 2013-2016 Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2013-2016, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-tabularx-package-options
   '("infoshow" "debugshow")
   "Package options for the tabularx package.")
@@ -65,6 +68,6 @@
    ;; `tabularx.sty' adds one new column specification letter.
    (set (make-local-variable 'LaTeX-array-column-letters)
        (concat LaTeX-array-column-letters "X")))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; tabularx.el ends here
diff --git a/style/tabulary.el b/style/tabulary.el
index aa0fcf5..18c1f41 100644
--- a/style/tabulary.el
+++ b/style/tabulary.el
@@ -1,6 +1,6 @@
-;;; tabulary.el --- AUCTeX style for the tabulary package.
+;;; tabulary.el --- AUCTeX style for the tabulary package.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2013-2016 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2016, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-tabulary-package-options
   '("debugshow")
   "Package options for the tabulary package.")
@@ -62,6 +65,6 @@
    ;; `tabulary.sty' adds some new column specification letters.
    (set (make-local-variable 'LaTeX-array-column-letters)
        (concat LaTeX-array-column-letters "L" "C" "R" "J")))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; tabulary.el ends here
diff --git a/style/tarticle.el b/style/tarticle.el
index f1bde04..c4381d3 100644
--- a/style/tarticle.el
+++ b/style/tarticle.el
@@ -1,6 +1,6 @@
-;;; tarticle.el - Special code for tarticle class.
+;;; tarticle.el - Special code for tarticle class.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2017 Free Software Foundation, Inc.
+;; Copyright (C) 2017, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ikumi Keita <ikumi@ikumi.que.jp>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-load-style "jarticle")
 (defvar LaTeX-tarticle-class-options LaTeX-jarticle-class-options
   "Class options for the tarticle class.")
@@ -38,6 +40,6 @@
  "tarticle"
  (lambda ()
    (TeX-run-style-hooks "jarticle" "plext"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; tarticle.el ends here
diff --git a/style/tbook.el b/style/tbook.el
index 5c4167a..6b36056 100644
--- a/style/tbook.el
+++ b/style/tbook.el
@@ -1,6 +1,6 @@
-;;; tbook.el - Special code for tbook class.
+;;; tbook.el - Special code for tbook class.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2017 Free Software Foundation, Inc.
+;; Copyright (C) 2017, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ikumi Keita <ikumi@ikumi.que.jp>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-load-style "jbook")
 (defvar LaTeX-tbook-class-options LaTeX-jbook-class-options
   "Class options for the tbook class.")
@@ -38,6 +40,6 @@
  "tbook"
  (lambda ()
    (TeX-run-style-hooks "jbook" "plext"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; tbook.el ends here
diff --git a/style/tcolorbox.el b/style/tcolorbox.el
index cae2662..d2aa27a 100644
--- a/style/tcolorbox.el
+++ b/style/tcolorbox.el
@@ -1,6 +1,6 @@
-;;; tcolorbox.el --- AUCTeX style for `tcolorbox.sty' (v4.00)
+;;; tcolorbox.el --- AUCTeX style for `tcolorbox.sty' (v4.00)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Tassilo Horn <tsdh@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -586,7 +586,7 @@ e.g. \"tcolorboxlib-raster.el\"."
     '("tcbuselibrary"
       (TeX-arg-eval mapconcat #'identity
                    (TeX-completing-read-multiple
-                    (TeX-argument-prompt optional nil "Libraries")
+                    (TeX-argument-prompt nil nil "Libraries")
                     LaTeX-tcolorbox-library-list) ","))
 
     ;; 3 Macros for Box Creation
@@ -599,7 +599,7 @@ e.g. \"tcolorboxlib-raster.el\"."
       (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local))
 
     '("tcbox"
-      [ TeX-arg-eval TeX-read-key-val optional
+      [ TeX-arg-eval TeX-read-key-val t
                     (append
                      LaTeX-tcolorbox-tcbox-options
                      LaTeX-tcolorbox-keyval-options-local) ]
@@ -614,7 +614,7 @@ e.g. \"tcolorboxlib-raster.el\"."
     '("renewtcolorbox"
       [ TeX-arg-key-val LaTeX-tcolorbox-init-options ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Color box")
+                   (TeX-argument-prompt nil nil "Color box")
                    (LaTeX-tcolorbox-newtcolorbox-list))
       [ TeX-arg-define-macro-arguments ]
       (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local))
@@ -630,7 +630,7 @@ e.g. \"tcolorboxlib-raster.el\"."
       (TeX-arg-eval
        (lambda ()
         (let ((macro (completing-read
-                      (TeX-argument-prompt optional nil "Macro: \\" t)
+                      (TeX-argument-prompt nil nil "Macro: \\" t)
                       (LaTeX-tcolorbox-newtcbox-list))))
           (concat TeX-esc macro))))
       [ TeX-arg-define-macro-arguments ]
@@ -652,7 +652,7 @@ e.g. \"tcolorboxlib-raster.el\"."
     ;; 5.2 Lists of tcolorboxes
     '("tcblistof"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Macro")
+                    (TeX-argument-prompt t nil "Macro")
                     (if (< (LaTeX-largest-level) 2)
                         '("\\chapter" "\\section" "\\subsection" 
"\\subsubsection")
                       '("\\section" "\\subsection" "\\subsubsection")) ]
@@ -697,7 +697,7 @@ e.g. \"tcolorboxlib-raster.el\"."
                                ("tcolorboxenvironment" "{{")
                                ("tcbsetmanagedlayer"   "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-tcolorbox-package-options LaTeX-tcolorbox-library-list
   "Package options for the tcolorbox package.")
diff --git a/style/tcolorboxlib-raster.el b/style/tcolorboxlib-raster.el
index 8d0ab79..91d4918 100644
--- a/style/tcolorboxlib-raster.el
+++ b/style/tcolorboxlib-raster.el
@@ -1,6 +1,6 @@
-;;; tcolorboxlib-raster.el --- AUCTeX style for `raster' library from tcolorbox
+;;; tcolorboxlib-raster.el --- AUCTeX style for `raster' library from 
tcolorbox  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -195,6 +198,6 @@
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("tcbitem" "["))
                              'textual)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; tcolorboxlib-raster.el ends here
diff --git a/style/tex-live.el b/style/tex-live.el
index 0750d91..45ae12b 100644
--- a/style/tex-live.el
+++ b/style/tex-live.el
@@ -1,4 +1,4 @@
-;;; tex-live.el --- AUCTeX style for `tex-live.sty'
+;;; tex-live.el --- AUCTeX style for `tex-live.sty'  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 2020 Free Software Foundation, Inc.
 
@@ -33,6 +33,11 @@
 ;; fontification is not ideal.  But this might be a starting point for
 ;; TeXLive documentation editors who use AUCTeX.
 
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function LaTeX-add-fancyvrb-environments
                  "fancyvrb"
@@ -78,7 +83,7 @@
     '("boxedverbatiminput" LaTeX-fancyvrb-arg-file-relative)
     '("listinginput"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Value of firstnumber 
key")
+                   (TeX-argument-prompt nil nil "Value of firstnumber key")
                    (cadr (assoc "firstnumber" 
LaTeX-fancyvrb-key-val-options-local)))
       LaTeX-fancyvrb-arg-file-relative)
 
@@ -91,7 +96,7 @@
     '("filename" "Directory")
     '("envname"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Environment")
+                   (TeX-argument-prompt nil nil "Environment")
                    '("TEXMFCACHE"
                      "TEXMFCNF"
                      "TEXMFCONFIG"
@@ -166,6 +171,6 @@
                              'italic-command)
      (font-latex-add-keywords '(("Ucom" "{"))
                              'bold-command)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; tex-live.el ends here
diff --git a/style/textcomp.el b/style/textcomp.el
index 17d0a0d..c48316c 100644
--- a/style/textcomp.el
+++ b/style/textcomp.el
@@ -1,4 +1,4 @@
-;;; textcomp.el --- AUCTeX style for `textcomp.sty' (v2.0n)
+;;; textcomp.el --- AUCTeX style for `textcomp.sty' (v2.0n)  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2014, 2017, 2020 Free Software Foundation, Inc.
 
diff --git a/style/textpos.el b/style/textpos.el
index 86f9728..4a143bb 100644
--- a/style/textpos.el
+++ b/style/textpos.el
@@ -1,6 +1,6 @@
-;;; textpos.el --- AUCTeX style for `textpos.sty' version v1.7j
+;;; textpos.el --- AUCTeX style for `textpos.sty' version v1.7j  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2016 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2016, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function LaTeX-color-definecolor-list "color" ())
 (declare-function LaTeX-xcolor-definecolor-list "xcolor" ())
@@ -114,7 +117,7 @@ them."
 
    ;; Add the lengths defined by textpos.sty
    (LaTeX-add-lengths "TPHorizModule" "TPVertModule" "TPboxrulesize"))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-textpos-package-options
   '("showboxes" "noshowtext" "absolute" "overlay" "verbose" "quiet")
diff --git a/style/theorem.el b/style/theorem.el
index 7b595e5..204f909 100644
--- a/style/theorem.el
+++ b/style/theorem.el
@@ -1,6 +1,6 @@
-;;; theorem.el --- AUCTeX style for `theorem.sty' (v2.2c)
+;;; theorem.el --- AUCTeX style for `theorem.sty' (v2.2c)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -36,6 +36,10 @@
 
 ;;; Code:
 
+(require 'crm)
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -99,9 +103,6 @@ RefTeX users should customize or add ENVIRONMENT to
     (LaTeX-newline)
     (indent-according-to-mode)))
 
-;; Needed for auto-parsing
-(require 'tex)
-
 ;; Setup parsing for \newtheorem
 (TeX-auto-add-type "theorem-newtheorem" "LaTeX")
 
@@ -171,7 +172,7 @@ make them available as new environments."
                                ("theorempreskipamount"  "{")
                                ("theorempostskipamount" "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-theorem-package-options nil
   "Package options for the theorem package.")
diff --git a/style/thm-restate.el b/style/thm-restate.el
index 2176515..8592556 100644
--- a/style/thm-restate.el
+++ b/style/thm-restate.el
@@ -1,6 +1,6 @@
-;;; thm-restate.el --- AUCTeX style for `thm-restate.sty' (v66)
+;;; thm-restate.el --- AUCTeX style for `thm-restate.sty' (v66)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -34,6 +34,7 @@
 
 ;; Needed for auto-parsing.
 (require 'tex)
+(require 'latex)
 
 ;; Silence the parser:
 (declare-function LaTeX-thmtools-declaretheorem-list
@@ -114,6 +115,6 @@
    (LaTeX-add-environments
     '("restatable"  LaTeX-env-args LaTeX-env-thmrestate-restatable)
     '("restatable*" LaTeX-env-args LaTeX-env-thmrestate-restatable)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; thm-restate.el ends here
diff --git a/style/thmtools.el b/style/thmtools.el
index 20ddb69..9e155d2 100644
--- a/style/thmtools.el
+++ b/style/thmtools.el
@@ -1,6 +1,6 @@
-;;; thmtools.el --- AUCTeX style for `thmtools.sty' (v67)
+;;; thmtools.el --- AUCTeX style for `thmtools.sty' (v67)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2018, 2019 Free Software Foundation, Inc.
+;; Copyright (C) 2018--2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -161,7 +161,8 @@ minibuffer.  PROMPT replaces the standard one."
        ("refname")
        ("Refname")
        ("shaded" ("textwidth" "bgcolor" "rulecolor" "rulewidth" "margin"))
-       ("thmbox" ("L" "M" "S"))))))
+       ("thmbox" ("L" "M" "S")))
+     prompt)))
 
 (defun LaTeX-arg-thmtools-declaretheorem (optional &optional prompt)
   "Insert the key=val and environment name defined by \\declaretheorem.
@@ -204,7 +205,8 @@ minibuffer.  PROMPT replaces the standard one."
        ("show" ,thms)
        ("ignoreall" ("true" "false"))
        ("showall" ("true" "false"))
-       ("title")))))
+       ("title"))
+     prompt)))
 
 (defun LaTeX-arg-thmtools-listoftheorems (optional &optional prompt)
   "Insert the key=val to \\listoftheorems macro.
@@ -270,7 +272,7 @@ RefTeX users should customize or add ENVIRONMENT to
     '("ignoretheorems"
       (TeX-arg-eval mapconcat #'identity
                    (TeX-completing-read-multiple
-                    (TeX-argument-prompt optional nil "Environment(s)")
+                    (TeX-argument-prompt nil nil "Environment(s)")
                     (append
                      ;; check for \newtheorem from amsthm.sty:
                      (when (and (fboundp 'LaTeX-amsthm-newtheorem-list)
@@ -293,7 +295,7 @@ RefTeX users should customize or add ENVIRONMENT to
                                ("listoftheorems"       "[")
                                ("ignoretheorems"       "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;; The package has only one option `debug'.  We ignore that in order
 ;; to make loading faster:
diff --git a/style/tikz.el b/style/tikz.el
index ded4d25..25a67b4 100644
--- a/style/tikz.el
+++ b/style/tikz.el
@@ -1,4 +1,4 @@
-;;; tikz.el --- AUCTeX style for `tikz.sty'
+;;; tikz.el --- AUCTeX style for `tikz.sty'  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2016, 2020 Free Software Foundation, Inc.
 
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (defcustom TeX-TikZ-point-name-regexp
   "(\\([A-Za-z0-9]+\\))"
   "A regexp that matches TikZ names."
diff --git a/style/titleps.el b/style/titleps.el
index 5580fbb..eda601c 100644
--- a/style/titleps.el
+++ b/style/titleps.el
@@ -1,6 +1,6 @@
-;;; titleps.el --- AUCTeX style for `titleps.sty' (v1.1.1)
+;;; titleps.el --- AUCTeX style for `titleps.sty' (v1.1.1)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -78,7 +81,7 @@ Removal is based on the return value of function
       (TeX-arg-eval
        (lambda ()
         (let ((ps (TeX-read-string
-                   (TeX-argument-prompt optional nil "Page style"))))
+                   (TeX-argument-prompt nil nil "Page style"))))
           (LaTeX-add-pagestyles ps)
           (format "%s" ps))))
       (TeX-arg-conditional (y-or-n-p "With optional global style? ")
@@ -106,14 +109,14 @@ Removal is based on the return value of function
     '("settitlemarks"
       (TeX-arg-eval mapconcat #'identity
                    (TeX-completing-read-multiple
-                    (TeX-argument-prompt optional nil "Level names")
+                    (TeX-argument-prompt nil nil "Level names")
                     (LaTeX-titleps-section-command-list))
                    ","))
 
     '("settitlemarks"
       (TeX-arg-eval mapconcat #'identity
                    (TeX-completing-read-multiple
-                    (TeX-argument-prompt optional nil "Level names")
+                    (TeX-argument-prompt nil nil "Level names")
                     (LaTeX-titleps-section-command-list))
                    ","))
 
@@ -140,12 +143,12 @@ Removal is based on the return value of function
 
     '("TitlepsPatchSection"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Sectioning command")
+                   (TeX-argument-prompt nil nil "Sectioning command")
                    (LaTeX-titleps-section-command-list)))
 
     '("TitlepsPatchSection*"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Sectioning command")
+                   (TeX-argument-prompt nil nil "Sectioning command")
                    (LaTeX-titleps-section-command-list)))
 
     ;; 5. Marks
@@ -161,13 +164,13 @@ Removal is based on the return value of function
 
     '("pretitlemark"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Sectioning command")
+                   (TeX-argument-prompt nil nil "Sectioning command")
                    (LaTeX-titleps-section-command-list))
       "Text")
 
     '("pretitlemark*"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Sectioning command")
+                   (TeX-argument-prompt nil nil "Sectioning command")
                    (LaTeX-titleps-section-command-list))
       "Text")
 
@@ -219,7 +222,7 @@ Removal is based on the return value of function
                                ("nextfloathead"        "*[[[{{{{[")
                                ("nextfloatfoot"        "*[[[{{{{["))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-titleps-package-options
   '(;; 4. Headline/footline width
diff --git a/style/titlesec.el b/style/titlesec.el
index e8922af..bdec21c 100644
--- a/style/titlesec.el
+++ b/style/titlesec.el
@@ -1,6 +1,6 @@
-;;; titlesec.el --- AUCTeX style for `titlesec.sty' (v2.11)
+;;; titlesec.el --- AUCTeX style for `titlesec.sty' (v2.11)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016--2019 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -121,7 +124,7 @@ insert the argument in brackets."
     '("titleformat"
       (LaTeX-arg-titlesec-titlespec)
       [TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Shape")
+                   (TeX-argument-prompt t nil "Shape")
                    LaTeX-titlesec-section-shape-list]
       (TeX-arg-conditional (y-or-n-p "With optional after-code? ")
                           (4 [nil])
@@ -158,7 +161,7 @@ insert the argument in brackets."
     ;; 3.4. Rules
     '("titleline"
       [TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Alignment")
+                   (TeX-argument-prompt t nil "Alignment")
                    '("l" "r" "c")]
       t)
 
@@ -171,20 +174,20 @@ insert the argument in brackets."
     ;; 3.5. Page styles
     '("assignpagestyle"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Sectioning command")
+                   (TeX-argument-prompt nil nil "Sectioning command")
                    (LaTeX-titlesec-section-command-list))
       (TeX-arg-pagestyle))
 
     ;; 3.9. Creating new levels and changing the class
     '("titleclass"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Sectioning command")
+                   (TeX-argument-prompt nil nil "Sectioning command")
                    (LaTeX-titlesec-section-command-list))
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Class")
+                   (TeX-argument-prompt nil nil "Class")
                    '("page" "top" "straight"))
       [TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Super level command")
+                   (TeX-argument-prompt t nil "Super level command")
                    (LaTeX-titlesec-section-command-list)]) )
 
    ;; 3.4. Rules: A variant of \titleline to be used only with calcwidth
@@ -192,7 +195,7 @@ insert the argument in brackets."
      (TeX-add-symbols
       '("titleline*"
        (TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Alignment")
+                     (TeX-argument-prompt nil nil "Alignment")
                      '("l" "r" "c"))
        t)))
 
@@ -222,7 +225,7 @@ insert the argument in brackets."
                                ("assignpagestyle"   "{{")
                                ("titleclass"        "{[{["))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-titlesec-package-options
   '(;; 2.1. Format
diff --git a/style/titletoc.el b/style/titletoc.el
index 454fc9a..005875c 100644
--- a/style/titletoc.el
+++ b/style/titletoc.el
@@ -1,6 +1,6 @@
-;;; titletoc.el --- AUCTeX style for `titletoc.sty' (v1.6)
+;;; titletoc.el --- AUCTeX style for `titletoc.sty' (v1.6)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2016, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -59,9 +62,6 @@ Removal is based on the return value of function
       (symbol-value 'LaTeX-titletoc-section-command-list)
     (remove "chapter" LaTeX-titletoc-section-command-list)))
 
-;; Needed for auto-parsing.
-(require 'tex)
-
 ;; Setup for \contentsuse:
 (TeX-auto-add-type "titletoc-contentsuse" "LaTeX")
 
@@ -99,7 +99,7 @@ Removal is based on the return value of function
     ;;                {<label width>}{<leader width>}
     '("dottedcontents"
       (TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Sectioning command")
+                    (TeX-argument-prompt nil nil "Sectioning command")
                     (LaTeX-titletoc-section-command-list))
       [ TeX-arg-length "Left margin" ] 3)
 
@@ -108,7 +108,7 @@ Removal is based on the return value of function
     ;;               {<filler-page-format>}[<below-code>]
     '("titlecontents"
       (TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Sectioning command")
+                    (TeX-argument-prompt nil nil "Sectioning command")
                     (LaTeX-titletoc-section-command-list))
       [ TeX-arg-length "Left margin" ]
       (TeX-arg-conditional (y-or-n-p "With optional below code argument? ")
@@ -120,7 +120,7 @@ Removal is based on the return value of function
     ;;                {<filler-page-format>}[<separator>]
     '("titlecontents*"
       (TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Sectioning command")
+                    (TeX-argument-prompt nil nil "Sectioning command")
                     (LaTeX-titletoc-section-command-list))
       [ TeX-arg-length "Left margin" ]
       (TeX-arg-conditional (y-or-n-p "With optional separator argument? ")
@@ -151,11 +151,11 @@ Removal is based on the return value of function
         (let ((name (if (and (member "newfloat" (TeX-active-styles))
                              (LaTeX-newfloat-DeclareFloatingEnvironment-list))
                         (completing-read
-                         (TeX-argument-prompt optional nil "Name of contents")
+                         (TeX-argument-prompt nil nil "Name of contents")
                          (mapcar #'car
                                  
(LaTeX-newfloat-DeclareFloatingEnvironment-list)))
                       (TeX-read-string
-                       (TeX-argument-prompt optional nil "Name of 
contents")))))
+                       (TeX-argument-prompt nil nil "Name of contents")))))
           (make-local-variable 'LaTeX-titletoc-section-command-list)
           (add-to-list 'LaTeX-titletoc-section-command-list name)
           (format "%s" name))))
@@ -189,7 +189,7 @@ Removal is based on the return value of function
                                ("contentsmargin"  "[{")
                                ("contentsuse"     "{{"))
                              'function)) )
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-titletoc-package-options
   '("leftlabels" "rightlabels" "dotinlabels")
diff --git a/style/transparent.el b/style/transparent.el
index 309eb01..c25b0b2 100644
--- a/style/transparent.el
+++ b/style/transparent.el
@@ -1,6 +1,6 @@
-;;; transparent.el --- AUCTeX style for `transparent.sty' (v1.0)
+;;; transparent.el --- AUCTeX style for `transparent.sty' (v1.0)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -50,7 +52,7 @@
                              'type-declaration)
      (font-latex-add-keywords '(("texttransparent" "{{"))
                              'type-command)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-transparent-package-options nil
   "Package options for the transparent package.")
diff --git a/style/treport.el b/style/treport.el
index 583b01f..f6aaf13 100644
--- a/style/treport.el
+++ b/style/treport.el
@@ -1,6 +1,6 @@
-;;; treport.el - Special code for treport class.
+;;; treport.el - Special code for treport class.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2017 Free Software Foundation, Inc.
+;; Copyright (C) 2017, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ikumi Keita <ikumi@ikumi.que.jp>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 (TeX-load-style "jreport")
 (defvar LaTeX-treport-class-options LaTeX-jreport-class-options
   "Class options for the treport class.")
@@ -38,6 +40,6 @@
  "treport"
  (lambda ()
    (TeX-run-style-hooks "jreport" "plext"))
- LaTeX-dialect)
+ TeX-dialect)
 
 ;;; treport.el ends here
diff --git a/style/ulem.el b/style/ulem.el
index 77bf1d3..d9e5e41 100644
--- a/style/ulem.el
+++ b/style/ulem.el
@@ -1,6 +1,6 @@
-;;; ulem.el --- AUCTeX style for `ulem.sty'
+;;; ulem.el --- AUCTeX style for `ulem.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2012, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2012, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Keywords: tex
@@ -28,6 +28,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -64,7 +66,7 @@
                                ("uwave" "{")
                                ("sout" "{")
                                ("xout" "{")) 'textual)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-arg-fontdecl
   (mapcar (lambda (str) (concat "\\" str))
diff --git a/style/unicode-math.el b/style/unicode-math.el
index 395e137..b87363d 100644
--- a/style/unicode-math.el
+++ b/style/unicode-math.el
@@ -1,6 +1,6 @@
-;;; unicode-math.el --- AUCTeX style for `unicode-math.sty' version 0.7e.
+;;; unicode-math.el --- AUCTeX style for `unicode-math.sty' version 0.7e.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2013, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <giordano.mose@libero.it>
@@ -29,6 +29,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -70,7 +73,7 @@
      (font-latex-add-keywords '(("setmathfont" "[{")
                                ("unimathsetup" "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-unicode-math-package-options ()
   "Prompt for package options for the unicode-math package."
diff --git a/style/units.el b/style/units.el
index f174453..b20132a 100644
--- a/style/units.el
+++ b/style/units.el
@@ -1,6 +1,6 @@
-;;; units.el --- AUCTeX style for the LaTeX package `units.sty' (v0.9b)
+;;; units.el --- AUCTeX style for the LaTeX package `units.sty' (v0.9b)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2004, 2005, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Christian Schlauer <cschl@arcor.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,6 +29,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -47,7 +49,7 @@
    (when (and (featurep 'font-latex)
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("unit" "[{") ("unitfrac" "[{{")) 'textual)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-units-package-options '("tight" "loose")
   "Package options for the units package.")
diff --git a/style/url.el b/style/url.el
index 740d2d7..418b772 100644
--- a/style/url.el
+++ b/style/url.el
@@ -1,4 +1,4 @@
-;;; url.el --- AUCTeX style for `url.sty'
+;;; url.el --- AUCTeX style for `url.sty'  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2004-2005, 2018, 2020 Free Software Foundation, Inc.
 
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -92,7 +95,7 @@
                              'variable)
      ;; Tell font-lock about the update.
      (font-latex-set-syntactic-keywords)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun TeX-arg-urlstyle (optional &optional prompt)
   "Prompt for style used in \\urlstyle with completion."
diff --git a/style/varioref.el b/style/varioref.el
index d5e7e0d..5ab7adb 100644
--- a/style/varioref.el
+++ b/style/varioref.el
@@ -1,6 +1,6 @@
-;;; varioref.el --- AUCTeX style for `varioref.sty' (v1.6b)
+;;; varioref.el --- AUCTeX style for `varioref.sty' (v1.6b)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1999, 2013, 2015, 2018, 2019 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2013, 2015, 2018--2020 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@strw.leidenuniv.nl>
 ;;         Mads Jensen <mje@inducks.org>
@@ -30,6 +30,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'tex-style)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -94,7 +97,7 @@
    (and LaTeX-reftex-ref-style-auto-activate
        (fboundp 'reftex-ref-style-activate)
        (reftex-ref-style-activate "Varioref")))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-varioref-package-options
   '("afrikaans" "american" "arabic" "austrian" "naustrian" "basque"
diff --git a/style/verbatim.el b/style/verbatim.el
index d4cb5fe..cd6a0b8 100644
--- a/style/verbatim.el
+++ b/style/verbatim.el
@@ -1,4 +1,4 @@
-;;; verbatim.el --- Style hook for the verbatim package.
+;;; verbatim.el --- Style hook for the verbatim package.  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 2001, 2020 Free Software Foundation, Inc.
 
@@ -29,6 +29,9 @@
 
 ;;; Code
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-set-syntactic-keywords
                  "font-latex")
@@ -54,7 +57,7 @@
                    (1 "!" t)))
      ;; Tell font-lock about the update.
      (font-latex-set-syntactic-keywords)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-verbatim-package-options nil
   "Package options for the verbatim package.")
diff --git a/style/virtex.el b/style/virtex.el
index e774b46..c4571ad 100644
--- a/style/virtex.el
+++ b/style/virtex.el
@@ -1,83 +1,86 @@
-;;; virtex.el - Common code for all TeX formats.
+;;; virtex.el - Common code for all TeX formats.  -*- lexical-binding: t; -*-
 
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 
 ;;; Code:
 
-(TeX-add-style-hook "virtex"
-  (lambda ()
-    (TeX-add-symbols "/" "above" "abovedisplayshortskip"
-                    "abovedisplayskip" "abovewithdelims" "accent"
-                    "adjdemerits" "advance" "afterassignment"
-                    "aftergroup" "atop" "atopwithdelims" "badness"
-                    "baselineskip" "batchmode" "begingroup"
-                    "belowdisplayshortskip" "belowdisplayskip"
-                    "binoppenalty" "botmark" "box" "boxmaxdepth"
-                    "brokenpenalty" "catcode" "char" "chardef"
-                    "cleaders" "closein" "closeout" "clubpenalty"
-                    "copy" "count" "countdef" "cr" "crcr" "csname"
-                    "day" "deadcycles" "def" "defaulthyphenchar"
-                    "defaultskewchar" "delcode" "delimiter"
-                    "delimiterfactor" "delimitershortfall" "dimen"
-                    "dimendef" "discretionary" "displayindent"
-                    "displaylimits" "displaystyle"
-                    "displaywidowpenalty" "displaywidth" "divide"
-                    "doublehyphendemerits" "dp" "dump" "edef" "else"
-                    "emergencystretch" "end" "endcsname" "endgroup"
-                    "endinput" "endlinechar" "eqno" "errhelp"
-                    "errmessage" "errorcontextlines" "errorstopmode"
-                    "escapechar" "everycr" "everydisplay"
-                    "everyhbox" "everyjob" "everymath" "everypar"
-                    "everyvbox" "exhyphenpenalty" "expandafter"
-                    "fam" "fi" "finalhyphendemerits" "firstmark"
-                    "floatingpenalty" "font" "fontdimen" "fontname"
-                    "futurelet" "gdef" "global" "globaldefs"
-                    "halign" "hangafter" "hangindent" "hbadness"
-                    "hbox" "hfil" "hfill" "hfilneg" "hfuzz"
-                    "hoffset" "holdinginserts" "hrule" "hsize"
-                    "hskip" "hss" "ht" "hyphenpenation" "hyphenchar"
-                    "hyphenpenalty" "if" "ifcase" "ifcat" "ifdim"
-                    "ifeof" "iffalse" "ifhbox" "ifinner" "ifhmode"
-                    "ifmmode" "ifnum" "ifodd" "iftrue" "ifvbox"
-                    "ifvoid" "ifx" "ignorespaces" "immediate"
-                    "indent" "input" "inputlineno" "insert"
-                    "insertpenalties" "interlinepenalty" "jobname"
-                    "kern" "language" "lastbox" "lastkern"
-                    "lastpenalty" "lastskip" "lccode" "leaders"
-                    "left" "lefthyphenmin" "leftskip" "leqno" "let"
-                    "limits" "linepenalty" "lineskip"
-                    "lineskiplimit" "long" "looseness" "lower"
-                    "lowercase" "mag" "markaccent" "mathbin"
-                    "mathchar" "mathchardef" "mathchoise"
-                    "mathclose" "mathcode" "mathinner" "mathhop"
-                    "mathopen" "mathord" "mathpunct" "mathrel"
-                    "mathsurround" "maxdeadcycles" "maxdepth"
-                    "meaning" "medmuskip" "message" "mkern" "month"
-                    "moveleft" "moveright" "mskip" "multiply"
-                    "muskip" "muskipdef" "newlinechar" "noalign"
-                    "noboundary" "noexpand" "noindent" "nolimits"
-                    "nonscript" "nonstopmode" "nulldelimiterspace"
-                    "nullfont" "number" "omit" "openin" "openout"
-                    "or" "outer" "output" "outputpenalty"
-                    "overfullrule" "parfillskip" "parindent"
-                    "parskip" "pausing" "postdisplaypenalty"
-                    "predisplaypenalty" "predisplaysize"
-                    "pretolerance" "relpenalty" "rightskip"
-                    "scriptspace" "showboxbreadth" "showboxdepth"
-                    "smallskipamount" "spaceskip" "splitmaxdepth"
-                    "splittopskip" "tabskip" "thickmuskip"
-                    "thinmuskip" "time" "tolerance" "topskip"
-                    "tracingcommands" "tracinglostchars"
-                    "tracingmacros" "tracingonline" "tracingoutput"
-                    "tracingpages" "tracingparagraphs"
-                    "tracingrestores" "tracingstats" "uccode"
-                    "uchyph" "underline" "unhbox" "unhcopy" "unkern"
-                    "unpenalty" "unskip" "unvbox" "unvcopy"
-                    "uppercase" "vadjust" "valign" "vbadness" "vbox"
-                    "vcenter" "vfil" "vfill" "vfilneg" "vfuzz"
-                    "voffset" "vrule" "vsize" "vskip" "vss" "vtop"
-                    "wd" "widowpenalty" "write" "xdef" "xleaders"
-                    "xspaceskip" "year"))
-  LaTeX-dialect)
+(require 'tex)
+
+(TeX-add-style-hook
+ "virtex"
+ (lambda ()
+   (TeX-add-symbols "/" "above" "abovedisplayshortskip"
+                   "abovedisplayskip" "abovewithdelims" "accent"
+                   "adjdemerits" "advance" "afterassignment"
+                   "aftergroup" "atop" "atopwithdelims" "badness"
+                   "baselineskip" "batchmode" "begingroup"
+                   "belowdisplayshortskip" "belowdisplayskip"
+                   "binoppenalty" "botmark" "box" "boxmaxdepth"
+                   "brokenpenalty" "catcode" "char" "chardef"
+                   "cleaders" "closein" "closeout" "clubpenalty"
+                   "copy" "count" "countdef" "cr" "crcr" "csname"
+                   "day" "deadcycles" "def" "defaulthyphenchar"
+                   "defaultskewchar" "delcode" "delimiter"
+                   "delimiterfactor" "delimitershortfall" "dimen"
+                   "dimendef" "discretionary" "displayindent"
+                   "displaylimits" "displaystyle"
+                   "displaywidowpenalty" "displaywidth" "divide"
+                   "doublehyphendemerits" "dp" "dump" "edef" "else"
+                   "emergencystretch" "end" "endcsname" "endgroup"
+                   "endinput" "endlinechar" "eqno" "errhelp"
+                   "errmessage" "errorcontextlines" "errorstopmode"
+                   "escapechar" "everycr" "everydisplay"
+                   "everyhbox" "everyjob" "everymath" "everypar"
+                   "everyvbox" "exhyphenpenalty" "expandafter"
+                   "fam" "fi" "finalhyphendemerits" "firstmark"
+                   "floatingpenalty" "font" "fontdimen" "fontname"
+                   "futurelet" "gdef" "global" "globaldefs"
+                   "halign" "hangafter" "hangindent" "hbadness"
+                   "hbox" "hfil" "hfill" "hfilneg" "hfuzz"
+                   "hoffset" "holdinginserts" "hrule" "hsize"
+                   "hskip" "hss" "ht" "hyphenpenation" "hyphenchar"
+                   "hyphenpenalty" "if" "ifcase" "ifcat" "ifdim"
+                   "ifeof" "iffalse" "ifhbox" "ifinner" "ifhmode"
+                   "ifmmode" "ifnum" "ifodd" "iftrue" "ifvbox"
+                   "ifvoid" "ifx" "ignorespaces" "immediate"
+                   "indent" "input" "inputlineno" "insert"
+                   "insertpenalties" "interlinepenalty" "jobname"
+                   "kern" "language" "lastbox" "lastkern"
+                   "lastpenalty" "lastskip" "lccode" "leaders"
+                   "left" "lefthyphenmin" "leftskip" "leqno" "let"
+                   "limits" "linepenalty" "lineskip"
+                   "lineskiplimit" "long" "looseness" "lower"
+                   "lowercase" "mag" "markaccent" "mathbin"
+                   "mathchar" "mathchardef" "mathchoise"
+                   "mathclose" "mathcode" "mathinner" "mathhop"
+                   "mathopen" "mathord" "mathpunct" "mathrel"
+                   "mathsurround" "maxdeadcycles" "maxdepth"
+                   "meaning" "medmuskip" "message" "mkern" "month"
+                   "moveleft" "moveright" "mskip" "multiply"
+                   "muskip" "muskipdef" "newlinechar" "noalign"
+                   "noboundary" "noexpand" "noindent" "nolimits"
+                   "nonscript" "nonstopmode" "nulldelimiterspace"
+                   "nullfont" "number" "omit" "openin" "openout"
+                   "or" "outer" "output" "outputpenalty"
+                   "overfullrule" "parfillskip" "parindent"
+                   "parskip" "pausing" "postdisplaypenalty"
+                   "predisplaypenalty" "predisplaysize"
+                   "pretolerance" "relpenalty" "rightskip"
+                   "scriptspace" "showboxbreadth" "showboxdepth"
+                   "smallskipamount" "spaceskip" "splitmaxdepth"
+                   "splittopskip" "tabskip" "thickmuskip"
+                   "thinmuskip" "time" "tolerance" "topskip"
+                   "tracingcommands" "tracinglostchars"
+                   "tracingmacros" "tracingonline" "tracingoutput"
+                   "tracingpages" "tracingparagraphs"
+                   "tracingrestores" "tracingstats" "uccode"
+                   "uchyph" "underline" "unhbox" "unhcopy" "unkern"
+                   "unpenalty" "unskip" "unvbox" "unvcopy"
+                   "uppercase" "vadjust" "valign" "vbadness" "vbox"
+                   "vcenter" "vfil" "vfill" "vfilneg" "vfuzz"
+                   "voffset" "vrule" "vsize" "vskip" "vss" "vtop"
+                   "wd" "widowpenalty" "write" "xdef" "xleaders"
+                   "xspaceskip" "year"))
+ TeX-dialect)
 
 ;;; virtex.el ends here
diff --git a/style/vwcol.el b/style/vwcol.el
index c85e815..0adb34e 100644
--- a/style/vwcol.el
+++ b/style/vwcol.el
@@ -1,6 +1,6 @@
-;;; vwcol.el --- AUCTeX style for `vwcol.sty' (v0.2)
+;;; vwcol.el --- AUCTeX style for `vwcol.sty' (v0.2)  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2015, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -68,7 +71,7 @@
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("vwcolsetup" "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-vwcol-package-options '("quiet")
   "Package options for the vwcol package.")
diff --git a/style/wrapfig.el b/style/wrapfig.el
index 11fe473..414ebf6 100644
--- a/style/wrapfig.el
+++ b/style/wrapfig.el
@@ -1,4 +1,4 @@
-;;; wrapfig.el --- AUCTeX style for `wrapfig.sty' version v3.6
+;;; wrapfig.el --- AUCTeX style for `wrapfig.sty' version v3.6  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
 
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 (TeX-add-style-hook
  "wrapfig"
  (lambda ()
@@ -110,7 +113,7 @@
            (unless (string= overhang "")
              (format "[%s]" overhang))
            (format "{%s}" width))))))))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-wrapfig-package-options '("verbose")
   "Package options for the wrapfig package.")
diff --git a/style/xcolor.el b/style/xcolor.el
index 43c5637..d8eb9ce 100644
--- a/style/xcolor.el
+++ b/style/xcolor.el
@@ -1,6 +1,6 @@
-;; xcolor.el --- AUCTeX style for `xcolor.sty' (v2.12)
+;; xcolor.el --- AUCTeX style for `xcolor.sty' (v2.12)  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2016--2019 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -231,7 +231,7 @@ If NO-NAMED is non-nil, remove \"named\" and return the
 remainder."
   (if no-named
       (remove "named" LaTeX-xcolor-color-models)
-    (symbol-value 'LaTeX-xcolor-color-models)))
+    LaTeX-xcolor-color-models))
 
 ;; Needed for auto-parsing.
 (require 'tex)
@@ -284,7 +284,7 @@ xcolor package.")
 (defun TeX-arg-xcolor-definecolor (optional)
   "Insert arguments of \\definecolor and similar macros from xcolor.sty."
   ;; \definecolor[<type>]{<name>}{<model-list>}{<spec-list>}
-  (let* ((last-optional-rejected nil)
+  (let* ((TeX-last-optional-rejected nil)
         (xcoltype  (LaTeX-check-insert-macro-default-style
                     (completing-read
                      (TeX-argument-prompt t nil "Type")
@@ -311,7 +311,7 @@ xcolor package.")
 
 (defun TeX-arg-xcolor-definecolorset (optional)
   "Insert arguments of \\definecolorset and similar macros from xcolor.sty."
-  (let* ((last-optional-rejected nil)
+  (let* ((TeX-last-optional-rejected nil)
         (xcoltype (LaTeX-check-insert-macro-default-style
                    (completing-read
                     (TeX-argument-prompt t nil "Type")
@@ -326,7 +326,7 @@ xcolor package.")
 (defun TeX-arg-xcolor (optional)
   "Insert arguments of various color commands from xcolor.sty."
   ;; \color{<name>} or \color[<model-list>]{<spec-list>}
-  (let* ((last-optional-rejected nil)
+  (let* ((TeX-last-optional-rejected nil)
         (xcolmodel (LaTeX-check-insert-macro-default-style
                     (completing-read
                      (TeX-argument-prompt t nil "Model (list)")
@@ -344,14 +344,14 @@ xcolor package.")
 (defun TeX-arg-xcolor-fcolorbox (optional)
   "Insert arguments of \\fcolorbox from xcolor.sty."
   ;;\fcolorbox[<frame model>]{<frame spec>}[<background model>]{<background 
spec>}{<text>}
-  (let* ((last-optional-rejected nil)
+  (let* ((TeX-last-optional-rejected nil)
         (xfrmodel (LaTeX-check-insert-macro-default-style
                    (completing-read
                     (TeX-argument-prompt t nil "(Frame) Color model")
                     LaTeX-xcolor-color-models)))
-        ;; Set `last-optional-rejected' acc. to `xfrmodel'
-        (last-optional-rejected (or (not xfrmodel)
-                                    (and xfrmodel (string= xfrmodel ""))))
+        ;; Set `TeX-last-optional-rejected' acc. to `xfrmodel'
+        (TeX-last-optional-rejected (or (not xfrmodel)
+                                        (and xfrmodel (string= xfrmodel ""))))
         (xfrspec  (if (or (null xfrmodel)
                           (string= xfrmodel "")
                           (string= xfrmodel "named"))
@@ -418,19 +418,19 @@ xcolor package.")
     ;; \colorlet[<type>]{<name>}[<num model>]{<color>}
     '("colorlet"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Type")
-                    LaTeX-xcolor-type-color-models ]
+       (TeX-argument-prompt t nil "Type")
+       LaTeX-xcolor-type-color-models ]
       (TeX-arg-eval
        (lambda ()
         (let ((xcolor (TeX-read-string
-                       (TeX-argument-prompt optional nil "Color"))))
+                       (TeX-argument-prompt nil nil "Color"))))
           (LaTeX-add-xcolor-definecolors xcolor)
           (format "%s" xcolor))))
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Model")
-                    (LaTeX-xcolor-color-models t) ]
+       (TeX-argument-prompt t nil "Model")
+       (LaTeX-xcolor-color-models t) ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Color")
+                   (TeX-argument-prompt nil nil "Color")
                    (LaTeX-xcolor-definecolor-list)))
 
     ;; 2.5.3 Defining sets of colors
@@ -488,30 +488,30 @@ xcolor package.")
     ;; 2.7 Color blending
     '("blendcolors"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Mix expr")
+                   (TeX-argument-prompt nil nil "Mix expr")
                    (LaTeX-xcolor-definecolor-list)))
     '("blendcolors*"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Mix expr")
+                   (TeX-argument-prompt nil nil "Mix expr")
                    (LaTeX-xcolor-definecolor-list)))
 
     ;; 2.8 Color masks and separation
     '("maskcolors"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Model")
+                    (TeX-argument-prompt t nil "Model")
                     (LaTeX-xcolor-color-models t) ]
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Color")
+                   (TeX-argument-prompt nil nil "Color")
                    (LaTeX-xcolor-definecolor-list)))
 
     ;; 2.9 Color series
     '("definecolorseries"
       "Name"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Core model")
+                   (TeX-argument-prompt nil nil "Core model")
                    LaTeX-xcolor-core-color-models)
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Method")
+                   (TeX-argument-prompt nil nil "Method")
                    '("step" "grad" "last"))
       [ t ] nil [ nil ] nil)
 
@@ -521,14 +521,14 @@ xcolor package.")
     ;; \extractcolorspec{<color>}{<cmd>}
     '("extractcolorspec"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Color")
+                   (TeX-argument-prompt nil nil "Color")
                    (LaTeX-xcolor-definecolor-list))
       (TeX-arg-define-macro "Command: \\"))
 
     ;; \extractcolorspecs{<color>}{<model-cmd>}{<color-cmd>}
     '("extractcolorspecs"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Color")
+                   (TeX-argument-prompt nil nil "Color")
                    (LaTeX-xcolor-definecolor-list))
       (TeX-arg-define-macro "Model command: \\")
       (TeX-arg-define-macro "Color command: \\"))
@@ -541,12 +541,12 @@ xcolor package.")
     ;; \convertcolorspec{<model>}{<spec>}{<target model>}{cmd>}
     '("convertcolorspec"
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Model")
+                   (TeX-argument-prompt nil nil "Model")
                    (LaTeX-xcolor-color-models))
       (TeX-arg-eval TeX-read-string
-                   (TeX-argument-prompt optional nil "Spec"))
+                   (TeX-argument-prompt nil nil "Spec"))
       (TeX-arg-eval completing-read
-                   (TeX-argument-prompt optional nil "Model")
+                   (TeX-argument-prompt nil nil "Model")
                    (LaTeX-xcolor-color-models t))
       (TeX-arg-define-macro "Macro: \\")) ) ; close TeX-add-symbols
 
@@ -565,10 +565,10 @@ xcolor package.")
                             (ignore))
        "Row"
        (TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Odd-row color")
+                     (TeX-argument-prompt nil nil "Odd-row color")
                      (LaTeX-xcolor-definecolor-list))
        (TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Even-row color")
+                     (TeX-argument-prompt nil nil "Even-row color")
                      (LaTeX-xcolor-definecolor-list)))
       '("rowcolors*"
        (TeX-arg-conditional (y-or-n-p "With optional commands? ")
@@ -576,10 +576,10 @@ xcolor package.")
                             (ignore))
        "Row"
        (TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Odd-row color")
+                     (TeX-argument-prompt nil nil "Odd-row color")
                      (LaTeX-xcolor-definecolor-list))
        (TeX-arg-eval completing-read
-                     (TeX-argument-prompt optional nil "Even-row color")
+                     (TeX-argument-prompt nil nil "Even-row color")
                      (LaTeX-xcolor-definecolor-list)))
       '("showrowcolors" 0)
       '("hiderowcolors" 0))
@@ -589,8 +589,8 @@ xcolor package.")
    (LaTeX-add-environments
     '("testcolors" LaTeX-env-args
       [ TeX-arg-eval mapconcat #'identity
-                    (TeX-completing-read-multiple
-                     (TeX-argument-prompt optional nil "Color models")
+                    (TeX-completing-read-multiple
+                     (TeX-argument-prompt t nil "Color models")
                      (LaTeX-xcolor-color-models t))
                     "," ] ))
 
@@ -623,7 +623,7 @@ xcolor package.")
                                ("convertcolorspec"  "{{{{")
                                ("rowcolors"         "*[{{{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-xcolor-package-options
   '(;; options that determine the color driver
diff --git a/style/xkcdcolors.el b/style/xkcdcolors.el
index acacfe2..f5f2444 100644
--- a/style/xkcdcolors.el
+++ b/style/xkcdcolors.el
@@ -1,6 +1,6 @@
-;;; xkcdcolors.el --- AUCTeX style for `xkcdcolors.sty' (v1.0.1)
+;;; xkcdcolors.el --- AUCTeX style for `xkcdcolors.sty' (v1.0.1)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019 Free Software Foundation, Inc.
+;; Copyright (C) 2019, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function LaTeX-add-xcolor-definecolors
                  "xcolor"
@@ -997,7 +999,7 @@
    (TeX-run-style-hooks "xcolor")
    ;; Make the colors defined in xkcdcolors.sty available:
    (apply #'LaTeX-add-xcolor-definecolors LaTeX-xkcdcolors-colornames))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-xkcdcolors-package-options nil
   "Package options for the xkcdcolors package.")
diff --git a/style/xltabular.el b/style/xltabular.el
index af34313..04ce22c 100644
--- a/style/xltabular.el
+++ b/style/xltabular.el
@@ -1,6 +1,6 @@
-;;; xltabular.el --- AUCTeX style for `xltabular.sty' (v0.05)
+;;; xltabular.el --- AUCTeX style for `xltabular.sty' (v0.05)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2017 Free Software Foundation, Inc.
+;; Copyright (C) 2017, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -29,6 +29,11 @@
 ;; This file adds support for `xltabular.sty' (v0.05) from 2017/10/26.
 ;; `xltabular.sty' is part of TeXLive.
 
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+
 (defvar LaTeX-xltabular-skipping-regexp
   (concat "[ \t]*" (regexp-opt '("[l]" "[r]" "[c]" "")) "[ \t]*{[^}]*}[ \t]*")
   "Regexp matching between \\begin{xltabular} and column specification.
@@ -120,7 +125,7 @@ If SUPPRESS is non-nil, do not insert line break macro."
    (when (fboundp 'reftex-add-label-environments)
      (reftex-add-label-environments
       '(("xltabular" ?t nil nil caption)))))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-xltabular-package-options nil
   "Package options for the xltabular package.")
diff --git a/style/xparse.el b/style/xparse.el
index 79ab604..1e54c6c 100644
--- a/style/xparse.el
+++ b/style/xparse.el
@@ -1,4 +1,4 @@
-;;; xparse.el --- AUCTeX style for `xparse.sty' version 2020-03-06
+;;; xparse.el --- AUCTeX style for `xparse.sty' version 2020-03-06  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2013, 2020 Free Software Foundation, Inc.
 
@@ -35,14 +35,14 @@
 
 ;;; Code:
 
+(require 'tex)
+(require 'latex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
                  (keywords class))
 
-;; Needed for auto-parsing.
-(require 'tex)
-
 (TeX-auto-add-type "xparse-macro" "LaTeX")
 
 (defvar LaTeX-xparse-macro-regexp
@@ -302,7 +302,7 @@ TYPE is one of the symobols mac or env."
                                ("ProvideDocumentEnvironment" "{{{{")
                                ("RenewDocumentEnvironment"   "{{{{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defun LaTeX-xparse-package-options ()
   "Read the xparse package options from the user."
diff --git a/style/xspace.el b/style/xspace.el
index 86c1e46..643060c 100644
--- a/style/xspace.el
+++ b/style/xspace.el
@@ -1,6 +1,6 @@
-;;; xspace.el --- AUCTeX style for `xspace.sty'
+;;; xspace.el --- AUCTeX style for `xspace.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2011, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2011, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,6 +30,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -50,7 +52,7 @@
                                ("xspaceaddexception" "{")
                                ("xspaceremoveexception" "{"))
                              'function)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-xspace-package-options nil
   "Package options for the xspace package.")
diff --git a/style/zlmtt.el b/style/zlmtt.el
index 2b075cf..2ee692c 100644
--- a/style/zlmtt.el
+++ b/style/zlmtt.el
@@ -1,6 +1,6 @@
-;;; zlmtt.el --- AUCTeX style for `zlmtt.sty' (v1.01)
+;;; zlmtt.el --- AUCTeX style for `zlmtt.sty' (v1.01)  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2014, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(require 'tex)
+
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                  "font-latex"
@@ -53,7 +55,7 @@
                                 ("monott"   "{")
                                 ("lctt"     "{"))
                               'type-command)))
- LaTeX-dialect)
+ TeX-dialect)
 
 (defvar LaTeX-zlmtt-package-options
   '("light" "l" "lightcondensed" "lc" "med" "m"
diff --git a/tests/japanese/preview-latex.el b/tests/japanese/preview-latex.el
index 41907df..5ca3d96 100644
--- a/tests/japanese/preview-latex.el
+++ b/tests/japanese/preview-latex.el
@@ -228,8 +228,7 @@ String encoded in `shift_jis' can have regexp meta 
characters in it."
          (setq process (TeX-inline-preview-internal
                         (preview-do-replacements
                          (TeX-command-expand
-                          (preview-string-expand preview-LaTeX-command)
-                          'TeX-master-file)
+                          (preview-string-expand preview-LaTeX-command))
                          preview-LaTeX-command-replacements)
                         dummyfile '(nil . nil) (current-buffer)
                         '(nil . (t . t)) dummyfile '(nil nil nil)))
@@ -263,8 +262,7 @@ String encoded in `shift_jis' can have regexp meta 
characters in it."
          (setq process (TeX-inline-preview-internal
                         (preview-do-replacements
                          (TeX-command-expand
-                          (preview-string-expand preview-LaTeX-command)
-                          'TeX-master-file)
+                          (preview-string-expand preview-LaTeX-command))
                          preview-dump-replacements)
                         dummyfile '(nil . nil) (current-buffer)
                         nil dummyfile '(nil nil nil)))
diff --git a/tests/tex/command-expansion.el b/tests/tex/command-expansion.el
index 0de5831..0bf661a 100644
--- a/tests/tex/command-expansion.el
+++ b/tests/tex/command-expansion.el
@@ -1,6 +1,6 @@
 ;;; command-expansion.el --- tests for TeX command expansion
 
-;; Copyright (C) 2014, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2018, 2020 Free Software Foundation, Inc.
 
 ;; This file is part of AUCTeX.
 
@@ -29,8 +29,7 @@
   (should (string=
            (let ((TeX-command-list
                  (list (cons "Test" '("%%%% %`%'" TeX-run-command t t)))))
-            (TeX-command-expand (nth 1 (assoc "Test" TeX-command-list))
-                                'TeX-master-file))
+            (TeX-command-expand (nth 1 (assoc "Test" TeX-command-list))))
            "%% ")))
 
 (ert-deftest TeX-command-expansion-errors ()
@@ -39,7 +38,7 @@
    ;; This error is actually thrown by `TeX-engine-in-engine-alist', but we 
want
    ;; to be sure that `TeX-command-expand' fails when the engine is not valid.
    (let ((TeX-engine 'non-existing-engine))
-     (TeX-command-expand "%l" 'TeX-master-file))))
+     (TeX-command-expand "%l"))))
 
 (ert-deftest TeX-view-command-raw-errors ()
   "Tests to trigger errors in `TeX-view-command-raw'."
@@ -89,13 +88,20 @@
   ;; Skip on w32 because the quoting style of `shell-quote-argument'
   ;; is different.
   (skip-unless (not (eq system-type 'windows-nt)))
-  (should (string=
-           (let ((major-mode 'latex-mode)
-                (TeX-engine 'default)
-                (TeX-master "/tmp/abc")
-                (TeX-command-extra-options " \"\\foo\""))
-            (TeX-command-expand "%`%(extraopts)%' %T" #'TeX-master-file))
-          " \"\\foo\" \"\\input\" \\\\detokenize\\{\\ abc.tex\\ \\}")))
+  (let ((major-mode 'latex-mode)
+       (TeX-engine 'default)
+       (TeX-command-extra-options " \"\\foo\"")
+       TeX-master)
+
+    (setq TeX-master "/tmp/abc")
+    (should (string=
+            (TeX-command-expand "%`%(extraopts)%' %T")
+            " \"\\foo\" \"\\input\" \\\\detokenize\\{\\ abc.tex\\ \\}"))
+
+    (setq TeX-master "/tmp/abc def")
+    (should (string=
+            (TeX-command-expand "%`%(extraopts)%' %T")
+            " \"\\foo\" \"\\input\" \\\\detokenize\\{\\ \\\"abc\\ 
def.tex\\\"\\ \\}"))))
 
 (ert-deftest TeX-command-expand-skip-file-name ()
   "Check whether file name is not subject to further expansion.
@@ -106,28 +112,26 @@ See 
<https://lists.gnu.org/r/bug-auctex/2014-08/msg00012.html>."
   ;; is different.
   (skip-unless (not (eq system-type 'windows-nt)))
   (let ((TeX-master "abc-def")
+       (TeX-output-extension "pdf")
        (TeX-expand-list '(("-" (lambda () ":")))))
     (should (string=
-            (TeX-command-expand "%s" #'TeX-master-file)
+            (TeX-command-expand "%s")
             TeX-master))
     (should (string=
-            (TeX-command-expand "%t" #'TeX-master-file)
+            (TeX-command-expand "%t")
             (TeX-master-file "tex" t)))
     (should (string=
-            (TeX-command-expand "%T" #'TeX-master-file)
+            (TeX-command-expand "%T")
             (TeX-master-file "tex" t)))
     (should (string=
-            (TeX-command-expand "%d" #'TeX-master-file)
+            (TeX-command-expand "%d")
             (TeX-master-file "dvi" t)))
     (should (string=
-            (TeX-command-expand "%f" #'TeX-master-file)
+            (TeX-command-expand "%f")
             (TeX-master-file "ps" t)))
-    ;; The expander of "%o" does not yet cater for this possible endless
-    ;; loop.
-    ;; (should (string=
-    ;;              (TeX-command-expand "%o" #'TeX-master-file)
-    ;;              (TeX-master-file "pdf" t)))
-    ))
+    (should (string=
+            (TeX-command-expand "%o")
+            (TeX-master-file "pdf" t)))))
 
 (ert-deftest TeX-command-expand-active-master ()
   "Test whether `TeX-active-master' is valid argument for 
`TeX-command-expand'."
@@ -138,11 +142,34 @@ See 
<https://lists.gnu.org/r/bug-auctex/2014-08/msg00012.html>."
        TeX-current-process-region-p)
     (setq TeX-current-process-region-p nil)
     (should (string=
-            (TeX-command-expand "%s" #'TeX-active-master)
+            (TeX-command-expand "%s")
             TeX-master))
     (setq TeX-current-process-region-p t)
     (should (string=
-            (TeX-command-expand "%s" #'TeX-active-master)
+            (TeX-command-expand "%s")
             TeX-region))))
 
+(ert-deftest TeX-command-expand-file-name-with-spaces ()
+  "Test whether file name with spaces is quoted correctly."
+  (let ((TeX-master "abc def")
+       (TeX-output-extension "pdf"))
+    (should (string=
+            (TeX-command-expand "%s")
+            (shell-quote-argument TeX-master)))
+    (should (string=
+            (TeX-command-expand "%t")
+            (shell-quote-argument (TeX-master-file "tex" t))))
+    (should (string=
+            (TeX-command-expand "%T")
+            (shell-quote-argument (TeX-master-file "tex" t))))
+    (should (string=
+            (TeX-command-expand "%d")
+            (shell-quote-argument (TeX-master-file "dvi" t))))
+    (should (string=
+            (TeX-command-expand "%f")
+            (shell-quote-argument (TeX-master-file "ps" t))))
+    (should (string=
+            (TeX-command-expand "%o")
+            (shell-quote-argument (TeX-master-file "pdf" t))))))
+
 ;;; command-expansion.el ends here
diff --git a/tex-bar.el b/tex-bar.el
index a908695..285828b 100644
--- a/tex-bar.el
+++ b/tex-bar.el
@@ -1,7 +1,6 @@
-;;; tex-bar.el --- toolbar icons on AUCTeX in GNU emacs
+;;; tex-bar.el --- toolbar icons on AUCTeX in GNU emacs.  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2004-2008, 2012-2014, 2016, 2018
-;;                                  Free Software Foundation, Inc.
+;; Copyright (C) 2004-2008, 2012-2020 Free Software Foundation, Inc.
 
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License as
@@ -39,7 +38,6 @@
 ;; -  You should have a folder called "symb-pics" with the pics of the
 ;;    symbols (xpm format is a good one), and the *parent* of this
 ;;    folder should be in `load-path'.
-
 ;; Did you read carefully this item?  I will say again: the folder
 ;; "symb-pics" should *not* be in `load-path', but its *parent*.
 
diff --git a/tex-buf.el b/tex-buf.el
index 510722c..bb5e275 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -1,4 +1,4 @@
-;;; tex-buf.el --- External commands for AUCTeX.
+;;; tex-buf.el --- External commands for AUCTeX.  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1991-1999, 2001-2020 Free Software Foundation, Inc.
 
@@ -463,10 +463,10 @@ Do you want to select one of these engines? "
   :group 'TeX-command
   :type 'integer)
 
-(defun TeX-command (name file &optional override-confirm)
-  "Run command NAME on the file returned by calling FILE.
+(defun TeX-command (name file-fn &optional override-confirm)
+  "Run command NAME on the file returned by calling FILE-FN.
 
-FILE is the symbol of a function returning a file name.  The
+FILE-FN is the symbol of a function returning a file name.  The
 function has one optional argument, the extension to use on the
 file.
 
@@ -485,17 +485,16 @@ been set."
   ;; because preview-latex calls `TeX-run-command' directly.
   (setq-default TeX-command-buffer (current-buffer))
 
-  (cond ((eq file #'TeX-region-file)
+  (cond ((eq file-fn #'TeX-region-file)
         (setq TeX-current-process-region-p t))
-       ((eq file #'TeX-master-file)
+       ((eq file-fn #'TeX-master-file)
         (setq TeX-current-process-region-p nil)))
 
   ;; When we're operating on a region, we need to update the position
   ;; of point in the region file so that forward search works.
   (if (string= name "View") (TeX-region-update-point))
 
-  (let ((command (TeX-command-expand (nth 1 (assoc name TeX-command-list))
-                                    file))
+  (let ((command (TeX-command-expand (nth 1 (assoc name TeX-command-list))))
        (hook (nth 2 (assoc name TeX-command-list)))
        (confirm (if override-confirm
                     (> (prefix-numeric-value override-confirm) 0)
@@ -531,115 +530,90 @@ remember to add /Library/TeX/texbin/ to your PATH"
                          ""))))
 
     ;; Now start the process
-    (setq file (funcall file))
-    (TeX-process-set-variable file 'TeX-command-next TeX-command-Show)
-    (funcall hook name command file)))
+    (let ((file (funcall file-fn)))
+      (TeX-process-set-variable file 'TeX-command-next TeX-command-Show)
+      (funcall hook name command file))))
 
-(defvar TeX-command-text)               ;Dynamically scoped.
-(defvar TeX-command-pos)                ;Dynamically scoped.
-
-(defun TeX-command-expand (command file &optional list)
-  "Expand COMMAND for FILE as described in LIST.
+(defun TeX-command-expand (command &optional list)
+  "Expand COMMAND for `TeX-active-master' as described in LIST.
 LIST default to `TeX-expand-list'.  As a special exception,
 `%%' can be used to produce a single `%' sign in the output
 without further expansion."
-  (defvar TeX-command-pos)
-  (let (pat
-       pos ;;FIXME: Should this be dynamically scoped?
-       entry TeX-command-text TeX-command-pos
-        expansion-res case-fold-search string expansion arguments)
+  (let ((TeX-expand-command command)
+        TeX-expand-pos
+        TeX-command-text
+        TeX-command-pos
+       pat entry case-fold-search string expansion arguments)
     (setq list (cons
                (list "%%" (lambda nil
-                            (setq pos (1+ pos))
+                            (setq TeX-expand-pos (1+ TeX-expand-pos))
                             "%"))
                (or list (TeX-expand-list)))
          pat (regexp-opt (mapcar #'car list)))
-    ;; `TeX-command-expand' is called with `file' argument being one
-    ;; of `TeX-master-file', `TeX-region-file' and
-    ;; `TeX-active-master'.  The return value of these functions
-    ;; sometimes needs suitable "decorations" for an argument for
-    ;; underlying shell or latex executable, or both, when the
-    ;; relavant file name involves some special characters such as
-    ;; space and multibyte characters.  Hence embed that function in a
-    ;; template prepared for that purpose.
-    (setq file (apply-partially
-               #'TeX--master-or-region-file-with-extra-quotes
-               file))
-    (while (setq pos (string-match pat command pos))
-      (setq string (match-string 0 command)
+    (while (setq TeX-expand-pos (string-match pat TeX-expand-command 
TeX-expand-pos))
+      (setq string (match-string 0 TeX-expand-command)
            entry (assoc string list)
            expansion (car (cdr entry)) ;Second element
            arguments (cdr (cdr entry)) ;Remaining elements
            string (save-match-data
-                    ;; Note regarding the special casing of `file':
-                    ;; `file' is prevented from being evaluated as a
-                    ;; function because inside of AUCTeX it only has
-                    ;; a meaning as a variable.  This makes sure that
-                    ;; a function definition made by an external
-                    ;; package (e.g. icicles) is not picked up.
-                    (cond ((and (not (eq expansion 'file))
-                                (functionp expansion))
-                           (apply expansion arguments))
-                          ((boundp expansion)
-                            (setq expansion-res
-                                  (apply (symbol-value expansion) arguments))
-                            (when (eq expansion 'file)
-                              ;; Advance past the file name in order to
-                              ;; prevent expanding any substring of it.
-                              (setq pos (+ pos (length expansion-res))))
-                           expansion-res)
-                          (t
-                           (error "Nonexpansion %s" expansion)))))
+                    (cond
+                      ((functionp expansion)
+                       (apply expansion arguments))
+                     ((boundp expansion)
+                       (apply (symbol-value expansion) arguments))
+                     (t
+                      (error "Nonexpansion %s" expansion)))))
       (if (stringp string)
-         (setq command
-               (replace-match string t t command)))))
-  command)
-
-(defun TeX--master-or-region-file-with-extra-quotes
-    (file-fn &optional extension nondirectory ask extra)
-  "Return file name with quote for shell.
-Helper function of `TeX-command-expand'.
-
-This is a kind of template.  How to use:
-Fix, by `apply-partially', the first argument FILE-FN as one of
-the three functions `TeX-master-file', `TeX-region-file' or
-`TeX-active-master'.  Then the result is just a wrapper for that
-function suitable in `TeX-command-expand'.
-
-As a wrapper described above, it passes EXTENSION, NONDIRECTORY
-and ASK to the \"bare\" function as-is, and arranges the returned
-file name for use with command shell.  I.e. it encloses the file
-name with space within quotes `\"' first when \" \\input\" is
-supplemented (indicated by dynamically binded variable
-`TeX-command-text' having string value.)  It also encloses the
-file name within \\detokenize{} when the following three
-conditions are met:
-1. compiling with standard (pdf)LaTeX or upLaTeX
-2. \" \\input\" is supplemented
-3. EXTRA is non-nil (default when expanding \"%T\")"
-  (shell-quote-argument
-   (let* ((raw (funcall file-fn extension nondirectory ask))
-         ;; String `TeX-command-text' means that the file name is
-         ;; given through \input command.
-         (quote-for-space (if (and (stringp TeX-command-text)
-                                   (string-match " " raw))
-                              "\"" "")))
-     (format
-      (if (and extra
-              (stringp TeX-command-text)
-              (memq major-mode '(latex-mode doctex-mode))
-              (memq TeX-engine '(default uptex)))
-         ;; Since TeXLive 2018, the default encoding for LaTeX
-         ;; files has been changed to UTF-8 if used with
-         ;; classic TeX or pdfTeX.  I.e.,
-         ;; \usepackage[utf8]{inputenc} is enabled by default
-         ;; in (pdf)latex.
-         ;; c.f. LaTeX News issue 28
-         ;; Due to this change, \detokenize is required to
-         ;; recognize non-ascii characters in the file name
-         ;; when \input precedes.
-         "\\detokenize{ %s }" "%s")
-      (concat quote-for-space raw quote-for-space)))))
+         (setq TeX-expand-command
+               (replace-match string t t TeX-expand-command))))
+    TeX-expand-command))
+
+(defun TeX-active-master-with-quotes
+    (&optional extension nondirectory ask extra)
+  "Return the current master or region file name with quote for shell.
+Pass arguments EXTENSION NONDIRECTORY ASK to `TeX-active-master'.
+If the returned file name contains space, enclose it within
+quotes `\"' when \" \\input\" is supplemented (indicated by
+dynamically bound variable `TeX-command-text' having string
+value.) Also enclose the file name within \\detokenize{} when
+the following three conditions are met:
+  1. compiling with standard (pdf)LaTeX or upLaTeX
+  2. \" \\input\" is supplemented
+  3. EXTRA is non-nil (default when expanding \"%T\")
+Adjust dynamically bound variable `TeX-expand-pos' to avoid possible
+infinite loop in `TeX-command-expand'.
+
+Helper function of `TeX-command-expand'. Use only within entries in
+`TeX-expand-list-builtin' and `TeX-expand-list'."
+  (let* ((raw (TeX-active-master extension nondirectory ask))
+        ;; String `TeX-command-text' means that the file name is
+        ;; given through \input command.
+        (quote-for-space (if (and (stringp TeX-command-text)
+                                  (string-match " " raw))
+                             "\"" ""))
+        (res
+         (shell-quote-argument
+          (format
+           (if (and extra
+                    (stringp TeX-command-text)
+                    (memq major-mode '(latex-mode doctex-mode))
+                    (memq TeX-engine '(default uptex)))
+               ;; Since TeXLive 2018, the default encoding for LaTeX
+               ;; files has been changed to UTF-8 if used with
+               ;; classic TeX or pdfTeX.  I.e.,
+               ;; \usepackage[utf8]{inputenc} is enabled by default
+               ;; in (pdf)latex.
+               ;; c.f. LaTeX News issue 28
+               ;; Due to this change, \detokenize is required to
+               ;; recognize non-ascii characters in the file name
+               ;; when \input precedes.
+               "\\detokenize{ %s }" "%s")
+           (concat quote-for-space raw quote-for-space)))))
+    ;; Advance past the file name in order to
+    ;; prevent expanding any substring of it.
+    (setq TeX-expand-pos
+          (+ TeX-expand-pos (length res)))
+    res))
 
 (defun TeX-check-files (derived originals extensions)
   "Check if DERIVED is newer than any of the ORIGINALS.
@@ -2475,6 +2449,7 @@ If REPARSE is non-nil, reparse the output log.
 If the file occurs in an included file, the file is loaded (if not
 already in an Emacs buffer) and the cursor is placed at the error."
   (let ((old-buffer (current-buffer))
+        ;; FIXME: default-major-mode has been removed in Emacs 26.
        (default-major-mode major-mode)
        max-index item)
 
@@ -3546,6 +3521,7 @@ please restart TeX error overview")))
          (with-current-buffer TeX-command-buffer
            ;; For consistency with `TeX-parse-TeX', use the major mode of
            ;; `TeX-command-buffer' when visiting the error point.
+            ;; FIXME: default-major-mode has been removed in Emacs 26.
            (let ((default-major-mode major-mode))
              ;; Find the error and display the help.
              (apply #'TeX-find-display-help item)))
diff --git a/tex-info.el b/tex-info.el
index 7c4b8a9..7a6729a 100644
--- a/tex-info.el
+++ b/tex-info.el
@@ -624,6 +624,8 @@ is assumed by default."
 ;;;###autoload
 (defalias 'Texinfo-mode 'texinfo-mode)
 
+(defvar TeX-sentinel-default-function) ;; Defined in tex-buf.el.
+
 ;;;###autoload
 (defun TeX-texinfo-mode ()
   "Major mode in AUCTeX for editing Texinfo files.
@@ -691,8 +693,8 @@ value of `Texinfo-mode-hook'."
   (setq TeX-trailer-start (regexp-quote (concat TeX-esc "bye")))
 
   (set (make-local-variable 'TeX-complete-list)
-       (list (list "@\\([a-zA-Z]*\\)" 1 'TeX-symbol-list-filtered nil)
-             (list "" TeX-complete-word)))
+       (list (list "@\\([a-zA-Z]*\\)" 1 'TeX-symbol-list-filtered nil)
+            (list "" TeX-complete-word)))
 
   (set (make-local-variable 'TeX-font-list) Texinfo-font-list)
   (set (make-local-variable 'TeX-font-replace-function) 
'TeX-font-replace-macro)
diff --git a/tex-ispell.el b/tex-ispell.el
index daf5094..50e9c80 100644
--- a/tex-ispell.el
+++ b/tex-ispell.el
@@ -1,6 +1,6 @@
-;;; tex-ispell.el --- AUCTeX skip additions for Ispell
+;;; tex-ispell.el --- AUCTeX skip additions for Ispell  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2016--2018 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
diff --git a/tex-jp.el b/tex-jp.el
index dff1b11..41ea4c5 100644
--- a/tex-jp.el
+++ b/tex-jp.el
@@ -1,6 +1,6 @@
-;;; tex-jp.el --- Support for Japanese TeX.  -*- coding: iso-2022-jp-unix; -*-
+;;; tex-jp.el --- Support for Japanese TeX.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1999, 2001-2008, 2012-2013, 2016-2018
+;; Copyright (C) 1999, 2001-2008, 2012-2013, 2016-2018, 2020
 ;;   Free Software Foundation, Inc.
 
 ;; Author:     KOBAYASHI Shinji <koba@flab.fujitsu.co.jp>,
@@ -148,7 +148,8 @@ systems are determined by their values regardless of the 
kanji option."
                          (let ((result (format "-d %s" dicname)))
                            ;; Advance past the file name in order to
                            ;; prevent expanding any substring of it.
-                           (setq pos (+ pos (length result)))
+                           (setq TeX-expand-pos
+                                 (+ TeX-expand-pos (length result)))
                            result)
                        ""))))
         ;; pxdvi $B$H(B %(o?)xdvi $B$NE,@Z$JJ}$rA*Br$9$k!#(B
@@ -912,4 +913,8 @@ save size
 
 (provide 'tex-jp)
 
+;; Local Variables:
+;; coding: iso-2022-jp-unix
+;; End:
+
 ;;; tex-jp.el ends here
diff --git a/tex-site.el.in b/tex-site.el.in
index 3f29021..64fa7ca 100644
--- a/tex-site.el.in
+++ b/tex-site.el.in
@@ -75,7 +75,6 @@ TeX-auto-* (automatically generated lisp).")
 (defcustom TeX-auto-global
     @lispautodir@
   "*Directory containing automatically generated information.
-Must end with a directory separator.
 
 For storing automatic extracted information about the TeX macros
 shared by all users of a site."
diff --git a/tex.el b/tex.el
index b2bbbbf..4c946cb 100644
--- a/tex.el
+++ b/tex.el
@@ -1,4 +1,4 @@
-;;; tex.el --- Support for TeX documents.
+;;; tex.el --- Support for TeX documents.  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1985-2020 Free Software Foundation, Inc.
 
@@ -50,14 +50,6 @@
                  (bus service path interface method &rest args))
 (declare-function dbus-register-signal "ext:dbus"
                  (bus service path interface signal handler &rest args))
-(declare-function TeX-output-extension "tex-buf"
-                 nil)
-(declare-function TeX-command-expand "tex-buf"
-                 (command file &optional list))
-(declare-function TeX-active-master "tex-buf"
-                 (&optional extension nondirectory ignore))
-(declare-function TeX-pop-to-buffer "tex-buf"
-                 (buffer &optional other-window norecord))
 (declare-function LaTeX-environment-list "latex"
                  nil)
 (declare-function tex--prettify-symbols-compose-p "ext:tex-mode"
@@ -80,7 +72,6 @@
 (defvar TeX-mode-map)
 (defvar TeX-mode-p)
 (defvar TeX-output-extension)
-(defvar TeX-output-extension)
 (defvar TeX-source-correlate-mode)
 (defvar TeX-source-specials-places)
 (defvar TeX-source-specials-tex-flags)
@@ -107,6 +98,7 @@
 ;; Others:
 (defvar tex--prettify-symbols-alist)   ; tex-mode.el
 (defvar Info-file-list-for-emacs)      ; info.el
+(defvar dbus-debug)                     ; dbus.el
 
 (defgroup TeX-file nil
   "Files used by AUCTeX."
@@ -511,6 +503,15 @@ string."
   :type 'string)
 (make-variable-buffer-local 'TeX-command-extra-options)
 
+(defvar TeX-command-text nil
+  "Dynamically bound by `TeX-command-expand'.")
+(defvar TeX-command-pos nil
+  "Dynamically bound by `TeX-command-expand'.")
+(defvar TeX-expand-pos nil
+  "Dynamically bound by `TeX-command-expand'.")
+(defvar TeX-expand-command nil
+  "Dynamically bound by `TeX-command-expand'.")
+
 ;; This is the list of expansion for the commands in
 ;; TeX-command-list.  Not likely to be changed, but you may e.g. want
 ;; to handle .ps files.
@@ -581,9 +582,11 @@ string."
                    (or (if TeX-source-correlate-output-page-function
                            (funcall TeX-source-correlate-output-page-function))
                        "1")))
-    ;; `file' means to call `TeX-master-file', `TeX-region-file' or 
`TeX-active-master'
-    ("%s" file nil t)
-    ("%t" file t t)
+    ;; `TeX-active-master-with-quotes' calls either `TeX-master-file'
+    ;; or `TeX-region-file' returning the master or region file, and
+    ;; adds suitable quotes for use in shell command line.
+    ("%s" TeX-active-master-with-quotes nil t)
+    ("%t" TeX-active-master-with-quotes t t)
     ;; If any TeX codes appear in the interval between %` and %', move
     ;; all of them after the interval and supplement " \input".  The
     ;; appearance is marked by leaving the bind to `TeX-command-text'
@@ -599,42 +602,41 @@ string."
            ""))
     (" \"\\" (lambda nil
               (if (eq TeX-command-pos t)
-                  (setq TeX-command-pos pos
-                        pos (+ 3 pos))
-                (setq pos (1+ pos)))))
+                  (setq TeX-command-pos TeX-expand-pos
+                        TeX-expand-pos (+ 3 TeX-expand-pos))
+                (setq TeX-expand-pos (1+ TeX-expand-pos)))))
     ("\"" (lambda nil (if (numberp TeX-command-pos)
                          (setq TeX-command-text
                                (concat
                                 TeX-command-text
-                                (substring command
+                                (substring TeX-expand-command
                                            TeX-command-pos
-                                           (1+ pos)))
-                               command
+                                           (1+ TeX-expand-pos)))
+                               TeX-expand-command
                                (concat
-                                (substring command
+                                (substring TeX-expand-command
                                            0
                                            TeX-command-pos)
-                                (substring command
-                                           (1+ pos)))
-                               pos TeX-command-pos
+                                (substring TeX-expand-command
+                                           (1+ TeX-expand-pos)))
+                               TeX-expand-pos TeX-command-pos
                                TeX-command-pos t)
-                       (setq pos (1+ pos)))))
+                       (setq TeX-expand-pos (1+ TeX-expand-pos)))))
     ("%'" (lambda nil
            (setq TeX-command-pos nil)
            (if (stringp TeX-command-text)
                (progn
-                 (setq pos (+ pos (length TeX-command-text) 9))
+                 (setq TeX-expand-pos (+ TeX-expand-pos (length 
TeX-command-text) 9))
                  (concat TeX-command-text " \"\\input\""))
              "")))
-    ;; The fourth argument of t is actually for wrapper function
-    ;; provided by `TeX--master-or-region-file-with-extra-quotes'.
-    ;; See its doc string as well as the comments in
-    ;; `TeX-command-expand'.
-    ("%T" file t t nil t)
+    ;; The fourth argument of t directs to supply "\detokenize{}" when
+    ;; necessary. See doc string and comment of
+    ;; `TeX-active-master-with-quotes'.
+    ("%T" TeX-active-master-with-quotes t t nil t)
     ("%n" TeX-current-line)
-    ("%d" file "dvi" t)
-    ("%f" file "ps" t)
-    ("%o" (lambda nil (funcall file (TeX-output-extension) t)))
+    ("%d" TeX-active-master-with-quotes "dvi" t)
+    ("%f" TeX-active-master-with-quotes "ps" t)
+    ("%o" (lambda nil (TeX-active-master-with-quotes (TeX-output-extension) 
t)))
     ;; for source specials the file name generated for the xdvi
     ;; command needs to be relative to the master file, just in
     ;; case the file is in a different subdirectory
@@ -691,25 +693,29 @@ sure \"%p\" is the first entry."
 ;; should remain unloaded as long as one is only editing files, so
 ;; requiring it here would be wrong.
 
-(autoload 'TeX-region-create "tex-buf" nil nil)
-(autoload 'TeX-save-document "tex-buf" nil t)
-(autoload 'TeX-home-buffer "tex-buf" nil t)
-(autoload 'TeX-pin-region "tex-buf" nil t)
-(autoload 'TeX-command-region "tex-buf" nil t)
+(autoload 'LaTeX-command-run-all-section "tex-buf" nil t)
+(autoload 'LaTeX-command-section "tex-buf" nil t)
+(autoload 'TeX-active-master "tex-buf")
+(autoload 'TeX-command "tex-buf")
 (autoload 'TeX-command-buffer "tex-buf" nil t)
+(autoload 'TeX-command-expand "tex-buf")
 (autoload 'TeX-command-master "tex-buf" nil t)
-(autoload 'LaTeX-command-section "tex-buf" nil t)
+(autoload 'TeX-command-region "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-current-offset "tex-buf")
+(autoload 'TeX-error-overview "tex-buf" nil t)
+(autoload 'TeX-home-buffer "tex-buf" nil t)
 (autoload 'TeX-kill-job "tex-buf" nil t)
-(autoload 'TeX-recenter-output-buffer "tex-buf" nil t)
 (autoload 'TeX-next-error "tex-buf" nil t)
-(autoload 'TeX-error-overview "tex-buf" nil t)
-(autoload 'TeX-region-file "tex-buf" nil nil)
-(autoload 'TeX-current-offset "tex-buf" nil nil)
-(autoload 'TeX-process-set-variable "tex-buf" nil nil)
+(autoload 'TeX-output-extension "tex-buf")
+(autoload 'TeX-pin-region "tex-buf" nil t)
+(autoload 'TeX-pop-to-buffer "tex-buf")
+(autoload 'TeX-process-set-variable "tex-buf")
+(autoload 'TeX-recenter-output-buffer "tex-buf" nil t)
+(autoload 'TeX-region-create "tex-buf")
+(autoload 'TeX-region-file "tex-buf")
+(autoload 'TeX-save-document "tex-buf" nil t)
 (autoload 'TeX-view "tex-buf" nil t)
 
 ;;; Portability.
@@ -728,10 +734,10 @@ but takes care of byte-compilation issues where the 
byte-code for
 the latter could signal an error if it has been compiled with
 emacs 24.1 and is then later run by emacs 24.5."
   (declare (indent 2) (debug (symbolp form &rest form)))
-  (if (fboundp name)            ;If macro exists at compile-time, just use it.
+  (if (fboundp name)             ;If macro exists at compile-time, just use it.
       then
-    `(if (fboundp ',name)       ;Else, check if it exists at run-time.
-        (eval ',then)          ;If it does, then run the then code.
+    `(if (fboundp ',name)               ;Else, check if it exists at run-time.
+        (eval ',then)                  ;If it does, then run the then code.
        ,@else)))                ;Otherwise, run the else code.
 
 (require 'easymenu)
@@ -1237,7 +1243,7 @@ entry in `TeX-view-program-list-builtin'."
                                 (get-file-buffer (TeX-region-file t)))
                               (current-buffer))
        (pdf-sync-forward-search))
-    (let ((pdf (concat file "." (TeX-output-extension))))
+    (let ((pdf (TeX-active-master (TeX-output-extension))))
       (pop-to-buffer (or (find-buffer-visiting pdf)
                         (find-file-noselect pdf))))))
 
@@ -1259,9 +1265,10 @@ for the Evince-compatible entries in
 DE is the name of the desktop environment, APP is the name of
 viewer."
   (require 'url-util)
-  (let* ((uri (concat "file://" (url-encode-url
-                                (expand-file-name
-                                 (concat file "." (TeX-output-extension))))))
+  (let* ((uri (concat "file://"
+                      (url-encode-url
+                      (expand-file-name
+                       (TeX-active-master (TeX-output-extension))))))
         (owner (dbus-call-method
                 :session (format "org.%s.%s.Daemon" de app)
                 (format "/org/%s/%s/Daemon" de app)
@@ -1556,11 +1563,11 @@ predicates are true, nil otherwise."
     (unless (or (null executable)
                (cond
                 ((stringp executable)
-                 (executable-find (TeX-command-expand executable nil)))
+                 (executable-find (TeX-command-expand executable)))
                 ((listp executable)
                  (catch 'notfound
                    (dolist (exec executable t)
-                     (unless (executable-find (TeX-command-expand exec nil))
+                     (unless (executable-find (TeX-command-expand exec))
                        (throw 'notfound nil)))))))
       (error (format "Cannot find %S viewer.  \
 Select another one in `TeX-view-program-selection'" viewer)))
@@ -2012,7 +2019,7 @@ Return the full path to the executable if possible."
        (concat client-full " " options)
       (concat client-base " " options))))
 
-(defun TeX-source-specials-view-expand-options (&optional viewer)
+(defun TeX-source-specials-view-expand-options (&optional _viewer)
   "Return source specials command line option for viewer command.
 The return value depends on the values of
 `TeX-source-correlate-mode' and
@@ -2601,6 +2608,9 @@ If REGEXP is nil, or \"\", an error will occur."
                       (TeX-split-string
                        (if (string-match ";" value) ";" ":")
                        value)))
+        (global (append '("/" "\\")
+                        (mapcar #'file-name-as-directory
+                                TeX-macro-global)))
         entry
         answers)
     (while entries
@@ -2611,7 +2621,7 @@ If REGEXP is nil, or \"\", an error will occur."
                       (substring entry 0 (match-beginning 0))
                     entry)))
       (or (not (file-name-absolute-p entry))
-         (member entry (append '("/" "\\") TeX-macro-global))
+         (member entry global)
          (setq answers (cons entry answers))))
     answers))
 
@@ -2770,6 +2780,13 @@ Used when checking if any files have changed."
 
 ;;; Style Files
 
+(define-obsolete-variable-alias 'LaTeX-dialect 'TeX-dialect "13.0")
+(defconst TeX-dialect :latex
+  "Default dialect for use with function `TeX-add-style-hook' for
+argument DIALECT-EXPR when the hook is to be run only on LaTeX
+file, or any mode derived thereof. See variable
+`TeX-style-hook-dialect'." )
+
 (defvar TeX-style-hook-list nil
   "List of TeX style hooks currently loaded.
 
@@ -3122,7 +3139,6 @@ Possible values are nil, t, or a list of style names.
 
 (defmacro TeX-complete-make-expert-command-functions (thing list-var prefix)
   (let* ((plural (concat thing "s"))
-        (upcase (upcase thing))
         (upcase-plural (upcase plural)))
     `(progn
        (defvar ,(intern (format "%s-expert-%s-table" prefix thing))
@@ -3363,6 +3379,9 @@ Space will complete and exit."
         (let ((minibuffer-local-completion-map TeX-electric-macro-map))
           (call-interactively 'TeX-insert-macro)))))
 
+(defvar TeX-exit-mark nil
+  "Dynamically bound by `TeX-parse-macro' and `LaTeX-env-args'.")
+
 (defun TeX-parse-macro (symbol args)
   "How to parse TeX macros which takes one or more arguments.
 
@@ -3386,9 +3405,10 @@ TeX macro.  What is done depend on the type of the 
element:
   after the previous argument, or after the macro name if this is
   the first argument.  Please leave point located after the
   argument you are inserting.  If you want point to be located
-  somewhere else after all hooks have been processed, set the value
-  of `exit-mark'.  It will point nowhere, until the argument hook
-  set it.  By convention, these hooks all start with `TeX-arg-'.
+  somewhere else after all hooks have been processed, set the
+  value of `TeX-exit-mark'.  It will point nowhere, until the
+  argument hook set it.  By convention, these hooks all start
+  with `TeX-arg-'.
 
   list: If the car is a string, insert it as a prompt and the next
   element as initial input.  Otherwise, call the car of the list
@@ -3412,12 +3432,12 @@ TeX macro.  What is done depend on the type of the 
element:
             (> (point) (mark)))
        (exchange-point-and-mark))
     (insert TeX-esc symbol)
-    (let ((exit-mark (make-marker))
+    (let ((TeX-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))
+      (cond ((marker-position TeX-exit-mark)
+            (goto-char (marker-position TeX-exit-mark))
+            (set-marker TeX-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
@@ -3457,11 +3477,14 @@ INITIAL-INPUT is a string to insert before reading 
input."
      (TeX-read-string (TeX-argument-prompt optional prompt "Text") 
initial-input))
    optional))
 
+(defvar TeX-last-optional-rejected nil
+  "Dynamically bound by `TeX-parse-arguments'.")
+
 (defun TeX-parse-arguments (args)
   "Parse TeX macro arguments ARGS.
 
 See `TeX-parse-macro' for details."
-  (let ((last-optional-rejected nil))
+  (let ((TeX-last-optional-rejected nil))
     (while args
       (if (vectorp (car args))
          ;; Maybe get rid of all optional arguments.  See `TeX-insert-macro'
@@ -3476,7 +3499,7 @@ See `TeX-parse-macro' for details."
                          (equal current-prefix-arg '(4)))
                     (and (eq TeX-insert-macro-default-style 
'mandatory-args-only)
                          (null (equal current-prefix-arg '(4))))
-                    last-optional-rejected))
+                    TeX-last-optional-rejected))
            (let ((TeX-arg-opening-brace LaTeX-optop)
                  (TeX-arg-closing-brace LaTeX-optcl))
              (TeX-parse-argument t (if (equal (length (car args)) 1)
@@ -3484,7 +3507,7 @@ See `TeX-parse-macro' for details."
                                      (append (car args) nil)))))
        (let ((TeX-arg-opening-brace TeX-grop)
              (TeX-arg-closing-brace TeX-grcl))
-         (setq last-optional-rejected nil)
+         (setq TeX-last-optional-rejected nil)
          (TeX-parse-argument nil (car args))))
       (setq args (cdr args)))))
 
@@ -3529,7 +3552,7 @@ See `TeX-parse-macro' for details."
           (if (and (not optional) (TeX-active-mark))
               (progn
                 (exchange-point-and-mark))
-            (set-marker exit-mark (point)))
+            (set-marker TeX-exit-mark (point)))
           (insert TeX-arg-closing-brace)
           (setq insert-flag t))
          ((symbolp arg)
@@ -3553,13 +3576,13 @@ See `TeX-parse-macro' for details."
 If OPTIONAL, only insert it if not empty, and then use square brackets.
 If PREFIX is given, insert it before NAME."
   (if (and optional (string-equal name ""))
-      (setq last-optional-rejected t)
+      (setq TeX-last-optional-rejected t)
     (insert TeX-arg-opening-brace)
     (if prefix
        (insert prefix))
     (if (and (string-equal name "")
-            (null (marker-position exit-mark)))
-       (set-marker exit-mark (point))
+            (null (marker-position TeX-exit-mark)))
+       (set-marker TeX-exit-mark (point))
       (insert name))
     (insert TeX-arg-closing-brace)))
 
@@ -3605,11 +3628,11 @@ Unless optional argument COMPLETE is non-nil, ``: '' 
will be appended."
        (TeX-parse-argument optional (car args))
       (TeX-parse-argument optional args))))
 
-(defun TeX-arg-literal (optional &rest args)
+(defun TeX-arg-literal (_optional &rest args)
   "Insert its arguments ARGS into the buffer.
 Used for specifying extra syntax for a macro.  The compatibility
 argument OPTIONAL is ignored."
-  (apply 'insert args))
+  (apply #'insert args))
 
 
 ;;; Font Locking
@@ -3949,7 +3972,7 @@ Generated by `TeX-auto-add-type'.")
 
 (defun TeX-safe-auto-write ()
   "Call `TeX-auto-write' safely."
-  (condition-case name
+  (condition-case _ignored
       (and (boundp 'TeX-auto-update)
           TeX-auto-update
           (TeX-auto-write))
@@ -3981,7 +4004,7 @@ Generated by `TeX-auto-add-type'.")
             (dir (file-name-directory file)))
        ;; Create auto directory if possible.
        (if (not (file-exists-p dir))
-           (condition-case name
+           (condition-case _ignored
                (make-directory dir)
              (error nil)))
        (if (file-writable-p file)
@@ -4301,7 +4324,7 @@ you should not use something like `[\\(]' for a character 
range."
        (goto-char (if end (min end (point-max)) (point-max)))
        (while (re-search-backward regexp beg t)
          (let* ((entry (cdr (TeX-member nil groups
-                                        (lambda (a b)
+                                        (lambda (_a b)
                                           (match-beginning (car b))))))
                 (symbol (nth 2 entry))
                 (match (nth 1 entry)))
@@ -4466,8 +4489,9 @@ If EXTENSIONS is not specified or nil, the value of
 (defun TeX-strip-extension (&optional string extensions nodir nostrip)
   "Return STRING without any trailing extension in EXTENSIONS.
 If NODIR is t, also remove directory part of STRING.
-If NODIR is `path', remove directory part of STRING if it is equal to
-the current directory, `TeX-macro-private' or `TeX-macro-global'.
+If NODIR is `path', remove directory part of STRING if it is
+equal to the current directory or is a member of
+`TeX-macro-private' or `TeX-macro-global'.
 If NOSTRIP is set, do not remove extension after all.
 STRING defaults to the name of the current buffer.
 EXTENSIONS defaults to `TeX-file-extensions'."
@@ -4485,8 +4509,8 @@ EXTENSIONS defaults to `TeX-file-extensions'."
         (dir (expand-file-name (or (file-name-directory strip) "./"))))
     (if (or (eq nodir t)
            (string-equal dir (expand-file-name "./"))
-           (member dir TeX-macro-global)
-           (member dir TeX-macro-private))
+           (member dir (mapcar #'file-name-as-directory TeX-macro-global))
+           (member dir (mapcar #'file-name-as-directory TeX-macro-private)))
        (file-name-nondirectory strip)
       strip)))
 
@@ -5073,10 +5097,9 @@ Brace insertion is only done if point is in a math 
construct and
        :help "Make \"Next Error\" show warnings"])
      ["Compile and view" TeX-command-run-all
       :help "Compile the document until it is ready and open the viewer"])
-   (let ((file 'TeX-command-on-current)) ;; is this actually needed?
-     (delq nil
-          (mapcar #'TeX-command-menu-entry
-                  (TeX-mode-specific-command-list mode))))))
+   (delq nil
+        (mapcar #'TeX-command-menu-entry
+                (TeX-mode-specific-command-list mode)))))
 
 (defun TeX-mode-specific-command-list (mode)
   "Return the list of commands available in the given MODE."
@@ -5181,7 +5204,7 @@ Brace insertion is only done if point is in a math 
construct and
 (make-variable-buffer-local 'TeX-verbatim-p-function)
 
 ;; XXX: We only have an implementation for LaTeX mode at the moment (Oct 2009).
-(defun TeX-verbatim-p (&optional pos)
+(defun TeX-verbatim-p (&optional _pos)
   "Return non-nil if position POS is in a verbatim-like construct.
 A mode-specific implementation is required.  If it is not
 available, the function always returns nil."
@@ -5289,7 +5312,7 @@ not move point further than this value."
   ;; A value of 0 is nonsense.
   (when (= count 0) (setq count 1))
   (unless limit (setq limit (point-max)))
-  (dotimes (i (abs count))
+  (dotimes (_ (abs count))
     (if (< count 0)
        (forward-line -1)
       (beginning-of-line))
@@ -5976,7 +5999,8 @@ sign.  With optional ARG, insert that many dollar signs."
        ;; inactivate-input-method is obsolete since emacs 24.3.
        (if (fboundp 'deactivate-input-method)
           (deactivate-input-method)
-        (inactivate-input-method))))
+        (with-no-warnings
+           (inactivate-input-method)))))
 
 ;;; Simple Commands
 
@@ -6225,7 +6249,7 @@ available from ")
         "https://www.gnu.org/software/auctex/";
         'face 'link
         'help-echo (concat "mouse-2, RET: Follow this link")
-        'action (lambda (button)
+        'action (lambda (_button)
                   (browse-url "https://www.gnu.org/software/auctex/";))
         'follow-link t)
        (insert " if your
@@ -6241,7 +6265,7 @@ tracker.  Visit ")
         "https://debbugs.gnu.org/cgi/pkgreport.cgi?pkg=auctex";
         'face 'link
         'help-echo (concat "mouse-2, RET: Follow this link")
-        'action (lambda (button)
+        'action (lambda (_button)
                   (browse-url 
"https://debbugs.gnu.org/cgi/pkgreport.cgi?pkg=auctex";))
         'follow-link t)
        (insert "\nto browse existing AUCTeX bugs.
@@ -6410,7 +6434,7 @@ NAME may be a package, a command, or a document."
       (when (and (called-interactively-p 'any)
                 (or (not name) (string= name "")))
        (let ((symbol (thing-at-point 'symbol))
-             contained completions doc)
+             contained completions)
          ;; Is the symbol at point contained in the lists of available
          ;; documentation?
          (setq contained (catch 'found
@@ -6442,16 +6466,7 @@ NAME may be a package, a command, or a document."
 
 ;;; Ispell Support
 
-;; FIXME: Document those functions and variables.  -- rs
-
-;; The FSF ispell.el use this.
-(defun ispell-tex-buffer-p ()
-  (and (boundp 'ispell-tex-p) ispell-tex-p))
-
-;; The FSF ispell.el might one day use this.
-(setq ispell-enable-tex-parser t)
-
-(defun TeX-run-ispell (command string file)
+(defun TeX-run-ispell (_command _string file)
   "Run ispell on current TeX buffer."
   (cond ((and (string-equal file (TeX-region-file))
              (fboundp 'ispell-region))
@@ -6471,8 +6486,7 @@ NAME may be a package, a command, or a document."
   (if (string-equal name "")
       (setq name (TeX-master-file)))
 
-  (let ((found nil)
-       (regexp (concat "\\`\\("
+  (let ((regexp (concat "\\`\\("
                        (mapconcat (lambda (dir)
                                     (regexp-quote
                                      (expand-file-name
@@ -6493,10 +6507,9 @@ NAME may be a package, a command, or a document."
       (let* ((buffer (car buffers))
             (name (buffer-file-name buffer)))
        (setq buffers (cdr buffers))
-       (if (and name (string-match regexp name))
-           (progn
-             (save-excursion (switch-to-buffer buffer) (ispell-buffer))
-             (setq found t)))))))
+       (when (and name (string-match regexp name))
+         (save-excursion (switch-to-buffer buffer) (ispell-buffer))
+          t)))))
 
 ;; Some versions of ispell 3 use this.
 (defvar ispell-tex-major-modes nil)
diff --git a/texmathp.el b/texmathp.el
index 733f639..37658f3 100644
--- a/texmathp.el
+++ b/texmathp.el
@@ -1,4 +1,4 @@
-;;; texmathp.el -- Code to check if point is inside LaTeX math environment
+;;; texmathp.el -- Code to check if point is inside LaTeX math environment  
-*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1998, 2004, 2017, 2020 Free Software Foundation, Inc.
 
@@ -181,15 +181,14 @@ customize (customize calls it when setting the variable)."
   (setq texmathp-tex-commands1 (append texmathp-tex-commands
                                       texmathp-tex-commands-default))
   (let ((list (reverse texmathp-tex-commands1))
-       var entry type switches togglers)
+       entry type switches togglers)
     (while (setq entry (car list))
       (setq type (nth 1 entry)
-           list (cdr list)
-           var (cond ((memq type '(env-on env-off)) 'texmathp-environments)
-                     ((memq type '(arg-on arg-off)) 'texmathp-macros)
-                     ((memq type '(sw-on sw-off))   'switches)
-                     ((memq type '(sw-toggle))      'togglers)))
-      (set var (cons (car entry) (symbol-value var))))
+           list (cdr list))
+      (cond ((memq type '(env-on env-off)) (push (car entry) 
texmathp-environments))
+           ((memq type '(arg-on arg-off)) (push (car entry) texmathp-macros))
+           ((memq type '(sw-on sw-off))   (push (car entry) switches))
+           ((memq type '(sw-toggle))      (push (car entry) togglers))))
     (setq texmathp-onoff-regexp
          (concat "\\(?:[^\\]\\|\\`\\)"
                  (regexp-opt switches t))



reply via email to

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