emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/auctex 2dc9539961 25/43: Merge branch 'master' into fea


From: Tassilo Horn
Subject: [elpa] externals/auctex 2dc9539961 25/43: Merge branch 'master' into feature/fix-mode-names-overlap
Date: Wed, 7 Feb 2024 06:07:11 -0500 (EST)

branch: externals/auctex
commit 2dc9539961ac325997ca9c39bfce37182ee12635
Merge: 142f28b539 6c6e2bcd08
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>

    Merge branch 'master' into feature/fix-mode-names-overlap
---
 Makefile.in               |   2 +-
 admin/release-process.org |  16 +-
 context.el                |   9 +-
 doc/auctex.texi           | 412 ++++++++++++++++++++++++----------------------
 doc/changes.texi          |  17 +-
 doc/faq.texi              |  12 +-
 doc/install.texi          |   2 +-
 doc/quickstart.texi       |   2 +-
 font-latex.el             |  43 ++---
 latex.el                  | 403 ++++++++++++++++++++++++++++++++++++---------
 preview.el.in             |   5 +-
 style/bicaption.el        |  36 ++--
 style/caption.el          |  35 ++--
 style/fvextra.el          |  54 +++++-
 style/graphicx.el         |  21 ++-
 style/imakeidx.el         |  13 +-
 style/minted.el           | 211 +++++++++++++-----------
 style/newfloat.el         |   8 +-
 style/ocg-p.el            |  60 +++----
 style/ocgx.el             |   8 +-
 style/pythontex.el        |  43 +++--
 style/refcount.el         |  90 ++++++++++
 style/splitidx.el         |  24 ++-
 style/subcaption.el       |  12 +-
 style/tcolorbox.el        |   7 +-
 style/titleps.el          |  49 +++---
 style/titletoc.el         |  35 ++--
 style/xparse.el           | 323 +-----------------------------------
 tests/latex/latex-test.el |  19 ++-
 tex-fold.el               |  67 ++++----
 tex-info.el               |  30 ++--
 tex-jp.el                 |   3 +-
 tex-site.el.in            |   2 +
 tex-style.el              |   3 +-
 tex.el                    | 200 +++++++++-------------
 texmathp.el               |   2 +-
 36 files changed, 1168 insertions(+), 1110 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 18c7922219..f98f294929 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -197,7 +197,7 @@ STYLESRC = style/prosper.el \
           style/proc.el      style/microtype.el style/tcolorboxlib-theorems.el 
\
           style/amsaddr.el   style/parskip.el   style/catchfilebetweentags.el \
           style/physics.el   style/soul.el      style/algpseudocodex.el \
-          style/wasysym.el
+          style/wasysym.el   style/refcount.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/admin/release-process.org b/admin/release-process.org
index 624d323e77..3348cf0751 100644
--- a/admin/release-process.org
+++ b/admin/release-process.org
@@ -40,7 +40,7 @@ everything goes well, before actually doing the release.
 
   - The instructions may mention how to build the XEmacs and Windows packages,
     but you do not need to do that if you decided to stop providing those
-    packages
+    packages.
   - Make sure that the patch for =gendocs.sh= in the =www-docs= target applies
     correctly, otherwise you will need to update it. Remember to update it in
     the =gendocspath= branch of the AUCTeX remote repository too.
