auctex-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/auctex b55368f75f 38/39: Merge remote-tracking branch '


From: Tassilo Horn
Subject: [elpa] externals/auctex b55368f75f 38/39: Merge remote-tracking branch 'origin/master' into externals/auctex
Date: Thu, 20 Jul 2023 04:21:51 -0400 (EDT)

branch: externals/auctex
commit b55368f75fa470ae9fa9e5c1a602a59484a0b496
Merge: 9d47b0a1bd 7cd0cdd60a
Author: Tassilo Horn <tsdh@gnu.org>
Commit: Tassilo Horn <tsdh@gnu.org>

    Merge remote-tracking branch 'origin/master' into externals/auctex
---
 Makefile.in                    |   3 +-
 RELEASE                        |   2 +-
 auctex.el.in                   |   4 +-
 bib-cite.el                    |   2 -
 configure.ac                   |   2 +-
 context-en.el                  |   7 +-
 context-nl.el                  |   7 +-
 context.el                     |  59 ++++-----
 doc/auctex.texi                |   6 +-
 doc/changes.texi               |   8 ++
 doc/faq.texi                   |   4 +-
 doc/install.texi               |   4 +-
 doc/preview-faq.texi           |   4 +-
 font-latex.el                  |  58 +++++----
 latex.el                       | 172 +++++++++++++++++++++-----
 style/XCharter.el              |  58 ++++-----
 style/algpseudocodex.el        |  47 +++++--
 style/amsthm.el                |  15 +--
 style/babel.el                 |  79 +++++++-----
 style/beamer.el                |  45 ++++---
 style/bicaption.el             |  30 ++---
 style/caption.el               |  27 +++--
 style/changelog.el             |   4 +-
 style/changes.el               |  66 +++++-----
 style/csquotes.el              | 138 +++++++++++----------
 style/dinbrief.el              |  52 ++++----
 style/expl3.el                 |  20 +--
 style/fontenc.el               |  14 +--
 style/geometry.el              |  11 +-
 style/letter.el                |  13 +-
 style/mdsymbol.el              |   9 +-
 style/menukeys.el              | 270 ++++++++++++++++++-----------------------
 style/microtype.el             |  13 +-
 style/natbib.el                |  31 +++--
 style/newfloat.el              |  15 +--
 style/ntheorem.el              |  65 +++++-----
 style/paralist.el              |  32 ++---
 style/parskip.el               |  18 +--
 style/pythontex.el             |  24 +---
 style/revtex4-2.el             |  25 ++--
 style/shortvrb.el              |  45 +++----
 style/siunitx.el               |  12 +-
 style/soul.el                  | 169 ++++++++++++++++++++++++++
 style/subcaption.el            |  13 +-
 style/theorem.el               |  15 +--
 style/wasysym.el               | 187 ++++++++++++++++++++++++++++
 style/xparse.el                |  20 +--
 tests/latex/font-latex-test.el | 128 ++++++++++++++++++-
 tex-info.el                    |  24 ++--
 tex-site.el.in                 |  19 +--
 tex.el                         |  57 +++++----
 51 files changed, 1396 insertions(+), 756 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 6244269a6e..18c7922219 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -196,7 +196,8 @@ STYLESRC = style/prosper.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 \
-          style/physics.el   style/algpseudocodex.el
+          style/physics.el   style/soul.el      style/algpseudocodex.el \
+          style/wasysym.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/RELEASE b/RELEASE
index f2496ca454..3e33bb7a5a 100644
--- a/RELEASE
+++ b/RELEASE
@@ -102,7 +102,7 @@ respectively.
 Requirements
 ------------
 
-It is required that you use at least GNU Emacs 25.1.
+It is required that you use at least GNU Emacs 26.1.
 
 The preview-latex subsystem requires image support.
 
diff --git a/auctex.el.in b/auctex.el.in
index 61527e2393..390c0e3c32 100644
--- a/auctex.el.in
+++ b/auctex.el.in
@@ -1,11 +1,11 @@
 ;;; auctex.el --- Integrated environment for *TeX*  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2014-2022 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2023 Free Software Foundation, Inc.
 
 ;; URL: https://www.gnu.org/software/auctex/
 ;; Maintainer: auctex-devel@gnu.org
 ;; Notifications-To: auctex-diffs@gnu.org
-;; Package-Requires: ((emacs "25.1"))
+;; Package-Requires: ((emacs "26.1"))
 ;; Keywords: TeX LaTeX Texinfo ConTeXt docTeX preview-latex
 
 ;; This file is part of AUCTeX.
diff --git a/bib-cite.el b/bib-cite.el
index 9c19be370d..5a7de98fe9 100644
--- a/bib-cite.el
+++ b/bib-cite.el
@@ -1570,8 +1570,6 @@ Does not save excursion."
          "Sorry, could not find an environment or section declaration")))))
 
 (defvar LaTeX-find-label-hist-alist nil "History list for LaTeX-find-label.")
