auctex-diffs
[Top][All Lists]
Advanced

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

feature/capf df92458f 2/2: Merge branch 'master' into feature/capf


From: Arash Esbati
Subject: feature/capf df92458f 2/2: Merge branch 'master' into feature/capf
Date: Fri, 14 Oct 2022 06:27:29 -0400 (EDT)

branch: feature/capf
commit df92458fa1a410eea4d5dccdce7d97786d2e2ef4
Merge: a119b921 4c26ef9b
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>

    Merge branch 'master' into feature/capf
---
 .gitignore                        |   2 +
 Makefile.in                       |  33 +++-
 aclocal.m4                        |   6 +-
 bib-cite.el                       |  11 +-
 configure.ac                      |   5 +-
 context.el                        |   6 +-
 doc/auctex.texi                   |  38 ++++-
 doc/changes.texi                  |  37 +++++
 doc/preview-problems.texi         |  10 ++
 doc/todo.texi                     |  43 +++++-
 doc/wininstall.texi               |   4 +
 font-latex.el                     |  69 ++++++---
 latex.el                          | 297 ++++++++++++++++++++++++++---------
 preview.el.in                     |  34 +++-
 style/amsaddr.el                  |  37 +++++
 style/amsart.el                   | 109 ++++++++++++-
 style/array.el                    |  15 +-
 style/catchfilebetweentags.el     | 116 ++++++++++++++
 style/doc.el                      |   3 -
 style/enumitem.el                 |  26 ++--
 style/fancyvrb.el                 |  29 +++-
 style/fvextra.el                  |  22 +--
 style/graphicx.el                 |   6 +-
 style/hyperref.el                 |  49 +++---
 style/keyval.el                   |  58 +++++++
 style/kvoptions.el                | 113 ++++++++++++++
 style/kvsetkeys.el                |  58 +++++++
 style/l3doc.el                    |  13 +-
 style/listings.el                 |  21 ++-
 style/longtable.el                |  11 +-
 style/ltx-base.el                 |  15 +-
 style/ltxdoc.el                   |   2 +-
 style/microtype.el                | 240 +++++++++++++++++++++++++++++
 style/parskip.el                  |  50 ++++++
 style/proc.el                     |  47 ++++++
 style/shortvrb.el                 |  27 +++-
 style/sidecap.el                  |   2 +-
 style/tcolorboxlib-theorems.el    | 317 ++++++++++++++++++++++++++++++++++++++
 style/tikz.el                     |  11 +-
 style/ulem.el                     |   7 +-
 style/xltabular.el                |  11 +-
 style/xparse.el                   |  21 +--
 tests/latex/doctex-indent-in.dtx  |   6 +
 tests/latex/doctex-indent-out.dtx |   6 +
 tests/latex/latex-filling-in.tex  |  19 +++
 tests/latex/latex-filling-out.tex |  21 +++
 tests/latex/latex-test.el         |   8 +-
 tex-bar.el                        | 103 +++++++------
 tex-fold.el                       |   4 +-
 tex-info.el                       |   1 -
 tex-site.el.in                    |   7 +-
 tex-style.el                      |   7 +
 tex.el                            | 115 +++++++++-----
 53 files changed, 1978 insertions(+), 350 deletions(-)

diff --git a/.gitignore b/.gitignore
index e4e274b5..f242adaf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,6 +35,8 @@ latex/preview-mk.ins
 latex/preview.aux
 latex/preview.drv
 latex/preview.dvi
+latex/preview.hd
+latex/preview.out
 latex/preview.pdf
 latex/preview.sty
 latex/prfootnotes.def
diff --git a/Makefile.in b/Makefile.in
index b8a45dd0..a2bb2d9d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -52,14 +52,25 @@ PACKAGE=auctex
 PACKAGE_INFO=auctex preview-latex
 EMACS=@EMACS@
 ELCC=$(EMACS) -batch -q -no-site-file -no-init-file -l lpath.el
-AUTOLOAD=--eval '(let ((autoload-file (expand-file-name "$@"))) \
-  (mapcar (lambda (file) \
-            (update-file-autoloads file nil autoload-file)) \
-          command-line-args-left) \
+AUTOLOAD=--eval '\
+(let* ((autoload-file (expand-file-name "$@")) \
+       (autoload-file-dir (file-name-directory autoload-file))) \
+  (if (fboundp (quote loaddefs-generate)) \
+      (loaddefs-generate autoload-file-dir autoload-file \
+                        (list "preview.el" "tex-wizard.el")) \
+    (mapcar (lambda (file) \
+             (update-file-autoloads file nil autoload-file)) \
+           command-line-args-left)) \
   (save-buffers-kill-emacs t))'
 
-PREVIEW_AUTOLOAD=--eval '(let ((autoload-file (expand-file-name "$@"))) \
-  (update-file-autoloads "preview.el" nil autoload-file) \
+PREVIEW_AUTOLOAD=--eval '\
+(let* ((autoload-file (expand-file-name "$@")) \
+       (autoload-file-dir (file-name-directory autoload-file))) \
+  (if (fboundp (quote loaddefs-generate)) \
+      (loaddefs-generate autoload-file-dir autoload-file \
+                        (mapcar (function symbol-name) \
+                                (quote ($(AUCSRC) tex-wizard.el)))) \
+    (update-file-autoloads "preview.el" nil autoload-file)) \
   (save-buffers-kill-emacs t))'
 
 # Files and directories excluded from distributed tar ball.
@@ -181,7 +192,10 @@ STYLESRC = style/prosper.el \
           style/rotating.el  style/sidecap.el   style/l3doc.el \
           style/ifthen.el    style/etoolbox.el  style/ifetex.el \
           style/ifpdf.el     style/iftex.el     style/ifvtex.el \
-          style/ifxetex.el   style/multibib.el  style/ltcaption.el
+          style/ifxetex.el   style/multibib.el  style/ltcaption.el \
+          style/keyval.el    style/kvoptions.el style/kvsetkeys.el \
+          style/proc.el      style/microtype.el style/tcolorboxlib-theorems.el 
\
+          style/amsaddr.el   style/parskip.el   style/catchfilebetweentags.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
@@ -255,6 +269,11 @@ tex-site.el: tex-site.el.out auto-loads.el Makefile
        cat auto-loads.el >>$@
        echo "(provide 'tex-site)" >>$@ ; \
        echo ";;; tex-site.el ends here" >>$@
+       sed -i'.tmp' \
+           -e "/^(provide 'auto-loads)/d" \
+           -e '/^;;; auto-loads.el ends here/d' \
+           -e 's/^\(;;; auto-loads.el.*\)\(   -\*- lexical-binding: t 
-\*-\)/\1/' $@
+       -rm -f $@.tmp
 
 tex-site.el.out: tex-site.el.in Makefile config.status
        ./config.status
diff --git a/aclocal.m4 b/aclocal.m4
index 383a5935..c6c73054 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -13,10 +13,10 @@ dnl assigned from the command line arguments from $5.
 AC_DEFUN(EMACS_LISP, [
   elisp="$2"
   OUTPUT=./conftest-$$
-  echo "${EMACS}" -batch $3 -eval "(let* (patsubst([$4], [\w+], [(\&(pop 
command-line-args-left))])(x ${elisp})) (write-region (if (stringp x) x 
(prin1-to-string x)) nil \"${OUTPUT}\"))" $5 >& AC_FD_CC 2>&1
-  "${EMACS}" -batch $3 -eval "(let* (patsubst([$4], [\w+], [(\&(pop 
command-line-args-left))])(x ${elisp})) (write-region (if (stringp x) x 
(prin1-to-string x)) nil \"${OUTPUT}\"))" $5 >& AC_FD_CC 2>&1
+  echo "${EMACS}" -batch $3 -eval "(let* (patsubst([$4], [\w+], [(\&(pop 
command-line-args-left))])(x ${elisp})) (write-region (if (stringp x) x 
(prin1-to-string x)) nil \"${OUTPUT}\"))" $5 >& AS_MESSAGE_LOG_FD 2>&1
+  "${EMACS}" -batch $3 -eval "(let* (patsubst([$4], [\w+], [(\&(pop 
command-line-args-left))])(x ${elisp})) (write-region (if (stringp x) x 
(prin1-to-string x)) nil \"${OUTPUT}\"))" $5 >& AS_MESSAGE_LOG_FD 2>&1
   $1="`cat ${OUTPUT}`"
-  echo "=> [$]{$1}" >& AC_FD_CC 2>&1
+  echo "=> [$]{$1}" >& AS_MESSAGE_LOG_FD 2>&1
   rm -f ${OUTPUT}
 ])
 
diff --git a/bib-cite.el b/bib-cite.el
index a6405046..9c19be37 100644
--- a/bib-cite.el
+++ b/bib-cite.el
@@ -595,6 +595,7 @@
 ;; Silence the compiler:
 (declare-function reftex-view-crossref "ext:reftex-dcr"
                   (&optional arg auto-how fail-quietly))
+(declare-function outline-show-entry "ext:outline" ())
 
 (defgroup bib-cite nil
   "bib-cite, LaTeX minor-mode to display \\cite, \\ref and \\label commands."
@@ -1429,11 +1430,7 @@ If within a multi-file document (in AUCTeX only)
     (if (bib-Is-hidden)
         (save-excursion
           (beginning-of-line)
-          ;; COMPATIBILITY for emacs<25.
-          (if (fboundp 'outline-show-entry)
-              (outline-show-entry)
-            (with-no-warnings
-              (show-entry)))))))
+          (outline-show-entry)))))
 
 (defvar bib-label-prompt-map
   (let ((map (make-sparse-keymap)))
@@ -1579,9 +1576,9 @@ Does not save excursion."
 (defun create-alist-from-list (the-list)
   "Return a single list from a THE-LIST that may contain either items or lists.
 e.g. turns
-'((\"label3\" \"label4\")(\"label1\" \"label2\") \"label\")
+\\='((\"label3\" \"label4\")(\"label1\" \"label2\") \"label\")
 into
-'((\"label3\") (\"label4\") (\"label1\") (\"label2\") (\"label\"))"
+\\='((\"label3\") (\"label4\") (\"label1\") (\"label2\") (\"label\"))"
   (mapcar #'list (bib-cite-mh-list-to-string the-list)))
 
 ;;
diff --git a/configure.ac b/configure.ac
index fe7616d5..81c09653 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@ dnl along with AUCTeX; see the file COPYING.  If not, write 
to the Free
 dnl Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 dnl MA 02110-1301, USA.
 
-AC_INIT(auctex,13.1,bug-auctex@gnu.org)
+AC_INIT([auctex],[13.1],[bug-auctex@gnu.org])
 
 AC_CHECK_PROGS_REQUIRED(MAKECMD, make, [make not found, aborting!])
 AC_PROG_MAKE_SET
@@ -268,7 +268,8 @@ AC_SHELL_QUOTIFY(TEXI2HTML)
 AC_SHELL_QUOTIFY(TEXI2DVI)
 AC_SHELL_QUOTIFY(TEXI2PDF)
 
-AC_OUTPUT(Makefile tex-site.el.out:tex-site.el.in doc/Makefile auctex.el 
preview.el latex/Makefile)
+AC_CONFIG_FILES([Makefile tex-site.el.out:tex-site.el.in doc/Makefile 
auctex.el preview.el latex/Makefile])
+AC_OUTPUT
 
 
 cat >&2 <<EOF
diff --git a/context.el b/context.el
index 653ed3ac..50fb1adf 100644
--- a/context.el
+++ b/context.el
@@ -696,7 +696,7 @@ With optional ARG, modify current environment."
         (ConTeXt-environment-menu environment)))))
 
 (defun ConTeXt-modify-environment (environment)
-  "Modify current environment."
+  "Modify current environment to new ENVIRONMENT."
   (save-excursion
     (ConTeXt-find-matching-stop)
     (re-search-backward (concat (regexp-quote TeX-esc)
@@ -1144,9 +1144,9 @@ An optional fourth (or sixth) element means always 
replace if t."
 (defun ConTeXt-outline-name ()
   "Guess a name for the current header line."
   (save-excursion
-    (if (re-search-forward "{\\([^\}]*\\)}" (point-at-eol) t)
+    (if (re-search-forward "{\\([^}]*\\)}" (line-end-position) t)
         (match-string 1)
-      (buffer-substring-no-properties (point) (point-at-eol)))))
+      (buffer-substring-no-properties (point) (line-end-position)))))
 
 ;; This imenu also includes commented out chapters. Perhaps a feature
 ;; for LaTeX, not sure we want or need that for ConTeXt.
diff --git a/doc/auctex.texi b/doc/auctex.texi
index 89527853..fb34568b 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -974,6 +974,9 @@ environment.
 If this command is called inside a comment and
 @code{LaTeX-syntactic-comments} is enabled, try to find the environment
 in commented regions with the same comment prefix.
+
+The key bind @kbd{C-M-a} actually calls @code{beginning-of-defun}, which
+in turn calls @code{LaTeX-find-matching-begin}.
 @end deffn
 
 @deffn Command LaTeX-find-matching-end
@@ -983,6 +986,9 @@ in commented regions with the same comment prefix.
 If this command is called inside a comment and
 @code{LaTeX-syntactic-comments} is enabled, try to find the environment
 in commented regions with the same comment prefix.
+
+The key bind @kbd{C-M-e} actually calls @code{end-of-defun}, which in turn
+calls @code{LaTeX-find-matching-end}.
 @end deffn
 
 @node Equations
@@ -2211,6 +2217,7 @@ your own macros which are listed in the table below.
 
 @vindex font-latex-match-bold-command-keywords
 @vindex font-latex-match-italic-command-keywords
+@vindex font-latex-match-underline-command-keywords
 @vindex font-latex-match-math-command-keywords
 @vindex font-latex-match-type-command-keywords
 @vindex font-latex-match-bold-declaration-keywords
@@ -2223,6 +2230,9 @@ Face: @code{font-latex-bold-face}
 @item font-latex-match-italic-command-keywords
 Keywords for commands specifying an italic font.@*
 Face: @code{font-latex-italic-face}
+@item font-latex-match-underline-command-keywords
+Keywords for commands specifying an underlined text.@*
+Face: @code{font-latex-underline-face}
 @item font-latex-match-math-command-keywords
 Keywords for commands specifying a math font.@*
 Face: @code{font-latex-math-face}
@@ -2251,7 +2261,7 @@ entries are "warning", "variable", "biblatexnoarg", 
"biblatex",
 "reference", "function" , "sectioning-0", "sectioning-1",
 "sectioning-2", "sectioning-3", "sectioning-4", "sectioning-5",
 "slide-title", "textual", "bold-command", "italic-command",
-"math-command", "type-command", "bold-declaration",
+"underline-command", "math-command", "type-command", "bold-declaration",
 "italic-declaration", "type-declaration".
 
 You can also get rid of certain keywords only.  For example if you want
@@ -4305,7 +4315,7 @@ all files in the document.  This means that you will get 
from each file,
 for example, completion for all labels defined anywhere in the document.
 
 @AUCTeX{} will create the @file{auto} directory automatically if
-@code{TeX-auto-save} is non-nil.  Without it, the files in the document
+@code{TeX-auto-save} is non-@code{nil}.  Without it, the files in the document
 will not know anything about each other, except for the name of the
 master file.  @xref{Automatic Local}.
 
@@ -5080,15 +5090,14 @@ These correspond to the personal @TeX{} macros.
 @cindex Local style directory
 
 @AUCTeX{} can update the style information about a file each time you
-save it, and it will do this if the directory @code{TeX-auto-local}
-exists.  @code{TeX-auto-local} is by default set to @samp{"auto"}, so
-simply creating an @file{auto} directory will enable automatic saving of
-style information.
+save it if @code{TeX-auto-save} option is enabled.  Saved information will
+be stored in the directory @code{TeX-auto-local}, set to @samp{"auto"} by
+default.
 
 The advantage of doing this is that macros, labels, etc.@: defined in any
 file in a multifile document will be known in all the files in the
 document.  The disadvantage is that saving will be slower.  To disable,
-set @code{TeX-auto-local} to nil.
+set @code{TeX-auto-local} to @code{nil}.
 
 @defopt TeX-style-local
 Directory containing hand generated @TeX{} information.
@@ -5102,6 +5111,15 @@ Directory containing automatically generated @TeX{} 
information.
 These correspond to @TeX{} macros found in the current directory.
 @end defopt
 
+@defopt TeX-auto-save-aggregate
+When non-@code{nil}, save parsed information in @file{auto} subdirectory
+of master directory.
+
+Otherwise, save in each @file{auto} subdirectory of the parsed file.
+
+Subdirectory name is actually taken from @code{TeX-auto-local}.
+@end defopt
+
 @node Style Files
 @section Writing Your Own Style Support
 @cindex Style files
@@ -5652,7 +5670,7 @@ an optional argument of the @samp{lstlisting} environment:
 @lisp
 (LaTeX-add-environments
  '("lstlisting" LaTeX-env-args
-   [TeX-arg-key-val LaTeX-listings-key-val-options]))
+   [TeX-arg-key-val (LaTeX-listings-key-val-options)]))
 @end lisp
 @end ftable
 
@@ -5812,6 +5830,7 @@ Which see.
 @cindex @file{macro.tex}
 @cindex @file{macro.el}
 @cindex Changing the parser
+@findex TeX-auto-add-regexp
 
 The automatic @TeX{} information extractor works by searching for
 regular expressions in the @TeX{} files, and storing the matched
@@ -5916,6 +5935,9 @@ List of functions to be called before parsing a @TeX{} 
file.
 List of functions to be called after parsing a @TeX{} file.
 @end defvar
 