@@ -81,7 +81,7 @@ You can also browse the 
[[http://web.cvs.savannah.gnu.org/viewvc/auctex/][conten
 - [ ] Update AUCTeX version and date in files in =src/= directory. When you are
   done, run the script =./genpages.sh=
 - [ ] Update the =ChangeLog=
-- [ ] Register all changes. You can use for example =vc-mode= in Emacs: [0/2]
+- [ ] Register all changes. You can use for example =vc-mode= in Emacs: [0/3]
 
   - [ ] Register all new files with =i=
   - [ ] Select all files in the same state with =m= and do check in/out with 
=v=
@@ -172,7 +172,7 @@ AUCTeX is kept in the ~externals/auctex~ branch of the ELPA 
repository.
 3. Merge the commits which have taken place in the normal auctex development on
    the ~master~ branch using ~git merge origin/master~.
 4. In case of conflicts, edit, and commit.
-5. Check that everything compiles by running ~make -f GNUMakefile~.
+5. Check that everything compiles by running ~make -f GNUmakefile~.
 6. Push your changes to the elpa remote (~git push~).
 
 Just updating the ~externals/auctex~ branch by merging in the changes from the
@@ -181,7 +181,7 @@ Emacs' package manager.  To do an actual release which will 
be published, you
 have to do the following steps in addition.
 
 7. Edit the line ~;; Version: X.Y.Z~ in the file ~auctex.el~.  For ELPA
-   releases, Y and Y match the latest AUCTeX version and Z is incremented for
+   releases, X and Y match the latest AUCTeX version and Z is incremented for
    every ELPA release of that AUCTeX version.  Z starts with 0, so AUCTeX
    12.2.0 should be (almost) identical to the AUCTeX release 12.2.
 8. Commit that change with this Git commit message (but do not push yet!).  The
@@ -194,7 +194,7 @@ Release GNU AUCTeX X.Y.Z
 * GNU AUCTeX Version X.Y.Z released.
 #+END_EXAMPLE
 
-9. Run ~make -f GNUMakefile~ again.  In the output you should see that the
+9. Run ~make -f GNUmakefile~ again.  In the output you should see that the
    above version is inserted into several files, e.g., the info documentation.
    The version change is gotten from the current HEAD of the branch.  That's
    the reason the commit message has to be in exactly this format.
@@ -258,3 +258,9 @@ Other files to be updated accordingly:
   at least XX.X.=.
 - [ ] =RELEASE= :: Update the version of GNU Emacs in the
   "Requirements" section.
+
+For ELPA releases:
+
+- [ ] =auctex.el= :: Since this file is not regenerated, the required
+  Emacs version must be adjusted manually in the GNU ELPA Git
+  repository.
diff --git a/context.el b/context.el
index fe1e02c146..dc6a81d4e2 100644
--- a/context.el
+++ b/context.el
@@ -71,17 +71,14 @@
   :group 'ConTeXt
   :type 'string)
 
-(defvar ConTeXt-current-interface "en"
+(defvar-local ConTeXt-current-interface "en"
   "Interface to be used for inserting macros and ConTeXt run.")
-(make-variable-buffer-local 'ConTeXt-current-interface)
 
-(defvar ConTeXt-menu-changed nil)
 ;; Need to update ConTeXt menu.
-(make-variable-buffer-local 'ConTeXt-menu-changed)
+(defvar-local ConTeXt-menu-changed nil)
 
-(defvar ConTeXt-largest-level nil
+(defvar-local ConTeXt-largest-level nil
   "Largest sectioning level within current document.")
-(make-variable-buffer-local 'ConTeXt-largest-level)
 
 (defun ConTeXt-largest-level ()
   (TeX-update-style)
diff --git a/doc/auctex.texi b/doc/auctex.texi
index d00ec36d4f..c4cd025761 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -376,10 +376,10 @@ String inserted by typing @kbd{"} to close a quotation.
 @end defopt
 
 @defopt TeX-quote-after-quote
-Determines the behavior of @kbd{"}.  If it is non-nil, typing @kbd{"}
-will insert a literal double quote.  The respective values of
-@code{TeX-open-quote} and @code{TeX-close-quote} will be inserted
-after typing @kbd{"} once again.
+Determines the behavior of @kbd{"}.  If it is non-@code{nil}, typing
+@kbd{"} will insert a literal double quote.  The respective values of
+@code{TeX-open-quote} and @code{TeX-close-quote} will be inserted after
+typing @kbd{"} once again.
 @end defopt
 
 The @samp{babel} package provides special support for the requirements
@@ -426,28 +426,27 @@ equations like @samp{$...$} or @samp{\(...\)} simply 
typing @kbd{$}.
 @code{TeX-electric-math}.
 
 @defopt TeX-electric-math
-If the variable is non-nil and you type @kbd{$} outside math mode,
-@AUCTeX{} will automatically insert the opening and closing symbols for
-an inline equation and put the point between them.  The opening symbol
-will blink when @code{blink-matching-paren} is non-nil.  If
-@code{TeX-electric-math} is nil, typing @kbd{$} simply inserts @samp{$}
-at point, this is the default.
+If the variable is non-@code{nil} and you type @kbd{$} outside math mode,
+@AUCTeX{} will automatically insert the opening and closing symbols for an
+inline equation and put the point between them.  The opening symbol will
+blink when @code{blink-matching-paren} is non-@code{nil}.  If
+@code{TeX-electric-math} is @code{nil}, typing @kbd{$} simply inserts
+@samp{$} at point, this is the default.
 
 Besides @code{nil}, possible values for this variable are @code{("$"
 . "$")} for @TeX{} inline equations @samp{$...$}, and @code{("\(" . "\)")}
 for @LaTeX{} inline equations @samp{\(...\)}.
 
-If the variable is non-nil and point is inside math mode right between a
-couple of single dollars, pressing @kbd{$} will insert another pair of
-dollar signs and leave the point between them.  Thus, if
+If the variable is non-@code{nil} and point is inside math mode right
+between a couple of single dollars, pressing @kbd{$} will insert another
+pair of dollar signs and leave the point between them.  Thus, if
 @code{TeX-electric-math} is set to @code{("$" . "$")} you can easily
-obtain a @TeX{} display equation @samp{$$...$$} by pressing @kbd{$}
-twice in a row.  (Note that you should not use double dollar signs in
-@LaTeX{} because this practice can lead to wrong spacing in typeset
-documents.)
+obtain a @TeX{} display equation @samp{$$...$$} by pressing @kbd{$} twice
+in a row.  (Note that you should not use double dollar signs in @LaTeX{}
+because this practice can lead to wrong spacing in typeset documents.)
 
-In addition, when the variable is non-nil and there is an active region
-outside math mode, typing @kbd{$} will put around the active region
+In addition, when the variable is non-@code{nil} and there is an active
+region outside math mode, typing @kbd{$} will put around the active region
 symbols for opening and closing inline equation and keep the region
 active, leaving point after the closing symbol.  By pressing repeatedly
 @kbd{$} while the region is active you can toggle between an inline
@@ -693,17 +692,17 @@ Delete the innermost font specification containing point.
 @kindex C-c C-f
 (@kbd{C-c C-f}) Insert template for font change command.
 
-If @var{replace} is not nil, replace current font.  @var{what}
+If @var{replace} is non-@code{nil}, replace current font.  @var{what}
 determines the font to use, as specified by @code{TeX-font-list}.
 @end deffn
 
 @defopt TeX-font-list
 List of fonts used by @code{TeX-font}.
 
-Each entry is a list with three elements.  The first element is the
-key to activate the font.  The second element is the string to insert
-before point, and the third element is the string to insert after
-point.  An optional fourth element means always replace if not nil.
+Each entry is a list with three elements.  The first element is the key to
+activate the font.  The second element is the string to insert before
+point, and the third element is the string to insert after point.  An
+optional fourth element means always replace if non-@code{nil}.
 @end defopt
 
 @defopt LaTeX-font-list
@@ -746,7 +745,7 @@ Determine the type of section to be inserted, by the 
argument
 
 @itemize @bullet
 @item
-If @var{arg} is nil or missing, use the current level.
+If @var{arg} is @code{nil} or missing, use the current level.
 @item
 If @var{arg} is a list (selected by C-u), go downward one level.
 @item
@@ -799,10 +798,10 @@ Name of the sectioning command, derived from 
@code{LaTeX-level}.
 @item LaTeX-title
 The title of the section, default to an empty string.
 @item LaTeX-toc
-Entry for the table of contents list, default nil.
+Entry for the table of contents list, default @code{nil}.
 @item LaTeX-done-mark
-Position of point afterwards, default nil meaning after the inserted
-text.
+Position of point afterwards, default @code{nil} meaning after the
+inserted text.
 @end vtable
 
 A number of hooks are already defined.  Most likely, you will be able to
@@ -818,10 +817,10 @@ Query the user about the title of the section.  Modifies 
@code{LaTeX-title}.
 Query the user for the toc entry.  Modifies @code{LaTeX-toc}.
 @item LaTeX-section-section
 Insert @LaTeX{} section command according to @code{LaTeX-name},
-@code{LaTeX-title}, and @code{LaTeX-toc}.  If @code{LaTeX-toc} is nil, no
-toc entry is inserted.  If @code{LaTeX-toc} or @code{LaTeX-title} are
-empty strings, @code{LaTeX-done-mark} will be placed at the point they
-should be inserted.
+@code{LaTeX-title}, and @code{LaTeX-toc}.  If @code{LaTeX-toc} is
+@code{nil}, no toc entry is inserted.  If @code{LaTeX-toc} or
+@code{LaTeX-title} are empty strings, @code{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}.
@@ -848,11 +847,11 @@ variable @code{LaTeX-section-label}.
 Default prefix when asking for a label.
 
 If it is a string, it is used unchanged for all kinds of sections.
-If it is nil, no label is inserted.
-If it is a list, the list is searched for a member whose car is equal
-to the name of the sectioning command being inserted.  The cdr is then
-used as the prefix.  If the name is not found, or if the cdr is nil,
-no label is inserted.
+If it is @code{nil}, no label is inserted.
+If it is a list, the list is searched for a member whose car is equal to
+the name of the sectioning command being inserted.  The cdr is then used
+as the prefix.  If the name is not found, or if the cdr is @code{nil}, no
+label is inserted.
 
 @cindex Prefix for labels
 @cindex Label prefix
@@ -892,8 +891,8 @@ complete a partially written name, and/or to get a list of 
available
 environments.  After selection of a specific environment @AUCTeX{} may
 prompt you for further specifications.
 
-If the optional argument @var{arg} is non-nil (i.e.@: you have given a
-prefix argument), the current environment is modified and no new
+If the optional argument @var{arg} is non-@code{nil} (i.e.@: you have
+given a prefix argument), the current environment is modified and no new
 environment is inserted.
 @end deffn
 
@@ -909,7 +908,7 @@ environment.
 This is an alist whose car is the environment name, and the cdr either
 the prefix or a symbol referring to one.
 
-If the name is not found, or if the cdr is nil, no label is
+If the name is not found, or if the cdr is @code{nil}, no label is
 automatically inserted for that environment.
 
 If you want to automatically insert a label for a environment but with
@@ -949,12 +948,12 @@ controlled by the user option 
@code{TeX-complete-expert-commands}.
 @defopt TeX-complete-expert-commands
 Complete macros and environments marked as expert commands.
 
-Possible values are nil, t, or a list of style names.
+Possible values are @code{nil}, @code{t}, or a list of style names.
 
 @table @asis
-@item nil
+@item @code{nil}
 Don't complete expert commands (default).
-@item t
+@item @code{t}
 Always complete expert commands.
 @item (@var{styles} @dots{})
 Only complete expert commands of @var{styles}.
@@ -1122,7 +1121,7 @@ inserted, while `description' will have @samp{\item[] } 
inserted.
 @end deffn
 
 @defopt TeX-arg-item-label-p
-If non-nil, you will always be asked for optional label in items.
+If non-@code{nil}, you will always be asked for optional label in items.
 Otherwise, you will be asked only in description environments.
 @end defopt
 
@@ -1143,8 +1142,9 @@ Default width for minipage and tabular* environments.
 @end defopt
 
 @defopt LaTeX-default-position
-Default position string for array and tabular environments.  If nil,
-act like the empty string is given, but don't prompt for a position.
+Default position string for array and tabular environments.  If
+@code{nil}, act like the empty string is given, but don't prompt for a
+position.
 @end defopt
 
 @AUCTeX{} calculates the number of columns from the format string and
@@ -1229,9 +1229,9 @@ Math mode.  Each entry should be a list of two to four 
elements.
 
 First, the key to be used after @code{LaTeX-math-abbrev-prefix} for macro
 insertion.  The key can be a character (e.g.@: @samp{?o}) for a single
-stroke or a string (e.g.@: @samp{"o a"}) for a multi-stroke binding.  If it
-is nil, the symbol has no associated keystroke (it is available in the
-menu, though).
+stroke or a string (e.g.@: @samp{"o a"}) for a multi-stroke binding.  If
+it is @code{nil}, the symbol has no associated keystroke (it is available
+in the menu, though).
 
 Second, a string representing the name of the macro (without a leading
 backslash.)
@@ -1260,10 +1260,11 @@ math mode commands.
 constructs by automatically inserting a pair of braces after typing
 @key{_} or @key{^} respectively and putting point between the braces.
 In order to enable this feature, set the variable
-@code{TeX-electric-sub-and-superscript} to a non-nil value.
+@code{TeX-electric-sub-and-superscript} to a non-@code{nil} value.
 
 @defopt TeX-electric-sub-and-superscript
-If non-nil, insert braces after typing @key{^} and @key{_} in math mode.
+If non-@code{nil}, insert braces after typing @key{^} and @key{_} in math
+mode.
 @end defopt
 
 @cindex input method
@@ -1315,8 +1316,8 @@ Each entry is a list with the following elements:
 
 @enumerate
 @item
-Regexp matching the preceding text or a predicate of arity 0 which
-returns non-nil and sets `match-data' appropriately if it is applicable.
+Regexp matching the preceding text or a predicate of arity 0 which returns
+non-@code{nil} and sets `match-data' appropriately if it is applicable.
 @item
 A number indicating the subgroup in the regexp containing the text.
 @item
@@ -1409,7 +1410,7 @@ A faster alternative is to enable the option
 @code{TeX-electric-escape}.
 
 @defopt TeX-electric-escape
-If this is non-nil, typing the @TeX{} escape character @kbd{\} will
+If this is non-@code{nil}, typing the @TeX{} escape character @kbd{\} will
 invoke the command @code{TeX-electric-macro}.
 
 In Texinfo mode, the command is invoked by @kbd{@@} instead.
@@ -1429,20 +1430,21 @@ Space (@key{SPC}) will complete and exit.
 By default @AUCTeX{} will put an empty set braces @samp{@{@}} after a
 macro with no arguments to stop it from eating the next whitespace.
 This is suppressed inside math mode and can be disabled totally by
-setting @code{TeX-insert-braces} to nil.
+setting @code{TeX-insert-braces} to @code{nil}.
 
 @defopt TeX-insert-braces
-If non-nil, append a empty pair of braces after inserting a macro with
-no arguments.
+If non-@code{nil}, append a empty pair of braces after inserting a macro
+with no arguments.
 @end defopt
 
 @defopt TeX-insert-braces-alist
 Control the insertion of a pair of braces after a macro on a per macro
 basis.
 
-This variable is an alist.  Each element is a cons cell, whose car is
-the macro name, and the cdr is non-nil or nil, depending on whether a
-pair of braces should be, respectively, appended or not to the macro.
+This variable is an alist.  Each element is a cons cell, whose car is the
+macro name, and the cdr is non-@code{nil} or @code{nil}, depending on
+whether a pair of braces should be, respectively, appended or not to the
+macro.
 
 If a macro has an element in this variable, @AUCTeX{} will
 use its value to decide what to do, whatever the value of the variable
@@ -1460,12 +1462,12 @@ controlled using the user option 
@code{TeX-complete-expert-commands}.
 @defopt TeX-complete-expert-commands
 Complete macros and environments marked as expert commands.
 
-Possible values are nil, t, or a list of style names.
+Possible values are @code{nil}, @code{t}, or a list of style names.
 
 @table @asis
-@item nil
+@item @code{nil}
 Don't complete expert commands (default).
-@item t
+@item @code{t}
 Always complete expert commands.
 @item (@var{styles} @dots{})
 Only complete expert commands of @var{styles}.
@@ -1515,7 +1517,7 @@ to its end.
 (@kbd{C-c *}) Set mark at end of current logical section, and point at
 top.
 
-With a non-nil prefix argument, mark only the region from the current
+With a non-@code{nil} prefix argument, mark only the region from the current
 section start to the next sectioning command.  Thereby subsections are
 not being marked.  Otherwise, any included subsections are also marked
 along with current section.
@@ -1546,9 +1548,10 @@ commands matched by the regular expression in the 
variable
 @code{outline-regexp} which in turn is a regular expression matching any
 element of the variable @code{texinfo-section-list}.
 
-With a non-nil prefix argument, mark only the region from the current
-section start to the next sectioning command.  Thereby subsections are
-not being marked.  Otherwise, any included subsections are also marked.
+With a non-@code{nil} prefix argument, mark only the region from the
+current section start to the next sectioning command.  Thereby subsections
+are not being marked.  Otherwise, any included subsections are also
+marked.
 
 Note that when the current section is starting immediately after a node
 command, then the node command is also marked as part of the section.
@@ -1680,12 +1683,12 @@ formatting @samp{tabular} and @samp{tabbing} 
environments with the
 function @code{align-current} which will nicely align columns in the
 source code.
 
-@AUCTeX{} is able to format commented parts of your code just as any
-other part.  This means @LaTeX{} environments and @TeX{} groups in
-comments will be indented syntactically correct if the variable
-@code{LaTeX-syntactic-comments} is set to t.  If you disable it,
-comments will be filled like normal text and no syntactic indentation
-will be done.
+@AUCTeX{} is able to format commented parts of your code just as any other
+part.  This means @LaTeX{} environments and @TeX{} groups in comments will
+be indented syntactically correct if the variable
+@code{LaTeX-syntactic-comments} is set to @code{t}.  If you disable it,
+comments will be filled like normal text and no syntactic indentation will
+be done.
 @vindex LaTeX-syntactic-comments
 
 Following you will find a list of most commands and variables related
@@ -1732,8 +1735,8 @@ matched by a @samp{@}}.
 @end defopt
 
 @defopt LaTeX-syntactic-comments
-If non-nil comments will be filled and indented according to @LaTeX{}
-syntax.  Otherwise they will be filled like normal text.
+If non-@code{nil} comments will be filled and indented according to
+@LaTeX{} syntax.  Otherwise they will be filled like normal text.
 @end defopt
 
 @defopt TeX-newline-function
@@ -1836,8 +1839,8 @@ behavior can be controlled by setting the variable
 @code{docTeX-indent-across-comments}.
 
 @defopt docTeX-indent-across-comments
-If non-nil, indentation in docTeX is done across comments.  This option is
-disabled by default.
+If non-@code{nil}, indentation in docTeX is done across comments.  This
+option is disabled by default.
 @end defopt
 
 @node Filling
@@ -2394,8 +2397,8 @@ recognize the different ways these quotes can be given in 
your source
 code, i.e.@: (@samp{"<}, @samp{">}), (@samp{<<}, @samp{>>}) and the
 respective 8-bit variants.
 
-If you set @code{font-latex-quotes} to nil, quoted content will not be
-fontified.
+If you set @code{font-latex-quotes} to @code{nil}, quoted content will not
+be fontified.
 @end defopt
 
 
@@ -2433,8 +2436,8 @@ variables @code{font-latex-fontify-script} and
 @code{font-latex-script-display}.
 
 @defopt font-latex-fontify-script
-If non-nil, fontify subscript and superscript strings.  Concretely, this
-means that the scripts are raised or lowered.
+If non-@code{nil}, fontify subscript and superscript strings.  Concretely,
+this means that the scripts are raised or lowered.
 
 Another possiblity is setting this variable to the symbol
 @code{multi-level}.  In this case, in a formula @i{x^@{y^z@}}, @i{y} is
@@ -2616,20 +2619,20 @@ forced fontification by customizing the variable
 @end defopt
 
 @defopt TeX-fold-auto
-By default, a macro inserted with @code{TeX-insert-macro} (@kbd{C-c
-C-m}) will not be folded.  Set this variable to a non-nil value to
+By default, a macro inserted with @code{TeX-insert-macro} (@kbd{C-c C-m})
+will not be folded.  Set this variable to a non-@code{nil} value to
 aumatically fold macros as soon as they are inserted.
 @end defopt
 
 @defopt TeX-fold-preserve-comments
-By default items found in comments will be folded.  If your comments
-often contain unfinished code this might lead to problems.  Give this
-variable a non-nil value and foldable items in your comments will be
-left alone.
+By default items found in comments will be folded.  If your comments often
+contain unfinished code this might lead to problems.  Give this variable a
+non-@code{nil} value and foldable items in your comments will be left
+alone.
 @end defopt
 
 @defopt TeX-fold-unfold-around-mark
-When this variable is non-nil and there is an active regione, text
+When this variable is non-@code{nil} and there is an active regione, text
 around the mark will be kept unfolded.
 @end defopt
 
@@ -2792,9 +2795,9 @@ Default display string for environments which are not 
specified in
 @end defopt
 
 @defopt TeX-fold-unspec-use-name
-If non-nil the name of the macro or environment surrounded by square
-brackets is used as display string, otherwise the defaults specified in
-@code{TeX-fold-unspec-macro-display-string} or
+If non-@code{nil} the name of the macro or environment surrounded by
+square brackets is used as display string, otherwise the defaults
+specified in @code{TeX-fold-unspec-macro-display-string} or
 @code{TeX-fold-unspec-env-display-string} respectively.
 @end defopt
 
@@ -2889,14 +2892,15 @@ Emacs 25 is able to prettify symbols in programming 
language buffers,
 example is to display @code{(lambda () ...)} as @code{(λ () ...)} in
 Lisp buffers.
 
-@AUCTeX{} can use this feature in order to display certain math macros
-and greek letters using their Unicode representation, too.  For example,
-the @TeX{} code @code{\alpha \times \beta} will be displayed as @code{α
-× β}.  When point is on one of the characters, it'll be unprettified
+@AUCTeX{} can use this feature in order to display certain math macros and
+greek letters using their Unicode representation, too.  For example, the
+@TeX{} code @code{\alpha \times \beta} will be displayed as @code{α × β}.
+When point is on one of the characters, it'll be unprettified
 automatically, meaning you see the verbatim text again.  For this
 behaviour however you need to set
-@code{prettify-symbols-unprettify-at-point} to t or @code{right-edge}
-which will unprettify the symbol when point moves into or near it.
+@code{prettify-symbols-unprettify-at-point} to @code{t} or
+@code{right-edge} which will unprettify the symbol when point moves into
+or near it.
 
 To enable prettification in @AUCTeX{}, simply add
 @code{prettify-symbols-mode} to @code{TeX-mode-hook}.  If you enabled
@@ -3174,18 +3178,18 @@ this variable if automatic parsing is not enabled.
 
 After confirming a command to execute, @AUCTeX{} will try to save any
 buffers related to the document, and check if the document needs to be
-reformatted.  If the variable @code{TeX-save-query} is non-nil,
+reformatted.  If the variable @code{TeX-save-query} is non-@code{nil},
 @AUCTeX{} will query before saving each file.  By default @AUCTeX{} will
-check emacs buffers associated with files in the current directory, in
-one of the @code{TeX-macro-private} directories, and in the
+check emacs buffers associated with files in the current directory, in one
+of the @code{TeX-macro-private} directories, and in the
 @code{TeX-macro-global} directories.  You can change this by setting the
 variable @code{TeX-check-path}.
 
 @defopt TeX-check-path
 Directory path to search for dependencies.
 
-If nil, just check the current file.
-Used when checking if any files have changed.
+If @code{nil}, just check the current file.  Used when checking if any
+files have changed.
 @end defopt
 
 @cindex ispell
@@ -3416,14 +3420,15 @@ generate the final @acronym{PDF} by converting a 
@acronym{DVI} file.
 This option controls if and how to produce a @acronym{PDF} file by
 converting a @acronym{DVI} file.
 
-When @code{TeX-PDF-mode} is non-nil, if @code{TeX-PDF-from-DVI} is
-non-nil too the document is compiled to @acronym{DVI} instead of
-@acronym{PDF}.  When the document is ready, @kbd{C-c C-c} will suggest
-to run the converter to @acronym{PDF} or an intermediate format.
+When @code{TeX-PDF-mode} is non-@code{nil}, if @code{TeX-PDF-from-DVI} is
+non-@code{nil} too the document is compiled to @acronym{DVI} instead of
+@acronym{PDF}.  When the document is ready, @kbd{C-c C-c} will suggest to
+run the converter to @acronym{PDF} or an intermediate format.
 
-If non-nil, @code{TeX-PDF-from-DVI} should be the name of the command in 
@code{TeX-command-list},
-as a string, used to convert the @acronym{DVI} file to @acronym{PDF} or
-to an intermediate format.  Values currently supported are:
+If non-@code{nil}, @code{TeX-PDF-from-DVI} should be the name of the
+command in @code{TeX-command-list}, as a string, used to convert the
+@acronym{DVI} file to @acronym{PDF} or to an intermediate format.  Values
+currently supported are:
 @itemize
 @item
 @code{"Dvips"}: the @acronym{DVI} file is converted to @acronym{PS} with
@@ -3490,14 +3495,14 @@ the executables you want to use instead.  You can also 
add entries to
 per default.
 
 @defopt TeX-engine-alist
-Alist of @TeX{} engines and associated commands.  Each entry is a list with
-a maximum of five elements.  The first element is a symbol used to
+Alist of @TeX{} engines and associated commands.  Each entry is a list
+with a maximum of five elements.  The first element is a symbol used to
 identify the engine.  The second is a string describing the engine.  The
 third is the command to be used for plain @TeX{}.  The fourth is the
 command to be used for @LaTeX{}.  The fifth is the command to be used for
-the @option{--engine} parameter of @ConTeXt{}'s @samp{texexec} program.  Each
-command can either be a variable or a string.  An empty string or nil
-means there is no command available.
+the @option{--engine} parameter of @ConTeXt{}'s @samp{texexec} program.
+Each command can either be a variable or a string.  An empty string or
+@code{nil} means there is no command available.
 @end defopt
 
 In some systems, Emacs cannot inherit the @env{PATH} environment variable from
@@ -3509,12 +3514,11 @@ the option @code{TeX-check-TeX}.
 @defopt TeX-check-TeX
 @vindex TeX-command
 @vindex TeX-check-TeX-command-not-found
-If non-nil, @AUCTeX{} will check if it is able to find a working @TeX{}
-distribution before running @TeX{}, @LaTeX{}, @ConTeXt{}, etc.  It
-actually checks if can run @code{TeX-command} command or the shell
-returns a command not found error.  The error code returned by the shell
-in this case can be set in @code{TeX-check-TeX-command-not-found}
-option.
+If non-@code{nil}, @AUCTeX{} will check if it is able to find a working
+@TeX{} distribution before running @TeX{}, @LaTeX{}, @ConTeXt{}, etc.  It
+actually checks if can run @code{TeX-command} command or the shell returns
+a command not found error.  The error code returned by the shell in this
+case can be set in @code{TeX-check-TeX-command-not-found} option.
 @end defopt
 
 Some @LaTeX{} packages requires the document to be compiled with a
@@ -3552,14 +3556,16 @@ You can customize @AUCTeX{} to show the processor 
output as it is
 produced.
 
 @defopt TeX-show-compilation
-If non-nil, the output of @TeX{} compilation is shown in another window.
+If non-@code{nil}, the output of @TeX{} compilation is shown in another
+window.
 @end defopt
 
 You can instruct @TeX{} to print error messages in the form
 @samp{file:line:error} which is similar to the way many compilers format them.
 
 @defopt TeX-file-line-error
-If non-nil, @TeX{} will produce @samp{file:line:error} style error messages.
+If non-@code{nil}, @TeX{} will produce @samp{file:line:error} style error
+messages.
 @end defopt
 
 @ConTeXt{} users can choose between Mark II and Mark IV versions.  This
@@ -3646,8 +3652,8 @@ definitions, you can do so via the variables
 
 @defopt TeX-view-predicate-list
 This is a list of predicates for viewer selection and invocation.  The
-first element of each list item is a symbol and the second element a
-Lisp form to be evaluated.  The form should return nil if the predicate
+first element of each list item is a symbol and the second element a Lisp
+form to be evaluated.  The form should return @code{nil} if the predicate
 is not fulfilled.
 
 A built-in predicate from @code{TeX-view-predicate-list-builtin} can be
@@ -3683,8 +3689,8 @@ and you are using evince-compatible viewer, customize the 
option
 @code{TeX-view-enince-keep-focus}.
 
 @defopt TeX-view-evince-keep-focus
-When this option is non-nil and the viewer is compatible with evince,
-the focus is pulled back to Emacs immediately after the viewer is
+When this option is non-@code{nil} and the viewer is compatible with
+evince, the focus is pulled back to Emacs immediately after the viewer is
 invoked or refreshed from within @AUCTeX{}.
 @end defopt
 
@@ -3881,13 +3887,12 @@ the whole @TeX{} log buffer.  This is controlled by the
 @code{TeX-parse-all-errors} variable.
 
 @defopt TeX-parse-all-errors
-If t, @AUCTeX{} automatically parses the whole output log buffer right
-after running a @TeX{} command, in order to collect all warnings and
+If @code{t}, @AUCTeX{} automatically parses the whole output log buffer
+right after running a @TeX{} command, in order to collect all warnings and
 errors.  This makes it possible to navigate back and forth between the
-error messages using @code{TeX-next-error} and
-@code{TeX-previous-error}.  This is the default.  If nil, @AUCTeX{} does
-not parse the whole output log buffer and @code{TeX-previous-error}
-cannot be used.
+error messages using @code{TeX-next-error} and @code{TeX-previous-error}.
+This is the default.  If @code{nil}, @AUCTeX{} does not parse the whole
+output log buffer and @code{TeX-previous-error} cannot be used.
 @end defopt
 
 As default, @AUCTeX{} will display a special help buffer containing the
@@ -3895,11 +3900,11 @@ error reported by @TeX{} along with the documentation.  
There is however
 an `expert' option, which allows you to display the real @TeX{} output.
 
 @defopt TeX-display-help
-If t @AUCTeX{} will automatically display a help text whenever an error
-is encountered using @code{TeX-next-error} (@kbd{C-c `}).  If nil a
-terse information about the error is displayed in the echo area.  If
-@code{expert} @AUCTeX{} will display the output buffer with the raw
-@TeX{} output.
+If @code{t}, @AUCTeX{} will automatically display a help text whenever an
+error is encountered using @code{TeX-next-error} (@kbd{C-c `}).  If
+@code{nil}, a terse information about the error is displayed in the echo
+area.  If @code{expert} @AUCTeX{} will display the output buffer with the
+raw @TeX{} output.
 @end defopt
 
 @menu
@@ -3954,19 +3959,19 @@ details.
 (@kbd{C-c C-t C-x}) Toggle whether @AUCTeX{} should actually hide the
 ignored warnings specified with @code{TeX-ignore-warnings}.  The boolean
 option @code{TeX-suppress-ignored-warnings} is set accordingly.  If this
-is nil, all warnings are shown, even those matched by
+is @code{nil}, all warnings are shown, even those matched by
 @code{TeX-ignore-warnings}, otherwise these are hidden.
 
-Note that @code{TeX-debug-warnings} takes the precedence: if it is nil,
-all warnings are hidden in any case.
+Note that @code{TeX-debug-warnings} takes the precedence: if it is
+@code{nil}, all warnings are hidden in any case.
 @end deffn
 
 @node Error overview
 @subsection List of all errors and warnings
 
-When the option @code{TeX-parse-all-errors} is non-nil, you will be also
-able to open an overview of all errors and warnings reported by the @TeX{}
-compiler.
+When the option @code{TeX-parse-all-errors} is non-@code{nil}, you will be
+also able to open an overview of all errors and warnings reported by the
+@TeX{} compiler.
 
 @deffn Command TeX-error-overview
 Show an overview of the errors and warnings occurred in the last @TeX{}
@@ -3985,7 +3990,7 @@ overview.
 @end deffn
 
 @defopt TeX-error-overview-open-after-TeX-run
-When this boolean variable is non-nil, the error overview will be
+When this boolean variable is non-@code{nil}, the error overview will be
 automatically opened after running @TeX{} if there are errors or warnings
 to show.
 @end defopt
@@ -3996,7 +4001,7 @@ default, but you can change this behavior by customizing 
the option
 
 @defopt TeX-error-overview-setup
 Controls the frame setup of the error overview.  The possible value is:
-@code{separate-frame}; with a nil value the current frame is used
+@code{separate-frame}; with a @code{nil} value the current frame is used
 instead.
 
 The parameters of the separate frame can be set with the
@@ -4111,7 +4116,7 @@ Alternatively, you may use @code{setq-default} to set the 
default value of
 this option or set it as a directory local variable (@pxref{Directory
 Variables,,, emacs, The Emacs Editor}).
 
-Note that a non-nil value of @code{TeX-output-dir} might be incompatible
+Note that a non-@code{nil} value of @code{TeX-output-dir} might be incompatible
 with some @TeX{} commands and macros.  In particular, the @LaTeX{} macro
 @samp{\include} is known to not work with this option.  Some @TeX{}
 packages which produce intermediary files might also be incompatible.  A
@@ -4177,7 +4182,7 @@ for each @AUCTeX{} mode by means of the following 
variables:
 
 @defopt TeX-clean-confirm
 Control if deletion of intermediate and output files has to be confirmed
-before it is actually done.  If non-nil, ask before deleting files.
+before it is actually done.  If non-@code{nil}, ask before deleting files.
 @end defopt
 
 @node Documentation
@@ -4399,7 +4404,7 @@ master file.  @xref{Automatic Local}.
 @end deffn
 
 @defopt TeX-save-query
-If non-nil, then query the user before saving each file with
+If non-@code{nil}, then query the user before saving each file with
 @code{TeX-save-document}.
 @end defopt
 
@@ -4808,10 +4813,10 @@ Used for overriding the default language-specific quote 
insertion
 behavior.  This is an alist where each element is a list consisting of
 four items.  The first item is the name of the language in concern as a
 string.  See the list of supported languages above.  The second item is
-the opening quotation mark.  The third item is the closing quotation
-mark.  Opening and closing quotation marks can be specified directly as
-strings or as functions returning a string.  The fourth item is a
-boolean controlling quote insertion.  It should be non-nil if if the
+the opening quotation mark.  The third item is the closing quotation mark.
+Opening and closing quotation marks can be specified directly as strings
+or as functions returning a string.  The fourth item is a boolean
+controlling quote insertion.  It should be non-@code{nil} if if the
 special quotes should only be used after inserting a literal @samp{"}
 character first, i.e.@: on second key press.
 @end defopt
@@ -4820,9 +4825,9 @@ character first, i.e.@: on second key press.
 Used for overriding the behavior of hyphen insertion for specific
 languages.  Every element in this alist is a list of three items.  The
 first item should specify the affected language as a string.  The second
-item denotes the hyphen string to be used as a string.  The third item,
-a boolean, controls the behavior of hyphen insertion and should be
-non-nil if the special hyphen should be inserted after inserting a
+item denotes the hyphen string to be used as a string.  The third item, a
+boolean, controls the behavior of hyphen insertion and should be
+non-@code{nil} if the special hyphen should be inserted after inserting a
 literal @samp{-} character, i.e.@: on second key press.
 @end defopt
 
@@ -4835,15 +4840,15 @@ String to be used when typing @key{-}.  This usually is 
a hyphen
 alternative or hyphenation aid provided by @samp{babel} and the related
 language style files, like @samp{"=}, @samp{"~} or @samp{"-}.
 
-Set it to an empty string or nil in order to disable language-specific
-hyphen insertion.
+Set it to an empty string or @code{nil} in order to disable
+language-specific hyphen insertion.
 @end defopt
 
 @defopt LaTeX-babel-hyphen-after-hyphen
-Control insertion of hyphen strings.  If non-nil insert normal hyphen on
-first key press and swap it with the language-specific hyphen string
-specified in the variable @code{LaTeX-babel-hyphen} on second key press.
-If nil do it the other way round.
+Control insertion of hyphen strings.  If non-@code{nil} insert normal
+hyphen on first key press and swap it with the language-specific hyphen
+string specified in the variable @code{LaTeX-babel-hyphen} on second key
+press.  If @code{nil} do it the other way round.
 @end defopt
 
 @node Japanese
@@ -4963,8 +4968,8 @@ There are three customize options with regard to the 
encoding of
 Japanese text.
 
 @defopt japanese-TeX-use-kanji-opt-flag
-If non-nil, @AUCTeX{} adds @option{-kanji} option to the typesetting
-command when @code{TeX-engine} is @samp{ptex}.
+If non-@code{nil}, @AUCTeX{} adds @option{-kanji} option to the
+typesetting command when @code{TeX-engine} is @samp{ptex}.
 @end defopt
 
 Usually @AUCTeX{} guesses the right coding systems for input to and
@@ -4972,12 +4977,12 @@ output from the Japanese @TeX{} process, but you can 
override them by
 the following two customize options.
 
 @defopt TeX-japanese-process-input-coding-system
-If non-nil, used for encoding input to Japanese @TeX{} process.
+If non-@code{nil}, used for encoding input to Japanese @TeX{} process.
 When @code{nil}, @AUCTeX{} tries to choose suitable coding system.
 @end defopt
 
 @defopt TeX-japanese-process-output-coding-system
-If non-nil, used for decoding output from Japanese @TeX{} process.
+If non-@code{nil}, used for decoding output from Japanese @TeX{} process.
 When @code{nil}, @AUCTeX{} tries to choose suitable coding system.
 @end defopt
 
@@ -5063,9 +5068,9 @@ By default, when @AUCTeX{} searches a directory for 
files, it will
 recursively search through subdirectories.
 
 @defopt TeX-file-recurse
-Whether to search @TeX{} directories recursively: nil means do not
+Whether to search @TeX{} directories recursively: @code{nil} means do not
 recurse, a positive integer means go that far deep in the directory
-hierarchy, t means recurse indefinitely.
+hierarchy, @code{t} means recurse indefinitely.
 @end defopt
 
 By default, @AUCTeX{} will ignore files named @file{.}, @file{..},
@@ -5095,8 +5100,8 @@ environments available for completion purposes.  The 
drawback is slower
 load time when you edit a new file and perhaps too many confusing
 symbols when you try to do a completion.
 
-You can disable the automatic generated global style hooks by setting
-the variable @code{TeX-auto-global} to nil.
+You can disable the automatic generated global style hooks by setting the
+variable @code{TeX-auto-global} to @code{nil}.
 
 @defopt TeX-macro-global
 Directories containing the site's @TeX{} style files.
@@ -5463,7 +5468,8 @@ Prompt for a @LaTeX{} environment with completion.
 @item TeX-arg-cite
 @vindex TeX-arg-cite-note-p
 Prompt for a Bib@TeX{} citation.  If the variable
-@code{TeX-arg-cite-note-p} is non-nil, ask also for optional note in citations.
+@code{TeX-arg-cite-note-p} is non-@code{nil}, ask also for optional note
+in citations.
 
 @item TeX-arg-counter
 Prompt for a @LaTeX{} counter completing with known counters.
@@ -5520,19 +5526,19 @@ Prompt for a @LaTeX{} savebox.
 @vindex LaTeX-default-options
 @vindex TeX-arg-input-file-search
 @vindex LaTeX-style-list
-Prompt for a @LaTeX{} document class, using @code{LaTeX-default-style}
-as default value and @code{LaTeX-default-options} as default list of
-options.  If the variable @code{TeX-arg-input-file-search} is t, you
-will be able to complete with all @LaTeX{} classes available on your
-system, otherwise classes listed in the variable @code{LaTeX-style-list}
-will be used for completion.  It is also provided completion for options
-of many common classes.
+Prompt for a @LaTeX{} document class, using @code{LaTeX-default-style} as
+default value and @code{LaTeX-default-options} as default list of options.
+If the variable @code{TeX-arg-input-file-search} is @code{t}, you will be
+able to complete with all @LaTeX{} classes available on your system,
+otherwise classes listed in the variable @code{LaTeX-style-list} will be
+used for completion.  It is also provided completion for options of many
+common classes.
 
 @item LaTeX-arg-usepackage
 @vindex TeX-arg-input-file-search
 Prompt for @LaTeX{} packages.  If the variable
-@code{TeX-arg-input-file-search} is t, you will be able to complete with
-all @LaTeX{} packages available on your system.  It is also provided
+@code{TeX-arg-input-file-search} is @code{t}, you will be able to complete
+with all @LaTeX{} packages available on your system.  It is also provided
 completion for options of many common packages.
 
 @item TeX-arg-bibstyle
@@ -5853,7 +5859,8 @@ value is actually the tail of the list of options given 
to @var{class}.
 
 @defun LaTeX-match-class-option @var{regexp}
 Check if a documentclass option matching @var{regexp} is active.  Return
-first found class option matching @var{regexp}, or nil if not found.
+first found class option matching @var{regexp}, or @code{nil} if not
+found.
 @end defun
 
 These functions are also useful to implement customized predicate(s) in
@@ -6002,8 +6009,8 @@ found.
 @defvar TeX-auto-regexp-list
 List of regular expressions matching @TeX{} macro definitions.
 
-The list has the following format ((@var{regexp} @var{match} @var{table}) 
@dots{}), that
-is, each entry is a list with three elements.
+The list has the following format ((@var{regexp} @var{match}
+@var{table})@dots{}), that is, each entry is a list with three elements.
 
 @var{regexp}.  Regular expression matching the macro we want to parse.
 
@@ -6150,16 +6157,16 @@ C-@var{k}} and call the function @code{TeX-font}.  Type 
@kbd{C-c C-f
 @key{RET}} to get a list of supported commands.
 
 Note that the prefix argument is not handled the same way by @AUCTeX{}.
-Note also that the node insertion command from the native mode
-(@code{texinfo-insert-@@node}) can still accessed from the Texinfo menu
-in @AUCTeX{}.
 
 @item Insert braces
+@findex TeX-insert-braces
 In @AUCTeX{} braces can be inserted with the same key binding as in the
 native Texinfo mode: @kbd{C-c @{}.  But @AUCTeX{} uses its own function
 for the feature: @code{TeX-insert-braces}.
 
 @item Insert environments
+@findex Texinfo-environment
+@kindex C-c C-e
 The native Texinfo mode does not insert full environments.  Instead, it
 provides the function @code{texinfo-insert-@@end} (mapped to @kbd{C-c
 C-c e}) for closing an open environment with a matching @code{@@end} statement.
@@ -6168,18 +6175,31 @@ In @AUCTeX{} you can insert full environments, i.e.@: 
both the opening and
 closing statements, with the function @code{Texinfo-environment} (mapped
 to @kbd{C-c C-e}).
 
-@item Format info files with makeinfo and @TeX{}
+@item Insert nodes
+@findex Texinfo-insert-node
+@kindex C-c C-s
+Node insertion command @code{texinfo-insert-@@node} is available in
+the native Texinfo mode (mapped to @kbd{C-c C-c n}).  It only inserts
+the string @samp{@@node } (with suitable newlines).
+
+@AUCTeX{} provides its own node insertion command
+@code{Texinfo-insert-node} (mapped to @kbd{C-c C-s}), which asks for
+the next, previous and upper nodes with completion, in addition to the
+node name you are going to insert.
+
+@item Format info files with @command{makeinfo} and @TeX{}
 In the native Texinfo mode there are various functions and bindings to
 format a region or the whole buffer for info or to typeset the
 respective text.  For example, there is @code{makeinfo-buffer} (mapped
-to @kbd{C-c C-m C-b}) which runs @samp{makeinfo} on the buffer or there
+to @kbd{C-c C-m C-b}) which runs @command{makeinfo} on the buffer or there
 is @code{texinfo-tex-buffer} (mapped to @kbd{C-c C-t C-b}) which runs
 @TeX{} on the buffer in order to produce a @acronym{DVI} file.
 
 In @AUCTeX{} different commands for formatting or typesetting can be
 invoked through the function @code{TeX-command-master} (mapped to
 @kbd{C-c C-c}).  After typing @kbd{C-c C-c}, you can select the desired
-command, e.g @samp{Makeinfo} or @samp{TeX}, through a prompt in the mini
+command, e.g.@: @samp{Makeinfo}, @samp{Makeinfo HTML}, @samp{Texi2dvi}
+or @samp{TeX}, through a prompt in the mini
 buffer.  Note that you can make, say @samp{Makeinfo}, the default by
 adding this statement in your init file:
 
@@ -6199,7 +6219,7 @@ Note also that in the case of a multifile document, 
@kbd{C-c C-c} in
 @AUCTeX{} will work on the whole document (provided that the file
 variable @code{TeX-master} is set correctly), while
 @code{makeinfo-buffer} in the native mode will process only the current
-buffer, provided at the @code{@@setfilename} statement is provided.
+buffer, provided that the @code{@@setfilename} statement is provided.
 
 @item Produce indexes and print
 The native Texinfo mode provides the binding @kbd{C-c C-t C-i}
@@ -6211,6 +6231,8 @@ through @kbd{C-c C-c} (@code{TeX-command-master}) in 
@AUCTeX{}: @samp{Texindex},
 @samp{Print}, and @samp{Queue}.
 
 @item Kill jobs
+@findex TeX-kill-job
+@kindex C-c C-k
 The command @kbd{C-c C-t C-k} (@code{tex-kill-job}) in the native mode
 is superseded by @kbd{C-c C-k} (@code{TeX-kill-job}) in @AUCTeX{}.
 @end table
@@ -6261,21 +6283,15 @@ C-d} in @AUCTeX{} instead.
 @node Unbinding
 @appendixsubsec Which native mode key bindings are missing
 
-The following commands from the native commands might still be useful
-when working with @AUCTeX{}, however, they are not accessible with a
+The following command from the native commands might still be useful
+when working with @AUCTeX{}, however, it is not accessible with a
 key binding any longer.
 
 @table @asis
-@item @code{@@node} insertion
-The node insertion command, mapped to @kbd{C-c C-c n} in the native
-mode, is not mapped to any key in @AUCTeX{}.  You can still access it
-through the Texinfo menu, though.  Another alternative is to use the
-@kbd{C-c C-m} binding for macro insertion in @AUCTeX{}.
-
 @item Show the section structure
 The command @code{texinfo-show-structure} (@kbd{C-c C-s}) from the
 native mode does not have a key binding in @AUCTeX{}.  The binding is
-used by @AUCTeX{} for sectioning.
+used by @AUCTeX{} for inserting @samp{@@node}.
 @end table
 
 @node Indices
diff --git a/doc/changes.texi b/doc/changes.texi
index d4b54c92d8..6d04ad4f92 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -15,7 +15,22 @@
 @AUCTeX{} now requires GNU Emacs 26.1 or higher.
 
 @item
-Now @LaTeX{} abbrevs are available in doc@TeX{} mode buffers.
+@LaTeX{} abbrevs are now available in doc@TeX{} mode buffers.
+
+@item
+@AUCTeX{} temporarily rebinds the variable @code{gc-cons-percentage} to a
+higher value during parsing which speeds up the process significantly.
+The memory pressure should still be acceptable, even on older machines.
+
+@item
+Macros provided by the @file{xparse} package are part of @LaTeX{} kernel
+since October 2020.  @AUCTeX{} tracks this change and the content of
+@file{xparse.el} is moved into @file{latex.el} and @file{font-latex.el}
+respectively.
+
+@item
+The variable @code{preview-scale-function} is now allowed as a file-local
+variable where the assigned value can only be between 0.1 and 10.
 @end itemize
 
 @heading News in 13.2
diff --git a/doc/faq.texi b/doc/faq.texi
index a2d2aec0d2..a2906d4da0 100644
--- a/doc/faq.texi
+++ b/doc/faq.texi
@@ -133,20 +133,20 @@ error in your init file.
 @item
 Why does @code{TeX-next-error} (@kbd{C-c `}) fail?
 
-If @code{TeX-file-line-error} is set to nil (not the default), these
-sort of failures might be related to the the fact that when writing the
-log file, @TeX{} puts information related to a file, including error
+If @code{TeX-file-line-error} is set to @code{nil} (not the default),
+these sort of failures might be related to the the fact that when writing
+the log file, @TeX{} puts information related to a file, including error
 messages, between a pair of parentheses.  In this scenario @AUCTeX{}
 determines the file where the error happened by parsing the log file and
-counting the parentheses.  This can fail when there are other,
-unbalanced parentheses present.
+counting the parentheses.  This can fail when there are other, unbalanced
+parentheses present.
 
 Activating so-called @samp{file:line:error} messages for the log file usually
 solves this issue, as these kind of messages are are easier to parse;
 however, they may lack some details.  Activation can be done either in
 the configuration of your @TeX{} system (consult its manual to see where
 this is) or by simply keeping the variable @code{TeX-file-line-error} to
-the default value of non-nil.
+the default value of non-@code{nil}.
 
 @item
 What does @samp{AUC} stand for?
diff --git a/doc/install.texi b/doc/install.texi
index cb5b413472..b7f1f42323 100644
--- a/doc/install.texi
+++ b/doc/install.texi
@@ -193,7 +193,7 @@ providers} for detail.
 
 If you are planning to install the package as a single non-priviledged
 user, you will typically set @var{prefix} to your home directory.
-Consult @ref{Advice for non-privileged users} for addtional
+Consult @ref{Advice for non-privileged users} for additional
 instructions.
 
 @item --with-emacs=@var{/path/to/emacs}
diff --git a/doc/quickstart.texi b/doc/quickstart.texi
index a9c7343f93..8f5f7ac00c 100644
--- a/doc/quickstart.texi
+++ b/doc/quickstart.texi
@@ -124,7 +124,7 @@ this and asks you to enter a value.
 
 @subsection Inserting macros
 
-@kbd{C-c C-m}, or simply @kbd{C-c RET} will give you a prompt that asks
+@kbd{C-c C-m}, or simply @kbd{C-c @key{RET}} will give you a prompt that asks
 you for a @LaTeX{} macro.  You can use @key{TAB} for completion, or the
 @key{up}/@key{down} arrow keys (or @kbd{M-p} and @kbd{M-n}) to browse the 
command
 history.  In many cases, @AUCTeX{} knows which arguments a macro needs
diff --git a/font-latex.el b/font-latex.el
index 472ed4dd44..65ce8d9998 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -60,9 +60,8 @@
 (defvar font-latex-multiline-boundary 5000
   "Size of region to search for the start or end of a multiline construct.")
 
-(defvar font-latex-quote-regexp-beg nil
+(defvar-local font-latex-quote-regexp-beg nil
   "Regexp used to find quotes.")
-(make-variable-buffer-local 'font-latex-quote-regexp-beg)
 
 (defvar font-latex-quote-list '(("``" "''") ("<<" ">>" french) ("«" "»" 
french))
   "List of quote specifiers for quotation fontification.
@@ -81,15 +80,13 @@ added quotes will be reversed for fontification.  For 
example if
 specifies `german', quotes will be used like \">foo\"< for
 fontification.")
 
-(defvar font-latex-quotes-control nil
+(defvar-local font-latex-quotes-control nil
   "Internal variable for keeping track if `font-latex-quotes' changed.")
-(make-variable-buffer-local 'font-latex-quotes-control)
 
-(defvar font-latex-quotes-internal nil
+(defvar-local font-latex-quotes-internal nil
   "Internal variable for tracking outcome of automatic detection.
 If automatic detection is not enabled, it is assigned the value
 of `font-latex-quotes'.")
-(make-variable-buffer-local 'font-latex-quotes-internal)
 
 (defvar font-latex-quotes-fallback 'french
   "Fallback value for `font-latex-quotes' if automatic detection fails.")
@@ -240,7 +237,7 @@ variable `font-latex-fontify-sectioning'." ',num)
   '(("warning"
      ("nopagebreak" "pagebreak" "newpage" "clearpage" "cleardoublepage"
       "enlargethispage" "nolinebreak" "linebreak" "newline" "-" "\\" "\\*"
-      "appendix" "displaybreak" "allowdisplaybreaks" "tabularnewline" "include"
+      "appendix" "displaybreak" "allowdisplaybreaks" "tabularnewline"
       "backmatter" "frontmatter" "mainmatter"
       "makeatletter" "makeatother" "newblock" "suppressfloats" "endinput")
      font-latex-warning-face 1 noarg)
@@ -365,7 +362,19 @@ variable `font-latex-fontify-sectioning'." ',num)
       ("labelformat" "{{") ("linespread" "{")
       ("AddToHook" "{[{") ("RemoveFromHook" "{[") ("AddToHookNext" "{{")
       ("ProvidesClass" "{[") ("ProvidesPackage" "{[") ("ProvidesFile" "{[")
-      ("NewMarkClass" "{"))
+      ("NewMarkClass" "{")
+      ("DeclareDocumentCommand" "|{\\{{")
+      ("NewDocumentCommand"     "|{\\{{")
+      ("ProvideDocumentCommand" "|{\\{{")
+      ("RenewDocumentCommand"   "|{\\{{")
+      ("DeclareExpandableDocumentCommand" "|{\\{{")
+      ("NewExpandableDocumentCommand"     "|{\\{{")
+      ("ProvideExpandableDocumentCommand" "|{\\{{")
+      ("RenewExpandableDocumentCommand"   "|{\\{{")
+      ("DeclareDocumentEnvironment" "{{{{")
+      ("NewDocumentEnvironment"     "{{{{")
+      ("ProvideDocumentEnvironment" "{{{{")
+      ("RenewDocumentEnvironment"   "{{{{"))
      font-lock-function-name-face 2 command)
     ("function-noarg"
      ("enspace" "enskip" "quad" "qquad" "nonumber"
@@ -379,7 +388,7 @@ variable `font-latex-fontify-sectioning'." ',num)
       "normalfont" "normalshape"
       "tableofcontents" "listoffigures" "listoftables"
       "maketitle" "makeindex" "makeglossary"
-      "sloppy" "fussy")
+      "sloppy" "fussy" "par")
      font-lock-keyword-face 2 noarg)
     ("sectioning-0"
      (("part" "*[{"))
@@ -854,8 +863,7 @@ Generated by `font-latex-user-keyword-classes'"))))
                      (throw 'single-char nil))))
                (set (intern (concat prefix (car elt)))
                     (when (> (safe-length keywords) 0)
-                    (concat "\\\\" (let ((max-specpdl-size 1000))
-                                     (regexp-opt keywords t))
+                    (concat "\\\\" (regexp-opt keywords t)
                             (unless single-char-macro-flag "\\>")))))))))
 
 (defun font-latex-make-user-keywords ()
@@ -1004,14 +1012,12 @@ The car is used for subscript, the cdr is used for 
superscripts."
 
 ;;; Syntactic keywords
 
-(defvar font-latex-syntactic-keywords nil
+(defvar-local font-latex-syntactic-keywords nil
   "Syntactic keywords used by `font-latex'.")
-(make-variable-buffer-local 'font-latex-syntactic-keywords)
 
-(defvar font-latex-syntactic-keywords-extra nil
+(defvar-local font-latex-syntactic-keywords-extra nil
   "List of syntactic keywords to add to `font-latex-syntactic-keywords'.
 The form should be the same as in `font-lock-syntactic-keywords'.")
-(make-variable-buffer-local 'font-latex-syntactic-keywords-extra)
 
 ;; Set and updated in `font-latex-set-syntactic-keywords'.
 (defvar font-latex-doctex-syntactic-keywords nil)
@@ -1752,13 +1758,12 @@ Return nil if no command is found."
   "List of characters directly after \"\\\" excluded from fontification.
 Each character is a string.")
 
-(defvar font-latex-match-simple-include-list '("@")
+(defvar-local font-latex-match-simple-include-list '("@")
   "List of characters allowed in a macro for fontification.
 Each character is a string.  This variable is initialized to
 \"@\" since internal LaTeX commands are very often redefined in a
 .tex file and the fontification should work correctly in those
 cases.")
-(make-variable-buffer-local 'font-latex-match-simple-include-list)
 
 (defun font-latex-match-simple-command (limit)
   "Search for command like \\foo before LIMIT."
@@ -1781,8 +1786,8 @@ cases.")
                      "a-zA-Z"
                      ;; Additional characters added by AUCTeX styles
                      (mapconcat #'identity
-                                  font-latex-match-simple-include-list
-                                  "")
+                                font-latex-match-simple-include-list
+                                "")
                      ;; End group
                      "]\\)*")
                     limit t)))
diff --git a/latex.el b/latex.el
index 92ecdac2e8..4cd1d47d00 100644
--- a/latex.el
+++ b/latex.el
@@ -233,8 +233,7 @@ 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)
+(defvar-local LaTeX-section-menu nil)
 
 (defun LaTeX-section-list-add-locally (sections &optional clean)
   "Add SECTIONS to `LaTeX-section-list'.
@@ -297,11 +296,9 @@ header is at the start of a line."
           "\\|" TeX-header-end
           "\\|" TeX-trailer-start))
 
-(defvar LaTeX-largest-level nil
+(defvar-local LaTeX-largest-level nil
   "Largest sectioning level with current document class.")
 
-(make-variable-buffer-local 'LaTeX-largest-level)
-
 (defun LaTeX-largest-level ()
   "Return largest sectioning level with current document class.
 Run style hooks before it has not been done."
@@ -560,16 +557,14 @@ is non-nil and the current environment is \"document\"."
   :type 'string)
 (make-variable-buffer-local 'LaTeX-default-environment)
 
-(defvar LaTeX-default-document-environment nil
+(defvar-local LaTeX-default-document-environment nil
   "The default environment when creating new ones with
 `LaTeX-environment' and the current one is \"document\".  This
 variable overrides `LaTeX-default-environment'.")
-(make-variable-buffer-local 'LaTeX-default-document-environment)
 
-(defvar LaTeX-default-tabular-environment "tabular"
+(defvar-local LaTeX-default-tabular-environment "tabular"
   "The default tabular-like environment used when inserting a table env.
 Styles such as tabularx may set it according to their needs.")
-(make-variable-buffer-local 'LaTeX-default-tabular-environment)
 
 (defvar LaTeX-environment-history nil)
 
@@ -1721,6 +1716,12 @@ right number."
 (defvar LaTeX-auto-optional nil)
 (defvar LaTeX-auto-env-args nil)
 (defvar LaTeX-auto-env-args-with-opt nil)
+(defvar LaTeX-auto-xparse-macro nil
+  "Information about user defined macros in the current buffer.
+This variable contains information after parsing the buffer.")
+(defvar LaTeX-auto-xparse-environment nil
+  "Information about user defined enviroments in the current buffer.
+This variable contains information after parsing the buffer.")
 
 (TeX-auto-add-type "label" "LaTeX")
 (TeX-auto-add-type "bibitem" "LaTeX")
@@ -1734,12 +1735,12 @@ right number."
 
 (defvar LaTeX-auto-minimal-regexp-list
   '(("\\\\document\\(style\\|class\\)\
-\\(\\[\\(\\([^#\\%]\\|%[^\n\r]*[\n\r]\\)*\\)\\]\\)?\
+\\(?:\\[\\(\\(?:[^#\\%]\\|%[^\n\r]*[\n\r]\\)*\\)\\]\\)?\
 {\\([^#\\.\n\r]+?\\)}"
-     (3 5 1) LaTeX-auto-style)
-    ("\\\\use\\(package\\)\\(\\[\\([^]]*\\)\\]\\)?\
+     (2 3 1) LaTeX-auto-style)
+    ("\\\\use\\(package\\)\\(?:\\[\\([^]]*\\)\\]\\)?\
 {\\(\\([^#}\\.%]\\|%[^\n\r]*[\n\r]\\)+?\\)}"
-     (3 4 1) LaTeX-auto-style))
+     (2 3 1) LaTeX-auto-style))
   "Minimal list of regular expressions matching LaTeX macro definitions.")
 
 (defvar LaTeX-auto-label-regexp-list
@@ -1747,23 +1748,29 @@ right number."
   "List of regular expression matching LaTeX labels only.")
 
 (defvar LaTeX-auto-index-regexp-list
-   
'(("\\\\\\(index\\|glossary\\){\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*}[^}{]*\\)*}[^}{]*\\)*\\)}"
-        2 LaTeX-auto-index-entry))
-   "List of regular expression matching LaTeX index/glossary entries only.
+  `((,(concat "\\\\\\(?:index\\|glossary\\)"
+              "{\\([^}{]*"
+              "\\(?:{[^}{]*"
+              "\\(?:{[^}{]*"
+              "\\(?:{[^}{]*}[^}{]*\\)*}"
+              "[^}{]*\\)*}"
+              "[^}{]*\\)*\\)}")
+     1 LaTeX-auto-index-entry))
+  "List of regular expression matching LaTeX index/glossary entries only.
 Regexp allows for up to 3 levels of parenthesis inside the index argument.
 This is necessary since index entries may contain commands and stuff.")
 
 (defvar LaTeX-auto-class-regexp-list
-  '(;; \RequirePackage[<options>]{<package>}[<date>]
-    ("\\\\Require\\(Package\\)\\(\\[\\([^]]*\\)\\]\\)?\
+  `(;; \RequirePackage[<options>]{<package>}[<date>]
+    ("\\\\Require\\(Package\\)\\(?:\\[\\([^]]*\\)\\]\\)?\
 {\\([^#\\.\n\r]+?\\)}"
-     (3 4 1) LaTeX-auto-style)
+     (2 3 1) LaTeX-auto-style)
     ;; \RequirePackageWithOptions{<package>}[<date>],
     ("\\\\Require\\(Package\\)WithOptions\\(\\){\\([^#\\.\n\r]+?\\)}"
      (2 3 1) LaTeX-auto-style)
     ;; \LoadClass[<options>]{<package>}[<date>]
-    ("\\\\Load\\(Class\\)\\(\\[\\([^]]*\\)\\]\\)?{\\([^#\\.\n\r]+?\\)}"
-     (3 4 1) LaTeX-auto-style)
+    ("\\\\Load\\(Class\\)\\(?:\\[\\([^]]*\\)\\]\\)?{\\([^#\\.\n\r]+?\\)}"
+     (2 3 1) LaTeX-auto-style)
     ;; \LoadClassWithOptions{<package>}[<date>]
     ("\\\\Load\\(Class\\)WithOptions\\(\\){\\([^#\\.\n\r]+?\\)}"
      (2 3 1) LaTeX-auto-style)
@@ -1777,13 +1784,16 @@ This is necessary since index entries may contain 
commands and stuff.")
     ("\\\\DeclareRobustCommand\\*?{?\\\\\\([A-Za-z]+\\)}?"
      1 TeX-auto-symbol)
     ;; Patterns for commands described in "LaTeX2e font selection" (fntguide)
-    ("\\\\DeclareMath\\(?:Symbol\\|Delimiter\\|Accent\\|Radical\\)\
-{?\\\\\\([A-Za-z]+\\)}?"
-     1 TeX-auto-symbol)
-    ("\\\\\\(Declare\\|Provide\\)Text\
-\\(?:Command\\|Symbol\\|Accent\\|Composite\\){?\\\\\\([A-Za-z]+\\)}?"
-     1 TeX-auto-symbol)
-    ("\\\\Declare\\(?:Text\\|Old\\)FontCommand{?\\\\\\([A-Za-z]+\\)}?"
+    (,(concat "\\\\"
+              (regexp-opt '("DeclareMathSymbol"  "DeclareMathDelimiter"
+                            "DeclareMathAccent"  "DeclareMathRadical"
+                            "DeclareTextCommand" "DeclareTextSymbol"
+                            "DeclareTextAccent"  "DeclareTextComposite"
+                            "ProvideTextCommand" "ProvideTextSymbol"
+                            "ProvideTextAccent"  "ProvideTextComposite"
+                            "DeclareTextFontCommand"
+                            "DeclareOldFontCommand"))
+              "{?\\\\\\([A-Za-z]+\\)}?")
      1 TeX-auto-symbol))
   "List of regular expressions matching macros in LaTeX classes and packages.")
 
@@ -1793,8 +1803,9 @@ This is necessary since index entries may contain 
commands and stuff.")
 
 (defvar LaTeX-auto-counter-regexp-list
   (let ((token TeX-token-char))
-    `((,(concat "\\\\newcounter *{\\(" token "+\\)}") 1 LaTeX-auto-counter)
-      (,(concat "\\\\@definecounter{\\(" token "+\\)}") 1 LaTeX-auto-counter)))
+    `((,(concat "\\\\"
+                "\\(?:newcounter\\|@definecounter\\) *{\\(" token "+\\)}")
+       1 LaTeX-auto-counter)))
   "List of regular expressions matching LaTeX counters only.")
 
 (defvar LaTeX-auto-length-regexp-list
@@ -1817,27 +1828,47 @@ This is necessary since index entries may contain 
commands and stuff.")
         (2 3 1) LaTeX-auto-arguments)
        (,(concat "\\\\\\(?:new\\|provide\\)command\\*?{?\\\\\\(" token 
"+\\)}?")
         1 TeX-auto-symbol)
+       (,(concat
+          "\\\\\\(New\\|Renew\\|Provide\\|Declare\\)"
+          "\\(?:Expandable\\)?"
+          "DocumentCommand"
+          "[ \t\n\r]*"
+          "{?"
+          "[ \t\n\r]*"
+          "\\\\\\(" token "+\\)"
+          "[ \t\n\r]*"
+          "}?"
+          "[ \t\n\r]*"
+          
"{\\([^}{]*\\(?:{[^}{]*\\(?:{[^}{]*\\(?:{[^}{]*}[^}{]*\\)*}[^}{]*\\)*}[^}{]*\\)*\\)}")
+        (0 2 3 1) LaTeX-auto-xparse-macro)
        ("\\\\\\(re\\)?newenvironment\\*?{\\([^}]+\\)}\\[\\([0-9]+\\)\\]\\["
         (2 3 1) LaTeX-auto-env-args-with-opt)
        ("\\\\\\(re\\)?newenvironment\\*?{\\([^}]+\\)}\\[\\([0-9]+\\)\\]"
         (2 3 1) LaTeX-auto-env-args)
        ("\\\\newenvironment\\*?{\\([^}]+\\)}"
         1 LaTeX-auto-environment)
+       (,(concat
+          "\\\\\\(New\\|Renew\\|Provide\\|Declare\\)"
+          "DocumentEnvironment"
+          "[ \t\n\r]*"
+          "{\\([^}]+\\)}"
+          "[ \t\n\r]*"
+          
"{\\([^}{]*\\(?:{[^}{]*\\(?:{[^}{]*\\(?:{[^}{]*}[^}{]*\\)*}[^}{]*\\)*}[^}{]*\\)*\\)}")
+        (0 2 3 1) LaTeX-auto-xparse-environment)
        (,(concat "\\\\newtheorem{\\(" token "+\\)}") 1 LaTeX-auto-environment)
        ("\\\\input{\"?\\([^#}%\"\\\n\r]+?\\)\\(?:\\.[^#}%/\"\\.\n\r]+\\)?\"?}"
         1 TeX-auto-file)
        ("\\\\include{\\(\\.*[^#}%\\.\n\r]+\\)\\(\\.[^#}%\\.\n\r]+\\)?}"
         1 TeX-auto-file)
-       (,(concat "\\\\bibitem{\\(" token "[^, \n\r\t%\"#'()={}]*\\)}")
-        1 LaTeX-auto-bibitem)
-       (,(concat "\\\\bibitem\\[[^][\n\r]+\\]{\\(" token "[^, 
\n\r\t%\"#'()={}]*\\)}")
+       (,(concat "\\\\bibitem\\(?:\\[[^][\n\r]+\\]\\)?"
+                 "{\\(" token "[^, \n\r\t%\"#'()={}]*\\)}")
         1 LaTeX-auto-bibitem)
        ("\\\\bibliography{\\([^#}\\\n\r]+\\)}" 1 LaTeX-auto-bibliography)
        ("\\\\addbibresource\\(?:\\[[^]]+\\]\\)?{\\([^#}\\\n\r]+\\)\\..+}"
         1 LaTeX-auto-bibliography)
        
("\\\\add\\(?:global\\|section\\)bib\\(?:\\[[^]]+\\]\\)?{\\([^#}\\\n\r.]+\\)\\(?:\\..+\\)?}"
 1 LaTeX-auto-bibliography)
-       ("\\\\newrefsection\\[\\([^]]+\\)\\]" 1 LaTeX-split-bibs)
-       ("\\\\begin{refsection}\\[\\([^]]+\\)\\]" 1 LaTeX-split-bibs)))
+       ("\\\\\\(?:newrefsection\\|begin{refsection}\\)\\[\\([^]]+\\)\\]"
+        1 LaTeX-split-bibs)))
    LaTeX-auto-class-regexp-list
    LaTeX-auto-label-regexp-list
    LaTeX-auto-index-regexp-list
@@ -1867,7 +1898,9 @@ Split the string at commas and remove Biber file 
extensions."
         LaTeX-auto-optional nil
         LaTeX-auto-env-args nil
         LaTeX-auto-style nil
-        LaTeX-auto-end-symbol nil))
+        LaTeX-auto-end-symbol nil
+        LaTeX-auto-xparse-macro nil
+        LaTeX-auto-xparse-environment nil))
 
 (add-hook 'TeX-auto-prepare-hook #'LaTeX-auto-prepare)
 
@@ -1913,7 +1946,7 @@ The input string may include LaTeX comments and newlines."
           (delete-char -1)))))
     opts))
 
-(defvar LaTeX-provided-class-options nil
+(defvar-local LaTeX-provided-class-options nil
   "Alist of options provided to LaTeX classes.
 For each element, the CAR is the name of the class, the CDR is
 the list of options provided to it.
@@ -1922,7 +1955,6 @@ For example, its value will be
   ((\"book\" \"a4paper\" \"11pt\" \"openany\" \"fleqn\")
    ...)
 See also `LaTeX-provided-package-options'.")
-(make-variable-buffer-local 'LaTeX-provided-class-options)
 
 (defun LaTeX-provided-class-options-member (class option)
   "Return non-nil if OPTION has been given to CLASS at load time.
@@ -1936,7 +1968,7 @@ Return first found class option matching REGEXP, or nil 
if not found."
                             (mapcar #'cdr LaTeX-provided-class-options))
               #'string-match))
 
-(defvar LaTeX-provided-package-options nil
+(defvar-local LaTeX-provided-package-options nil
   "Alist of options provided to LaTeX packages.
 For each element, the CAR is the name of the package, the CDR is
 the list of options provided to it.
@@ -1946,13 +1978,171 @@ For example, its value will be
    (\"geometry\" \"a4paper\" \"top=2cm\" \"bottom=2cm\" \"left=2.5cm\" 
\"right=2.5cm\")
    ...)
 See also `LaTeX-provided-class-options'.")
-(make-variable-buffer-local 'LaTeX-provided-package-options)
 
 (defun LaTeX-provided-package-options-member (package option)
   "Return non-nil if OPTION has been given to PACKAGE at load time.
 The value is actually the tail of the list of options given to PACKAGE."
   (member option (cdr (assoc package LaTeX-provided-package-options))))
 
+(defun LaTeX-arg-xparse-embellishment (_optional embellish)
+  "Special insert function for embellishments.
+Compatibility argument OPTIONAL is ignored.  EMBELLISH is a
+string with parsed elements inserted in the buffer.  This
+function also sets the value of `TeX-exit-mark' where the point
+will be once the insertion is completed."
+  (let (p)
+    (just-one-space)
+    (setq p (point))
+    (insert embellish)
+    (set-marker TeX-exit-mark (1+ p))))
+
+(defun LaTeX-xparse-macro-parse (type)
+  "Process parsed macro and environment definitions.
+TYPE is one of the symbols mac or env."
+  (dolist (xcmd (if (eq type 'mac)
+                    LaTeX-auto-xparse-macro
+                  LaTeX-auto-xparse-environment))
+    (let ((name (string-trim (nth 1 xcmd) "[ \t\r\n%]+" "[ \t\r\n%]+"))
+          (spec (nth 2 xcmd))
+          (what (nth 3 xcmd))
+          (case-fold-search nil)
+          (syntax (TeX-search-syntax-table ?\{ ?\}))
+          args opt-star opt-token)
+      (with-temp-buffer
+        (set-syntax-table LaTeX-mode-syntax-table)
+        (insert (replace-regexp-in-string "[ \t\r\n%]" "" spec))
+        (goto-char (point-min))
+        (while (looking-at-p "[+!>=bmrRvodODsteE]")
+          (cond ((looking-at-p "[+!b]")
+                 ;; + or !: Long argument or space aware: Move over
+                 ;; them.  b is special; only available for
+                 ;; enviroments
+                 (forward-char 1))
+                ;; Argument processors and key-val modifier: Move
+                ;; over [>=] and a balanced {}
+                ((looking-at-p "[>=]")
+                 (forward-char 1)
+                 (with-syntax-table syntax (forward-sexp)))
+                ;; Mandatory arguments:
+                ;; m: Ask for input with "Text" as prompt
+                ((looking-at-p "m")
+                 (forward-char 1)
+                 (push "Text" args))
+                ;; r<token1><token2>
+                ((looking-at-p "r")
+                 (re-search-forward "r\\(.\\)\\(.\\)" (+ (point) 3) t)
+                 (push `(TeX-arg-string nil nil nil nil
+                                        ,(match-string-no-properties 1)
+                                        ,(match-string-no-properties 2))
+                       args))
+                ;; R<token1><token2>{default}
+                ((looking-at-p "R")
+                 (re-search-forward "R\\(.\\)\\(.\\)" (+ (point) 3) t)
+                 (with-syntax-table syntax (forward-sexp))
+                 (push `(TeX-arg-string nil nil nil nil
+                                        ,(match-string-no-properties 1)
+                                        ,(match-string-no-properties 2))
+                       args))
+                ;; v: Use `TeX-arg-verb-delim-or-brace'
+                ((looking-at-p "v")
+                 (forward-char 1)
+                 (push #'TeX-arg-verb-delim-or-brace args))
+                ;; Optional arguments:
+                ;; o standard LaTeX optional in square brackets
+                ((looking-at-p "o")
+                 (forward-char 1)
+                 (push (vector "Text") args))
+                ;; d<token1><token2>
+                ((looking-at-p "d")
+                 (re-search-forward "d\\(.\\)\\(.\\)" (+ (point) 3) t)
+                 (push (vector #'TeX-arg-string nil nil nil nil
+                               (match-string-no-properties 1)
+                               (match-string-no-properties 2))
+                       args))
+                ;; O{default}
+                ((looking-at-p "O")
+                 (forward-char 1)
+                 (with-syntax-table syntax (forward-sexp))
+                 (push (vector "Text") args))
+                ;; D<token1><token2>{default}
+                ((looking-at-p "D")
+                 (re-search-forward "D\\(.\\)\\(.\\)" (+ (point) 3) t)
+                 (with-syntax-table syntax (forward-sexp))
+                 (push (vector #'TeX-arg-string nil nil nil nil
+                               (match-string-no-properties 1)
+                               (match-string-no-properties 2))
+                       args))
+                ;; s: optional star
+                ((looking-at-p "s")
+                 (forward-char 1)
+                 (setq opt-star t))
+                ;; t: optional <token>
+                ((looking-at-p "t")
+                 (re-search-forward "t\\(.\\)" (+ (point) 2) t)
+                 (setq opt-token (match-string-no-properties 1)))
+                ;; e{tokes} a set of optional embellishments
+                ((looking-at-p "e")
+                 (forward-char)
+                 (if (looking-at-p TeX-grop)
+                     (re-search-forward "{\\([^}]+\\)}" nil t)
+                   (re-search-forward "\\(.\\)" (1+ (point)) t))
+                 (push `(LaTeX-arg-xparse-embellishment
+                         ,(match-string-no-properties 1))
+                       args))
+                ;; E{tokes}{defaults}
+                ((looking-at-p "E")
+                 (forward-char)
+                 (if (looking-at-p TeX-grop)
+                     (re-search-forward "{\\([^}]+\\)}" nil t)
+                   (re-search-forward "\\(.\\)" (1+ (point)) t))
+                 (push `(LaTeX-arg-xparse-embellishment
+                         ,(match-string-no-properties 1))
+                       args)
+                 (when (looking-at-p TeX-grop)
+                   (with-syntax-table syntax (forward-sexp))))
+                ;; Finished:
+                (t nil))))
+      (if (eq type 'env)
+          ;; Parsed enviroments: If we are Renew'ing or Delare'ing, we
+          ;; delete the enviroment first from `LaTeX-environment-list'
+          ;; before adding the new one.  We have to sort the value of
+          ;; `LaTeX-environment-list' by running the function of the
+          ;; same name:
+          (progn
+            (when (member what '("Renew" "Declare"))
+              (setq LaTeX-auto-environment
+                    (assq-delete-all (car (assoc name LaTeX-auto-environment))
+                                     LaTeX-auto-environment)))
+            (add-to-list 'LaTeX-auto-environment
+                         (if args
+                             `(,name LaTeX-env-args ,@(reverse args))
+                           (list name))))
+        ;; Parsed macros: If we are Renew'ing or Delare'ing, we delete
+        ;; the macros first from `TeX-symbol-list' before adding the
+        ;; new ones.  We have to sort the value of `TeX-symbol-list'
+        ;; by running the function of the same name:
+        (when (member what '("Renew" "Declare"))
+          (setq TeX-auto-symbol
+                (assq-delete-all (car (assoc name TeX-auto-symbol))
+                                 TeX-auto-symbol))
+          (when opt-star
+            (setq TeX-auto-symbol
+                  (assq-delete-all (car (assoc (concat name "*")
+                                               TeX-auto-symbol))
+                                   TeX-auto-symbol)))
+          (when opt-token
+            (setq TeX-auto-symbol
+                  (assq-delete-all (car (assoc (concat name opt-token)
+                                               TeX-auto-symbol))
+                                   TeX-auto-symbol))))
+        (add-to-list 'TeX-auto-symbol (cons name (reverse args)))
+        (when opt-star
+          (add-to-list 'TeX-auto-symbol (cons (concat name "*")
+                                              (reverse args))))
+        (when opt-token
+          (add-to-list 'TeX-auto-symbol (cons (concat name opt-token)
+                                              (reverse args))))))))
+
 (defun LaTeX-auto-cleanup ()
   "Cleanup after LaTeX parsing."
 
@@ -2048,6 +2238,9 @@ The value is actually the tail of the list of options 
given to PACKAGE."
                              (string-to-number (nth 1 entry)))))
         LaTeX-auto-arguments)
 
+  ;; Cleanup for marcos defined with former xparse commands:
+  (LaTeX-xparse-macro-parse 'mac)
+
   ;; Cleanup default optional arguments
   (mapc (lambda (entry)
           ;; If we're renewcommand-ing and there is already an entry
@@ -2094,6 +2287,9 @@ The value is actually the tail of the list of options 
given to PACKAGE."
                              (1- (string-to-number (nth 1 entry))))))
         LaTeX-auto-env-args-with-opt)
 
+  ;; Cleanup for enviroments defined with former xparse commands:
+  (LaTeX-xparse-macro-parse 'env)
+
   ;; Cleanup use of def to add environments
   ;; NOTE: This uses an O(N^2) algorithm, while an O(N log N)
   ;; algorithm is possible.
@@ -2123,9 +2319,8 @@ The value is actually the tail of the list of options 
given to PACKAGE."
 
 ;;; Biber support
 
-(defvar LaTeX-using-Biber nil
+(defvar-local LaTeX-using-Biber nil
   "Used to track whether Biber is in use.")
-(make-variable-buffer-local 'LaTeX-using-Biber)
 
 ;;; BibTeX
 
@@ -3299,7 +3494,8 @@ which see."
                         complete)
    (cond ((and (listp key-val-alist)
                (symbolp (car key-val-alist))
-               (fboundp (car key-val-alist)))
+               (fboundp (car key-val-alist))
+               (not (eq (car key-val-alist) 'lambda)))
           (funcall (car key-val-alist)))
          ((functionp key-val-alist)
           (funcall key-val-alist))
@@ -3387,7 +3583,8 @@ INHERIT-INPUT-METHOD are passed to `completing-read', 
which see."
                         complete)
    (cond ((and (listp collection)
                (symbolp (car collection))
-               (fboundp (car collection)))
+               (fboundp (car collection))
+               (not (eq (car collection) 'lambda)))
           (funcall (car collection)))
          ((functionp collection)
           (funcall collection))
@@ -3451,7 +3648,8 @@ INHERIT-INPUT-METHOD are passed to
                         complete)
    (cond ((and (listp table)
                (symbolp (car table))
-               (fboundp (car table)))
+               (fboundp (car table))
+               (not (eq (car table) 'lambda)))
           (funcall (car table)))
          ((functionp table)
           (funcall table))
@@ -3700,7 +3898,7 @@ including buffer-local keyword additions via
   :group 'LaTeX-macro
   :type '(repeat (string)))
 
-(defvar LaTeX-verbatim-macros-with-delims-local nil
+(defvar-local LaTeX-verbatim-macros-with-delims-local nil
   "Buffer-local variable for inline verbatim with args in delimiters.
 
 Style files should add constructs to this variable and not to
@@ -3710,7 +3908,6 @@ Programs should not use this variable directly but the 
function
 `LaTeX-verbatim-macros-with-delims' which returns a value
 including values of the variable
 `LaTeX-verbatim-macros-with-delims' as well.")
-(make-variable-buffer-local 'LaTeX-verbatim-macros-with-delims-local)
 (put 'LaTeX-verbatim-macros-with-delims-local 'safe-local-variable
      #'TeX--list-of-string-p)
 
@@ -3725,7 +3922,7 @@ including buffer-local keyword additions via
   :group 'LaTeX-macro
   :type '(repeat (string)))
 
-(defvar LaTeX-verbatim-macros-with-braces-local nil
+(defvar-local LaTeX-verbatim-macros-with-braces-local nil
   "Buffer-local variable for inline verbatim with args in braces.
 
 Style files should add constructs to this variable and not to
@@ -3735,7 +3932,6 @@ Programs should not use this variable directly but the 
function
 `LaTeX-verbatim-macros-with-braces' which returns a value
 including values of the variable
 `LaTeX-verbatim-macros-with-braces' as well.")
-(make-variable-buffer-local 'LaTeX-verbatim-macros-with-braces-local)
 (put 'LaTeX-verbatim-macros-with-braces-local 'safe-local-variable
      #'TeX--list-of-string-p)
 
@@ -3750,7 +3946,7 @@ buffer-local keyword additions via
   :group 'LaTeX-environment
   :type '(repeat (string)))
 
-(defvar LaTeX-verbatim-environments-local nil
+(defvar-local LaTeX-verbatim-environments-local nil
   "Buffer-local variable for verbatim environments.
 
 Style files should add constructs to this variable and not to
@@ -3759,7 +3955,6 @@ Style files should add constructs to this variable and 
not to
 Programs should not use this variable directly but the function
 `LaTeX-verbatim-environments' which returns a value including
 values of the variable `LaTeX-verbatim-environments' as well.")
-(make-variable-buffer-local 'LaTeX-verbatim-environments-local)
 (put 'LaTeX-verbatim-environments-local 'safe-local-variable
      #'TeX--list-of-string-p)
 
@@ -3859,21 +4054,22 @@ of the macro argument as cons."
 The macro body (\"\\verb\") and its delimiters, including
 optional argument if any, aren't considered as component of a
 verbatim-like construct."
-  (when pos (goto-char pos))
-  (save-match-data
-    ;; TODO: Factor out syntax propertize facility from font-latex.el
-    ;; and re-implement as major mode feature.  Then we can drop the
-    ;; fallback code below.
-    (if (eq TeX-install-font-lock 'font-latex-setup)
-        (progn
-          (syntax-propertize (point))
-          (nth 3 (syntax-ppss)))
-      ;; Fallback for users who stay away from font-latex.
-      (or
-       (let ((region (LaTeX-verbatim-macro-boundaries t)))
-         (and region
-              (<= (car region) (point) (cdr region))))
-       (member (LaTeX-current-environment) (LaTeX-verbatim-environments))))))
+  (save-excursion
+    (when pos (goto-char pos))
+    (save-match-data
+      ;; TODO: Factor out syntax propertize facility from font-latex.el
+      ;; and re-implement as major mode feature.  Then we can drop the
+      ;; fallback code below.
+      (if (eq TeX-install-font-lock 'font-latex-setup)
+          (progn
+            (syntax-propertize (point))
+            (nth 3 (syntax-ppss)))
+        ;; Fallback for users who stay away from font-latex.
+        (or
+         (let ((region (LaTeX-verbatim-macro-boundaries t)))
+           (and region
+                (<= (car region) (point) (cdr region))))
+         (member (LaTeX-current-environment) 
(LaTeX-verbatim-environments)))))))
 
 
 ;;; Formatting
@@ -6664,10 +6860,8 @@ The argument IGNORED is not used in any way."
         (setq LaTeX-section-menu
               (mapcar #'LaTeX-section-menu-entry LaTeX-section-list)))))
 
-(defvar LaTeX-environment-menu nil)
-(make-variable-buffer-local 'LaTeX-environment-menu)
-(defvar LaTeX-environment-modify-menu nil)
-(make-variable-buffer-local 'LaTeX-environment-modify-menu)
+(defvar-local LaTeX-environment-menu nil)
+(defvar-local LaTeX-environment-modify-menu nil)
 (defun LaTeX-environment-menu-filter (menu)
   "Filter function for the environment submenus in the mode menu.
 The argument MENU is the name of the submenu in concern and
@@ -6861,13 +7055,12 @@ value overriding `LaTeX-babel-hyphen-after-hyphen'."
                                    (boolean :tag "Insert plain hyphen first"
                                             :value t))))
 
-(defvar LaTeX-babel-hyphen-language nil
+(defvar-local LaTeX-babel-hyphen-language nil
   "String determining language-specific behavior of hyphen insertion.
 It serves as an indicator that the babel hyphenation string
 should be used and as a means to find a potential customization
 in `LaTeX-babel-hyphen-language-alist' related to the active
 language.  It is usually set by language-related style files.")
-(make-variable-buffer-local 'LaTeX-babel-hyphen-language)
 
 (defun LaTeX-babel-insert-hyphen (force)
   "Insert a hyphen string.
@@ -7725,7 +7918,7 @@ or `LaTeX-environment-list' and returns it."
     ;; cases, but will also fail for example in hyperref.el.  This
     ;; decision should revisited at a later stage:
     (when (assq 'TeX-arg-conditional arg-list)
-      (cl-flet ((y-or-n-p #'TeX-always))
+      (cl-letf (((symbol-function 'y-or-n-p) #'TeX-always))
         (while (and arg-list
                     (setq arg (car arg-list)))
           (if (and (listp arg) (eq (car arg) 'TeX-arg-conditional))
@@ -7845,8 +8038,9 @@ ARG is the entry for the current argument in buffer 
stored in
            (fun1 (lambda (elt)
                    (cond ((and (listp elt)
                                (symbolp (car elt))
-                               (fboundp (car elt)))
-                          ;; It is a function call:
+                               (fboundp (car elt))
+                               (not (eq (car elt) 'lambda)))
+                          ;; It is a named function and not anonymous:
                           (funcall (car elt)))
                          ;; It is a function object
                          ((functionp elt)
@@ -8689,6 +8883,65 @@ function would return non-nil and `(match-string 1)' 
would return
 
      '("linespread" "Factor")
 
+     ;; Macros for document-command parser, aka xparse added to LaTeX
+     ;; kernel with 2020-10-01 release:
+     '("DeclareDocumentCommand"
+       TeX-arg-define-macro "Argument specification" t)
+     '("NewDocumentCommand"
+       TeX-arg-define-macro "Argument specification" t)
+     '("RenewDocumentCommand"
+       TeX-arg-macro "Argument specification" t)
+     '("ProvideDocumentCommand"
+       TeX-arg-define-macro "Argument specification" t)
+
+     ;; Declaring environments
+     '("DeclareDocumentEnvironment" TeX-arg-define-environment
+       "Argument specification" t t)
+     '("NewDocumentEnvironment" TeX-arg-define-environment
+       "Argument specification" t t)
+     '("RenewDocumentEnvironment" TeX-arg-environment
+       "Argument specification" t t)
+     '("ProvideDocumentEnvironment" TeX-arg-define-environment
+       "Argument specification" t t)
+
+     ;; Fully-expandable document commands
+     '("DeclareExpandableDocumentCommand"
+       TeX-arg-define-macro "Argument specification" t)
+     '("NewExpandableDocumentCommand"
+       TeX-arg-define-macro "Argument specification" t)
+     '("RenewExpandableDocumentCommand"
+       TeX-arg-macro "Argument specification" t)
+     '("ProvideExpandableDocumentCommand"
+       TeX-arg-define-macro "Argument specification" t)
+
+     ;; Testing special values
+     '("IfBooleanTF" 3)
+     '("IfBooleanT" 2)
+     '("IfBooleanF" 2)
+     '("IfNoValueTF" 3)
+     '("IfNoValueT" 2)
+     '("IfNoValueF" 2)
+     '("IfValueTF" 3)
+     '("IfValueT" 2)
+     '("IfValueF" 2)
+     '("IfBlankTF" 3)
+     '("IfBlankT" 2)
+     '("IfBlankF" 2)
+     "BooleanTrue"
+     "BooleanFalse"
+     ;; Argument processors
+     "ProcessedArgument"
+     "ReverseBoolean"
+     '("SplitArgument" "Number" "Token")
+     '("SplitList" "Token")
+     "TrimSpaces"
+     '("ProcessList" "List" "Function")
+     ;; Access to the argument specification
+     '("GetDocumentCommandArgSpec" TeX-arg-macro)
+     '("GetDocumentEnvironmmentArgSpec" TeX-arg-environment)
+     '("ShowDocumentCommandArgSpec" TeX-arg-macro)
+     '("ShowDocumentEnvironmentArgSpec" TeX-arg-environment)
+
      ;; LaTeX hook macros:
      '("AddToHook"      TeX-arg-hook [ "Label" ] t)
      '("RemoveFromHook" TeX-arg-hook [ "Label" ])
diff --git a/preview.el.in b/preview.el.in
index 4e113baaff..1472bf767f 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -1,6 +1,6 @@
 ;;; preview.el --- embed preview LaTeX images in source buffer  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2001-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2001-2023  Free Software Foundation, Inc.
 
 ;; Author: David Kastrup
 ;; Keywords: tex, wp, convenience
@@ -1488,6 +1488,9 @@ a fixed number."
                  (const 1.0)
                  (number :value 1.0)
                  (function :value preview-scale-from-face)))
+;;;###autoload
+(put 'preview-scale-function 'safe-local-variable
+     (lambda (x) (and (numberp x) (<= 0.1 x 10))))
 
 (defcustom preview-default-document-pt 10
   "Assumed document point size for `preview-scale-from-face'.
diff --git a/style/bicaption.el b/style/bicaption.el
index c0ed9773d4..7437770ce7 100644
--- a/style/bicaption.el
+++ b/style/bicaption.el
@@ -1,4 +1,4 @@
-;;; bicaption.el --- AUCTeX style for `bicaption.sty' (v1.1-158)  -*- 
lexical-binding: t; -*-
+;;; bicaption.el --- AUCTeX style for `bicaption.sty' (v1.6)  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2016--2023 Free Software Foundation, Inc.
 
@@ -26,8 +26,8 @@
 
 ;;; Commentary:
 
-;; This file adds support for `bicaption.sty' (v1.1-158) from
-;; 2016/03/27.  `bicaption.sty' is part of TeXLive.
+;; This file adds support for `bicaption.sty' (v1.6) from
+;; 2023/07/10.  `bicaption.sty' is part of TeXLive.
 
 ;; If things do not work or when in doubt, press `C-c C-n'.  Comments
 ;; for improvement are welcome.
@@ -139,22 +139,6 @@ arguments."
       (indent-according-to-mode)
       (end-of-line))))
 
-(defun LaTeX-arg-bicaption-captionsetup (optional)
-  "Query for 2 arguments for \"\\captionsetup\" with bicaption.sty loaded.
-When OPTIONAL is non-nil, include both as optional arguments in
-square brackets."
-  (let* ((flttype (completing-read (TeX-argument-prompt optional nil "Float 
type")
-                                  LaTeX-caption-supported-float-types))
-         (biflt (if (and (not (or (string= flttype "bi")
-                                  (string= flttype "bi-first")
-                                  (string= flttype "bi-second")))
-                         flttype (not (string= flttype "")))
-                    (completing-read (TeX-argument-prompt optional nil 
"Bicaption type")
-                                     '("bi" "bi-first" "bi-second"))
-                  "")))
-    (TeX-argument-insert flttype optional)
-    (TeX-argument-insert biflt optional)))
-
 (TeX-add-style-hook
  "bicaption"
  (lambda ()
@@ -164,6 +148,13 @@ square brackets."
 
    ;; Macros
    (TeX-add-symbols
+    '("bicaptionsetup"
+      [TeX-arg-completing-read LaTeX-caption-supported-float-types
+                               "Float type"]
+      (TeX-arg-key-val (LaTeX-caption-key-val-options)
+                       "First language")
+      (TeX-arg-key-val (LaTeX-caption-key-val-options)
+                       "Second language"))
     '("bicaption"        (LaTeX-arg-bicaption-bicaption))
     '("bicaption*"       (LaTeX-arg-bicaption-bicaption  nil    t))
     '("bicaptionbox"     (LaTeX-arg-bicaption-bicaption  nil   nil  t   t) t)
@@ -175,7 +166,8 @@ square brackets."
 
    ;; \bi(sub)?caption(box)? macros should get their own lines
    (LaTeX-paragraph-commands-add-locally '("bicaption"    "bicaptionbox"
-                                           "bisubcaption" "bisubcaptionbox"))
+                                           "bisubcaption" "bisubcaptionbox"
+                                           "bicaptionsetup"))
 
    ;; Fontification
    (when (and (featurep 'font-latex)
@@ -184,7 +176,9 @@ square brackets."
                                 ("bicaptionbox"    "*[{[{[[")
                                 ("bisubcaption"    "*[{[{")
                                 ("bisubcaptionbox" "*[{[{[["))
-                              'textual)))
+                              'textual)
+     (font-latex-add-keywords '(("bicaptionsetup"  "[{{"))
+                              'function)))
  TeX-dialect)
 
 (defun LaTeX-bicaption-package-options-list ()
diff --git a/style/caption.el b/style/caption.el
index db745142ac..68366e843d 100644
--- a/style/caption.el
+++ b/style/caption.el
@@ -206,8 +206,6 @@ package if loaded."
 
 (defvar LaTeX-caption-supported-float-types
   '("figure" "table" "ContinuedFloat"   ; Standard caption.sty
-    "sub" "subtable" "subfigure"        ; subcaption.sty
-    "bi" "bi-first" "bi-second"         ; bicaption.sty
     "ruled" "boxed"                     ; float.sty
     "floatingfigure" "floatingtable"    ; floatflt.sty
     "lstlisting"                        ; listings.sty
@@ -383,26 +381,26 @@ STAR is non-nil, do not query for a short-caption and a 
label."
     '("captionof*" (LaTeX-arg-caption-captionof t))
 
     '("captionsetup"
-      (TeX-arg-conditional (member "bicaption" (TeX-style-list))
-          ([LaTeX-arg-bicaption-captionsetup])
-        ([TeX-arg-completing-read
-          LaTeX-caption-supported-float-types "Float type"]))
+      [TeX-arg-completing-read LaTeX-caption-supported-float-types
+                               "Float type"]
       (TeX-arg-key-val (LaTeX-caption-key-val-options)))
 
     '("captionsetup*"
-      (TeX-arg-conditional (member "bicaption" (TeX-style-list))
-          ([LaTeX-arg-bicaption-captionsetup])
-        ([TeX-arg-completing-read
-          LaTeX-caption-supported-float-types "Float type"]))
+      [TeX-arg-completing-read LaTeX-caption-supported-float-types
+                               "Float type"]
       (TeX-arg-key-val (LaTeX-caption-key-val-options)))
 
     '("clearcaptionsetup"
-      [TeX-arg-completing-read (LaTeX-caption-key-val-options) "Single key"]
-      (TeX-arg-completing-read LaTeX-caption-supported-float-types "Float 
type"))
+      [TeX-arg-completing-read (LaTeX-caption-key-val-options)
+                               "Single key"]
+      (TeX-arg-completing-read LaTeX-caption-supported-float-types
+                               "Float type"))
 
     '("clearcaptionsetup*"
-      [TeX-arg-completing-read (LaTeX-caption-key-val-options) "Single key"]
-      (TeX-arg-completing-read LaTeX-caption-supported-float-types "Float 
type"))
+      [TeX-arg-completing-read (LaTeX-caption-key-val-options)
+                               "Single key"]
+      (TeX-arg-completing-read LaTeX-caption-supported-float-types
+                               "Float type"))
 
     '("captionbox"  (LaTeX-arg-caption-captionbox) t)
 
@@ -450,8 +448,10 @@ STAR is non-nil, do not query for a short-caption and a 
label."
 
     '("bothIfSecond" 2))
 
-   ;; \caption(box|of) macros should get their own lines
-   (LaTeX-paragraph-commands-add-locally '("captionbox" "captionof"))
+   ;; \caption(of|box|setup) macros should get their own lines
+   (LaTeX-paragraph-commands-add-locally '("captionof"
+                                           "captionbox"
+                                           "captionsetup"))
 
    ;; Fontification
    (when (and (featurep 'font-latex)
@@ -477,8 +477,7 @@ STAR is non-nil, do not query for a short-caption and a 
label."
  TeX-dialect)
 
 (defvar LaTeX-caption-package-options-list
-  (append '(("compatibility"  ("true" "false"))
-            ("figureposition" ("top" "above" "bottom" "below"))
+  (append '(("figureposition" ("top" "above" "bottom" "below"))
             ("tableposition"  ("top" "above" "bottom" "below")))
           LaTeX-caption-key-val-options)
   "Package options for the caption package.")
diff --git a/style/fvextra.el b/style/fvextra.el
index c74baf13d0..9bcf120018 100644
--- a/style/fvextra.el
+++ b/style/fvextra.el
@@ -1,6 +1,6 @@
-;;; fvextra.el --- AUCTeX style for `fvextra.sty' (v1.4)  -*- lexical-binding: 
t; -*-
+;;; fvextra.el --- AUCTeX style for `fvextra.sty' (v1.6)  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2017--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2017--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -26,7 +26,7 @@
 
 ;;; Commentary:
 
-;; This file adds support for `fvextra.sty' (v1.5) from 2022/11/30.
+;; This file adds support for `fvextra.sty' (v1.6) from 2023/11/19.
 ;; `fvextra.sty' is part of TeXLive.
 
 ;;; Code:
@@ -86,6 +86,7 @@
     ("breakbeforeinrun" ("true" "false"))
     ("breakbeforesymbolpre")
     ("breakbeforesymbolpost")
+    ("breakcollapsespaces" ("true" "false"))
     ("breakindent")
     ("breakindentnchars")
     ("breaklines" ("true" "false"))
@@ -104,7 +105,8 @@
     ("breaksymbolsepleft")
     ("breaksymbolsepleftnchars")
     ("breaksymbolsepright")
-    ("breaksymbolseprightnchars"))
+    ("breaksymbolseprightnchars")
+    ("spacebreak"))
   "Key=value options for fvextra macros and environments.")
 
 (TeX-add-style-hook
@@ -118,8 +120,13 @@
     ;; 4.1 Inline formatting with \fvinlineset
     '("fvinlineset" (TeX-arg-key-val (LaTeX-fancyvrb-key-val-options)))
 
-    ;; 4.2 Line and text formatting
+    ;; 4.2 Custom formatting for inline commands like \Verb with
+    ;; \FancyVerbFormatInline
     "FancyVerbFormatInline"
+
+    ;; 4.3 Custom formatting for environments like Verbatim with
+    ;; \FancyVerbFormatLine and \FancyVerbFormatText
+    "FancyVerbFormatLine"
     "FancyVerbFormatText"
 
     ;; 6 New commands and environments
@@ -129,6 +136,17 @@
     '("EscVerb*"
       [TeX-arg-key-val (LaTeX-fancyvrb-key-val-options)] "Text")
 
+    ;; 6.5 \VerbatimInsertBuffer
+    '("VerbatimInsertBuffer"
+      [TeX-arg-key-val (lambda ()
+                         (append (LaTeX-fancyvrb-key-val-options)
+                                 '(("afterbuffer")
+                                   ("bufferer")
+                                   ("bufferlengthname")
+                                   ("bufferlinename")
+                                   ("buffername")
+                                   ("globalbuffer" ("true" "false")))))])
+
     ;; 7.3.2 Breaks within macro arguments
     "FancyVerbBreakStart"
     "FancyVerbBreakStop"
@@ -141,12 +159,28 @@
    ;; 6.2 VerbEnv environment
    (LaTeX-add-environments
     '("VerbEnv" LaTeX-env-args
-      [TeX-arg-key-val (LaTeX-fancyvrb-key-val-options)]))
+      [TeX-arg-key-val (LaTeX-fancyvrb-key-val-options)])
+
+    ;; 6.3 VerbatimWrite
+    '("VerbatimWrite" LaTeX-env-args
+      [TeX-arg-key-val (("writefilehandle") ("writer"))])
+
+    ;; 6.4 VerbatimBuffer
+    '("VerbatimBuffer" LaTeX-env-args
+      [TeX-arg-key-val (("afterbuffer")
+                        ("bufferer")
+                        ("bufferlengthname")
+                        ("bufferlinename")
+                        ("buffername")
+                        ("globalbuffer" ("true" "false")))]) )
 
    ;; Filling
-   (add-to-list 'LaTeX-verbatim-environments-local "VerbEnv")
-   (add-to-list (make-local-variable 'LaTeX-indent-environment-list)
-                '("VerbEnv" current-indentation) t)
+   (let ((envs '("VerbEnv" "VerbatimWrite" "VerbatimBuffer")))
+     (make-local-variable 'LaTeX-indent-environment-list)
+     (dolist (env envs)
+       (add-to-list 'LaTeX-verbatim-environments-local env)
+       (add-to-list 'LaTeX-indent-environment-list
+                    `(,env current-indentation) t)))
 
    ;; Add \Verb*? and \EscVerb*? to
    ;; `LaTeX-verbatim-macros-with-braces-local':
@@ -162,6 +196,8 @@
                               'function)
      (font-latex-add-keywords '(("EscVerb"     "*["))
                               'textual)
+     (font-latex-add-keywords '(("VerbatimInsertBuffer" "["))
+                              'reference)
      (font-latex-set-syntactic-keywords)))
  TeX-dialect)
 
diff --git a/style/graphicx.el b/style/graphicx.el
index bc0dd8fcca..cf7c8637d1 100644
--- a/style/graphicx.el
+++ b/style/graphicx.el
@@ -1,6 +1,6 @@
 ;;; graphicx.el --- AUCTeX style file for graphicx.sty  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2000, 2004, 2005, 2014--2022 by Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2004, 2005, 2014--2023 by Free Software Foundation, Inc.
 
 ;; Author: Ryuichi Arafune <arafune@debian.org>
 ;; Created: 1999/3/20
@@ -90,13 +90,13 @@ key=vals."
   "List of extensions for image files supported by \"dvips\".")
 
 (defvar LaTeX-includegraphics-pdftex-extensions
-  '("png" "pdf" "jpe?g" "jbig2" "jb2" "mps"
-    "PNG" "PDF" "JPE?G" "JBIG2" "JB2")
+  '("png" "pdf" "jpg" "jpeg" "jbig2" "jb2" "mps"
+    "PNG" "PDF" "JPG" "JPEG" "JBIG2" "JB2")
   "List of extensions for image files supported by \"pdftex\" and \"luatex\".")
 
 (defvar LaTeX-includegraphics-xetex-extensions
-  '("pdf" "eps" "mps" "ps" "png" "jpe?g" "jp2" "jpf"
-    "PDF" "EPS" "MPS" "PS" "PNG" "JPE?G" "JP2" "JPF"
+  '("pdf" "eps" "mps" "ps" "png" "jpg" "jpeg" "jp2" "jpf"
+    "PDF" "EPS" "MPS" "PS" "PNG" "JPG" "JPEG" "JP2" "JPF"
     "bmp" "pict" "psd" "mac" "tga" "gif" "tif" "tiff"
     "BMP" "PICT" "PSD" "MAC" "TGA" "GIF" "TIF" "TIFF")
   "List of extensions for image files supported by \"xetex\".")
@@ -275,10 +275,19 @@ subdirectories and inserts the relative file name.  See
 
     '("graphicspath" t)
 
-    '("DeclareGraphicsExtensions" t)
+    '("DeclareGraphicsExtensions"
+      (TeX-arg-completing-read-multiple
+       (lambda ()
+         (delete ".jpe?g" (mapcar (lambda (ext)
+                                    (concat "." ext))
+                                  (LaTeX-includegraphics-extensions-list))))
+       "Extension(s)" nil nil nil nil nil nil nil nil "."))
 
     '("DeclareGraphicsRule" 4))
 
+   ;; \includegraphics macro should get its own line
+   (LaTeX-paragraph-commands-add-locally '("includegraphics"))
+
    ;; Fontification
    (when (and (featurep 'font-latex)
               (eq TeX-install-font-lock 'font-latex-setup))
diff --git a/style/imakeidx.el b/style/imakeidx.el
index ef434137b3..216dca12fa 100644
--- a/style/imakeidx.el
+++ b/style/imakeidx.el
@@ -1,6 +1,6 @@
 ;;; imakeidx.el --- AUCTeX style for `imakeidx.sty'.  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2012-2022 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2023 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <giordano.mose@libero.it>
@@ -49,13 +49,12 @@
     ("columnseprule" ("true" "false")))
   "Key=value options for makeindex macro of the imakeidx package.")
 
-(defvar LaTeX-imakeidx-indexsetup-options
-  '(("level")
-    ("toclevel")
-    ("noclearpage" ("true" "false"))
-    ("othercode"))
+(defvar-local LaTeX-imakeidx-indexsetup-options
+    '(("level")
+      ("toclevel")
+      ("noclearpage" ("true" "false"))
+      ("othercode"))
   "Key=value options for indexsetup macro of the imakeidx package.")
-(make-variable-buffer-local 'LaTeX-imakeidx-indexsetup-options)
 
 (TeX-add-style-hook
  "imakeidx"
diff --git a/style/minted.el b/style/minted.el
index 99310311b3..10bc0b357c 100644
--- a/style/minted.el
+++ b/style/minted.el
@@ -1,4 +1,4 @@
-;;; minted.el --- AUCTeX style for `minted.sty' (v2.5)  -*- lexical-binding: 
t; -*-
+;;; minted.el --- AUCTeX style for `minted.sty' (v2.8)  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 2014--2023 Free Software Foundation, Inc.
 
@@ -26,7 +26,7 @@
 
 ;;; Commentary:
 
-;; This file adds support for `minted.sty' (v2.5) from 2017/07/19.
+;; This file adds support for `minted.sty' (v2.8) from 2023/09/12.
 
 ;;; Code:
 
@@ -47,13 +47,14 @@
                   "newfloat" (&rest newfloat-declarefloatingenvironments))
 
 (defvar font-latex-syntactic-keywords-extra)
+(defvar LaTeX-fontenc-package-options)
 
 (defvar LaTeX-minted-key-val-options
   '(("autogobble" ("true" "false"))
     ("baselinestretch" ("auto"))
     ("beameroverlays" ("true" "false"))
     ("breakafter")
-    ("breakaftergroup" ("true" "false"))
+    ("breakafterinrun" ("true" "false"))
     ("breakaftersymbolpre")
     ("breakaftersymbolpost")
     ("breakanywhere" ("true" "false"))
@@ -61,7 +62,7 @@
     ("breakanywheresymbolpost")
     ("breakautoindent" ("true" "false"))
     ("breakbefore")
-    ("breakbeforegroup" ("true" "false"))
+    ("breakbeforeinrun" ("true" "false"))
     ("breakbeforesymbolpre")
     ("breakbeforesymbolpost")
     ("breakbytoken" ("true" "false"))
@@ -175,10 +176,16 @@ prepends them to variable `LaTeX-minted-key-val-options'."
          (push (list key colors) result))))
    LaTeX-minted-key-val-options))
 
-(defvar LaTeX-minted-pygmentize-program (executable-find "pygmentize"))
+(defvar LaTeX-minted-pygmentize-program (executable-find "pygmentize")
+  "Absolute file name to pygmentize program.")
 
 (defvar LaTeX-minted-language-list nil
-  "List containing languages provided by pymentize program.")
+  "List containing languages provided by pymentize program.
+Initialized once at the first prompt for a Pygments language.
+May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+
+;; Add the variable to `TeX-normal-mode-reset-list':
+(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-minted-language-list)
 
 (defun LaTeX-minted-language-list (&rest _ignored)
   "Return a list of languages provided by pymentize program.
@@ -197,7 +204,12 @@ Update the variable `LaTeX-minted-language-list' if still 
nil."
           LaTeX-minted-language-list))))
 
 (defvar LaTeX-minted-style-list nil
-  "List containing styles provided by pymentize program.")
+  "List containing styles provided by pymentize program.
+Initialized once at the first prompt for a Pygments style.
+May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+
+;; Add the variable to `TeX-normal-mode-reset-list':
+(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-minted-style-list)
 
 (defun LaTeX-minted-style-list (&rest _ignored)
   "Return a list of styles provided by pymentize program.
@@ -215,91 +227,83 @@ Update the variable `LaTeX-minted-style-list' if still 
nil."
             (setq LaTeX-minted-style-list styles))
           LaTeX-minted-style-list))))
 
-(defvar LaTeX-minted-auto-newminted nil)
-(defvar LaTeX-minted-newminted-regexp
-  '("\\\\newminted\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
-    (1 2) LaTeX-minted-auto-newminted))
+(TeX-auto-add-type "minted-newmint" "LaTeX")
 
-(defvar LaTeX-minted-auto-newmint nil)
 (defvar LaTeX-minted-newmint-regexp
-  '("\\\\newmint\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
-    (1 2) LaTeX-minted-auto-newmint))
-
-(defvar LaTeX-minted-auto-newmintinline nil)
-(defvar LaTeX-minted-newmintinline-regexp
-  '("\\\\newmintinline\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
-    (1 2) LaTeX-minted-auto-newmintinline))
-
-(defvar LaTeX-minted-auto-newmintedfile nil)
-(defvar LaTeX-minted-newmintedfile-regexp
-  '("\\\\newmintedfile\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
-    (1 2) LaTeX-minted-auto-newmintedfile))
+  
'("\\\\newmint\\(edfile\\|inline\\|ed\\)?\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}"
+    (2 3 1) LaTeX-auto-minted-newmint)
+  "Match the arguments of \\newmint* macros from minted package.")
 
 (defun LaTeX-minted-auto-prepare ()
-  (setq LaTeX-minted-auto-newminted     nil
-        LaTeX-minted-auto-newmint       nil
-        LaTeX-minted-auto-newmintinline nil
-        LaTeX-minted-auto-newmintedfile nil
-        LaTeX-minted-language-list      nil
-        LaTeX-minted-style-list         nil))
+  "Reset `LaTeX-auto-minted-newmint' before parsing."
+  (setq LaTeX-auto-minted-newmint nil))
 
 (defun LaTeX-minted-auto-cleanup ()
-  ;; \newminted{lang}{opts} => new langcode and langcode* envs.
-  ;; \newminted[envname]{lang}{opts} => new envname/envname* envs.
-  (dolist (name-lang LaTeX-minted-auto-newminted)
-    (let* ((env (if (> (length (car name-lang)) 0)
-                    (car name-lang)
-                  (concat (cadr name-lang) "code")))
-           (env* (concat env "*")))
-      (add-to-list 'LaTeX-auto-environment (list env))
-      (add-to-list 'LaTeX-auto-environment
-                   (list env* #'LaTeX-env-args
-                         '(TeX-arg-key-val (LaTeX-minted-key-val-options))))
-      (add-to-list 'LaTeX-indent-environment-list `(,env current-indentation) 
t)
-      (add-to-list 'LaTeX-indent-environment-list `(,env* current-indentation) 
t)
-      (add-to-list 'LaTeX-verbatim-environments-local env)
-      (add-to-list 'LaTeX-verbatim-environments-local env*)))
-  ;; \newmint{foo}{opts} => \foo[key=vals]|code|
-  ;; \newmint[macname]{foo}{opts} => \macname[key=vals]|code|
-  (dolist (name-lang LaTeX-minted-auto-newmint)
-    (let ((lang (if (> (length (car name-lang)) 0)
-                    (car name-lang)
-                  (cadr name-lang))))
-      (add-to-list 'TeX-auto-symbol
-                   `(,lang [TeX-arg-key-val (LaTeX-minted-key-val-options)]
-                           TeX-arg-verb))
-      (add-to-list 'LaTeX-verbatim-macros-with-delims-local lang)
-      (when (and (fboundp 'font-latex-add-keywords)
-                 (eq TeX-install-font-lock 'font-latex-setup))
-        (font-latex-add-keywords `((,lang "[")) 'textual))))
-  ;; \newmintinline{foo}{opts} => \fooinline[key=vals]|code| or
-  ;;                              \fooinline[key=vals]{code}
-  ;; \newmintinline[macname]{foo}{opts} => \macname[key=vals]|code| or
-  ;;                                       \macname[key=vals]{code}
-  (dolist (name-lang LaTeX-minted-auto-newmintinline)
-    (let ((lang (if (> (length (car name-lang)) 0)
-                    (car name-lang)
-                  (concat (cadr name-lang) "inline"))))
-      (add-to-list 'TeX-auto-symbol
-                   `(,lang [TeX-arg-key-val (LaTeX-minted-key-val-options)]
-                           TeX-arg-verb-delim-or-brace))
-      (add-to-list 'LaTeX-verbatim-macros-with-delims-local lang)
-      (add-to-list 'LaTeX-verbatim-macros-with-braces-local lang)
-      (when (and (fboundp 'font-latex-add-keywords)
-                 (eq TeX-install-font-lock 'font-latex-setup))
-        (font-latex-add-keywords `((,lang "[")) 'textual))))
-  ;; \newmintedfile{foo}{opts} => \foofile[key=vals]{file-name}
-  ;; \newmintedfile[macname]{foo}{opts} => \macname[key=vals]{file-name}
-  (dolist (name-lang LaTeX-minted-auto-newmintedfile)
-    (let ((lang (if (> (length (car name-lang)) 0)
-                    (car name-lang)
-                  (concat (cadr name-lang) "file"))))
-      (add-to-list 'TeX-auto-symbol
-                   `(,lang [TeX-arg-key-val (LaTeX-minted-key-val-options)]
-                           TeX-arg-file))))
-  (when (and (fboundp 'font-latex-set-syntactic-keywords)
+  "Process the parsed results from minted package."
+  (dolist (mint (LaTeX-minted-newmint-list))
+    (cond ((string= (nth 2 mint) "ed")
+           ;; \newminted{lang}{opts} => new langcode and langcode* envs.
+           ;; \newminted[envname]{lang}{opts} => new envname/envname* envs.
+           (let* ((env (if (string-empty-p (car mint))
+                           (concat (cadr mint) "code")
+                         (car mint)))
+                  (env* (concat env "*")))
+             (LaTeX-add-environments (list env))
+             (LaTeX-add-environments (list env* #'LaTeX-env-args
+                                           '(TeX-arg-key-val
+                                             (LaTeX-minted-key-val-options))))
+             (add-to-list 'LaTeX-indent-environment-list
+                          `(,env current-indentation) t)
+             (add-to-list 'LaTeX-indent-environment-list
+                          `(,env* current-indentation) t)
+             (add-to-list 'LaTeX-verbatim-environments-local env)
+             (add-to-list 'LaTeX-verbatim-environments-local env*)))
+          ;; \newmintinline{foo}{opts} => \fooinline[key=vals]|code| or
+          ;;                              \fooinline[key=vals]{code}
+          ;; \newmintinline[macname]{foo}{opts} => \macname[key=vals]|code| or
+          ;;                                       \macname[key=vals]{code}
+          ((string= (nth 2 mint) "inline")
+           (let ((lang (if (string-empty-p (car mint))
+                           (concat (cadr mint) "inline")
+                         (car mint))))
+             (TeX-add-symbols `(,lang
+                                [TeX-arg-key-val 
(LaTeX-minted-key-val-options)]
+                                TeX-arg-verb-delim-or-brace))
+             (add-to-list 'LaTeX-verbatim-macros-with-delims-local lang)
+             (add-to-list 'LaTeX-verbatim-macros-with-braces-local lang)
+             (when (and (fboundp 'font-latex-add-keywords)
+                        (eq TeX-install-font-lock 'font-latex-setup))
+               (font-latex-add-keywords `((,lang "[")) 'textual))))
+          ;; \newmintedfile{foo}{opts} => \foofile[key=vals]{file-name}
+          ;; \newmintedfile[macname]{foo}{opts} => 
\macname[key=vals]{file-name}
+          ((string= (nth 2 mint) "edfile")
+           (let ((lang (if (string-empty-p (car mint))
+                           (concat (cadr mint) "file")
+                         (car mint))))
+             (TeX-add-symbols `(,lang
+                                [TeX-arg-key-val 
(LaTeX-minted-key-val-options)]
+                                TeX-arg-file))))
+          ;; \newmint{foo}{opts} => \foo[key=vals]|code| or
+          ;;                        \foo[key=vals]{code}
+          ;; \newmint[macname]{foo}{opts} => \macname[key=vals]|code| or
+          ;;                                 \macname[key=vals]{code}
+          (t
+           (let ((lang (if (string-empty-p (car mint))
+                           (cadr mint)
+                         (car mint))))
+             (TeX-add-symbols `(,lang
+                                [TeX-arg-key-val 
(LaTeX-minted-key-val-options)]
+                                TeX-arg-verb-delim-or-brace))
+             (add-to-list 'LaTeX-verbatim-macros-with-delims-local lang)
+             (add-to-list 'LaTeX-verbatim-macros-with-braces-local lang)
+             (when (and (fboundp 'font-latex-add-keywords)
+                        (eq TeX-install-font-lock 'font-latex-setup))
+               (font-latex-add-keywords `((,lang "[")) 'textual))))))
+  ;; Refresh font-locking so that the verbatim envs take effect only
+  ;; when there are defined shortcuts:
+  (when (and (LaTeX-minted-newmint-list)
+             (fboundp 'font-latex-set-syntactic-keywords)
              (eq TeX-install-font-lock 'font-latex-setup))
-    ;; Refresh font-locking so that the verbatim envs take effect.
     (font-latex-set-syntactic-keywords)))
 
 (add-hook 'TeX-auto-prepare-hook #'LaTeX-minted-auto-prepare t)
@@ -307,7 +311,7 @@ Update the variable `LaTeX-minted-style-list' if still nil."
 (add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
 
 (defun LaTeX-minted-add-syntactic-keywords-extra (type macro)
-  "Add MACRO from minted.sty to `font-latex-syntactic-keywords-extra'.
+  "Add TYPE of MACRO to `font-latex-syntactic-keywords-extra'.
 TYPE is one of the symbols `brace' or `delim' indicating how
 verbatim text is enclosed after the macro.  MACRO is a string or
 a list of strings."
@@ -355,7 +359,7 @@ a list of strings."
     '("mint"
       [TeX-arg-key-val (LaTeX-minted-key-val-options)]
       (TeX-arg-completing-read (LaTeX-minted-language-list) "Language")
-      TeX-arg-verb)
+      TeX-arg-verb-delim-or-brace)
     '("mintinline"
       [TeX-arg-key-val (LaTeX-minted-key-val-options)]
       (TeX-arg-completing-read (LaTeX-minted-language-list) "Language")
@@ -416,10 +420,7 @@ a list of strings."
         '(("listing" ?l "lst:" "~\\ref{%s}" caption nil nil)))))
 
    ;; Add to the auto parser
-   (TeX-auto-add-regexp LaTeX-minted-newminted-regexp)
    (TeX-auto-add-regexp LaTeX-minted-newmint-regexp)
-   (TeX-auto-add-regexp LaTeX-minted-newmintinline-regexp)
-   (TeX-auto-add-regexp LaTeX-minted-newmintedfile-regexp)
 
    ;; Filling
    (add-to-list (make-local-variable 'LaTeX-indent-environment-list)
@@ -453,12 +454,28 @@ a list of strings."
      (font-latex-set-syntactic-keywords)))
  TeX-dialect)
 
-(defvar LaTeX-minted-package-options '("chapter"     "cache"
-                                       "cachedir"    "finalizecache"
-                                       "frozencache" "draft"
-                                       "final"       "kpsewhich"
-                                       "langlinenos" "newfloat"
-                                       "outputdir"   "section")
-  "Package options for the minted package.")
+(defun LaTeX-minted-package-options-list ()
+  "Return an alist of package options for minted package."
+  (append
+   `(("fontencoding"
+      ,(when (member "fontenc" (TeX-style-list))
+         LaTeX-fontenc-package-options)))
+   '(("chapter")
+     ("cache"            ("true" "false"))
+     ("cachedir")
+     ("finalizecache"    ("true" "false"))
+     ("frozencache"      ("true" "false"))
+     ("draft"            ("true" "false"))
+     ("final"            ("true" "false"))
+     ("inputlanglinenos" ("true" "false"))
+     ("kpsewhich"        ("true" "false"))
+     ("langlinenos"      ("true" "false"))
+     ("newfloat"         ("true" "false"))
+     ("outputdir")
+     ("section"))))
+
+(defun LaTeX-minted-package-options ()
+  "Prompt for package options for the minted package."
+  (TeX-read-key-val t (LaTeX-minted-package-options-list)))
 
 ;;; minted.el ends here
diff --git a/style/newfloat.el b/style/newfloat.el
index f90b614842..61285d1d95 100644
--- a/style/newfloat.el
+++ b/style/newfloat.el
@@ -1,4 +1,4 @@
-;;; newfloat.el --- AUCTeX style for `newfloat.sty' (v1.1-109)  -*- 
lexical-binding: t; -*-
+;;; newfloat.el --- AUCTeX style for `newfloat.sty' (v1.2)  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2015--2023 Free Software Foundation, Inc.
 
@@ -26,7 +26,7 @@
 
 ;;; Commentary:
 
-;; This file adds support for `newfloat.sty' (v1.1-109) from 2015/09/17.
+;; This file adds support for `newfloat.sty' (v1.2) from 2023/10/01.
 ;; `newfloat.sty' is part of TeXLive.
 
 ;; This style has some facilities to process the newly defined
@@ -77,6 +77,10 @@
    (if (< (LaTeX-largest-level) 2)
        '(("within" ("chapter" "section" "none")))
      '(("within" ("section" "none"))))
+   (when (member "hyperref" (TeX-style-list))
+     '(("autorefname")))
+   (when (member "memoir" TeX-active-styles)
+     '(("legendname")))
    LaTeX-newfloat-key-val-options))
 
 ;; Setup parsing for \DeclareFloatingEnvironment:
diff --git a/style/ocg-p.el b/style/ocg-p.el
index d3ab40da89..5a4cd22f1a 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)  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2018--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2018--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -68,36 +68,6 @@
     ("listintoolbar" ("always" "never" "iffirstuse")))
   "Key=value options for ocg environment from ocg-p package.")
 
-(defun LaTeX-env-ocgp-ocg (optional)
-  "Insert arguments for ocg environment from ocg-p package."
-  ;; The optional key-val argument:
-  (let ((TeX-arg-opening-brace LaTeX-optop)
-        (TeX-arg-closing-brace LaTeX-optcl))
-    (TeX-argument-insert
-     (TeX-read-key-val t LaTeX-ocgp-env-key-val-options)
-     t))
-  ;; Layer Name:
-  (TeX-argument-insert
-   (TeX-read-string
-    (TeX-argument-prompt optional nil "Layer name"))
-   optional)
-  ;;
-  ;; Layer id: Use completing read to show which id's are available.
-  ;; Then add the new id to list of know id's and insert it
-  (TeX-argument-insert
-   (let ((id (completing-read
-              (TeX-argument-prompt optional nil "Layer id")
-              (LaTeX-ocgp-ocg-layer-id-list))))
-     (LaTeX-add-ocgp-ocg-layer-ids id)
-     id)
-   optional)
-  ;;
-  ;; Initial visibility: Insert 0 or 1
-  (TeX-argument-insert
-   (TeX-read-string
-    (TeX-argument-prompt optional nil "Initial visibility (0 or 1)"))
-   optional))
-
 (defvar LaTeX-ocgp-mac-key-val-options
   '(("triggerocg" ("onareaenter" "onareaexit" "onmousedown"
                    "onmouseup"   "allactions")))
@@ -112,7 +82,8 @@ Completion is still available with <TAB> key."
           (remove (assoc 32 crm-local-completion-map) 
crm-local-completion-map))
          (ids (mapconcat #'identity
                          (TeX-completing-read-multiple
-                          (TeX-argument-prompt optional prompt "Layer id ('s 
space separated)")
+                          (TeX-argument-prompt optional prompt
+                                               "Layer id (space separated 
crm)")
                           (LaTeX-ocgp-ocg-layer-id-list))
                          " ")))
     (TeX-argument-insert ids optional)))
@@ -153,30 +124,39 @@ Just like array and tabular."
 
    ;; 2.3 The ocg environment
    (LaTeX-add-environments
-    '("ocg" LaTeX-env-args LaTeX-env-ocgp-ocg))
+    '("ocg" LaTeX-env-args
+      [TeX-arg-key-val LaTeX-ocgp-env-key-val-options]
+      "Layer name"
+      (TeX-arg-completing-read (LaTeX-ocgp-ocg-layer-id-list) "Layer id")
+      (TeX-arg-completing-read ("0" "1") "Initial visibility")
+      (lambda (_optional)
+        (save-excursion
+          (when (re-search-backward "{\\([^}{]+\\)}{[01]}"
+                                    (line-beginning-position) t)
+            (LaTeX-add-ocgp-ocg-layer-ids (match-string-no-properties 1)))))))
 
    ;; 2.4 The commands of the package
    (TeX-add-symbols
     '("toggleocgs"
-      [ TeX-arg-key-val LaTeX-ocgp-mac-key-val-options ]
+      [TeX-arg-key-val LaTeX-ocgp-mac-key-val-options]
       LaTeX-arg-ocgp-layer-id
       "Action button")
 
     '("showocgs"
-      [ TeX-arg-key-val LaTeX-ocgp-mac-key-val-options ]
+      [TeX-arg-key-val LaTeX-ocgp-mac-key-val-options]
       LaTeX-arg-ocgp-layer-id
       "Action button")
 
     '("hideocgs"
-      [ TeX-arg-key-val LaTeX-ocgp-mac-key-val-options ]
+      [TeX-arg-key-val LaTeX-ocgp-mac-key-val-options]
       LaTeX-arg-ocgp-layer-id
       "Action button")
 
     '("setocgs"
-      [ TeX-arg-key-val LaTeX-ocgp-mac-key-val-options ]
-      (LaTeX-arg-ocgp-layer-id "Toggle layer id ('s space separated)")
-      (LaTeX-arg-ocgp-layer-id "Show layer id ('s space separated)")
-      (LaTeX-arg-ocgp-layer-id "Hide layer id ('s space separated)")
+      [TeX-arg-key-val LaTeX-ocgp-mac-key-val-options]
+      (LaTeX-arg-ocgp-layer-id "Toggle layer id (space separated crm)")
+      (LaTeX-arg-ocgp-layer-id "Show layer id (space separated crm)")
+      (LaTeX-arg-ocgp-layer-id "Hide layer id (space separated crm)")
       "Action button"))
 
    ;; 2.5 The ocgtabular environment
diff --git a/style/ocgx.el b/style/ocgx.el
index 340da52bd8..116d8a5b20 100644
--- a/style/ocgx.el
+++ b/style/ocgx.el
@@ -1,6 +1,6 @@
 ;;; ocgx.el --- AUCTeX style for `ocgx.sty' (v0.5)  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2018, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -54,9 +54,9 @@
     '("hideocg" LaTeX-arg-ocgp-layer-id "Action button")
 
     '("actionsocg"
-      (LaTeX-arg-ocgp-layer-id "Toggle layer id ('s space separated)")
-      (LaTeX-arg-ocgp-layer-id "Show layer id ('s space separated)")
-      (LaTeX-arg-ocgp-layer-id "Hide layer id ('s space separated)")
+      (LaTeX-arg-ocgp-layer-id "Toggle layer id (space separated crm)")
+      (LaTeX-arg-ocgp-layer-id "Show layer id (space separated crm)")
+      (LaTeX-arg-ocgp-layer-id "Hide layer id (space separated crm)")
       "Action button"))
 
    ;; Fontification
diff --git a/style/pythontex.el b/style/pythontex.el
index 8c1399f0de..6ea9ef32a5 100644
--- a/style/pythontex.el
+++ b/style/pythontex.el
@@ -318,19 +318,19 @@ a list of strings."
 
     ;;\saveprintpythontex{<name>}
     '("saveprintpythontex"
-      (TeX-arg-eval (lambda ()
-                      (let ((name (TeX-read-string
-                                   (TeX-argument-prompt nil nil "Name"))))
-                        (LaTeX-add-pythontex-savecontents name)
-                        (format "%s" name)))))
+      (lambda (optional)
+        (let ((name (TeX-read-string
+                     (TeX-argument-prompt optional nil "Name"))))
+          (LaTeX-add-pythontex-savecontents name)
+          (TeX-argument-insert name optional))))
 
     ;;\savestdoutpythontex{<name>}
     '("savestdoutpythontex"
-      (TeX-arg-eval (lambda ()
-                      (let ((name (TeX-read-string
-                                   (TeX-argument-prompt nil nil "Name"))))
-                        (LaTeX-add-pythontex-savecontents name)
-                        (format "%s" name)))))
+      (lambda (optional)
+        (let ((name (TeX-read-string
+                     (TeX-argument-prompt optional nil "Name"))))
+          (LaTeX-add-pythontex-savecontents name)
+          (TeX-argument-insert name optional))))
 
     ;; \useprintpythontex[<verbatim options>][<fancyvrb options>]{<name>}
     ;; I assume <verbatim options> is meant to be <mode>
@@ -353,11 +353,11 @@ a list of strings."
 
     ;;\savestderrpythontex{<name>}
     '("savestderrpythontex"
-      (TeX-arg-eval (lambda ()
-                      (let ((name (TeX-read-string
-                                   (TeX-argument-prompt nil nil "Name"))))
-                        (LaTeX-add-pythontex-savecontents name)
-                        (format "%s" name)))))
+      (lambda (optional)
+        (let ((name (TeX-read-string
+                     (TeX-argument-prompt optional nil "Name"))))
+          (LaTeX-add-pythontex-savecontents name)
+          (TeX-argument-insert name optional))))
 
     ;; \usestderrpythontex[<mode>][<fancyvrb options>]{<name>}
     '("usestderrpythontex"
@@ -427,13 +427,12 @@ a list of strings."
    ;; Cater for \setpythontexlistingenv:
    (TeX-add-symbols
     '("setpythontexlistingenv"
-      (TeX-arg-eval
-       (lambda ()
-         (let ((name (TeX-read-string
-                      (TeX-argument-prompt nil nil "Listing environment 
name"))))
-           (LaTeX-add-newfloat-DeclareFloatingEnvironments `(,name "verbatim"))
-           (LaTeX-newfloat-auto-cleanup)
-           (format "%s" name))))))
+      (lambda (optional)
+        (let ((name (TeX-read-string
+                     (TeX-argument-prompt optional nil "Listing environment 
name"))))
+          (LaTeX-add-newfloat-DeclareFloatingEnvironments `(,name "verbatim"))
+          (LaTeX-newfloat-auto-cleanup)
+          (TeX-argument-insert name optional)))))
 
    (LaTeX-add-environments
     ;; 4.2.5 Custom code
diff --git a/style/refcount.el b/style/refcount.el
new file mode 100644
index 0000000000..972580465e
--- /dev/null
+++ b/style/refcount.el
@@ -0,0 +1,90 @@
+;;; refcount.el --- AUCTeX style for refcount package v3.6  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2023 Free Software Foundation, Inc.
+
+;; Author: Uwe Brauer <oub@mat.ucm.es>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2023-12-02
+;; 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 the refcount package v3.6.
+
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+
+;; Silence the compiler:
+(declare-function font-latex-add-keywords
+                  "font-latex"
+                  (keywords class))
+
+(TeX-add-style-hook
+ "refcount"
+ (lambda ()
+   (TeX-add-symbols
+    ;; 1.1 Setting counters
+    '("setcounterref" TeX-arg-counter TeX-arg-ref)
+    '("addtocounterref" TeX-arg-counter TeX-arg-ref)
+    '("setcounterpageref" TeX-arg-counter TeX-arg-ref)
+    '("addcounterpageref" TeX-arg-counter TeX-arg-ref)
+    ;; 1.2 Expandable commands
+    '("getrefnumber"  TeX-arg-ref)
+    '("getpagerefnumber"  TeX-arg-ref)
+    '("setrefcountdefault" "Default")
+    '("getrefbykeydefault"
+      TeX-arg-ref
+      (TeX-arg-completing-read ("page" "title" "name" "anchor" "url"))
+      "Default")
+    ;; 1.3 Undefined references
+    '("refused" TeX-arg-ref)
+    '("IfRefUndefinedExpandable" TeX-arg-ref 2)
+    '("IfRefUndefinedBabel" TeX-arg-ref 2))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("setcounterref"     "{{")
+                                ("addtocounterref"   "{{")
+                                ("setcounterpageref" "{{")
+                                ("addcounterpageref" "{{"))
+                              'variable)
+     (font-latex-add-keywords '(("getrefnumber"       "{")
+                                ("getpagerefnumber"   "{")
+                                ("getrefbykeydefault" "{{{")
+                                ("refused"            "{"))
+                              'reference)
+     (font-latex-add-keywords '(("setrefcountdefault"       "{")
+                                ("IfRefUndefinedExpandable" "{{{")
+                                ("IfRefUndefinedBabel"      "{{{"))
+                              'function))
+
+   ;; Activate RefTeX reference style
+   (and LaTeX-reftex-ref-style-auto-activate
+        (fboundp 'reftex-ref-style-activate)
+        (reftex-ref-style-activate "Refcount")))
+ TeX-dialect)
+
+(defvar LaTeX-refcount-package-options nil
+  "Package options for the refcount package.")
+
+;;; refcount.el ends here
diff --git a/style/splitidx.el b/style/splitidx.el
index 37d36be686..2fa4af2cb1 100644
--- a/style/splitidx.el
+++ b/style/splitidx.el
@@ -1,6 +1,6 @@
 ;;; splitidx.el --- AUCTeX style for `splitidx.sty' (v1.2a)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -150,12 +150,11 @@
     ;; 3.1 Setup
     '("newindex"
       [ "Index name" ]
-      (TeX-arg-eval
-       (lambda ()
-         (let ((shortcut (TeX-read-string
-                          (TeX-argument-prompt nil nil "Short cut"))))
-           (LaTeX-add-splitidx-newindices shortcut)
-           (format "%s" shortcut)))))
+      (lambda (optional)
+        (let ((shortcut (TeX-read-string
+                         (TeX-argument-prompt optional nil "Short cut"))))
+          (LaTeX-add-splitidx-newindices shortcut)
+          (TeX-argument-insert shortcut optional))))
 
     ;; 3.2 Marking up index entries
     '("sindex"
@@ -175,12 +174,11 @@
     ;; 3.6 Preventing premature expansion of index entries
     '("newprotectedindex"
       [ "Index name" ]
-      (TeX-arg-eval
-       (lambda ()
-         (let ((shortcut (TeX-read-string
-                          (TeX-argument-prompt nil nil "Short cut"))))
-           (LaTeX-add-splitidx-newindices shortcut)
-           (format "%s" shortcut)))))
+      (lambda (optional)
+        (let ((shortcut (TeX-read-string
+                         (TeX-argument-prompt optional nil "Short cut"))))
+          (LaTeX-add-splitidx-newindices shortcut)
+          (TeX-argument-insert shortcut optional))))
 
     ;; 3.7 Including the generated indices in your document
     '("printindex"
diff --git a/style/subcaption.el b/style/subcaption.el
index 67b96e4fcf..c366851115 100644
--- a/style/subcaption.el
+++ b/style/subcaption.el
@@ -121,6 +121,10 @@ caption, insert only a caption."
 
    (TeX-add-symbols
     ;; Basic commands
+    '("subcaptionsetup"
+      [TeX-arg-completing-read LaTeX-caption-supported-float-types
+                               "Float type"]
+      (TeX-arg-key-val (LaTeX-caption-key-val-options)))
     '("subcaption"     (LaTeX-arg-subcaption-subcaption))
     '("subcaption*"    (LaTeX-arg-subcaption-subcaption     t)  )
     '("subcaptionbox"  (LaTeX-arg-subcaption-subcaptionbox) t)
@@ -162,9 +166,10 @@ caption, insert only a caption."
            '("figure" "table")))
        "Type")))
 
-   ;; \subcaption(box)? and \subfloat macros should get their own lines
+   ;; \subcaption(box|setup)? and \subfloat macros should get their
+   ;; own lines
    (LaTeX-paragraph-commands-add-locally
-    '("subcaption" "subcaptionbox" "subfloat"))
+    '("subcaption" "subcaptionbox" "subcaptionsetup" "subfloat"))
 
    ;; The subfigure & subtable environments
    (LaTeX-add-environments
@@ -192,7 +197,8 @@ caption, insert only a caption."
                               'textual)
      (font-latex-add-keywords '(("subref"                "*{"))
                               'reference)
-     (font-latex-add-keywords '(("DeclareCaptionSubType" "*[{"))
+     (font-latex-add-keywords '(("DeclareCaptionSubType" "*[{")
+                                ("subcaptionsetup"       "[{"))
                               'function)) )
  TeX-dialect)
 
diff --git a/style/tcolorbox.el b/style/tcolorbox.el
index 03ce96699a..edc39e23c8 100644
--- a/style/tcolorbox.el
+++ b/style/tcolorbox.el
@@ -1,6 +1,6 @@
 ;;; tcolorbox.el --- AUCTeX style for `tcolorbox.sty' (v4.00)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2015--2023 Free Software Foundation, Inc.
 
 ;; Author: Tassilo Horn <tsdh@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -362,15 +362,14 @@
        (cl-pushnew (list key colors) result :test #'equal)))
    LaTeX-tcolorbox-keyval-options))
 
-(defvar LaTeX-tcolorbox-keyval-options-full
-  '(LaTeX-tcolorbox-keyval-options)
+(defvar-local LaTeX-tcolorbox-keyval-options-full
+    '(LaTeX-tcolorbox-keyval-options)
   "Buffer-local list of symbols containing key=val options.
 tcolorbox libraries should add their key=val options to this
 list.  Key=val options might be a variable or a function.  This
 variable is initialized with the function
 `LaTeX-tcolorbox-keyval-options'.  Please add entries on top of
 this list so that this item always comes last.")
-(make-variable-buffer-local 'LaTeX-tcolorbox-keyval-options-full)
 
 (defun LaTeX-tcolorbox-keyval-options-full ()
   "Return an updated list of full key=vals for tcolorbox and libraries.
diff --git a/style/titleps.el b/style/titleps.el
index 67891035ce..ed03dcb126 100644
--- a/style/titleps.el
+++ b/style/titleps.el
@@ -1,6 +1,6 @@
 ;;; titleps.el --- AUCTeX style for `titleps.sty' (v1.1.1)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -78,30 +78,29 @@ Removal is based on the return value of function
    (TeX-add-symbols
     ;; 2. Defining Page Styles
     '("newpagestyle"
-      (TeX-arg-eval
-       (lambda ()
-         (let ((ps (TeX-read-string
-                    (TeX-argument-prompt nil nil "Page style"))))
-           (LaTeX-add-pagestyles ps)
-           (format "%s" ps))))
+      (lambda (optional)
+        (let ((ps (TeX-read-string
+                   (TeX-argument-prompt optional nil "Page style"))))
+          (LaTeX-add-pagestyles ps)
+          (TeX-argument-insert ps optional)))
       (TeX-arg-conditional (y-or-n-p "With optional global style? ")
-                           ( [ t ] nil)
-                           ( t )))
+          ( [ t ] nil)
+        ( t )))
 
     '("renewpagestyle" TeX-arg-pagestyle
       (TeX-arg-conditional (y-or-n-p "With optional global style? ")
-                           ( [ t ] nil)
-                           ( t )))
+          ( [ t ] nil)
+        ( t )))
 
     '("sethead"
       (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
-                           ( [ 3 ] nil nil nil)
-                           ( 3 )))
+          ( [ 3 ] nil nil nil)
+        ( 3 )))
 
     '("setfoot"
       (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
-                           ( [ 3 ] nil nil nil)
-                           ( 3 )))
+          ( [ 3 ] nil nil nil)
+        ( 3 )))
 
     '("sethead*" 3)
     '("setfoot*" 3)
@@ -130,8 +129,8 @@ Removal is based on the return value of function
     ;; 4. Headline/footline width
     '("widenhead"
       (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
-                           ( [ 2 ] nil nil)
-                           ( 2 )))
+          ( [ 2 ] nil nil)
+        ( 2 )))
 
     '("widenhead*" 2)
 
@@ -172,26 +171,26 @@ Removal is based on the return value of function
     ;; 6. Running heads with floats
     '("setfloathead"
       (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
-                           ( [ 3 ] nil nil nil nil [ nil ] )
-                           ( 4 [ nil ] )))
+          ( [ 3 ] nil nil nil nil [ nil ] )
+        ( 4 [ nil ] )))
 
     '("setfloatfoot"
       (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
-                           ( [ 3 ] nil nil nil nil [ nil ] )
-                           ( 4 [ nil ] )))
+          ( [ 3 ] nil nil nil nil [ nil ] )
+        ( 4 [ nil ] )))
 
     '("setfloathead*" 4 [ nil ] )
     '("setfloatfoot*" 4 [ nil ] )
 
     '("nextfloathead"
       (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
-                           ( [ 3 ] nil nil nil nil [ nil ] )
-                           ( 4 [ nil ] )))
+          ( [ 3 ] nil nil nil nil [ nil ] )
+        ( 4 [ nil ] )))
 
     '("nextfloatfoot"
       (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
-                           ( [ 3 ] nil nil nil nil [ nil ] )
-                           ( 4 [ nil ] )))
+          ( [ 3 ] nil nil nil nil [ nil ] )
+        ( 4 [ nil ] )))
 
     '("nextfloathead*" 4 [ nil ] )
     '("nextfloatfoot*" 4 [ nil ] )
diff --git a/style/titletoc.el b/style/titletoc.el
index 5031f1e5e9..4b32a57d3d 100644
--- a/style/titletoc.el
+++ b/style/titletoc.el
@@ -1,6 +1,6 @@
 ;;; titletoc.el --- AUCTeX style for `titletoc.sty' (v1.6)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -111,8 +111,8 @@ Removal is based on the return value of function
                                "Sectioning command")
       [TeX-arg-length "Left margin"]
       (TeX-arg-conditional (y-or-n-p "With optional below code argument? ")
-                           (4 [nil])
-                           (4)))
+          (4 [nil])
+        (4)))
 
     ;; \titlecontents*{<section>}[<left>]{<above-code>}
     ;;                {<numbered-entry-format>}{<numberless-entry-format>}
@@ -122,8 +122,8 @@ Removal is based on the return value of function
                                "Sectioning command")
       [TeX-arg-length "Left margin"]
       (TeX-arg-conditional (y-or-n-p "With optional separator argument? ")
-                           (4 [nil])
-                           (4)))
+          (4 [nil])
+        (4)))
 
     ;; \contentsmargin[<correction>]{<right>}
     '("contentsmargin" [ "Correction" ] "Right margin")
@@ -144,19 +144,18 @@ Removal is based on the return value of function
     ;; the environments must be introduced to titletoc.sty with
     ;; \contentuse{ENV} and then can be used as argument to \titlecontents.
     '("contentsuse"
-      (TeX-arg-eval
-       (lambda ()
-         (let ((name (if (and (member "newfloat" (TeX-active-styles))
-                              (LaTeX-newfloat-DeclareFloatingEnvironment-list))
-                         (completing-read
-                          (TeX-argument-prompt nil nil "Name of contents")
-                          (mapcar #'car
-                                  
(LaTeX-newfloat-DeclareFloatingEnvironment-list)))
-                       (TeX-read-string
-                        (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))))
+      (lambda (optional)
+        (let ((name (if (and (member "newfloat" (TeX-active-styles))
+                             (LaTeX-newfloat-DeclareFloatingEnvironment-list))
+                        (completing-read
+                         (TeX-argument-prompt optional nil "Name of contents")
+                         (mapcar #'car
+                                 
(LaTeX-newfloat-DeclareFloatingEnvironment-list)))
+                      (TeX-read-string
+                       (TeX-argument-prompt optional nil "Name of 
contents")))))
+          (make-local-variable 'LaTeX-titletoc-section-command-list)
+          (add-to-list 'LaTeX-titletoc-section-command-list name)
+          (TeX-argument-insert name optional)))
       "File extension")
 
     ;; 6.3. Partial TOC's
diff --git a/style/xparse.el b/style/xparse.el
index e71e456d85..ed136702df 100644
--- a/style/xparse.el
+++ b/style/xparse.el
@@ -1,6 +1,6 @@
 ;;; xparse.el --- AUCTeX style for `xparse.sty' version 2022-07-05  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2013, 2020--2023 Free Software Foundation, Inc.
+;; Copyright (C) 2013--2023 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <mose@gnu.org>
@@ -25,332 +25,17 @@
 
 ;;; Commentary:
 
-;; This file adds basic support for `xparse.sty' version 2022-07-05.
-;; It parses argument specification of macros and environments.
+;; The content of this file is now (December 2023) part of latex.el
+;; and font-latex.el.  This style provides only completion for xparse
+;; package options.
 
 ;; The "yet not more supported" specifiers `l', `u', `g' and `G' are
 ;; ignored completely and may lead to wrong parsing results.
 
 ;;; Code:
 
-(require 'tex)
 (require 'latex)
 
-;; Silence the compiler:
-(declare-function font-latex-add-keywords
-                  "font-latex"
-                  (keywords class))
-
-(TeX-auto-add-type "xparse-macro" "LaTeX")
-
-(defvar LaTeX-xparse-macro-regexp
-  `(,(concat
-      (regexp-quote TeX-esc)
-      "\\(New\\|Renew\\|Provide\\|Declare\\)"
-      "\\(?:Expandable\\)?"
-      "DocumentCommand"
-      "[ \t\n\r]*"
-      "{?"
-      "[ \t\n\r]*"
-      (regexp-quote TeX-esc)
-      "\\([A-Za-z]+\\)"
-      "[ \t\n\r]*"
-      "}?"
-      "[ \t\n\r]*"
-      
"{\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*}[^}{]*\\)*}[^}{]*\\)*\\)}")
-    (0 2 3 1) LaTeX-auto-xparse-macro)
-  "Matches macros by xparse package.")
-
-(TeX-auto-add-type "xparse-environment" "LaTeX")
-
-(defvar LaTeX-xparse-environment-regexp
-  `(,(concat
-      (regexp-quote TeX-esc)
-      "\\(New\\|Renew\\|Provide\\|Declare\\)"
-      "DocumentEnvironment"
-      "[ \t\n\r]*"
-      "{"
-      "[ \t\n\r]*"
-      "\\([A-Za-z]+\\)"
-      "[ \t\n\r]*"
-      "}"
-      "[ \t\n\r]*"
-      
"{\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*}[^}{]*\\)*}[^}{]*\\)*\\)}")
-    (0 2 3 1) LaTeX-auto-xparse-environment)
-  "Matches environments by xparse package.")
-
-(defun LaTeX-arg-xparse-query (optional op-brace cl-brace &optional prompt)
-  "Special query function for parsed elements from xparse package.
-If OPTIONAL is non-nil, indicate it in minibuffer.  OP-BRACE sets
-the opening brace, CL-BRACE sets the closing one.  PROMPT
-replaces the standard one."
-  (let ((TeX-arg-opening-brace op-brace)
-        (TeX-arg-closing-brace cl-brace))
-    (TeX-argument-insert
-     (TeX-read-string (TeX-argument-prompt optional prompt "Text"))
-     optional)))
-
-(defun LaTeX-arg-xparse-embellishment-query (_optional embellish)
-  "Special insert function for embellishments from xparse package.
-Compatibility argument OPTIONAL is ignored.  EMBELLISH is a
-string with parsed elements inserted in the buffer.  This
-function also sets the value of `TeX-exit-mark' where the point
-will be once the insertion is completed."
-  (let (p)
-    (just-one-space)
-    (setq p (point))
-    (insert embellish)
-    (set-marker TeX-exit-mark (1+ p))))
-
-(defun LaTeX-xparse-macro-parse (type)
-  "Process parsed macro and environment definitions.
-TYPE is one of the symbols mac or env."
-  (dolist (xcmd (if (eq type 'mac)
-                    (LaTeX-xparse-macro-list)
-                  (LaTeX-xparse-environment-list)))
-    (let ((name (nth 1 xcmd))
-          (spec (nth 2 xcmd))
-          (what (nth 3 xcmd))
-          (case-fold-search nil)
-          (syntax (TeX-search-syntax-table ?\{ ?\}))
-          args opt-star opt-token)
-      (with-temp-buffer
-        (set-syntax-table LaTeX-mode-syntax-table)
-        ;; This one is probably not really needed?
-        (goto-char (point-min))
-        (insert (replace-regexp-in-string "[ \t\r\n%]" "" spec))
-        (goto-char (point-min))
-        (while (looking-at-p "[+!>=bmrRvodODsteE]")
-          (cond ((looking-at-p "[+!b]")
-                 ;; + or !: Long argument or space aware: Move over
-                 ;; them.  b is special; only available for
-                 ;; enviroments
-                 (forward-char 1))
-                ;; Argument processors and key-val modifier: Move
-                ;; over [>=] and a balanced {}
-                ((looking-at-p "[>=]")
-                 (forward-char 1)
-                 (with-syntax-table syntax (forward-sexp)))
-                ;; Mandatory arguments:
-                ;; m: Ask for input with "Text" as prompt
-                ((looking-at-p "m")
-                 (forward-char 1)
-                 (push "Text" args))
-                ;; r<token1><token2>
-                ((looking-at-p "r")
-                 (re-search-forward "r\\(.\\)\\(.\\)" (+ (point) 3) t)
-                 (push `(LaTeX-arg-xparse-query
-                         ,(match-string-no-properties 1)
-                         ,(match-string-no-properties 2))
-                       args))
-                ;; R<token1><token2>{default}
-                ((looking-at-p "R")
-                 (re-search-forward "R\\(.\\)\\(.\\)" (+ (point) 3) t)
-                 (with-syntax-table syntax (forward-sexp))
-                 (push `(LaTeX-arg-xparse-query
-                         ,(match-string-no-properties 1)
-                         ,(match-string-no-properties 2))
-                       args))
-                ;; v: Use `TeX-arg-verb-delim-or-brace'
-                ((looking-at-p "v")
-                 (forward-char 1)
-                 (push #'TeX-arg-verb-delim-or-brace args))
-                ;; Optional arguments:
-                ;; o standard LaTeX optional in square brackets
-                ((looking-at-p "o")
-                 (forward-char 1)
-                 (push (vector "Text") args))
-                ;; d<token1><token2>
-                ((looking-at-p "d")
-                 (re-search-forward "d\\(.\\)\\(.\\)" (+ (point) 3) t)
-                 (push (vector #'LaTeX-arg-xparse-query
-                               (match-string-no-properties 1)
-                               (match-string-no-properties 2))
-                       args))
-                ;; O{default}
-                ((looking-at-p "O")
-                 (forward-char 1)
-                 (with-syntax-table syntax (forward-sexp))
-                 (push (vector "Text") args))
-                ;; D<token1><token2>{default}
-                ((looking-at-p "D")
-                 (re-search-forward "D\\(.\\)\\(.\\)" (+ (point) 3) t)
-                 (with-syntax-table syntax (forward-sexp))
-                 (push (vector #'LaTeX-arg-xparse-query
-                               (match-string-no-properties 1)
-                               (match-string-no-properties 2))
-                       args))
-                ;; s: optional star
-                ((looking-at-p "s")
-                 (forward-char 1)
-                 (setq opt-star t))
-                ;; t: optional <token>
-                ((looking-at-p "t")
-                 (re-search-forward "t\\(.\\)" (+ (point) 2) t)
-                 (setq opt-token (match-string-no-properties 1)))
-                ;; e{tokes} a set of optional embellishments
-                ((looking-at-p "e")
-                 (forward-char)
-                 (if (looking-at-p TeX-grop)
-                     (re-search-forward "{\\([^}]+\\)}" nil t)
-                   (re-search-forward "\\(.\\)" (1+ (point)) t))
-                 (push `(LaTeX-arg-xparse-embellishment-query
-                         ,(match-string-no-properties 1))
-                       args))
-                ;; E{tokes}{defaults}
-                ((looking-at-p "E")
-                 (forward-char)
-                 (if (looking-at-p TeX-grop)
-                     (re-search-forward "{\\([^}]+\\)}" nil t)
-                   (re-search-forward "\\(.\\)" (1+ (point)) t))
-                 (push `(LaTeX-arg-xparse-embellishment-query
-                         ,(match-string-no-properties 1))
-                       args)
-                 (when (looking-at-p TeX-grop)
-                   (with-syntax-table syntax (forward-sexp))))
-                ;; Finished:
-                (t nil))))
-      (if (eq type 'env)
-          ;; Parsed enviroments: If we are Renew'ing or Delare'ing, we
-          ;; delete the enviroment first from `LaTeX-environment-list'
-          ;; before adding the new one.  We have to sort the value of
-          ;; `LaTeX-environment-list' by running the function of the
-          ;; same name:
-          (progn
-            (when (member what '("Renew" "Declare"))
-              (LaTeX-environment-list)
-              (setq LaTeX-environment-list
-                    (assq-delete-all (car (assoc name LaTeX-environment-list))
-                                     LaTeX-environment-list)))
-            (LaTeX-add-environments `(,name
-                                      LaTeX-env-args
-                                      ,@(reverse args))))
-        ;; Parsed macros: If we are Renew'ing or Delare'ing, we delete
-        ;; the macros first from `TeX-symbol-list' before adding the
-        ;; new ones.  We have to sort the value of `TeX-symbol-list'
-        ;; by running the function of the same name:
-        (when (member what '("Renew" "Declare"))
-          (TeX-symbol-list)
-          (setq TeX-symbol-list
-                (assq-delete-all (car (assoc name TeX-symbol-list))
-                                 TeX-symbol-list))
-          (when opt-star
-            (setq TeX-symbol-list
-                  (assq-delete-all (car (assoc (concat name "*") 
TeX-symbol-list))
-                                   TeX-symbol-list)))
-          (when opt-token
-            (setq TeX-symbol-list
-                  (assq-delete-all (car (assoc (concat name opt-token) 
TeX-symbol-list))
-                                   TeX-symbol-list))))
-        (TeX-add-symbols (cons name
-                               (reverse args)))
-        (when opt-star
-          (TeX-add-symbols (cons (concat name "*")
-                                 (reverse args))))
-        (when opt-token
-          (TeX-add-symbols (cons (concat name opt-token)
-                                 (reverse args))))))))
-
-(defun LaTeX-xparse-auto-prepare ()
-  "Clear various `LaTeX-auto-xparse-*' variables before parsing."
-  (setq LaTeX-auto-xparse-macro nil
-        LaTeX-auto-xparse-environment nil))
-
-(defun LaTeX-xparse-auto-cleanup ()
-  "Process parsed elements for xparse package."
-  (LaTeX-xparse-macro-parse 'mac)
-  (LaTeX-xparse-macro-parse 'env))
-
-(add-hook 'TeX-auto-prepare-hook #'LaTeX-xparse-auto-prepare t)
-(add-hook 'TeX-auto-cleanup-hook #'LaTeX-xparse-auto-cleanup t)
-(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
-
-(TeX-add-style-hook
- "xparse"
- (lambda ()
-   (TeX-auto-add-regexp LaTeX-xparse-macro-regexp)
-   (TeX-auto-add-regexp LaTeX-xparse-environment-regexp)
-   (TeX-run-style-hooks
-    "expl3")
-   (TeX-add-symbols
-    ;; Declaring commands
-    '("DeclareDocumentCommand"
-      TeX-arg-define-macro "Argument specification" t)
-    '("NewDocumentCommand"
-      TeX-arg-define-macro "Argument specification" t)
-    '("RenewDocumentCommand"
-      TeX-arg-macro "Argument specification" t)
-    '("ProvideDocumentCommand"
-      TeX-arg-define-macro "Argument specification" t)
-
-    ;; Declaring commands and environments
-    '("DeclareDocumentEnvironment" TeX-arg-define-environment
-      "Argument specification" t t)
-    '("NewDocumentEnvironment" TeX-arg-define-environment
-      "Argument specification" t t)
-    '("RenewDocumentEnvironment" TeX-arg-environment
-      "Argument specification" t t)
-    '("ProvideDocumentEnvironment" TeX-arg-define-environment
-      "Argument specification" t t)
-
-    ;; Fully-expandable document commands
-    '("DeclareExpandableDocumentCommand"
-      TeX-arg-define-macro "Argument specification" t)
-    '("NewExpandableDocumentCommand"
-      TeX-arg-define-macro "Argument specification" t)
-    '("RenewExpandableDocumentCommand"
-      TeX-arg-macro "Argument specification" t)
-    '("ProvideExpandableDocumentCommand"
-      TeX-arg-define-macro "Argument specification" t)
-
-    ;; Testing special values
-    '("IfBooleanTF" 3)
-    '("IfBooleanT" 2)
-    '("IfBooleanF" 2)
-    '("IfNoValueTF" 3)
-    '("IfNoValueT" 2)
-    '("IfNoValueF" 2)
-    '("IfValueTF" 3)
-    '("IfValueT" 2)
-    '("IfValueF" 2)
-    '("IfBlankTF" 3)
-    '("IfBlankT" 2)
-    '("IfBlankF" 2)
-    "BooleanTrue"
-    "BooleanFalse"
-    ;; Argument processors
-    "ProcessedArgument"
-    "ReverseBoolean"
-    '("SplitArgument" "Number" "Token")
-    '("SplitList" "Token")
-    "TrimSpaces"
-    '("ProcessList" "List" "Function")
-    ;; Access to the argument specification
-    '("GetDocumentCommandArgSpec" TeX-arg-macro)
-    '("GetDocumentEnvironmmentArgSpec" TeX-arg-environment)
-    '("ShowDocumentCommandArgSpec" TeX-arg-macro)
-    '("ShowDocumentEnvironmentArgSpec" TeX-arg-environment))
-
-   ;; Fontification
-   (when (and (featurep 'font-latex)
-              (eq TeX-install-font-lock 'font-latex-setup))
-     (font-latex-add-keywords '(("DeclareDocumentCommand" "|{\\{{")
-                                ("NewDocumentCommand"     "|{\\{{")
-                                ("ProvideDocumentCommand" "|{\\{{")
-                                ("RenewDocumentCommand"   "|{\\{{")
-                                ;;
-                                ("DeclareExpandableDocumentCommand" "|{\\{{")
-                                ("NewExpandableDocumentCommand"     "|{\\{{")
-                                ("ProvideExpandableDocumentCommand" "|{\\{{")
-                                ("RenewExpandableDocumentCommand"   "|{\\{{")
-                                ;;
-                                ("DeclareDocumentEnvironment" "{{{{")
-                                ("NewDocumentEnvironment"     "{{{{")
-                                ("ProvideDocumentEnvironment" "{{{{")
-                                ("RenewDocumentEnvironment"   "{{{{"))
-                              'function)))
- TeX-dialect)
-
 (defvar LaTeX-xparse-package-options-list
   '(("log-declarations" ("true" "false")))
   "Package options for the xparse package.")
diff --git a/tests/latex/latex-test.el b/tests/latex/latex-test.el
index 5b947331e7..eae951f115 100644
--- a/tests/latex/latex-test.el
+++ b/tests/latex/latex-test.el
@@ -302,8 +302,9 @@ backend=biber % here is a comment
             TeX-DVI-via-PDFTeX nil)
       (should
        (equal (sort (LaTeX-includegraphics-extensions-list) #'string<)
-              (sort '("png" "pdf" "jpe?g" "jbig2" "jb2" "mps"
-                      "PNG" "PDF" "JPE?G" "JBIG2" "JB2" "eps") #'string<)))
+              (sort '("png" "pdf" "jpe?g" "jpeg" "jpg" "jbig2" "jb2" "mps"
+                      "PNG" "PDF"         "JPEG" "JPG" "JBIG2" "JB2" "eps")
+                    #'string<)))
       ;; default 2
       (setq TeX-PDF-mode t
             TeX-PDF-from-DVI "Dvips"
@@ -324,8 +325,9 @@ backend=biber % here is a comment
             TeX-DVI-via-PDFTeX t)
       (should
        (equal (sort (LaTeX-includegraphics-extensions-list) #'string<)
-              (sort '("png" "pdf" "jpe?g" "jbig2" "jb2" "mps"
-                      "PNG" "PDF" "JPE?G" "JBIG2" "JB2" "eps") #'string<)))
+              (sort '("png" "pdf" "jpe?g" "jpeg" "jpg" "jbig2" "jb2" "mps"
+                      "PNG" "PDF"         "JPEG" "JPG" "JBIG2" "JB2" "eps")
+                    #'string<)))
       ;; default 5
       (setq TeX-PDF-mode t
             TeX-PDF-from-DVI "Dvipdfmx"
@@ -340,8 +342,9 @@ backend=biber % here is a comment
       (setq TeX-PDF-mode t)
       (should
        (equal (sort (LaTeX-includegraphics-extensions-list) #'string<)
-              (sort '("png" "pdf" "jpe?g" "jbig2" "jb2" "mps"
-                      "PNG" "PDF" "JPE?G" "JBIG2" "JB2" "eps") #'string<)))
+              (sort '("png" "pdf" "jpe?g" "jpeg" "jpg" "jbig2" "jb2" "mps"
+                      "PNG" "PDF"         "JPEG" "JPG" "JBIG2" "JB2" "eps")
+                    #'string<)))
       ;; luatex 2
       (setq TeX-PDF-mode nil)
       (should
@@ -352,8 +355,8 @@ backend=biber % here is a comment
       (setq TeX-engine 'xetex)
       (should
        (equal (sort (LaTeX-includegraphics-extensions-list) #'string<)
-              (sort '("pdf" "eps" "mps" "ps" "png" "jpe?g" "jp2" "jpf"
-                      "PDF" "EPS" "MPS" "PS" "PNG" "JPE?G" "JP2" "JPF"
+              (sort '("pdf" "eps" "mps" "ps" "png" "jpe?g" "jpeg" "jpg" "jp2" 
"jpf"
+                      "PDF" "EPS" "MPS" "PS" "PNG"         "JPEG" "JPG" "JP2" 
"JPF"
                       "bmp" "pict" "psd" "mac" "tga" "gif" "tif" "tiff"
                       "BMP" "PICT" "PSD" "MAC" "TGA" "GIF" "TIF" "TIFF")
                     #'string<)))
diff --git a/tex-fold.el b/tex-fold.el
index 1bbbf969c7..a1fd48be51 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -121,13 +121,12 @@ Customize or reset the mode."
                                 (function :tag "Function to execute"))
                         (repeat :tag "Macros" (string)))))
 
-(defvar TeX-fold-macro-spec-list-internal nil
+(defvar-local TeX-fold-macro-spec-list-internal nil
   "Internal list of display strings and macros to fold.
 Is updated when the TeX Fold mode is being activated and then
 contains all constructs to fold for the given buffer or mode
 respectively, that is, contents of both `TeX-fold-macro-spec-list'
 and <mode-prefix>-fold-macro-spec-list.")
-(make-variable-buffer-local 'TeX-fold-macro-spec-list-internal)
 
 (defcustom TeX-fold-env-spec-list
   '(("[comment]" ("comment")))
@@ -137,13 +136,12 @@ and <mode-prefix>-fold-macro-spec-list.")
                                 (function :tag "Function to execute"))
                         (repeat :tag "Environments" (string)))))
 
-(defvar TeX-fold-env-spec-list-internal nil
+(defvar-local TeX-fold-env-spec-list-internal nil
   "Internal list of display strings and environments to fold.
 Is updated when the TeX Fold mode is being activated and then
 contains all constructs to fold for the given buffer or mode
 respectively, that is, contents of both `TeX-fold-env-spec-list'
 and <mode-prefix>-fold-env-spec-list.")
-(make-variable-buffer-local 'TeX-fold-env-spec-list-internal)
 
 (defcustom TeX-fold-math-spec-list nil
   "List of display strings and math macros to fold."
@@ -152,13 +150,12 @@ and <mode-prefix>-fold-env-spec-list.")
                                 (function :tag "Function to execute"))
                         (repeat :tag "Math Macros" (string)))))
 
-(defvar TeX-fold-math-spec-list-internal nil
+(defvar-local TeX-fold-math-spec-list-internal nil
   "Internal list of display strings and math macros to fold.
 Is updated when the TeX Fold mode is being activated and then
 contains all constructs to fold for the given buffer or mode
 respectively, that is, contents of both `TeX-fold-math-spec-list'
 and <mode-prefix>-fold-math-spec-list.")
-(make-variable-buffer-local 'TeX-fold-math-spec-list-internal)
 
 (defcustom TeX-fold-unspec-macro-display-string "[m]"
   "Display string for unspecified macros.
@@ -234,8 +231,7 @@ Set it to zero in order to disable help echos."
 (defvar TeX-fold-ellipsis "..."
   "String used as display string for overlays instead of a zero-length 
string.")
 
-(defvar TeX-fold-open-spots nil)
-(make-variable-buffer-local 'TeX-fold-open-spots)
+(defvar-local TeX-fold-open-spots nil)
 
 (defcustom TeX-fold-command-prefix "\C-c\C-o"
   "Prefix key to use for commands in TeX Fold mode.
@@ -741,36 +737,31 @@ Return non-nil if a removal happened, nil otherwise."
   "Expand instances of {<num>}, [<num>], <<num>>, and (<num>).
 Replace them with the respective macro argument."
   (let ((spec-list (split-string spec "||"))
-        (delims '((?\{ . ?\}) (?\[ . ?\]) (?< . ?>) (?\( . ?\))))
-        index success)
-    (catch 'success
-      ;; Iterate over alternatives.
-      (dolist (elt spec-list)
-        (setq spec elt
-              index nil)
-        ;; Find and expand every placeholder.
-        (while (and (string-match "\\([[{<]\\)\\([1-9]\\)\\([]}>]\\)" elt 
index)
-                    ;; Does the closing delim match the opening one?
-                    (string-equal
-                     (match-string 3 elt)
-                     (char-to-string
-                      (cdr (assq (string-to-char (match-string 1 elt))
-                                 delims)))))
-          (setq index (match-end 0))
-          (let ((arg (car (save-match-data
-                            ;; Get the argument.
-                            (TeX-fold-macro-nth-arg
-                             (string-to-number (match-string 2 elt))
-                             ov-start ov-end
-                             (assoc (string-to-char (match-string 1 elt))
-                                    delims))))))
-            (when arg (setq success t))
-            ;; Replace the placeholder in the string.
-            (setq elt (replace-match (or arg TeX-fold-ellipsis) nil t elt)
-                  index (+ index (- (length elt) (length spec)))
-                  spec elt)))
-        (when success (throw 'success nil))))
-    spec))
+        (delims '((?\{ . ?\}) (?\[ . ?\]) (?< . ?>) (?\( . ?\)))))
+    (cl-labels
+        ((expand (spec &optional index)
+           ;; If there is something to replace and the closing delimiter
+           ;; matches the opening one…
+           (if-let (((string-match "\\([[{<(]\\)\\([1-9]\\)\\([]}>)]\\)"
+                                   spec index))
+                    (open (string-to-char (match-string 1 spec)))
+                    (num (string-to-number (match-string 2 spec)))
+                    (close (string-to-char (match-string 3 spec)))
+                    ((equal close (cdr (assoc open delims)))))
+               ;; … then replace it and move on.  Otherwise, it must have been
+               ;; a spurious spec, so abort.
+               (when-let ((arg (car (save-match-data
+                                      (TeX-fold-macro-nth-arg
+                                       num ov-start ov-end (assoc open 
delims)))))
+                          (spec* (replace-match arg nil t spec)))
+                 (expand spec*
+                         (+ (match-end 0) (- (length spec*) (length spec)))))
+             ;; Nothing to replace: return the (completed) spec.
+             spec)))
+      (or (cl-loop for elt in spec-list
+                   do (when-let (expanded (expand elt))
+                        (cl-return expanded)))
+          TeX-fold-ellipsis))))
 
 (defun TeX-fold-hide-item (ov)
   "Hide a single macro or environment.
diff --git a/tex-info.el b/tex-info.el
index 180360fd0a..63242e0df7 100644
--- a/tex-info.el
+++ b/tex-info.el
@@ -479,26 +479,17 @@ is assumed by default."
            (if (nth 1 reftex-label-menu-flags) ; section number flag
                (concat section-number " "))
            text))
-    (prog1
-        (list 'toc "toc" text file marker level section-number
-              literal (marker-position marker))
-      (set-marker marker nil))))
+    (list 'toc "toc" text file marker level section-number
+          literal (marker-position marker))))
 
 (defun Texinfo-reftex-hook ()
   "Hook function to plug Texinfo into RefTeX."
   ;; force recompilation of variables
-  (when (string= TeX-base-mode-name "Texinfo")
-    ;; dirty temporary hook to remove when reftex has a Texinfo builtin
-    ;; TODO --- taken on <2014-01-06 mon> --- remove the dirty trick once 
reftex
-    ;; has been corrected for long enough a time
-    (unless (assq 'Texinfo reftex-label-alist-builtin)
-      (setq reftex-label-alist-builtin (append reftex-label-alist-builtin
-                                               '((Texinfo "Texinfo default 
environments" nil)))))
-    (dolist (v `((reftex-section-pre-regexp . "@")
-                 ; section post-regexp must contain exactly one group
-                 (reftex-section-post-regexp . "\\([ \t]+\\)")
-                 (reftex-section-info-function . Texinfo-reftex-section-info)
-                 (reftex-default-label-alist-entries . (Texinfo))
+  (dolist (v `((reftex-section-pre-regexp . "@")
+               ;; section post-regexp must contain exactly one group
+               (reftex-section-post-regexp . "\\([ \t]+\\)")
+               (reftex-section-info-function . Texinfo-reftex-section-info)
+               (reftex-default-label-alist-entries . (Texinfo))
                (reftex-section-levels
                 . ,(mapcar
                     (lambda (x)
@@ -507,8 +498,8 @@ is assumed by default."
                           (cons (car x) (- (cadr x)))
                         (cons (car x) (cadr x))))
                     texinfo-section-list))))
-      (set (make-local-variable (car v) ) (cdr v)))
-    (reftex-ensure-compiled-variables)))
+    (set (make-local-variable (car v) ) (cdr v)))
+  (reftex-ensure-compiled-variables))
 
 ;;; Keymap:
 
@@ -523,6 +514,7 @@ is assumed by default."
     (define-key map "\C-c\C-u\C-n"   #'texinfo-update-node)
     (define-key map "\C-c\C-u\C-e"   #'texinfo-every-node-update)
     (define-key map "\C-c\C-u\C-a"   #'texinfo-all-menus-update)
+    (define-key map "\C-c\C-u\C-d"   #'texinfo-start-menu-description)
 
     ;; Simulating LaTeX-mode
     (define-key map "\C-c\C-e" #'Texinfo-environment)
@@ -865,7 +857,7 @@ value of `Texinfo-mode-hook'."
    '("xref" (Texinfo-arg-nodename "Node name")))
 
   ;; RefTeX plugging
-  (add-hook 'reftex-mode-hook #'Texinfo-reftex-hook)
+  (add-hook 'reftex-mode-hook #'Texinfo-reftex-hook nil t)
   (if (and (boundp 'reftex-mode) reftex-mode)
       (Texinfo-reftex-hook)))
 
diff --git a/tex-jp.el b/tex-jp.el
index a9de222622..cdb62d974f 100644
--- a/tex-jp.el
+++ b/tex-jp.el
@@ -83,9 +83,8 @@ systems are determined by their values regardless of the 
kanji option."
        TeX-command-list))
 
 ;; Define before first use.
-(defvar japanese-TeX-mode nil
+(defvar-local japanese-TeX-mode nil
   "Non-nil means the current buffer handles Japanese TeX/LaTeX.")
-(make-variable-buffer-local 'japanese-TeX-mode)
 
 (setq TeX-expand-list-builtin
       (append
diff --git a/tex-site.el.in b/tex-site.el.in
index b9e0e268b2..e4c6d05c9d 100644
--- a/tex-site.el.in
+++ b/tex-site.el.in
@@ -41,6 +41,8 @@
 (when (< emacs-major-version 26)
   (error "AUCTeX requires Emacs 26.1 or later"))
 
+(declare-function BibTeX-auto-store "latex")
+
 (unless (or (fboundp 'TeX-modes-set)     ;Avoid inf-looping.
             (fboundp 'TeX-tex-mode))     ;auctex-autoloads is not loaded.
   ;; Try and support the case where someone loads tex-site.el or
diff --git a/tex-style.el b/tex-style.el
index 615f49a1f7..6fdeceedf5 100644
--- a/tex-style.el
+++ b/tex-style.el
@@ -218,12 +218,11 @@ It can be a list of themes or a function.  If it is the 
symbol
 
 ;; style/biblatex.el
 
-(defvar LaTeX-biblatex-use-Biber t
+(defvar-local LaTeX-biblatex-use-Biber t
   "Whether to use Biber with biblatex.
 
 This variable is intended to be used as a file local variable to
 override the autodetection of the biblatex backend.")
-(make-variable-buffer-local 'LaTeX-biblatex-use-Biber)
 (put 'LaTeX-biblatex-use-Biber 'safe-local-variable #'booleanp)
 
 ;; style/catchfilebetweentags.el
diff --git a/tex.el b/tex.el
index 10bdf838ff..efe6291f5e 100644
--- a/tex.el
+++ b/tex.el
@@ -944,9 +944,8 @@ more details."
 
 ;;; Mode names.
 
-(defvar TeX-base-mode-name nil
+(defvar-local TeX-base-mode-name nil
   "Base name of mode.")
-(make-variable-buffer-local 'TeX-base-mode-name)
 
 (defun TeX-set-mode-name (&optional changed local reset)
   "Build and set the mode name.
@@ -1645,11 +1644,10 @@ actually used for forward and inverse search."
                                      (const source-specials)))))
   :group 'TeX-view)
 
-(defvar TeX-source-correlate-output-page-function nil
+(defvar-local TeX-source-correlate-output-page-function nil
   "Symbol of function returning an output page relating to buffer position.
 The function should take no arguments and return the page numer
 as a string.")
-(make-variable-buffer-local 'TeX-source-correlate-output-page-function)
 
 (define-obsolete-variable-alias 'TeX-source-specials-view-start-server
   'TeX-source-correlate-start-server "11.86")
@@ -2002,9 +2000,8 @@ enabled and the `synctex' binary is available."
 
 ;;; Miscellaneous minor modes
 
-(defvar TeX-mode-p nil
+(defvar-local TeX-mode-p nil
   "This indicates a TeX mode being active.")
-(make-variable-buffer-local 'TeX-mode-p)
 
 (defun TeX-mode-set (var value)
   (set-default var value)
@@ -2042,22 +2039,20 @@ function `TeX-global-PDF-mode' for toggling this value."
 
 (defalias 'tex-pdf-mode #'TeX-PDF-mode)
 
-(defvar TeX-PDF-mode-parsed nil
+(defvar-local TeX-PDF-mode-parsed nil
   "Set if `TeX-PDF-mode' has come about by parsing.")
 
-(make-variable-buffer-local 'TeX-PDF-mode-parsed)
-
 (defun TeX-PDF-mode-parsed (arg)
   "Change `TeX-PDF-mode' to ARG based on parsing.
 If this conflicts with previous parsed settings,
 just use the default.  If an explicit setting is
 already established, don't do anything."
 
-;; Basically we have the following situations:
-;; TeX-PDF-mode-parsed (local-variable-p 'TeX-PDF-mode):
-;; nil nil : virgin state
-;; nil t   : stably set state (possibly because of conflicting parse info)
-;; t   t   : non-conflicting parsed info
+  ;; Basically we have the following situations:
+  ;; TeX-PDF-mode-parsed (local-variable-p 'TeX-PDF-mode):
+  ;; nil nil : virgin state
+  ;; nil t   : stably set state (possibly because of conflicting parse info)
+  ;; t   t   : non-conflicting parsed info
 
   (if TeX-PDF-mode-parsed
       (unless (eq TeX-PDF-mode arg)
@@ -2168,21 +2163,15 @@ Must be the car of an entry in `TeX-command-list'."
   :group 'TeX-command-name
   :type 'string)
 
-(defvar TeX-trailer-start nil
+(defvar-local TeX-trailer-start nil
   "Regular expression delimiting start of trailer in a TeX file.")
 
- (make-variable-buffer-local 'TeX-trailer-start)
-
-(defvar TeX-header-end nil
+(defvar-local TeX-header-end nil
   "Regular expression delimiting end of header in a TeX file.")
 
- (make-variable-buffer-local 'TeX-header-end)
-
-(defvar TeX-command-default nil
+(defvar-local TeX-command-default nil
   "The default command for `TeX-command' in the current major mode.")
 
- (make-variable-buffer-local 'TeX-command-default)
-
 (put 'TeX-command-default 'safe-local-variable #'stringp)
 
 (defvar TeX-clean-default-intermediate-suffixes
@@ -2973,9 +2962,8 @@ See variable `TeX-style-hook-dialect' for supported 
dialects."
   :group 'TeX-parse
   :type 'string)
 
-(defvar TeX-active-styles nil
+(defvar-local TeX-active-styles nil
   "List of styles currently active in the document.")
- (make-variable-buffer-local 'TeX-active-styles)
 
 (defun TeX-run-style-hooks (&rest styles)
   "Run the TeX style hooks STYLES."
@@ -3023,9 +3011,8 @@ See variable `TeX-style-hook-dialect' for supported 
dialects."
   :group 'TeX-parse
   :type 'boolean)
 
-(defvar TeX-style-hook-applied-p nil
+(defvar-local TeX-style-hook-applied-p nil
   "Non-nil means the style specific hooks have been applied.")
- (make-variable-buffer-local 'TeX-style-hook-applied-p)
 
 (defvar TeX-update-style-hook nil
   "Hook run as soon as style specific hooks were applied.")
@@ -3070,14 +3057,11 @@ FORCE is not nil."
 
 ;;; Special Characters
 
-(defvar TeX-esc "\\" "The TeX escape character.")
- (make-variable-buffer-local 'TeX-esc)
+(defvar-local TeX-esc "\\" "The TeX escape character.")
 
-(defvar TeX-grop "{" "The TeX group opening character.")
- (make-variable-buffer-local 'TeX-grop)
+(defvar-local TeX-grop "{" "The TeX group opening character.")
 
-(defvar TeX-grcl "}" "The TeX group closing character.")
- (make-variable-buffer-local 'TeX-grcl)
+(defvar-local TeX-grcl "}" "The TeX group closing character.")
 
 ;;; Symbols
 
@@ -4321,21 +4305,16 @@ alter the numbering of any ordinary, non-shy groups.")
 
 (defvar plain-TeX-auto-regexp-list
   (let ((token TeX-token-char))
-    `((,(concat "\\\\def\\\\\\(" token "+\\)[^a-zA-Z@]")
-       1 TeX-auto-symbol-check)
-      (,(concat "\\\\let\\\\\\(" token "+\\)[^a-zA-Z@]")
+    `((,(concat "\\\\\\(?:def\\|let\\)\\\\\\(" token "+\\)[^a-zA-Z@]")
        1 TeX-auto-symbol-check)
-      (,(concat "\\\\font\\\\\\(" token "+\\)[^a-zA-Z@]") 1 TeX-auto-symbol)
-      (,(concat "\\\\chardef\\\\\\(" token "+\\)[^a-zA-Z@]") 1 TeX-auto-symbol)
-      (,(concat "\\\\new\\(?:count\\|dimen\\|muskip\\|skip\\)\\\\\\(" token
-                "+\\)[^a-zA-Z@]")
+      (,(concat "\\\\"
+                (regexp-opt '("font" "newfont" "chardef" "mathchardef"
+                              "newcount" "newdimen" "newmuskip" "newskip"))
+                "{?\\\\\\(" token "+\\)}?[^a-zA-Z@]")
        1 TeX-auto-symbol)
-      (,(concat "\\\\newfont{?\\\\\\(" token "+\\)}?") 1 TeX-auto-symbol)
       (,(concat "\\\\typein\\[\\\\\\(" token "+\\)\\]") 1 TeX-auto-symbol)
       ("\\\\input +\\([^#}%\"\\\n\r]+?\\)\\(?:\\.[^#}%/\"\\.\n\r]+\\)?"
-       1 TeX-auto-file)
-      (,(concat "\\\\mathchardef\\\\\\(" token "+\\)[^a-zA-Z@]")
-       1 TeX-auto-symbol)))
+       1 TeX-auto-file)))
   "List of regular expression matching common plain TeX macro definitions.")
 
 (defvar TeX-auto-full-regexp-list plain-TeX-auto-regexp-list
@@ -4541,14 +4520,12 @@ Check for potential LaTeX environments."
   :group 'TeX-file-extension
   :type 'string)
 
-(defvar TeX-output-extension nil
+(defvar-local TeX-output-extension nil
   "Extension of TeX output file.
 This is either a string or a list with
 a string as element.  Its value is obtained from `TeX-command-output-list'.
 Access to the value should be through the function `TeX-output-extension'.")
 
-  (make-variable-buffer-local 'TeX-output-extension)
-
 (defcustom TeX-Biber-file-extensions '("bib" "ris" "xml")
   "Valid file extensions for Biber files."
   :group 'TeX-file-extension
@@ -5320,10 +5297,9 @@ Brace insertion is only done if point is in a math 
construct and
 
 ;;; Verbatim constructs
 
-(defvar TeX-verbatim-p-function nil
+(defvar-local TeX-verbatim-p-function nil
   "Mode-specific function to be called by `TeX-verbatim-p'.
 It must accept optional argument POS for position.")
-(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)
@@ -5336,11 +5312,10 @@ available, the function always returns nil."
 
 ;;; Comments
 
-(defvar TeX-comment-start-regexp "%"
+(defvar-local TeX-comment-start-regexp "%"
   "Regular expression matching a comment starter.
 Unlike the variable `comment-start-skip' it should not match any
 whitespace after the comment starter or any character before it.")
-(make-variable-buffer-local 'TeX-comment-start-regexp)
 
 (defun TeX-uncomment ()
   "Delete comment characters from the beginning of each line in a comment."
@@ -5552,25 +5527,38 @@ additional characters."
                                           '(?\{ ?\} ?\\))
                                     (TeX-in-comment))))
                  (forward-char)
-                 ;; If inside a verbatim construct, just return t and
-                 ;; proceed, otherwise start counting:
-                 (if (TeX-verbatim-p)
-                     t
-                   (cond ((memq char (append
-                                      TeX-indent-open-delimiters
-                                      '(?\{)))
-                          (setq count (+ count TeX-brace-indent-level)))
-                         ((memq char (append
-                                      TeX-indent-close-delimiters
-                                      '(?\})))
-                          (setq count (- count TeX-brace-indent-level)))
-                         ((eq char ?\\)
-                          (when (< (point) limit)
-                            ;; ?\\ in verbatim constructs doesn't escape
-                            ;; the next char
-                            (unless (TeX-verbatim-p)
-                              (forward-char))
-                            t)))))))
+                 ;; We have to cater for verb-macros with braces and
+                 ;; what the function `TeX-verbatim-p' returns dep. on
+                 ;; the position of point:
+                 ;;       \Verb{\ or { or } are not special}.
+                 ;;     nil  <-^^-> t                  t <-^^-> nil
+                 (cond ((memq char (append
+                                    TeX-indent-open-delimiters
+                                    '(?\{)))
+                        ;; Point is one char after `{', if char before
+                        ;; isn't inside a verb macro, then the brace
+                        ;; is a real delimiter and we increase
+                        ;; `count', otherwise not:
+                        (if (TeX-verbatim-p (1- (point)))
+                            t
+                          (setq count (+ count TeX-brace-indent-level))))
+                       ((memq char (append
+                                    TeX-indent-close-delimiters
+                                    '(?\})))
+                        ;; Point if one char after `}', if not inside
+                        ;; a verb macro, this is a real delimiter and
+                        ;; we decrease `count', otherwise not:
+                        (if (TeX-verbatim-p)
+                            t
+                          (setq count (- count TeX-brace-indent-level))))
+                       ((eq char ?\\)
+                        ;; Point is one char-after after `\', so check
+                        ;; if the char before point is inside a verb
+                        ;; macro:
+                        (when (< (point) limit)
+                          (unless (TeX-verbatim-p (1- (point)))
+                            (forward-char))
+                          t))))))
       count)))
 
 ;;; Navigation
@@ -5838,13 +5826,12 @@ escape characters, such as \"\\\" in LaTeX."
         (buffer-substring-no-properties
          (point) (progn (skip-chars-forward "@A-Za-z*") (point)))))))
 
-(defvar TeX-search-forward-comment-start-function nil
+(defvar-local TeX-search-forward-comment-start-function nil
   "Function to find the start of a comment.
 The function should accept an optional argument for specifying
 the limit of the search.  It should return the position just
 before the comment if one is found and nil otherwise.  Point
 should not be moved.")
-(make-variable-buffer-local 'TeX-search-forward-comment-start-function)
 
 (defun TeX-search-forward-comment-start (&optional limit)
   "Search forward for a comment start from current position till LIMIT.
@@ -6266,7 +6253,7 @@ valid languages."
                         (choice :tag "Closing quotation mark" string function)
                         (boolean :tag "Insert plain quote first" :value t))))
 
-(defvar TeX-quote-language nil
+(defvar-local TeX-quote-language nil
   "If non-nil determines behavior of quote insertion.
 It is usually set by language-related style files.  Its value has
 the same structure as the elements of `TeX-quote-language-alist'.
@@ -6274,7 +6261,6 @@ The symbol `override' can be used as its car in order to 
override
 the settings of style files.  Style files should therefore check
 if this symbol is present and not alter `TeX-quote-language' if
 it is.")
-(make-variable-buffer-local 'TeX-quote-language)
 
 (defun TeX-insert-quote (force)
   "Insert the appropriate quotation marks for TeX.
@@ -6969,13 +6955,10 @@ depend on it being positive instead of the entry in 
`TeX-command-list'."
 ;; However, that string is inappropriate for plain TeX and ConTeXt.
 ;; This needs reconsideration.
 
-(defvar TeX-command-region-begin nil)
-(defvar TeX-command-region-end nil)
+(defvar-local TeX-command-region-begin nil)
+(defvar-local TeX-command-region-end nil)
 ;; Used for marking the last region.
 
-(make-variable-buffer-local 'TeX-command-region-begin)
-(make-variable-buffer-local 'TeX-command-region-end)
-
 (defun TeX-current-offset (&optional pos)
   "Calculate line offset of POS, or of point if POS is nil."
   (save-restriction
@@ -7159,12 +7142,11 @@ the master file."
       (find-file (TeX-master-file TeX-default-extension))
     (switch-to-buffer TeX-command-buffer)))
 
-(defvar TeX-error-last-visited -1
+(defvar-local TeX-error-last-visited -1
   "Index of the last visited error listed in `TeX-error-list'.
 
 This variable is intended to be set only in output buffer so it
 will be shared among all files of the same document.")
-(make-variable-buffer-local 'TeX-error-last-visited)
 
 (defun TeX-get-parse-function ()
   "Get the parse function for the current buffer."
@@ -7239,12 +7221,11 @@ run.")
   :group 'TeX-command
   :type 'boolean)
 
-(defvar TeX-check-engine-list '(default luatex omega xetex)
+(defvar-local TeX-check-engine-list '(default luatex omega xetex)
   "List of engines required by the loaded TeX packages.
 
 Do not set this variable directly, use
 `TeX-check-engine-add-engines' to specify required engines.")
-(make-variable-buffer-local 'TeX-check-engine-list)
 
 (defun TeX-check-engine-add-engines (&rest engines)
   "Add ENGINES to list of required engines.
@@ -7732,11 +7713,9 @@ omitted) and `TeX-region-file'."
         answer
       default)))
 
-(defvar TeX-command-next nil
+(defvar-local TeX-command-next nil
   "The default command next time `TeX-command' is invoked.")
 
- (make-variable-buffer-local 'TeX-command-next)
-
 (defun TeX-printer-query (&optional queue)
   "Query the user for a printer name.
 QUEUE is non-nil when we are checking for the printer queue."
@@ -7745,7 +7724,7 @@ QUEUE is non-nil when we are checking for the printer 
queue."
         (unless (setq element 2 command TeX-queue-command)
           (error "Need to customize `TeX-queue-command'"))
       (unless (setq element 1 command TeX-print-command)
-          (error "Need to customize `TeX-print-command'")))
+        (error "Need to customize `TeX-print-command'")))
     (while (progn
              (setq printer (if TeX-printer-list
                                (let ((completion-ignore-case t))
@@ -8323,20 +8302,15 @@ Insert MSG with some additional information."
   (setq compilation-in-progress (delq process compilation-in-progress)))
 
 
-(defvar TeX-sentinel-function (lambda (_process _name) nil)
+(defvar-local TeX-sentinel-function (lambda (_process _name) nil)
   "Hook to cleanup TeX command buffer after termination of PROCESS.
 NAME is the name of the process.")
 
-(make-variable-buffer-local 'TeX-sentinel-function)
-
-
-(defvar TeX-sentinel-default-function (lambda (_process _name) nil)
+(defvar-local TeX-sentinel-default-function (lambda (_process _name) nil)
   "Default for `TeX-sentinel-function'.  To be set in major mode.
 Hook to cleanup TeX command buffer after termination of PROCESS.
 NAME is the name of the process.")
 
-(make-variable-buffer-local 'TeX-sentinel-default-function)
-
 (defun TeX-TeX-sentinel (process name)
   "Cleanup TeX output buffer after running TeX.
 
@@ -8803,16 +8777,14 @@ command."
       (insert-before-markers string)
       (set-marker (process-mark process) (point)))))
 
-(defvar TeX-current-page nil
+(defvar-local TeX-current-page nil
   "The page number currently being formatted, enclosed in brackets.")
 
- (make-variable-buffer-local 'TeX-current-page)
-
 (defun TeX-format-mode-line (process)
   "Format the mode line for a buffer containing TeX output from PROCESS."
-    (setq mode-line-process (concat " " TeX-current-page ": "
-                                    (symbol-name (process-status process))))
-    (force-mode-line-update))
+  (setq mode-line-process (concat " " TeX-current-page ": "
+                                  (symbol-name (process-status process))))
+  (force-mode-line-update))
 
 (defun TeX-format-filter (process string)
   "Filter to process TeX output."
@@ -8857,9 +8829,8 @@ command."
                   pt nil)
             (TeX-format-mode-line process)))))))
 
-(defvar TeX-parse-function nil
+(defvar-local TeX-parse-function nil
   "Function to call to parse content of TeX output buffer.")
-(make-variable-buffer-local 'TeX-parse-function)
 
 (defun TeX-background-filter (_process string)
   "Filter to process background output."
@@ -9138,10 +9109,9 @@ The compatibility argument IGNORE is ignored."
   :group 'TeX-command
   :type 'string)
 
-(defvar LaTeX-command-section-level nil
+(defvar-local LaTeX-command-section-level nil
   "The section level used for `LaTeX-command-section'.
 Will be initialized to `LaTeX-largest-level' buffer-locally.")
-(make-variable-buffer-local 'LaTeX-command-section-level)
 
 (defun LaTeX-command-section-level ()
   "Return the value of `LaTeX-command-section-level'.
@@ -9150,7 +9120,6 @@ Initialize it to `LaTeX-largest-level' if needed."
     (setq LaTeX-command-section-level LaTeX-largest-level))
   LaTeX-command-section-level)
 
-
 (defun LaTeX-command-section-change-level (arg)
   "Change `LaTeX-command-section-level' by ARG.
 `LaTeX-command-section-level' is the sectioning level used to
@@ -9245,21 +9214,15 @@ compile the current section instead, that is, call
 
 ;;; - Global Parser Variables
 
-(defvar TeX-error-point nil
+(defvar-local TeX-error-point nil
   "How far we have parsed until now.")
 
-(make-variable-buffer-local 'TeX-error-point)
-
-(defvar TeX-error-file nil
+(defvar-local TeX-error-file nil
   "Stack of files in which errors have occurred.")
 
-(make-variable-buffer-local 'TeX-error-file)
-
-(defvar TeX-error-offset nil
+(defvar-local TeX-error-offset nil
   "Add this to any line numbers from TeX.  Stack like `TeX-error-file'.")
 
-(make-variable-buffer-local 'TeX-error-offset)
-
 (defun TeX-parse-reset (&optional reparse)
   "Reset all variables used for parsing TeX output.
 If optional argument REPARSE is non-nil, reparse the output log."
@@ -9381,7 +9344,7 @@ from this hook.")
 ;; for each error/warning, because it can be set within `TeX-warning' by a
 ;; custom function taking as argument all information present in
 ;; `TeX-error-list' but `ignore', see `TeX-ignore-warnings'.
-(defvar TeX-error-list nil
+(defvar-local TeX-error-list nil
   "List of warnings and errors.
 
 Each element of the list is a list of information for a specific
@@ -9402,7 +9365,6 @@ error or warning.  This is the structure of each element:
 
 This variable is intended to be set only in output buffer so it
 will be shared among all files of the same document.")
-(make-variable-buffer-local 'TeX-error-list)
 
 (defun TeX-parse-all-errors ()
   "Parse TeX output buffer to collect all warnings and errors."
@@ -10236,6 +10198,7 @@ forward, if negative)."
 (define-derived-mode TeX-error-overview-mode tabulated-list-mode
                      "TeX errors"
   "Major mode for listing TeX errors."
+  :syntax-table nil :abbrev-table nil :interactive nil
   (setq tabulated-list-format [("File" 25 nil)
                                ("Line" 4 nil :right-align t)
                                ("Type" 7 nil)
@@ -10338,7 +10301,8 @@ warnings and bad boxes"
 
 ;;; Output mode
 
-(define-derived-mode TeX-special-mode special-mode "TeX")
+(define-derived-mode TeX-special-mode special-mode "TeX"
+  :syntax-table nil :abbrev-table nil :interactive nil)
 
 (defvar TeX-output-mode-map
   (let ((map (make-sparse-keymap)))
@@ -10361,7 +10325,7 @@ warnings and bad boxes"
 (define-derived-mode TeX-output-mode TeX-special-mode "TeX Output"
   "Major mode for viewing TeX output.
 \\{TeX-output-mode-map} "
-  :syntax-table nil
+  :syntax-table nil :abbrev-table nil :interactive nil
   (set (make-local-variable 'revert-buffer-function)
        #'TeX-output-revert-buffer)
   ;; special-mode makes it read-only which prevents input from TeX.
diff --git a/texmathp.el b/texmathp.el
index da4f682d67..3316c461e9 100644
--- a/texmathp.el
+++ b/texmathp.el
@@ -327,7 +327,7 @@ See the variable `texmathp-tex-commands' about which 
commands are checked."
     ;; is used stand-alone without latex.el provided by AUCTeX
     ;; (bug#61410):
     (if (and (fboundp 'LaTeX-verbatim-p)
-             (save-excursion (LaTeX-verbatim-p (cdr match))))
+             (LaTeX-verbatim-p (cdr match)))
         (progn
           (setq texmathp-why `(nil . ,(cdr match)))
           (when (called-interactively-p 'any)



reply via email to

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