-(defvar LaTeX-label-list nil "Used by AUCTeX to store label names.")
-
 
 (defun create-alist-from-list (the-list)
   "Return a single list from a THE-LIST that may contain either items or lists.
diff --git a/configure.ac b/configure.ac
index 30fdd598ee..1e986788c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,7 +37,7 @@ AC_SUBST(PREVIEWVERSION)
 
 EMACS_PROG_EMACS
 
-EMACS_CHECK_VERSION(25,1)
+EMACS_CHECK_VERSION(26,1)
 
 # The Debian package uses `--disable-build-dir-test'; normal users should
 # never need to modify the default behavior.
diff --git a/context-en.el b/context-en.el
index 54f30da3be..62394206ce 100644
--- a/context-en.el
+++ b/context-en.el
@@ -1,7 +1,7 @@
 ;;; context-en.el --- Support for the ConTeXt english interface. -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2003-2004, 2006, 2008
-;;               2010, 2014, 2020-2022 Free Software Foundation, Inc.
+;;               2010, 2014, 2020-2023 Free Software Foundation, Inc.
 
 ;; Maintainer: Berend de Boer <berend@pobox.com>
 ;; Keywords: tex
@@ -188,9 +188,8 @@ That is, besides the section(-block) commands.")
 
 (defun ConTeXt-en-mode-initialization ()
   "ConTeXt english interface specific initialization."
-  ;; FIXME: This `mapc' seems spurious because
-  ;; `ConTeXt-language-variable-list' includes
-  ;; `ConTeXt-environment-list'.
+  ;; FIXME: Move to `ConTeXt-mode-common-initialization' replacing
+  ;; `ConTeXt-environment-list-en' with `ConTeXt-environment-list'?
   (mapc #'ConTeXt-add-environments (reverse ConTeXt-environment-list-en))
 
   (TeX-add-symbols
diff --git a/context-nl.el b/context-nl.el
index 143a18a388..49aacac46d 100644
--- a/context-nl.el
+++ b/context-nl.el
@@ -1,7 +1,7 @@
 ;;; context-nl.el --- Support for the ConTeXt dutch interface. -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2003, 2004, 2006, 2010,
-;;               2015, 2020-2022 Free Software Foundation, Inc.
+;;               2015, 2020-2023 Free Software Foundation, Inc.
 
 ;; Maintainer: Berend de Boer <berend@pobox.com>
 ;; Keywords: tex
@@ -163,9 +163,8 @@ That is, besides the section(-block) commands.")
 
 (defun ConTeXt-nl-mode-initialization ()
   "ConTeXt dutch interface specific initialization."
-  ;; FIXME: This `mapc' seems spurious because
-  ;; `ConTeXt-language-variable-list' includes
-  ;; `ConTeXt-environment-list'.
+  ;; FIXME: Move to `ConTeXt-mode-common-initialization' replacing
+  ;; `ConTeXt-environment-list-nl' with `ConTeXt-environment-list'?
   (mapc #'ConTeXt-add-environments (reverse ConTeXt-environment-list-nl))
 
   (TeX-add-symbols
diff --git a/context.el b/context.el
index ae546b6af1..40214aad4d 100644
--- a/context.el
+++ b/context.el
@@ -1,6 +1,6 @@
 ;;; context.el --- Support for ConTeXt documents.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2003-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2003-2023  Free Software Foundation, Inc.
 
 ;; Maintainer: Berend de Boer <berend@pobox.com>
 ;; Keywords: tex
@@ -309,13 +309,20 @@ The following variables can be set to customize:
 
 ;; LaTeX has a max function here, which makes no sense.
 ;; I think you want to insert a section that is max ConTeXt-largest-level
+;; (May 3, 2023) The above comment is wrong.  Here "large" refers to
+;; coarseness of document structure grouping.  That is, "chapter" is
+;; larger than "section", "section" is larger than "subsection" etc.
+;; On the ohter hand, the corresponding levels are numbered in the
+;; reversed order.  That is, "chapter" is level 1, "section" is level
+;; 2 etc.  Hence the largest _section_ has the smallest _level_.
+;; That's the reason we use `max' rather than `min' here.
 (defun ConTeXt-current-section ()
   "Return the level of the section that contain point.
 See also `ConTeXt-section' for description of levels."
   (save-excursion
-    (min (ConTeXt-largest-level)
+    (max (ConTeXt-largest-level)
          (if (re-search-backward outline-regexp nil t)
-             (+ 1 (- (ConTeXt-outline-level) (ConTeXt-outline-offset)))
+             (- (ConTeXt-outline-level) (ConTeXt-outline-offset))
            (ConTeXt-largest-level)))))
 
 (defun ConTeXt-down-section ()
@@ -549,7 +556,7 @@ assumes the section already is inserted."
   (newline)
   ;; If RefTeX is available, tell it that we've just made a new section
   (and (fboundp 'reftex-notice-new-section)
-       (funcall (symbol-function 'reftex-notice-new-section))))
+       (reftex-notice-new-section)))
 
 (defun ConTeXt-section-ref ()
   "Hook to insert a reference after the sectioning command.
@@ -1159,7 +1166,8 @@ header is at the start of a line."
    "\\|" (ConTeXt-header-end) "\\b"
    "\\|" (ConTeXt-trailer-start) "\\b"))
 
-(defvar ConTeXt-text "Name of ConTeXt macro that begins the text body.")
+(defvar ConTeXt-text nil
+  "Name of ConTeXt macro that begins the text body.")
 
 (defun ConTeXt-header-end ()
   "Default end of header marker for ConTeXt documents."
@@ -1451,20 +1459,20 @@ else.  There might be text before point."
 
 (defun ConTeXt-environment-menu-entry (entry)
   "Create an ENTRY for the environment menu."
-  (vector (car entry) (list 'ConTeXt-environment-menu (car entry)) t))
+  (vector (car entry) (list #'ConTeXt-environment-menu (car entry)) t))
 
 (defvar ConTeXt-environment-modify-menu-name "Change Environment   (C-u C-c 
C-e)")
 
 (defun ConTeXt-environment-modify-menu-entry (entry)
   "Create an ENTRY for the change environment menu."
-  (vector (car entry) (list 'ConTeXt-modify-environment (car entry)) t))
+  (vector (car entry) (list #'ConTeXt-modify-environment (car entry)) t))
 
 ;; ConTeXt define macros
 (defvar ConTeXt-define-menu-name "Define")
 
 (defun ConTeXt-define-menu-entry (entry)
   "Create an ENTRY for the define menu."
-  (vector entry (list 'ConTeXt-define-menu entry)))
+  (vector entry (list #'ConTeXt-define-menu entry)))
 
 (defun ConTeXt-define-menu (define)
   "Insert DEFINE from menu."
@@ -1475,7 +1483,7 @@ else.  There might be text before point."
 
 (defun ConTeXt-setup-menu-entry (entry)
   "Create an ENTRY for the setup menu."
-  (vector entry (list 'ConTeXt-setup-menu entry)))
+  (vector entry (list #'ConTeXt-setup-menu entry)))
 
 (defun ConTeXt-setup-menu (setup)
   "Insert SETUP from menu."
@@ -1486,7 +1494,7 @@ else.  There might be text before point."
 
 (defun ConTeXt-referencing-menu-entry (entry)
   "Create an ENTRY for the referencing menu."
-  (vector entry (list 'ConTeXt-referencing-menu entry)))
+  (vector entry (list #'ConTeXt-referencing-menu entry)))
 
 (defun ConTeXt-referencing-menu (referencing)
   "Insert REFERENCING from menu."
@@ -1497,7 +1505,7 @@ else.  There might be text before point."
 
 (defun ConTeXt-other-macro-menu-entry (entry)
   "Create an ENTRY for the other macro menu."
-  (vector entry (list 'ConTeXt-other-macro-menu entry)))
+  (vector entry (list #'ConTeXt-other-macro-menu entry)))
 
 (defun ConTeXt-other-macro-menu (other-macro)
   "Insert OTHER-MACRO from menu."
@@ -1516,7 +1524,7 @@ else.  There might be text before point."
 
 (defun ConTeXt-project-structure-menu-entry (entry)
   "Create an ENTRY for the project structure menu."
-  (vector entry (list 'ConTeXt-project-structure-menu entry)))
+  (vector entry (list #'ConTeXt-project-structure-menu entry)))
 
 
 ;; meta-structure section blocks menu entries
@@ -1529,7 +1537,7 @@ else.  There might be text before point."
 
 (defun ConTeXt-section-block-menu-entry (entry)
   "Create an ENTRY for the section block menu."
-  (vector entry (list 'ConTeXt-section-block-menu entry)))
+  (vector entry (list #'ConTeXt-section-block-menu entry)))
 
 
 ;; section menu entries
@@ -1564,25 +1572,23 @@ else.  There might be text before point."
 (defun ConTeXt-numbered-section-menu-entry (entry)
   "Create an ENTRY for the numbered section menu."
   (let ((enable (ConTeXt-section-enable-symbol (nth 1 entry))))
-    (set enable t)
-    (vector (car entry) (list 'ConTeXt-numbered-section-menu (nth 1 entry)) 
enable)))
+    (vector (car entry) (list #'ConTeXt-numbered-section-menu (nth 1 entry)) 
enable)))
 
 (defun ConTeXt-unnumbered-section-menu-entry (entry)
   "Create an ENTRY for the unnumbered section menu."
   (let ((enable (ConTeXt-section-enable-symbol (nth 1 entry))))
-    (set enable t)
-    (vector (car entry) (list 'ConTeXt-unnumbered-section-menu (nth 1 entry)) 
enable)))
+    (vector (car entry) (list #'ConTeXt-unnumbered-section-menu (nth 1 entry)) 
enable)))
 
 
 ;; etexshow support
 
 (defun ConTeXt-etexshow ()
-  "Call etexshow, if available, to show the definition of a ConText macro."
+  "Call etexshow, if available, to show the definition of a ConTeXt macro."
   (interactive)
-  (if (fboundp 'etexshow)
-      (let ()
+  (if (fboundp 'etexshow-cmd)
+      (progn
         (require 'etexshow)
-        (funcall (symbol-function 'etexshow-cmd)))
+        (etexshow-cmd))
     (error "etexshow is not installed.  Get it from http://levana.de/emacs/";)))
 
 ;; menu itself
@@ -1783,6 +1789,9 @@ Use `ConTeXt-Mark-version' to choose the command."
     ConTeXt-extra-paragraph-commands
     ConTeXt-environment-list)
   "List of variables to be set from languages specific ones.")
+;; Make language specific variables buffer local
+(dolist (symbol ConTeXt-language-variable-list)
+  (make-variable-buffer-local symbol))
 
 (defconst ConTeXt-dialect :context
   "Default dialect for use with function `TeX-add-style-hook' for
@@ -1794,8 +1803,8 @@ file, or any mode derived thereof.  See variable
   ;; See *suffixes in texutil.pl.
   '("\\.tui" "\\.tup" "\\.ted" "\\.tes" "\\.top" "\\.log" "\\.tmp" "\\.run"
     "\\.bck" "\\.rlg" "\\.mpt" "\\.mpx" "\\.mpd" "\\.mpo" "\\.tuo" "\\.tub"
-    "\\.top" "-mpgraph\\.mp" "-mpgraph\\.mpd" "-mpgraph\\.mpo" "-mpgraph\\.mpy"
-    "-mprun\\.mp" "-mprun\\.mpd" "-mprun\\.mpo" "-mprun\\.mpy")
+    "\\.top" "\\.tuc" "-mpgraph\\.mp" "-mpgraph\\.mpd" "-mpgraph\\.mpo"
+    "-mpgraph\\.mpy" "-mprun\\.mp" "-mprun\\.mpd" "-mprun\\.mpo" 
"-mprun\\.mpy")
   "List of regexps matching suffixes of files to be deleted.
 The regexps will be anchored at the end of the file name to be matched,
 that is, you do _not_ have to cater for this yourself by adding \\\\\\=' or $."
@@ -1826,10 +1835,6 @@ that is, you do _not_ have to cater for this yourself by 
adding \\\\\\=' or $."
   (setq local-abbrev-table context-mode-abbrev-table)
   (set (make-local-variable 'TeX-style-hook-dialect) ConTeXt-dialect)
 
-  ;; Make language specific variables buffer local
-  (dolist (symbol ConTeXt-language-variable-list)
-    (make-variable-buffer-local symbol))
-
   (require (intern (concat "context-" ConTeXt-current-interface)))
   (dolist (symbol ConTeXt-language-variable-list)
     (set symbol (symbol-value (intern (concat (symbol-name symbol) "-"
diff --git a/doc/auctex.texi b/doc/auctex.texi
index b396e39758..8d5b282f66 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -12,7 +12,7 @@ This manual is for @AUCTeX{}
 (version @value{VERSION} from @value{UPDATED}),
 a sophisticated @TeX{} environment for Emacs.
 
-Copyright @copyright{} 1992-1995, 2001, 2002, 2004-2022
+Copyright @copyright{} 1992-1995, 2001, 2002, 2004-2023
 Free Software Foundation, Inc.
 
 @quotation
@@ -2317,11 +2317,11 @@ described above.  You can disable these defaults per 
class by
 customizing the variable @code{font-latex-deactivated-keyword-classes}.
 This is a list of strings for keyword classes to be deactivated.  Valid
 entries are "warning", "variable", "biblatexnoarg", "biblatex",
-"reference", "function" , "sectioning-0", "sectioning-1",
+"reference", "function", "function-noarg", "sectioning-0", "sectioning-1",
 "sectioning-2", "sectioning-3", "sectioning-4", "sectioning-5",
 "slide-title", "textual", "bold-command", "italic-command",
 "underline-command", "math-command", "type-command", "bold-declaration",
-"italic-declaration", "type-declaration".
+"italic-declaration" or "type-declaration".
 
 You can also get rid of certain keywords only.  For example if you want
 to remove highlighting of footnotes as references you can put the
diff --git a/doc/changes.texi b/doc/changes.texi
index 00bfe01bb5..467af2a506 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -8,6 +8,14 @@
 
 @end ifset
 
+@heading News since last release
+
+@itemize @bullet
+@item
+@AUCTeX{} now requires GNU Emacs 26.1 or higher.
+
+@end itemize
+
 @heading News in 13.2
 
 @itemize @bullet
diff --git a/doc/faq.texi b/doc/faq.texi
index a6122ec01b..547cb01f0f 100644
--- a/doc/faq.texi
+++ b/doc/faq.texi
@@ -1,5 +1,5 @@
 @c This is part of the AUCTeX Manual.
-@c Copyright (C) 2004-2014, 2021, 2022 Free Software Foundation, Inc.
+@c Copyright (C) 2004-2023 Free Software Foundation, Inc.
 @c See the file auctex.texi for copying conditions.
 @ifset rawfile
 @include macros.texi
@@ -71,7 +71,7 @@ statements related to the problem.
 @item
 What versions of Emacs are supported?
 
-@AUCTeX{} was tested with @w{GNU Emacs 25.1}.  Older versions may work but
+@AUCTeX{} was tested with @w{GNU Emacs 26.1}.  Older versions may work but
 are unsupported.
 
 @item
diff --git a/doc/install.texi b/doc/install.texi
index 19034cb957..f808135b54 100644
--- a/doc/install.texi
+++ b/doc/install.texi
@@ -1,6 +1,6 @@
 @c This is part of the AUCTeX Manual.
 @c Copyright (C) 1994, 1996, 2003-2007, 2012-2013,
-@c               2015, 2017, 2018, 2020, 2021  Free Software Foundation, Inc.
+@c               2015-2023  Free Software Foundation, Inc.
 @c See the file auctex.texi for copying conditions.
 @ifset rawfile
 @include macros.texi
@@ -96,7 +96,7 @@ the file @file{INSTALL.windows}.
 @end ifclear
 
 @itemize @bullet
-@item GNU Emacs 25.1 or higher
+@item GNU Emacs 26.1 or higher
 
 Using @previewlatex{} requires a version of Emacs compiled with image
 support.
diff --git a/doc/preview-faq.texi b/doc/preview-faq.texi
index bf16c7f61a..3b983bf159 100644
--- a/doc/preview-faq.texi
+++ b/doc/preview-faq.texi
@@ -1,6 +1,6 @@
 @c This is part of the preview-latex manual.
 @c Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009
-@c               2017, 2021 Free Software Foundation, Inc.
+@c               2017, 2021-2023 Free Software Foundation, Inc.
 @c See file preview-latex.texi for copying conditions.
 @ifset rawfile
 @include macros.texi
@@ -48,7 +48,7 @@ to @email{auctex-devel@@gnu.org}.
 @subsection Which version of Emacs is needed?
 
 @previewlatex{} nominally requires @w{GNU Emacs} with a version of at
-least 25.1.
+least 26.1.
 
 @subsection Which versions of Ghostscript and @AUCTeX{} are needed?
 
diff --git a/font-latex.el b/font-latex.el
index b78cf58ad2..7617b5cc84 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1,6 +1,6 @@
 ;;; font-latex.el --- LaTeX fontification for Font Lock mode.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1996-2022  Free Software Foundation, Inc.
+;; Copyright (C) 1996-2023  Free Software Foundation, Inc.
 
 ;; Authors:    Peter S. Galbraith <psg@debian.org>
 ;;             Simon Marshall <Simon.Marshall@esrin.esa.it>
@@ -365,21 +365,22 @@ variable `font-latex-fontify-sectioning'." ',num)
       ("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" "")
-      ("bigskip" "") ("medskip" "")  ("smallskip" "")
-      ("thinspace" "")  ("negthinspace" "")
-      ("thicklines" "") ("thinlines" "")
-      ("noindent" "") ("hline" "") ("ldots" "")
-      ("centering" "") ("raggedright" "") ("raggedleft" "")
-      ("raggedbottom" "") ("flushbottom" "")
-      ("TeX" "") ("LaTeX" "") ("LaTeXe" "")
-      ("normalfont" "") ("normalshape" "")
-      ("tableofcontents" "") ("listoffigures" "") ("listoftables" "")
-      ("maketitle" "") ("makeindex" "") ("makeglossary" ""))
+      ("NewMarkClass" "{"))
      font-lock-function-name-face 2 command)
+    ("function-noarg"
+     ("enspace" "enskip" "quad" "qquad" "nonumber"
+      "bigskip" "medskip"  "smallskip"
+      "thinspace"  "negthinspace"
+      "thicklines" "thinlines"
+      "noindent" "hline" "ldots"
+      "centering" "raggedright" "raggedleft"
+      "raggedbottom" "flushbottom"
+      "TeX" "LaTeX" "LaTeXe"
+      "normalfont" "normalshape"
+      "tableofcontents" "listoffigures" "listoftables"
+      "maketitle" "makeindex" "makeglossary"
+      "sloppy" "fussy")
+     font-lock-keyword-face 2 noarg)
     ("sectioning-0"
      (("part" "*[{"))
      (if (eq font-latex-fontify-sectioning 'color)
@@ -481,12 +482,13 @@ will match macros of the form \"\\foo[bar]{baz}\"."))
   "List of strings for built-in keyword classes to be deactivated.
 
 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\", \"underline-command\",
-\"math-command\", \"type-command\", \"bold-declaration\",
-\"italic-declaration\", \"type-declaration\".
+\"biblatex\", \"reference\", \"function\", \"function-noarg\",
+\"sectioning-0\", \"sectioning-1\", \"sectioning-2\",
+\"sectioning-3\", \"sectioning-4\", \"sectioning-5\",
+\"slide-title\", \"textual\", \"bold-command\",
+\"italic-command\", \"underline-command\", \"math-command\",
+\"type-command\", \"bold-declaration\", \"italic-declaration\" or
+\"type-declaration\".
 
 You have to restart Emacs for a change of this variable to take effect."
   :group 'font-latex-keywords
@@ -913,7 +915,7 @@ Generated by `font-latex-make-user-keywords'.")))
 KEYWORDS is a list of keywords or keywords with syntax specs.
 CLASS corresponds to a keyword class and can be one of the
 symbols `warning', `variable', `reference', `biblatexnoarg',
-`biblatex', `function', `sectioning-0', `sectioning-1',
+`biblatex', `function', `function-noarg', `sectioning-1',
 `sectioning-2', `sectioning-3', `sectioning-4', `sectioning-5',
 `slide-title', `textual', `bold-command', `italic-command',
 `underline-command', `math-command', `type-command',
@@ -1095,8 +1097,16 @@ have changed."
                   ;; Some macros take an optional argument.  This is
                   ;; the same line as above for environments.
                   "\\(?:\\[[^][]*\\(?:\\[[^][]*\\][^][]*\\)*\\]\\)?"
-                  "\\({\\).*?[^\\]\\(?:\\\\\\\\\\)*\\(}\\)")
-         (1 "|") (2 "|")))))
+                  ;; Within verb macros with braces, only balanced
+                  ;; pairs of braces are allowed; so we respect this
+                  ;; and allow one level of balanced braces.  Give
+                  ;; escape char(s) at the end of the verbatim
+                  ;; construct punctuation syntax.
+                  "\\({\\)[^}{]*?"
+                  "\\(?:{[^}{]*}[^}{]*?\\)*"
+                  "\\(" (regexp-quote TeX-esc) "*\\)"
+                  "\\(}\\)")
+         (1 "|") (2 ".") (3 "|")))))
   (when font-latex-syntactic-keywords-extra
     (nconc font-latex-syntactic-keywords font-latex-syntactic-keywords-extra))
   ;; ;; Cater for docTeX mode.
diff --git a/latex.el b/latex.el
index c3b4f8b879..6c51a14654 100644
--- a/latex.el
+++ b/latex.el
@@ -1,6 +1,6 @@
 ;;; latex.el --- Support for LaTeX documents.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1991, 1993-2022 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1993-2023 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Keywords: tex
@@ -31,9 +31,7 @@
 (require 'tex)
 (require 'tex-style)
 (require 'tex-ispell)
-(when (<= 26 emacs-major-version)
-  ;; latex-flymake requires Emacs 26.
-  (require 'latex-flymake))
+(require 'latex-flymake)
 (eval-when-compile
   (require 'cl-lib))
 
@@ -45,11 +43,6 @@
 (declare-function turn-off-filladapt-mode "ext:filladapt"
                   nil)
 
-;; This function is reported to be unknown when built
-;; `with-native-compilation':
-(declare-function LaTeX-flymake "latex-flymake"
-                  (report-fn &rest _args))
-
 ;; Silence the compiler for variables:
 (defvar outline-heading-alist)
 (defvar LaTeX-section-list-changed)
@@ -2842,8 +2835,7 @@ argument, otherwise as a mandatory one.  Use PROMPT as 
the prompt
 string."
   (TeX-argument-insert
    (completing-read (TeX-argument-prompt optional prompt "Position")
-                    '("l" "r" "t" "b" "tl" "tr" "bl" "br")
-                    nil t)
+                    '("l" "r" "t" "b" "tl" "tr" "bl" "br"))
    optional))
 
 (defun TeX-arg-lr (optional &optional prompt)
@@ -2853,15 +2845,14 @@ argument, otherwise as a mandatory one.  Use PROMPT as 
the prompt
 string."
   (TeX-argument-insert
    (completing-read (TeX-argument-prompt optional prompt "Position")
-                    '("l" "r")
-                    nil t)
+                    '("l" "r"))
    optional))
 
 (defun TeX-arg-tb (optional &optional prompt poslist)
   "Prompt for a LaTeX side with completion.
 If OPTIONAL is non-nil, insert the resulting value as an optional
 argument, otherwise as a mandatory one.  Use PROMPT as the prompt
-string.  POSLIST contains the positioning characters offered for
+string.  POSLIST controls the positioning characters offered for
 completion.  It can be the symbols `center', `stretch' or nil
 with the following completion list:
   center   t, b, c
@@ -2874,8 +2865,7 @@ with the following completion list:
                           ((eq poslist 'stretch)
                            '("t" "b" "c" "s"))
                           (t
-                           '("t" "b")))
-                    nil t)
+                           '("t" "b"))))
    optional))
 
 (defcustom TeX-date-format "%Y/%m/%d"
@@ -5703,7 +5693,7 @@ use \\[customize]."
   '("Math"
     ("Greek Uppercase") ("Greek Lowercase") ("Binary Op") ("Relational")
     ("Arrows") ("Punctuation") ("Misc Symbol") ("Var Symbol") ("Log-like")
-    ("Delimiters") ("Constructs") ("Accents") ("AMS"))
+    ("Delimiters") ("Constructs") ("Accents") ("AMS") ("Wasysym"))
   "Menu containing LaTeX math commands.
 The menu entries will be generated dynamically, but you can specify
 the sequence by initializing this variable.")
@@ -6230,7 +6220,26 @@ the sequence by initializing this variable.")
     (nil "intertext" ("AMS" "Special"))
     (nil "substack" ("AMS" "Special"))
     (nil "subarray" ("AMS" "Special"))
-    (nil "sideset" ("AMS" "Special")))
+    (nil "sideset" ("AMS" "Special"))
+    ;; Wasysym symbols:
+    (nil "lhd" ("Wasysym" "Binary Op") 9665) ;; #X22C1
+    (nil "LHD" ("Wasysym" "Binary Op") 9664) ;; #X25C0
+    (nil "ocircle" ("Wasysym" "Binary Op") 9675) ;; #X25CB
+    (nil "rhd" ("Wasysym" "Binary Op") 9655) ;; #X25B7
+    (nil "RHD" ("Wasysym" "Binary Op") 9654) ;; #X25B6
+    (nil "unlhd" ("Wasysym" "Binary Op") 8884) ;; #X22B4
+    (nil "unrhd" ("Wasysym" "Binary Op") 8885) ;; #X22B5
+    (nil "apprle" ("Wasysym" "Relational") 8818) ;; #X2272
+    (nil "apprge" ("Wasysym" "Relational") 8819) ;; #X2273
+    (nil "invneg" ("Wasysym" "Relational") 8976) ;; #X2310
+    (nil "Join" ("Wasysym" "Relational") 10781) ;; #X2A1D
+    (nil "leadsto" ("Wasysym" "Relational") 10547) ;; #X2933
+    (nil "sqsubset" ("Wasysym" "Relational") 8847) ;; #X228f
+    (nil "sqsupset" ("Wasysym" "Relational") 8848) ;; #X2290
+    (nil "wasypropto" ("Wasysym" "Relational") 8733) ;; #X221D
+    (nil "Box" ("Wasysym" "Misc Symbol") 9633) ;; #X25A1
+    (nil "Diamond" ("Wasysym" "Misc Symbol") 9671) ;; #X25C7
+    (nil "logof" ("Wasysym" "Misc Symbol")))
   "Alist of LaTeX math symbols.
 
 Each entry should be a list with upto four elements, KEY, VALUE,
@@ -7585,6 +7594,93 @@ COLLECTION is an list of strings."
                    (lambda (_)
                      collection)))))
 
+(defun LaTeX-completion-documentclass-usepackage (entry)
+  "Return completion candidates for \\usepackage and \\documentclass arguments.
+ENTRY is the value returned by `LaTeX-what-macro'.  This function
+provides completion for class/package names if point is inside
+the mandatory argument and class/package options if inside the
+first optional argument.  The completion for class/package names
+is provided only if the value of `TeX-arg-input-file-search' is
+set to t."
+  (let ((cls-or-sty (if (member (car entry) '("usepackage" "RequirePackage"
+                                              "RequirePackageWithOptions"))
+                        'sty
+                      'cls)))
+    (cond ((and (eq (nth 3 entry) 'mandatory)
+                (eq TeX-arg-input-file-search t))
+           (if (eq cls-or-sty 'cls)
+               (progn
+                 (unless LaTeX-global-class-files
+                   (let ((TeX-file-extensions '("cls")))
+                     (message "Searching for LaTeX classes...")
+                     (setq LaTeX-global-class-files
+                           (mapcar #'list (TeX-search-files-by-type 'texinputs 
'global t t)))
+                     (message "Searching for LaTeX classes...done")))
+                 (LaTeX-completion-candidates-completing-read
+                  LaTeX-global-class-files))
+             (unless LaTeX-global-package-files
+               (let ((TeX-file-extensions '("sty")))
+                 (message "Searching for LaTeX packages...")
+                 (setq LaTeX-global-package-files
+                       (mapcar #'list (TeX-search-files-by-type 'texinputs 
'global t t)))
+                 (message "Searching for LaTeX packages...done")))
+             (LaTeX-completion-candidates-completing-read-multiple
+              LaTeX-global-package-files)))
+          ;; We have to be more careful for the optional argument
+          ;; since the macros can look like this:
+          ;; \usepackage[opt1]{mand}[opt2].  So we add an extra check
+          ;; if we are inside the first optional arg:
+          ((and (eq (nth 3 entry) 'optional)
+                (= (nth 2 entry) 1))
+           (let ((syntax (TeX-search-syntax-table ?\[ ?\]))
+                 style style-opts)
+             ;; We have to find out about the package/class name:
+             (save-excursion
+               (with-syntax-table syntax
+                 (condition-case nil
+                     (let ((forward-sexp-function nil))
+                       (up-list))
+                   (error nil)))
+               (skip-chars-forward "^[:alnum:]")
+               (setq style (thing-at-point 'symbol t)))
+             ;; Load the style file; may fail but that's Ok for us
+             (TeX-load-style style)
+             ;; Now we have to find out how the options are available:
+             ;; This is usually a variable called
+             ;; `LaTeX-<class|package>-package-options'.  If it is a
+             ;; function, then the options are stored either in a
+             ;; variable or a function called
+             ;; `LaTeX-<class|package>-package-options-list:'
+             (when (setq style-opts
+                         (intern-soft (format
+                                       (concat "LaTeX-%s-"
+                                               (if (eq cls-or-sty 'cls)
+                                                   "class"
+                                                 "package")
+                                               "-options")
+                                       style)))
+               (cond ((and (boundp style-opts)
+                           (symbol-value style-opts))
+                      (LaTeX-completion-candidates-completing-read-multiple
+                       (symbol-value style-opts)))
+                     ((and (setq style-opts
+                                 (intern-soft (format
+                                               (concat "LaTeX-%s-"
+                                                       (if (eq cls-or-sty 'cls)
+                                                           "class"
+                                                         "package")
+                                                       "-options-list")
+                                               style)))
+                           (boundp style-opts)
+                           (symbol-value style-opts))
+                      (LaTeX-completion-candidates-key-val
+                       (symbol-value style-opts)))
+                     ((fboundp style-opts)
+                      (LaTeX-completion-candidates-key-val
+                       (funcall style-opts)))
+                     (t nil)))))
+          (t nil))))
+
 (defun LaTeX-completion-parse-args (entry)
   "Return the match of buffer position ENTRY with AUCTeX macro definitions.
 ENTRY is generated by the function `LaTeX-what-macro'.  This
@@ -7695,7 +7791,7 @@ or `LaTeX-environment-list' and returns it."
           (t nil))
     result))
 
-(defvar LaTeX-completion-function-map-alist-keyval '()
+(defvar LaTeX-completion-function-map-alist-keyval nil
   "Alist mapping style funcs to completion-candidates counterparts.
 Each element is a cons with the name of the function used in an
 AUCTeX style file which queries and inserts something in the
@@ -7707,6 +7803,7 @@ key=val completions.  See also
 (defvar LaTeX-completion-function-map-alist-cr
   `((TeX-arg-counter . LaTeX-counter-list)
     (TeX-arg-pagestyle . LaTeX-pagestyle-list)
+    (TeX-arg-environment . LaTeX-environment-list)
     (TeX-arg-length . ,(lambda () (mapcar (lambda (x)
                                             (concat TeX-esc (car x)))
                                           (LaTeX-length-list)))))
@@ -7799,7 +7896,13 @@ function `TeX--completion-at-point' which should come 
first in
   (when (and (LaTeX-completion-find-argument-boundries)
              (not (nth 4 (syntax-ppss))))
     (let ((entry (LaTeX-what-macro)))
-      (cond ((or (and entry
+      (cond ((and entry
+                  (member (car entry) '("usepackage" "RequirePackage"
+                                        "RequirePackageWithOptions"
+                                        "documentclass" "LoadClass"
+                                        "LoadClassWithOptions")))
+             (LaTeX-completion-documentclass-usepackage entry))
+            ((or (and entry
                       (eq (nth 1 entry) 'mac)
                       (assoc (car entry) (TeX-symbol-list)))
                  (and entry
@@ -7905,9 +8008,8 @@ of `LaTeX-mode-hook'."
   (if (and (boundp 'filladapt-mode)
            filladapt-mode)
       (turn-off-filladapt-mode))
-  (when (< 25 emacs-major-version)
-    ;; Set up flymake backend, see latex-flymake.el
-    (add-hook 'flymake-diagnostic-functions #'LaTeX-flymake nil t)))
+  ;; Set up flymake backend, see latex-flymake.el
+  (add-hook 'flymake-diagnostic-functions #'LaTeX-flymake nil t))
 
 (TeX-abbrev-mode-setup doctex-mode)
 
@@ -8171,14 +8273,20 @@ function would return non-nil and `(match-string 1)' 
would return
      [ TeX-arg-define-macro-arguments ] 2)
    '("renewenvironment*" TeX-arg-environment
      [ TeX-arg-define-macro-arguments ] 2)
+   ;; \newtheorem comes in 3 flavors:
+   ;; \newtheorem{name}{title} or
+   ;; \newtheorem{name}[numbered_like]{title} or
+   ;; \newtheorem{name}{title}[numbered_within]
+   ;; Both optional args are not allowed
    '("newtheorem" TeX-arg-define-environment
      [ TeX-arg-environment "Numbered like" ]
-     t [ (TeX-arg-eval progn (if (eq (save-excursion
-                                       (backward-char 2)
-                                       (preceding-char)) ?\])
-                                 ()
-                               (TeX-arg-counter t "Within counter"))
-                       "") ])
+     "Title"
+     (TeX-arg-conditional (save-excursion
+                            (skip-chars-backward (concat "^" TeX-grcl))
+                            (backward-list)
+                            (= (preceding-char) ?\]))
+         ()
+       ([TeX-arg-counter "Within counter"])))
    '("newfont" TeX-arg-define-macro t)
    '("circle" "Diameter")
    '("circle*" "Diameter")
@@ -8266,9 +8374,9 @@ function would return non-nil and `(match-string 1)' 
would return
    '("date" TeX-arg-date)
    '("thanks" t)
    '("title" t)
-   '("pagenumbering" (TeX-arg-eval
-                      completing-read "Numbering style: "
-                      '(("arabic") ("roman") ("Roman") ("alph") ("Alph"))))
+   '("pagenumbering" (TeX-arg-completing-read
+                      ("arabic" "roman" "Roman" "alph" "Alph")
+                      "Numbering style"))
    '("pagestyle" TeX-arg-pagestyle)
    '("markboth" t nil)
    '("markright" t)
diff --git a/style/XCharter.el b/style/XCharter.el
index 4edb5a37ef..8838d29245 100644
--- a/style/XCharter.el
+++ b/style/XCharter.el
@@ -1,6 +1,6 @@
 ;;; XCharter.el --- AUCTeX style for `XCharter.sty' (v1.24)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2014--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -134,32 +134,36 @@
                               'textual)))
  TeX-dialect)
 
+(defun LaTeX-XCharter-package-options-list ()
+  "Return an alist of package options for XCharter package."
+  (append
+   (when (memq TeX-engine '(xetex luatex))
+     '(("nofontspec" ("true" "false"))
+       ("type1text" ("true" "false"))
+       ("type1" ("true" "false"))
+       ("defaultfeatures")))
+   '(("scaled")
+     ("scale")
+     ("lining" ("true" "false"))
+     ("lf" ("true" "false"))
+     ("oldstyle" ("true" "false"))
+     ("osf" ("true" "false"))
+     ("proportional" ("true" "false"))
+     ("p" ("true" "false"))
+     ("tabular" ("true" "false"))
+     ("t" ("true" "false"))
+     ("oldstyleI" ("true" "false"))
+     ("osfI" ("true" "false"))
+     ("sups")
+     ("scosf")
+     ("serbianc")
+     ("theoremfont")
+     ("thmlining")
+     ("oldSS")
+     ("notextnu"))))
+
 (defun LaTeX-XCharter-package-options ()
-  "Read the XCharter package options."
-  (TeX-read-key-val t (append
-                       (when (memq TeX-engine '(xetex luatex))
-                         '(("nofontspec" ("true" "false"))
-                           ("type1text" ("true" "false"))
-                           ("type1" ("true" "false"))
-                           ("defaultfeatures")))
-                       '(("scaled")
-                         ("scale")
-                         ("lining" ("true" "false"))
-                         ("lf" ("true" "false"))
-                         ("oldstyle" ("true" "false"))
-                         ("osf" ("true" "false"))
-                         ("proportional" ("true" "false"))
-                         ("p" ("true" "false"))
-                         ("tabular" ("true" "false"))
-                         ("t" ("true" "false"))
-                         ("oldstyleI" ("true" "false"))
-                         ("osfI" ("true" "false"))
-                         ("sups")
-                         ("scosf")
-                         ("serbianc")
-                         ("theoremfont")
-                         ("thmlining")
-                         ("oldSS")
-                         ("notextnu")))))
+  "Prompt for package options for the XCharter package."
+  (TeX-read-key-val t (LaTeX-XCharter-package-options-list)))
 
 ;;; XCharter.el ends here
diff --git a/style/algpseudocodex.el b/style/algpseudocodex.el
index d2b9848d92..810e031556 100644
--- a/style/algpseudocodex.el
+++ b/style/algpseudocodex.el
@@ -1,6 +1,6 @@
 ;;; algpseudocodex.el --- AUCTeX style for `algpseudocodex.sty' (v1.0.2)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2022--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Created: 2022-10-10
@@ -136,6 +136,25 @@ the number of arguments."
     ;; 2.2 Boxes Inside Single Line
     '("BoxedString" ["options"] t)
 
+    ;; 4.3 Changing Keywords
+    "algorithmicend"
+    "algorithmicdo"
+    "algorithmicwhile"
+    "algorithmicfor"
+    "algorithmicforall"
+    "algorithmicloop"
+    "algorithmicrepeat"
+    "algorithmicuntil"
+    "algorithmicprocedure"
+    "algorithmicfunction"
+    "algorithmicif"
+    "algorithmicthen"
+    "algorithmicelse"
+    "algorithmicrequire"
+    "algorithmicensure"
+    "algorithmicreturn"
+    "algorithmicoutput"
+
     '("algrenewcommand"
       (TeX-arg-completing-read ("algorithmicend"
                                 "algorithmicdo"
@@ -200,17 +219,21 @@ the number of arguments."
                               'function)))
  TeX-dialect)
 
+(defvar LaTeX-algpseudocodex-package-options-list
+  '(("noEnd" ("true" "false"))
+    ("indLines" ("true" "false"))
+    ("spaceRequire" ("true" "false"))
+    ("italicComments" ("true" "false"))
+    ("rightComments" ("true" "false"))
+    ("commentColor")
+    ("beginComment")
+    ("endComment")
+    ("beginLComment")
+    ("endLComment"))
+  "Package options for the algpseudocodex package.")
+
 (defun LaTeX-algpseudocodex-package-options ()
-  "Package options for the algpseudocodex package."
-  (TeX-read-key-val t '(("noEnd" ("true" "false"))
-                        ("indLines" ("true" "false"))
-                        ("spaceRequire" ("true" "false"))
-                        ("italicComments" ("true" "false"))
-                        ("rightComments" ("true" "false"))
-                        ("commentColor")
-                        ("beginComment")
-                        ("endComment")
-                        ("beginLComment")
-                        ("endLComment"))))
+  "Prompt for package options for the algpseudocodex package."
+  (TeX-read-key-val t LaTeX-algpseudocodex-package-options-list))
 
 ;;; algpseudocodex.el ends here
diff --git a/style/amsthm.el b/style/amsthm.el
index ad06ff8919..8305ed565f 100644
--- a/style/amsthm.el
+++ b/style/amsthm.el
@@ -1,6 +1,6 @@
 ;;; amsthm.el --- Style hook for the AMS-LaTeX amsthm package.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1997--2022  Free Software Foundation, Inc.
+;; Copyright (C) 1997--2023  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@strw.leidenuniv.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -98,12 +98,13 @@ make them available as new environments."
            (LaTeX-add-environments (list nthm #'LaTeX-env-label-args 
["Heading"]))
            (TeX-argument-insert nthm optional)))
       [ TeX-arg-environment "Numbered like" ]
-      t [ (TeX-arg-eval progn (if (eq (save-excursion
-                                        (backward-char 2)
-                                        (preceding-char)) ?\])
-                                  ()
-                                (TeX-arg-counter t "Within counter"))
-                        "") ])
+      "Title"
+      (TeX-arg-conditional (save-excursion
+                             (skip-chars-backward (concat "^" TeX-grcl))
+                             (backward-list)
+                             (= (preceding-char) ?\]))
+          ()
+        ([TeX-arg-counter "Within counter"])))
 
     `("newtheorem*"
       ,(lambda (optional)
diff --git a/style/babel.el b/style/babel.el
index 70cc56585d..495e9f6468 100644
--- a/style/babel.el
+++ b/style/babel.el
@@ -1,6 +1,6 @@
-;;; babel.el --- AUCTeX style for `babel.sty' version 3.31.  -*- 
lexical-binding: t; -*-
+;;; babel.el --- AUCTeX style for `babel.sty' version 3.88.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2005-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2005-2023  Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -26,7 +26,7 @@
 
 ;;; Commentary:
 
-;; This file adds support for `babel.sty' version 3.31 from 2019/05/04.
+;; This file adds support for `babel.sty' version 3.88 from 2023/04/18.
 
 ;;; Code:
 
@@ -43,6 +43,7 @@
 (declare-function LaTeX-fontspec-auto-cleanup
                   "fontspec"
                   ())
+(defvar LaTeX-fontenc-package-options)
 
 (defvar LaTeX-babel-language-list
   '("afrikaans"
@@ -255,6 +256,7 @@
       (TeX-arg-completing-read (LaTeX-babel-active-languages)
                                "Language"))
     '("foreignlanguage"
+      [TeX-arg-completing-read-multiple ("date" "captions")]
       (TeX-arg-completing-read (LaTeX-babel-active-languages)
                                "Language")
       t)
@@ -363,6 +365,7 @@
       (TeX-arg-completing-read (LaTeX-babel-active-languages)
                                "Language"))
     '("otherlanguage*" LaTeX-env-args
+      [TeX-arg-completing-read-multiple ("date" "captions")]
       (TeX-arg-completing-read (LaTeX-babel-active-languages)
                                "Language"))
     '("hyphenrules" LaTeX-env-args
@@ -373,7 +376,6 @@
    (when (and (featurep 'font-latex)
               (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("selectlanguage"     "{")
-                                ("foreignlanguage"    "{{")
                                 ("babeltags"          "{")
                                 ("babelensure"        "{{")
                                 ("shorthandon"        "{")
@@ -393,38 +395,49 @@
      (font-latex-add-keywords '(("defineshorthand"    "[{{")
                                 ("aliasshorthand"     "{{")
                                 ("languageattribute"  "{{"))
-                              'variable)))
+                              'variable)
+     (font-latex-add-keywords '(("foreignlanguage"    "[{{"))
+                              'textual)))
  TeX-dialect)
 
+(defvar LaTeX-babel-package-options-list
+  (progn
+    (TeX-load-style "fontenc")
+    (append
+     `(("KeepShorthandsActive")
+       ("activeacute")
+       ("activegrave")
+       ("shorthands" ("off"))
+       ("safe" ("none" "ref" "bib"))
+       ("math" ("active" "normal"))
+       ("config")
+       ("main" ,LaTeX-babel-language-list)
+       ("headfoot" ,LaTeX-babel-language-list)
+       ("noconfigs")
+       ("nocase")
+       ("silent")
+       ("showlanguages")
+       ("nocase")
+       ("silent")
+       ("strings" ,(append
+                    LaTeX-fontenc-package-options
+                    '("generic" "unicode" "encoded")))
+       ("hyphenmap" ("off" "first" "select"
+                     "other" "other*"))
+       ("bidi" ("default" "basic" "basic-r"
+                "bidi-l" "bidi-r"))
+       ("layout" ("sectioning" "counters" "lists"
+                  "contents" "footnotes"  "captions"
+                  "columns" "graphics" "extras"))
+       ("provide" ("*"))
+       ("provide+" ("*"))
+       ("provide*" ("*"))
+       ("base"))
+     (mapcar #'list LaTeX-babel-language-list)))
+  "Package options for the babel package.")
+
 (defun LaTeX-babel-package-options ()
   "Prompt for package options for the babel package."
-  (TeX-read-key-val
-   t
-   (append
-    '(("KeepShorthandsActive")
-      ("activeacute")
-      ("activegrave")
-      ("shorthands" ("off"))
-      ("safe" ("none" "ref" "bib"))
-      ("math" ("active" "normal"))
-      ("config")
-      ("main" LaTeX-babel-language-list)
-      ("headfoot" LaTeX-babel-language-list)
-      ("noconfigs")
-      ("nocase")
-      ("silent")
-      ("showlanguages")
-      ("nocase")
-      ("silent")
-      ("strings" ("generic" "unicode" "encoded"
-                  "OT1" "OT2" "OT3" "OT4" "OT6"
-                  "T1"  "T2A" "T2B" "T2C" "T3" "T4" "T5"
-                  "X2"  "LY1" "LV1" "LGR"))
-      ("hyphenmap" ("off" "first" "select" "other" "other*"))
-      ("bidi" ("default" "basic" "basic-r" "bidi-l" "bidi-r"))
-      ("layout" ("sectioning" "counters" "lists" "contents" "footnotes"
-                 "captions"  "columns" "graphics" "extras"))
-      ("base"))
-    (mapcar #'list LaTeX-babel-language-list))))
+  (TeX-read-key-val t LaTeX-babel-package-options-list))
 
 ;;; babel.el ends here
diff --git a/style/beamer.el b/style/beamer.el
index 765519b934..d0d2e6270f 100644
--- a/style/beamer.el
+++ b/style/beamer.el
@@ -1,6 +1,6 @@
 ;;; beamer.el --- AUCTeX style for the latex-beamer class  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2003-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2003-2023  Free Software Foundation, Inc.
 
 ;; Author: Thomas Baumann <thomas.baumann@ch.tum.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -37,6 +37,9 @@
 (declare-function font-latex-add-keywords
                   "font-latex"
                   (keywords class))
+(defvar LaTeX-hyperref-package-options-list)
+(defvar LaTeX-color-package-options)
+(defvar LaTeX-xcolor-package-options)
 
 (defun LaTeX-beamer-after-insert-env (env start _end)
   "Do beamer-specific stuff after the insertion of an environment."
@@ -608,22 +611,30 @@ also be a string.  Then the length of the string is used."
     (and (fboundp 'reftex-notice-new-section)
          (reftex-notice-new-section))))
 
+(defvar LaTeX-beamer-class-options-list
+  (progn
+    (TeX-load-style "hyperref")
+    (TeX-load-style "color")
+    (TeX-load-style "xcolor")
+    `(("usepdftitle" ("false")) ("envcountsect")
+      ("notheorems") ("noamsthm") ("compress") ("t") ("c")
+      ("leqno") ("fleqn") ("handout") ("trans")
+      ("ignorenonframetext") ("onlytextwidth")
+      ("noamssymb") ("bigger") ("smaller") ("8pt") ("9pt")
+      ("10pt") ("11pt") ("12pt") ("14pt") ("17pt") ("20pt")
+      ("draft") ("CJK") ("cjk") ("pgf")
+      ;; Take only the keys from `LaTeX-hyperref-package-options-list'
+      ;; since a new alist doesn't make sense here and isn't
+      ;; recognized as such:
+      ("hyperref" ,(mapcar #'car LaTeX-hyperref-package-options-list))
+      ("color" ,LaTeX-color-package-options)
+      ("xcolor" ,LaTeX-xcolor-package-options)
+      ("ucs") ("utf8x") ("utf8")
+      ("aspectratio" ("2013" "1610" "169" "149" "141" "54" "43" "32"))))
+  "Class options for the beamer class.")
+
 (defun LaTeX-beamer-class-options ()
-  "Read the beamer class options from the user."
-  (TeX-load-style "hyperref")
-  (TeX-load-style "color")
-  (TeX-load-style "xcolor")
-  (TeX-read-key-val t '(("usepdftitle" ("false")) ("envcountsect")
-                        ("notheorems") ("noamsthm") ("compress") ("t") ("c")
-                        ("leqno") ("fleqn") ("handout") ("trans")
-                        ("ignorenonframetext") ("onlytextwidth")
-                        ("noamssymb") ("bigger") ("smaller") ("8pt") ("9pt")
-                        ("10pt") ("11pt") ("12pt") ("14pt") ("17pt") ("20pt")
-                        ("draft") ("CJK") ("cjk") ("pgf")
-                        ("hyperref" LaTeX-hyperref-package-options-list)
-                        ("color" LaTeX-color-package-options)
-                        ("xcolor" LaTeX-xcolor-package-options)
-                        ("ucs") ("utf8x") ("utf8")
-                        ("aspectratio" ("2013" "1610" "169" "149" "141" "54" 
"43" "32")))))
+  "Prompt for the class options for the beamer class."
+  (TeX-read-key-val t LaTeX-beamer-class-options-list))
 
 ;;; beamer.el ends here
diff --git a/style/bicaption.el b/style/bicaption.el
index 245b45410b..c0ed9773d4 100644
--- a/style/bicaption.el
+++ b/style/bicaption.el
@@ -1,6 +1,6 @@
 ;;; bicaption.el --- AUCTeX style for `bicaption.sty' (v1.1-158)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016--2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -187,20 +187,22 @@ square brackets."
                               'textual)))
  TeX-dialect)
 
+(defun LaTeX-bicaption-package-options-list ()
+  "Return an alist of package options for bicaption package."
+  (TeX-load-style "caption")
+  (append `(,(list "language"
+                   (cond ((and (member "babel" (TeX-style-list))
+                               (LaTeX-babel-active-languages))
+                          (butlast (LaTeX-babel-active-languages)))
+                         ((and (member "polyglossia" (TeX-style-list))
+                               (LaTeX-polyglossia-active-languages))
+                          (butlast (LaTeX-babel-active-languages)))
+                         (t nil))))
+          LaTeX-bicaption-key-val-options
+          LaTeX-caption-key-val-options))
+
 (defun LaTeX-bicaption-package-options ()
   "Prompt for package options for the bicaption package."
-  (TeX-load-style "caption")
-  (TeX-read-key-val t
-                    (append
-                     `(,(list "language"
-                              (cond ((and (member "babel" (TeX-style-list))
-                                          (LaTeX-babel-active-languages))
-                                     (butlast (LaTeX-babel-active-languages)))
-                                    ((and (member "polyglossia" 
(TeX-style-list))
-                                          (LaTeX-polyglossia-active-languages))
-                                     (butlast (LaTeX-babel-active-languages)))
-                                    (t nil))))
-                     LaTeX-bicaption-key-val-options
-                     LaTeX-caption-key-val-options)))
+  (TeX-read-key-val t (LaTeX-bicaption-package-options-list)))
 
 ;;; bicaption.el ends here
diff --git a/style/caption.el b/style/caption.el
index 073dff4e2a..db745142ac 100644
--- a/style/caption.el
+++ b/style/caption.el
@@ -1,6 +1,6 @@
 ;;; caption.el --- AUCTeX style for `caption.sty' (v3.4a)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2015--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -384,16 +384,16 @@ STAR is non-nil, do not query for a short-caption and a 
label."
 
     '("captionsetup"
       (TeX-arg-conditional (member "bicaption" (TeX-style-list))
-                           ([LaTeX-arg-bicaption-captionsetup])
-                           ([TeX-arg-completing-read
-                             LaTeX-caption-supported-float-types "Float 
type"]))
+          ([LaTeX-arg-bicaption-captionsetup])
+        ([TeX-arg-completing-read
+          LaTeX-caption-supported-float-types "Float type"]))
       (TeX-arg-key-val (LaTeX-caption-key-val-options)))
 
     '("captionsetup*"
       (TeX-arg-conditional (member "bicaption" (TeX-style-list))
-                           ([LaTeX-arg-bicaption-captionsetup])
-                           ([TeX-arg-completing-read
-                             LaTeX-caption-supported-float-types "Float 
type"]))
+          ([LaTeX-arg-bicaption-captionsetup])
+        ([TeX-arg-completing-read
+          LaTeX-caption-supported-float-types "Float type"]))
       (TeX-arg-key-val (LaTeX-caption-key-val-options)))
 
     '("clearcaptionsetup"
@@ -476,12 +476,15 @@ STAR is non-nil, do not query for a short-caption and a 
label."
                               'function)) )
  TeX-dialect)
 
+(defvar LaTeX-caption-package-options-list
+  (append '(("compatibility"  ("true" "false"))
+            ("figureposition" ("top" "above" "bottom" "below"))
+            ("tableposition"  ("top" "above" "bottom" "below")))
+          LaTeX-caption-key-val-options)
+  "Package options for the caption package.")
+
 (defun LaTeX-caption-package-options ()
   "Prompt for package options for the caption package."
-  (TeX-read-key-val t
-                    (append '(("compatibility"  ("true" "false")))
-                            '(("figureposition" ("top" "above" "bottom" 
"below")))
-                            '(("tableposition"  ("top" "above" "bottom" 
"below")))
-                            LaTeX-caption-key-val-options)))
+  (TeX-read-key-val t LaTeX-caption-package-options-list))
 
 ;;; caption.el ends here
diff --git a/style/changelog.el b/style/changelog.el
index 1f7dccea04..8f4ee31be3 100644
--- a/style/changelog.el
+++ b/style/changelog.el
@@ -1,6 +1,6 @@
 ;;; changelog.el --- AUCTeX style for `changelog.sty' (v2.0.0)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2019--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -83,7 +83,7 @@ OPTIONAL is ignored."
   (let* ((s (save-excursion
               (LaTeX-find-matching-begin)
               (point)))
-         (currenv LaTeX-current-environment)
+         (currenv (LaTeX-current-environment))
          ;; Extract the chosen sectioning command
          (sec (save-excursion
                 (re-search-backward
diff --git a/style/changes.el b/style/changes.el
index b0277686b4..96ca2c233a 100644
--- a/style/changes.el
+++ b/style/changes.el
@@ -1,6 +1,6 @@
 ;;; changes.el --- AUCTeX style for `changes.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2021--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2021--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -172,39 +172,41 @@
                               'reference)))
  TeX-dialect)
 
-(defun LaTeX-changes-package-options ()
-  "Prompt for package options for the changes package."
+(defun LaTeX-changes-package-options-list ()
+  "Return an alist of package options for changes package."
   (TeX-load-style "xcolor")
   (TeX-load-style "truncate")
   (TeX-load-style "ulem")
-  (TeX-read-key-val
-   t
-   (append
-    `(("defaultcolor"
-       ,(if (and (fboundp 'LaTeX-xcolor-definecolor-list)
-                 (LaTeX-xcolor-definecolor-list))
-            (mapcar #'car (LaTeX-xcolor-definecolor-list))
-          LaTeX-xcolor-base-colors)))
-    `(("draft")
-      ("final")
-      ("commandnameprefix" ("none" "ifneeded" "always"))
-      ("markup" ("default" "underlined" "bfit" "nocolor"))
-      ("addedmarkup" ("colored" "uline" "uuline" "uwave"
-                      "dashuline" "dotuline"
-                      "bf" "it" "sl" "em"))
-      ("deletedmarkup" ("sout" "xout" "colored"
-                        "uline" "uuline" "uwave"
-                        "dashuline" "dotuline"
-                        "bf" "it" "sl" "em"))
-      ("highlightmarkup" ("background" "uuline" "uwave"))
-      ("commentmarkup" ("todo" "margin" "footnote" "uwave"))
-      ("authormarkup" ("superscript" "subscript" "brackets"
-                       "footnote" "none"))
-      ("authormarkupposition" ("right" "left"))
-      ("authormarkuptext" ("id" "name"))
-      ("todonotes")
-      ("truncate" ,LaTeX-truncate-package-options)
-      ("ulem" ,LaTeX-ulem-package-options)
-      ("xcolor" ,LaTeX-xcolor-package-options)))))
+  (append
+   `(("defaultcolor"
+      ,(if (and (fboundp 'LaTeX-xcolor-definecolor-list)
+                (LaTeX-xcolor-definecolor-list))
+           (mapcar #'car (LaTeX-xcolor-definecolor-list))
+         LaTeX-xcolor-base-colors)))
+   `(("draft")
+     ("final")
+     ("commandnameprefix" ("none" "ifneeded" "always"))
+     ("markup" ("default" "underlined" "bfit" "nocolor"))
+     ("addedmarkup" ("colored" "uline" "uuline" "uwave"
+                     "dashuline" "dotuline"
+                     "bf" "it" "sl" "em"))
+     ("deletedmarkup" ("sout" "xout" "colored"
+                       "uline" "uuline" "uwave"
+                       "dashuline" "dotuline"
+                       "bf" "it" "sl" "em"))
+     ("highlightmarkup" ("background" "uuline" "uwave"))
+     ("commentmarkup" ("todo" "margin" "footnote" "uwave"))
+     ("authormarkup" ("superscript" "subscript" "brackets"
+                      "footnote" "none"))
+     ("authormarkupposition" ("right" "left"))
+     ("authormarkuptext" ("id" "name"))
+     ("todonotes")
+     ("truncate" ,LaTeX-truncate-package-options)
+     ("ulem" ,LaTeX-ulem-package-options)
+     ("xcolor" ,LaTeX-xcolor-package-options))))
+
+(defun LaTeX-changes-package-options ()
+  "Prompt for package options for the changes package."
+  (TeX-read-key-val t (LaTeX-changes-package-options-list)))
 
 ;;; changes.el ends here
diff --git a/style/csquotes.el b/style/csquotes.el
index 9caf2a3bf1..a736f2e54c 100644
--- a/style/csquotes.el
+++ b/style/csquotes.el
@@ -1,6 +1,6 @@
 ;;; csquotes.el --- AUCTeX style for `csquotes.sty' (v5.2j)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2004--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2004--2023 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -342,73 +342,77 @@ retrieve the active languages."
                                 'variable))))
  TeX-dialect)
 
+(defvar LaTeX-csquotes-package-options-list
+  '(("strict"     ("true" "false"))
+    ("style"      ("american"
+                   "australian"
+                   "austrian"
+                   "brazil"
+                   "brazilian"
+                   "british"
+                   "canadian"
+                   "croatian"
+                   "czech"
+                   "danish"
+                   "dutch"
+                   "english"
+                   "finnish"
+                   "french"
+                   "german"
+                   "greek"
+                   "italian"
+                   "mexican"
+                   "naustrian"
+                   "newzealand"
+                   "ngerman"
+                   "norsk"
+                   "norwegian"
+                   "nswissgerman"
+                   "nynorsk"
+                   "portuges"
+                   "portuguese"
+                   "russian"
+                   "serbian"
+                   "spanish"
+                   "swedish"
+                   "swiss"
+                   "swissgerman"
+                   "UKenglish"
+                   "USenglish"))
+    ("autostyle"  ("true" "false" "try" "once" "tryonce"))
+    ("austrian"   ("quotes" "guillemets"))
+    ("croatian"   ("quotes" "guillemets" "guillemets*"))
+    ("czech"      ("quotes" "guillemets"))
+    ("danish"     ("quotes" "guillemets" "topquotes"))
+    ("english"    ("american" "british"))
+    ("estonian")
+    ("french"     ("quotes" "quotes*" "guillemets" "guillemets*"))
+    ("galician"   ("quotes" "guillemets"))
+    ("german"     ("quotes" "guillemets" "swiss"))
+    ("hungarian")
+    ("italian"    ("guillemets" "quotes"))
+    ("latvian")
+    ("norwegian"  ("guillemets" "quotes"))
+    ("polish"     ("guillemets" "guillemets*"))
+    ("portuguese" ("portuguese" "brazilian"))
+    ("serbian"    ("quotes" "guillemets" "german"))
+    ("spanish"    ("spanish" "mexican"))
+    ("swedish"    ("quotes" "guillemets" "guillemets*"))
+    ("maxlevel")
+    ("autopunct"     ("true" "false"))
+    ("threshold")
+    ("thresholdtype" ("lines" "words"))
+    ("parthreshold"  ("true" "false"))
+    ("splitcomp"     ("true" "false"))
+    ("csdisplay"     ("true" "false"))
+    ("debug"         ("true" "false"))
+    ;; "babel" key is deprecated, replaced by "autostyle":
+    ;; ("babel" ("true" "false" "try" "once" "tryonce"))
+    ("version"       ("4.4" "3.6" "3.0")))
+  "Package options for the csquotes package.")
+
 (defun LaTeX-csquotes-package-options ()
   "Prompt for package options for the csquotes package."
-  (TeX-read-key-val t '(("strict"     ("true" "false"))
-                        ("style"      ("american"
-                                       "australian"
-                                       "austrian"
-                                       "brazil"
-                                       "brazilian"
-                                       "british"
-                                       "canadian"
-                                       "croatian"
-                                       "czech"
-                                       "danish"
-                                       "dutch"
-                                       "english"
-                                       "finnish"
-                                       "french"
-                                       "german"
-                                       "greek"
-                                       "italian"
-                                       "mexican"
-                                       "naustrian"
-                                       "newzealand"
-                                       "ngerman"
-                                       "norsk"
-                                       "norwegian"
-                                       "nswissgerman"
-                                       "nynorsk"
-                                       "portuges"
-                                       "portuguese"
-                                       "russian"
-                                       "serbian"
-                                       "spanish"
-                                       "swedish"
-                                       "swiss"
-                                       "swissgerman"
-                                       "UKenglish"
-                                       "USenglish"))
-                        ("autostyle"  ("true" "false" "try" "once" "tryonce"))
-                        ("austrian"   ("quotes" "guillemets"))
-                        ("croatian"   ("quotes" "guillemets" "guillemets*"))
-                        ("czech"      ("quotes" "guillemets"))
-                        ("danish"     ("quotes" "guillemets" "topquotes"))
-                        ("english"    ("american" "british"))
-                        ("estonian")
-                        ("french"     ("quotes" "quotes*" "guillemets" 
"guillemets*"))
-                        ("galician"   ("quotes" "guillemets"))
-                        ("german"     ("quotes" "guillemets" "swiss"))
-                        ("hungarian")
-                        ("italian"    ("guillemets" "quotes"))
-                        ("latvian")
-                        ("norwegian"  ("guillemets" "quotes"))
-                        ("polish"     ("guillemets" "guillemets*"))
-                        ("portuguese" ("portuguese" "brazilian"))
-                        ("serbian"    ("quotes" "guillemets" "german"))
-                        ("spanish"    ("spanish" "mexican"))
-                        ("swedish"    ("quotes" "guillemets" "guillemets*"))
-                        ("maxlevel")
-                        ("autopunct"     ("true" "false"))
-                        ("threshold")
-                        ("thresholdtype" ("lines" "words"))
-                        ("parthreshold"  ("true" "false"))
-                        ("splitcomp"     ("true" "false"))
-                        ("csdisplay"     ("true" "false"))
-                        ("debug"         ("true" "false"))
-                        ;; "babel" key is deprecated, replaced by "autostyle":
-                        ;; ("babel" ("true" "false" "try" "once" "tryonce"))
-                        ("version"       ("4.4" "3.6" "3.0")))))
+  (TeX-read-key-val t LaTeX-csquotes-package-options-list))
 
 ;;; csquotes.el ends here
diff --git a/style/dinbrief.el b/style/dinbrief.el
index fe8a5e99b0..c3108466f4 100644
--- a/style/dinbrief.el
+++ b/style/dinbrief.el
@@ -1,6 +1,6 @@
 ;;; dinbrief.el --- Special code for LaTeX-Style dinbrief.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1994-2021  Free Software Foundation, Inc.
+;; Copyright (C) 1994-2023  Free Software Foundation, Inc.
 
 ;; Author: Werner Fink <werner@suse.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -71,28 +71,23 @@
 
 (defun LaTeX-dinbrief-style ()
   "Insert some useful packages for writing german letters."
-  ;; COMPATIBILITY for EMACS<26
-  (let ((func (if (fboundp 'indent-relative-first-indent-point)
-                  #'indent-relative-first-indent-point
-                ;; Stay away from using #' to avoid compiler warning.
-                'indent-relative-maybe)))
-    (save-excursion
-      (goto-char (point-min)) ; insert before \begin{document}
-      (if (re-search-forward ".begin.document." (point-max) t)
-          (beginning-of-line 1))
-      (open-line 2)
-      (funcall func)
-      (LaTeX-dinbrief-insert TeX-esc "usepackage"
-                             LaTeX-optop "latin1,utf8" LaTeX-optcl
-                             TeX-grop "inputenc" TeX-grcl)
-      (newline-and-indent)
-      (LaTeX-dinbrief-insert TeX-esc "usepackage"
-                             LaTeX-optop "T1" LaTeX-optcl
-                             TeX-grop "fontenc" TeX-grcl)
-      (funcall func)
-      (LaTeX-dinbrief-insert TeX-esc "usepackage"
-                             TeX-grop "ngerman" TeX-grcl))
-    (TeX-run-style-hooks "inputenc" "fontenc" "ngerman")))
+  (save-excursion
+    (goto-char (point-min)) ; insert before \begin{document}
+    (if (re-search-forward ".begin.document." (point-max) t)
+        (beginning-of-line 1))
+    (open-line 2)
+    (indent-relative-first-indent-point)
+    (LaTeX-dinbrief-insert TeX-esc "usepackage"
+                           LaTeX-optop "latin1,utf8" LaTeX-optcl
+                           TeX-grop "inputenc" TeX-grcl)
+    (newline-and-indent)
+    (LaTeX-dinbrief-insert TeX-esc "usepackage"
+                           LaTeX-optop "T1" LaTeX-optcl
+                           TeX-grop "fontenc" TeX-grcl)
+    (indent-relative-first-indent-point)
+    (LaTeX-dinbrief-insert TeX-esc "usepackage"
+                           TeX-grop "ngerman" TeX-grcl))
+  (TeX-run-style-hooks "inputenc" "fontenc" "ngerman"))
 
 (defun LaTeX-dinbrief-env-recipient (environment)
   "Insert ENVIRONMENT and prompt for recipient and address."
@@ -108,12 +103,7 @@
         (opening (TeX-read-string "Anrede: "))
         (closing (TeX-read-string "Schluss: "))
         (signature (TeX-read-string "Unterschrift: "))
-        (anlage (TeX-read-string "Anlagen: "))
-        ;; COMPATIBILITY for EMACS<26
-        (func (if (fboundp 'indent-relative-first-indent-point)
-                  #'indent-relative-first-indent-point
-                ;; Stay away from using #' to avoid compiler warning.
-                'indent-relative-maybe)))
+        (anlage (TeX-read-string "Anlagen: ")))
     (if (string= fenster "ja")
         (progn
           (LaTeX-dinbrief-insert TeX-esc "enabledraftstandard")
@@ -201,7 +191,7 @@
                              opening)
                            TeX-grcl "\n")
 
-    (funcall func)
+    (indent-relative-first-indent-point)
     (save-excursion
       (LaTeX-dinbrief-insert "\n" TeX-esc "closing"
                              TeX-grop
@@ -209,7 +199,7 @@
                                  (concat TeX-esc " ")
                                closing)
                              TeX-grcl "\n")
-      (funcall func))))
+      (indent-relative-first-indent-point))))
 
 (defun LaTeX-dinbrief-sender ()
   "Read and write the senders address."
diff --git a/style/expl3.el b/style/expl3.el
index 51250bd88e..4326f95be6 100644
--- a/style/expl3.el
+++ b/style/expl3.el
@@ -83,14 +83,18 @@
                               'function)))
  TeX-dialect)
 
+(defvar LaTeX-expl3-package-options-list
+  '(("check-declarations" ("true" "false"))
+    ("log-functions" ("true" "false"))
+    ("enable-debug" ("true" "false"))
+    ("backend" ("dvips"   "dvipdfmx"
+                "dvisvgm" "luatex"
+                "pdftex"  "xetex"))
+    ("suppress-backend-headers" ("true" "false")))
+  "Package options for the expl3 package.")
+
 (defun LaTeX-expl3-package-options ()
-  "Read the expl3 package options from the user."
-  (TeX-read-key-val t '(("check-declarations" ("true" "false"))
-                        ("log-functions" ("true" "false"))
-                        ("enable-debug" ("true" "false"))
-                        ("backend" ("dvips"   "dvipdfmx"
-                                    "dvisvgm" "luatex"
-                                    "pdftex"  "xetex"))
-                        ("suppress-backend-headers" ("true" "false")))))
+  "Prompt for package options for the expl3 package."
+  (TeX-read-key-val t LaTeX-expl3-package-options-list))
 
 ;;; expl3.el ends here
diff --git a/style/fontenc.el b/style/fontenc.el
index ba430db8ce..abbd6a2a9e 100644
--- a/style/fontenc.el
+++ b/style/fontenc.el
@@ -1,6 +1,6 @@
 ;;; fontenc.el --- AUCTeX style for `fontenc.sty' (v1.99g)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2021  Free Software Foundation, Inc.
+;; Copyright (C) 2015--2023  Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,9 +31,7 @@
 
 ;;; Code:
 
-(require 'tex)
-
-(defvar LaTeX-fontenc-package-options-list
+(defvar LaTeX-fontenc-package-options
   '(;; 128+ glyph encodings (text)
     "OT1" "OT2" "OT3" "OT4" "OT6"
     ;; 256 glyph encodings (text)
@@ -44,12 +42,4 @@
     "LY1" "LV1" "LGR")
   "Package options for the fontenc package.")
 
-(defun LaTeX-fontenc-package-options ()
-  "Prompt for package options for the fontenc package."
-  (mapconcat #'identity
-             (TeX-completing-read-multiple
-              "Encoding(s): "
-              LaTeX-fontenc-package-options-list)
-             ","))
-
 ;;; fontenc.el ends here
diff --git a/style/geometry.el b/style/geometry.el
index f1cab73035..aa169ce84a 100644
--- a/style/geometry.el
+++ b/style/geometry.el
@@ -1,6 +1,6 @@
 ;;; geometry.el --- AUCTeX style for `geometry.sty' (v5.6)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2015--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -148,10 +148,13 @@ package.")
        (setq TeX-PDF-from-DVI "Dvipdfmx")))
  TeX-dialect)
 
+(defvar LaTeX-geometry-package-options-list
+  (append LaTeX-geometry-preamble-key-val-options
+          LaTeX-geometry-always-key-val-options)
+  "Package options for the geometry package.")
+
 (defun LaTeX-geometry-package-options ()
   "Prompt for package options for the geometry package."
-  (TeX-read-key-val t
-                    (append LaTeX-geometry-preamble-key-val-options
-                            LaTeX-geometry-always-key-val-options)))
+  (TeX-read-key-val t LaTeX-geometry-package-options-list))
 
 ;;; geometry.el ends here
diff --git a/style/letter.el b/style/letter.el
index 5c64c28baa..32c938ec43 100644
--- a/style/letter.el
+++ b/style/letter.el
@@ -1,6 +1,6 @@
 ;;; letter.el - Special code for letter style.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1993, 2012, 2013, 2014, 2018, 2020 Free Software Foundation, 
Inc.
+;; Copyright (C) 1993-2023 Free Software Foundation, Inc.
 
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Maintainer: auctex-devel@gnu.org
@@ -101,12 +101,7 @@
         (signature (TeX-read-string "Signature: "))
         (opening (TeX-read-string "Opening: "))
         (closing (TeX-read-string "Closing: "))
-        (date (TeX-read-string "Date: " (LaTeX-today)))
-        ;; COMPATIBILITY for EMACS<26
-        (func (if (fboundp 'indent-relative-first-indent-point)
-                  #'indent-relative-first-indent-point
-                ;; Stay away from using #' to avoid compiler warning.
-                'indent-relative-maybe)))
+        (date (TeX-read-string "Date: " (LaTeX-today))))
 
     (insert TeX-esc "name" TeX-grop sender TeX-grcl)
     (newline-and-indent)
@@ -157,7 +152,7 @@
               opening)
             TeX-grcl "\n")
 
-    (funcall func)
+    (indent-relative-first-indent-point)
     (save-excursion
       (insert "\n" TeX-esc "closing"
               TeX-grop
@@ -165,7 +160,7 @@
                   (concat TeX-esc " ")
                 closing)
               TeX-grcl "\n")
-      (funcall func))))
+      (indent-relative-first-indent-point))))
 
 (defun LaTeX-today nil
   "Return a string representing todays date according to flavor."
diff --git a/style/mdsymbol.el b/style/mdsymbol.el
index d82f87eef8..dfc89e9f24 100644
--- a/style/mdsymbol.el
+++ b/style/mdsymbol.el
@@ -1,6 +1,6 @@
 ;;; mdsymbol.el --- AUCTeX style for `mdsymbol.sty' (v0.5)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2014, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -85,9 +85,8 @@
       '("lambdaslash"))))
  TeX-dialect)
 
-(defvar LaTeX-mdsymbol-package-options
-  '(;;
-    ("normalweight"  ("Light" "Regular" "autolight" "autoregular"))
+(defvar LaTeX-mdsymbol-package-options-list
+  '(("normalweight"  ("Light" "Regular" "autolight" "autoregular"))
     ("boldweight"    ("Semibold" "Bold" "autosemibold"))
     ("onlysansmath"  ("true" "false"))
     ("retainmissing" ("true" "false"))
@@ -97,6 +96,6 @@
 
 (defun LaTeX-mdsymbol-package-options nil
   "Prompt for package options for the mdsymbol package."
-  (TeX-read-key-val t LaTeX-mdsymbol-package-options))
+  (TeX-read-key-val t LaTeX-mdsymbol-package-options-list))
 
 ;;; mdsymbol.el ends here
diff --git a/style/menukeys.el b/style/menukeys.el
index 72b5560deb..62c905d8b8 100644
--- a/style/menukeys.el
+++ b/style/menukeys.el
@@ -1,6 +1,6 @@
 ;;; menukeys.el --- AUCTeX style for `menukeys.sty' (v1.4)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -220,62 +220,57 @@ macro.  If RENEW is non-nil, query for an already defined 
macro."
 
     ;; 4.2.2 Declaring styles
     ;; \newmenustylesimple*{<name>}[<pre>]{<style>}[<sep>][<post>]{<theme>}
-    '("newmenustylesimple"
-      (TeX-arg-eval
-       (lambda ()
+    `("newmenustylesimple"
+      ,(lambda (optional)
          (let ((name (TeX-read-string
-                      (TeX-argument-prompt nil nil "Name"))))
+                      (TeX-argument-prompt optional nil "Name"))))
            (LaTeX-add-menukeys-newmenustyles name)
-           (format "%s" name))))
+           (TeX-argument-insert name optional)))
       [ t ] nil [ nil ] [ nil ]
       (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
                                "Color theme"))
 
-    '("newmenustylesimple*"
-      (TeX-arg-eval
-       (lambda ()
+    `("newmenustylesimple*"
+      ,(lambda (optional)
          (let ((name (TeX-read-string
-                      (TeX-argument-prompt nil nil "Name"))))
+                      (TeX-argument-prompt optional nil "Name"))))
            (LaTeX-add-menukeys-newmenustyles name)
-           (format "%s" name))))
+           (TeX-argument-insert name optional)))
       [ t ] nil [ nil ] [ nil ]
-      (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list) "Color 
theme"))
+      (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
+                               "Color theme"))
 
     ;; 
\newmenustyle*{<name>}[<pre>]{<first>}[<sep>]{<mid>}{<last>}{<single>}[<post>]{<theme>}
-    '("newmenustyle"
-      (TeX-arg-eval
-       (lambda ()
+    `("newmenustyle"
+      ,(lambda (optional)
          (let ((name (TeX-read-string
-                      (TeX-argument-prompt nil nil "Name"))))
+                      (TeX-argument-prompt optional nil "Name"))))
            (LaTeX-add-menukeys-newmenustyles name)
-           (format "%s" name))))
+           (TeX-argument-insert name optional)))
       [ t ] nil [ nil ] nil nil nil [ nil ]
-      (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list) "Color 
theme"))
+      (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
+                               "Color theme"))
 
-    '("newmenustyle*"
-      (TeX-arg-eval
-       (lambda ()
+    `("newmenustyle*"
+      ,(lambda (optional)
          (let ((name (TeX-read-string
-                      (TeX-argument-prompt nil nil "Name"))))
+                      (TeX-argument-prompt optional nil "Name"))))
            (LaTeX-add-menukeys-newmenustyles name)
-           (format "%s" name))))
+           (TeX-argument-insert name optional)))
       [ t ] nil [ nil ] nil nil nil [ nil ]
-      (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list) "Color 
theme"))
+      (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
+                               "Color theme"))
 
     '("CurrentMenuElement" 0)
 
     ;; 4.2.3 Copying styles
-    '("copymenustyle"
-      (TeX-arg-eval
-       (lambda ()
+    `("copymenustyle"
+      ,(lambda (optional)
          (let ((copy (TeX-read-string
-                      (TeX-argument-prompt nil nil "Copy")))
-               (orig (completing-read
-                      (TeX-argument-prompt nil nil "Original")
-                      (LaTeX-menukeys-newmenustyle-list))))
+                      (TeX-argument-prompt optional nil "Copy"))))
            (LaTeX-add-menukeys-newmenustyles copy)
-           (TeX-argument-insert copy nil)
-           (format "%s" orig)))))
+           (TeX-argument-insert copy optional)))
+      (TeX-arg-completing-read (LaTeX-menukeys-newmenustyle-list) "Original"))
 
     ;; 4.2.4 Changing styles
     ;; \changemenuelement*{name}{element}{definition}
@@ -294,13 +289,12 @@ macro.  If RENEW is non-nil, query for an already defined 
macro."
       (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
                                "Color theme"))
 
-    '("providemenustylesimple"
-      (TeX-arg-eval
-       (lambda ()
+    `("providemenustylesimple"
+      ,(lambda (optional)
          (let ((name (TeX-read-string
-                      (TeX-argument-prompt nil nil "Name"))))
+                      (TeX-argument-prompt optional nil "Name"))))
            (LaTeX-add-menukeys-newmenustyles name)
-           (format "%s" name))))
+           (TeX-argument-insert name optional)))
       [ t ] nil [ nil ] [ nil ]
       (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
                                "Color theme"))
@@ -312,13 +306,12 @@ macro.  If RENEW is non-nil, query for an already defined 
macro."
       (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
                                "Color theme"))
 
-    '("renewmenustyle"
-      (TeX-arg-eval
-       (lambda ()
+    `("renewmenustyle"
+      ,(lambda (optional)
          (let ((name (TeX-read-string
-                      (TeX-argument-prompt nil nil "Name"))))
+                      (TeX-argument-prompt optional nil "Name"))))
            (LaTeX-add-menukeys-newmenustyles name)
-           (format "%s" name))))
+           (TeX-argument-insert name optional)))
       [ t ] nil [ nil ] nil nil nil [ nil ]
       (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
                                "Color theme"))
@@ -326,116 +319,96 @@ macro.  If RENEW is non-nil, query for an already 
defined macro."
     ;; 4.3 Color themes
     ;; 4.3.2 Create a theme
     ;; \newmenucolortheme{<name>}{<model>}{<bg>}{<br>}{<txt>}[<a>][<b>][<c>]
-    '("newmenucolortheme"
-      (TeX-arg-eval
-       (lambda ()
+    `("newmenucolortheme"
+      ,(lambda (optional)
          (let ((name (TeX-read-string
-                      (TeX-argument-prompt nil nil "Name"))))
+                      (TeX-argument-prompt optional nil "Name"))))
            (LaTeX-add-menukeys-newmenucolorthemes name)
-           (format "%s" name))))
-      (TeX-arg-eval
-       (lambda ()
-         (let ((model (completing-read
-                       (TeX-argument-prompt nil nil "Model")
-                       (LaTeX-xcolor-color-models))))
-           (TeX-argument-insert model nil)
-           (if (string= model "named")
-               (let ((bg (completing-read
-                          (TeX-argument-prompt nil nil "Node background color")
-                          (LaTeX-xcolor-definecolor-list)))
-                     (br (completing-read
-                          (TeX-argument-prompt nil nil "Node border color")
-                          (LaTeX-xcolor-definecolor-list)))
-                     (txt (completing-read
-                           (TeX-argument-prompt nil nil "Node text color")
-                           (LaTeX-xcolor-definecolor-list))))
-                 (TeX-argument-insert bg nil)
-                 (TeX-argument-insert br nil)
-                 (format "%s" txt))
-             (let ((bg (TeX-read-string
-                        (TeX-argument-prompt nil nil "Node background color 
spec")))
-                   (br (TeX-read-string
-                        (TeX-argument-prompt nil nil "Node border color 
spec")))
-                   (txt (TeX-read-string
-                         (TeX-argument-prompt nil nil "Node text color 
spec"))))
-               (TeX-argument-insert bg nil)
-               (TeX-argument-insert br nil)
-               (format "%s" txt))))))
+           (TeX-argument-insert name optional)))
+      (TeX-arg-completing-read (LaTeX-xcolor-color-models) "Model")
+      (TeX-arg-conditional (save-excursion
+                             (re-search-backward
+                              "\\\\newmenucolortheme{[^}]+}{\\([^}]+\\)}"
+                              (line-beginning-position) t)
+                             (string= (match-string-no-properties 1) "named"))
+          ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list)
+                                    "Node background color"))
+        ("Node background color spec"))
+      (TeX-arg-conditional (save-excursion
+                             (re-search-backward
+                              "\\\\newmenucolortheme{[^}]+}{\\([^}]+\\)}"
+                              (line-beginning-position) t)
+                             (string= (match-string-no-properties 1) "named"))
+          ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list)
+                                    "Node border color"))
+        ("Node border color spec"))
+      (TeX-arg-conditional (save-excursion
+                             (re-search-backward
+                              "\\\\newmenucolortheme{[^}]+}{\\([^}]+\\)}"
+                              (line-beginning-position) t)
+                             (string= (match-string-no-properties 1) "named"))
+          ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list)
+                                    "Node text color"))
+        ("Node text color spec"))
       (TeX-arg-conditional (y-or-n-p "With additional optional arguments? ")
-                           ( [ 3 ] )
-                           (ignore)))
+          ( [ 3 ] )
+        (ignore)))
 
     ;; 4.3.3 Copy a theme
-    '("copymenucolortheme"
-      (TeX-arg-eval
-       (lambda ()
+    `("copymenucolortheme"
+      ,(lambda (optional)
          (let ((copy (TeX-read-string
-                      (TeX-argument-prompt nil nil "Copy")))
-               (orig (completing-read
-                      (TeX-argument-prompt nil nil "Original")
-                      (LaTeX-menukeys-newmenucolortheme-list))))
+                      (TeX-argument-prompt optional nil "Copy"))))
            (LaTeX-add-menukeys-newmenucolorthemes copy)
-           (TeX-argument-insert copy nil)
-           (format "%s" orig)))))
+           (TeX-argument-insert copy optional)))
+      (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
+                               "Original"))
 
     ;; 4.3.4 Change a theme
     '("changemenucolor"
       (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list) "Name")
       (TeX-arg-completing-read ("bg" "br" "txt") "Element")
-      (TeX-arg-eval
-       (lambda ()
-         (let ((model (completing-read
-                       (TeX-argument-prompt nil nil "Model")
-                       (LaTeX-xcolor-color-models))))
-           (TeX-argument-insert model nil)
-           (if (string= model "named")
-               (let ((color (completing-read
-                             (TeX-argument-prompt nil nil "Color")
-                             (LaTeX-xcolor-definecolor-list))))
-                 (format "%s" color))
-             (let ((color (TeX-read-string
-                           (TeX-argument-prompt nil nil "Color spec"))))
-               (format "%s" color)))))))
+      (TeX-arg-completing-read (LaTeX-xcolor-color-models) "Model")
+      (TeX-arg-conditional (save-excursion
+                             (re-search-backward
+                              "\\\\changemenucolor{[^}]+}{[^}]+}{\\([^}]+\\)}"
+                              (line-beginning-position) t)
+                             (string= (match-string-no-properties 1) "named"))
+          ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list) "Color"))
+        ("Color spec")))
 
     ;; Same arguments as \newmenucolortheme
     '("renewmenucolortheme"
-      (TeX-arg-eval
-       (lambda ()
-         (let ((name (TeX-read-string
-                      (TeX-argument-prompt nil nil "Name"))))
-           (LaTeX-add-menukeys-newmenucolorthemes name)
-           (format "%s" name))))
-      (TeX-arg-eval
-       (lambda ()
-         (let ((model (completing-read
-                       (TeX-argument-prompt nil nil "Model")
-                       (LaTeX-xcolor-color-models))))
-           (TeX-argument-insert model nil)
-           (if (string= model "named")
-               (let ((bg (completing-read
-                          (TeX-argument-prompt nil nil "Node background color")
-                          (LaTeX-xcolor-definecolor-list)))
-                     (br (completing-read
-                          (TeX-argument-prompt nil nil "Node border color")
-                          (LaTeX-xcolor-definecolor-list)))
-                     (txt (completing-read
-                           (TeX-argument-prompt nil nil "Node text color")
-                           (LaTeX-xcolor-definecolor-list))))
-                 (TeX-argument-insert bg nil)
-                 (TeX-argument-insert br nil)
-                 (format "%s" txt))
-             (let ((bg (TeX-read-string
-                        (TeX-argument-prompt nil nil "Node background color 
spec")))
-                   (br (TeX-read-string
-                        (TeX-argument-prompt nil nil "Node border color 
spec")))
-                   (txt (TeX-read-string
-                         (TeX-argument-prompt nil nil "Node text color 
spec"))))
-               (TeX-argument-insert bg nil)
-               (TeX-argument-insert br nil)
-               (format "%s" txt))))))
+      (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
+                               "Name")
+      (TeX-arg-completing-read (LaTeX-xcolor-color-models) "Model")
+      (TeX-arg-conditional (save-excursion
+                             (re-search-backward
+                              "\\\\renewmenucolortheme{[^}]+}{\\([^}]+\\)}"
+                              (line-beginning-position) t)
+                             (string= (match-string-no-properties 1) "named"))
+          ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list)
+                                    "Node background color"))
+        ("Node background color spec"))
+      (TeX-arg-conditional (save-excursion
+                             (re-search-backward
+                              "\\\\renewmenucolortheme{[^}]+}{\\([^}]+\\)}"
+                              (line-beginning-position) t)
+                             (string= (match-string-no-properties 1) "named"))
+          ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list)
+                                    "Node border color"))
+        ("Node border color spec"))
+      (TeX-arg-conditional (save-excursion
+                             (re-search-backward
+                              "\\\\renewmenucolortheme{[^}]+}{\\([^}]+\\)}"
+                              (line-beginning-position) t)
+                             (string= (match-string-no-properties 1) "named"))
+          ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list)
+                                    "Node text color"))
+        ("Node text color spec"))
       (TeX-arg-conditional (y-or-n-p "With additional optional arguments? ")
-                           ( [ 3 ] )
-                           (ignore)))
+          ( [ 3 ] )
+        (ignore)))
 
     ;; 4.4 Menu macros
     ;; 4.4.2 Defining or changing menu macros
@@ -463,18 +436,17 @@ macro.  If RENEW is non-nil, query for an already defined 
macro."
            (os '("mac" "win"))
            collector)
        (dolist (cmd keycmds)
-         (cond
-          ((= (cdr cmd) 0)
-           (push (car cmd) collector))
-          ((= (cdr cmd) 1)
-           (push (list (car cmd) '(TeX-arg-completing-read
-                                   ("^" "v" ">" "<")
-                                   "Direction"))
-                 collector))
-          ((= (cdr cmd) 2)
-           (push (car cmd) collector)
-           (dolist (x os)
-             (push (concat (car cmd) x) collector)))))
+         (cond ((= (cdr cmd) 0)
+                (push (car cmd) collector))
+               ((= (cdr cmd) 1)
+                (push (list (car cmd)
+                            '(TeX-arg-completing-read  ("^" "v" ">" "<")
+                                                       "Direction"))
+                      collector))
+               ((= (cdr cmd) 2)
+                (push (car cmd) collector)
+                (dolist (x os)
+                  (push (concat (car cmd) x) collector)))))
        (apply #'TeX-add-symbols collector)))
 
    ;; Fontification:
diff --git a/style/microtype.el b/style/microtype.el
index 9287ccaac6..528ad5a2ac 100644
--- a/style/microtype.el
+++ b/style/microtype.el
@@ -1,6 +1,6 @@
 ;;; microtype.el --- AUCTeX style for `microtype.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2022--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -231,10 +231,13 @@
                               'type-declaration)))
  TeX-dialect)
 
+(defvar LaTeX-microtype-package-options-list
+  (append '((config))
+          LaTeX-microtype-key-val-options)
+  "Package options for the microtype package.")
+
 (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)))
+  "Prompt for package options for the microtype package."
+  (TeX-read-key-val t LaTeX-microtype-package-options-list))
 
 ;;; microtype.el ends here
diff --git a/style/natbib.el b/style/natbib.el
index 3cac59606d..b7eb9838fc 100644
--- a/style/natbib.el
+++ b/style/natbib.el
@@ -74,7 +74,9 @@
            ;; Pre and post notes
            (list
             (car cmd)
-            '(TeX-arg-conditional TeX-arg-cite-note-p 
([LaTeX-arg-natbib-notes]) nil)
+            '(TeX-arg-conditional TeX-arg-cite-note-p
+                 (["Pre-note"] LaTeX-arg-natbib-notes)
+               nil)
             #'TeX-arg-cite))))
        citecmds))
 
@@ -173,21 +175,18 @@
      (reftex-set-cite-format 'natbib)))
  TeX-dialect)
 
-(defun LaTeX-arg-natbib-notes (optional)
-  "Prompt for two note arguments a natbib citation command.
-If OPTIONAL is non-nil, insert them in brackets, otherwise in
-braces."
-  (let ((pre (TeX-read-string
-              (TeX-argument-prompt optional nil "Pre-note")))
-        (post (TeX-read-string
-               (TeX-argument-prompt optional nil "Post-note"))))
-    (TeX-argument-insert pre optional)
-    (TeX-argument-insert post optional)
-    ;; pre is given, post is empty: Make sure that we insert an
-    ;; extra pair of `[]', otherwise pre becomes post
-    (when (and pre (not (string= pre ""))
-               (string= post ""))
-      (insert LaTeX-optop LaTeX-optcl))))
+(defun LaTeX-arg-natbib-notes (_optional)
+  "Prompt for the post-note argument of a natbib citation command.
+OPTIONAL is ignored."
+  (let ((post (TeX-read-string
+               (TeX-argument-prompt t nil "Post-note")))
+        (TeX-arg-opening-brace LaTeX-optop)
+        (TeX-arg-closing-brace LaTeX-optcl))
+    ;; Pre-note is given, Post-note is empty: Make sure that we insert
+    ;; an extra pair of `[]', otherwise pre becomes post
+    (if (and (string-empty-p post) (= (preceding-char) ?\]))
+        (insert LaTeX-optop LaTeX-optcl)
+      (TeX-argument-insert post t))))
 
 (defvar LaTeX-natbib-package-options '("numbers" "super" "authoryear"
                                        "round" "square" "angle" "curly"
diff --git a/style/newfloat.el b/style/newfloat.el
index 50b0a4e047..f90b614842 100644
--- a/style/newfloat.el
+++ b/style/newfloat.el
@@ -200,14 +200,15 @@ If `caption.el' is loaded, add the new floating 
environment to
                               'function)))
  TeX-dialect)
 
+(defun LaTeX-newfloat-package-options-list ()
+  "Return an alist of package options for the newfloat package."
+  (append '(("chapterlistsgap"))
+          (if (< (LaTeX-largest-level) 2)
+              '(("within" ("chapter" "section" "none")))
+            '(("within" ("section" "none"))))))
+
 (defun LaTeX-newfloat-package-options ()
   "Prompt for package options for the newfloat package."
-  (TeX-read-key-val
-   t
-   (append
-    '(("chapterlistsgap"))
-    (if (< (LaTeX-largest-level) 2)
-        '(("within" ("chapter" "section" "none")))
-      '(("within" ("section" "none")))))))
+  (TeX-read-key-val t (LaTeX-newfloat-package-options-list)))
 
 ;;; newfloat.el ends here
diff --git a/style/ntheorem.el b/style/ntheorem.el
index 59455b996e..7396970d6f 100644
--- a/style/ntheorem.el
+++ b/style/ntheorem.el
@@ -1,6 +1,6 @@
 ;;; ntheorem.el --- AUCTeX style for `ntheorem.sty' (v1.33)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2015-2023  Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -122,13 +122,9 @@ make them available as new environments.  Update
  (lambda ()
 
    (TeX-auto-add-regexp
-    `(,(concat "\\\\newtheorem{\\(" TeX-token-char "+\\)}")
-      1 LaTeX-auto-ntheorem-newtheorem))
-   (TeX-auto-add-regexp
-    `(,(concat "\\\\newframedtheorem{\\(" TeX-token-char "+\\)}")
-      1 LaTeX-auto-ntheorem-newtheorem))
-   (TeX-auto-add-regexp
-    `(,(concat "\\\\newshadedtheorem{\\(" TeX-token-char "+\\)}")
+    `(,(concat "\\\\"
+               (regexp-opt '("newtheorem" "newframedtheorem" 
"newshadedtheorem"))
+               "{\\(" TeX-token-char "+\\)}")
       1 LaTeX-auto-ntheorem-newtheorem))
    (TeX-auto-add-regexp
     `(,(concat "\\\\newtheoremstyle{\\(" TeX-token-char "+\\)}")
@@ -151,23 +147,25 @@ make them available as new environments.  Update
                                          #'LaTeX-env-label-args ["Heading"]))
            (TeX-argument-insert nthm optional)))
       [ TeX-arg-environment "Numbered like" ]
-      t [ (TeX-arg-eval progn (if (eq (save-excursion
-                                        (backward-char 2)
-                                        (preceding-char)) ?\])
-                                  ()
-                                (TeX-arg-counter t "Within counter"))
-                        "") ])
+      "Title"
+      (TeX-arg-conditional (save-excursion
+                             (skip-chars-backward (concat "^" TeX-grcl))
+                             (backward-list)
+                             (= (preceding-char) ?\]))
+          ()
+        ([TeX-arg-counter "Within counter"])))
 
     '("renewtheorem"
       (TeX-arg-completing-read (LaTeX-ntheorem-newtheorem-list)
                                "Environment")
       [ TeX-arg-environment "Numbered like" ]
-      t [ (TeX-arg-eval progn (if (eq (save-excursion
-                                        (backward-char 2)
-                                        (preceding-char)) ?\])
-                                  ()
-                                (TeX-arg-counter t "Within counter"))
-                        "") ])
+      "Title"
+      (TeX-arg-conditional (save-excursion
+                             (skip-chars-backward (concat "^" TeX-grcl))
+                             (backward-list)
+                             (= (preceding-char) ?\]))
+          ()
+        ([TeX-arg-counter "Within counter"])))
 
     ;; 2.3 Defining the Layout of Theorem Sets
     '("theoremstyle"
@@ -245,12 +243,13 @@ make them available as new environments.  Update
                                          #'LaTeX-env-label-args ["Heading"]))
            (TeX-argument-insert nthm optional)))
       [ TeX-arg-environment "Numbered like" ]
-      t [ (TeX-arg-eval progn (if (eq (save-excursion
-                                        (backward-char 2)
-                                        (preceding-char)) ?\])
-                                  ()
-                                (TeX-arg-counter t "Within counter"))
-                        "") ])
+      "Title"
+      (TeX-arg-conditional (save-excursion
+                             (skip-chars-backward (concat "^" TeX-grcl))
+                             (backward-list)
+                             (= (preceding-char) ?\]))
+          ()
+        ([TeX-arg-counter "Within counter"])))
 
     `("newshadedtheorem"
       ,(lambda (optional)
@@ -263,12 +262,14 @@ make them available as new environments.  Update
                                          #'LaTeX-env-label-args ["Heading"]))
            (TeX-argument-insert nthm optional)))
       [ TeX-arg-environment "Numbered like" ]
-      t [ (TeX-arg-eval progn (if (eq (save-excursion
-                                        (backward-char 2)
-                                        (preceding-char)) ?\])
-                                  ()
-                                (TeX-arg-counter t "Within counter"))
-                        "") ])
+      "Title"
+      (TeX-arg-conditional (save-excursion
+                             (skip-chars-backward (concat "^" TeX-grcl))
+                             (backward-list)
+                             (= (preceding-char) ?\]))
+          ()
+        ([TeX-arg-counter "Within counter"])))
+
     `("shadecolor"
       (TeX-arg-conditional (TeX-member "\\`x?color\\'" (TeX-style-list) 
#'string-match)
           ((TeX-arg-completing-read ,(lambda ()
diff --git a/style/paralist.el b/style/paralist.el
index ee5cef830b..38920ca913 100644
--- a/style/paralist.el
+++ b/style/paralist.el
@@ -1,6 +1,6 @@
 ;;; paralist.el -- AUCTeX style for paralist.sty  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2003-2005, 2014, 2018, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2023 Free Software Foundation, Inc.
 
 ;; Author:   Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -38,20 +38,6 @@
                   "font-latex"
                   (keywords class))
 
-;; Insert an itemize-ish environment and ask for an optional label
-(defun LaTeX-paralist-env-item-opt-label (environment)
-  "Insert ENVIRONMENT, an optional label and the first item."
-  (LaTeX-insert-environment
-   environment
-   (let ((label (TeX-read-string "(Optional) Label: ")))
-     (concat (unless (zerop (length label))
-               (format "[%s]" label)))))
-  (LaTeX-find-matching-begin)
-  (end-of-line 1)
-  (delete-char 1)
-  (delete-horizontal-space)
-  (LaTeX-insert-item))
-
 (TeX-add-style-hook
  "paralist"
  (lambda ()
@@ -74,21 +60,21 @@
 
    ;; New environments
    (LaTeX-add-environments
-    '("asparaenum" LaTeX-paralist-env-item-opt-label)
-    '("inparaenum" LaTeX-paralist-env-item-opt-label)
-    '("compactenum" LaTeX-paralist-env-item-opt-label)
-    '("asparaitem" LaTeX-paralist-env-item-opt-label)
-    '("inparaitem" LaTeX-paralist-env-item-opt-label)
-    '("compactitem" LaTeX-paralist-env-item-opt-label)
+    '("asparaenum" LaTeX-env-item-args ["Label"])
+    '("inparaenum" LaTeX-env-item-args ["Label"])
+    '("compactenum" LaTeX-env-item-args ["Label"])
+    '("asparaitem" LaTeX-env-item-args ["Label"])
+    '("inparaitem" LaTeX-env-item-args ["Label"])
+    '("compactitem" LaTeX-env-item-args ["Label"])
     '("compactdesc" LaTeX-env-item))
    ;; Environments (re)defined only when the package is loaded with particular
    ;; options.
    (unless (LaTeX-provided-package-options-member "paralist" "olditem")
      (LaTeX-add-environments
-      '("itemize" LaTeX-paralist-env-item-opt-label)))
+      '("itemize" LaTeX-env-item-args ["Label"])))
    (unless (LaTeX-provided-package-options-member "paralist" "oldenum")
      (LaTeX-add-environments
-      '("enumerate" LaTeX-paralist-env-item-opt-label)))
+      '("enumerate" LaTeX-env-item-args ["Label"])))
    (when (LaTeX-provided-package-options-member "paralist" "defblank")
      (LaTeX-add-environments
       '("asparablank" LaTeX-env-item)
diff --git a/style/parskip.el b/style/parskip.el
index 861d4698ec..cafca0cb33 100644
--- a/style/parskip.el
+++ b/style/parskip.el
@@ -1,6 +1,6 @@
 ;;; parskip.el --- AUCTeX style for `parskip.sty' (v2.0h)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2022--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -37,14 +37,18 @@
 (require 'tex)
 (require 'latex)
 
-(defun LaTeX-parskip-package-options ()
-  "Prompt for package options for the parskip package."
+(defun LaTeX-parskip-package-options-list ()
+  "Return an alist of 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)))))
+    `(("skip"    ,len)
+      ("tocskip" ,len)
+      ("indent"  ,len)
+      ("parfill" ,len))))
+
+(defun LaTeX-parskip-package-options ()
+  "Prompt for package options for the parskip package."
+  (TeX-read-key-val t (LaTeX-parskip-package-options-list)))
 
 ;;; parskip.el ends here
diff --git a/style/pythontex.el b/style/pythontex.el
index 610a6341ec..8c1399f0de 100644
--- a/style/pythontex.el
+++ b/style/pythontex.el
@@ -1,6 +1,6 @@
 ;;; pythontex.el --- AUCTeX style for `pythontex.sty' (v0.16)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2018--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2018--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -113,24 +113,6 @@ Update the variable `LaTeX-pythontex-language-list' if 
still nil."
   '("py" "sympy" "pylab" "rb" "ruby" "jl" "julia" "octave")
   "List of language families provided by pythontex package.")
 
-(defun LaTeX-env-pythontex (environment)
-  "Insert ENVIRONMENT provided by pythontex package."
-  (let ((session (TeX-read-string
-                  (TeX-argument-prompt t nil "Session")))
-        (fvkeyval (TeX-read-key-val t (LaTeX-fancyvrb-key-val-options))))
-    (LaTeX-insert-environment environment
-                              (concat
-                               (when (and session (not (string= session "")))
-                                 (concat LaTeX-optop session LaTeX-optcl))
-                               ;; We need an extra pair of brackets
-                               ;; when no session is given but
-                               ;; key=vals are available
-                               (when (and session (string= session "")
-                                          fvkeyval (not (string= fvkeyval "")))
-                                 (concat LaTeX-optop LaTeX-optcl))
-                               (when (and fvkeyval (not (string= fvkeyval "")))
-                                 (concat LaTeX-optop fvkeyval LaTeX-optcl))))))
-
 ;; Setup for \saveprintpythontex & \savestdoutpythontex &
 ;; \savestderrpythontex
 (TeX-auto-add-type "pythontex-savecontent" "LaTeX")
@@ -248,7 +230,9 @@ a list of strings."
                     verb-macs))
      (apply #'LaTeX-add-environments
             (mapcar (lambda (env)
-                      (list env #'LaTeX-env-pythontex))
+                      (list env #'LaTeX-env-args
+                            [ "Session" ]
+                            [TeX-arg-key-val 
(LaTeX-fancyvrb-key-val-options)]))
                     verb-envs))
      ;; Filling:
      (dolist (mac verb-macs)
diff --git a/style/revtex4-2.el b/style/revtex4-2.el
index 26a5eff5d2..13020afbaa 100644
--- a/style/revtex4-2.el
+++ b/style/revtex4-2.el
@@ -1,6 +1,6 @@
 ;;; revtex4-2.el --- AUCTeX style for `revtex4-2.cls' (v4.2c)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -38,6 +38,8 @@
 (declare-function font-latex-add-keywords
                   "font-latex"
                   (keywords class))
+(declare-function font-latex-set-syntactic-keywords
+                  "font-latex")
 (defvar LaTeX-natbib-package-options)
 (defvar LaTeX-url-package-options)
 
@@ -132,10 +134,14 @@ provided by REVTeX class."
 
     ;; VIII.1. Citing a reference
     '("onlinecite"
-      (TeX-arg-conditional TeX-arg-cite-note-p ([LaTeX-arg-natbib-notes]) nil)
+      (TeX-arg-conditional TeX-arg-cite-note-p
+          (["Pre-note"] LaTeX-arg-natbib-notes)
+        nil)
       TeX-arg-cite)
     '("textcite"
-      (TeX-arg-conditional TeX-arg-cite-note-p ([LaTeX-arg-natbib-notes]) nil)
+      (TeX-arg-conditional TeX-arg-cite-note-p
+          (["Pre-note"] LaTeX-arg-natbib-notes)
+        nil)
       TeX-arg-cite)
 
     ;; IX.2 video environment
@@ -192,13 +198,14 @@ provided by REVTeX class."
               (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("fbox"          "*[{")
                                 ("keywords"      "{")
-                                ("preprint"      "")
-                                ("onecolumngrid" "")
-                                ("twocolumngrid" "")
-                                ("squeezetable"  "")
                                 ("printtables"   "*")
                                 ("printfigures"  "*"))
                               'function)
+     (font-latex-add-keywords '("preprint"
+                                "onecolumngrid"
+                                "twocolumngrid"
+                                "squeezetable")
+                              'function-noarg)
      (font-latex-add-keywords '(("affiliation"    "{")
                                 ("noaffiliation"  "")
                                 ("collaboration"  "{")
@@ -211,7 +218,9 @@ provided by REVTeX class."
                                 ("setfloatlink" ""))
                               'reference)
      (font-latex-add-keywords '(("appendix*" ""))
-                              'warning)))
+                              'warning)
+     ;; Tell font-lock about the update
+     (font-latex-set-syntactic-keywords)))
  TeX-dialect)
 
 (defvar LaTeX-revtex4-2-class-options
diff --git a/style/shortvrb.el b/style/shortvrb.el
index e6de06080c..405ab6f240 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--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2009--2023 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -45,12 +45,11 @@
 (require 'tex-style)
 
 ;; Silence the compiler:
-(declare-function font-latex-add-to-syntax-alist
-                  "font-latex"
-                  (list))
+(declare-function font-latex-set-syntactic-keywords
+                  "font-latex" ())
 (declare-function font-latex-add-keywords
-                  "font-latex"
-                  (keywords class))
+                  "font-latex" (keywords class))
+(defvar font-latex-syntactic-keywords-extra)
 
 (TeX-add-style-hook
  "shortvrb"
@@ -69,26 +68,28 @@
                   (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)
+   (when (and (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))
-
      (font-latex-add-keywords '(("MakeShortVerb"   "*{")
                                 ("DeleteShortVerb" "{"))
-                              'function)))
+                              'function)
+
+     ;; Use `font-latex-syntactic-keywords-extra' instead of
+     ;; `font-latex-add-to-syntax-alist' so we can catch a backslash
+     ;; within the shortvrb delimiters and make things like |xyz\|
+     ;; work correctly:
+     (when LaTeX-shortvrb-chars
+       (dolist (c LaTeX-shortvrb-chars)
+         (let ((s (char-to-string c)))
+           (add-to-list 'font-latex-syntactic-keywords-extra
+                        `(,(concat "\\(" s "\\)"
+                                   ".*?"
+                                   "\\(" (regexp-quote TeX-esc) "*\\)"
+                                   "\\(" s "\\)")
+                          (1 "\"") (2 ".") (3 "\"")))))
+       ;; Tell font-lock about the update
+       (font-latex-set-syntactic-keywords))))
  TeX-dialect)
 
 ;;; shortvrb.el ends here
diff --git a/style/siunitx.el b/style/siunitx.el
index da09a7e390..cec13b59c7 100644
--- a/style/siunitx.el
+++ b/style/siunitx.el
@@ -1,6 +1,6 @@
 ;;; siunitx.el --- AUCTeX style for `siunitx.sty' version 3.3.36.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2012-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2012-2023  Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <mose@gnu.org>
@@ -512,11 +512,13 @@ string."
                                   'function)))))
  TeX-dialect)
 
+(defvar LaTeX-siunitx-package-options-list
+  (append '(("table-column-type")) ; 'table-column-type' is a preamble only
+          LaTeX-siunitx-package-options)
+  "Package options for the siunitx package.")
+
 (defun LaTeX-siunitx-package-options nil
   "Prompt for package options for the siunitx package."
-  (TeX-read-key-val t (append
-                       ;; 'table-column-type' is a preamble only:
-                       '(("table-column-type"))
-                       LaTeX-siunitx-package-options)))
+  (TeX-read-key-val t LaTeX-siunitx-package-options-list))
 
 ;; siunitx.el ends here
diff --git a/style/soul.el b/style/soul.el
new file mode 100644
index 0000000000..054777049e
--- /dev/null
+++ b/style/soul.el
@@ -0,0 +1,169 @@
+;;; soul.el --- AUCTeX style for `soul.sty' (v3.0)  -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2023 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2023-04-21
+;; 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 `soul.sty' (v3.0) from 2023-18-02.
+;; `soul.sty' is part of TeXLive.
+
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+
+;; Silence the compiler:
+(declare-function font-latex-add-keywords
+                  "font-latex"
+                  (keywords class))
+(declare-function LaTeX-color-definecolor-list "color.el" ())
+(declare-function LaTeX-xcolor-definecolor-list "xcolor.el" ())
+
+;; Setup for \sodef:
+(TeX-auto-add-type "soul-sodef" "LaTeX")
+
+(defvar LaTeX-soul-sodef-regexp
+  `(,(concat "\\\\sodef{?\\\\\\(" TeX-token-char "+\\)")
+    1 LaTeX-auto-soul-sodef))
+
+(defun LaTeX-soul-auto-prepare ()
+  "Reset `LaTeX-auto-soul-sodef' before parsing."
+  (setq LaTeX-auto-soul-sodef nil))
+
+(defun LaTeX-soul-auto-cleanup ()
+  "Process new macros defined with \\sodef."
+  (dolist (elt (LaTeX-soul-sodef-list))
+    (let ((mac (car elt)))
+      (TeX-add-symbols `(,mac "Text"))
+      (when (and (featurep 'font-latex)
+                 (eq TeX-install-font-lock 'font-latex-setup))
+        (font-latex-add-keywords `((,mac "{")) 'bold-command)))))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-soul-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-soul-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "soul"
+ (lambda ()
+
+   (TeX-auto-add-regexp LaTeX-soul-sodef-regexp)
+
+   ;; New symbols
+   (TeX-add-symbols
+    '("so"   "Text")
+    '("caps" "Text")
+    '("ul"   "Text")
+    '("st"   "Text")
+    '("hl"   "Text")
+    '("sloppyword" "Text")
+
+    `("sodef"
+      ,(lambda (optional)
+         (let ((mac (TeX-read-string
+                     (TeX-argument-prompt optional nil "Macro: \\" t)))
+               (TeX-arg-opening-brace "")
+               (TeX-arg-closing-brace ""))
+           (LaTeX-add-soul-sodefs mac)
+           (LaTeX-soul-auto-cleanup)
+           (TeX-argument-insert mac optional TeX-esc)))
+      (TeX-arg-completing-read LaTeX-font-shape "Font: \\" t ,TeX-esc)
+      "Inner-letter space" "Inner space" "Outer space"
+      (lambda (_optional)
+        (set-marker TeX-exit-mark (point))))
+
+    "resetso"
+
+    `("capsdef"
+      (TeX-arg-string "Font" "////")
+      (TeX-arg-completing-read LaTeX-font-shape "Font: \\" t ,TeX-esc)
+      "Inner-letter space" "Inner space" "Outer space")
+
+    "capsreset"
+    '("capssave" "Name")
+    '("capsselect" "Name")
+
+    '("setul" "Underline depth" "Underline thickness")
+    "resetul"
+    '("setuldepth" "Underline depth")
+
+    '("setuloverlap" "Overlap")
+    '("soulaccent" (TeX-arg-string "Accent command" "\\"))
+    '("soulregister" TeX-arg-macro "Number of arguments"))
+
+   ;; The next macros are only added if a color package is loaded:
+   (when (TeX-member "\\`x?color\\'" (TeX-style-list) #'string-match)
+     (TeX-add-symbols
+      `("setulcolor" (TeX-arg-completing-read
+                      ,(lambda ()
+                         (if (member "xcolor" (TeX-style-list))
+                             (LaTeX-xcolor-definecolor-list)
+                           (LaTeX-color-definecolor-list)))
+                      "Color"))
+      `("setstcolor" (TeX-arg-completing-read
+                      ,(lambda ()
+                         (if (member "xcolor" (TeX-style-list))
+                             (LaTeX-xcolor-definecolor-list)
+                           (LaTeX-color-definecolor-list)))
+                      "Color"))
+      `("sethlcolor" (TeX-arg-completing-read
+                      ,(lambda ()
+                         (if (member "xcolor" (TeX-style-list))
+                             (LaTeX-xcolor-definecolor-list)
+                           (LaTeX-color-definecolor-list)))
+                      "Color"))))
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("so"         "|{\\")
+                                ("caps"       "|{\\")
+                                ("st"         "|{\\")
+                                ("hl"         "|{\\")
+                                ("sloppyword" "|{\\"))
+                              'bold-command)
+     (font-latex-add-keywords '(("ul"   "|{\\"))
+                              'underline-command)
+     (font-latex-add-keywords '(("setulcolor" "{")
+                                ("setstcolor" "{")
+                                ("sethlcolor" "{")
+                                ("sodef"      "|{\\{{{{")
+                                ("resetso"    "")
+                                ("capsdef"    "|{\\{{{{")
+                                ("capsreset"  "")
+                                ("capssave"   "{")
+                                ("capsselect" "{")
+                                ("setul"      "{{")
+                                ("resetul"    "")
+                                ("setuldepth" "{")
+                                ("setuloverlap" "{")
+                                ("soulaccent"   "{")
+                                ("soulregister" "{{"))
+                              'function)))
+ TeX-dialect)
+
+(defvar LaTeX-soul-package-options '("capsdefault")
+  "Package options for the soul package.")
+
+;;; soul.el ends here
diff --git a/style/subcaption.el b/style/subcaption.el
index c98596a594..67b96e4fcf 100644
--- a/style/subcaption.el
+++ b/style/subcaption.el
@@ -1,6 +1,6 @@
 ;;; subcaption.el --- AUCTeX style for `subcaption.sty' (v1.3)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2015--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -196,10 +196,15 @@ caption, insert only a caption."
                               'function)) )
  TeX-dialect)
 
+(defvar LaTeX-subcaption-package-options-list
+  (progn
+    (TeX-load-style "caption")
+    (append LaTeX-subcaption-key-val-options
+            LaTeX-caption-key-val-options))
+  "Package options for the subcaption package.")
+
 (defun LaTeX-subcaption-package-options ()
   "Prompt for package options for the subcaption package."
-  (TeX-load-style "caption")
-  (TeX-read-key-val t (append LaTeX-subcaption-key-val-options
-                              LaTeX-caption-key-val-options)))
+  (TeX-read-key-val t LaTeX-subcaption-package-options-list))
 
 ;;; subcaption.el ends here
diff --git a/style/theorem.el b/style/theorem.el
index 52aea651ba..91a3d3917a 100644
--- a/style/theorem.el
+++ b/style/theorem.el
@@ -1,6 +1,6 @@
 ;;; theorem.el --- AUCTeX style for `theorem.sty' (v2.2c)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2015-2023  Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -94,12 +94,13 @@ make them available as new environments."
            (LaTeX-add-environments (list nthm #'LaTeX-env-label-args 
["Heading"]))
            (TeX-argument-insert nthm optional)))
       [ TeX-arg-environment "Numbered like" ]
-      t [ (TeX-arg-eval progn (if (eq (save-excursion
-                                        (backward-char 2)
-                                        (preceding-char)) ?\])
-                                  ()
-                                (TeX-arg-counter t "Within counter"))
-                        "") ])
+      "Title"
+      (TeX-arg-conditional (save-excursion
+                             (skip-chars-backward (concat "^" TeX-grcl))
+                             (backward-list)
+                             (= (preceding-char) ?\]))
+          ()
+        ([TeX-arg-counter "Within counter"])))
 
     '("theoremstyle"
       (TeX-arg-completing-read LaTeX-theorem-theoremstyle-list "Style"))
diff --git a/style/wasysym.el b/style/wasysym.el
new file mode 100644
index 0000000000..8fef61c965
--- /dev/null
+++ b/style/wasysym.el
@@ -0,0 +1,187 @@
+;;; wasysym.el --- AUCTeX style for `wasysym.sty' (v2.4)  -*- lexical-binding: 
t; -*-
+
+;; Copyright (C) 2023 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2023-05-02
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+
+;; This file adds support for `wasysym.sty' (v2.4) from 2020/01/19.
+
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+
+(TeX-add-style-hook
+ "wasysym"
+ (lambda ()
+   (TeX-add-symbols
+    ;; General symbols
+    "male"
+    "female"
+    "cent"
+    "wasyeuro"
+    "currency"
+    "phone"
+    "recorder"
+    "clock"
+    "lightning"
+    "diameter"
+    "invdiameter"
+    "varangle"
+    "wasylozenge"
+    "kreuz"
+    "smiley"
+    "frownie"
+    "blacksmiley"
+    "sun"
+    "checked"
+    "bell"
+    "ataribox"
+    "permil"
+    "brokenvert"
+    "wasytherefore"
+    "Bowtie"
+    "agemO"
+    "wasyparagraph"
+    "Paragraph"
+    "wasycmd"
+    "applecmd"
+
+    ;; Electrical and physical symbols
+    "AC"
+    "HF"
+    "VHF"
+    "photon"
+    "gluon"
+
+    ;; Polygons and stars
+    "Square"
+    "XBox"
+    "CheckedBox"
+    "hexagon"
+    "varhexagon"
+    "pentagon"
+    "octagon"
+    "hexstar"
+    "varhexstar"
+    "davidsstar"
+
+    ;; Music notes
+    "eighthnote"
+    "quarternote"
+    "halfnote"
+    "fullnote"
+    "twonotes"
+
+    ;; Various circles
+    "Circle"
+    "CIRCLE"
+    "Leftcircle"
+    "LEFTCIRCLE"
+    "Rightcircle"
+    "RIGHTCIRCLE"
+    "LEFTcircle"
+    "RIGHTcircle"
+    "leftturn"
+    "rightturn"
+
+    ;; Arrows
+    "pointer"
+    "RIGHTarrow"
+    "LEFTarrow"
+    "UParrow"
+    "DOWNarrow"
+
+    ;; Phonetic symbols
+    "thorn"
+    "Thorn"
+    "openo"
+    "inve"
+
+    ;; Astronomical symbols
+    "vernal"
+    "ascnode"
+    "descnode"
+    "fullmoon"
+    "newmoon"
+    "leftmoon"
+    "rightmoon"
+    "astrosun"
+    "mercury"
+    "venus"
+    "earth"
+    "mars"
+    "jupiter"
+    "saturn"
+    "uranus"
+    "neptune"
+    "pluto"
+
+    ;; Astrological symbols and the zodiacal symbols
+    "aries"
+    "taurus"
+    "gemini"
+    "cancer"
+    "leo"
+    "virgo"
+    "libra"
+    "scorpio"
+    "sagittarius"
+    "capricornus"
+    "aquarius"
+    "pisces"
+    "conjunction"
+    "opposition"
+
+    ;; APL symbols
+    "APLstar"
+    "APLlog"
+    "APLbox"
+    "APLup"
+    "APLdown"
+    "APLinput"
+    "APLcomment"
+    "APLinv"
+    "APLuparrowbox"
+    "APLdownarrowbox"
+    "APLleftarrowbox"
+    "APLrightarrowbox"
+    "notbackslash"
+    "notslash"
+    "APLnot"
+    "APLvert"
+    "APLcirc"
+    "APLminus")
+
+   ;; \euro is available unless `noeuro' option is specified:
+   (unless (LaTeX-provided-package-options-member "wasysym" "noeuro")
+     (TeX-add-symbols "euro")))
+ TeX-dialect)
+
+(defvar LaTeX-wasysym-package-options
+  '("integrals" "nointegrals" "compat1" "noeuro")
+  "Package options for the wasysym package.")
+
+;;; wasysym.el ends here
diff --git a/style/xparse.el b/style/xparse.el
index 397a0c4bae..e71e456d85 100644
--- a/style/xparse.el
+++ b/style/xparse.el
@@ -1,6 +1,6 @@
 ;;; xparse.el --- AUCTeX style for `xparse.sty' version 2022-07-05  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2013, 2020--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2020--2023 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <mose@gnu.org>
@@ -111,6 +111,8 @@ TYPE is one of the symbols mac or env."
     (let ((name (nth 1 xcmd))
           (spec (nth 2 xcmd))
           (what (nth 3 xcmd))
+          (case-fold-search nil)
+          (syntax (TeX-search-syntax-table ?\{ ?\}))
           args opt-star opt-token)
       (with-temp-buffer
         (set-syntax-table LaTeX-mode-syntax-table)
@@ -128,7 +130,7 @@ TYPE is one of the symbols mac or env."
                 ;; over [>=] and a balanced {}
                 ((looking-at-p "[>=]")
                  (forward-char 1)
-                 (forward-sexp))
+                 (with-syntax-table syntax (forward-sexp)))
                 ;; Mandatory arguments:
                 ;; m: Ask for input with "Text" as prompt
                 ((looking-at-p "m")
@@ -144,7 +146,7 @@ TYPE is one of the symbols mac or env."
                 ;; R<token1><token2>{default}
                 ((looking-at-p "R")
                  (re-search-forward "R\\(.\\)\\(.\\)" (+ (point) 3) t)
-                 (forward-sexp)
+                 (with-syntax-table syntax (forward-sexp))
                  (push `(LaTeX-arg-xparse-query
                          ,(match-string-no-properties 1)
                          ,(match-string-no-properties 2))
@@ -168,12 +170,12 @@ TYPE is one of the symbols mac or env."
                 ;; O{default}
                 ((looking-at-p "O")
                  (forward-char 1)
-                 (forward-sexp)
+                 (with-syntax-table syntax (forward-sexp))
                  (push (vector "Text") args))
                 ;; D<token1><token2>{default}
                 ((looking-at-p "D")
                  (re-search-forward "D\\(.\\)\\(.\\)" (+ (point) 3) t)
-                 (forward-sexp)
+                 (with-syntax-table syntax (forward-sexp))
                  (push (vector #'LaTeX-arg-xparse-query
                                (match-string-no-properties 1)
                                (match-string-no-properties 2))
@@ -205,7 +207,7 @@ TYPE is one of the symbols mac or env."
                          ,(match-string-no-properties 1))
                        args)
                  (when (looking-at-p TeX-grop)
-                   (forward-sexp)))
+                   (with-syntax-table syntax (forward-sexp))))
                 ;; Finished:
                 (t nil))))
       (if (eq type 'env)
@@ -349,8 +351,12 @@ TYPE is one of the symbols mac or env."
                               'function)))
  TeX-dialect)
 
+(defvar LaTeX-xparse-package-options-list
+  '(("log-declarations" ("true" "false")))
+  "Package options for the xparse package.")
+
 (defun LaTeX-xparse-package-options ()
   "Read the xparse package options from the user."
-  (TeX-read-key-val t '(("log-declarations" ("true" "false")))))
+  (TeX-read-key-val t LaTeX-xparse-package-options-list))
 
 ;;; xparse.el ends here
diff --git a/tests/latex/font-latex-test.el b/tests/latex/font-latex-test.el
index 0c81392add..40f9633a1a 100644
--- a/tests/latex/font-latex-test.el
+++ b/tests/latex/font-latex-test.el
@@ -1,6 +1,6 @@
 ;;; font-latex-test.el --- tests for font-latex  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2020-2021  Free Software Foundation, Inc.
+;; Copyright (C) 2020-2023  Free Software Foundation, Inc.
 
 ;; This file is part of AUCTeX.
 
@@ -350,4 +350,130 @@ x
       (should (font-latex-faces-present-p 'font-lock-function-name-face
                                           (match-end 0)))  )))
 
+(ert-deftest font-latex-shortvrb-chars ()
+  "Test fontification within delimiters defined by `LaTeX-shortvrb-chars'."
+  (with-temp-buffer
+    (let ((TeX-install-font-lock #'font-latex-setup)
+          (LaTeX-shortvrb-chars '(?| ?\"))
+          (TeX-parse-self t))
+      (insert "\
+\\documentclass{article}
+\\usepackage{shortvrb}
+\\begin{document}
+foo |xyz\\| bar
+foo \"xyz\\\" bar
+\\end{document}")
+      (LaTeX-mode)
+      (TeX-update-style t)
+      ;; See 
https://lists.gnu.org/archive/html/auctex-devel/2023-04/msg00011.html
+      (syntax-ppss-flush-cache (point-min))
+      (font-lock-ensure)
+      (goto-char (point-min))
+      (re-search-forward "^f" nil t)
+      (should-not (get-text-property (point) 'face))
+      (search-forward "|" nil t)
+      ;; This is the `|' char:
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face
+                                          (1- (point))))
+      ;; This is the `x' char:
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face))
+      (search-forward "|" nil t)
+      ;; This is the `\' char:
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face
+                                          (- (point) 2)))
+      ;; This is the `|' char:
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face
+                                          (1- (point))))
+      (search-forward "ba" nil t)
+      (should-not (get-text-property (point) 'face))
+
+      (re-search-forward "^f" nil t)
+      (should-not (get-text-property (point) 'face))
+      (search-forward "\"" nil t)
+      ;; This is the `"' char:
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face
+                                          (1- (point))))
+      ;; This is the `x' char:
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face))
+      (search-forward "\"" nil t)
+      ;; This is the `\' char:
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face
+                                          (- (point) 2)))
+      ;; This is the `"' char:
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face
+                                          (1- (point))))
+      (search-forward "ba" nil t)
+      (should-not (get-text-property (point) 'face)))))
+
+(ert-deftest font-latex-verb-macros-with-braces ()
+  "Test fontification for verb macros with argument in braces."
+  (with-temp-buffer
+    (let ((TeX-install-font-lock #'font-latex-setup)
+          (TeX-parse-self t))
+      (insert "\
+\\documentclass{article}
+\\usepackage{fvextra}
+\\usepackage{hyperref}
+\\begin{document}
+foo \\Verb[commandchars=\\\\\\{\\}]{Pre \fbox{Middle} Post} bar
+foo \\Verb{w{o}r{k}s} bar
+foo \\Verb{b{r}eak{s}} bar
+foo \\href[ismap=false]{text \\cmd{test} text}{more text} bar
+foo \\path{C:\\path\\to\\} bar
+\\end{document}")
+      (LaTeX-mode)
+      (TeX-update-style t)
+      (syntax-ppss-flush-cache (point-min))
+      (font-lock-ensure)
+      (goto-char (point-min))
+
+      (re-search-forward "^f" nil t)
+      (should-not (get-text-property (point) 'face))
+      (search-forward "commandc")
+      (should (font-latex-faces-present-p 'font-lock-variable-name-face))
+      (search-forward "Mid")
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face))
+      (search-forward "Po")
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face))
+      (search-forward "ba")
+      (should-not (get-text-property (point) 'face))
+
+      (re-search-forward "^f" nil t)
+      (should-not (get-text-property (point) 'face))
+      (search-forward "k")
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face))
+      (search-forward "ba")
+      (should-not (get-text-property (point) 'face))
+
+      (re-search-forward "^f" nil t)
+      (should-not (get-text-property (point) 'face))
+      (search-forward "s")
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face))
+      (search-forward "ba")
+      (should-not (get-text-property (point) 'face))
+
+      (re-search-forward "^f" nil t)
+      (should-not (get-text-property (point) 'face))
+      (search-forward "ismap")
+      (should (font-latex-faces-present-p 'font-lock-variable-name-face))
+      (search-forward "text")
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face))
+      (search-forward "cmd{t")
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face))
+      (search-forward "text")
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face))
+      (search-forward "more")
+      (should (font-latex-faces-present-p 'font-lock-constant-face))
+      (search-forward "ba")
+      (should-not (get-text-property (point) 'face))
+
+      (re-search-forward "^f" nil t)
+      (should-not (get-text-property (point) 'face))
+      (search-forward "C:")
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face))
+      (search-forward "to")
+      (should (font-latex-faces-present-p 'font-latex-verbatim-face))
+      (search-forward "ba")
+      (should-not (get-text-property (point) 'face)))))
+
 ;;; font-latex-test.el ends here
diff --git a/tex-info.el b/tex-info.el
index dd0ff43333..8bef02a16b 100644
--- a/tex-info.el
+++ b/tex-info.el
@@ -1,6 +1,6 @@
 ;;; tex-info.el --- Support for editing Texinfo source.  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 1993-2022  Free Software Foundation, Inc.
+;; Copyright (C) 1993-2023  Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Keywords: tex
@@ -555,7 +555,7 @@ is assumed by default."
   Texinfo-mode-map
   "Menu used in Texinfo mode."
   `("Texinfo"
-    ["Node ..." texinfo-insert-@node
+    ["Node ..." Texinfo-insert-node
      :help "Insert a node"]
     ["Macro ..." TeX-insert-macro
      :help "Insert a macro and possibly arguments"]
@@ -655,7 +655,7 @@ value of `Texinfo-mode-hook'."
         "^@node [ \t]*[Tt]op\\|^@\\("
         texinfo-chapter-level-regexp
         "\\)"))
-  (set (make-local-variable 'require-final-newline) t)
+  (set (make-local-variable 'require-final-newline) mode-require-final-newline)
   (set (make-local-variable 'indent-tabs-mode) nil)
   (set (make-local-variable 'paragraph-separate)
        (concat "@[a-zA-Z]*[ \n]\\|" paragraph-separate))
@@ -669,6 +669,7 @@ value of `Texinfo-mode-hook'."
   (set (make-local-variable 'words-include-escapes) t)
   (set (make-local-variable 'imenu-generic-expression)
        texinfo-imenu-generic-expression)
+  (setq imenu-case-fold-search nil)
 
   (set (make-local-variable 'font-lock-defaults)
        '(texinfo-font-lock-keywords nil nil nil backward-paragraph))
@@ -676,10 +677,12 @@ value of `Texinfo-mode-hook'."
        texinfo-syntax-propertize-function)
 
   ;; Outline settings.
-  (set (make-local-variable 'outline-regexp)
-       (concat "@\\("
-               (mapconcat #'car texinfo-section-list "\\>\\|")
-               "\\>\\)"))
+  (setq-local outline-heading-alist
+             (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x)))
+                     texinfo-section-list))
+  (setq-local outline-regexp
+             (concat (regexp-opt (mapcar #'car outline-heading-alist) t)
+                     "\\>"))
 
   ;; Mostly AUCTeX stuff
   (set (make-local-variable 'TeX-command-current) #'TeX-command-master)
@@ -690,11 +693,12 @@ value of `Texinfo-mode-hook'."
   (set (make-local-variable 'TeX-auto-regexp-list) 'TeX-auto-empty-regexp-list)
 
   (setq TeX-command-default "TeX")
-  (setq TeX-header-end "%*end")
-  (setq TeX-trailer-start (regexp-quote (concat TeX-esc "bye")))
+  (setq TeX-header-end (regexp-quote "%**end of header"))
+  (setq TeX-trailer-start (format "^%s$"
+                                  (regexp-quote (concat TeX-esc "bye"))))
 
   (set (make-local-variable 'TeX-complete-list)
-       (list (list "@\\([a-zA-Z]*\\)" 1 'TeX-symbol-list-filtered nil)
+       (list (list "@\\([a-zA-Z]*\\)" 1 #'TeX-symbol-list-filtered nil)
              (list "" TeX-complete-word)))
 
   (set (make-local-variable 'TeX-font-list) Texinfo-font-list)
diff --git a/tex-site.el.in b/tex-site.el.in
index 47f8e3ee75..9338cc3c5b 100644
--- a/tex-site.el.in
+++ b/tex-site.el.in
@@ -1,6 +1,6 @@
 ;;; tex-site.el - Site specific variables.  Don't edit.  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2005-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2005-2023  Free Software Foundation, Inc.
 ;;
 ;; completely rewritten.
 
@@ -38,8 +38,8 @@
 
 ;;; Code:
 
-(when (< emacs-major-version 25)
-  (error "AUCTeX requires Emacs 25.1 or later"))
+(when (< emacs-major-version 26)
+  (error "AUCTeX requires Emacs 26.1 or later"))
 
 (unless (or (fboundp 'TeX-modes-set)     ;Avoid inf-looping.
             (fboundp 'TeX-tex-mode))     ;auctex-autoloads is not loaded.
@@ -73,7 +73,7 @@ TeX-auto-* (automatically generated lisp).")
   "The directory where the AUCTeX non-Lisp data is located.")
 
 (defcustom TeX-auto-global
-    @lispautodir@
+  @lispautodir@
   "Directory containing automatically generated information.
 
 For storing automatic extracted information about the TeX macros
@@ -91,10 +91,11 @@ shared by all users of a site."
 
 (defalias 'TeX-load-hack #'ignore)
 
-(add-hook 'tex-site-unload-hook
-          (lambda ()
-            (TeX-modes-set 'TeX-modes nil)
-            (setq load-path (delq TeX-lisp-directory load-path))))
+(defun tex-site-unload-function ()
+  (TeX-modes-set 'TeX-modes nil)
+  (setq load-path (delq TeX-lisp-directory load-path))
+  ;; Tell emacs to continue standard unloading procedure.
+  nil)
 
 (defun TeX-modes-set (var value &optional _ignored)
   "Set VAR (which should be `TeX-modes') to VALUE.
@@ -127,7 +128,7 @@ set it with `TeX-modes-set'."
   :initialize #'custom-initialize-reset)
 
 (defconst AUCTeX-version "@AUCTEXVERSION@"
-    "AUCTeX version.
+  "AUCTeX version.
 If not a regular release, the date of the last change.")
 
 (defconst AUCTeX-date "@AUCTEXDATE@"
diff --git a/tex.el b/tex.el
index 9328c525a1..7974698069 100644
--- a/tex.el
+++ b/tex.el
@@ -28,8 +28,8 @@
 
 ;;; Code:
 
-(when (< emacs-major-version 25)
-  (error "AUCTeX requires Emacs 25.1 or later"))
+(when (< emacs-major-version 26)
+  (error "AUCTeX requires Emacs 26.1 or later"))
 
 (require 'custom)
 (require 'tex-site)
@@ -2098,12 +2098,11 @@ Programs should not use this variable directly but the 
function
   :type '(choice
           (const :tag "No DVI to PDF conversion" nil)
           (const :tag "dvips - ps2pdf sequence" "Dvips")
-          (const :tag "dvipdfmx" "Dvipdfmx")))
+          (const :tag "dvipdfmx" "Dvipdfmx"))
+  :safe #'string-or-null-p)
 ;; If you plan to support new values of `TeX-PDF-from-DVI' remember to update
 ;; `TeX-command-default' accordingly.
 (make-variable-buffer-local 'TeX-PDF-from-DVI)
-(put 'TeX-PDF-from-DVI 'safe-local-variable
-     (lambda (x) (or (stringp x) (null x))))
 
 (defcustom TeX-PDF-via-dvips-ps2pdf nil
   "Whether to produce PDF output through the (La)TeX - dvips - ps2pdf 
sequence."
@@ -2483,10 +2482,12 @@ Get `major-mode' from master file and enable it."
          comment-prefix "End:\n")
         (unless (eq mode major-mode)
           (funcall mode)
-          ;; TeX modes run `VirTeX-common-initialization' which kills all local
-          ;; variables, thus `TeX-master' will be forgotten after `(funcall
-          ;; mode)'.  Reparse local variables in order to bring it back.
-          (hack-local-variables))))))
+          ;; On Emacs 26 and later, no need to reparse local variables
+          ;; in order to retain `TeX-master' because major mode
+          ;; function runs `hack-local-variables' through
+          ;; `run-mode-hooks'.
+          ;; (hack-local-variables)
+          )))))
 
 (defun TeX-local-master-p ()
   "Return non-nil if there is a `TeX-master' entry in local variables spec.
@@ -5484,7 +5485,10 @@ additional characters."
                         (setq count (- count TeX-brace-indent-level)))
                        ((eq char ?\\)
                         (when (< (point) limit)
-                          (forward-char)
+                          ;; ?\\ in verbatim constructs doesn't escape
+                          ;; the next char
+                          (unless (TeX-verbatim-p)
+                            (forward-char))
                           t))))))
       count)))
 
@@ -5507,7 +5511,7 @@ It should be accessed through the function 
`TeX-search-syntax-table'.")
   "Return a syntax table for searching purposes.
 ARGS may be a list of characters.  For each of them the
 respective predefined syntax is set.  Currently the parenthetical
-characters ?{, ?}, ?[, ?], ?\(, ?\), ?<, and ?> are supported.
+characters ?{, ?}, ?[, ?], ?(, ?), ?<, and ?> are supported.
 The syntax of each of these characters not specified will be
 reset to \" \"."
   (let ((char-syntax-alist '((?\{ . "(}") (?\} . "){")
@@ -6121,14 +6125,15 @@ With optional argument ARG, also reload the style 
hooks."
   (if arg
       (dolist (var TeX-normal-mode-reset-list)
         (set var nil)))
-  (let ((TeX-auto-save t))
-    (if (buffer-modified-p)
-        (save-buffer)
-      (TeX-auto-write)))
-  (normal-mode)
-  ;; See also addition to `find-file-hook' in `VirTeX-common-initialization'.
-  (when (eq TeX-master 'shared) (TeX-master-file nil nil t))
-  (TeX-update-style t))
+  (let ((gc-cons-percentage 0.5))
+    (let ((TeX-auto-save t))
+      (if (buffer-modified-p)
+          (save-buffer)
+        (TeX-auto-write)))
+    (normal-mode)
+    ;; See also addition to `find-file-hook' in `VirTeX-common-initialization'.
+    (when (eq TeX-master 'shared) (TeX-master-file nil nil t))
+    (TeX-update-style t)))
 
 (defgroup TeX-quote nil
   "Quoting in AUCTeX."
@@ -8255,16 +8260,17 @@ errors or warnings to show."
       (progn
         (if TeX-parse-all-errors
             (TeX-parse-all-errors))
-        (if (and TeX-error-overview-open-after-TeX-run
+        (if (and (with-current-buffer TeX-command-buffer
+                   TeX-error-overview-open-after-TeX-run)
                  (TeX-error-overview-make-entries
                   (TeX-master-directory) (TeX-active-buffer)))
             (TeX-error-overview)))
     (message (concat name ": formatted " (TeX-current-pages)))
     (let (dvi2pdf)
-        (if (with-current-buffer TeX-command-buffer
-           (and TeX-PDF-mode (setq dvi2pdf (TeX-PDF-from-DVI))))
-         (setq TeX-command-next dvi2pdf)
-       (setq TeX-command-next TeX-command-Show)))))
+      (if (with-current-buffer TeX-command-buffer
+            (and TeX-PDF-mode (setq dvi2pdf (TeX-PDF-from-DVI))))
+          (setq TeX-command-next dvi2pdf)
+        (setq TeX-command-next TeX-command-Show)))))
 
 (defun TeX-current-pages ()
   "Return string indicating the number of pages formatted."
@@ -8370,7 +8376,8 @@ Open the error overview if
 errors or warnings to show."
   (if TeX-parse-all-errors
       (TeX-parse-all-errors))
-  (if (and TeX-error-overview-open-after-TeX-run
+  (if (and (with-current-buffer TeX-command-buffer
+             TeX-error-overview-open-after-TeX-run)
            (TeX-error-overview-make-entries
             (TeX-master-directory) (TeX-active-buffer)))
       (TeX-error-overview))




reply via email to

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