+@c FIXME: Write a @defun for `TeX-auto-add-regexp' here.  Then we can omit
+@c its @findex below the subsection heading.
+
 @node Appendices
 @appendix Copying, Changes, Development, FAQ, Texinfo Mode
 
diff --git a/doc/changes.texi b/doc/changes.texi
index b8c70ba3..debfec68 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -11,6 +11,21 @@
 @heading News since last release
 
 @itemize @bullet
+@item
+@AUCTeX{} underlines the argument of macros which produce underlined text
+in the final product with @code{font-latex-underline-face}.  The
+corresponding keyword class is called @code{underline-command}.
+@ifset rawfile
+See the section for fontification of macros
+@end ifset
+@ifclear rawfile
+@xref{Fontification of macros}
+@end ifclear
+if you dislike this feature and wish to deactivate it.
+
+@item
+Support for the Sioyek document viewer is added.
+
 @item
 @AUCTeX{} now requires GNU Emacs 25.1 or higher.
 
@@ -62,6 +77,26 @@ Replace it with @code{(require 'tex)}.
 Replace it with @code{(require 'latex)}.
 @end enumerate
 
+@item
+When you edit a document divided into multiple files, auto parsed
+information for all sub files are saved under @file{auto} subdirectory at
+master directory when @code{TeX-parse-self} and @code{TeX-auto-save}
+options are enabled.  Now you can have support @file{.el} file saved under
+@file{auto} subdirectory of each directory of the sub file when the sub
+files aren't located at the master directory.
+
+To achieve that, set new user option @code{TeX-auto-save-aggregate} to
+@code{nil}.
+
+@item
+There was another hook where former dynamic free variables could be used.
+The usage was invalidated at version 13.1, by introduction of lexical
+binding over @AUCTeX{}.
+
+The functions in @code{TeX-region-hook} could access the free variables
+@code{master-buffer} and @code{orig-buffer}.  Those are now named
+@code{TeX-region-master-buffer} and @code{TeX-region-orig-buffer},
+respectively.
 @end itemize
 
 @heading News in 13.1
@@ -1111,8 +1146,10 @@ inserted by typing @key{"}.
 Completion support for options of some @LaTeX{} packages was added.
 
 @item
+@ifclear rawfile
 @cindex @file{auctex.el}
 @cindex @file{tex-site.el}
+@end ifclear
 Already in version 11.81 the way to activate @AUCTeX{} changed
 substantially.  This should now be done with @code{(load "auctex.el" nil
 t t)} instead of the former @code{(require 'tex-site)}.  Related to this
diff --git a/doc/preview-problems.texi b/doc/preview-problems.texi
index e40ff42d..0f1518bf 100644
--- a/doc/preview-problems.texi
+++ b/doc/preview-problems.texi
@@ -20,6 +20,7 @@ newer versions of the problematic software or by simple 
patches.
 * x-symbol interoperation::     
 * Middle-clicks paste instead of toggling::  
 * No images are displayed with gs 9.27 and earlier::
+* Black texts are too hard to read on dark background::
 @end menu
 
 If you find something not mentioned here, please send a bug report using
@@ -194,3 +195,12 @@ well.
 The default value used to be @code{compatible} for short period before
 Ghostscript 9.50 was released but now is @code{t}.
 @end defopt
+
+@node Black texts are too hard to read on dark background
+@section Black texts are too hard to read on dark background
+Unfortunately, foreground color adjustment discussed in the previous node
+doesn't work for Xe@LaTeX{} for technical reason.  The texts are always
+rendered as black in the preview images, so it's almost impossible to read
+them on dark background.  Hence Xe@LaTeX{} users who like dark background
+in Emacs frame should customize @code{preview-pdf-adjust-color-method} to
+@code{nil}.
diff --git a/doc/todo.texi b/doc/todo.texi
index 218231d0..6819ce17 100644
--- a/doc/todo.texi
+++ b/doc/todo.texi
@@ -73,17 +73,52 @@ buffer-local variables.
 As of @AUCTeX{} 12.3, @code{TeX-remove-style} is no longer used by any
 other codes.
 
+@item Factor out syntax propertization from @file{font-latex.el}
+
+Syntax propertization is implemented in @file{font-latex.el}.  This means
+that features which depend on syntax parse don't work well for
+@file{tex-font.el} users and those who disable font lock.
+
+Hence syntax propertization should be factored out from
+@file{font-latex.el} and implemented as a major mode facility.
+
+(Texinfo mode is an exception because it already has its own syntax
+propertize function, which just copies the one available in Emacs built-in
+texinfo mode.)
+
+@item Add documentation
+
+Following entries should be included in the document:
+@itemize @minus
 @item
-Document @code{LaTeX-insert-into-commments},
-@code{TeX-translate-location-hook}, and usage of @ConTeXt{} mode.
+Variables @code{LaTeX-insert-into-comments}, @code{TeX-translate-location-hook}
+
+@item
+How to use @code{TeX-auto-add-type}, as well as functions and variables
+generated by that macro.
+@ifclear rawfile
+They should be covered in the node @ref{Hacking the Parser}.
+@end ifclear
+
+@item
+Usage of @ConTeXt{} mode
+@end itemize
+
 @end itemize
 
 @node Wishlist
 @section Wishlist
 
 @itemize @bullet
-@item
-Simplify tool bar implementation.  The library @file{toolbar-x.el} was
+@item Enable syntactic font lock for verbatim constructs in @samp{docTeX}
+mode
+
+In @samp{docTeX} mode buffer, @samp{%} sign at the line beginning hinders
+syntactic font lock of verbatim constructs.  This should be improved.
+
+@item Simplify tool bar implementation
+
+The library @file{toolbar-x.el} was
 developed as an abstraction layer to absorb difference between XEmacs
 and @acronym{GNU} Emacs.  Now that XEmacs is no longer supported, the
 library, together with @file{tex-bar.el} as a whole, can be much
diff --git a/doc/wininstall.texi b/doc/wininstall.texi
index 230f8e22..1c812d4d 100644
--- a/doc/wininstall.texi
+++ b/doc/wininstall.texi
@@ -47,8 +47,10 @@ containing the programs to the @env{PATH} environment 
variable if
 necessary.  Here is how to do that in W2000/XP:
 
 @enumerate
+@ifclear rawfile
 @cindex Adding to @env{PATH} in Windows
 @cindex @env{PATH} in Windows
+@end ifclear
 @item
 On the desktop, right click ``My Computer'' and select properties.
 @item
@@ -303,7 +305,9 @@ in either a site-wide @file{site-start.el} or your personal 
startup file
 (usually accessible as @file{~/.emacs} or @file{~/.emacs.d/init.el} from
 within Emacs).
 
+@ifclear rawfile
 @cindex @file{tex-mik.el}
+@end ifclear
 The default configuration of @AUCTeX{} is probably not the best fit for
 Windows systems with MiK@TeX{}.  You might want to add
 @lisp
diff --git a/font-latex.el b/font-latex.el
index c49a6987..52c0fca1 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -77,7 +77,7 @@ quotes.
 
 If `font-latex-quotes' specifies a different state, order of the
 added quotes will be reversed for fontification.  For example if
-'(\"\\\"<\" \"\\\">\" french) is given but `font-latex-quotes'
+\\='(\"\\\"<\" \"\\\">\" french) is given but `font-latex-quotes'
 specifies `german', quotes will be used like \">foo\"< for
 fontification.")
 
@@ -362,9 +362,10 @@ variable `font-latex-fontify-sectioning'." ',num)
       ("qbezier" "[(((") ("raisebox" "{[[{")
       ("addvspace" "{") ("vspace" "*{") ("hspace" "*{")
       ("addcontentsline" "{{{") ("addtocontents" "{{")
-      ("labelformat" "{{")
+      ("labelformat" "{{") ("linespread" "{")
       ("AddToHook" "{[{") ("RemoveFromHook" "{[") ("AddToHookNext" "{{")
       ("ProvidesClass" "{[") ("ProvidesPackage" "{[") ("ProvidesFile" "{[")
+      ("NewMarkClass" "{")
       ;; XXX: Should macros without arguments rather be listed in a
       ;; separate category with 'noarg instead of 'command handling?
       ("enspace" "") ("enskip" "") ("quad" "") ("qquad" "") ("nonumber" "")
@@ -373,9 +374,11 @@ variable `font-latex-fontify-sectioning'." ',num)
       ("thicklines" "") ("thinlines" "")
       ("noindent" "") ("hline" "") ("ldots" "")
       ("centering" "") ("raggedright" "") ("raggedleft" "")
+      ("raggedbottom" "") ("flushbottom" "")
       ("TeX" "") ("LaTeX" "") ("LaTeXe" "")
       ("normalfont" "") ("normalshape" "")
-      ("tableofcontents" "") ("listoffigures" "") ("listoftables" ""))
+      ("tableofcontents" "") ("listoffigures" "") ("listoftables" "")
+      ("maketitle" ""))
      font-lock-function-name-face 2 command)
     ("sectioning-0"
      (("part" "*[{"))
@@ -428,6 +431,9 @@ variable `font-latex-fontify-sectioning'." ',num)
     ("italic-command"
      (("emph" "{") ("textit" "{") ("textsl" "{") ("mathit" "{"))
      font-latex-italic-face 1 command)
+    ("underline-command"
+     (("underline" "{"))
+     font-latex-underline-face 1 command)
     ("math-command"
      (("ensuremath" "|{\\"))
      font-latex-math-face 1 command)
@@ -478,9 +484,9 @@ Valid entries are \"warning\", \"variable\", 
\"biblatexnoarg\",
 \"biblatex\", \"reference\", \"function\" , \"sectioning-0\",
 \"sectioning-1\", \"sectioning-2\", \"sectioning-3\",
 \"sectioning-4\", \"sectioning-5\", \"slide-title\", \"textual\",
-\"bold-command\", \"italic-command\", \"math-command\",
-\"type-command\", \"bold-declaration\", \"italic-declaration\",
-\"type-declaration\".
+\"bold-command\", \"italic-command\", \"underline-command\",
+\"math-command\", \"type-command\", \"bold-declaration\",
+\"italic-declaration\", \"type-declaration\".
 
 You have to restart Emacs for a change of this variable to take effect."
   :group 'font-latex-keywords
@@ -642,10 +648,10 @@ Generated by `font-latex-make-built-in-keywords'."))
       ;; defvar font-latex-match-*
       ;; We make this variable buffer local later, but don't use
       ;; `defvar-local' here because it shouldn't have nil as its
-      ;; default value.  Its true default value is set by
-      ;; through font-latex-match-*-make in :set specification of
-      ;; defcustom of font-latex-match-*-keywords below.  It's
-      ;; only after that this variable can be buffer local.
+      ;; default value.  Its true default value is set through
+      ;; font-latex-match-*-make in :set specification of defcustom of
+      ;; font-latex-match-*-keywords below.  It's only after that this
+      ;; variable can be buffer local.
       (push `(defvar ,(intern (concat prefix name)) nil
                ,(concat "Regular expression to match " name
                         " keywords.
@@ -910,8 +916,8 @@ symbols `warning', `variable', `reference', `biblatexnoarg',
 `biblatex', `function', `sectioning-0', `sectioning-1',
 `sectioning-2', `sectioning-3', `sectioning-4', `sectioning-5',
 `slide-title', `textual', `bold-command', `italic-command',
-`math-command', `type-command', `bold-declaration',
-`italic-declaration' or `type-declaration'.
+`underline-command', `math-command', `type-command',
+`bold-declaration', `italic-declaration' or `type-declaration'.
 
 The keywords will be added to the buffer-local list of keywords
 of the respective keyword class and necessary updates of the font
@@ -1140,6 +1146,20 @@ have changed."
   "Face used to highlight text to be typeset in italic."
   :group 'font-latex-highlighting-faces)
 
+(defface font-latex-underline-face
+  (let ((font '(:inherit underline)))
+    `((((class grayscale) (background light))
+       (:foreground "DimGray" ,@font))
+      (((class grayscale) (background dark))
+       (:foreground "LightGray" ,@font))
+      (((class color) (background light))
+       (:foreground "DarkOliveGreen" ,@font))
+      (((class color) (background dark))
+       (:foreground "OliveDrab" ,@font))
+      (t (,@font))))
+  "Face used to highlight text to be underlined."
+  :group 'font-latex-highlighting-faces)
+
 (defface font-latex-math-face
   (let ((font '(:inherit underline)))
     `((((class grayscale) (background light))
@@ -1347,7 +1367,7 @@ then call `font-latex-set-syntactic-keywords'.")))
 
 (defvar font-latex--updated-region-end nil
 ;; During font lock operation, matched range sometimes exceeds the
-;; given end limit. So record the actual end in this variable to
+;; given end limit.  So record the actual end in this variable to
 ;; notify the font lock machinery.
 ;; Match functions should do the following two if the end of the
 ;; actual match goes beyond the limit:
@@ -1364,11 +1384,8 @@ then call `font-latex-set-syntactic-keywords'.")))
 Take care when the actually fonfified region was extended beyond END."
   (setq font-latex--updated-region-end end)
   (let ((res (font-lock-default-fontify-region beg end verbose)))
-    ;; COMPATIBILITY for older emacsen. Return value for jit-lock
-    ;; is meaningful for only newer emacsen.
-    (if (eq (car-safe res) 'jit-lock-bounds)
-        `(jit-lock-bounds ,(cadr res) .
-                          ,(max (cddr res) font-latex--updated-region-end)))))
+    `(jit-lock-bounds ,(cadr res) .
+                      ,(max (cddr res) font-latex--updated-region-end))))
 
 ;; Copy and adaption of `tex-font-lock-unfontify-region' from
 ;; tex-mode.el in GNU Emacs on 2004-08-04.
@@ -1419,6 +1436,8 @@ ignored during the search."
         ;; XXX: Do not look up syntax-table properties since they may
         ;; be misleading, e.g. in the case of "{foo}^^A" where the
         ;; closing brace gets a comment end syntax.
+        ;; (2022 Mar) The latter half of the above paragraph no longer
+        ;; applies since we changed the way to fontify ^^A comment.
         (parse-sexp-lookup-properties nil))
     (or
      (condition-case nil
@@ -1785,6 +1804,7 @@ Used for patterns like:
                 ;; If the closing tag is beyond the current end of
                 ;; region, take care of it.
                 (when (< font-latex--updated-region-end p)
+                  ;; FIXME: Why?  Should this use `font-lock-flush'?
                   (font-lock-unfontify-region font-latex--updated-region-end p)
                   (setq font-latex--updated-region-end p))
                 (store-match-data (list beg beg beg p)))
@@ -1864,6 +1884,7 @@ The \\begin{equation} incl. arguments in the same line and
                              (+ limit font-latex-multiline-boundary) 'move)
           (progn
             (setq end (match-beginning 0))
+            ;; FIXME: Duplicate of code in `font-latex-match-math-env'.
             (if (< font-latex--updated-region-end limit)
                 (setq font-latex--updated-region-end limit))
             (when (< font-latex--updated-region-end end)
@@ -1873,8 +1894,8 @@ The \\begin{equation} incl. arguments in the same line and
         (setq end beg
               beg-of-begin beg))
       ;; Store the position of "\begin{foo}" as (match-beginnig 0) so
-      ;; that `font-lock-multiline' text property covers it. This keeps
-      ;; editing inside multi-line optional argument sane.
+      ;; that `font-lock-multiline' text property covers it.  This
+      ;; keeps editing inside multi-line optional argument sane.
       (store-match-data (list beg-of-begin end beg end))
       t)))
 
@@ -1900,6 +1921,7 @@ The \\begin{equation} incl. arguments in the same line and
                 (progn
                   (forward-char num)
                   (let ((p (point)))
+                    ;; FIXME: Duplicate of code in `font-latex-match-math-env'.
                     (if (< font-latex--updated-region-end limit)
                         (setq font-latex--updated-region-end limit))
                     (when (< font-latex--updated-region-end p)
@@ -1964,11 +1986,11 @@ Take into account $...$, $$...$$, \\(...\\) and 
\\=\\[...\\], too."
   ;; Check if `font-lock-beg' is inside math mode.
   (goto-char font-lock-beg)
 
-  ;; Workaround bug#41522. Ensure `syntax-table' property is given to
+  ;; Workaround bug#41522.  Ensure `syntax-table' property is given to
   ;; all verbatim-like constructs up to the position before running
   ;; `texmathp' in order to prevent wrong fontification of verbatim
-  ;; face. This is necessary because `texmathp' calls `up-list' inside
-  ;; narrowing.
+  ;; face.  This is necessary because `texmathp' calls `up-list'
+  ;; inside narrowing.
   (syntax-propertize (point))
 
   ;; XXX: Should we make the `texmathp' search honor
@@ -2063,6 +2085,7 @@ set to `french', and >>german<< (and 8-bit) are used if 
set to `german'."
                   (goto-char after-beg)
                   (store-match-data (list after-beg after-beg beg after-beg)))
               (let ((p (point)))
+                ;; FIXME: Duplicate of code in `font-latex-match-math-env'.
                 (if (< font-latex--updated-region-end limit)
                     (setq font-latex--updated-region-end limit))
                 (when (< font-latex--updated-region-end p)
diff --git a/latex.el b/latex.el
index 7ec66cd9..9bd2b6ac 100644
--- a/latex.el
+++ b/latex.el
@@ -52,7 +52,6 @@
 
 ;; Silence the compiler for variables:
 (defvar outline-heading-alist)
-(defvar TeX-auto-file)
 (defvar LaTeX-section-list-changed)
 
 ;;; Syntax
@@ -376,7 +375,7 @@ If so, return the second element, otherwise return nil."
 (defun LaTeX-outline-name ()
   "Guess a name for the current header line."
   (save-excursion
-    (if (re-search-forward "{\\([^\}]*\\)}" (+ (point) fill-column 10) t)
+    (if (re-search-forward "{\\([^}]*\\)}" (+ (point) fill-column 10) t)
         (match-string 1)
       (buffer-substring (point) (min (point-max) (+ 20 (point)))))))
 
@@ -858,7 +857,7 @@ position just before \\begin and the position just before
 \\end.")
 
 (defun LaTeX-modify-environment (environment)
-  "Modify current ENVIRONMENT."
+  "Modify current environment to new ENVIRONMENT."
   (let ((goto-end (lambda ()
                     (LaTeX-find-matching-end)
                     (re-search-backward (concat (regexp-quote TeX-esc)
@@ -1779,18 +1778,18 @@ This is necessary since index entries may contain 
commands and stuff.")
        ("\\\\newenvironment\\*?{\\([^}]+\\)}"
         1 LaTeX-auto-environment)
        (,(concat "\\\\newtheorem{\\(" token "+\\)}") 1 LaTeX-auto-environment)
-       ("\\\\input{\\(\\.*[^#}%\\\\\\.\n\r]+\\)\\(\\.[^#}%\\\\\\.\n\r]+\\)?}"
+       ("\\\\input{\"?\\([^#}%\"\\\n\r]+?\\)\\(?:\\.[^#}%/\"\\.\n\r]+\\)?\"?}"
         1 TeX-auto-file)
-       ("\\\\include{\\(\\.*[^#}%\\\\\\.\n\r]+\\)\\(\\.[^#}%\\\\\\.\n\r]+\\)?}"
+       ("\\\\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%\"#'()={}]*\\)}")
         1 LaTeX-auto-bibitem)
-       ("\\\\bibliography{\\([^#}\\\\\n\r]+\\)}" 1 LaTeX-auto-bibliography)
-       ("\\\\addbibresource\\(?:\\[[^]]+\\]\\)?{\\([^#}\\\\\n\r]+\\)\\..+}"
+       ("\\\\bibliography{\\([^#}\\\n\r]+\\)}" 1 LaTeX-auto-bibliography)
+       ("\\\\addbibresource\\(?:\\[[^]]+\\]\\)?{\\([^#}\\\n\r]+\\)\\..+}"
         1 LaTeX-auto-bibliography)
-       
("\\\\add\\(?:global\\|section\\)bib\\(?:\\[[^]]+\\]\\)?{\\([^#}\\\\\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)))
    LaTeX-auto-class-regexp-list
@@ -2142,10 +2141,7 @@ confirmation before proceeding."
                   (assoc label (LaTeX-label-list)))
              (ding)
              (when (y-or-n-p
-                    ;; Emacs 24 compatibility
-                    (if (fboundp 'format-message)
-                        (format-message "Label `%s' exists. Use anyway? " 
label)
-                      (format "Label `%s' exists. Use anyway? " label)))
+                    (format-message "Label `%s' exists. Use anyway? " label))
                (setq valid t)))
             (t
              (setq valid t))))
@@ -2904,7 +2900,7 @@ The compatibility argument OPTIONAL and IGNORE are 
ignored."
 If OPTIONAL, indicate optional argument in minibuffer.  PROMPT is
 a string replacing the default one when asking the user for text.
 This function is intended for \\verb like macros which take their
-argument in delimiters like \"\| \|\" or braces \"\{ \}\"."
+argument in delimiters like \"| |\" or braces \"{ }\"."
   (let ((del (read-quoted-char
               (concat "Delimiter (default "
                       (char-to-string LaTeX-default-verb-delimiter) "): "))))
@@ -3239,9 +3235,9 @@ returning an alist.  Use PROMPT as the prompt string."
          ((and (listp key-val-alist)
                (symbolp (car key-val-alist))
                (fboundp (car key-val-alist)))
-          (let ((head (car key-val-alist))
-                (tail (cdr key-val-alist)))
-            (apply head tail)))
+          (if (> (length key-val-alist) 1)
+              (eval key-val-alist t)
+            (funcall (car key-val-alist))))
          (t
           key-val-alist))))
 
@@ -3251,10 +3247,141 @@ Insert the given value as a TeX macro argument.  If 
OPTIONAL is
 non-nil, insert it as an optional argument.  KEY-VAL-ALIST is an
 alist.  The car of each element should be a string representing a
 key and the optional cdr should be a list with strings to be used
-as values for the key.  Use PROMPT as the prompt string."
+as values for the key.  KEY-VAL-ALIST can be a symbol or a
+function call returning an alist.  Use PROMPT as the prompt
+string."
   (let ((options (TeX-read-key-val optional key-val-alist prompt)))
     (TeX-argument-insert options optional)))
 
+(defun TeX-read-completing-read (optional collection &optional prompt complete
+                                          predicate require-match
+                                          initial-input hist def
+                                          inherit-input-method)
+  "Read a string in the minibuffer, with completion and return it.
+If OPTIONAL is non-nil, indicate it in the prompt.
+
+COLLECTION provides elements for completion and is passed to
+`completing-read'.  It can be:
+  - A List or an alist
+  - A symbol returning a list
+  - A function call
+
+PROMPT replaces the standard one where \\=' (cr): \\=' is appended to
+it.  If you want the full control over the prompt, set COMPLETE
+to non-nil and then provide a full PROMPT.
+
+PREDICATE, REQUIRE-MATCH, INITIAL-INPUT, HIST, DEF and
+INHERIT-INPUT-METHOD are passed to `completing-read', which see."
+  (completing-read
+   (TeX-argument-prompt optional
+                        (cond ((and prompt (not complete))
+                               (concat prompt " (cr)"))
+                              ((and prompt complete)
+                               prompt)
+                              (t nil))
+                        "Option (cr)"
+                        complete)
+   (cond ((and (symbolp collection)
+               (boundp collection))
+          (symbol-value collection))
+         ((and (listp collection)
+               (symbolp (car collection))
+               (fboundp (car collection)))
+          (if (> (length collection) 1)
+              (eval collection t)
+            (funcall (car collection))))
+         (t collection))
+   predicate require-match initial-input hist def inherit-input-method))
+
+(defun TeX-arg-completing-read (optional collection &optional prompt complete
+                                         prefix leftbrace rightbrace
+                                         predicate require-match
+                                         initial-input hist def
+                                         inherit-input-method)
+  "Read a string in the minibuffer, with completion and insert it.
+If OPTIONAL is non-nil, indicate it in the minibuffer and insert
+the result in brackets if not empty.  The brackets used are
+controlled by the string values of LEFTBRACE and RIGHTBRACE.
+
+For PROMPT and COMPLETE, refer to `TeX-read-completing-read'.
+For PREFIX, see `TeX-argument-insert'.
+PREDICATE, REQUIRE-MATCH, INITIAL-INPUT, HIST, DEF and
+INHERIT-INPUT-METHOD are passed to `completing-read', which see."
+  (let ((TeX-arg-opening-brace (or leftbrace TeX-arg-opening-brace))
+        (TeX-arg-closing-brace (or rightbrace TeX-arg-closing-brace)))
+    (TeX-argument-insert
+     (TeX-read-completing-read optional collection prompt complete
+                               predicate require-match initial-input
+                               hist def inherit-input-method)
+     optional prefix)))
+
+(defun TeX-read-completing-read-multiple (optional table &optional prompt 
complete
+                                                   predicate require-match
+                                                   initial-input hist def
+                                                   inherit-input-method)
+  "Read multiple strings in the minibuffer, with completion and return them.
+If OPTIONAL is non-nil, indicate it in the prompt.
+
+COLLECTION provides elements for completion and is passed to
+`completing-read'.  It can be:
+  - A List or an alist
+  - A symbol returning a list
+  - A function call
+
+PROMPT replaces the standard one where \\=' (crm): \\=' is appended to
+it.  If you want the full control over the prompt, set COMPLETE
+to non-nil and then provide a full PROMPT.
+
+PREDICATE, REQUIRE-MATCH, INITIAL-INPUT, HIST, DEF and
+INHERIT-INPUT-METHOD are passed to
+`TeX-completing-read-multiple', which see."
+  (TeX-completing-read-multiple
+   (TeX-argument-prompt optional
+                        (cond ((and prompt (not complete))
+                               (concat prompt " (crm)"))
+                              ((and prompt complete)
+                               prompt)
+                              (t nil))
+                        "Options (crm)"
+                        complete)
+   (cond ((and (symbolp table)
+               (boundp table))
+          (symbol-value table))
+         ((and (listp table)
+               (symbolp (car table))
+               (fboundp (car table)))
+          (if (> (length table) 1)
+              (eval table t)
+            (funcall (car table))))
+         (t table))
+   predicate require-match initial-input hist def inherit-input-method))
+
+(defun TeX-arg-completing-read-multiple (optional table &optional prompt 
complete
+                                                  prefix leftbrace rightbrace
+                                                  predicate require-match
+                                                  initial-input hist def
+                                                  inherit-input-method)
+  "Read multiple strings in the minibuffer, with completion and insert them.
+If OPTIONAL is non-nil, indicate it in the minibuffer and insert
+the result in brackets if not empty.  The brackets used are
+controlled by the string values of LEFTBRACE and RIGHTBRACE.
+
+For PROMPT and COMPLETE, refer to `TeX-read-completing-read-multiple'.
+For PREFIX, see `TeX-argument-insert'.
+PREDICATE, REQUIRE-MATCH, INITIAL-INPUT, HIST, DEF and
+INHERIT-INPUT-METHOD are passed to
+`TeX-completing-read-multiple', which see."
+  (let ((TeX-arg-opening-brace (or leftbrace TeX-arg-opening-brace))
+        (TeX-arg-closing-brace (or rightbrace TeX-arg-closing-brace)))
+    (TeX-argument-insert
+     (mapconcat #'identity
+                (TeX-read-completing-read-multiple optional table prompt
+                                                   complete predicate
+                                                   require-match initial-input
+                                                   hist def 
inherit-input-method)
+                ",")
+     optional prefix)))
+
 (defun TeX-read-hook ()
   "Read a LaTeX hook and return it as a string."
   (let* ((hook (completing-read
@@ -3271,7 +3398,9 @@ as values for the key.  Use PROMPT as the prompt string."
                   ;; From ltshipout-doc.pdf
                   "shipout"
                   ;; From ltpara-doc.pdf
-                  "para")))
+                  "para"
+                  ;; From ltmarks-doc.pdf
+                  "insertmark")))
          (place (lambda (&optional opt pr)
                   (completing-read
                    (TeX-argument-prompt opt pr "Where")
@@ -3588,8 +3717,9 @@ non-parenthetical delimiters, like \\verb+foo+, are 
recognized."
   "Return non-nil if position POS is in a verbatim-like construct."
   (when pos (goto-char pos))
   (save-match-data
-    (or (when (fboundp 'font-latex-faces-present-p)
-          (font-latex-faces-present-p 'font-latex-verbatim-face))
+    (or (progn
+          (syntax-propertize (point))
+          (nth 3 (syntax-ppss)))
         (member (LaTeX-current-verbatim-macro)
                 (LaTeX-verbatim-macros-with-delims))
         (member (TeX-current-macro) (LaTeX-verbatim-macros-with-braces))
@@ -3784,7 +3914,10 @@ value."
      4 t)
     (,(concat (regexp-quote TeX-esc)
               "\\(begin\\|end\\)[ \t]*{\\(macro\\|environment\\)\\*?}")
-     0 nil))
+     0 nil)
+    (,(concat (regexp-quote TeX-esc)
+              "\\(begin\\|end\\)[ \t]*{verbatim\\*?}")
+     0 t))
   "List of items which should have a fixed inner indentation.
 The items consist of three parts.  The first is a regular
 expression which should match the respective string.  The second
@@ -3805,10 +3938,10 @@ should add their macros to this variable and then run
 (defvar-local LaTeX-indent-begin-exceptions-list nil
   "List of macros which shouldn't increase the indentation.
 Each item in this list is a string without a backslash and will
-mostly start with 'if'.  These macros should not increase
-indentation although they start with 'if', for example the
-'ifthenelse' macro provided by the ifthen package.  AUCTeX styles
-should add their macros to this variable and then run
+mostly start with \"if\".  These macros should not increase
+indentation although they start with \"if\", for example the
+\"ifthenelse\" macro provided by the ifthen package.  AUCTeX
+styles should add their macros to this variable and then run
 `LaTeX-indent-commands-regexp-make'.")
 
 (defvar-local LaTeX-indent-mid-list nil
@@ -3916,13 +4049,18 @@ Lines starting with an item is given an extra 
indentation of
                  (concat (match-string 0) (TeX-comment-padding-string))))))
     (save-excursion
       (cond ((and fill-prefix
-                  (TeX-in-line-comment)
-                  (eq major-mode 'doctex-mode))
+                  (eq major-mode 'doctex-mode)
+                  (TeX-in-line-comment))
              ;; If point is in a line comment in `doctex-mode' we only
-             ;; consider the inner indentation.
-             (let ((inner-indent (LaTeX-indent-calculate 'inner)))
-               (when (/= (LaTeX-current-indentation 'inner) inner-indent)
-                 (LaTeX-indent-inner-do inner-indent))))
+             ;; consider the inner indentation.  An exception is when
+             ;; we're inside a verbatim environment where we don't
+             ;; want to touch the indentation, notably with a
+             ;; fill-prefix "% ":
+             (unless (member (LaTeX-current-environment)
+                             (LaTeX-verbatim-environments))
+               (let ((inner-indent (LaTeX-indent-calculate 'inner)))
+                 (when (/= (LaTeX-current-indentation 'inner) inner-indent)
+                   (LaTeX-indent-inner-do inner-indent)))))
             ((and fill-prefix
                   LaTeX-syntactic-comments)
              ;; In any other case of a comment we have to consider
@@ -3931,16 +4069,16 @@ Lines starting with an item is given an extra 
indentation of
              (let ((inner-indent (LaTeX-indent-calculate 'inner))
                    (outer-indent (LaTeX-indent-calculate 'outer)))
                (when (/= (LaTeX-current-indentation 'inner) inner-indent)
-                   (LaTeX-indent-inner-do inner-indent))
+                 (LaTeX-indent-inner-do inner-indent))
                (when (/= (LaTeX-current-indentation 'outer) outer-indent)
-                   (LaTeX-indent-outer-do outer-indent))))
+                 (LaTeX-indent-outer-do outer-indent))))
             (t
              ;; The default is to adapt whitespace before any
              ;; non-whitespace character, i.e. to do outer
              ;; indentation.
              (let ((outer-indent (LaTeX-indent-calculate 'outer)))
                (when (/= (LaTeX-current-indentation 'outer) outer-indent)
-                   (LaTeX-indent-outer-do outer-indent))))))
+                 (LaTeX-indent-outer-do outer-indent))))))
     (when (< (current-column) (save-excursion
                                 (LaTeX-back-to-indentation) (current-column)))
       (LaTeX-back-to-indentation))))
@@ -4627,7 +4765,8 @@ space does not end a sentence, so don't break a line 
there."
       fill-prefix)))
 
 (defun LaTeX-fill-move-to-break-point (linebeg)
-  "Move to the position where the line should be broken."
+  "Move to the position where the line should be broken.
+See `fill-move-to-break-point' for the meaning of LINEBEG."
   (fill-move-to-break-point linebeg)
   ;; Prevent line break between 2-byte char and 1-byte char.
   (when (and (or (and (not (looking-at LaTeX-nospace-between-char-regexp))
@@ -4652,40 +4791,6 @@ space does not end a sentence, so don't break a line 
there."
                                       (1- (- (point) linebeg)))
              (not (TeX-escaped-p (match-beginning 0))))
     (goto-char (match-beginning 0)))
-  ;; Cater for \verb|...| (and similar) contructs which should not be
-  ;; broken. (FIXME: Make it work with shortvrb.sty (also loaded by
-  ;; doc.sty) where |...| is allowed.  Arbitrary delimiters may be
-  ;; chosen with \MakeShortVerb{<char>}.)  This could probably be
-  ;; handled with `fill-nobreak-predicate', but this is not available
-  ;; in XEmacs.
-  (let ((final-breakpoint (point))
-        (verb-macros (regexp-opt (append (LaTeX-verbatim-macros-with-delims)
-                                         
(LaTeX-verbatim-macros-with-braces)))))
-    (save-excursion
-      ;; Look for the start of a verbatim macro in the current line.
-      (when (re-search-backward (concat (regexp-quote TeX-esc)
-                                        "\\(?:" verb-macros 
"\\)\\([^a-z@*]\\)")
-                                (line-beginning-position) t)
-        ;; Determine start and end of verbatim macro.
-        (let ((beg (point))
-              (end (if (not (string-match "[ [{]" (match-string 1)))
-                       (cdr (LaTeX-verbatim-macro-boundaries))
-                     (TeX-find-macro-end))))
-          ;; Determine if macro end is behind fill column.
-          (when (and end
-                     (> (- end (line-beginning-position))
-                        (current-fill-column))
-                     (> end final-breakpoint))
-            ;; Search backwards for place to break before the macro.
-            (goto-char beg)
-            (skip-chars-backward "^ \n")
-            ;; Determine if point ended up at the beginning of the line.
-            (when (save-excursion (skip-chars-backward " \t%") (bolp))
-              ;; Search forward for a place to break after the macro.
-              (goto-char end)
-              (skip-chars-forward "^ \n" (point-max)))
-            (setq final-breakpoint (point))))))
-    (goto-char final-breakpoint))
   (when LaTeX-fill-break-at-separators
     (let ((orig-breakpoint (point))
           (final-breakpoint (point))
@@ -6056,7 +6161,7 @@ single stroke or a string (for example \"o a\") for a 
multi-stroke
 binding.  If KEY is nil, the symbol has no associated
 keystroke (it is available in the menu, though).  Note that
 predefined keys in `LaTeX-math-default' cannot be overridden in
-this variable.  Currently, only the lowercase letter 'o' is free
+this variable.  Currently, only the lowercase letter \\='o\\=' is free
 for user customization, more options are available in uppercase
 area.
 
@@ -6667,13 +6772,13 @@ you did something too clever, or AUCTeX something too 
stupid.")
 
     ("Bad \\\\line or \\\\vector argument.*" .
      "The first argument of a \\line or \\vector command, which specifies the
-slope, is illegal\.")
+slope, is illegal.")
 
     ("Bad math environment delimiter.*" .
      "TeX has found either a math-mode-starting command such as \\[ or \\(
 when it is already in math mode, or else a math-mode-ending command
 such as \\) or \\] while in LR or paragraph mode.  The problem is caused
-by either unmatched math mode delimiters or unbalanced braces\.")
+by either unmatched math mode delimiters or unbalanced braces.")
 
     ("Bad use of \\\\\\\\.*" .
      "A \\\\ command appears between paragraphs, where it makes no sense. This
@@ -7260,6 +7365,10 @@ function would return non-nil and `(match-string 1)' 
would return
   (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
   (set (make-local-variable 'fill-paragraph-function) #'LaTeX-fill-paragraph)
   (set (make-local-variable 'adaptive-fill-mode) nil)
+  ;; Cater for \verb|...| (and similar) contructs which should not be
+  ;; broken.
+  (add-to-list (make-local-variable 'fill-nobreak-predicate)
+               #'LaTeX-verbatim-p t)
 
   (or LaTeX-largest-level
       (setq LaTeX-largest-level (LaTeX-section-level "section")))
@@ -7780,6 +7889,8 @@ function would return non-nil and `(match-string 1)' 
would return
      ;; User level reset macros:
      '("normalfont" -1) '("normalshape" -1)
 
+     '("linespread" "Factor")
+
      ;; LaTeX hook macros:
      '("AddToHook"      TeX-arg-hook [ "Label" ] t)
      '("RemoveFromHook" TeX-arg-hook [ "Label" ])
@@ -7810,7 +7921,47 @@ function would return non-nil and `(match-string 1)' 
would return
                      (TeX-argument-prompt t nil "Format")
                      '("\\arabic" "\\roman" "\\Roman" "\\alph" "\\Alph")]
        (TeX-arg-counter)
-       (TeX-arg-counter "Within counter"))))
+       (TeX-arg-counter "Within counter"))
+
+     ;; Added in LaTeX 2022-06-01
+     '("NewMarkClass" "Class")
+     '("InsertMark" "Class" t)
+     '("TopMark"
+       [TeX-arg-completing-read ("page"         "previous-page"
+                                 "column"       "previous-column"
+                                 "first-column" "last-column")
+                                "Region"]
+       (TeX-arg-completing-read ("2e-left" "2e-right" "2e-right-nonempty")
+                                "Class"))
+     '("FirstMark"
+       [TeX-arg-completing-read ("page"         "previous-page"
+                                 "column"       "previous-column"
+                                 "first-column" "last-column")
+                                "Region"]
+       (TeX-arg-completing-read ("2e-left" "2e-right" "2e-right-nonempty")
+                                "Class"))
+     '("LastMark"
+       [TeX-arg-completing-read ("page"         "previous-page"
+                                 "column"       "previous-column"
+                                 "first-column" "last-column")
+                                "Region"]
+       (TeX-arg-completing-read ("2e-left" "2e-right" "2e-right-nonempty")
+                                "Class"))
+     '("IfMarksEqualTF"
+       [TeX-arg-completing-read ("page"         "previous-page"
+                                 "column"       "previous-column"
+                                 "first-column" "last-column")
+                                "Region"]
+       (TeX-arg-completing-read ("2e-left" "2e-right" "2e-right-nonempty")
+                                "Class")
+       (TeX-arg-completing-read ("top" "first" "last")
+                                "Position 1")
+       (TeX-arg-completing-read ("top" "first" "last")
+                                "Position 2")
+       2)
+     '("fpeval" t)
+     '("dimeval" t)
+     '("skipeval" t) ))
 
   (TeX-run-style-hooks "LATEX")
 
diff --git a/preview.el.in b/preview.el.in
index 96c57066..5c327956 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -1622,7 +1622,7 @@ numbers (can be float if available)."
 
 (defface preview-reference-face '((t nil))
   "Face consulted for colors and scale of active previews.
-Fallback to :inherit and 'default implemented."
+Fallback to :inherit and \\='default implemented."
   :group 'preview-appearance)
 
 (defcustom preview-auto-reveal
@@ -1707,13 +1707,13 @@ to the default background in most other cases."
   "Width of transparent border for previews in pt.
 Setting this to a numeric value will add a border of
 `preview-transparent-color' around images, and will turn
-the heuristic-mask setting of images to default to 't since
+the heuristic-mask setting of images to default to t since
 then the borders are correctly detected even in case of
 palette operations.  If the transparent color is something
 not present otherwise in the image, the cursor display
 will affect just this border.  A width of 0 is interpreted
 by PostScript as meaning a single pixel, other widths are
-interpreted as PostScript points (1/72 of 1in)"
+interpreted as PostScript points (1/72 of 1in)."
   :group 'preview-appearance
   :type '(choice (const :value nil :tag "No border")
                  (number :value 1.5 :tag "Border width in pt")))
@@ -1945,7 +1945,7 @@ definition of OV, AFTER-CHANGE, BEG, END and LENGTH."
 (defun preview-toggle (ov &optional arg event)
   "Toggle visibility of preview overlay OV.
 ARG can be one of the following: t displays the overlay,
-nil displays the underlying text, and 'toggle toggles.
+nil displays the underlying text, and `toggle' toggles.
 If EVENT is given, it indicates the window where the event
 occured, either by being a mouse event or by directly being
 the window in question.  This may be used for cursor restoration
@@ -3636,7 +3636,7 @@ name(\\([^)]+\\))\\)\\|\
              (mm-dims (cdr (assoc 'mm-size monitor-attrs)))
              (mm-width (nth 0 mm-dims))
              (mm-height (nth 1 mm-dims))
-             (pixel-dims (cdddr (assoc 'geometry monitor-attrs)))
+             (pixel-dims (cl-cdddr (assoc 'geometry monitor-attrs)))
              (pixel-width (nth 0 pixel-dims))
              (pixel-height (nth 1 pixel-dims)))
         (cons (/ (* 25.4 pixel-width) mm-width)
@@ -3979,8 +3979,28 @@ If FORMAT-CONS is non-nil, a previous format may get 
reused."
           (preview-cache-preamble-off format-cons)
         (setq format-cons (list format-name))
         (push format-cons preview-dumped-alist))
-      ;; mylatex.ltx expects a file name to follow.  Bad. `.tex'
-      ;; in the tools bundle is an empty file.
+      ;; mylatex.ltx expects a file name to follow.  Bad.
+      ;; The file `.tex' in the tools bundle is solely emitting
+      ;; `File ignored', and `\input mylatex.ltx \relax' has the
+      ;; same effect as `\input mylatex.ltx .tex '.
+      ;; The \dump hacks accomplish, among others:
+      ;; - let TeX not ignore spaces (despite instructions to the
+      ;;   contrary inserted into the format by mylatex.ltx)
+      ;;   as we may need to input a `file name with spaces'.
+      ;; - work around the fact that the backslash `\' (as per
+      ;;   mylatex.ltx mandate) has lost its standard TeX status
+      ;;   once the format is loaded, and we could not use `\input'
+      ;;   as in e.g. `pdflatex &abc '\input' abc.tex'.  We
+      ;;   configure TeX for `/' as substitute.
+      ;; - in place of such `/input', we will use `/AUCTEXINPUT'
+      ;;   defined here in the dumped format to grab the file name,
+      ;;   sanitize it via `\detokenize', then
+      ;;   reset TeX to ignore spaces and execute `\input' which
+      ;;   will skip the preamble already dumped.
+      ;; Prior to the patch adding `/AUCTEXINPUT', resetting the
+      ;; spaces to be ignored was included as part of `\everyjob',
+      ;; which was another way to delay this to after the filename
+      ;; was seen by TeX.
       (write-region "\\let\\PREVIEWdump\\dump\\def\\dump{%
 \\edef\\next{{\\ifx\\pdfoutput\\undefined\\else\
 \\pdfoutput=\\the\\pdfoutput\\relax\\fi\
diff --git a/style/amsaddr.el b/style/amsaddr.el
new file mode 100644
index 00000000..e5203653
--- /dev/null
+++ b/style/amsaddr.el
@@ -0,0 +1,37 @@
+;;; amsaddr.el --- AUCTeX style for the (LaTeX) amsaddr package    -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; Author: Uwe Brauer <oub@mat.ucm.es>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2022-09-04
+;; 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 amsaddr package.
+
+;;; Code:
+
+(defvar LaTeX-amsaddr-package-options
+  '("foot")
+  "Package options for the amsaddr package.")
+
+;;; amsaddr.el ends here
diff --git a/style/amsart.el b/style/amsart.el
index 7f93f1af..67a587a4 100644
--- a/style/amsart.el
+++ b/style/amsart.el
@@ -1,16 +1,117 @@
 ;;; amsart.el --- Style hook for the AMS-LaTeX article document class.  -*- 
lexical-binding: t; -*-
 
+;; Copyright (C) 1994-2022 Free Software Foundation, Inc.
+
+;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 1994-01-05
+;; 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.
+
 ;;; Code:
 
 (require 'tex)
 (require 'latex)
 
+;; Silence the compiler:
+(declare-function font-latex-add-keywords
+                  "font-latex"
+                  (keywords class))
+(declare-function font-latex-set-syntactic-keywords
+                  "font-latex")
+
+(defvar LaTeX-amsart-class-options
+  '("a4paper" "letterpaper" "landscape" "portrait"
+    "twoside" "oneside" "draft" "final"
+    "8pt" "9pt" "10pt" "11pt" "12pt"
+    "titlepage" "notitlepage" "onecolumn" "twocolumn"
+    "leqno" "reqno" "centertags" "tbtags" "fleqn"
+    "nomath" "noamsfonts" "psamsfonts")
+  "Class options for the amsart class.")
+
 (TeX-add-style-hook
  "amsart"
- (function
-  (lambda ()
-    (TeX-run-style-hooks "amsmath" "amsthm")
-    (LaTeX-add-environments "abstract")))
+ (lambda ()
+
+   ;; Load amsmath.el if the option nomath isn't given:
+   (unless (LaTeX-provided-class-options-member "amsart" "nomath")
+     (TeX-run-style-hooks "amsmath"))
+   ;; Same for amsfonts.el:
+   (unless (LaTeX-provided-class-options-member "amsart" "noamsfonts")
+     (TeX-run-style-hooks "amsfonts"))
+   ;; amsthm is built-in:
+   (TeX-run-style-hooks "amsthm")
+
+   (TeX-add-symbols
+    '("address" 1)
+    '("author" ["Short author(s)"] (LaTeX-arg-author "Long author(s)"))
+    '("curraddr" 1)
+    '("dedicatory" 1)
+    '("email" 1)
+    '("keywords" 1)
+    '("subjclass" ["Year"] "List of subjects")
+    '("title" ["Short Title"] "Title")
+    '("urladdr" 1))
+
+   (LaTeX-add-environments "abstract")
+
+   (LaTeX-largest-level-set "section")
+   (LaTeX-add-counters "part" "section" "subsection" "subsubsection"
+                       "paragraph" "subparagraph"
+                       "figure" "table")
+   (LaTeX-add-pagestyles "headings" "myheadings")
+
+   ;; Tell AUCTeX about \specialsection:
+   (LaTeX-section-list-add-locally '("specialsection" 2))
+   (LaTeX-paragraph-commands-add-locally "specialsection")
+   (add-to-list (make-local-variable 'LaTeX-section-label)
+                '("specialsection" . "sec:")
+                t)
+
+   ;; Tell RefTeX about \specialsection and append the entry to
+   ;; `reftex-section-levels':
+   (when (boundp 'reftex-section-levels)
+     (add-to-list (make-local-variable 'reftex-section-levels)
+                  '("specialsection" . 2)
+                  t))
+
+   ;; These macros will contain links etc., so treat the argument
+   ;; verbatim:
+   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "email")
+   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "urladdr")
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("author"      "[{")
+                                ("contrib"     "[{")
+                                ("curraddr"    "{")
+                                ("dedicatory"  "{")
+                                ("keywords"    "{")
+                                ("subjclass"   "[{")
+                                ("title"       "[{")
+                                ("email"       "")
+                                ("urladdr"     ""))
+                              'textual)
+     (font-latex-add-keywords '(("specialsection" "{"))
+                              'sectioning-2)
+     (font-latex-set-syntactic-keywords)))
  TeX-dialect)
 
 ;;; amsart.el ends here.
diff --git a/style/array.el b/style/array.el
index be7baf36..b564e055 100644
--- a/style/array.el
+++ b/style/array.el
@@ -1,6 +1,6 @@
 ;;; array.el --- AUCTeX style for `array.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2013-2021  Free Software Foundation, Inc.
+;; Copyright (C) 2013-2022  Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -56,16 +56,11 @@ package.")
     (LaTeX-array-update-column-letters)))
 
 (defun LaTeX-array-update-column-letters ()
-  "Update and uniquify the value of `LaTeX-array-column-letters'
-and make it buffer local. "
+  "Update and uniquify the local value of `LaTeX-array-column-letters'."
   (set (make-local-variable 'LaTeX-array-column-letters)
-       (mapconcat #'identity
-                  (TeX-delete-duplicate-strings
-                   (split-string
-                    (concat LaTeX-array-column-letters
-                            (mapconcat #'car (LaTeX-array-newcolumntype-list) 
""))
-                    "" t))
-                  "")))
+       (let* ((newtypes (mapconcat #'car (LaTeX-array-newcolumntype-list) ""))
+              (alltypes (concat LaTeX-array-column-letters newtypes)))
+         (seq-concatenate 'string (seq-uniq alltypes #'=)))))
 
 (add-hook 'TeX-auto-prepare-hook #'LaTeX-array-auto-prepare t)
 (add-hook 'TeX-auto-cleanup-hook #'LaTeX-array-auto-cleanup t)
diff --git a/style/catchfilebetweentags.el b/style/catchfilebetweentags.el
new file mode 100644
index 00000000..27c67e23
--- /dev/null
+++ b/style/catchfilebetweentags.el
@@ -0,0 +1,116 @@
+;;; catchfilebetweentags.el --- AUCTeX style for catchfilebetweentags package  
-*- lexical-binding: t; -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; Author: Uwe Brauer <oub@mat.ucm.es>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: Aug 23, 2022
+;; 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 catchfilebetweentags package.
+
+;; Acknowledgements
+;; Arash Esbati <arash@gnu.org> for, basically, a complete rewrite, thanks.
+
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+
+;; Silence the compiler:
+(declare-function font-latex-add-keywords
+                  "font-latex"
+                  (keywords class))
+
+(defvar-local LaTeX-catchfilebetweentags-counter nil
+  "Counter for LaTeX-catchfilebetweentags numbers.")
+
+;; Scanning function, stolen from markdown-mode
+(defun LaTeX-catchfilebetweentags-counter-inc ()
+  "Increment `LaTeX-catchfilebetweentags-counter' and return the new value."
+  (when (null LaTeX-catchfilebetweentags-counter)
+    (setq LaTeX-catchfilebetweentags-counter 0)
+    (save-excursion
+      (goto-char (point-min))
+      (while (re-search-forward (concat "^%<\\*\\([^>]+\\)>$")
+                                (point-max) t)
+        (let ((fn (string-to-number (match-string 1))))
+          (when (> fn LaTeX-catchfilebetweentags-counter)
+            (setq LaTeX-catchfilebetweentags-counter fn))))))
+  (setq LaTeX-catchfilebetweentags-counter
+        (1+ LaTeX-catchfilebetweentags-counter)))
+
+(defun LaTeX-env-catchfilebetweentags (_environment)
+  "Insert a tag-skeleton defined by `LaTeX-catchfilebetweentags'.
+ENVIRONMENT is ignored."
+  (let* ((fn (when LaTeX-catchfilebetweentags-use-numeric-label
+               (LaTeX-catchfilebetweentags-counter-inc)))
+         (tag  (TeX-read-string
+                (if fn (format "Tag (default %s): " fn) "Tag: ")
+                nil nil (when fn (number-to-string fn)))))
+    (unless (bolp)
+      (newline)
+      (delete-horizontal-space))
+    (save-excursion
+      (insert (concat (format "%%<*%s>" tag)
+                      "\n\n"
+                      (format "%%</%s>" tag)))))
+  (forward-line))
+
+(TeX-add-style-hook
+ "catchfilebetweentags"
+ (lambda ()
+   (TeX-add-symbols
+    '("ExecuteMetaData"
+      ;; Act like \include and not like \input:
+      [TeX-arg-input-file "File" t] "Tag")
+    '("ExecuteMetaData*"
+      [TeX-arg-input-file "File" t] "Tag")
+
+    '("CatchFileBetweenTags"
+      TeX-arg-define-macro (TeX-arg-input-file  "File-name" t) "Tag")
+    '("CatchFileBetweenTags*"
+      TeX-arg-define-macro (TeX-arg-input-file  "File-name" t) "Tag")
+
+    '("CatchFileBetweenDelims"
+      TeX-arg-define-macro (TeX-arg-input-file  "File-name" t)
+      "Start delimiter" "Stop delimiter" ["Setup"]))
+
+   (LaTeX-add-environments
+    '("catchfilebetweenfiletags" LaTeX-env-catchfilebetweentags))
+
+   ;; Add `LaTeX-catchfilebetweentags-counter' to
+   ;; `TeX-normal-mode-reset-list' in case the variable gets out of
+   ;; sync:
+   (add-to-list 'TeX-normal-mode-reset-list
+                'LaTeX-catchfilebetweentags-counter)
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("ExecuteMetaData" "*[{")
+                                ("CatchFileBetweenTags"   "*|{\\{{")
+                                ("CatchFileBetweenDelims" "|{\\{{{["))
+                              'function)))
+ TeX-dialect)
+
+;;; catchfilebetweentags.el ends here
diff --git a/style/doc.el b/style/doc.el
index 63c6580c..3ab6c0c7 100644
--- a/style/doc.el
+++ b/style/doc.el
@@ -36,9 +36,6 @@
 (declare-function font-latex-add-keywords
                   "font-latex"
                   (keywords class))
-(declare-function font-latex-add-to-syntax-alist
-                  "font-latex"
-                  (list))
 
 (defun LaTeX-env-doc-no-comment (environment)
   "Insert ENVIRONMENT and make sure there is no commented empty line inside."
diff --git a/style/enumitem.el b/style/enumitem.el
index d8ad0566..62ad17f1 100644
--- a/style/enumitem.el
+++ b/style/enumitem.el
@@ -331,18 +331,20 @@ provided.  OPTIONAL is ignored."
                    sizes))))
       (TeX-argument-insert size t)))
   ;; Second opt. argument:
-  (TeX-argument-insert
-   (mapconcat #'identity
-              (TeX-completing-read-multiple
-               (TeX-argument-prompt t nil "Environment(s), level(s)")
-               (append
-                (when (LaTeX-provided-package-options-member
-                       "enumitem" "includedisplayed")
-                  '("trivlist"))
-                (mapcar #'car (LaTeX-enumitem-newlist-list))
-                '("1" "2" "3" "4")))
-              ",")
-   t)
+  (let ((TeX-arg-opening-brace LaTeX-optop)
+        (TeX-arg-closing-brace LaTeX-optcl))
+    (TeX-argument-insert
+     (mapconcat #'identity
+                (TeX-completing-read-multiple
+                 (TeX-argument-prompt t nil "Environment(s), level(s)")
+                 (append
+                  (when (LaTeX-provided-package-options-member
+                         "enumitem" "includedisplayed")
+                    '("trivlist"))
+                  (mapcar #'car (LaTeX-enumitem-newlist-list))
+                  '("1" "2" "3" "4")))
+                ",")
+     t))
   ;; Mandatory argument:
   (TeX-argument-insert
    (TeX-read-key-val nil (LaTeX-enumitem-key-val-options))
diff --git a/style/fancyvrb.el b/style/fancyvrb.el
index 22e52c26..a9ea0a44 100644
--- a/style/fancyvrb.el
+++ b/style/fancyvrb.el
@@ -1,6 +1,6 @@
-;;; fancyvrb.el --- AUCTeX style for `fancyvrb.sty' version 3.6.  -*- 
lexical-binding: t; -*-
+;;; fancyvrb.el --- AUCTeX style for `fancyvrb.sty' version 4.5.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2013, 2014, 2016-2021 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2014, 2016-2022 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <mose@gnu.org>
@@ -25,7 +25,7 @@
 
 ;;; Commentary:
 
-;; This file adds support for `fancyvrb.sty' version 3.6.
+;; This file adds support for `fancyvrb.sty' version 4.5.
 
 ;; This style has some capabilities to parse user defined macros,
 ;; environments and saved blocks with `SaveVerbatim' environments and
@@ -571,9 +571,15 @@ ENV is the name of current environment as a string."
     ;; Verbatim material in footnotes
     "VerbatimFootnotes"
     ;; Improved verbatim commands
-    '("Verb" [TeX-arg-key-val (LaTeX-fancyvrb-key-val-options)] TeX-arg-verb)
-    ;; \Verb also has a starred version:
-    '("Verb*" [TeX-arg-key-val (LaTeX-fancyvrb-key-val-options)] TeX-arg-verb)
+    '("Verb" [TeX-arg-key-val (LaTeX-fancyvrb-key-val-options)]
+      (TeX-arg-conditional (member "fvextra" (TeX-style-list))
+                           (TeX-arg-verb-delim-or-brace)
+                           (TeX-arg-verb)))
+    ;; \Verb also has a starred version
+    '("Verb*" [TeX-arg-key-val (LaTeX-fancyvrb-key-val-options)]
+      (TeX-arg-conditional (member "fvextra" (TeX-style-list))
+                           (TeX-arg-verb-delim-or-brace)
+                           (TeX-arg-verb)))
     '("DefineShortVerb" (TeX-arg-eval
                          TeX-read-string
                          (TeX-argument-prompt nil nil "Character")
@@ -618,11 +624,18 @@ ENV is the name of current environment as a string."
                       (TeX-argument-prompt nil nil "Save name"))))
            (LaTeX-add-fancyvrb-saveverbs name)
            (format "%s" name))))
-      TeX-arg-verb)
+      (TeX-arg-conditional (member "fvextra" (TeX-style-list))
+                           (TeX-arg-verb-delim-or-brace)
+                           (TeX-arg-verb)))
     '("UseVerb" (TeX-arg-eval
                  completing-read
                  (TeX-argument-prompt nil nil "Saved name")
                  (LaTeX-fancyvrb-saveverb-list)))
+    ;; \UseVerb also has a starred version
+    '("UseVerb*" (TeX-arg-eval
+                  completing-read
+                  (TeX-argument-prompt nil nil "Saved name")
+                  (LaTeX-fancyvrb-saveverb-list)))
     '("UseVerbatim" (TeX-arg-eval completing-read
                                   (TeX-argument-prompt nil nil "Saved name")
                                   (LaTeX-fancyvrb-saveverbatim-list)))
@@ -758,7 +771,7 @@ ENV is the name of current environment as a string."
                               'reference)
      (font-latex-add-keywords '(("Verb" "*[") ; The second argument is 
verbatim.
                                 ("SaveVerb"     "[{")
-                                ("UseVerb"      "{")
+                                ("UseVerb"      "*{")
                                 ("UseVerbatim"  "{")
                                 ("LUseVerbatim" "{")
                                 ("BUseVerbatim" "{"))
diff --git a/style/fvextra.el b/style/fvextra.el
index 31092169..3bb11e81 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; -*-
 
-;; Copyright (C) 2017--2021 Free Software Foundation, Inc.
+;; Copyright (C) 2017--2022 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -34,14 +34,12 @@
 (require 'tex)
 (require 'latex)
 
-;; Needed for compiling `cl-pushnew':
-(eval-when-compile
-  (require 'cl-lib))
-
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                   "font-latex"
                   (keywords class))
+(declare-function font-latex-set-syntactic-keywords
+                  "font-latex")
 
 (declare-function LaTeX-color-definecolor-list "color" ())
 (declare-function LaTeX-xcolor-definecolor-list "xcolor" ())
@@ -138,11 +136,12 @@
     "FancyVerbBreakBeforeBreak"
     "FancyVerbBreakAfterBreak")
 
-   ;; Add \EscVerb*? to `LaTeX-verbatim-macros-with-braces-local':
-   (add-to-list 'LaTeX-verbatim-macros-with-braces-local
-                "EscVerb" t)
-   (add-to-list 'LaTeX-verbatim-macros-with-braces-local
-                "EscVerb*" t)
+   ;; Add \Verb*? and \EscVerb*? to
+   ;; `LaTeX-verbatim-macros-with-braces-local':
+   (let ((macs '("Verb" "Verb*"
+                 "EscVerb" "EscVerb*")))
+     (dolist (mac macs)
+       (add-to-list 'LaTeX-verbatim-macros-with-braces-local mac t)))
 
    ;; Fontification
    (when (and (fboundp 'font-latex-add-keywords)
@@ -150,7 +149,8 @@
      (font-latex-add-keywords '(("fvinlineset" "{"))
                               'function)
      (font-latex-add-keywords '(("EscVerb"     "*["))
-                              'textual)))
+                              'textual)
+     (font-latex-set-syntactic-keywords)))
  TeX-dialect)
 
 (defvar LaTeX-fvextra-package-options nil
diff --git a/style/graphicx.el b/style/graphicx.el
index 0e1e2200..5704ecf1 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--2021 by Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2004, 2005, 2014--2022 by Free Software Foundation, Inc.
 
 ;; Author: Ryuichi Arafune <arafune@debian.org>
 ;; Created: 1999/3/20
@@ -89,8 +89,8 @@ Temporarily remove \"space\" from `crm-local-completion-map' 
and
 `minibuffer-local-completion-map' in order to be able to insert
 spaces conveniently.
 
-If `TeX-engine' is set to symbol 'default (while
-`TeX-PDF-from-DVI' is set to nil) or 'luatex and `TeX-PDF-mode'
+If `TeX-engine' is set to symbol `default' (while
+`TeX-PDF-from-DVI' is set to nil) or `luatex' and `TeX-PDF-mode'
 is non-nil, add the keys \"page\" and \"pagebox\" to list of
 key-val's."
   (let ((crm-local-completion-map
diff --git a/style/hyperref.el b/style/hyperref.el
index 81a0533c..c225359b 100644
--- a/style/hyperref.el
+++ b/style/hyperref.el
@@ -1,6 +1,6 @@
 ;;; hyperref.el --- AUCTeX style for `hyperref.sty' v6.83m  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2008, 2013-2021 Free Software Foundation, Inc.
+;; Copyright (C) 2008, 2013-2022 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -42,7 +42,7 @@
                   "font-latex")
 
 (defvar LaTeX-hyperref-package-options-list
-  '(;; See https://www.tug.org/applications/hyperref/manual.html#x1-40003
+  '(;; See 
https://mirrors.ctan.org/macros/latex/contrib/hyperref/doc/hyperref-doc.html#x1-110005
     ;; General options
     ("draft" ("true" "false"))
     ("final" ("true" "false"))
@@ -164,8 +164,7 @@
     ("nextactionraw"))
   "Key=value options for href macro of the hyperref package.")
 
-;; See 
https://www.tug.org/applications/hyperref/ftp/doc/manual.html#x1-220006.2
-
+;; See 
https://mirrors.ctan.org/macros/latex/contrib/hyperref/doc/hyperref-doc.html#x1-600009.2
 (defvar LaTeX-hyperref-forms-options
   '(("accesskey")
     ("align"          ("0" "1" "2"))
@@ -173,16 +172,12 @@
     ("backgroundcolor")
     ("bordercolor")
     ("bordersep")
-    ("borderwidth")
-    ;; "borderstyle" is not mentioned in the original hyperref-doc, it
-    ;; can be seen in action in
-    ;; https://github.com/latex3/hyperref/blob/main/test/testform.tex
-    ;; S=Solid (default), D=Dashed, B=Beveled, I=Inset, U=Underline
     ("borderstyle"    ("S" "D" "B" "I" "U"))
+    ("borderwidth")
     ("calculate")
     ("charsize")
-    ("checkboxsymbol" ("true" "false"))
-    ("checked")
+    ("checkboxsymbol")
+    ("checked"        ("true" "false"))
     ("color")
     ("combo"          ("true" "false"))
     ("default")
@@ -239,7 +234,10 @@
     '("hyperbaseurl" t)
     '("hyperimage" "Image URL" "Text")
     '("hyperdef" "Category" "Name" "Text")
-    '("hyperref" "URL" "Category" "Name" "Text")
+    '("hyperref"
+      (TeX-arg-conditional (y-or-n-p "Insert a label and text? ")
+                           ([TeX-arg-ref] "Text")
+                           ("URL" "Category" "Name" "Text")))
     '("hyperlink" "Name" "Text")
     '("hypertarget" "Name" "Text")
     '("phantomsection" 0)
@@ -273,13 +271,17 @@
     '("MakeCheckField" "Width" "Height")
     '("MakeTextField" "Width" "Height")
     '("MakeChoiceField" "Width" "Height")
-    '("MakeButtonField" "Text"))
+    '("MakeButtonField" "Text")
+    ;; The macro version of the 'Form' environment:
+    '("Form" 0))
 
    ;; Form fields must be inside a "Form"-env, one per file is allowed, cf.
-   ;; https://www.tug.org/applications/hyperref/ftp/doc/manual.html#x1-200006
-   ;; It is up to user to insert [<options>] after \begin{Form}
+   ;; 
https://mirrors.ctan.org/macros/latex/contrib/hyperref/doc/hyperref-doc.html#x1-590009.1
    (LaTeX-add-environments
-    '("Form"))
+    '("Form" LaTeX-env-args [TeX-arg-key-val (("action")
+                                              ("encoding" ("html"))
+                                              ("method"   ("post" "get")))])
+    "NoHyper")
 
    ;; Do not indent the content of the "Form"-env; it is odd if the
    ;; whole document is indented.  Append it to a local version of
@@ -291,13 +293,17 @@
    (add-to-list 'LaTeX-verbatim-macros-with-braces-local "nolinkurl")
    (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperbaseurl")
    (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperimage")
-   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperref")
+   ;; "hyperref" macros is not added here since it takes different
+   ;; number of arguments depending on a given optional argument.
+   ;; The first mandatory argument is not necessarily a verbatim one.
+   ;; (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperref")
    (add-to-list 'LaTeX-verbatim-macros-with-braces-local "href")
 
-   ;; In hyperref package, \url macro is redefined and \url|...| can't be used,
-   ;; while it's possible when only url package (required by hyperref) is 
loaded
+   ;; In hyperref package, \url macro is redefined and \url|...| can't
+   ;; be used, while it's possible when only url package (required by
+   ;; hyperref) is loaded
    (setq LaTeX-verbatim-macros-with-delims-local
-         (remove "url"  LaTeX-verbatim-macros-with-delims-local))
+         (remove "url" LaTeX-verbatim-macros-with-delims-local))
 
    ;; Fontification
    (when (and (featurep 'font-latex)
@@ -307,7 +313,8 @@
                                 ("hyperbaseurl" "{")
                                 ("hyperimage" "{{")
                                 ("hyperdef" "{{{")
-                                ("hyperref" "{{{{")
+                                ;; Fontify only the minimum set of args:
+                                ("hyperref" "[{")
                                 ("hyperlink" "{{")
                                 ("hypertarget" "{{")
                                 ("autoref" "*{")
diff --git a/style/keyval.el b/style/keyval.el
new file mode 100644
index 00000000..f93e86b1
--- /dev/null
+++ b/style/keyval.el
@@ -0,0 +1,58 @@
+;;; keyval.el --- AUCTeX style for `keyval.sty' version 1.15.  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2022-05-29
+;; 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 `keyval.sty' 1.15 from 2014-10-28.
+
+;;; Code:
+
+(require 'tex)
+
+;; Silence the compiler:
+(declare-function font-latex-add-keywords
+                  "font-latex"
+                  (keywords class))
+
+(TeX-add-style-hook
+ "keyval"
+ (lambda ()
+   (TeX-add-symbols
+    '("define@key" "Family" "Key" [ "Default" ] t)
+    '("setkeys" "Family" t))
+
+   ;; Fontification: Don't fontify arguments which contain code
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("define@key" "{{[")
+                                ("setkeys"    "{{"))
+                              'function)))
+ TeX-dialect)
+
+(defvar LaTeX-keyval-package-options nil
+  "Package options for the keyval package.")
+
+;;; keyval.el ends here
diff --git a/style/kvoptions.el b/style/kvoptions.el
new file mode 100644
index 00000000..66595dc2
--- /dev/null
+++ b/style/kvoptions.el
@@ -0,0 +1,113 @@
+;;; kvoptions.el --- AUCTeX style for `kvoptions.sty' version 3.14.  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2022-05-27
+;; 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 `kvoptions.sty' 3.14 from 2020-10-07.
+
+;;; Code:
+
+(require 'tex)
+
+;; Silence the compiler:
+(declare-function font-latex-add-keywords
+                  "font-latex"
+                  (keywords class))
+
+(TeX-add-style-hook
+ "kvoptions"
+ (lambda ()
+
+   ;; kvoptions.sty loads kvsetkeys.sty:
+   (TeX-run-style-hooks "kvsetkeys")
+
+   (TeX-add-symbols
+    ;; 2.1.1 \ProcessKeyvalOptions
+    '("ProcessKeyvalOptions" "Family")
+    '("ProcessKeyvalOptions*" 0)
+
+    '("ProcessLocalKeyvalOptions" "Family")
+    '("ProcessLocalKeyvalOptions*" 0)
+
+    '("SetupKeyvalOptions"
+      (TeX-arg-key-val (("family")
+                        ("prefix")
+                        ("setkeys" ("\\setkeys" "\\kvsetkeys")))))
+
+    ;; 2.2.1 \DeclareStringOption
+    '("DeclareStringOption" ["Initial value"] "Key" ["Default value"])
+
+    ;; 2.2.2 \DeclareBoolOption
+    '("DeclareBoolOption" ["Initial value"] "Key")
+
+    ;; 2.2.3 \DeclareComplementaryOption
+    '("DeclareComplementaryOption" "Key" "Parent")
+
+    ;; 2.2.4 \DeclareVoidOption
+    '("DeclareVoidOption" "Key" t)
+
+    ;; 2.2.5 \DeclareDefaultOption
+    '("DeclareDefaultOption" t)
+
+    ;; 2.2.6 Local options
+    '("DeclareLocalOption" "Option")
+    '("DeclareLocalOptions" "Options")
+
+    ;; 2.2.8 \DisableKeyvalOption
+    '("DisableKeyvalOption"
+      [TeX-arg-key-val (("action" ("undef" "warning" "error" "ignore"))
+                        ("global")
+                        ("local")
+                        ("package")
+                        ("class"))]
+      "Family" "Key")
+
+    ;; 2.2.9 \AddToKeyvalOption
+    '("AddToKeyvalOption"  "Family" "Key" t)
+    '("AddToKeyvalOption*" "Key" t))
+
+   ;; Fontification: Don't fontify arguments which contain code
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("ProcessKeyvalOptions"       "*")
+                                ("ProcessLocalKeyvalOptions"  "*")
+                                ("SetupKeyvalOptions"         "{")
+                                ("DeclareStringOption"        "[{[")
+                                ("DeclareBoolOption"          "[{")
+                                ("DeclareComplementaryOption" "{{")
+                                ("DeclareVoidOption"          "{")
+                                ("DeclareDefaultOption"       "")
+                                ("DeclareLocalOption"         "{")
+                                ("DeclareLocalOptions"        "{")
+                                ("DisableKeyvalOption"        "[{{")
+                                ("AddToKeyvalOption"          "*{"))
+                              'function)))
+ TeX-dialect)
+
+(defvar LaTeX-kvoptions-package-options '("patch" "debugshow")
+  "Package options for the kvoptions package.")
+
+;;; kvoptions.el ends here
diff --git a/style/kvsetkeys.el b/style/kvsetkeys.el
new file mode 100644
index 00000000..4614857e
--- /dev/null
+++ b/style/kvsetkeys.el
@@ -0,0 +1,58 @@
+;;; kvsetkeys.el --- AUCTeX style for `kvsetkeys.sty' version 1.18.  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2022-05-29
+;; 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 `kvsetkeys.sty' 1.18 from 2019-12-15.
+
+;;; Code:
+
+(require 'tex)
+
+;; Silence the compiler:
+(declare-function font-latex-add-keywords
+                  "font-latex"
+                  (keywords class))
+
+(TeX-add-style-hook
+ "kvsetkeys"
+ (lambda ()
+   (TeX-add-symbols
+    '("kvsetkeys" "Family" t)
+    '("kvsetknownkeys" "Family" 2))
+
+   ;; Fontification: Don't fontify arguments which contain code
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("kvsetkeys"      "{{")
+                                ("kvsetknownkeys" "{{{"))
+                              'function)))
+ TeX-dialect)
+
+(defvar LaTeX-kvsetkeys-package-options nil
+  "Package options for the kvsetkeys package.")
+
+;;; kvsetkeys.el ends here
diff --git a/style/l3doc.el b/style/l3doc.el
index e51e83a4..69ae346b 100644
--- a/style/l3doc.el
+++ b/style/l3doc.el
@@ -48,9 +48,9 @@
 
 (defun LaTeX-env-l3doc-function (environment)
   "Insert the ENVIRONMENT provided by l3doc.cls.
-This function should be used for the environments 'function' and
-'variable' provided by the l3doc class.  Also ask the user if a
-'syntax' environment should be added as well."
+This function should be used for the environments \"function\" and
+\"variable\" provided by the l3doc class.  Also ask the user if a
+\"syntax\" environment should be added as well."
   (let* ((time (format-time-string "%Y-%m-%d" (current-time)))
          (exp-flag (TeX-read-key-val t `(("added" (,time))
                                          ("updated" (,time))
@@ -184,10 +184,9 @@ For syntax environment from l3doc class."
     '("parg" "Picture mode argument")
 
     '("file" "File name")
-    '("env" LaTeX-env-args
-      (TeX-arg-eval completing-read
-                    (TeX-argument-prompt nil nil "Environment")
-                    (LaTeX-environment-list)))
+    '("env" (TeX-arg-eval completing-read
+                          (TeX-argument-prompt nil nil "Environment")
+                          (LaTeX-environment-list)))
     '("pkg" "Package name")
     '("cls" "Class name")
 
diff --git a/style/listings.el b/style/listings.el
index cfd49687..43d1c191 100644
--- a/style/listings.el
+++ b/style/listings.el
@@ -1,6 +1,6 @@
 ;;; listings.el --- AUCTeX style for `listings.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2004, 2005, 2009, 2013-2021 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2009, 2013-2022 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -295,7 +295,7 @@
 (defvar LaTeX-listings-lstdefinestyle-regexp
   '("\\\\lstdefinestyle{\\([^}]+\\)}"
     1 LaTeX-auto-listings-lstdefinestyle)
-  "Matches the argument of '\\lstdefinestyle' from 'listings' package.")
+  "Matches the argument of \\='\\lstdefinestyle\\=' from listings package.")
 
 ;; Setup for parsing the labels inside optional arguments:
 
@@ -306,12 +306,12 @@
   "Matches the label inside an optional argument after \\begin{lstlisting}.")
 
 (defun LaTeX-listings-auto-prepare ()
-  "Clear temporary variable from 'listings' package before parsing."
+  "Clear temporary variable from listings package before parsing."
   (setq LaTeX-auto-listings-lstnewenvironment nil)
   (setq LaTeX-auto-listings-lstdefinestyle    nil))
 
 (defun LaTeX-listings-auto-cleanup ()
-  "Process the parsed results of 'listings' package."
+  "Process the parsed results of listings package."
   (dolist (env-args LaTeX-auto-listings-lstnewenvironment)
     (let ((env  (car   env-args))
           (args (cadr  env-args))
@@ -345,6 +345,16 @@
          `((,env ?l "lst:" "~\\ref{%s}"
                  LaTeX-listings-reftex-label-context-function
                  (regexp "[Ll]isting")))))
+      (when (boundp 'reftex-label-regexps)
+        (add-to-list (make-local-variable 'reftex-label-regexps)
+                     (concat (regexp-quote TeX-esc)
+                             "begin[[:space:]]*"
+                             (regexp-quote TeX-grop)
+                             (regexp-quote env)
+                             (regexp-quote TeX-grcl)
+                             "[[:space:]]*"
+                             (LaTeX-extract-key-value-label nil 1))
+                     t))
       ;; Fontification
       (when (and (fboundp 'font-latex-add-keywords)
                  (eq TeX-install-font-lock 'font-latex-setup))
@@ -462,7 +472,8 @@ caption key is found, an error is issued."
      (font-latex-add-keywords '(("lstalias" "{{")
                                 ("lstdefinestyle" "{{")
                                 ("lstset" "{"))
-                              'variable)))
+                              'variable)
+     (font-latex-set-syntactic-keywords)))
  TeX-dialect)
 
 (defvar LaTeX-listings-package-options '("draft" "final" "savemem"
diff --git a/style/longtable.el b/style/longtable.el
index 8db4083c..55384bca 100644
--- a/style/longtable.el
+++ b/style/longtable.el
@@ -88,11 +88,12 @@ insert line break macro."
       (insert TeX-grop caption)
       ;; ask for a label and insert it
       (LaTeX-label environment 'environment)
-      ;; the longtable `\caption' is equivalent to a
-      ;; `\multicolumn', so it needs a `\\' at the
-      ;; end of the line.  Prior to that, add } to
-      ;; close `\caption{'
-      (insert TeX-grcl "\\\\")
+      ;; the longtable `\caption' is equivalent to a `\multicolumn',
+      ;; so it needs a `\\' at the end of the line.  Prior to that,
+      ;; add } to close `\caption{' and a space:
+      (insert TeX-grcl)
+      (just-one-space)
+      (insert "\\\\")
       ;; fill the caption
       (when auto-fill-function (LaTeX-fill-paragraph))
       ;; Insert a new line and indent
diff --git a/style/ltx-base.el b/style/ltx-base.el
index d10a1379..693308a3 100644
--- a/style/ltx-base.el
+++ b/style/ltx-base.el
@@ -123,7 +123,13 @@
     '("addpenalty" "Penalty")
     '("@ifundefined" TeX-arg-macro 2)
     '("@ifnextchar" (TeX-arg-literal " ") (TeX-arg-free "Character") 2)
-    '("expandafter" 0))
+    '("expandafter" 0)
+
+    ;; These macros are currently (June 2022) described in ltkeys.dtx:
+    '("DeclareKeys" ["Family"] t)
+    '("DeclareUnknownKeyHandler" ["Family"] t)
+    '("ProcessKeyOptions" ["Family"])
+    '("SetKeys" ["Family"] t))
 
    ;; Fontification
    (when (and (featurep 'font-latex)
@@ -149,7 +155,12 @@
                                 ("ProcessOptions" "*")
                                 ("ExecuteOptions" "{")
                                 ("DeclareRobustCommand" "*|{\\[[{")
-                                ("CheckCommand"         "*|{\\[[{"))
+                                ("CheckCommand"         "*|{\\[[{")
+
+                                ("DeclareKeys"              "[{")
+                                ("DeclareUnknownKeyHandler" "[{")
+                                ("ProcessKeyOptions"        "[")
+                                ("SetKeys"                  "[{"))
                               'function)))
  TeX-dialect)
 
diff --git a/style/ltxdoc.el b/style/ltxdoc.el
index 16c26e1f..feeb300d 100644
--- a/style/ltxdoc.el
+++ b/style/ltxdoc.el
@@ -87,7 +87,7 @@
   (progn
     (TeX-load-style "article")
     (append (remove "a5paper" LaTeX-article-class-options)
-            '("nocfg")))
+            '("nocfg" "doc2")))
   "Class options for the ltxdoc class.
 All options are passed to article class, \"a5paper\" is disabled
 by ltxdoc.  Therefore it is also removed here.")
diff --git a/style/microtype.el b/style/microtype.el
new file mode 100644
index 00000000..9287ccaa
--- /dev/null
+++ b/style/microtype.el
@@ -0,0 +1,240 @@
+;;; microtype.el --- AUCTeX style for `microtype.sty'  -*- lexical-binding: t; 
-*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2022-06-19
+;; 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 Street, Fifth Floor, Boston,
+;; MA 02110-1301 USA.
+
+;;; Commentary:
+
+;; This file adds support for `microtype.sty' v3.0e form 2022-06-20.
+
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+
+;; Silence the compiler:
+(declare-function font-latex-add-keywords
+                  "font-latex"
+                  (keywords class))
+
+(defvar LaTeX-microtype-key-val-options
+  '(;; 3.1 Enabling the micro-typographic features
+    ("protrusion" ("true" "false" "compatibility" "nocompatibility"
+                   "all"  "alltext" "allmath"
+                   "alltext-nott"   "allmath-nott"
+                   "basictext"      "basicmath"
+                   "smallcaps" "footnotesize" "scriptsize" "normalfont"))
+    ("expansion"  ("true" "false" "compatibility" "nocompatibility"
+                   "all"  "alltext" "allmath"
+                   "alltext-nott"   "allmath-nott"
+                   "basictext"      "basicmath"
+                   "smallcaps" "footnotesize" "scriptsize" "normalfont"))
+    ("activate"   ("true" "false" "compatibility" "nocompatibility"))
+    ("tracking"   ("true" "false"
+                   "all"  "alltext" "allmath"
+                   "alltext-nott"   "allmath-nott"
+                   "basictext"      "basicmath"
+                   "smallcaps" "footnotesize" "scriptsize" "normalfont"))
+    ("kerning"    ("true" "false"
+                   "all"  "alltext" "allmath"
+                   "alltext-nott"   "allmath-nott"
+                   "basictext"      "basicmath"
+                   "smallcaps" "footnotesize" "scriptsize" "normalfont"))
+    ("spacing"    ("true" "false"
+                   "all"  "alltext" "allmath"
+                   "alltext-nott"   "allmath-nott"
+                   "basictext"      "basicmath"
+                   "smallcaps" "footnotesize" "scriptsize" "normalfont"))
+    ;; 3.2 Character protrusion
+    ("factor")
+    ("patch"   ("all" "none" "item" "toc" "footnote" "eqnum"))
+    ("nopatch" ("all" "none" "item" "toc" "footnote" "eqnum"))
+    ("unit")
+    ;; 3.3 Font expansion
+    ("auto" ("true" "false"))
+    ("stretch")
+    ("step")
+    ("selected" ("true" "false"))
+    ;; 3.4 Tracking
+    ("letterspace")
+    ;; 3.5 Miscellaneous options
+    ("disable" ("true" "false" "ifdraft"))
+    ("verbose" ("true" "false" "errors" "silent"))
+    ("babel" ("true" "false"))
+    ;; "config" is allowed only when the package is loaded, so we add
+    ;; it below:
+    ;; ("config")
+    ("DVIoutput" ("true" "false")))
+  "Key=value options for microtype package.")
+
+(TeX-add-style-hook
+ "microtype"
+ (lambda ()
+
+   (TeX-add-symbols
+    '("microtypesetup"
+      (TeX-arg-key-val LaTeX-microtype-key-val-options))
+
+    ;; 4 Selecting fonts for micro-typography
+    '("DeclareMicrotypeSet"
+      [TeX-arg-completing-read-multiple ("protrusion" "expansion"
+                                         "tracking" "kerning" "spacing")
+                                        "Features"]
+      "Set name"
+      (TeX-arg-key-val (("encoding") ("family") ("series")
+                        ("shape")    ("size")   ("font"))))
+
+    '("DeclareMicrotypeSet*"
+      [TeX-arg-completing-read-multiple ("protrusion" "expansion"
+                                         "tracking" "kerning" "spacing")
+                                        "Features"]
+      "Set name"
+      (TeX-arg-key-val (("encoding") ("family") ("series")
+                        ("shape")    ("size")   ("font"))))
+
+    '("UseMicrotypeSet"
+      [TeX-arg-completing-read-multiple ("protrusion" "expansion"
+                                         "tracking" "kerning" "spacing")
+                                        "Features"]
+      "Set name")
+
+    '("DeclareMicrotypeSetDefault"
+      [TeX-arg-completing-read-multiple ("protrusion" "expansion"
+                                         "tracking" "kerning" "spacing")
+                                        "Features"]
+      "Set name")
+
+    ;; 5.1 Character protrusion
+    '("SetProtrusion"
+      [TeX-arg-key-val (("name") ("load") ("factor") ("unit") ("preset")
+                        ("inputenc") ("context"))]
+      2)
+
+    ;; 5.2 Font expansion
+    '("SetExpansion"
+      [TeX-arg-key-val (("name") ("load") ("factor") ("unit") ("preset")
+                        ("inputenc") ("context")
+                        ("auto") ("stretch") ("shrink") ("step"))]
+      2)
+
+    ;; 5.3 Tracking
+    '("SetTracking"
+      [TeX-arg-key-val (("name") ("unit") ("context") ("spacing")
+                        ("outer spacing") ("outer kerning") ("no ligatures"))]
+
+      2)
+
+    ;; 5.4 Additional kerning
+    '("SetExtraKerning"
+      [TeX-arg-key-val (("name") ("load") ("factor") ("preset") ("inputenc")
+                        ("unit") ("context"))]
+      2)
+
+    ;; 5.5 Interword spacing
+    '("SetExtraSpacing"
+      [TeX-arg-key-val (("name") ("load") ("factor") ("preset")
+                        ("inputenc") ("context") ("unit"))]
+      2)
+
+    ;; 5.6 Character inheritance
+    '("DeclareCharacterInheritance"
+      [TeX-arg-key-val (("inputenc"))]
+      2)
+
+    ;; 5.7 Configuration files
+    '("DeclareMicrotypeVariants" t)
+    '("DeclareMicrotypeVariants*" t)
+    '("DeclareMicrotypeAlias" "Font name" "Alias name")
+    '("LoadMicrotypeFile" "Font name")
+
+    ;; 6 Context-sensitive setup
+    '("microtypecontext"
+      (TeX-arg-key-val (("protrusion") ("expansion") ("activate")
+                        ("tracking") ("spacing") ("kerning"))))
+
+    '("textmicrotypecontext"
+      (TeX-arg-key-val (("protrusion") ("expansion") ("activate")
+                        ("tracking") ("spacing") ("kerning")))
+      "Text")
+
+    '("DeclareMicrotypeBabelHook"
+      "Language(s)"
+      (TeX-arg-key-val (("protrusion") ("expansion") ("activate")
+                        ("tracking") ("spacing") ("kerning"))))
+
+    ;; 7 Letterspacing revisited
+    '("textls" ["Amount"] "Text")
+    "lsstyle"
+    '("lslig" "Ligature")
+
+    ;; 8 Disabling ligatures
+    '("DisableLigatures" ["Characters"] t)
+
+    ;; 9 Being pedantic about protrusion
+    '("leftprotrusion" "Text")
+    '("rightprotrusion" "Text")
+    "noprotrusion"
+    "noprotrusionifhmode")
+
+   (LaTeX-add-environments
+    '("microtypecontext" LaTeX-env-args
+      (TeX-arg-key-val (("protrusion") ("expansion") ("activate")
+                        ("tracking") ("spacing") ("kerning")))))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("microtypesetup"      "{")
+                                ("DeclareMicrotypeSet" "*[{{")
+                                ("UseMicrotypeSet"     "[{")
+                                ("DeclareMicrotypeSetDefault"  "[{")
+                                ("SetProtrusion"       "[{{")
+                                ("SetExpansion"        "[{{")
+                                ("SetTracking"         "[{{")
+                                ("SetExtraKerning"     "[{{")
+                                ("SetExtraSpacing"     "[{{")
+                                ("DeclareCharacterInheritance" "[{{")
+                                ("DeclareMicrotypeVariants"    "*{")
+                                ("DeclareMicrotypeAlias"       "{{")
+                                ("LoadMicrotypeFile"   "{")
+                                ("microtypecontext"    "{")
+                                ("DeclareMicrotypeBabelHook"   "{{")
+                                ("DisableLigatures"    "[{"))
+                              'function)
+     (font-latex-add-keywords '(("textmicrotypecontext" "{{")
+                                ("textls"   "*[{"))
+                              'textual)
+     (font-latex-add-keywords '(("textls"   "*[{"))
+                              'type-command)
+     (font-latex-add-keywords '("lsstyle")
+                              'type-declaration)))
+ TeX-dialect)
+
+(defun LaTeX-microtype-package-options ()
+  "Read the microtype package options from the user."
+  (TeX-read-key-val t (append
+                       '((config))
+                       LaTeX-microtype-key-val-options)))
+
+;;; microtype.el ends here
diff --git a/style/parskip.el b/style/parskip.el
new file mode 100644
index 00000000..861d4698
--- /dev/null
+++ b/style/parskip.el
@@ -0,0 +1,50 @@
+;;; parskip.el --- AUCTeX style for `parskip.sty' (v2.0h)  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2022-10-07
+;; 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 `parskip.sty' (v2.0h) from 2021/03/14.
+;; `parskip.sty' is part of TeXLive.  Note that the parskip package
+;; doesn't offer any document user commands and just needs loading
+;; with \usepackage.  Hence this style provides only one function for
+;; key=val query of package options.
+
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+
+(defun LaTeX-parskip-package-options ()
+  "Prompt for package options for the parskip package."
+  (let ((len (mapcar (lambda (x)
+                       (concat TeX-esc (car x)))
+                     (LaTeX-length-list))))
+    (TeX-read-key-val t `(("skip"    ,len)
+                          ("tocskip" ,len)
+                          ("indent"  ,len)
+                          ("parfill" ,len)))))
+
+;;; parskip.el ends here
diff --git a/style/proc.el b/style/proc.el
new file mode 100644
index 00000000..30b86bed
--- /dev/null
+++ b/style/proc.el
@@ -0,0 +1,47 @@
+;;; proc.el --- AUCTeX style for `proc.cls'  -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2022-06-12
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+;; MA 02110-1301 USA.
+
+;;; Commentary:
+
+;; This file adds support for `proc.cls' v1.3m form 2021-12-09.
+
+;;; Code:
+
+(require 'tex)
+
+(defvar LaTeX-proc-class-options
+  '("a4paper" "letterpaper" "legalpaper" "executivepaper"
+    "landscape" "10pt" "11pt" "12pt" "oneside" "twoside" "draft" "final"
+    "notitlepage" "twocolumn" "leqno" "fleqn" "openbib")
+  "Package options for the proc class.")
+
+(TeX-add-style-hook
+ "proc"
+ (lambda ()
+   (TeX-run-style-hooks "article"))
+ TeX-dialect)
+
+;;; proc.el ends here
diff --git a/style/shortvrb.el b/style/shortvrb.el
index 5f8df926..e6de0608 100644
--- a/style/shortvrb.el
+++ b/style/shortvrb.el
@@ -1,6 +1,6 @@
 ;;; shortvrb.el --- AUCTeX style for `shortvrb.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009, 2014, 2018, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009--2022 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -48,11 +48,19 @@
 (declare-function font-latex-add-to-syntax-alist
                   "font-latex"
                   (list))
+(declare-function font-latex-add-keywords
+                  "font-latex"
+                  (keywords class))
 
 (TeX-add-style-hook
  "shortvrb"
  (lambda ()
 
+   (TeX-add-symbols
+    '("MakeShortVerb"   (TeX-arg-string "Character" "\\"))
+    '("MakeShortVerb*"  (TeX-arg-string "Character" "\\"))
+    '("DeleteShortVerb" (TeX-arg-string "Character" "\\")))
+
    ;; Ispell: Add entries to `ispell-tex-skip-alist':
    (when LaTeX-shortvrb-chars
      (TeX-ispell-skip-setcar
@@ -61,13 +69,26 @@
                   (cons str str)))
               LaTeX-shortvrb-chars)))
 
+   ;; Syntax
+   ;; N.B. This doesn't handle backslash just before the closing
+   ;; delimiter like |xyz\| correctly.  We hope we can live with that.
+   (when LaTeX-shortvrb-chars
+     (let ((st (make-syntax-table (syntax-table))))
+       (dolist (c LaTeX-shortvrb-chars)
+         (modify-syntax-entry c "\"" st))
+       (set-syntax-table st)))
+
    ;; Fontification
    (when (and LaTeX-shortvrb-chars
               (featurep 'font-latex)
               (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-to-syntax-alist
-      (mapcar (lambda (char) (cons char "|"))
-              LaTeX-shortvrb-chars))))
+      (mapcar (lambda (char) (cons char "\""))
+              LaTeX-shortvrb-chars))
+
+     (font-latex-add-keywords '(("MakeShortVerb"   "*{")
+                                ("DeleteShortVerb" "{"))
+                              'function)))
  TeX-dialect)
 
 ;;; shortvrb.el ends here
diff --git a/style/sidecap.el b/style/sidecap.el
index ff175173..0cc55b35 100644
--- a/style/sidecap.el
+++ b/style/sidecap.el
@@ -37,7 +37,7 @@
 (defun LaTeX-env-sidecap-float (environment)
   "Create ENVIRONMENT with \\caption and \\label commands.
 This function runs `LaTeX-env-figure' and inserts the first
-optional argument 'relwidth' provided by environments of the
+optional argument \\='relwidth\\=' provided by environments of the
 package sidecap."
   (let ((relwidth (TeX-read-string
                    (TeX-argument-prompt t nil "Relative caption width")))
diff --git a/style/tcolorboxlib-theorems.el b/style/tcolorboxlib-theorems.el
new file mode 100644
index 00000000..20aa710d
--- /dev/null
+++ b/style/tcolorboxlib-theorems.el
@@ -0,0 +1,317 @@
+;;; tcolorboxlib-theorems.el --- AUCTeX style for `theorems' lib from 
tcolorbox  -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2022-08-18
+;; 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 `theorems' library from tcolorbox.sty.
+;; It supports automatic parsing of newly defined environments with
+;; the '\newtcbtheorem' and addition of 'label={prefix:value}' to the
+;; optional arguments of environments.  To do so, users must make some
+;; additions to `LaTeX-label-alist' and `reftex-label-alist' if RefTeX
+;; is used (which is of course highly recommended).  Suppose a new
+;; environment 'Theorem' is defined like this:
+
+;; \newtcbtheorem{Theorem}{Theorem}{%
+;;   many key-values,
+;; }{}
+
+;; Note that the last mandatory argument 'prefix' is left empty.
+;; Suppose you want to use the 'thm' prefix for the labels, the
+;; additions look like this:
+;;
+;; For AUCTeX:
+;; (with-eval-after-load 'latex
+;;   (add-to-list 'LaTeX-label-alist '("Theorem" . "thm") t))
+;;
+;; For AUCTeX and RefTeX:
+;; (with-eval-after-load 'latex
+;;   (add-to-list 'LaTeX-label-alist '("Theorem" . "thm") t))
+;;
+;; (with-eval-after-load 'reftex-vars
+;;   (add-to-list 'reftex-label-alist
+;;                '("Theorem" ?m "thm:" "~\\ref{%s}"
+;;                  LaTeX-tcolorbox-lib-theorems-reftex-label-context-function
+;;                  ("Theorem" "theorem") nil)
+;;                t))
+;;
+;; This file defines the function
+;; `LaTeX-tcolorbox-lib-theorems-reftex-label-context-function' which
+;; extracts the context for RefTeX in Select Label buffer.
+
+;;; Code:
+
+;; Silence the compiler:
+(declare-function font-latex-add-keywords
+                  "font-latex"
+                  (keywords class))
+(declare-function LaTeX-xcolor-definecolor-list "xcolor" ())
+(declare-function LaTeX-tcolorbox-keyval-options "tcolorbox" ())
+(defvar LaTeX-tcolorbox-keyval-options-full)
+
+;; Needed for auto-parsing:
+(require 'tex)
+(require 'latex)
+
+(defvar LaTeX-tcolorbox-lib-theorems-keyval-options
+  '(;; 18.2 Option Keys of the Library
+    ("separator sign")
+    ("separator sign colon")
+    ("separator sign dash")
+    ("separator sign none")
+    ("description delimiters" ("{}{}"))
+    ("description delimiters parenthesis")
+    ("description delimiters none")
+    ("description color")
+    ("description font"
+     ("\\rmfamily" "\\sffamily" "\\ttfamily" "\\mdseries" "\\bfseries"
+      "\\upshape" "\\itshape" "\\slshape" "\\scshape"
+      "\\tiny"  "\\scriptsize" "\\footnotesize"
+      "\\small" "\\normalsize" "\\large"
+      "\\Large" "\\LARGE" "\\huge" "\\Huge" "\\normalfont"))
+    ("description formatter")
+    ("terminator sign")
+    ("terminator sign colon")
+    ("terminator sign dash")
+    ("terminator sign none")
+    ("label separator")
+    ("theorem full label supplement")
+    ("theorem label supplement" ("{}"))
+    ("theorem hanging indent")
+    ("theorem name and number")
+    ("theorem number and name")
+    ("theorem name")
+    ("theorem number")
+    ("theorem" ("{}{}{}{}"))
+    ("highlight math")
+    ("highlight math style" ("{}"))
+    ("math upper")
+    ("math lower")
+    ("math")
+    ("ams equation upper")
+    ("ams equation lower")
+    ("ams equation")
+    ("ams equation* upper")
+    ("ams equation* lower")
+    ("ams equation*")
+    ("ams align upper")
+    ("ams align lower")
+    ("ams align")
+    ("ams align* upper")
+    ("ams align* lower")
+    ("ams align*")
+    ("ams gather upper")
+    ("ams gather lower")
+    ("ams gather")
+    ("ams gather* upper")
+    ("ams gather* lower")
+    ("ams gather*")
+    ("ams nodisplayskip upper")
+    ("ams nodisplayskip lower")
+    ("ams nodisplayskip")
+    ("theorem style" ("standard" "change standard"
+                      "plain" "break" "plain apart"
+                      "change" "change break" "change apart"
+                      "margin" "margin break" "margin apart")))
+  "Key=value options for theorems library from tcolorbox.")
+
+(defun LaTeX-tcolorbox-lib-theorems-keyval-options ()
+  "Return an updated list of key=vals for the theorems library."
+  (append
+   ;; `tcolorbox' loads the style `xcolor.el', so we use
+   ;; `LaTeX-xcolor-definecolor-list' right away:
+   (let ((colors (mapcar #'car (LaTeX-xcolor-definecolor-list)))
+         (colkeys '("description color"))
+         result)
+     (dolist (key colkeys result)
+       (push (list key colors) result)))
+   (let ((lengths (cons "auto" (mapcar (lambda (x)
+                                         (concat TeX-esc (car x)))
+                                       (LaTeX-length-list))))
+         (lenkeys '("theorem hanging indent"))
+         result)
+     (dolist (key lenkeys result)
+       (push (list key lengths) result)))
+   LaTeX-tcolorbox-lib-theorems-keyval-options))
+
+(defun LaTeX-tcolorbox-lib--theorems-keyval-options ()
+  "Return key=vals from theorems library incl. standard ones."
+  (append (LaTeX-tcolorbox-keyval-options)
+          (LaTeX-tcolorbox-lib-theorems-keyval-options)))
+
+;; Setup for \newtcbtheorem:
+(TeX-auto-add-type "tcolorbox-lib-theorems-newtcbtheorem" "LaTeX")
+
+(defvar LaTeX-tcolorbox-lib-theorems-newtcbtheorem-regexp
+  `(,(concat "\\\\newtcbtheorem"
+             "[ \t\n\r%]*"
+             ;; Init options:
+             "\\(?:"
+             (LaTeX-extract-key-value-label 'none)
+             "\\)?"
+             "[ \t\n\r%]*"
+             ;; Name of the environment
+             "{\\([^}]+\\)}")
+    1 LaTeX-auto-tcolorbox-lib-theorems-newtcbtheorem)
+  "Matches the name of new env defined with \\newtcbtheorem macro.")
+
+(defun LaTeX-tcolorbox-lib-theorems-auto-prepare ()
+  "Reset `LaTeX-auto-tcolorbox-lib-theorems-newtcbtheorem' before parsing."
+  (setq LaTeX-auto-tcolorbox-lib-theorems-newtcbtheorem nil))
+
+(defun LaTeX-tcolorbox-lib-theorems-auto-cleanup ()
+  "Process user defined theorems with \\newtcbtheorem."
+  (dolist (elt (LaTeX-tcolorbox-lib-theorems-newtcbtheorem-list))
+    (let ((env (car elt)))
+      ;; Add newly defined env's to AUCTeX:
+      (LaTeX-add-environments
+       `(,env LaTeX-env-tcolorbox-lib-theorems)
+       `(,(concat env "*") LaTeX-env-tcolorbox-lib-theorems))
+      ;; RefTeX: Make `reftex-label-regexps' buffer local and add env
+      ;; to it:
+      (when (boundp 'reftex-label-regexps)
+        (make-local-variable 'reftex-label-regexps)
+        (add-to-list 'reftex-label-regexps
+                     (concat
+                      (regexp-quote TeX-esc)
+                      "begin[[:space:]]*"
+                      (regexp-quote TeX-grop)
+                      (regexp-quote env)
+                      (regexp-quote TeX-grcl)
+                      "[[:space:]]*"
+                      (LaTeX-extract-key-value-label "label" 1))
+                     t)))))
+
+(add-hook 'TeX-auto-prepare-hook
+          #'LaTeX-tcolorbox-lib-theorems-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook
+          #'LaTeX-tcolorbox-lib-theorems-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(defun LaTeX-env-tcolorbox-lib-theorems (environment)
+  "Insert theorems ENVIRONMENT, ask for arguments and insert a label."
+  (LaTeX-insert-environment
+   environment
+   (let ((opts (TeX-read-key-val t 
(LaTeX-tcolorbox-lib--theorems-keyval-options)))
+         (title (TeX-read-string
+                 (TeX-argument-prompt nil nil "Title"))))
+     (concat
+      (when (and opts (not (string= opts "")))
+        (format "[%s]" opts))
+      (concat TeX-grop title TeX-grcl)
+      (unless (string= (substring-no-properties environment -1) "*")
+        (concat TeX-grop TeX-grcl)))))
+  (unless (string= (substring-no-properties environment -1) "*")
+    (LaTeX-env-label-as-keyval nil nil nil environment)))
+
+(defun LaTeX-arg-tcolorbox-lib-theorems-newtcbtheorem (optional)
+  "Query and insert arguments of \\newtcbtheorem macro.
+If OPTIONAL is non-nil, insert the argument in brackets in not
+empty."
+  (let ((env (TeX-read-string
+              (TeX-argument-prompt optional nil "Name")))
+        (disp-name (TeX-read-string
+                    (TeX-argument-prompt optional nil "Display Name")))
+        (opts (TeX-read-key-val optional
+                                
(LaTeX-tcolorbox-lib--theorems-keyval-options))))
+    (LaTeX-add-tcolorbox-lib-theorems-newtcbtheorems env)
+    (LaTeX-tcolorbox-lib-theorems-auto-cleanup)
+    (TeX-argument-insert env optional)
+    (TeX-argument-insert disp-name optional)
+    (TeX-argument-insert opts optional)
+    ;; Our 'prefix' argument is always empty as we insert the 'label'
+    ;; key with a full label value:
+    (insert TeX-grop TeX-grcl)))
+
+(defun LaTeX-tcolorbox-lib-theorems-reftex-label-context-function (env)
+  "Return a context string for RefTeX in ENV."
+  (let* ((envstart (save-excursion
+                     (re-search-backward
+                      (concat (regexp-quote TeX-esc)
+                              "begin[[:space:]]*"
+                              (regexp-quote TeX-grop)
+                              (regexp-quote env)
+                              (regexp-quote TeX-grcl)))))
+         (label-key (save-excursion
+                      (re-search-backward "\\<label[ \t\n\r%]*=[ \t\n\r%]*"
+                                          envstart t))))
+    (if label-key
+        (save-excursion
+          (goto-char label-key)
+          ;; Move out of the optional argument:
+          (up-list)
+          ;; Move until the beginning of the title with {:
+          (skip-chars-forward (concat "^" TeX-grop))
+          ;; Return the title string:
+          (buffer-substring-no-properties (1+ (point))
+                                          (progn
+                                            (forward-list)
+                                            (1- (point)))))
+      (error "No label found"))))
+
+(TeX-add-style-hook
+ "tcolorboxlib-theorems"
+ (lambda ()
+
+   ;; Add the style to the parser
+   (TeX-auto-add-regexp LaTeX-tcolorbox-lib-theorems-newtcbtheorem-regexp)
+
+   ;; Register key-vals from library to `LaTeX-tcolorbox-keyval-options-full':
+   (add-to-list 'LaTeX-tcolorbox-keyval-options-full
+                'LaTeX-tcolorbox-lib-theorems-keyval-options)
+
+   ;; This library loads amsmath:
+   (TeX-run-style-hooks "amsmath")
+
+   (TeX-add-symbols
+    ;; 18.1 Macros of the Library
+    '("newtcbtheorem"
+      [TeX-arg-key-val LaTeX-tcolorbox-init-options]
+      LaTeX-arg-tcolorbox-lib-theorems-newtcbtheorem)
+
+    `("renewtcbtheorem"
+      [TeX-arg-key-val LaTeX-tcolorbox-init-options]
+      (TeX-arg-competing-read (tcolorbox-lib-theorems-newtcbtheorem-list) 
"Name")
+      "Display Name"
+      (TeX-arg-key-val (LaTeX-tcolorbox-lib--theorems-keyval-options))
+      (TeX-arg-literal ,TeX-grop ,TeX-grcl))
+
+    '("tcboxmath"
+      [TeX-arg-key-val (LaTeX-tcolorbox-lib--theorems-keyval-options)]
+      t)
+
+    '("tcbhighmath"
+      [TeX-arg-key-val (LaTeX-tcolorbox-lib--theorems-keyval-options)]
+      t))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("newtcbtheorem"   "[{{{{")
+                                ("renewtcbtheorem" "[{{{{"))
+                              'function)))
+ TeX-dialect)
+
+;;; tcolorboxlib-theorems.el ends here
diff --git a/style/tikz.el b/style/tikz.el
index f3a50bc4..565e6b0a 100644
--- a/style/tikz.el
+++ b/style/tikz.el
@@ -1,6 +1,6 @@
 ;;; tikz.el --- AUCTeX style for `tikz.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2021  Free Software Foundation, Inc.
+;; Copyright (C) 2016-2022  Free Software Foundation, Inc.
 
 ;; Author: Matthew Leach <matthew@mattleach.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -53,8 +53,7 @@
                        `((,(concat "+" key) ,value "+")
                          (,(concat "++" key) ,value "++"))))
                    TeX-TikZ-point-function-map))
-  "`TeX-TikZ-point-function-map' with \"+\" and \"++\" as a
-prefix.")
+  "`TeX-TikZ-point-function-map' with \"+\" and \"++\" as a prefix.")
 
 (defconst TeX-TikZ-path-connector-function-map
   '(("--" identity)
@@ -73,7 +72,7 @@ prefix.")
     ("Arc" TeX-TikZ-arg-arc)
     ("Parabola" TeX-TikZ-arg-parabola)
     ("Grid" TeX-TikZ-arg-grid))
-  "An alist of argument names and functoins for TikZ's \draw.")
+  "An alist of argument names and functions for TikZ's \\draw.")
 
 (defun TeX-TikZ-get-opt-arg-string (arg &optional open close)
   "Return a string for optional arguments.
@@ -199,7 +198,7 @@ is finished."
   "Find TiKZ named points in current enviroment.
 Begin by finding the span of the current TikZ enviroment and then
 searching within that span to find all named-points and return
-them as a list of strings, dropping the '()'."
+them as a list of strings, dropping the \\='()\\='."
   (let* ((env-end (save-excursion
                     (LaTeX-find-matching-end)
                      (point)))
@@ -232,7 +231,7 @@ them as a list of strings, dropping the '()'."
 (defun TeX-TikZ-arg-bend (optional)
   "Prompt the user for a bend argument.
 If OPTIONAL is non-nil and the user doesn't provide a point,
-  return \"\"."
+return \"\"."
   (let ((point
          (TeX-TikZ-single-macro-arg TeX-TikZ-point-function-map
                                     (TeX-argument-prompt optional nil "Bend 
point")
diff --git a/style/ulem.el b/style/ulem.el
index cfb6105e..fa9cefb0 100644
--- a/style/ulem.el
+++ b/style/ulem.el
@@ -69,14 +69,15 @@
      ;; Tell font-lock about the update.
      (font-latex-add-keywords '(("useunder" "{{{"))
                               'function)
+     (font-latex-add-keywords '(("sout" "{")
+                                ("xout" "{"))
+                              'textual)
      (font-latex-add-keywords '(("uline" "{")
                                 ("uuline" "{")
                                 ("uwave" "{")
-                                ("sout" "{")
-                                ("xout" "{")
                                 ("dashuline" "{")
                                 ("dotuline" "{"))
-                              'textual)))
+                              'underline-command)))
  TeX-dialect)
 
 (defvar LaTeX-ulem-fontdecl
diff --git a/style/xltabular.el b/style/xltabular.el
index 3fb3e0d2..bcd190b7 100644
--- a/style/xltabular.el
+++ b/style/xltabular.el
@@ -87,11 +87,12 @@ nested curly brace pair nor escaped \"}\".")
       (insert TeX-grop caption)
       ;; ask for a label and insert it
       (LaTeX-label environment 'environment)
-      ;; the longtable `\caption' is equivalent to a
-      ;; `\multicolumn', so it needs a `\\' at the
-      ;; end of the line.  Prior to that, add } to
-      ;; close `\caption{'
-      (insert TeX-grcl "\\\\")
+      ;; the longtable `\caption' is equivalent to a `\multicolumn',
+      ;; so it needs a `\\' at the end of the line.  Prior to that,
+      ;; add } to close `\caption{' and a space:
+      (insert TeX-grcl)
+      (just-one-space)
+      (insert "\\\\")
       ;; fill the caption
       (when auto-fill-function (LaTeX-fill-paragraph))
       ;; Insert a new line and indent
diff --git a/style/xparse.el b/style/xparse.el
index fd9bb328..397a0c4b 100644
--- a/style/xparse.el
+++ b/style/xparse.el
@@ -1,6 +1,6 @@
-;;; xparse.el --- AUCTeX style for `xparse.sty' version 2020-03-06  -*- 
lexical-binding: t; -*-
+;;; xparse.el --- AUCTeX style for `xparse.sty' version 2022-07-05  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2013, 2020, 2021 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2020--2022 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <mose@gnu.org>
@@ -25,7 +25,7 @@
 
 ;;; Commentary:
 
-;; This file adds basic support for `xparse.sty' version 2020-03-06.
+;; This file adds basic support for `xparse.sty' version 2022-07-05.
 ;; It parses argument specification of macros and environments.
 
 ;; The "yet not more supported" specifiers `l', `u', `g' and `G' are
@@ -118,15 +118,15 @@ TYPE is one of the symbols mac or env."
         (goto-char (point-min))
         (insert (replace-regexp-in-string "[ \t\r\n%]" "" spec))
         (goto-char (point-min))
-        (while (looking-at-p "[+!>bmrRvodODsteE]")
-          (cond (;; + or !: Long argument or space aware: Move over
+        (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
-                 (looking-at-p "[+!b]")
                  (forward-char 1))
-                ((looking-at-p ">")
-                 ;; Argument processors: Move over > and a balanced
-                 ;; {}
+                ;; Argument processors and key-val modifier: Move
+                ;; over [>=] and a balanced {}
+                ((looking-at-p "[>=]")
                  (forward-char 1)
                  (forward-sexp))
                 ;; Mandatory arguments:
@@ -311,6 +311,9 @@ TYPE is one of the symbols mac or env."
     '("IfValueTF" 3)
     '("IfValueT" 2)
     '("IfValueF" 2)
+    '("IfBlankTF" 3)
+    '("IfBlankT" 2)
+    '("IfBlankF" 2)
     "BooleanTrue"
     "BooleanFalse"
     ;; Argument processors
diff --git a/tests/latex/doctex-indent-in.dtx b/tests/latex/doctex-indent-in.dtx
index 4f439588..8d6081ca 100644
--- a/tests/latex/doctex-indent-in.dtx
+++ b/tests/latex/doctex-indent-in.dtx
@@ -33,6 +33,12 @@
 % \DescribeEnv{YOURENV}
 % Put description of |YOURENV| here.
 %
+%\begin{verbatim}
+%              Some
+%verbatim
+%        content
+%\end{verbatim}
+%
 % \StopEventually{\PrintIndex}
 %
 % \section{Implementation}
diff --git a/tests/latex/doctex-indent-out.dtx 
b/tests/latex/doctex-indent-out.dtx
index 2bdcf40c..432d969b 100644
--- a/tests/latex/doctex-indent-out.dtx
+++ b/tests/latex/doctex-indent-out.dtx
@@ -33,6 +33,12 @@
 % \DescribeEnv{YOURENV}
 % Put description of |YOURENV| here.
 %
+%\begin{verbatim}
+%              Some
+%verbatim
+%        content
+%\end{verbatim}
+%
 % \StopEventually{\PrintIndex}
 %
 % \section{Implementation}
diff --git a/tests/latex/latex-filling-in.tex b/tests/latex/latex-filling-in.tex
index 0d97fcf0..16c314f9 100644
--- a/tests/latex/latex-filling-in.tex
+++ b/tests/latex/latex-filling-in.tex
@@ -1,3 +1,7 @@
+\documentclass{article}
+\usepackage{shortvrb}
+\begin{document}
+
 Lorem ipsum dolor sit amet, consectetur adipisci elit, sed eiusmod \(0 = 1\) 
tempor incidunt ut $a^{2} + b^{2} = c^{2}$ labore et dolore magna aliqua.  Ut 
enim ad minim veniam, quis nostrum exercitationem ullam corporis suscipit 
laboriosam, nisi ut aliquid ex ea commodi consequatur.
 
 \begin{tabular}{| l | l | l | l |}
@@ -68,3 +72,18 @@ Mauris ac felis vel velit tristique imperdiet.  Vestibulum 
convallis, lorem a te
 Mauris ac felis vel velit tristique imperdiet.  Vestibulum convallis, lorem a 
 tempus semper, dui dui euismod elit, vitae placerat urna tortor vitae lacus.\\
   Fusce sagittis, libero non molestie mollis, magna orci ultrices dolor, at 
vulputate neque nulla lacinia eros.  Aliquam posuere.  Cum sociis natoque 
penatibus et magnis dis parturient montes, nascetur ridiculus mus.%  
+
+% bug#56160-1 Line break should be suppressed inside \verb|...|.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, \verb|sed do|eiusmod 
tempor
+
+% bug#56160-2 Line break should be suppressed inside shortcuts defined
+% in `LaTeX-shortvrb-chars'.  The variable itself is let-bound to
+% '(?\") in the function `LaTeX-filling' in latex-test.el.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, "sed do"eiusmod tempor
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/tests/latex/latex-filling-out.tex 
b/tests/latex/latex-filling-out.tex
index bf326d16..18dec27c 100644
--- a/tests/latex/latex-filling-out.tex
+++ b/tests/latex/latex-filling-out.tex
@@ -1,3 +1,7 @@
+\documentclass{article}
+\usepackage{shortvrb}
+\begin{document}
+
 Lorem ipsum dolor sit amet, consectetur adipisci elit, sed eiusmod
 \(0 = 1\) tempor incidunt ut $a^{2} + b^{2} = c^{2}$ labore et dolore
 magna aliqua.  Ut enim ad minim veniam, quis nostrum exercitationem
@@ -76,3 +80,20 @@ Fusce sagittis, libero non molestie mollis, magna orci 
ultrices dolor,
 at vulputate neque nulla lacinia eros.  Aliquam posuere.  Cum sociis
 natoque penatibus et magnis dis parturient montes, nascetur ridiculus
 mus.%
+
+% bug#56160-1 Line break should be suppressed inside \verb|...|.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit,
+\verb|sed do|eiusmod tempor
+
+% bug#56160-2 Line break should be suppressed inside shortcuts defined
+% in `LaTeX-shortvrb-chars'.  The variable itself is let-bound to
+% '(?\") in the function `LaTeX-filling' in latex-test.el.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit,
+"sed do"eiusmod tempor
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/tests/latex/latex-test.el b/tests/latex/latex-test.el
index d5f267e4..c82b240f 100644
--- a/tests/latex/latex-test.el
+++ b/tests/latex/latex-test.el
@@ -154,7 +154,11 @@
            (with-temp-buffer
              (insert-file-contents LaTeX-filling/in)
              (LaTeX-mode)
-             (let ((fill-column 70))
+             (let ((fill-column 70)
+                   (LaTeX-shortvrb-chars '(?\"))
+                   (TeX-parse-self t))
+               (TeX-update-style t)
+               (search-forward "Lorem")
                (fill-paragraph)
 
                (let ((cmds '("captionsetup" "caption"
@@ -166,7 +170,7 @@
                      (fill-paragraph))))
 
                (while (search-forward "% bug#" nil t)
-                 (forward-line 1)
+                 (TeX-forward-comment-skip 1)
                  (fill-paragraph)))
              (buffer-string))
            (with-temp-buffer
diff --git a/tex-bar.el b/tex-bar.el
index a9863f88..5c36f24b 100644
--- a/tex-bar.el
+++ b/tex-bar.el
@@ -133,43 +133,43 @@ the argument BUTTON-ALIST in function 
`toolbarx-install-toolbar'."
   :group 'TeX-tool-bar-button-definitions)
 
 (defcustom TeX-bar-TeX-button-alist
-  '((tex :image (lambda nil (if TeX-PDF-mode "pdftex" "tex"))
+  `((tex :image ,(lambda nil (if TeX-PDF-mode "pdftex" "tex"))
          :command (progn
                     (TeX-save-document #'TeX-master-file)
                     (TeX-command "TeX" #'TeX-master-file -1))
-         :help (lambda (&rest ignored)
-                 (TeX-bar-help-from-command-list "TeX")))
+         :help ,(lambda (&rest _ignored)
+                  (TeX-bar-help-from-command-list "TeX")))
     (pdftex :image "pdftex"
             :command (progn
                        (TeX-save-document #'TeX-master-file)
                        (TeX-command "PDFTeX" #'TeX-master-file -1))
-            :help (lambda (&rest ignored)
-                    (TeX-bar-help-from-command-list "PDFTeX")))
+            :help ,(lambda (&rest _ignored)
+                     (TeX-bar-help-from-command-list "PDFTeX")))
     (next-error :image "error"
                 :command TeX-next-error
                 :enable (TeX-error-report-has-errors-p)
                 :visible (TeX-error-report-has-errors-p))
-    (view :image (lambda nil (if TeX-PDF-mode "viewpdf" "viewdvi"))
+    (view :image ,(lambda nil (if TeX-PDF-mode "viewpdf" "viewdvi"))
           :command (TeX-command "View" #'TeX-master-file -1)
-          :help (lambda (&rest ignored)
-                  (TeX-bar-help-from-command-list "View")))
+          :help ,(lambda (&rest _ignored)
+                   (TeX-bar-help-from-command-list "View")))
     (file :image "dvips"
           :command (TeX-command "File" #'TeX-master-file -1)
           :visible (not TeX-PDF-mode)
-          :help (lambda (&rest ignored)
-                  (TeX-bar-help-from-command-list "File")))
+          :help ,(lambda (&rest _ignored)
+                   (TeX-bar-help-from-command-list "File")))
     (bibtex :image "bibtex"
             :command (TeX-command "BibTeX" #'TeX-master-file -1)
-            :help (lambda (&rest ignored)
-                    (TeX-bar-help-from-command-list "BibTeX")))
+            :help ,(lambda (&rest _ignored)
+                     (TeX-bar-help-from-command-list "BibTeX")))
     (clean  :image "delete"
             :command (TeX-command "Clean" #'TeX-master-file -1)
-            :help (lambda (&rest ignored)
-                    (TeX-bar-help-from-command-list "Clean")))
+            :help ,(lambda (&rest _ignored)
+                     (TeX-bar-help-from-command-list "Clean")))
     (spell  :image "spell"
             :command (TeX-command "Spell" #'TeX-master-file -1)
-            :help (lambda (&rest ignored)
-                    (TeX-bar-help-from-command-list "Spell"))))
+            :help ,(lambda (&rest _ignored)
+                     (TeX-bar-help-from-command-list "Spell"))))
   ;; latex-symbols-experimental?
   "Alist for button definitions in TeX bar.
 Value should le a list where each element is of format (KEY .
@@ -202,7 +202,7 @@ format of the argument MEANING-ALIST in the mentioned 
function."
         (insert (format "\n\n`%s' provides the following buttons:\n  " (car 
i)))
         (dolist (j (cdr i))
           (insert (format " %s" j)))
-        (fill-region (point-at-bol) (point-at-eol))))
+        (fill-region (line-beginning-position) (line-end-position))))
     (display-buffer "*TeX tool bar buttons*" t)))
 
 ;;; Installation of the tool bar
@@ -269,48 +269,48 @@ the argument BUTTON-ALIST in function 
`toolbarx-install-toolbar'."
   :group 'TeX-tool-bar-button-definitions)
 
 (defcustom TeX-bar-LaTeX-button-alist
-  '((latex :image (lambda nil (if TeX-PDF-mode "pdftex" "tex"))
+  `((latex :image ,(lambda nil (if TeX-PDF-mode "pdftex" "tex"))
            :command (progn
                       (TeX-save-document #'TeX-master-file)
                       (TeX-command "LaTeX" #'TeX-master-file -1))
-           :help (lambda (&rest ignored)
-                   (TeX-bar-help-from-command-list "LaTeX")))
+           :help ,(lambda (&rest ignored)
+                    (TeX-bar-help-from-command-list "LaTeX")))
     (pdflatex :image "pdftex"
               :command (progn
                          (TeX-save-document #'TeX-master-file)
                          (TeX-command "PDFLaTeX" #'TeX-master-file -1))
-              :help (lambda (&rest ignored)
-                      (TeX-bar-help-from-command-list "PDFLaTeX")))
+              :help ,(lambda (&rest ignored)
+                       (TeX-bar-help-from-command-list "PDFLaTeX")))
     (next-error :image "error"
                 :command TeX-next-error
                 :enable (TeX-error-report-has-errors-p)
                 :visible (TeX-error-report-has-errors-p))
-    (view :image (lambda nil (if TeX-PDF-mode "viewpdf" "viewdvi"))
+    (view :image ,(lambda nil (if TeX-PDF-mode "viewpdf" "viewdvi"))
           :command (TeX-command "View" #'TeX-master-file -1)
-          :help (lambda (&rest ignored)
-                  (TeX-bar-help-from-command-list "View")))
+          :help ,(lambda (&rest ignored)
+                   (TeX-bar-help-from-command-list "View")))
     (file :image "dvips"
           :command (TeX-command "File" #'TeX-master-file -1)
           :visible (not TeX-PDF-mode)
-          :help (lambda (&rest ignored)
-                  (TeX-bar-help-from-command-list "File")))
+          :help ,(lambda (&rest ignored)
+                   (TeX-bar-help-from-command-list "File")))
     (bibtex :image "bibtex"
             :command (TeX-command (if LaTeX-using-Biber "Biber" "BibTeX")
                                   #'TeX-master-file -1)
-            :help (lambda (&rest ignored)
-                    (TeX-bar-help-from-command-list
-                     (if LaTeX-using-Biber "Biber" "BibTeX"))))
+            :help ,(lambda (&rest ignored)
+                     (TeX-bar-help-from-command-list
+                      (if LaTeX-using-Biber "Biber" "BibTeX"))))
     (clean  :image "delete"
             :command (TeX-command "Clean" #'TeX-master-file -1)
-            :help (lambda (&rest ignored)
-                    (TeX-bar-help-from-command-list "Clean")))
+            :help ,(lambda (&rest ignored)
+                     (TeX-bar-help-from-command-list "Clean")))
     (spell  :image "spell"
             :command (TeX-command "Spell" #'TeX-master-file -1)
-            :help (lambda (&rest ignored)
-                    (TeX-bar-help-from-command-list "Spell")))
+            :help ,(lambda (&rest ignored)
+                     (TeX-bar-help-from-command-list "Spell")))
     (latex-symbols-experimental . (:alias :eval-group
-                                          LaTeX-symbols-toolbar-switch-contents
-                                          LaTeX-symbols-toolbar-contents)))
+                                   LaTeX-symbols-toolbar-switch-contents
+                                   LaTeX-symbols-toolbar-contents)))
   "Alist for button definitions in TeX bar.
 Value should le a list where each element is of format (KEY .
 PROPS), where KEY is a symbol that labels the button and PROPS is
@@ -342,7 +342,7 @@ format of the argument MEANING-ALIST in the mentioned 
function."
         (insert (format "\n\n`%s' provides the following buttons:\n  " (car 
i)))
         (dolist (j (cdr i))
           (insert (format " %s" j)))
-        (fill-region (point-at-bol) (point-at-eol))))
+        (fill-region (line-beginning-position) (line-end-position))))
     (display-buffer "*TeX tool bar buttons*" t)))
 
 ;;; Installation of the tool bar
@@ -454,32 +454,35 @@ format of the argument MEANING-ALIST in the mentioned 
function."
                               (cons (cons menu-str (list menu-buttons))
                                     menu-strings-alist-temp)))))))))))
        (list-strings (let* ((list-str-temp))
-                       (dolist (i menu-strings-buttons-alist
-                                  (nreverse list-str-temp))
+                       (dolist (i menu-strings-buttons-alist)
                          (setq list-str-temp (cons (car i)
-                                                   list-str-temp))))))
+                                                   list-str-temp)))
+                       (nreverse list-str-temp))))
+  ;; Will be defined by running LaTeX-install-toolbar.
+  (defvar LaTeX-symbols-active-menuitem)
   (defvar LaTeX-symbols-toolbar-visible-flag nil
     "Non-nil means that the LaTeX symbols on toolbar are visible.
 Internal variable.")
   (defconst LaTeX-symbols-toolbar-switch-contents
     `(;; the on-off switch button
       (latex-symbols-switch
-       :image (lambda nil (if LaTeX-symbols-toolbar-visible-flag
-                              "ltx-symb-turn-off"
-                            "ltx-symb-turn-on"))
+       :image ,(lambda ()
+                 (if LaTeX-symbols-toolbar-visible-flag
+                     "ltx-symb-turn-off"
+                   "ltx-symb-turn-on"))
        :command (progn
                   (setq LaTeX-symbols-toolbar-visible-flag
                         (not LaTeX-symbols-toolbar-visible-flag))
                   (toolbarx-refresh))
        ;; help message depends on if symb-toolbar is on or off, and in
        ;; the name of the current class of symbols
-       :help (lambda (&rest ignore)
-               (concat "Turn "
-                       (if LaTeX-symbols-toolbar-visible-flag "off " "on ")
-                       "the toolbar of LaTeX symbols (current class: "
-                       (nth (1- LaTeX-symbols-active-menuitem)
-                            (quote ,list-strings))
-                       ")")))
+       :help ,(lambda (&rest _ignore)
+                (concat "Turn "
+                        (if LaTeX-symbols-toolbar-visible-flag "off " "on ")
+                        "the toolbar of LaTeX symbols (current class: "
+                        (nth (1- LaTeX-symbols-active-menuitem)
+                             list-strings)
+                        ")")))
       ;; the dropdown button, that also switch on the symbols
       ,(append '(:dropdown-group)
                list-strings
diff --git a/tex-fold.el b/tex-fold.el
index 6d50f314..6f74f75a 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -311,8 +311,8 @@ and `TeX-fold-math-spec-list', and environments in 
`TeX-fold-env-spec-list'."
 
 (defun TeX-fold-region-macro-or-env (start end type)
   "Fold all items of type TYPE in region from START to END.
-TYPE can be one of the symbols 'env for environments, 'macro
-for macros and 'math for math macros."
+TYPE can be one of the symbols `env' for environments, `macro'
+for macros and `math' for math macros."
   (save-excursion
     (let (fold-list item-list regexp)
       (dolist (item (cond ((eq type 'env) TeX-fold-env-spec-list-internal)
diff --git a/tex-info.el b/tex-info.el
index 66e57517..2ee3d7ac 100644
--- a/tex-info.el
+++ b/tex-info.el
@@ -680,7 +680,6 @@ value of `Texinfo-mode-hook'."
        (concat "@\\("
                (mapconcat #'car texinfo-section-list "\\>\\|")
                "\\>\\)"))
-  (set (make-local-variable 'outline-level) 'texinfo-outline-level)
 
   ;; Mostly AUCTeX stuff
   (set (make-local-variable 'TeX-command-current) #'TeX-command-master)
diff --git a/tex-site.el.in b/tex-site.el.in
index e088251e..b9a73bd9 100644
--- a/tex-site.el.in
+++ b/tex-site.el.in
@@ -107,7 +107,12 @@ functions into the respective function cell of the mode."
       (setq elt (car (pop list)))
       (let ((dst (intern (concat "TeX-" (symbol-name elt)))))
         (if (memq elt value)
-            (advice-add elt :override dst)
+            (advice-add elt :override dst
+                        ;; COMPATIBILITY for Emacs 28.[12]
+                        ;; Give it higher precedence than the :around
+                        ;; advice given to `tex-mode' in tex-mode.el.
+                        ;; 
<URL:https://lists.gnu.org/r/auctex-devel/2022-09/msg00050.html>
+                        '((depth . -10)))
           (advice-remove elt dst))))))
 
 (defcustom TeX-modes
diff --git a/tex-style.el b/tex-style.el
index 3ef92d27..b880bfcc 100644
--- a/tex-style.el
+++ b/tex-style.el
@@ -226,6 +226,13 @@ 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
+
+(defcustom LaTeX-catchfilebetweentags-use-numeric-label t
+  "If non-nil, insert automatic numerical labels.
+Otherwise the prompt asks for a label name."
+  :type 'boolean)
+
 ;; style/comment.el
 
 (defcustom LaTeX-comment-env-list '("comment")
diff --git a/tex.el b/tex.el
index 8a80f13f..e9690b9c 100644
--- a/tex.el
+++ b/tex.el
@@ -36,6 +36,9 @@
 (eval-when-compile
   (require 'cl-lib))
 (require 'texmathp)
+;; seq.el is preloaded in Emacs 29, so the next form can be removed
+;; once 29 is the minimum required Emacs version
+(require 'seq)
 ;; Require dbus at compile time to get macro definition of
 ;; `dbus-ignore-errors'.
 (eval-when-compile (require 'dbus))
@@ -51,14 +54,11 @@
                   (bus service path interface method &rest args))
 (declare-function dbus-register-signal "ext:dbus"
                   (bus service path interface signal handler &rest args))
-(declare-function LaTeX-environment-list "latex"
-                  nil)
-(declare-function LaTeX-bibliography-list "latex"
-                  nil)
-(declare-function comint-exec
+(declare-function LaTeX-environment-list "latex" nil)
+(declare-function LaTeX-bibliography-list "latex" nil)
+(declare-function comint-exec "ext:comint"
                   (buffer name command startfile switches))
-(declare-function comint-mode
-                  nil)
+(declare-function comint-mode "ext:comint" nil)
 (declare-function tex--prettify-symbols-compose-p "ext:tex-mode"
                   (start end match))
 (declare-function gnuserv-start "ext:gnuserv"
@@ -100,6 +100,7 @@
 (defvar Info-file-list-for-emacs)       ; info.el
 (defvar ispell-parser)                  ; ispell.el
 (defvar compilation-error-regexp-alist) ; compile.el
+(defvar compilation-in-progress)        ; compile.el
 
 (defgroup TeX-file nil
   "Files used by AUCTeX."
@@ -595,6 +596,7 @@ string."
     ;; adds suitable quotes for use in shell command line.
     ("%s" TeX-active-master-with-quotes nil t)
     ("%t" TeX-active-master-with-quotes t t)
+    ("%(s-filename-only)" TeX-active-master-with-quotes nil t nil nil 
file-name-nondirectory)
     ("%(t-filename-only)" TeX-active-master-with-quotes t t nil nil 
file-name-nondirectory)
     ;; If any TeX codes appear in the interval between %` and %', move
     ;; all of them after the interval and supplement " \input".  The
@@ -639,7 +641,7 @@ string."
                   (concat TeX-command-text " \"\\input\""))
               "")))
     ;; The fourth argument of t directs to supply "\detokenize{}" when
-    ;; necessary. See doc string and comment of
+    ;; necessary.  See doc string and comment of
     ;; `TeX-active-master-with-quotes'.
     ("%T" TeX-active-master-with-quotes t t nil t)
     ("%n" TeX-current-line)
@@ -1086,7 +1088,7 @@ The following built-in predicates are available:
   :type '(alist :key-type symbol :value-type (group sexp)))
 
 ;; XXX: Atril and xreader are forks of Evince and share an almost
-;; identical interface with it. Instead of having different functions
+;; identical interface with it.  Instead of having different functions
 ;; for each program, we keep the original *-evince-* functions and
 ;; make them accept arguments to specify the actual name of the
 ;; program and the desktop environment, that will be used to set up
@@ -1295,7 +1297,15 @@ viewer."
        ("zathura %o"
         (mode-io-correlate
          " --synctex-forward %n:0:\"%b\" -x \"emacsclient +%{line} 
%{input}\""))
-       "zathura"))))
+       "zathura")
+      ("Sioyek"
+       ("sioyek %o"
+        (mode-io-correlate
+         ,(concat
+           " --forward-search-file \"%b\""
+           " --forward-search-line %n"
+           " --inverse-search \"emacsclient +%2 %1\"")))
+       "sioyek"))))
   "Alist of built-in viewer specifications.
 This variable should not be changed by the user who can use
 `TeX-view-program-list' to add new viewers or overwrite the
@@ -1514,7 +1524,7 @@ Check the `TeX-view-program-selection' variable" viewer)))
     (xetex "XeTeX" "xetex" "xelatex" "xetex")
     ;; Some lualatex versions before 0.71 would use "texput" as file
     ;; name if --jobname were not supplied
-    (luatex "LuaTeX" "luatex" "lualatex --jobname=%s" "luatex")
+    (luatex "LuaTeX" "luatex" "lualatex --jobname=%(s-filename-only)" "luatex")
     (omega "Omega" TeX-Omega-command LaTeX-Omega-command ConTeXt-Omega-engine))
   "Alist of built-in TeX engines and associated commands.
 For a description of the format see `TeX-engine-alist'.")
@@ -1725,8 +1735,8 @@ If this is nil, an empty string will be returned."
           (concat TeX-source-specials-tex-flags
                   (if TeX-source-specials-places
                       ;; -src-specials=WHERE: insert source specials
-                      ;; in certain places of the DVI file. WHERE is a
-                      ;; comma-separated value list: cr display hbox
+                      ;; in certain places of the DVI file.  WHERE is
+                      ;; a comma-separated value list: cr display hbox
                       ;; math par parend vbox
                       (concat "=" (mapconcat #'identity
                                              TeX-source-specials-places ","))))
@@ -2736,10 +2746,10 @@ Used when checking if any files have changed."
 
 (define-obsolete-variable-alias 'LaTeX-dialect 'TeX-dialect "13.0")
 (defconst TeX-dialect :latex
-  "Default dialect for use with function `TeX-add-style-hook' for
-argument DIALECT-EXPR when the hook is to be run only on LaTeX
-file, or any mode derived thereof. See variable
-`TeX-style-hook-dialect'." )
+  "Default dialect for use with function `TeX-add-style-hook'.
+This applies to the argument DIALECT-EXPR when the hook is to be
+run only on LaTeX file, or any mode derived thereof.  See
+variable `TeX-style-hook-dialect'." )
 
 (defvar TeX-style-hook-list nil
   "List of TeX style hooks currently loaded.
@@ -2938,8 +2948,9 @@ found in DIALECT-LIST and return the list thereof."
     ret)))
 
 (defun TeX-unload-style (style &optional dialect-list)
-  "Forget that we once loaded STYLE. If DIALECT-LIST is provided
-the STYLE is only removed for those dialects in DIALECT-LIST.
+  "Forget that we once loaded STYLE.
+If DIALECT-LIST is provided, the STYLE is only removed for those
+dialects in DIALECT-LIST.
 
 See variable `TeX-style-hook-dialect' for supported dialects."
   (let ((style-data (assoc-string style TeX-style-hook-list)))
@@ -3330,8 +3341,9 @@ is called with \\[universal-argument]."
                                    'TeX-macro-history TeX-default-macro))))
   (when (called-interactively-p 'any)
     (setq TeX-default-macro symbol))
-  (TeX-parse-macro symbol (cdr-safe (assoc symbol (TeX-symbol-list))))
-  (run-hooks 'TeX-after-insert-macro-hook))
+  (atomic-change-group
+    (TeX-parse-macro symbol (cdr-safe (assoc symbol (TeX-symbol-list))))
+    (run-hooks 'TeX-after-insert-macro-hook)))
 
 (defvar TeX-electric-macro-map
   (let ((map (make-sparse-keymap)))
@@ -3752,12 +3764,20 @@ The algorithm is as follows:
   ;;                           (make-display-table)))
   ;;  (aset buffer-display-table ?\t (apply 'vector (append "<TAB>" nil)))
 
-  ;; Symbol completion.
-  (set (make-local-variable 'TeX-complete-list)
-       (list (list "\\\\\\([a-zA-Z]*\\)"
-                   1 'TeX-symbol-list-filtered
-                   (if TeX-insert-braces "{}"))
-             (list "" TeX-complete-word)))
+  ;; Symbol & length completion.
+  (setq-local TeX-complete-list
+              (list (list "\\\\\\([a-zA-Z]*\\)"
+                          1
+                          (lambda ()
+                            (append (TeX-symbol-list-filtered)
+                                    (when (fboundp 'LaTeX-length-list)
+                                      (LaTeX-length-list))
+                                    (when (fboundp 'LaTeX-counter-list)
+                                      (mapcar (lambda (x)
+                                                `(,(concat "the" (car x))))
+                                              (LaTeX-counter-list)))))
+                          (if TeX-insert-braces "{}"))
+                    (list "" TeX-complete-word)))
 
   (funcall TeX-install-font-lock)
 
@@ -3836,6 +3856,10 @@ The algorithm is as follows:
 (defconst TeX-auto-parser-local 3)
 (defconst TeX-auto-parser-change 4)
 
+(defvar TeX-auto-file nil)
+;; Internal temporal variable.  Don't refer to it in your program
+;; unless you know what you are doing.  Use (TeX-style-list) instead.
+
 (defun TeX-auto-add-information (name entries)
   "For NAME in `TeX-auto-parser' add ENTRIES."
   (let* ((entry (assoc name TeX-auto-parser))
@@ -3954,6 +3978,17 @@ Generated by `TeX-auto-add-type'.")
   :group 'TeX-parse
   :type 'boolean)
 
+(defcustom TeX-auto-save-aggregate t
+  "When non-nil, save parsed information in one directory.
+Each style file of automatically parsed information is saved in
+\"auto\" subdirectory of master file.
+
+When nil, saves in each \"auto\" subdirectory.
+
+Subdirectory name is actually taken from `TeX-auto-local'."
+  :group 'TeX-parse
+  :type 'boolean)
+
 (defun TeX-auto-write ()
   "Save all relevant TeX information from the current buffer."
   (if TeX-auto-untabify
@@ -3964,7 +3999,9 @@ Generated by `TeX-auto-add-type'.")
                      (file-name-as-directory TeX-auto-local)
                      (TeX-strip-extension nil TeX-all-extensions t)
                      ".el")
-                    (TeX-master-directory)))
+                    (if TeX-auto-save-aggregate
+                        (TeX-master-directory)
+                      default-directory)))
              (dir (file-name-directory file)))
         ;; Create auto directory if possible.
         (if (not (file-exists-p dir))
@@ -4222,7 +4259,7 @@ alter the numbering of any ordinary, non-shy groups.")
        1 TeX-auto-symbol)
       (,(concat "\\\\newfont{?\\\\\\(" token "+\\)}?") 1 TeX-auto-symbol)
       (,(concat "\\\\typein\\[\\\\\\(" token "+\\)\\]") 1 TeX-auto-symbol)
-      ("\\\\input +\\(\\.*[^#%\\\\\\.\n\r]+\\)\\(\\.[^#%\\\\\\.\n\r]+\\)?"
+      ("\\\\input +\\([^#}%\"\\\n\r]+?\\)\\(?:\\.[^#}%/\"\\.\n\r]+\\)?"
        1 TeX-auto-file)
       (,(concat "\\\\mathchardef\\\\\\(" token "+\\)[^a-zA-Z@]")
        1 TeX-auto-symbol)))
@@ -5652,7 +5689,7 @@ characters."
 (defun TeX-search-unescaped (pattern
                              &optional direction regexp-flag bound noerror)
   "Search for unescaped PATTERN in a certain DIRECTION.
-DIRECTION can be indicated by the symbols 'forward and 'backward.
+DIRECTION can be indicated by the symbols `forward' and `backward'.
 If DIRECTION is omitted, a forward search is carried out.
 If REGEXP-FLAG is non-nil, PATTERN may be a regular expression,
 otherwise a string.
@@ -6271,7 +6308,7 @@ available from ")
         (insert " if your
 installation is older than the one available from the web site.
 
-If the bug is triggered by a specific \(La\)TeX file, you should try
+If the bug is triggered by a specific (La)TeX file, you should try
 to produce a minimal sample file showing the problem and include it
 in your report.
 
@@ -6985,7 +7022,6 @@ at bottom if LINE is nil."
 (defvar TeX-parse-function)
 (defvar TeX-sentinel-function)
 (defvar TeX-sentinel-default-function)
-(defvar compilation-in-progress)
 (defvar TeX-current-page)
 (defvar TeX-error-overview-open-after-TeX-run)
 (defvar TeX-error-list)
@@ -7294,19 +7330,19 @@ Pass arguments EXTENSION NONDIRECTORY ASK to 
`TeX-active-master'.
 If the returned file name contains space, enclose it within
 quotes `\"' when \" \\input\" is supplemented (indicated by
 dynamically bound variable `TeX-command-text' having string
-value.) Also enclose the file name within \\detokenize{} when
+value.)  Also enclose the file name within \\detokenize{} when
 the following three conditions are met:
   1. compiling with standard (pdf)LaTeX or upLaTeX
   2. \" \\input\" is supplemented
   3. EXTRA is non-nil (default when expanding \"%T\")
-Adjust dynamically bound variable `TeX-expand-pos' to avoid possible
-infinite loop in `TeX-command-expand'.
+Adjust dynamically bound variable `TeX-expand-pos' to avoid
+possible infinite loop in `TeX-command-expand'.
 If PREPROCESS-FN is non-nil then it is called with the filename
 as an argument and the result is enclosed instead of the
 filename.
 
-Helper function of `TeX-command-expand'. Use only within entries in
-`TeX-expand-list-builtin' and `TeX-expand-list'."
+Helper function of `TeX-command-expand'. Use only within entries
+in `TeX-expand-list-builtin' and `TeX-expand-list'."
   (let* ((raw (TeX-active-master extension nondirectory ask))
          ;; String `TeX-command-text' means that the file name is
          ;; given through \input command.
@@ -7803,6 +7839,7 @@ Return the new process."
           (set-process-filter process #'TeX-command-filter)
           (set-process-sentinel process #'TeX-command-sentinel)
           (set-marker (process-mark process) (point-max))
+          (require 'compile)
           (setq compilation-in-progress (cons process compilation-in-progress))
           process)
       (setq mode-line-process ": run")
@@ -7973,6 +8010,7 @@ run of `TeX-run-format', use
   ;; FIXME: This is just an ad-hoc workaround and it's better to fix
   ;; the regular expression in compile.el properly, if possible.  But
   ;; there was no response to such request in emacs-devel@gnu.org.
+  (require 'compile)
   (with-current-buffer TeX-command-buffer
     (make-local-variable 'compilation-error-regexp-alist)
     ;; Add slightly modified entry of the one associated with `comma'
@@ -8070,6 +8108,7 @@ Error parsing on \\[next-error] should work with a bit of 
luck."
     (TeX-command-mode-line process)
     (set-process-sentinel process #'TeX-command-sentinel)
     (set-marker (process-mark process) (point-max))
+    (require 'compile)
     (setq compilation-in-progress (cons process compilation-in-progress))
     (TeX-parse-reset)
     (setq TeX-parse-function #'TeX-parse-TeX)
@@ -8096,7 +8135,7 @@ This function is *obsolete* and only here for 
compatibility
 reasons.  Use `TeX-run-function' instead."
   (interactive)
   (TeX-ispell-document ""))
-
+(make-obsolete 'TeX-run-ispell-on-document 'TeX-run-function "2006-02-07")
 
 ;;; Command Sentinels
 



reply via email to

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