emacs-diffs
[Top][All Lists]
Advanced

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

feature/pgtk b242394: Merge branch 'master' of git.sv.gnu.org:/srv/git/e


From: Yuuki Harano
Subject: feature/pgtk b242394: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Date: Sun, 18 Jul 2021 06:14:41 -0400 (EDT)

branch: feature/pgtk
commit b242394f24b154f8e20f5abf4b2f826629e99ea6
Merge: 492a0ae 6b802a0
Author: Yuuki Harano <masm+github@masm11.me>
Commit: Yuuki Harano <masm+github@masm11.me>

    Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
---
 doc/emacs/back.texi                             |   55 +-
 doc/emacs/book-spine.texi                       |    4 +-
 doc/emacs/dired.texi                            |    9 +
 doc/emacs/display.texi                          |    4 +-
 doc/emacs/emacs.texi                            |    2 +-
 doc/emacs/files.texi                            |   21 +-
 doc/emacs/maintaining.texi                      |   10 +-
 doc/emacs/misc.texi                             |    2 +-
 doc/emacs/mule.texi                             |    6 +-
 doc/lispref/files.texi                          |   38 +-
 doc/lispref/intro.texi                          |    2 +-
 doc/lispref/lists.texi                          |    4 +-
 doc/lispref/modes.texi                          |   13 +-
 doc/lispref/objects.texi                        |    7 +
 doc/lispref/os.texi                             |    5 +
 doc/lispref/processes.texi                      |   10 +
 doc/lispref/text.texi                           |   22 +-
 doc/lispref/tips.texi                           |   11 +-
 doc/misc/efaq.texi                              |   34 +
 doc/misc/modus-themes.org                       | 1291 ++++++++----
 doc/misc/tramp.texi                             |   34 +-
 etc/NEWS                                        |  114 +-
 etc/themes/modus-operandi-theme.el              |    2 +-
 etc/themes/modus-themes.el                      | 2523 +++++++++++++++--------
 etc/themes/modus-vivendi-theme.el               |    2 +-
 lib-src/etags.c                                 |   49 +-
 lib-src/movemail.c                              |   14 +-
 lisp/apropos.el                                 |   42 +-
 lisp/bookmark.el                                |   22 +-
 lisp/cus-edit.el                                |   13 +-
 lisp/desktop.el                                 |    5 +-
 lisp/dired.el                                   |   82 +-
 lisp/emacs-lisp/autoload.el                     |    5 +-
 lisp/emacs-lisp/bytecomp.el                     |    5 +-
 lisp/emacs-lisp/cconv.el                        |    3 +-
 lisp/emacs-lisp/eieio.el                        |   35 +-
 lisp/emacs-lisp/macroexp.el                     |   24 +-
 lisp/emacs-lisp/memory-report.el                |    2 +
 lisp/emacs-lisp/package.el                      |   11 +-
 lisp/emacs-lisp/re-builder.el                   |   15 +-
 lisp/emacs-lisp/shadow.el                       |    9 +-
 lisp/emacs-lisp/shortdoc.el                     |   44 +-
 lisp/emacs-lisp/tabulated-list.el               |   44 +-
 lisp/facemenu.el                                |   12 +-
 lisp/faces.el                                   |   23 +-
 lisp/ffap.el                                    |    1 +
 lisp/files.el                                   |  176 +-
 lisp/frame.el                                   |   10 +-
 lisp/gnus/gnus-art.el                           |   23 +-
 lisp/gnus/gnus-msg.el                           |    4 +
 lisp/gnus/gnus-search.el                        |  136 +-
 lisp/gnus/message.el                            |   20 +-
 lisp/gnus/mm-view.el                            |   27 +-
 lisp/help-fns.el                                |    4 +-
 lisp/hi-lock.el                                 |    2 +-
 lisp/hilit-chg.el                               |   24 +-
 lisp/ido.el                                     |    4 +
 lisp/image.el                                   |    4 +-
 lisp/info.el                                    |   83 +-
 lisp/isearch.el                                 |   11 +-
 lisp/jka-cmpr-hook.el                           |   29 +-
 lisp/jka-compr.el                               |  123 +-
 lisp/menu-bar.el                                |    4 +-
 lisp/mouse.el                                   |    4 +-
 lisp/net/shr.el                                 |   41 +-
 lisp/net/tramp-adb.el                           |   35 +-
 lisp/net/tramp-archive.el                       |    4 +
 lisp/net/tramp-cache.el                         |    2 +
 lisp/net/tramp-compat.el                        |   10 +
 lisp/net/tramp-crypt.el                         |   23 +
 lisp/net/tramp-fuse.el                          |   17 +-
 lisp/net/tramp-gvfs.el                          |    7 +
 lisp/net/tramp-rclone.el                        |    8 +
 lisp/net/tramp-sh.el                            |   42 +-
 lisp/net/tramp-smb.el                           |   32 +-
 lisp/net/tramp-sshfs.el                         |   44 +-
 lisp/net/tramp-sudoedit.el                      |    8 +
 lisp/net/tramp.el                               |  135 +-
 lisp/outline.el                                 |    1 -
 lisp/pcmpl-unix.el                              |    3 +-
 lisp/progmodes/bug-reference.el                 |   50 +-
 lisp/progmodes/grep.el                          |    7 +
 lisp/progmodes/inf-lisp.el                      |    8 +-
 lisp/progmodes/make-mode.el                     |    4 +-
 lisp/progmodes/sh-script.el                     |    4 +-
 lisp/progmodes/xref.el                          |    4 +-
 lisp/repeat.el                                  |   10 +-
 lisp/replace.el                                 |   12 +-
 lisp/saveplace.el                               |   12 +-
 lisp/select.el                                  |   16 +-
 lisp/shell.el                                   |   10 +
 lisp/simple.el                                  |    6 +
 lisp/subr.el                                    |    8 +
 lisp/tab-line.el                                |    5 +-
 lisp/textmodes/enriched.el                      |    4 +-
 lisp/textmodes/tex-mode.el                      |    7 +-
 lisp/thingatpt.el                               |   16 +-
 lisp/userlock.el                                |    2 +-
 lisp/vc/ediff-util.el                           |    5 +-
 lisp/window.el                                  |   12 +-
 oldXMenu/Create.c                               |    2 +
 oldXMenu/Internal.c                             |   31 +-
 oldXMenu/XMakeAssoc.c                           |    2 +
 src/alloc.c                                     |   44 +-
 src/buffer.c                                    |    6 +-
 src/data.c                                      |    8 +-
 src/dispnew.c                                   |   12 +-
 src/editfns.c                                   |    2 +-
 src/emacs.c                                     |    4 +-
 src/eval.c                                      |    4 +-
 src/fileio.c                                    |   18 +-
 src/filelock.c                                  |  215 +-
 src/gtkutil.c                                   |    2 +-
 src/image.c                                     |   19 +-
 src/insdel.c                                    |    2 +-
 src/keyboard.c                                  |    9 +-
 src/lisp.h                                      |    2 -
 src/process.c                                   |    5 +-
 src/sysdep.c                                    |  134 +-
 src/window.c                                    |   16 +-
 src/xdisp.c                                     |   20 +-
 src/xfns.c                                      |   10 +-
 src/xfont.c                                     |    5 +-
 test/Makefile.in                                |    7 +-
 test/lisp/emacs-lisp/eieio-tests/eieio-tests.el |   16 +-
 test/lisp/filenotify-tests.el                   |    2 +-
 test/lisp/files-tests.el                        |   38 +
 test/lisp/gnus/gnus-search-tests.el             |    4 +-
 test/lisp/net/tramp-archive-tests.el            |    4 +-
 test/lisp/net/tramp-tests.el                    |  199 +-
 test/lisp/replace-tests.el                      |   11 +
 test/lisp/shadowfile-tests.el                   |    4 +-
 test/lisp/shell-tests.el                        |   19 +
 test/lisp/subr-tests.el                         |    2 +-
 test/lisp/thingatpt-tests.el                    |   33 +
 test/src/emacs-module-resources/mod-test.c      |    4 +
 test/src/process-tests.el                       |   32 +
 137 files changed, 4840 insertions(+), 2094 deletions(-)

diff --git a/doc/emacs/back.texi b/doc/emacs/back.texi
index e1a2a04..ae0121e 100644
--- a/doc/emacs/back.texi
+++ b/doc/emacs/back.texi
@@ -15,21 +15,18 @@
 @sp 1
 
 @quotation
-GNU Emacs is much more than a text editor; over the years, it has
-expanded to become an entire workflow environment, impressing
-programmers with its integrated debugging and project-management
-features.  It is also a multi-lingual word processor, can handle all
-your email and Usenet news needs, display web pages, and even has a
-diary and a calendar for your appointments!
+GNU Emacs is much @strong{more than a text editor;} over the years, it
+has expanded to become @strong{an entire workflow environment,}
+impressing programmers with its integrated debugging and
+project-management features.  It is also a multi-lingual word
+processor, can handle all your email and Usenet news needs, display
+web pages, and even has a diary and a calendar for your appointments!
 
-And when you tire of all the work you can accomplish with it, Emacs
-contains games to play.
-
-@strong{Features include:}
+Features include:
 
 @itemize @bullet
 @item
-Special editing modes for @strong{27 programing languages}, including C,
+Special editing modes for @strong{27 programming languages,} including C,
 C@t{++}, Fortran, Java, JavaScript, Lisp, Objective C, Pascal, Perl,
 and Scheme.
 
@@ -39,7 +36,7 @@ and creating Makefiles for GNU/Linux, UNIX, Windows/DOS, and 
VMS
 systems.
 
 @item
-Support for typing and displaying in @strong{60 non-English languages},
+Support for typing and displaying in @strong{60 non-English languages,}
 including Arabic, Chinese, Czech, Hebrew, Hindi, Japanese, Korean,
 Russian, Vietnamese, and all Western European languages.
 
@@ -48,18 +45,18 @@ The ability to:
 
 @itemize @minus
 @item
-Create @strong{PostScript output} from plain-text files (special editing
-modes for @LaTeX{} and @TeX{} are included).
+Create @strong{PostScript output} from plain-text files (special
+editing modes for @LaTeX{} and @TeX{} are included).
 
 @item
 @strong{Compile} and @strong{debug} from inside Emacs.
 
 @item
-Maintain program @strong{ChangeLogs}.
+Maintain program @strong{ChangeLogs.}
 
 @item
 Flag, move, and delete files and sub-directories recursively
-(@strong{directory navigation}).
+@strong{(directory navigation).}
 
 @item
 Run @strong{shell commands} from inside Emacs, or even use Emacs itself
@@ -69,8 +66,8 @@ as a shell (Eshell).
 Enjoy the use of extensive @strong{merge} and @strong{diff} functions.
 
 @item
-Take advantage of built-in support for many @strong{version control}
-systems, including Git, Mercurial, Bazaar, Subversion, and CVS.
+Take advantage of built-in support for many @strong{version control
+systems}, including Git, Mercurial, Bazaar, Subversion, and CVS.
 
 @item
 And much more!
@@ -78,20 +75,24 @@ And much more!
 @end itemize
 
 Emacs comes with an introductory online tutorial available in many
-languages.  This book picks up where that tutorial ends.  It explains
-the full range of Emacs's power and contains reference material useful
-to expert users.
+languages, and this nineteenth edition of the manual picks up where
+that tutorial ends.  It explains the full range of the power of Emacs,
+now up to @strong[version 27.2,} and contains reference material
+useful to expert users.  It also includes appendices with specific
+material about X and GTK resources, and with details for users of
+macOS and Microsoft Windows.
 
-Appendices are included, with specific material about X and GTK
-resources, and with details for users of Macintosh and Microsoft OS.
+And when you tire of all the work you can accomplish with it, Emacs
+contains games to play.
 
-@strong{About the Author:}
+@strong{About the original and principal author:}
 
-Richard M.@: Stallman developed the first Emacs in 1975 and wrote GNU
+Richard M.@: Stallman developed the first Emacs in 1976 and wrote GNU
 Emacs in 1984/85.  He has received the ACM Grace Hopper Award, a
 MacArthur Foundation fellowship, the Electronic Frontier Foundation's
-Pioneer award, and the Takeda Award for Social/Economic Betterment, as
-well as several honorary doctorates.
+Pioneer award, the Takeda Award for Social/Economic Betterment, and
+the ACM Software and System Award, as well as several doctorates
+honoris causa.
 @end quotation
 
 @hfil
diff --git a/doc/emacs/book-spine.texi b/doc/emacs/book-spine.texi
index 84a0168..20e23ca 100644
--- a/doc/emacs/book-spine.texi
+++ b/doc/emacs/book-spine.texi
@@ -13,8 +13,8 @@
 
 @center @titlefont{GNU Emacs Manual}
 @sp 5
-@center @value{EDITION} Edition, for Emacs Version @value{EMACSVER}
+@center @value{EDITION} edition, for Emacs Version @value{EMACSVER}
 @sp 5
 
-@center by Richard M.@: Stallman
+@center by Richard M.@: Stallman et al.
 @bye
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
index 3625703..3fbaf8b 100644
--- a/doc/emacs/dired.texi
+++ b/doc/emacs/dired.texi
@@ -457,6 +457,15 @@ Visit the parent directory of the current directory
 for @file{..} and typing @kbd{f} there.
 @end table
 
+@defopt dired-kill-when-opening-new-dired-buffer
+  When visiting a new sub-directory in Dired, Emacs will (by default)
+open a new buffer to display this new directory, and leave the old
+Dired buffer as is.  If this user option is non-@code{nil}, the old
+Dired buffer will be killed after selecting the new directory.  This
+means that if you're traversing a directory structure in Dired, you
+won't end up with more than a single Dired buffer.
+@end defopt
+
 @node Marks vs Flags
 @section Dired Marks vs.@: Flags
 
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index f6c422a..ae345c1 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1189,8 +1189,8 @@ that has some special meaning for formatting the source 
code of a
 program.
 
   To activate the fill-column indication display, use the minor modes
-@kbd{M-x display-fill-@-column-indicator-mode} and
-@kbd{M-x global-display-fill-column-indicator-mode}, which enable
+@code{display-fill-@-column-indicator-mode} and
+@code{global-display-fill-column-indicator-mode}, which enable
 the indicator locally or globally, respectively.
 
 Alternatively, you can set the two buffer-local variables
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index c895b01..d2011eb 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -95,7 +95,7 @@ Boston, MA 02110-1301 USA @*
 ISBN 978-0-9831592-8-5
 
 @sp 2
-Cover art by Etienne Suvasa; cover design by Matt Lee.
+Cover art by Etienne Suvasa; cover design by FSF staff.
 
 @end titlepage
 
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 912980b..7edf4d2 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -227,6 +227,15 @@ File Names}, for information on how to visit a file whose 
name
 actually contains wildcard characters.  You can disable the wildcard
 feature by customizing @code{find-file-wildcards}.
 
+@vindex query-about-changed-file
+  If you're asking to visit a file that's already visited in a buffer,
+but the file has changed externally, Emacs normally asks you whether
+you want to re-read the file from disk.  But if you set
+@code{query-about-changed-file} to @code{nil}, Emacs won't query you,
+but will instead just display the buffer's contents before the
+changes, and show an echo-area message telling you how to revert the
+buffer from the file.
+
 @kindex C-x C-v
 @findex find-alternate-file
   If you visit the wrong file unintentionally by typing its name
@@ -789,7 +798,9 @@ Emacs buffer visiting it has unsaved changes.
 @vindex create-lockfiles
   You can prevent the creation of lock files by setting the variable
 @code{create-lockfiles} to @code{nil}.  @strong{Caution:} by
-doing so you will lose the benefits that this feature provides.
+doing so you will lose the benefits that this feature provides.  You
+can also control where lock files are written by using the
+@code{lock-file-name-transforms} variable.
 
 @cindex collision
   If you begin to modify the buffer while the visited file is locked by
@@ -834,6 +845,14 @@ warning message and asks for confirmation before saving; 
answer
 place, one way to compare the buffer to its file is the @kbd{M-x
 diff-buffer-with-file} command.  @xref{Comparing Files}.
 
+@vindex remote-file-name-inhibit-locks
+  You can prevent the creation of remote lock files by setting the
+variable @code{remote-file-name-inhibit-locks} to @code{t}.
+
+@cindex lock-file-mode
+  The minor mode @code{lock-file-mode}, called interactively, toggles
+the local value of @code{create-lockfiles} in the current buffer.
+
 @node File Shadowing
 @subsection Shadowing Files
 @cindex shadow files
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index a91bfac..3205e6d 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -3132,10 +3132,12 @@ one is able to set the variables.
 Setup for version-controlled files configurable by the variable
 @code{bug-reference-setup-from-vc-alist}.  The default is able to
 setup GNU projects where @url{https://debbugs.gnu.org} is used as
-issue tracker, Github projects where both bugs and pull requests are
-referenced using the @code{#42} notation, and GitLab projects where
-bugs are references with @code{#17}, too, but merge requests use the
-@code{!18} notation.
+issue tracker and issues are usually referenced as @code{bug#13} (but
+many different notations are considered, too), Sourcehut projects
+where issues are referenced using the notation @code{#17}, Codeberg
+and Github projects where both bugs and pull requests are referenced
+using the same notation, and GitLab projects where bugs are referenced
+with @code{#17}, too, but merge requests use the @code{!18} notation.
 
 @item
 Setup for email guessing from mail folder/mbox names, and mail header
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 3c11a39..12cd492 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -2031,7 +2031,7 @@ evaluation performed is for side-effect rather than 
result.
 Connect to the Emacs server named @var{server-name}.  (This option is
 not supported on MS-Windows.)  The server name is given by the
 variable @code{server-name} on the Emacs server.  If this option is
-omitted, @command{emacsclient} connects to the first server it finds.
+omitted, @command{emacsclient} connects to the default socket.
 If you set @code{server-name} of the Emacs server to an absolute file
 name, give the same absolute file name as @var{server-name} to this
 option to instruct @command{emacsclient} to connect to that server.
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index 922eec7..22b3677 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -174,8 +174,10 @@ characters in the range @code{#x0080..#x00FF}.
 @cindex font of character at point
 @cindex text properties at point
 @cindex face at point
-  With a prefix argument (@kbd{C-u C-x =}), this command displays a
-detailed description of the character in a window:
+@findex describe-char
+  With a prefix argument (@kbd{C-u C-x =}), this command additionally
+calls the command @code{describe-char}, which displays a detailed
+description of the character:
 
 @itemize @bullet
 @item
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 5238597..c7e5537 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -772,6 +772,20 @@ and otherwise ignores the error.
 If this variable is @code{nil}, Emacs does not lock files.
 @end defopt
 
+@defopt lock-file-name-transforms
+By default, Emacs creates the lock files in the same directory as the
+files that are being locked.  This can be changed by customizing this
+variable.  Is has the same syntax as
+@code{auto-save-file-name-transforms} (@pxref{Auto-Saving}).  For
+instance, to make Emacs write all the lock files to @file{/var/tmp/},
+you could say something like:
+
+@lisp
+(setq lock-file-name-transforms
+      '(("\\`/.*/\\([^/]+\\)\\'" "/var/tmp/\\1" t)))
+@end lisp
+@end defopt
+
 @defun ask-user-about-lock file other-user
 This function is called when the user tries to modify @var{file}, but it
 is locked by another user named @var{other-user}.  The default
@@ -807,6 +821,16 @@ If you wish, you can replace the 
@code{ask-user-about-lock} function
 with your own version that makes the decision in another way.
 @end defun
 
+@defopt remote-file-name-inhibit-locks
+You can prevent the creation of remote lock files by setting the
+variable @code{remote-file-name-inhibit-locks} to @code{t}.
+@end defopt
+
+@deffn Command lock-file-mode
+This command, called interactively, toggles the local value of
+@code{create-lockfiles} in the current buffer.
+@end deffn
+
 @node Information about Files
 @section Information about Files
 @cindex file, information about
@@ -3273,7 +3297,7 @@ first, before handlers for jobs such as remote file 
access.
 @code{file-equal-p},
 @code{file-executable-p}, @code{file-exists-p},
 @code{file-in-directory-p},
-@code{file-local-copy},
+@code{file-local-copy}, @code{file-locked-p},
 @code{file-modes}, @code{file-name-all-completions},
 @code{file-name-as-directory},
 @code{file-name-case-insensitive-p},
@@ -3292,10 +3316,11 @@ first, before handlers for jobs such as remote file 
access.
 @code{get-file-buffer},
 @code{insert-directory},
 @code{insert-file-contents},@*
-@code{load},
+@code{load}, @code{lock-file},
 @code{make-auto-save-file-name},
 @code{make-directory},
 @code{make-directory-internal},
+@code{make-lock-file-name},
 @code{make-nearby-temp-file},
 @code{make-process},
 @code{make-symbolic-link},@*
@@ -3307,6 +3332,7 @@ first, before handlers for jobs such as remote file 
access.
 @code{substitute-in-file-name},@*
 @code{temporary-file-directory},
 @code{unhandled-file-name-directory},
+@code{unlock-file},
 @code{vc-registered},
 @code{verify-visited-file-modtime},@*
 @code{write-region}.
@@ -3331,7 +3357,7 @@ first, before handlers for jobs such as remote file 
access.
 @code{file-equal-p},
 @code{file-executable-p}, @code{file-exists-p},
 @code{file-in-directory-p},
-@code{file-local-copy},
+@code{file-local-copy}, @code{file-locked-p},
 @code{file-modes}, @code{file-name-all-completions},
 @code{file-name-as-directory},
 @code{file-name-case-insensitive-p},
@@ -3350,10 +3376,12 @@ first, before handlers for jobs such as remote file 
access.
 @code{get-file-buffer},
 @code{insert-directory},
 @code{insert-file-contents},
-@code{load},
+@code{load}, @code{lock-file},
 @code{make-auto-save-file-name},
 @code{make-direc@discretionary{}{}{}tory},
 @code{make-direc@discretionary{}{}{}tory-internal},
+@code{make-lock-file-name},
+@code{make-nearby-temp-file},
 @code{make-process},
 @code{make-symbolic-link},
 @code{process-file},
@@ -3362,7 +3390,9 @@ first, before handlers for jobs such as remote file 
access.
 @code{set-visited-file-modtime}, @code{shell-command},
 @code{start-file-process},
 @code{substitute-in-file-name},
+@code{temporary-file-directory},
 @code{unhandled-file-name-directory},
+@code{unlock-file},
 @code{vc-regis@discretionary{}{}{}tered},
 @code{verify-visited-file-modtime},
 @code{write-region}.
diff --git a/doc/lispref/intro.texi b/doc/lispref/intro.texi
index 35f852b..c2ed964 100644
--- a/doc/lispref/intro.texi
+++ b/doc/lispref/intro.texi
@@ -89,7 +89,7 @@ you are criticizing.
 @cindex suggestions
 Please send comments and corrections using @kbd{M-x
 report-emacs-bug}.  If you wish to contribute new code (or send a
-patch to fix a problem), use @kbd{M-x submit-emacs-patch}).
+patch to fix a problem), use @kbd{M-x submit-emacs-patch}.
 
 @node Lisp History
 @section Lisp History
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi
index 2805b1f..ac99835 100644
--- a/doc/lispref/lists.texi
+++ b/doc/lispref/lists.texi
@@ -1804,7 +1804,7 @@ through a simple example:
 (let-alist colors
   (if (eq .rose 'red)
       .lily))
-=> white
+     @result{} white
 @end lisp
 
 The @var{body} is inspected at compilation time, and only the symbols
@@ -1820,7 +1820,7 @@ Nested association lists is supported:
 (let-alist colors
   (if (eq .rose 'red)
       .lily.belladonna))
-=> yellow
+     @result{} yellow
 @end lisp
 
 Nesting @code{let-alist} inside each other is allowed, but the code in
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 5869f53..7214948 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -3551,7 +3551,7 @@ which will instruct font-lock not to start or end the 
scan in the
 middle of the construct.
 @end itemize
 
-  There are three ways to do rehighlighting of multiline constructs:
+  There are several ways to do rehighlighting of multiline constructs:
 
 @itemize
 @item
@@ -3573,6 +3573,17 @@ This works only if @code{jit-lock-contextually} is used, 
and with the
 same delay before rehighlighting, but like @code{font-lock-multiline},
 it also handles the case where highlighting depends on
 subsequent lines.
+@item
+If parsing the @emph{syntax} of a construct depends on it being parsed in one
+single chunk, you can add the @code{syntax-multiline} text property
+over the construct in question.  The most common use for this is when
+the syntax property to apply to @samp{FOO} depend on some later text
+@samp{BAR}: By placing this text property over the whole of
+@samp{FOO...BAR}, you make sure that any change of @samp{BAR} will
+also cause the syntax property of @samp{FOO} to be recomputed.
+Note: For this to work, the mode needs to add
+@code{syntax-propertize-multiline} to
+@code{syntax-propertize-extend-region-functions}.
 @end itemize
 
 @menu
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi
index d8091f1..365d5ac 100644
--- a/doc/lispref/objects.texi
+++ b/doc/lispref/objects.texi
@@ -1001,6 +1001,13 @@ It looks like this:
 @end example
 @end ifnottex
 
+  As a somewhat peculiar side effect of @code{(a b . c)} and
+@code{(a . (b . c))} being equivalent, for consistency this means
+that if you replace @code{b} here with the empty sequence, then it
+follows that @code{(a . c)} and @code{(a . ( . c))} are equivalent,
+too.  This also means that @code{( .  c)} is equivalent to @code{c},
+but this is seldom used.
+
 @node Association List Type
 @subsubsection Association List Type
 
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 242c5ed..12ddaf0 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -2167,6 +2167,11 @@ if @var{time} is @code{t}, then the timer runs whenever 
the time is a
 multiple of @var{repeat} seconds after the epoch.  This is useful for
 functions like @code{display-time}.
 
+If Emacs didn't get any CPU time when the timer would have run (for
+example if the system was busy running another process or if the
+computer was sleeping or in a suspended state), the timer will run as
+soon as Emacs resumes and is idle.
+
 The function @code{run-at-time} returns a timer value that identifies
 the particular scheduled future action.  You can use this value to call
 @code{cancel-timer} (see below).
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 0dfdac7..90c4215 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -247,6 +247,16 @@ protected by @code{shell-quote-argument};
 @code{combine-and-quote-strings} is @emph{not} intended to protect
 special characters from shell evaluation.
 
+@defun split-string-shell-command string
+This function splits @var{string} into substrings, respecting double
+and single quotes, as well as backslash quoting.
+
+@smallexample
+(split-string-shell-command "ls /tmp/'foo bar'")
+     @result{} ("ls" "/tmp/foo bar")
+@end smallexample
+@end defun
+
 @defun split-string-and-unquote string &optional separators
 This function splits @var{string} into substrings at matches for the
 regular expression @var{separators}, like @code{split-string} does
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 0c87a19..6fbb475 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -502,6 +502,15 @@ This is like @code{insert-buffer-substring} except that it 
does not
 copy any text properties.
 @end defun
 
+@defun insert-into-buffer to-buffer &optional start end
+This is like @code{insert-buffer-substring}, but works in the opposite
+direction: The text is copied from the current buffer into
+@var{to-buffer}.  The block of text is copied to the current point in
+@var{to-buffer}, and point (in that buffer) is advanced to after the
+end of the copied text.  Is @code{start}/@code{end} is @code{nil}, the
+entire text in the current buffer is copied over.
+@end defun
+
   @xref{Sticky Properties}, for other insertion functions that inherit
 text properties from the nearby text in addition to inserting it.
 Whitespace inserted by indentation functions also inherits text
@@ -4399,7 +4408,8 @@ based on their character codes.
 @cindex replace characters
 This function replaces all occurrences of the character @var{old-char}
 with the character @var{new-char} in the region of the current buffer
-defined by @var{start} and @var{end}.
+defined by @var{start} and @var{end}.  Both characters must have the
+same length of their multibyte form.
 
 @cindex undo avoidance
 If @var{noundo} is non-@code{nil}, then @code{subst-char-in-region} does
@@ -4428,6 +4438,16 @@ ThXs Xs the contents of the buffer before.
 @end example
 @end defun
 
+
+@defun subst-char-in-string fromchar tochar string &optional inplace
+@cindex replace characters in string
+This function replaces all occurrences of the character @var{fromchar}
+with @var{tochar} in @var{string}.  By default, substitution occurs in
+a copy of @var{string}, but if the optional argument @var{inplace} is
+non-@code{nil}, the function modifies the @var{string} itself.  In any
+case, the function returns the resulting string.
+@end defun
+
 @deffn Command translate-region start end table
 This function applies a translation table to the characters in the
 buffer between positions @var{start} and @var{end}.
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index 54cafff..8aa225a 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -168,11 +168,12 @@ follow the naming conventions for hooks.  @xref{Hooks}.
 
 @item
 @cindex unloading packages, preparing for
-If loading the file adds functions to hooks, define a function
-@code{@var{feature}-unload-function}, where @var{feature} is the name
-of the feature the package provides, and make it undo any such
-changes.  Using @code{unload-feature} to unload the file will run this
-function.  @xref{Unloading}.
+Using @code{unload-feature} will undo the changes usually done by
+loading a feature (like adding functions to hooks).  However, if
+loading @var{feature} does something unusual and more complex, you can
+define a function named @code{@var{feature}-unload-function}, and make
+it undo any such special changes.  @code{unload-feature} will then
+automatically run this function if it exists.  @xref{Unloading}.
 
 @item
 It is a bad idea to define aliases for the Emacs primitives.  Normally
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index 53a3af4..d66c12f 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -1519,6 +1519,7 @@ of files from Macintosh, Microsoft, and Unix platforms.
 * Documentation for etags::
 * Disabling backups::
 * Disabling auto-save-mode::
+* Not writing files to the current directory::
 * Going to a line by number::
 * Modifying pull-down menus::
 * Deleting menus and menu options::
@@ -2620,6 +2621,39 @@ such as @file{/tmp}.
 To disable or change how @code{auto-save-mode} works,
 @pxref{Auto Save,,, emacs, The GNU Emacs Manual}.
 
+@node Not writing files to the current directory
+@section Making Emacs write all auxiliary files somewhere else
+@cindex Writing all auxiliary files to the same directory
+
+By default, Emacs may create many new files in the directory where
+you're editing a file.  If you're editing the file
+@file{/home/user/foo.txt}, Emacs will create the lock file
+@file{/home/user/.#foo.txt}, the auto-save file
+@file{/home/user/#foo.txt#}, and when you save the file, Emacs will
+create the backup file @file{/home/user/foo.txt~}.  (The first two
+files are deleted when you save the file.)
+
+This may be inconvenient in some setups, so Emacs has mechanisms for
+changing the locations of all these files.
+
+@table @code
+@item auto-save-file-name-transforms (@pxref{Auto-Saving,,,elisp, GNU Emacs 
Lisp Reference Manual}).
+@item lock-file-name-transforms (@pxref{File Locks,,,elisp, GNU Emacs Lisp 
Reference Manual}).
+@item backup-directory-alist (@pxref{Making Backups,,,elisp, GNU Emacs Lisp 
Reference Manual}).
+@end table
+
+For instance, to write all these things to
+@file{~/.emacs.d/aux/}:
+
+@lisp
+(setq lock-file-name-transforms
+      '(("\\`/.*/\\([^/]+\\)\\'" "~/.emacs.d/aux/\\1" t)))
+(setq auto-save-file-name-transforms
+      '(("\\`/.*/\\([^/]+\\)\\'" "~/.emacs.d/aux/\\1" t)))
+(setq backup-directory-alist
+      '((".*" . "~/.emacs.d/aux/")))
+@end lisp
+
 @node Going to a line by number
 @section How can I go to a certain line given its number?
 @cindex Going to a line by number
diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org
index 9b1a001..5bb230f 100644
--- a/doc/misc/modus-themes.org
+++ b/doc/misc/modus-themes.org
@@ -2,12 +2,12 @@
 #+author: Protesilaos Stavrou
 #+email: info@protesilaos.com
 #+language: en
-#+options: ':t toc:nil author:t email:t
+#+options: ':t toc:nil author:t email:t num:t
 #+startup: content
 
-#+macro: stable-version 1.4.0
-#+macro: release-date 2021-05-25
-#+macro: development-version 1.5.0-dev
+#+macro: stable-version 1.5.0
+#+macro: release-date 2021-07-15
+#+macro: development-version 1.6.0-dev
 #+macro: file @@texinfo:@file{@@$1@@texinfo:}@@
 #+macro: space @@texinfo:@: @@
 #+macro: kbd @@texinfo:@kbd{@@$1@@texinfo:}@@
@@ -245,8 +245,11 @@ a theme with either of the following expressions:
 #+end_src
 
 Changes to the available customization options must always be evaluated
-before loading a theme 
([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]).  This is 
how a basic
-setup could look like:
+before loading a theme 
([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]).  An 
exception to this
+norm is when using the various Custom interfaces or with commands like
+{{{kbd(M-x customize-set-variable)}}}, which automatically reload the theme by
+default ([[#h:9001527a-4e2c-43e0-98e8-3ef72d770639][Option for inhibiting 
theme reload]]).  This is how a basic setup
+could look like:
 
 #+begin_src emacs-lisp
 (require 'modus-themes)
@@ -294,9 +297,9 @@ package configurations in their setup.  We use this as an 
example:
   :ensure                         ; omit this to use the built-in themes
   :init
   ;; Add all your customizations prior to loading the themes
-  (setq modus-themes-slanted-constructs t
+  (setq modus-themes-italic-constructs t
         modus-themes-bold-constructs nil
-        modus-themes-region 'no-extend)
+        modus-themes-region '(bg-only no-extend))
 
   ;; Load the theme files before enabling a theme (else you get an error).
   (modus-themes-load-themes)
@@ -366,7 +369,7 @@ configure custom faces, where ~load-theme~ is expected, 
though
 
 The Modus themes are highly configurable, though they should work well
 without any further tweaks.  By default, all customization options are
-set to nil.
+set to nil, unless otherwise noted in this manual.
 
 Remember that all customization options must be evaluated before loading
 a theme ([[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]).
@@ -375,68 +378,78 @@ Below is a summary of what you will learn in the 
subsequent sections of
 this manual.
 
 #+begin_src emacs-lisp
-(setq modus-themes-slanted-constructs t
+(setq modus-themes-italic-constructs t
       modus-themes-bold-constructs nil
       modus-themes-no-mixed-fonts nil
       modus-themes-subtle-line-numbers nil
       modus-themes-success-deuteranopia t
+      modus-themes-inhibit-reload t ; only applies to `customize-set-variable' 
and related
 
       modus-themes-fringes nil ; {nil,'subtle,'intense}
 
-      ;; Options for `modus-themes-lang-checkers': nil,
-      ;; 'straight-underline, 'subtle-foreground,
-      ;; 'subtle-foreground-straight-underline, 'intense-foreground,
-      ;; 'intense-foreground-straight-underline, 'colored-background
+      ;; Options for `modus-themes-lang-checkers' are either nil (the
+      ;; default), or a list of properties that may include any of those
+      ;; symbols: `straight-underline', `text-also', `background',
+      ;; `intense'
       modus-themes-lang-checkers nil
 
-      ;; Options for `modus-themes-mode-line': nil, '3d, 'moody,
-      ;; 'borderless, 'borderless-3d, 'borderless-moody, 'accented,
-      ;; 'accented-3d, 'accented-moody, 'borderless-accented,
-      ;; 'borderless-accented-3d, 'borderless-accented-moody
-      modus-themes-mode-line '3d
+      ;; Options for `modus-themes-mode-line' are either nil, or a list
+      ;; that can combine any of `3d' OR `moody', `borderless',
+      ;; `accented'.  The variable's doc string shows all possible
+      ;; combinations.
+      modus-themes-mode-line '(3d accented)
 
-      ;; Options for `modus-themes-syntax': nil, 'faint,
-      ;; 'yellow-comments, 'green-strings,
-      ;; 'yellow-comments-green-strings, 'alt-syntax,
-      ;; 'alt-syntax-yellow-comments, 'faint-yellow-comments
+      ;; Options for `modus-themes-syntax' are either nil (the default),
+      ;; or a list of properties that may include any of those symbols:
+      ;; `faint', `yellow-comments', `green-strings', `alt-syntax'
       modus-themes-syntax nil
 
-      ;; Options for `modus-themes-hl-line': nil, 'intense-background,
-      ;; 'accented-background, 'underline-neutral,
-      ;; 'underline-accented, 'underline-only-neutral,
-      ;; 'underline-only-accented
-      modus-themes-hl-line 'underline-neutral
+      ;; Options for `modus-themes-hl-line' are either nil (the default),
+      ;; or a list of properties that may include any of those symbols:
+      ;; `accented', `underline', `intense'
+      modus-themes-hl-line '(underline accented)
 
-      modus-themes-paren-match 'subtle-bold ; 
{nil,'subtle-bold,'intense,'intense-bold}
+      ;; Options for `modus-themes-paren-match' are either nil (the
+      ;; default), or a list of properties that may include any of those
+      ;; symbols: `bold', `intense', `underline'
+      modus-themes-paren-match '(bold intense)
 
-      ;; Options for `modus-themes-links': nil, 'faint,
-      ;; 'neutral-underline, 'faint-neutral-underline, 'no-underline,
-      ;; 'underline-only, 'neutral-underline-only
-      modus-themes-links 'neutral-underline
+      ;; Options for `modus-themes-links' are either nil (the default),
+      ;; or a list of properties that may include any of those symbols:
+      ;; `neutral-underline' OR `no-underline', `faint' OR `no-color',
+      ;; `bold', `italic', `background'
+      modus-themes-links '(neutral-underline background)
 
-      ;; Options for `modus-themes-prompts': nil, 'subtle-accented,
-      ;; 'intense-accented, 'subtle-gray, 'intense-gray
-      modus-themes-prompts 'subtle-gray
+      ;; Options for `modus-themes-prompts' are either nil (the
+      ;; default), or a list of properties that may include any of those
+      ;; symbols: `background', `bold', `gray', `intense', `italic'
+      modus-themes-prompts '(intense bold)
 
       modus-themes-completions 'moderate ; {nil,'moderate,'opinionated}
 
       modus-themes-mail-citations nil ; {nil,'faint,'monochrome}
 
-      ;; Options for `modus-themes-region': nil, 'no-extend, 'bg-only,
-      ;; 'bg-only-no-extend, 'accent, 'accent-no-extend
-      modus-themes-region 'bg-only-no-extend
+      ;; Options for `modus-themes-region' are either nil (the default),
+      ;; or a list of properties that may include any of those symbols:
+      ;; `no-extend', `bg-only', `accented'
+      modus-themes-region '(bg-only no-extend)
 
       ;; Options for `modus-themes-diffs': nil, 'desaturated,
       ;; 'bg-only, 'deuteranopia, 'fg-only-deuteranopia
       modus-themes-diffs 'fg-only-deuteranopia
 
       modus-themes-org-blocks 'gray-background ; 
{nil,'gray-background,'tinted-background}
-      modus-themes-org-habit nil ; {nil,'simplified,'traffic-light}
+
+      modus-themes-org-agenda ; this is an alist: read the manual or its doc 
string
+      '((header-block . (variable-pitch scale-title))
+        (header-date . (grayscale workaholic bold-today))
+        (scheduled . uniform)
+        (habit . traffic-light-deuteranopia))
 
       modus-themes-headings ; this is an alist: read the manual or its doc 
string
-      '((1 . line)
-        (2 . rainbow-line-no-bold)
-        (t . no-bold))
+      '((1 . (overline background))
+        (2 . (rainbow overline))
+        (t . (no-bold)))
 
       modus-themes-variable-pitch-ui nil
       modus-themes-variable-pitch-headings t
@@ -445,9 +458,30 @@ this manual.
       modus-themes-scale-2 1.15
       modus-themes-scale-3 1.21
       modus-themes-scale-4 1.27
-      modus-themes-scale-5 1.33)
+      modus-themes-scale-title 1.33)
 #+end_src
 
+** Option for inhibiting theme reload
+:properties:
+:alt_title: Custom reload theme
+:description: Toggle auto-reload of the theme when setting custom variables
+:custom_id: h:9001527a-4e2c-43e0-98e8-3ef72d770639
+:end:
+#+vindex: modus-themes-inhibit-reload
+
+Symbol: ~modus-themes-inhibit-reload~
+
+Possible values:
+
+1. ~nil~ 
+2. ~t~ (default)
+
+By default, customizing a theme-related user option through the Custom
+interfaces or with {{{kbd(M-x customize-set-variable)}}} will not reload the
+currently active Modus theme.
+
+Enable this behaviour by setting this variable to ~nil~.
+
 ** Option for color-coding success state (deuteranopia)
 :properties:
 :alt_title: Success' color-code
@@ -501,26 +535,36 @@ weight.  This concerns keywords and other important 
aspects of code
 syntax.  It also affects certain mode line indicators and command-line
 prompts.
 
-** Option for more slanted constructs
+Advanced users may also want to configure the exact attributes of the
+~bold~ face.
+
+[[#h:2793a224-2109-4f61-a106-721c57c01375][Configure bold and italic faces]].
+
+** Option for more italic constructs
 :properties:
-:alt_title: Slanted constructs
-:description: Toggle slanted constructs (italics) in code
+:alt_title: Italic constructs
+:description: Toggle italic font constructs in code
 :custom_id: h:977c900d-0d6d-4dbb-82d9-c2aae69543d6
 :end:
-#+vindex: modus-themes-slanted-constructs
+#+vindex: modus-themes-italic-constructs
 
-Symbol: ~modus-themes-slanted-constructs~
+Symbol: ~modus-themes-italic-constructs~
 
 Possible values:
 
 1. ~nil~ (default)
 2. ~t~
 
-The default is to not use slanted text (italics) unless it is absolutely
-necessary.
+The default is to not use slanted text forms (italics) unless it is
+absolutely necessary.
 
-With a non-nil value (~t~) choose to render more faces in slanted text.
-This typically affects documentation strings and code comments.
+With a non-nil value (~t~) choose to render more faces in italics.  This
+typically affects documentation strings and code comments.
+
+Advanced users may also want to configure the exact attributes of the
+~italic~ face.
+
+[[#h:2793a224-2109-4f61-a106-721c57c01375][Configure bold and italic faces]].
 
 ** Option for syntax highlighting
 :properties:
@@ -532,44 +576,57 @@ This typically affects documentation strings and code 
comments.
 
 Symbol: ~modus-themes-syntax~
 
-Possible values:
+Possible values are expressed as a list of properties (default is ~nil~ or
+an empty list).  The list can include any of the following symbols:
 
-1. ~nil~ (default)
-2. ~faint~
-3. ~yellow-comments~
-4. ~green-strings~
-5. ~yellow-comments-green-strings~
-6. ~alt-syntax~
-7. ~alt-syntax-yellow-comments~
-8. ~faint-yellow-comments~
-
-The default style (nil) for code syntax highlighting is a balanced
++ ~faint~
++ ~yellow-comments~
++ ~green-strings~
++ ~alt-syntax~
+
+The default (a ~nil~ value or an empty list) is to use a balanced
 combination of colors on the cyan-blue-magenta side of the spectrum.
-There is little to no use of greens, yellows, or reds, except when it is
-necessary.
+There is little to no use of greens, yellows, and reds.  Comments are
+gray, strings are blue colored, doc strings are a shade of cyan, while
+color combinations are designed to avoid exaggerations.
+
+The property ~faint~ fades the saturation of all applicable colors, where
+that is possible or appropriate.
+
+The property ~yellow-comments~ applies a yellow color to comments.
 
-Option ~faint~ is like the default in terms of the choice of palette but
-applies desaturated color values.
+The property ~green-strings~ applies a green color to strings and a green
+tint to doc strings.
 
-Option ~yellow-comments~ adds a yellow tint to comments.  The rest of the
-syntax is the same as the default.
+The property ~alt-syntax~ changes the combination of colors beyond strings
+and comments, so that the effective palette is broadened to provide
+greater variety relative to the default.
 
-Option ~green-strings~ replaces the blue/cyan/cold color variants in
-strings with greener alternatives.  The rest of the syntax remains the
-same.
+Combinations of any of those properties are expressed as a list, like in
+these examples:
 
-Option ~yellow-comments-green-strings~ combines yellow comments with green
-strings and the rest of the default syntax highlighting style.
+#+begin_src emacs-lisp
+(faint)
+(green-strings yellow-comments)
+(alt-syntax green-strings yellow-comments)
+(faint alt-syntax green-strings yellow-comments)
+#+end_src
 
-Option ~alt-syntax~ expands the active spectrum by applying color
-combinations with more contrasting hues between them.  Expect to find
-red and green variants in addition to cyan, blue, magenta.
+The order in which the properties are set is not significant.
 
-Option ~alt-syntax-yellow-comments~ combines ~alt-syntax~ with
-~yellow-comments~.
+In user configuration files the form may look like this:
 
-Option ~faint-yellow-comments~ combines the ~faint~ style with
-~yellow-comments~.
+#+begin_src emacs-lisp
+(setq modus-themes-syntax '(faint alt-syntax))
+#+end_src
+
+Independent of this variable, users may also control the use of a bold
+weight or italic text: ~modus-themes-bold-constructs~ and
+~modus-themes-italic-constructs~.
+
+[[#h:b25714f6-0fbe-41f6-89b5-6912d304091e][Option for more bold constructs]].
+
+[[#h:977c900d-0d6d-4dbb-82d9-c2aae69543d6][Option for more italic constructs]].
 
 ** Option for no font mixing
 :properties:
@@ -611,43 +668,66 @@ are ~org-variable-pitch~ and ~mixed-pitch~.
 
 Symbol: ~modus-themes-links~
 
-Possible values:
+Possible values are expressed as a list of properties (default is ~nil~ or
+an empty list).  The list can include any of the following symbols:
 
-1. ~nil~ (default)
-2. ~faint~
-3. ~neutral-underline~
-4. ~faint-neutral-underline~
-5. ~no-underline~
-6. ~underline-only~
-7. ~neutral-underline-only~
++ Underline style:
+  - ~neutral-underline~
+  - ~no-underline~
++ Text coloration:
+  - ~faint~
+  - ~no-color~
++ ~bold~
++ ~italic~
++ ~background~
+
+The default (a ~nil~ value or an empty list) is a prominent text color,
+typically blue, with an underline of the same color.
 
-The default style (nil) for links is to apply an underline and a
-saturated color to the affected text.  The color of the two is the same,
-which makes the link fairly prominent.
+For the style of the underline, a ~neutral-underline~ property turns the
+color of the line into a subtle gray, while the ~no-underline~ property
+removes the line altogether.  If both of those are set, the latter takes
+precedence.
 
-Option ~faint~ follows the same approach as the default, but uses less
-intense colors.
+For text coloration, a ~faint~ property desaturates the color of the text
+and the underline, unless the underline is affected by the
+aforementioned properties.  While a ~no-color~ property removes the color
+from the text.  If both of those are set, the latter takes precedence.
 
-Option ~neutral-underline~ changes the underline's color to a subtle gray,
-while retaining the default text color.
+A ~bold~ property applies a heavy typographic weight to the text of the
+link.
 
-Option ~faint-neutral-underline~ combines a desaturated text color with a
-subtle gray underline.
+An ~italic~ property adds a slant to the link's text (italic or oblique
+forms, depending on the typeface).
 
-Option ~no-underline~ removes link underlines altogether, while retaining
-their original fairly vivid color.
+A ~background~ property applies a subtle tinted background color.
 
-Option ~underline-only~ applies a prominent underline while making the
-affected text colorless (it uses the same foreground as the theme's
-default).
+In case both ~no-underline~ and ~no-color~ are set, then a subtle gray
+background is applied to all links.  This can still be combined with the
+~bold~ and ~italic~ properties.
 
-Option ~neutral-underline-only~ makes the text colorless while using a
-subtle gray underline below it.
+Combinations of any of those properties are expressed as a list,
+like in these examples:
 
-NOTE: The placement of the underline, i.e. its proximity to the affected
-text, is controlled by the built-in ~x-underline-at-descent-line~,
-~x-use-underline-position-properties~, ~underline-minimum-offset~.  Please
-refer to their documentation strings.
+#+begin_src emacs-lisp
+(faint)
+(no-underline faint)
+(no-color no-underline bold)
+(italic bold background no-color no-underline)
+#+end_src
+
+The order in which the properties are set is not significant.
+
+In user configuration files the form may look like this:
+
+#+begin_src emacs-lisp
+(setq modus-themes-links '(neutral-underline background))
+#+end_src
+
+The placement of the underline, meaning its proximity to the text, is
+controlled by ~x-use-underline-position-properties~,
+~x-underline-at-descent-line~, ~underline-minimum-offset~.  Please refer to
+their documentation strings.
 
 ** Option for command prompt styles
 :properties:
@@ -659,27 +739,51 @@ refer to their documentation strings.
 
 Symbol: ~modus-themes-prompts~
 
-Possible values:
+Possible values are expressed as a list of properties (default is ~nil~ or
+an empty list).  The list can include any of the following symbols:
 
-1. ~nil~ (default)
-2. ~subtle-accented~ (~subtle~ exists for backward compatibility)
-3. ~intense-accented~ (~intense~ exists for backward compatibility)
-4. ~subtle-gray~
-5. ~intense-gray~
++ ~background~
++ ~bold~
++ ~gray~
++ ~intense~
++ ~italic~
+
+The default (a ~nil~ value or an empty list) means to only use a subtle
+accented foreground color.
+
+The property ~background~ applies a background color to the prompt's text.
+By default, this is a subtle accented value.
 
-The default does not use any background for minibuffer and command line
-prompts.  It relies exclusively on an accented foreground color.
+The property ~intense~ makes the foreground color more prominent.  If the
+~background~ property is also set, it amplifies the value of the
+background as well.
 
-Options ~subtle-accented~ and ~intense-accented~ will change both the
-background and the foreground values to use accented color combinations
-that follow the hue of the default styles' foreground (e.g. the default
-minibuffer prompt is cyan text, so these combinations will involved a
-cyan background and an appropriate cyan foreground).  The difference
-between the two is that the latter has a more pronounced/noticeable
-effect than the former.
+The property ~gray~ changes the prompt's colors to grayscale.  This
+affects the foreground and, if the ~background~ property is also set, the
+background.  Its effect is subtle, unless it is combined with the
+~intense~ property.
 
-Options ~subtle-gray~, ~intense-gray~ are like their accented counterparts,
-except they use grayscale values.
+The property ~bold~ makes the text use a bold typographic weight.
+Similarly, ~italic~ adds a slant to the font's forms (italic or oblique
+forms, depending on the typeface).
+
+Combinations of any of those properties are expressed as a list, like in
+these examples:
+
+#+begin_src emacs-lisp
+(intense)
+(bold intense)
+(intense bold gray)
+(intense background gray bold)
+#+end_src
+
+The order in which the properties are set is not significant.
+
+In user configuration files the form may look like this:
+
+#+begin_src emacs-lisp
+(setq modus-themes-prompts '(background gray))
+#+end_src
 
 ** Option for mode line presentation
 :properties:
@@ -691,83 +795,78 @@ except they use grayscale values.
 
 Symbol: ~modus-themes-mode-line~
 
-Possible values:
+Possible values, which can be expressed as a list of combinations of box
+effect, color, and border visibility:
 
-1. ~nil~ (default)
-2. ~3d~
-3. ~moody~
-4. ~borderless~
-5. ~borderless-3d~
-6. ~borderless-moody~
-7. ~accented~
-8. ~accented-3d~
-9. ~accented-moody~
-10. ~borderless-accented~
-11. ~borderless-accented-3d~
-12. ~borderless-accented-moody~
-
-The default produces a two-dimensional effect both for the active and
-inactive mode lines.  The differences between the two are limited to
-distinct shades of grayscale values, with the active being more intense
-than the inactive.
-
-Option ~3d~ will make the active mode line look like a three-dimensional
-rectangle.  Inactive mode lines remain 2D, though they are slightly
-toned down relative to the default.  This aesthetic is virtually the
-same as what you get when you run Emacs without any customizations
-(=emacs -Q= on the command line).
-
-While ~moody~ removes all box effects from the mode lines and applies
-underline and overline properties instead.  It also tones down a bit the
-inactive mode lines.  This is meant to optimize things for use with the
-[[https://github.com/tarsius/moody][moody package]] (hereinafter referred to 
as "Moody"), though it can work
-fine even without it.
-
-The ~borderless~ option uses the same colors as the default (nil value),
-but removes the border effect.  This is done by making the box property
-use the same color as the background, effectively blending the two and
-creating some padding.
-
-The ~borderless-3d~ and ~borderless-moody~ approximate the ~3d~ and ~moody~
-options respectively, while removing the borders.  However, to ensure
-that the inactive mode lines remain visible, they apply a slightly more
-prominent background to them than what their counterparts do (same
-inactive background as with the default).
-
-Similarly, ~accented~, ~accented-3d~, and ~accented-moody~ correspond to the
-default (~nil~), ~3d~, and ~moody~ styles respectively, except that the active
-mode line uses a colored background instead of the standard shade of
-gray.
-
-Same principle for ~borderless-accented~, ~borderless-accented-3d~, and
-~borderless-accented-moody~ which use a colored background for the active
-mode line and have no discernible borders around both the active and
-inactive the mode lines.
++ Overall style:
+  - ~3d~
+  - ~moody~
++ ~accented~
++ ~borderless~
+
+The default (a nil value or an empty list) is a two-dimensional
+rectangle with a border around it.  The active and the inactive
+mode lines use different shades of grayscale values for the
+background, foreground, border.
+
+The ~3d~ property applies a three-dimensional effect to the
+active mode line.  The inactive mode lines remain two-dimensional
+and are toned down a bit, relative to the default style.
+
+The ~moody~ property optimizes the mode line for use with the
+library of the same name (hereinafter referred to as 'Moody').
+In practice, it removes the box effect and replaces it with
+underline and overline properties.  It also tones down the
+inactive mode lines.  Despite its intended purpose, this option
+can also be used without the Moody library (please consult the
+themes' manual on this point for more details).  If both ~3d~ and
+~moody~ properties are set, the latter takes precedence.
+
+The ~borderless~ property removes the color of the borders.  It
+does not actually remove the borders, but only makes their color
+the same as the background, effectively creating some padding.
+
+The ~accented~ property ensures that the active mode line uses a
+colored background instead of the standard shade of gray.
+
+Combinations of any of those properties are expressed as a list,
+like in these examples:
+
+#+begin_src emacs-lisp
+(accented)
+(borderless 3d)
+(moody accented borderless)
+#+end_src
+
+The order in which the properties are set is not significant.
+
+In user configuration files the form may look like this:
+
+#+begin_src emacs-lisp
+(setq modus-themes-prompts '(borderless accented))
+#+end_src
 
 Note that Moody does not expose any faces that the themes could style
 directly.  Instead it re-purposes existing ones to render its tabs and
 ribbons.  As such, there may be cases where the contrast ratio falls
 below the 7:1 target that the themes conform with (WCAG AAA).  To hedge
-against this, we configure a fallback foreground for the ~moody~ option,
+against this, we configure a fallback foreground for the ~moody~ property,
 which will come into effect when the background of the mode line changes
 to something less accessible, such as Moody ribbons (read the doc string
 of ~set-face-attribute~, specifically ~:distant-foreground~).  This fallback
 is activated when Emacs determines that the background and foreground of
 the given construct are too close to each other in terms of color
-distance.  In effect, users would need to experiment with the variable
+distance.  In practice, users will need to experiment with the variable
 ~face-near-same-color-threshold~ to trigger the effect.  We find that a
-value of =45000= will suffice, contrary to the default =30000=.  Though for
-the ~accented-moody~ value mentioned above, that should be raised up to
-=70000=.  Do not set it too high, because it has the adverse effect of
-always overriding the default colors (which have been carefully designed
-to be highly accessible).
+value of =45000= shall suffice, contrary to the default =30000=.  Though for
+the combinations that involve the ~accented~ and ~moody~ properties, as
+mentioned above, that should be raised up to =70000=.  Do not set it too
+high, because it has the adverse effect of always overriding the default
+colors (which have been carefully designed to be highly accessible).
 
 Furthermore, because Moody expects an underline and overline instead of
-a box style, it is advised you include this in your setup:
-
-#+begin_src emacs-lisp
-(setq x-underline-at-descent-line t)
-#+end_src
+a box style, it is advised to set ~x-underline-at-descent-line~ to a
+non-nil value.
 
 ** Option for completion framework aesthetics
 :properties:
@@ -877,43 +976,55 @@ names imply.
 
 Symbol: ~modus-themes-lang-checkers~
 
-Possible values:
+Possible values are expressed as a list of properties (default is ~nil~ or
+an empty list).  The list can include any of the following symbols:
 
-1. ~nil~ (default)
-2. ~subtle-foreground~
-3. ~intense-foreground~
-4. ~straight-underline~
-5. ~subtle-foreground-straight-underline~
-6. ~intense-foreground-straight-underline~
-7. ~colored-background~
-
-Nil (the default) applies a color-coded underline to the affected text,
-while it leaves the original foreground in tact.  If the display spec
-where Emacs runs in has support for it (e.g. Emacs GUI), the underline's
-style is that of a wave, otherwise it is a straight line.
-
-Options ~subtle-foreground~ and ~intense-foreground~ follow the same
-color-coding pattern and wavy underline of the default, while extending
-it with a corresponding foreground value for the affected text.  The
-difference between the two options is one of degree, as their names
-suggest.
-
-Option ~straight-underline~ is like the default but always applies a
-straight line under the affected text.  Same principle for
-~subtle-foreground-straight-underline~ and its counterpart
-~intense-foreground-straight-underline~.
-
-Option ~colored-background~ uses a straight underline, a tinted
-background, and a suitable foreground.  All are color-coded.  This is
-the most intense combination of face properties.
-
-The present variable affects packages and/or face groups such as those
-of =flyspell=, =flymake=, =flycheck=, ~artbollocks-mode~, and ~writegood-mode~.
++ ~straight-underline~
++ ~text-also~
++ ~background~
++ ~intense~
+
+The default (a ~nil~ value or an empty list) applies a color-coded
+underline to the affected text, while it leaves the original foreground
+intact.  If the display spec of Emacs has support for it, the
+underline's style is that of a wave, otherwise it is a straight line.
+
+The property ~straight-underline~ ensures that the underline under the
+affected text is always drawn as a straight line.
+
+The property ~text-also~ applies the same color of the underline to the
+affected text.
+
+The property ~background~ adds a color-coded background.
+
+The property ~intense~ amplifies the applicable colors if ~background~
+and/or ~text-only~ are set.  If ~intense~ is set on its own, then it implies
+~text-only~.
+
+To disable fringe indicators for Flymake or Flycheck, refer to variables
+~flymake-fringe-indicator-position~ and ~flycheck-indication-mode~,
+respectively.
+
+Combinations of any of those properties can be expressed in a
+list, as in those examples:
+
+#+begin_src emacs-lisp
+(background)
+(straight-underline intense)
+(background text-also straight-underline)
+#+end_src
+
+The order in which the properties are set is not significant.
+
+In user configuration files the form may look like this:
+
+#+begin_src emacs-lisp
+(setq modus-themes-lang-checkers '(text-also background))
+#+end_src
 
 NOTE: The placement of the straight underline, though not the wave
-style, is controlled by the built-in ~x-underline-at-descent-line~,
-~x-use-underline-position-properties~, ~underline-minimum-offset~.  Please
-refer to their documentation strings.
+style, is controlled by the built-in variables ~underline-minimum-offset~,
+~x-underline-at-descent-line~, ~x-use-underline-position-properties~.
 
 ** Option for line highlighting (hl-line-mode)
 :properties:
@@ -925,43 +1036,47 @@ refer to their documentation strings.
 
 Symbol: ~modus-themes-hl-line~
 
-Possible values:
+Possible values are expressed as a list of properties (default is ~nil~ or
+an empty list).  The list can include any of the following symbols:
 
-1. ~nil~ (default)
-2. ~intense-background~
-3. ~accented-background~
-4. ~underline-neutral~
-5. ~underline-accented~
-6. ~underline-only-neutral~
-7. ~underline-only-accented~
++ ~accented~
++ ~intense~
++ ~underline~
 
-The default is to use a subtle gray background for the current line when
-~hl-line-mode~ is enabled.
+The default (a ~nil~ value or an empty list) is a subtle gray background
+color.
 
-The ~intense-background~ applies a more prominent gray to the background
-of the current line.
+The property ~accented~ changes the background to a colored variant.
 
-With ~accented-background~ the background gets a colored hint and is more
-prominent than the default.
+An ~underline~ property draws a line below the highlighted area.  Its
+color is similar to the background, so gray by default or an accent
+color when ~accented~ is also set.
 
-The ~underline-neutral~ combines the default subtle neutral background
-with a gray underline.
+An ~intense~ property amplifies the colors in use, which may be both the
+background and the underline.
 
-Similarly, the ~underline-accented~ renders the background of the current
-line in a subtle colored background, while it also draws an accented
-underline.
+Combinations of any of those properties are expressed as a list, like in
+these examples:
 
-Option ~underline-only-neutral~ produces a neutral underline, but does not
-use any background.
+#+begin_src emacs-lisp
+(intense)
+(underline intense)
+(accented intense underline)
+#+end_src
 
-While ~underline-only-accented~ also uses just an underline, only this one
-is colored.
+The order in which the properties are set is not significant.
 
-Consider setting the variable ~x-underline-at-descent-line~ to a non-nil
-value for better results with underlines.
+In user configuration files the form may look like this:
+
+#+begin_src emacs-lisp
+(setq modus-themes-hl-line '(underline accented))
+#+end_src
+
+Set ~x-underline-at-descent-line~ to a non-nil value for better results
+with underlines.
 
 This style affects several packages that enable ~hl-line-mode~, such as
-=elfeed= and =mu4e=.
+=elfeed=, =notmuch=, and =mu4e=.
 
 ** Option for line numbers (display-line-numbers-mode)
 :properties:
@@ -1002,26 +1117,42 @@ updated to accommodate this aesthetic.
 
 Symbol: ~modus-themes-paren-match~
 
-Possible values:
+Possible values are expressed as a list of properties (default is ~nil~ or
+an empty list).  The list can include any of the following symbols:
 
-1. ~nil~ (default)
-2. ~subtle-bold~
-3. ~intense~
-4. ~intense-bold~
++ ~bold~
++ ~intense~
++ ~underline~
 
-Nil means to use a subtle tinted background color for the matching
+The default (a ~nil~ value or an empty list) is a subtle background color.
+
+The ~bold~ property adds a bold weight to the characters of the matching
 delimiters.
 
-Option ~intense~ applies a saturated background color.
+The ~intense~ property applies a more prominent background color to the
+delimiters.
 
-Option ~subtle-bold~ is the same as the default, but also makes use of
-bold typographic weight (inherits the ~bold~ face).
+The ~underline~ property draws a straight line under the affected text.
 
-Option ~intense-bold~ is the same as ~intense~, while it also uses a bold
-weight.
+Combinations of any of those properties are expressed as a list, like in
+these examples:
+
+#+begin_src emacs-lisp
+(bold)
+(underline intense)
+(bold intense underline)
+#+end_src
+
+The order in which the properties are set is not significant.
+
+In user configuration files the form may look like this:
+
+#+begin_src emacs-lisp
+(setq modus-themes-paren-match '(bold intense))
+#+end_src
 
-This customization variable affects tools such as the built-in
-~show-paren-mode~ and the =smartparens= package.
+This customization variable affects the built-in ~show-paren-mode~ and the
+=smartparens= package.
 
 ** Option for active region
 :properties:
@@ -1033,33 +1164,41 @@ This customization variable affects tools such as the 
built-in
 
 Symbol: ~modus-themes-region~
 
-Possible values:
+Possible values are expressed as a list of properties (default is ~nil~ or
+an empty list).  The list can include any of the following symbols:
 
-1. ~nil~ (default)
-2. ~no-extend~
-3. ~bg-only~
-4. ~bg-only-no-extend~
-5. ~accent~
-6. ~accent-no-extend~
++ ~no-extend~
++ ~bg-only~
++ ~accented~
 
-Nil means to only use a prominent gray background with a neutral
-foreground.  The foreground overrides all syntax highlighting.  The
-region extends to the edge of the window.
+The default (a ~nil~ value or an empty list) is a prominent gray
+background that overrides all foreground colors in the area it
+encompasses.  Its reach extends to the edge of the window.
 
-Option ~no-extend~ preserves the default aesthetic but prevents the region
-from extending to the edge of the window.
+The ~no-extend~ property limits the region to the end of the line, so that
+it does not reach the edge of the window.
 
-Option ~bg-only~ applies a faint tinted background that is distinct from
-all others used in the theme, while it does not override any existing
-colors.  It extends to the edge of the window.
+The ~bg-only~ property makes the region's background color more subtle to
+allow the underlying text to retain its foreground colors.
 
-Option ~bg-only-no-extend~ is a combination of the ~bg-only~ and ~no-extend~
-options.
+The ~accented~ property applies a more colorful background to the region.
+
+Combinations of any of those properties are expressed as a list, like in
+these examples:
 
-Option ~accent~ is like the default, though it uses a more colorful
-background, while ~accent-no-extend~ is the same except it draws the
-region only up to the end of each line instead of extending to the edge
-of the window.
+#+begin_src emacs-lisp
+(no-extend)
+(bg-only accented)
+(accented bg-only no-extend)
+#+end_src
+
+The order in which the properties are set is not significant.
+
+In user configuration files the form may look like this:
+
+#+begin_src emacs-lisp
+(setq modus-themes-region '(bg-only no-extend))
+#+end_src
 
 ** Option for diff buffer looks
 :properties:
@@ -1148,169 +1287,238 @@ Older versions of the themes provided options 
~grayscale~ (or ~greyscale~)
 and ~rainbow~.  Those will continue to work as they are aliases for
 ~gray-background~ and ~tinted-background~, respectively.
 
-** Option for org-habit graph styles
+** Option for Org agenda constructs
 :properties:
-:alt_title: Org agenda habits
-:description: Choose among standard, simplified, or traffic light styles
-:custom_id: h:b7e328c0-3034-4db7-9cdf-d5ba12081ca2
+:alt_title: Org agenda
+:description: Control each element in the presentation of the agenda
+:custom_id: h:68f481bc-5904-4725-a3e6-d7ecfa7c3dbc
 :end:
-#+vindex: modus-themes-org-habit
+#+vindex: modus-themes-org-agenda
 
-Symbol: ~modus-themes-org-habit~
+Symbol: ~modus-themes-org-agenda~
 
-Possible values:
+This is an alist that accepts a =(key . value)= combination.  Some values
+are specified as a list.  Here is a sample, followed by a description of
+all possible combinations:
 
-1. ~nil~ (default)
-2. ~simplified~
-3. ~traffic-light~
-
-The default is meant to conform with the original aesthetic of
-=org-habit=.  It employs all four color codes that correspond to the
-org-habit states---clear, ready, alert, and overdue---while
-distinguishing between their present and future variants.  This results
-in a total of eight colors in use: red, yellow, green, blue, in tinted
-and shaded versions.  They cover the full set of information provided by
-the =org-habit= consistency graph.
-
-Option ~simplified~ is like the default except that it removes the
-dichotomy between current and future variants by applying uniform
-color-coded values.  It applies a total of four colors: red, yellow,
-green, blue.  They produce a simplified consistency graph that is more
-legible (or less "busy") than the default.  The intent is to shift focus
-towards the distinction between the four states of a habit task, rather
-than each state's present/future outlook.
-
-Option ~traffic-light~ further reduces the available colors to red,
-yellow, and green.  As in ~simplified~, present and future variants appear
-uniformly, but differently from it, the 'clear' state is rendered in a
-green hue, instead of the original blue.  This is meant to capture the
-use-case where a habit task being "too early" is less important than it
-being "too late".  The difference between ready and clear states is
-attenuated by painting both of them using shades of green.  This option
-thus highlights the alert and overdue states.
+#+begin_src emacs-lisp
+(setq modus-themes-org-agenda
+      '((header-block . (variable-pitch scale-title))
+        (header-date . (grayscale workaholic bold-today))
+        (scheduled . uniform)
+        (habit . traffic-light)))
+#+end_src
 
-** Option for the headings' overall style
-:properties:
-:alt_title: Heading styles
-:description: Choose among several styles, also per heading level
-:custom_id: h:271eff19-97aa-4090-9415-a6463c2f9ae1
-:end:
-#+vindex: modus-themes-headings
+A ~header-block~ key applies to elements that concern the headings which
+demarcate blocks in the structure of the agenda.  By default (a ~nil~
+value) those are rendered in a bold typographic weight, plus a height
+that is slightly taller than the default font size.  Acceptable values
+come in the form of a list that can include either or both of those
+properties:
 
-This is defined as an alist and, therefore, uses a different approach
-than other customization options documented in this manual.
+- ~variable-pitch~ to use a proportionately spaced typeface;
+- ~scale-title~ to increase the size to the number assigned to
+  ~modus-themes-scale-title~ 
([[#h:6868baa1-beba-45ed-baa5-5fd68322ccb3][Control the scale of headings]]) or 
~no-scale~
+  to make the font use the same height as the rest of the buffer.
 
-Symbol: ~modus-themes-headings~
+In case both ~scale-title~ and ~no-scale~ are in the list, the latter takes
+precedence.
 
-Possible values, which can be specified for each heading level N
-(examples further below):
+Example usage:
 
-+ ~nil~ (~t~ is also available for backward compatibility)
-+ ~no-bold~
-+ ~line~
-+ ~line-no-bold~
-+ ~rainbow~
-+ ~rainbow-line~
-+ ~rainbow-line-no-bold~
-+ ~highlight~
-+ ~highlight-no-bold~
-+ ~rainbow-highlight~
-+ ~rainbow-highlight-no-bold~
-+ ~section~
-+ ~section-no-bold~
-+ ~rainbow-section~
-+ ~rainbow-section-no-bold~
-+ ~no-color~
-+ ~no-color-no-bold~
-
-To control faces per level from 1-8, use something like this:
+#+begin_src emacs-lisp
+(header-block . nil)
+(header-block . (scale-title))
+(header-block . (no-scale))
+(header-block . (variable-pitch scale-title))
+#+end_src
+
+A ~header-date~ key covers date headings.  Dates use only a foreground
+color by default (a ~nil~ value), with weekdays and weekends having a
+slight difference in hueness.  The current date has an added gray
+background.  This key accepts a list of values that can include any of
+the following properties:
+
+- ~grayscale~ to make weekdays use the main foreground color and
+  weekends a more subtle gray;
+- ~workaholic~ to make weekdays and weekends look the same in
+  terms of color;
+- ~bold-today~ to apply a bold typographic weight to the current
+  date;
+- ~bold-all~ to render all date headings in a bold weight.
+
+For example:
 
 #+begin_src emacs-lisp
-(setq modus-themes-headings
-      '((1 . section)
-        (2 . section-no-bold)
-        (3 . rainbow-line)
-        (t . rainbow-line-no-bold)))
+(header-date . nil)
+(header-date . (workaholic))
+(header-date . (grayscale bold-all))
+(header-date . (grayscale workaholic))
+(header-date . (grayscale workaholic bold-today))
 #+end_src
 
-The above uses the ~section~ value for heading levels 1, ~section-no-bold~
-for headings 2, ~rainbow-line~ for 3.  All other levels fall back to
-~rainbow-line-no-bold~.
+A ~scheduled~ key applies to tasks with a scheduled date.  By default (a
+~nil~ value), those use varying shades of yellow to denote (i) a past or
+current date and (ii) a future date.  Valid values are symbols:
+
+- nil (default);
+- ~uniform~ to make all scheduled dates the same color;
+- ~rainbow~ to use contrasting colors for past, present, future
+  scheduled dates.
 
-To set a uniform value for all heading levels, use this pattern:
+For example:
 
 #+begin_src emacs-lisp
-;; A given style for every heading
-(setq modus-themes-headings
-      '((t . section)))
+(scheduled . nil)
+(scheduled . uniform)
+(scheduled . rainbow)
+#+end_src
 
-;; Default aesthetic for every heading
-(setq modus-themes-headings nil)
+A ~habit~ key applies to the ~org-habit~ graph.  All possible value are
+passed as a symbol.  Those are:
+
+- The default (~nil~) is meant to conform with the original aesthetic of
+  ~org-habit~.  It employs all four color codes that correspond to the
+  org-habit states---clear, ready, alert, and overdue---while
+  distinguishing between their present and future variants.  This
+  results in a total of eight colors in use: red, yellow, green, blue,
+  in tinted and shaded versions.  They cover the full set of information
+  provided by the ~org-habit~ consistency graph.
+- ~simplified~ is like the default except that it removes the dichotomy
+  between current and future variants by applying uniform color-coded
+  values.  It applies a total of four colors: red, yellow, green, blue.
+  They produce a simplified consistency graph that is more legible (or
+  less busy) than the default.  The intent is to shift focus towards the
+  distinction between the four states of a habit task, rather than each
+  state's present/future outlook.
+- ~traffic-light~ further reduces the available colors to red, yellow, and
+  green.  As in ~simplified~, present and future variants appear
+  uniformly, but differently from it, the ~clear~ state is rendered in a
+  green hue, instead of the original blue.  This is meant to capture the
+  use-case where a habit task being too early is less important than it
+  being too late.  The difference between ready and clear states is
+  attenuated by painting both of them using shades of green.  This
+  option thus highlights the alert and overdue states.
+- ~traffic-light-deuteranopia~ is like the ~traffic-light~ except its three
+  colors are red, yellow, and blue to be suitable for users with
+  red-green color deficiency (deuteranopia).
+
+For example:
+
+#+begin_src emacs-lisp
+(habit . nil)
+(habit . simplified)
+(habit . traffic-light)
 #+end_src
 
-The default style for headings uses a fairly desaturated foreground
-color in combination with bold typographic weight.  To specify this
-style for a given level N, assuming you wish to have another fallback
-option, just assign the value ~nil~ like this:
+Putting it all together, the alist can look like this:
+
+#+begin_src emacs-lisp
+'((header-block . (scale-title variable-pitch))
+  (header-date . (grayscale workaholic bold-today))
+  (scheduled . uniform)
+  (habit . traffic-light))
+
+;; Or else:
+(setq modus-themes-org-agenda
+      '((header-block . (scale-title variable-pitch))
+        (header-date . (grayscale workaholic bold-today))
+        (scheduled . uniform)
+        (habit . traffic-light)))
+#+end_src
+
+** Option for the headings' overall style
+:properties:
+:alt_title: Heading styles
+:description: Choose among several styles, also per heading level
+:custom_id: h:271eff19-97aa-4090-9415-a6463c2f9ae1
+:end:
+#+vindex: modus-themes-headings
+
+Symbol: ~modus-themes-headings~
+
+This is an alist that accepts a =(key . list-of-values)= combination.  The
+key is either a number, representing the heading's level or ~t~, which
+pertains to the fallback style.  The list of values covers symbols that
+refer to properties, as described below.  Here is a sample, followed by
+a presentation of all available properties:
 
 #+begin_src emacs-lisp
 (setq modus-themes-headings
-      '((1 . nil)
-        (2 . line)
-        (3) ; same as nil
-        (t . rainbow-line-no-bold)))
+      '((1 . (background overline))
+        (2 . (overline rainbow))
+        (t . (monochrome))))
 #+end_src
 
-A description of all other possible styles beyond the default:
+Properties:
 
-+ ~no-bold~ retains the default text color while removing the bold
-  typographic weight.
++ ~rainbow~
++ ~overline~
++ ~background~
++ ~no-bold~
++ ~monochrome~
 
-+ ~line~ is the same as the default plus an overline across the
-  heading's length.
+By default (a ~nil~ value for this variable), all headings have a bold
+typographic weight and use a desaturated text color.
 
-+ ~line-no-bold~ is the same as ~line~ without bold weight.
+A ~rainbow~ property makes the text color more saturated.
 
-+ ~rainbow~ uses a more colorful foreground in combination with bold
-  typographic weight.
+An ~overline~ property draws a line above the area of the heading.
 
-+ ~rainbow-line~ is the same as ~rainbow~ plus an overline.
+A ~background~ property adds a subtle tinted color to the background of
+the heading.
 
-+ ~rainbow-line-no-bold~ is the same as ~rainbow-line~ without the bold
-  weight.
+A ~no-bold~ property removes the bold weight from the heading's text.
 
-+ ~highlight~ retains the default style of a fairly desaturated
-  foreground combined with a bold weight and adds to it a subtle
-  accented background.
+A ~monochrome~ property makes all headings the same base color, which is
+that of the default for the active theme (black/white).  When ~background~
+is also set, ~monochrome~ changes its color to gray.  If both ~monochrome~
+and ~rainbow~ are set, the former takes precedence.
 
-+ ~highlight-no-bold~ is the same as ~highlight~ without a bold weight.
+Combinations of any of those properties are expressed as a list, like in
+these examples:
 
-+ ~rainbow-highlight~ is the same as ~highlight~ but with a more
-  colorful foreground.
+#+begin_src emacs-lisp
+(no-bold)
+(rainbow background)
+(overline monochrome no-bold)
+#+end_src
 
-+ ~rainbow-highlight-no-bold~ is the same as ~rainbow-highlight~ without
-  a bold weight.
+The order in which the properties are set is not significant.
 
-+ ~section~ retains the default looks and adds to them both an overline
-  and a slightly accented background.  It is, in effect, a combination
-  of the ~line~ and ~highlight~ values.
+In user configuration files the form may look like this:
 
-+ ~section-no-bold~ is the same as ~section~ without a bold weight.
+#+begin_src emacs-lisp
+(setq modus-themes-headings
+      '((1 . (background overline rainbow))
+        (2 . (background overline))
+        (t . (overline no-bold))))
+#+end_src
 
-+ ~rainbow-section~ is the same as ~section~ but with a more colorful
-  foreground.
+When defining the styles per heading level, it is possible to pass a
+non-nil value (~t~) instead of a list of properties.  This will retain the
+original aesthetic for that level.  For example:
 
-+ ~rainbow-section-no-bold~ is the same as ~rainbow-section~ without a
-  bold weight.
+#+begin_src emacs-lisp
+(setq modus-themes-headings
+      '((1 . t)           ; keep the default style
+        (2 . (background overline))
+        (t . (rainbow)))) ; style for all other headings
 
-+ ~no-color~ does not apply any color to the heading, meaning that it
-  uses the foreground of the ~default~ face.  It still renders the text
-  with a bold typographic weight.
+(setq modus-themes-headings
+      '((1 . (background overline))
+        (2 . (rainbow no-bold))
+        (t . t))) ; default style for all other levels
+#+end_src
 
-+ ~no-color-no-bold~ is like ~no-color~ but without the bold weight.
+For Org users, the extent of the heading depends on the variable
+~org-fontify-whole-heading-line~.  This affects the ~overline~ and
+~background~ properties.  Depending on the version of Org, there may be
+others, such as ~org-fontify-done-headline~.
 
-Remember to also inspect relevant variables that Org provides, such as:
-~org-fontify-whole-heading-line~ and ~org-fontify-done-headline~.
+[[#h:075eb022-37a6-41a4-a040-cc189f6bfa1f][Option for scaled headings]].
+
+[[#h:97caca76-fa13-456c-aef1-a2aa165ea274][Option for variable-pitch font in 
headings]].
 
 ** Option for scaled headings
 :properties:
@@ -1366,7 +1574,7 @@ resource for finding a consistent scale:
       modus-themes-scale-2 1.1
       modus-themes-scale-3 1.15
       modus-themes-scale-4 1.2
-      modus-themes-scale-5 1.3)
+      modus-themes-scale-title 1.3)
 #+end_src
 
 As for the application of that scale, the variables that range from
@@ -1376,19 +1584,20 @@ smallest, while the latter is the largest.  "Regular 
headings" are those
 that have a standard syntax for their scale, such as Org mode's eight
 levels of asterisks or Markdown's six columns.
 
-Whereas ~modus-themes-scale-5~ is applied to special headings that do not
-conform with the aforementioned syntax, yet which are expected to be
-larger than the largest value on that implied scale.  Put concretely,
-Org's =#+title= meta datum is not part of the eight levels of headings in
-an Org file, yet is supposed to signify the primary header.  Similarly,
-the Org Agenda's structure headings are not part of a recognisable scale
-and so they also get ~modus-themes-scale-5~.
+Whereas ~modus-themes-scale-title~ is applied to special headings that do
+not conform with the aforementioned syntax, yet which are expected to be
+larger than the largest value on that implied scale or at least have
+some unique purpose in the buffer.  Put concretely, Org's =#+title= meta
+datum is not part of the eight levels of headings in an Org file, yet is
+supposed to signify the primary header.  Similarly, the Org Agenda's
+structure headings are not part of a recognisable scale and so they also
+get ~modus-themes-scale-title~ 
([[#h:68f481bc-5904-4725-a3e6-d7ecfa7c3dbc][Option for Org agenda constructs]]).
 
 Users who wish to maintain scaled headings for the normal syntax while
 preventing special headings from standing out, can assign a value of =1.0=
-to ~modus-themes-scale-5~ to make it the same as body text (or whatever
-value would render it indistinguishable from the desired point of
-reference).
+to ~modus-themes-scale-title~ to make it the same as body text (or
+whatever value would render it indistinguishable from the desired point
+of reference).
 
 Note that in earlier versions of Org, scaling would only increase the
 size of the heading, but not of keywords that were added to it, like
@@ -1727,7 +1936,7 @@ activates ~hl-line-mode~, but we wish to keep it distinct 
from other
 buffers.  This is where ~face-remap-add-relative~ can be applied and may
 be combined with ~modus-themes-with-colors~ to deliver consistent results.
 
-[[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the 
themes' palette (DIY)]].
+[[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the 
themes' palette]].
 
 In this example we will write a simple interactive function that adjusts
 the background color of the ~region~ face.  This is the sample code:
@@ -2216,6 +2425,11 @@ reading the doc string of ~set-face-attribute~):
 (set-face-attribute 'fixed-pitch nil :family "DejaVu Sans Mono" :height 1.0)
 #+end_src
 
+The next section shows how to make those work in a more elaborate setup
+that is robust to changes between the Modus themes.
+
+[[#h:2793a224-2109-4f61-a106-721c57c01375][Configure bold and italic faces]].
+
 Note the differences in the ~:height~ property.  The ~default~ face must
 specify an absolute value, which is the point size × 10.  So if you want
 to use a font at point size =11=, you set the height to =110=.[fn:: ~:height~
@@ -2230,6 +2444,98 @@ base font size (i.e. the ~default~ face's absolute 
height).
 
 [[#h:e6c5451f-6763-4be7-8fdb-b4706a422a4c][Note for EWW and Elfeed fonts (SHR 
fonts)]].
 
+** Configure bold and italic faces (DIY)
+:properties:
+:custom_id: h:2793a224-2109-4f61-a106-721c57c01375
+:end:
+#+cindex: Bold and italic fonts
+
+The Modus themes do not hardcode a ~:weight~ or ~:slant~ attribute in the
+thousands of faces they cover.  Instead, they configure the generic
+faces called ~bold~ and ~italic~ to use the appropriate styles and then
+instruct all relevant faces that require emphasis to inherit from them.
+
+This practically means that users can change the particularities of what
+it means for a construct to be bold/italic, by tweaking the ~bold~ and
+~italic~ faces.  Cases where that can be useful include:
+
++ The default typeface does not have a variant with slanted glyphs
+  (e.g. Fira Mono/Code as of this writing on 2021-07-07), so the user
+  wants to add another family for the italics, such as Hack.
+
++ The typeface of choice provides a multitude of weights and the user
+  prefers the light one by default.  To prevent the bold weight from
+  being too heavy compared to the light one, they opt to make ~bold~ use a
+  semibold weight.
+
++ The typeface distinguishes between oblique and italic forms by
+  providing different font variants (the former are just slanted
+  versions of the upright forms, while the latter have distinguishing
+  features as well).  In this case, the user wants to specify the font
+  that applies to the ~italic~ face.
+
+To achieve those effects, one must first be sure that the fonts they use
+have support for those features.  It then is a matter of following the
+instructions for all face tweaks.
+
+[[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and 
others]].
+
+In this example, we set the default font family to Fira Code, while we
+choose to render italics in the Hack typeface (obviously you need to
+pick fonts that work well together):
+
+#+begin_src emacs-lisp
+(set-face-attribute 'default nil :family "Fira Code" :height 110)
+(set-face-attribute 'italic nil :family "Hack")
+#+end_src
+
+And here we play with different weights, using Source Code Pro:
+
+#+begin_src emacs-lisp
+(set-face-attribute 'default nil :family "Source Code Pro" :height 110 :weight 
'light)
+(set-face-attribute 'bold nil :weight 'semibold)
+#+end_src
+
+To reset the font family, one can use this:
+
+#+begin_src emacs-lisp
+(set-face-attribute 'italic nil :family 'unspecified)
+#+end_src
+
+To ensure that the effects persist after switching between the Modus
+themes (such as with {{{kbd(M-x modus-themes-toggle)}}}), the user needs to
+write their configurations to a function and hook it up to the
+~modus-themes-after-load-theme-hook~.  This is necessary because the
+themes set the default styles of faces (otherwise changing themes would
+not be possible).
+
+[[#h:86f6906b-f090-46cc-9816-1fe8aeb38776][A theme-agnostic hook for theme 
loading]].
+
+This is a minimal setup to preserve font configurations across theme
+load phases.  For a more permanent setup, it is better to employ the
+~custom-set-faces~ function: ~set-face-attribute~ works just fine, though it
+is more convenient for quick previews or for smaller scale operations
+(~custom-set-faces~ follows the format used in the source code of the
+themes).
+
+#+begin_src emacs-lisp
+;; our generic function
+(defun my-modes-themes-bold-italic-faces ()
+  (set-face-attribute 'default nil :family "Source Code Pro" :height 110)
+  (set-face-attribute 'bold nil :weight 'semibold))
+
+;; or use this if you configure a lot of face and attributes and
+;; especially if you plan to use `modus-themes-with-colors', as shown
+;; elsewhere in the manual
+(defun my-modes-themes-bold-italic-faces ()
+  (custom-set-faces
+   '(default ((t :family "Source Code Pro" :height 110)))
+   '(bold ((t :weight semibold)))))
+
+;; and here is the hook
+(add-hook 'modus-themes-after-load-theme-hook 
#'my-modes-themes-bold-italic-faces)
+#+end_src
+
 ** Custom Org user faces (DIY)
 :properties:
 :custom_id: h:89f0678d-c5c3-4a57-a526-668b2bb2d7ad
@@ -2263,7 +2569,8 @@ have something like this:
 
 You could then use a variant of the following to inherit from a face
 that uses the styles you want and also to preserve the properties
-applied by the ~org-todo~ face:
+applied by the ~org-todo~ face (in case there is a difference between the
+two):
 
 #+begin_src emacs-lisp
 (setq org-todo-keyword-faces
@@ -2286,9 +2593,14 @@ If you want back the defaults, try specifying just the 
~org-todo~ face:
 #+end_src
 
 When you inherit from multiple faces, you need to quote the list as
-shown further above.  The order is important: the last item is applied
-over the previous ones.  If you do not want to blend multiple faces, you
-do not need a quoted list.  A pattern of =keyword . face= will suffice.
+shown further above.  The order is significant: the first entry is
+applied on top of the second, overriding any properties that are
+explicitly set for both of them: any property that is not specified is
+not overridden, so, for example, if ~org-todo~ has a background and a
+foreground, while ~font-lock-type-face~ only has a foreground, the merged
+face will include the background of the former and the foreground of the
+latter.  If you do not want to blend multiple faces, you do not need a
+quoted list.  A pattern of =keyword . face= will suffice.
 
 Both approaches can be used simultaneously, as illustrated in this
 configuration of the priority cookies:
@@ -2470,7 +2782,7 @@ the case for the time being.  We must thus employ the 
face remapping
 technique that is documented elsewhere in this document to change the
 buffer-local value of the ~default~ face.
 
-[[#h:7a93cb6f-4eca-4d56-a85c-9dcd813d6b0f][Remap face with local value (DIY)]].
+[[#h:7a93cb6f-4eca-4d56-a85c-9dcd813d6b0f][Remap face with local value]].
 
 To remap the buffer's backdrop, we start with a function like this one:
 
@@ -2628,6 +2940,7 @@ have lots of extensions, so the "full support" may not be 
100% true…
 + counsel-org-capture-string
 + cov
 + cperl-mode
++ css-mode
 + csv-mode
 + ctrlf
 + custom (what you get with {{{kbd(M-x customize)}}})
@@ -2708,6 +3021,7 @@ have lots of extensions, so the "full support" may not be 
100% true…
 + git-timemachine
 + git-walktree
 + gnus
++ gotest
 + golden-ratio-scroll-screen
 + helm*
 + helm-ls-git
@@ -2751,6 +3065,7 @@ have lots of extensions, so the "full support" may not be 
100% true…
 + jupyter
 + kaocha-runner
 + keycast
++ ledger-mode
 + line numbers (~display-line-numbers-mode~ and global variant)
 + lsp-mode
 + lsp-ui
@@ -2814,6 +3129,7 @@ have lots of extensions, so the "full support" may not be 
100% true…
 + prism ([[#h:a94272e0-99da-4149-9e80-11a7e67a2cf2][Note for prism.el]])
 + proced
 + prodigy
++ pulse
 + quick-peek
 + racket-mode
 + rainbow-blocks
@@ -2929,6 +3245,93 @@ supported by the themes.
 This section covers information that may be of interest to users of
 individual packages.
 
+** Note on avy hints
+:properties:
+:custom_id: h:2fdce705-6de7-44e6-ab7f-18f59af99e01
+:end:
+
+Hints can appear everywhere, in wildly varying contexts, hence, their
+appearance, by necessity, is a compromise.  However, there are various
+options for making them stand out. First is dimming the surroundings:
+
+#+begin_src emacs-lisp
+(setq avy-background t)
+#+end_src
+
+Dimming works well when you find it difficult to spot hints, any hint.
+Second is limiting the number of faces used by hints:
+
+#+begin_src emacs-lisp
+(setq avy-lead-faces
+      '(avy-lead-face
+        avy-lead-face-1
+        avy-lead-face-1
+        avy-lead-face-1
+        avy-lead-face-1))
+#+end_src
+
+Limiting the number of faces works well with longer hints when you find
+it difficult to identify individual hints, especially with hints
+touching each other.  The first character of the hint will have an
+intense color, the remaining ones the same neutral color.
+
+Third is preferring commands that produce fewer candidates.  Fewer hints
+is less noise: ~avy-goto-char-timer~ is an excellent alternative to
+~avy-goto-char~.
+
+** Note on calendar.el weekday and weekend colors
+:properties:
+:custom_id: h:b2db46fb-32f4-44fd-8e11-d2b261cf51ae
+:end:
+
+By default, the {{{kbd(M-x calendar)}}} interface differentiates weekdays from
+weekends by applying a gray color to the former and a faint red to the
+latter.  The idea for this approach is that the weekend should serve as
+a subtle warning that no work is supposed to be done on that day, per
+the design of traditional calendars.
+
+Users who prefer all days to look the same can configure the variable
+~calendar-weekend-days~ to either use gray of weekdays or the faint red of
+weekends uniformly.
+
+#+begin_src emacs-lisp
+;; All are treated like weekdays (gray color)
+(setq calendar-weekend-days nil)
+
+;; All are treated like weekends (red-faint color)
+(setq calendar-weekend-days (number-sequence 0 6))
+
+;; The default marks the Saturday and Sunday as the weekend
+(setq calendar-weekend-days '(0 6))
+#+end_src
+
+For changes to take effect, the Calendar buffer needs to be generated
+anew.
+
+** Note on underlines in compilation buffers
+:properties:
+:custom_id: h:420f5a33-c7a9-4112-9b04-eaf2cbad96bd
+:end:
+
+Various buffers that produce compilation results or run tests on code
+apply an underline to the file names they reference or to relevant
+messages.  Users may consider this unnecessary or excessive.
+
+To outright disable the effect, use this:
+
+#+begin_src emacs-lisp
+(setq compilation-message-face nil)
+#+end_src
+
+If some element of differentiation is still desired, a good option is to
+render the affected text using the ~italic~ face:
+
+#+begin_src emacs-lisp
+(setq compilation-message-face 'italic)
+#+end_src
+
+[[#h:2793a224-2109-4f61-a106-721c57c01375][Configure bold and italic faces]].
+
 ** Note on inline Latex in Org buffers
 :properties:
 :custom_id: h:dd8478da-f56a-45cd-b199-b836c85c3c5a
@@ -3566,9 +3969,9 @@ In general, an additional source of light other than that 
of the monitor
 can help reduce eye strain: the eyes are more relaxed when they do not
 have to focus on one point to gather light.
 
-The monitor's display settings must be accounted for.  Gamma ray values,
-in particular, need to be calibrated to neither amplify nor distort the
-perception of black.  Same principle for sharpness, brightness, and
+The monitor's display settings must be accounted for. Gamma values, in
+particular, need to be calibrated to neither amplify nor distort the
+perception of black. Same principle for sharpness, brightness, and
 contrast as determined by the hardware, which all have an effect on how
 text is read on the screen.
 
@@ -3716,8 +4119,9 @@ The Modus themes are a collective effort.  Every bit of 
work matters.
 + Contributions to code or documentation :: Anders Johansson, Basil
   L.{{{space()}}} Contovounesios, Carlo Zancanaro, Eli Zaretskii, Fritz Grabo,
   Kostadin Ninev, Madhavan Krishnan, Markus Beppler, Matthew Stevenson,
-  Mauro Aranda, Nicolas De Jaeghere, Rudolf Adamkovič, Shreyas Ragavan,
-  Stefan Kangas, Vincent Murphy, Xinglu Chen.
+  Mauro Aranda, Nicolas De Jaeghere, Philip Kaludercic, Rudolf
+  Adamkovič, Shreyas Ragavan, Stefan Kangas, Vincent Murphy, Xinglu
+  Chen.
 
 + Ideas and user feedback :: Aaron Jensen, Adam Spiers, Adrian Manea,
   Alex Griffin, Alex Peitsinis, Alexey Shmalko, Alok Singh, Anders
@@ -3725,19 +4129,20 @@ The Modus themes are a collective effort.  Every bit of 
work matters.
   Contovounesios, Burgess Chang, Christian Tietze, Christopher Dimech,
   Damien Cassou, Daniel Mendler, Dario Gjorgjevski, David Edmondson,
   Davor Rotim, Divan Santana, Emanuele Michele Alberto Monterosso,
-  Farasha Euker, Gerry Agbobada, Gianluca Recchia, Gustavo Barros,
-  Hörmetjan Yiltiz, Ilja Kocken, Iris Garcia, Jeremy Friesen, John
-  Haman, Joshua O'Connor, Kevin Fleming, Kévin Le Gouguec, Kostadin
-  Ninev, Len Trigg, Manuel Uberti, Mark Burton, Markus Beppler, Mauro
-  Aranda, Michael Goldenberg, Morgan Smith, Murilo Pereira, Nicky van
-  Foreest, Nicolas De Jaeghere, Paul Poloskov, Pete Kazmier, Peter Wu,
-  Philip K., Pierre Téchoueyres, Roman Rudakov, Ryan Phillips, Rudolf
-  Adamkovič, Sam Kleinman, Shreyas Ragavan, Simon Pugnet, Tassilo Horn,
-  Thibaut Verron, Trey Merkley, Togan Muftuoglu, Toon Claes, Uri Sharf,
-  Utkarsh Singh, Vincent Foley.  As well as users: Ben, CsBigDataHub1,
-  Emacs Contrib, Eugene, Fourchaux, Fredrik, Moesasji, Nick, TheBlob42,
-  Trey, bepolymathe, doolio, fleimgruber, iSeeU, jixiuf, okamsn,
-  pRot0ta1p.
+  Farasha Euker, Gautier Ponsinet, Gerry Agbobada, Gianluca Recchia,
+  Gustavo Barros, Hörmetjan Yiltiz, Ilja Kocken, Iris Garcia, Jeremy
+  Friesen, Jerry Zhang, John Haman, Joshua O'Connor, Kevin Fleming,
+  Kévin Le Gouguec, Kostadin Ninev, Len Trigg, Manuel Uberti, Mark
+  Burton, Markus Beppler, Mauro Aranda, Michael Goldenberg, Morgan
+  Smith, Murilo Pereira, Nicky van Foreest, Nicolas De Jaeghere, Paul
+  Poloskov, Pengji Zhang, Pete Kazmier, Peter Wu, Philip Kaludercic,
+  Pierre Téchoueyres, Roman Rudakov, Ryan Phillips, Rudolf Adamkovič,
+  Sam Kleinman, Shreyas Ragavan, Simon Pugnet, Tassilo Horn, Thibaut
+  Verron, Thomas Heartman, Trey Merkley, Togan Muftuoglu, Toon Claes,
+  Uri Sharf, Utkarsh Singh, Vincent Foley.  As well as users: Ben,
+  CsBigDataHub1, Emacs Contrib, Eugene, Fourchaux, Fredrik, Moesasji,
+  Nick, TheBlob42, Trey, bepolymathe, doolio, fleimgruber, iSeeU,
+  jixiuf, okamsn, pRot0ta1p.
 
 + Packaging :: Basil L.{{{space()}}} Contovounesios, Eli Zaretskii, Glenn
   Morris, Mauro Aranda, Richard Stallman, Stefan Kangas (core Emacs),
@@ -3747,9 +4152,9 @@ The Modus themes are a collective effort.  Every bit of 
work matters.
 + Inspiration for certain features :: Bozhidar Batsov (zenburn-theme),
   Fabrice Niessen (leuven-theme).
 
-Special thanks, in no particular order, to Manuel Uberti and Omar
-Antolín Camarena for their long time contributions and insightful
-commentary.
+Special thanks, in no particular order, to Manuel Uberti, Gustavo
+Barros, and Omar Antolín Camarena for their long time contributions and
+insightful commentary.
 
 * Meta
 :properties:
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 6ef9459..088352e 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -142,7 +142,8 @@ Configuring @value{tramp} for use
 * Remote shell setup::          Remote shell setup hints.
 * FUSE setup::                  @acronym{FUSE} setup hints.
 * Android shell setup::         Android shell setup hints.
-* Auto-save and Backup::        Auto-save and Backup.
+* Auto-save File Lock and Backup::
+                                Auto-save, File Lock and Backup.
 * Keeping files encrypted::     Protect remote files by encryption.
 * Windows setup hints::         Issues with Cygwin ssh.
 
@@ -691,7 +692,8 @@ may be used in your init file:
 * Remote shell setup::          Remote shell setup hints.
 * FUSE setup::                  @acronym{FUSE} setup hints.
 * Android shell setup::         Android shell setup hints.
-* Auto-save and Backup::        Auto-save and Backup.
+* Auto-save File Lock and Backup::
+                                Auto-save, File Lock and Backup.
 * Keeping files encrypted::     Protect remote files by encryption.
 * Windows setup hints::         Issues with Cygwin ssh.
 @end menu
@@ -2745,9 +2747,10 @@ Open a remote connection with a more concise command 
@kbd{C-x C-f
 @end itemize
 
 
-@node Auto-save and Backup
-@section Auto-save and Backup configuration
+@node Auto-save File Lock and Backup
+@section Auto-save, File Lock and Backup configuration
 @cindex auto-save
+@cindex file-lock
 @cindex backup
 
 @vindex backup-directory-alist
@@ -2842,11 +2845,28 @@ auto-saved files to the same directory as the original 
file.
 Alternatively, set the user option @code{tramp-auto-save-directory}
 to direct all auto saves to that location.
 
+@vindex lock-file-name-transforms
+And still more issues to handle.  Since @w{Emacs 28}, file locks use a
+similar user option as auto-save files, called
+@code{lock-file-name-transforms}.  By default this user option is
+@code{nil}, meaning to keep file locks in the same directory as the
+original file.
+
+If you change @code{lock-file-name-transforms} in order to keep file
+locks for remote files somewhere else, you will loose Emacs' feature
+to warn you, if a file is changed in parallel from different Emacs
+sessions, or via different remote connections.  Be careful with such
+settings.
+
+@vindex remote-file-name-inhibit-locks
+Setting @code{remote-file-name-inhibit-locks} to non-@code{nil}
+prevents the creation of remote lock files at all.
+
 @vindex tramp-allow-unsafe-temporary-files
 Per default, @value{tramp} asks for confirmation if a
-@samp{root}-owned backup or auto-save remote file has to be written to
-your local temporary directory.  If you want to suppress this
-confirmation question, set user option
+@samp{root}-owned remote backup, auto-save or lock file has to be
+written to your local temporary directory.  If you want to suppress
+this confirmation question, set user option
 @code{tramp-allow-unsafe-temporary-files} to @code{t}.
 
 
diff --git a/etc/NEWS b/etc/NEWS
index 1a31308..88d8fbe 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -309,6 +309,14 @@ about the different options to visit a file, how you can 
disable the
 prompt, and how you can tweak the file size threshold.
 
 +++
+** New user option 'query-about-changed-file'.
+If non-nil (the default), users are prompted as before when
+re-visiting a file that has changed externally after it was visited
+the first time.  If nil, the user is not prompted, but instead the
+buffer is opened with its contents before the change, and the user is
+given instructions how to revert the buffer.
+
++++
 ** Improved support for terminal emulators that encode the Meta flag.
 Some terminal emulators set the 8th bit of Meta characters, and then
 encode the resulting character code as if it were non-ASCII character
@@ -323,6 +331,7 @@ emulators by using the new input-meta-mode with the special 
value
 ** New frame parameter 'drag-with-tab-line'.
 This parameter, similar to 'drag-with-header-line', allows moving frames
 by dragging the tab lines of their topmost windows with the mouse.
+
 
 * Editing Changes in Emacs 28.1
 
@@ -777,6 +786,11 @@ time zones will use a form like "+0100" instead of "CET".
 
 ** Dired
 
++++
+*** New user option 'dired-kill-when-opening-new-dired-buffer'.
+If non-nil, Dired will kill the current buffer when selecting a new
+directory to display.
+
 ---
 *** Behavior change on 'dired-clean-confirm-killing-deleted-buffers'.
 Previously, if 'dired-clean-up-buffers-too' was non-nil, and
@@ -1139,6 +1153,11 @@ any directory names on the 'find' command lines end in a 
slash.
 This change is for better compatibility with old versions of non-GNU
 'find', such as the one used on macOS.
 
+---
+*** New utility function 'grep-file-at-point'.
+This returns the name of the file at point (if any) in 'grep-mode'
+buffers.
+
 ** Help
 
 +++
@@ -1185,6 +1204,16 @@ can provide a better overview in a long list of 
available bindings.
 In previous Emacs versions, the "*Help*" buffer was killed instead when
 clicking the "X" icon in the tool bar.
 
+** Info
+
+---
+*** New user option 'Info-warn-on-index-alternatives-wrap'.
+This option affects what happens when using the ',' command after
+looking up an entry with 'i' in info buffers.  If non-nil (the
+default), the ',' command will now warn you when proceeding beyond the
+final entry, and tapping ',' once more will then take you to the
+first entry.
+
 +++
 ** New command 'lossage-size'.
 It allows users to set the maximum number of keystrokes and commands
@@ -1266,6 +1295,9 @@ To revert to the previous behavior,
 
 ** Customize
 
+---
+*** Customize buffers can now be reverted with 'C-x x g'.
+
 *** Most customize commands now hide obsolete user options.
 Obsolete user options are no longer shown in the listings produced by
 the commands 'customize', 'customize-group', 'customize-apropos' and
@@ -1450,9 +1482,15 @@ buffer to a file under the "/tmp/" directory.  This is 
useful, if (in
 rare cases) Tramp blocks Emacs, and we need further debug information.
 
 +++
-*** Writing sensitive auto-save or backup files to the local temporary
-directory must be confirmed.  In order to suppress this confirmation,
-set user option 'tramp-allow-unsafe-temporary-files' to t.
+*** Tramp supports lock files now.
+In order to deactivate this, set user option
+'remote-file-name-inhibit-locks' to t.
+
++++
+*** Writing sensitive auto-save, backup or lock files to the local
+temporary directory must be confirmed.  In order to suppress this
+confirmation, set user option 'tramp-allow-unsafe-temporary-files' to
+t.
 
 ** Tempo
 
@@ -1476,6 +1514,14 @@ This is a slightly deeper copy than the previous 
'copy-sequence'.
 
 ** Package
 
+---
+*** '/ s' ('package-menu-filter-by-status') changes parameter handling.
+The command was documented to take a comma-separated list of statuses
+to filter by, but instead it used the parameter as a regexp.  The
+command has been changed so that it now works as documented, and
+checks statuses not as a regexp, but instead an exact match from the
+comma-separated list.
+
 +++
 *** New command 'package-browse-url' and keystroke 'w'.
 
@@ -1617,6 +1663,10 @@ t, which preserves the original behavior.
 If set non-nil, showing an unseen message will set the Rmail buffer's
 modified flag.
 
+---
+*** New faces for heading elements.
+Those are 'shr-h1', 'shr-h2', 'shr-h3', 'shr-h4', 'shr-h5', 'shr-h6'.
+
 ** Apropos
 
 *** New commands 'apropos-next-symbol' and 'apropos-previous-symbol'.
@@ -2146,8 +2196,40 @@ Shift while typing 'C-a', i.e. 'C-S-a', will now 
highlight the text.
 If the 'EMACS_TEST_VERBOSE' environment variable is set, failure
 summaries will include the failing condition.
 
+** File Locks
+
++++
+*** New user option 'lock-file-name-transforms'.
+This option allows controlling where lock files are written.  It uses
+the same syntax as 'auto-save-file-name-transforms'.
+
++++
+*** New user option 'remote-file-name-inhibit-locks'.
+When non-nil, this option suppresses lock files for remote files.
+
++++
+*** New minor mode 'lock-file-mode'.
+This command, called interactively, toggles the local value of
+'create-lockfiles' in the current buffer.
+
 ** Miscellaneous
 
+---
+*** New user option 'save-place-abbreviate-file-names'.
+
+---
+*** 'tabulated-list-mode' can now restore original display order.
+Many commands (like 'C-x C-b') are derived from 'tabulated-list-mode',
+and that mode allow the user to sort on any column.  There was
+previously no easy way to get back to the original displayed order
+after sorting, but giving a -1 numerical prefix to the sorting command
+will now restore the original order.
+
++++
+*** New utility function 'insert-into-buffer'.
+This is like 'insert-buffer-substring', but works in the opposite
+direction.
+
 +++
 *** New user option 'kill-transform-function'.
 This can be used to transform (and suppress) strings from entering the
@@ -2385,12 +2467,6 @@ leak information from the reporting user.
 The semantics are as with 'walk-windows'.
 
 ---
-*** Killing virtual ido buffers interactively will make them go away.
-Previously, killing a virtual ido buffer with 'ido-kill-buffer' didn't
-do anything.  This has now been changed, and killing virtual buffers
-with that command will remove the buffer from recentf.
-
----
 *** New variable 'ffap-file-name-with-spaces'.
 If non-nil, 'find-file-at-point' and friends will try to guess more
 expansively to identify a file name with spaces.
@@ -2464,6 +2540,17 @@ height of lines or width of chars.
 When non-nil, use a new xwidget webkit session after bookmark jump.
 Otherwise, it will use 'xwidget-webkit-last-session'.
 
+** ido
+
+---
+*** Switching on 'ido-mode' now also overrides 'ffap-file-finder'.
+
+---
+*** Killing virtual ido buffers interactively will make them go away.
+Previously, killing a virtual ido buffer with 'ido-kill-buffer' didn't
+do anything.  This has now been changed, and killing virtual buffers
+with that command will remove the buffer from recentf.
+
 ** Flymake mode
 
 +++
@@ -2915,6 +3002,15 @@ The former is now declared obsolete.
 * Lisp Changes in Emacs 28.1
 
 +++
+*** New function 'split-string-shell-command'.
+This splits a shell command string into separate components,
+respecting quoting with single ('like this') and double ("like this")
+quotes, as well as backslash quoting (like\ this).
+
+---
+*** ':safe' settings in 'defcustom' are now propagated to the loaddefs files.
+
++++
 ** New function 'syntax-class-to-char'.
 This does almost the opposite of 'string-to-syntax' -- it returns the
 syntax descriptor (a character) given a raw syntax descriptor (an
diff --git a/etc/themes/modus-operandi-theme.el 
b/etc/themes/modus-operandi-theme.el
index cd73681..a946d74 100644
--- a/etc/themes/modus-operandi-theme.el
+++ b/etc/themes/modus-operandi-theme.el
@@ -4,7 +4,7 @@
 
 ;; Author: Protesilaos Stavrou <info@protesilaos.com>
 ;; URL: https://gitlab.com/protesilaos/modus-themes
-;; Version: 1.4.0
+;; Version: 1.5.0
 ;; Package-Requires: ((emacs "26.1"))
 ;; Keywords: faces, theme, accessibility
 
diff --git a/etc/themes/modus-themes.el b/etc/themes/modus-themes.el
index c70c560..b9fe4a3 100644
--- a/etc/themes/modus-themes.el
+++ b/etc/themes/modus-themes.el
@@ -4,8 +4,8 @@
 
 ;; Author: Protesilaos Stavrou <info@protesilaos.com>
 ;; URL: https://gitlab.com/protesilaos/modus-themes
-;; Version: 1.4.0
-;; Last-Modified: <2021-05-25 12:25:39 +0300>
+;; Version: 1.5.0
+;; Last-Modified: <2021-07-15 13:21:55 +0300>
 ;; Package-Requires: ((emacs "26.1"))
 ;; Keywords: faces, theme, accessibility
 
@@ -33,10 +33,10 @@
 ;; official Info manual for further documentation (distributed with the
 ;; themes, or available at: <https://protesilaos.com/modus-themes>).
 ;;
-;; The themes share the following customization variables, all of which
-;; are disabled by default (nil):
+;; The themes share the following customization variables:
 ;;
-;;     modus-themes-slanted-constructs             (boolean)
+;;     modus-themes-inhibit-reload                 (boolean)
+;;     modus-themes-italic-constructs              (boolean)
 ;;     modus-themes-bold-constructs                (boolean)
 ;;     modus-themes-variable-pitch-headings        (boolean)
 ;;     modus-themes-variable-pitch-ui              (boolean)
@@ -47,8 +47,8 @@
 ;;     modus-themes-headings                       (alist)
 ;;     modus-themes-fringes                        (choice)
 ;;     modus-themes-lang-checkers                  (choice)
+;;     modus-themes-org-agenda                     (alist)
 ;;     modus-themes-org-blocks                     (choice)
-;;     modus-themes-org-habit                      (choice)
 ;;     modus-themes-prompts                        (choice)
 ;;     modus-themes-mode-line                      (choice)
 ;;     modus-themes-diffs                          (choice)
@@ -63,11 +63,11 @@
 ;; The default scale for headings is as follows (it can be customized as
 ;; well---remember, no scaling takes place by default):
 ;;
-;;     modus-themes-scale-1 1.05
-;;     modus-themes-scale-2 1.1
-;;     modus-themes-scale-3 1.15
-;;     modus-themes-scale-4 1.2
-;;     modus-themes-scale-5 1.3
+;;     modus-themes-scale-1                        1.05
+;;     modus-themes-scale-2                        1.1
+;;     modus-themes-scale-3                        1.15
+;;     modus-themes-scale-4                        1.2
+;;     modus-themes-scale-title                    1.3
 ;;
 ;; There also exist two unique customization variables for overriding
 ;; color palette values.  The specifics are documented in the manual.
@@ -122,6 +122,7 @@
 ;;     counsel-org-capture-string
 ;;     cov
 ;;     cperl-mode
+;;     css-mode
 ;;     csv-mode
 ;;     ctrlf
 ;;     custom (M-x customize)
@@ -203,6 +204,7 @@
 ;;     git-timemachine
 ;;     git-walktree
 ;;     gnus
+;;     gotest
 ;;     golden-ratio-scroll-screen
 ;;     helm
 ;;     helm-ls-git
@@ -245,6 +247,7 @@
 ;;     jupyter
 ;;     kaocha-runner
 ;;     keycast
+;;     ledger-mode
 ;;     line numbers (`display-line-numbers-mode' and global variant)
 ;;     lsp-mode
 ;;     lsp-ui
@@ -307,6 +310,7 @@
 ;;     prism (see "Note for prism.el" in the manual)
 ;;     proced
 ;;     prodigy
+;;     pulse
 ;;     quick-peek
 ;;     racket-mode
 ;;     rainbow-blocks
@@ -395,20 +399,6 @@
 ;; - modus-operandi-theme.el    (Light theme)
 ;; - modus-vivendi-theme.el     (Dark theme)
 
-;;; News:
-;;
-;; Users updating from older versions to >= 1.0.0, are advised to read
-;; the announcement on the emacs-devel mailing list:
-;; <https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00300.html>.
-;;
-;; The web page of the change log is also available:
-;; <https://protesilaos.com/modus-themes-changelog/>.
-;;
-;; An Info manual should be distributed with the Modus themes.
-;; Evaluate this form to access it directly:
-;;
-;;    (info "(modus-themes) Top")
-
 ;;; Code:
 
 
@@ -430,6 +420,13 @@ cover the blue-cyan-magenta side of the spectrum."
   :prefix "modus-themes-"
   :tag "Modus Themes")
 
+(defgroup modus-themes-faces ()
+  "Faces defined my `modus-operandi' and `modus-vivendi'."
+  :group 'modus-themes
+  :link '(info-link "(modus-themes) Top")
+  :prefix "modus-themes-"
+  :tag "Modus Themes Faces")
+
 ;;; Variables for each theme variant
 
 ;;;; Modus Operandi
@@ -614,6 +611,7 @@ cover the blue-cyan-magenta side of the spectrum."
     (bg-paren-expression . "#dff0ff")
     (bg-region . "#bcbcbc")
     (bg-region-accent . "#afafef")
+    (bg-region-accent-subtle . "#efdfff")
 
     (bg-tab-bar . "#d5d5d5")
     (bg-tab-active . "#f6f6f6")
@@ -710,9 +708,9 @@ symbol and the latter as a string.")
     (green-faint . "#78bf78")
     (green-alt-faint . "#99b56f")
     (green-alt-other-faint . "#88bf99")
-    (yellow . "#e0cc00")
-    (yellow-alt . "#c4d030")
-    (yellow-alt-other . "#e3c55f")
+    (yellow . "#d0bc00")
+    (yellow-alt . "#c0c530")
+    (yellow-alt-other . "#d3b55f")
     (yellow-faint . "#d2b580")
     (yellow-alt-faint . "#cabf77")
     (yellow-alt-other-faint . "#d0ba95")
@@ -847,7 +845,7 @@ symbol and the latter as a string.")
     ;;
     ;; all pairs are combinable with themselves
     (bg-hl-line . "#151823")
-    (bg-hl-line-intense . "#2f2f2f")
+    (bg-hl-line-intense . "#292929")
     (bg-hl-line-intense-accent . "#00353f")
     (bg-hl-alt . "#181732")
     (bg-hl-alt-intense . "#282e46")
@@ -856,6 +854,7 @@ symbol and the latter as a string.")
     (bg-paren-expression . "#221044")
     (bg-region . "#3c3c3c")
     (bg-region-accent . "#4f3d88")
+    (bg-region-accent-subtle . "#240f55")
 
     (bg-tab-bar . "#2c2c2c")
     (bg-tab-active . "#0e0e0e")
@@ -928,212 +927,244 @@ symbol and the latter as a string.")
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-subtle-green nil
   "Subtle green background combined with a dimmed foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-subtle-yellow nil
   "Subtle yellow background combined with a dimmed foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-subtle-blue nil
   "Subtle blue background combined with a dimmed foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-subtle-magenta nil
   "Subtle magenta background combined with a dimmed foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-subtle-cyan nil
   "Subtle cyan background combined with a dimmed foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-subtle-neutral nil
   "Subtle gray background combined with a dimmed foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-intense-red nil
   "Intense red background combined with the main foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-intense-green nil
   "Intense green background combined with the main foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-intense-yellow nil
   "Intense yellow background combined with the main foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-intense-blue nil
   "Intense blue background combined with the main foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-intense-magenta nil
   "Intense magenta background combined with the main foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-intense-cyan nil
   "Intense cyan background combined with the main foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-intense-neutral nil
   "Intense gray background combined with the main foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-refine-red nil
   "Combination of accented red background and foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-refine-green nil
   "Combination of accented green background and foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-refine-yellow nil
   "Combination of accented yellow background and foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-refine-blue nil
   "Combination of accented blue background and foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-refine-magenta nil
   "Combination of accented magenta background and foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-refine-cyan nil
   "Combination of accented cyan background and foreground.
 This is used for general purpose highlighting, mostly in buffers
 or for completion interfaces.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-active-red nil
   "A red background meant for use on the mode line or similar.
 This is combined with the mode lines primary foreground value.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-active-green nil
   "A green background meant for use on the mode line or similar.
 This is combined with the mode lines primary foreground value.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-active-yellow nil
   "A yellow background meant for use on the mode line or similar.
 This is combined with the mode lines primary foreground value.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-active-blue nil
   "A blue background meant for use on the mode line or similar.
 This is combined with the mode lines primary foreground value.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-active-magenta nil
   "A magenta background meant for use on the mode line or similar.
 This is combined with the mode lines primary foreground value.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-active-cyan nil
   "A cyan background meant for use on the mode line or similar.
 This is combined with the mode lines primary foreground value.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-fringe-red nil
   "A red background meant for use on the fringe or similar.
 This is combined with the main foreground value.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-fringe-green nil
   "A green background meant for use on the fringe or similar.
 This is combined with the main foreground value.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-fringe-yellow nil
   "A yellow background meant for use on the fringe or similar.
 This is combined with the main foreground value.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-fringe-blue nil
   "A blue background meant for use on the fringe or similar.
 This is combined with the main foreground value.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-fringe-magenta nil
   "A magenta background meant for use on the fringe or similar.
 This is combined with the main foreground value.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-fringe-cyan nil
   "A cyan background meant for use on the fringe or similar.
 This is combined with the main foreground value.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-nuanced-red nil
   "A nuanced red background.
@@ -1142,7 +1173,8 @@ meant to serve as the backdrop for elements such as Org 
blocks,
 headings, and any other surface that needs to retain the colors
 on display.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-nuanced-green nil
   "A nuanced green background.
@@ -1151,7 +1183,8 @@ meant to serve as the backdrop for elements such as Org 
blocks,
 headings, and any other surface that needs to retain the colors
 on display.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-nuanced-yellow nil
   "A nuanced yellow background.
@@ -1160,7 +1193,8 @@ meant to serve as the backdrop for elements such as Org 
blocks,
 headings, and any other surface that needs to retain the colors
 on display.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-nuanced-blue nil
   "A nuanced blue background.
@@ -1169,7 +1203,8 @@ meant to serve as the backdrop for elements such as Org 
blocks,
 headings, and any other surface that needs to retain the colors
 on display.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-nuanced-magenta nil
   "A nuanced magenta background.
@@ -1178,7 +1213,8 @@ meant to serve as the backdrop for elements such as Org 
blocks,
 headings, and any other surface that needs to retain the colors
 on display.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-nuanced-cyan nil
   "A nuanced cyan background.
@@ -1187,7 +1223,8 @@ meant to serve as the backdrop for elements such as Org 
blocks,
 headings, and any other surface that needs to retain the colors
 on display.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-special-cold nil
   "Combines the 'special cold' background and foreground values.
@@ -1195,7 +1232,8 @@ This is intended for cases when a neutral gray background 
is not
 suitable and where a combination of more saturated colors would
 not be appropriate.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-special-mild nil
   "Combines the 'special mild' background and foreground values.
@@ -1203,7 +1241,8 @@ This is intended for cases when a neutral gray background 
is not
 suitable and where a combination of more saturated colors would
 not be appropriate.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-special-warm nil
   "Combines the 'special warm' background and foreground values.
@@ -1211,7 +1250,8 @@ This is intended for cases when a neutral gray background 
is not
 suitable and where a combination of more saturated colors would
 not be appropriate.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-special-calm nil
   "Combines the 'special calm' background and foreground values.
@@ -1219,188 +1259,223 @@ This is intended for cases when a neutral gray 
background is not
 suitable and where a combination of more saturated colors would
 not be appropriate.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-diff-added nil
   "Combines green colors for the 'added' state in diffs.
 The applied colors are contingent on the value assigned to
 `modus-themes-diffs'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-diff-changed nil
   "Combines yellow colors for the 'changed' state in diffs.
 The applied colors are contingent on the value assigned to
 `modus-themes-diffs'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-diff-removed nil
   "Combines red colors for the 'removed' state in diffs.
 The applied colors are contingent on the value assigned to
 `modus-themes-diffs'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-diff-refine-added nil
   "Combines green colors for word-wise 'added' state in diffs.
 The applied colors are contingent on the value assigned to
 `modus-themes-diffs'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-diff-refine-changed nil
   "Combines yellow colors for word-wise 'changed' state in diffs.
 The applied colors are contingent on the value assigned to
 `modus-themes-diffs'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-diff-refine-removed nil
   "Combines red colors for word-wise 'removed' state in diffs.
 The applied colors are contingent on the value assigned to
 `modus-themes-diffs'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-diff-focus-added nil
   "Combines green colors for the focused 'added' state in diffs.
 The applied colors are contingent on the value assigned to
 `modus-themes-diffs'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-diff-focus-changed nil
   "Combines yellow colors for the focused 'changed' state in.
 The applied colors are contingent on the value assigned to
 `modus-themes-diffs'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-diff-focus-removed nil
   "Combines red colors for the focused 'removed' state in diffs.
 The applied colors are contingent on the value assigned to
 `modus-themes-diffs'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-diff-heading nil
   "Combines blue colors for the diff hunk heading.
 The applied colors are contingent on the value assigned to
 `modus-themes-diffs'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-pseudo-header nil
   "Generic style for some elements that function like headings.
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-mark-alt nil
   "Combines yellow colors for marking special lines.
 This is intended for use in modes such as Dired, Ibuffer, Proced.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-mark-del nil
   "Combines red colors for marking deletable lines.
 This is intended for use in modes such as Dired, Ibuffer, Proced.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-mark-sel nil
   "Combines green colors for marking lines.
 This is intended for use in modes such as Dired, Ibuffer, Proced.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-mark-symbol nil
   "Applies a blue color and other styles for mark indicators.
 This is intended for use in modes such as Dired, Ibuffer, Proced.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-heading-1 nil
   "General purpose face for use in headings level 1.
 The exact attributes assigned to this face are contingent on the
 values assigned to the `modus-themes-headings' variable.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-heading-2 nil
   "General purpose face for use in headings level 2.
 The exact attributes assigned to this face are contingent on the
 values assigned to the `modus-themes-headings' variable.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-heading-3 nil
   "General purpose face for use in headings level 3.
 The exact attributes assigned to this face are contingent on the
 values assigned to the `modus-themes-headings' variable.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-heading-4 nil
   "General purpose face for use in headings level 4.
 The exact attributes assigned to this face are contingent on the
 values assigned to the `modus-themes-headings' variable.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-heading-5 nil
   "General purpose face for use in headings level 5.
 The exact attributes assigned to this face are contingent on the
 values assigned to the `modus-themes-headings' variable.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-heading-6 nil
   "General purpose face for use in headings level 6.
 The exact attributes assigned to this face are contingent on the
 values assigned to the `modus-themes-headings' variable.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-heading-7 nil
   "General purpose face for use in headings level 7.
 The exact attributes assigned to this face are contingent on the
 values assigned to the `modus-themes-headings' variable.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-heading-8 nil
   "General purpose face for use in headings level 8.
 The exact attributes assigned to this face are contingent on the
 values assigned to the `modus-themes-headings' variable.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-hl-line nil
   "General purpose face for the current line.
 The exact attributes assigned to this face are contingent on the
 values assigned to the `modus-themes-hl-line' variable.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-bold nil
   "Generic face for applying a conditional bold weight.
 This behaves in accordance with `modus-themes-bold-constructs'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-slant nil
   "Generic face for applying a conditional slant (italics).
-This behaves in accordance with `modus-themes-slanted-constructs'.
+This behaves in accordance with `modus-themes-italic-constructs'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-variable-pitch nil
   "Generic face for applying a conditional `variable-pitch'.
 This behaves in accordance with `modus-themes-no-mixed-fonts',
-`modus-themes-variable-pitch-headings' for all heading levels, and
-`modus-themes-variable-pitch-ui'.
+`modus-themes-variable-pitch-headings' for all heading levels,
+and `modus-themes-variable-pitch-ui'.
+
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
-The actual styling of the face is done by `modus-themes-faces'.")
+(defface modus-themes-fixed-pitch nil
+  "Generic face for applying a conditional `fixed-pitch'.
+This behaves in accordance with `modus-themes-no-mixed-fonts'.
+
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-graph-red-0 nil
   "Special subdued red face for use in graphs.
@@ -1408,7 +1483,8 @@ This is intended to be applied in contexts such as the 
Org agenda
 habit graph where faithfulness to the semantics of a color value
 is of paramount importance.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-graph-red-1 nil
   "Special prominent red face for use in graphs.
@@ -1416,7 +1492,8 @@ This is intended to be applied in contexts such as the 
Org agenda
 habit graph where faithfulness to the semantics of a color value
 is of paramount importance.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-graph-green-0 nil
   "Special subdued green face for use in graphs.
@@ -1424,7 +1501,8 @@ This is intended to be applied in contexts such as the 
Org agenda
 habit graph where faithfulness to the semantics of a color value
 is of paramount importance.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-graph-green-1 nil
   "Special prominent green face for use in graphs.
@@ -1432,7 +1510,8 @@ This is intended to be applied in contexts such as the 
Org agenda
 habit graph where faithfulness to the semantics of a color value
 is of paramount importance.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-graph-yellow-0 nil
   "Special subdued yellow face for use in graphs.
@@ -1440,7 +1519,8 @@ This is intended to be applied in contexts such as the 
Org agenda
 habit graph where faithfulness to the semantics of a color value
 is of paramount importance.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-graph-yellow-1 nil
   "Special prominent yellow face for use in graphs.
@@ -1448,7 +1528,8 @@ This is intended to be applied in contexts such as the 
Org agenda
 habit graph where faithfulness to the semantics of a color value
 is of paramount importance.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-graph-blue-0 nil
   "Special subdued blue face for use in graphs.
@@ -1456,7 +1537,8 @@ This is intended to be applied in contexts such as the 
Org agenda
 habit graph where faithfulness to the semantics of a color value
 is of paramount importance.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-graph-blue-1 nil
   "Special prominent blue face for use in graphs.
@@ -1464,7 +1546,8 @@ This is intended to be applied in contexts such as the 
Org agenda
 habit graph where faithfulness to the semantics of a color value
 is of paramount importance.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-graph-magenta-0 nil
   "Special subdued magenta face for use in graphs.
@@ -1472,7 +1555,8 @@ This is intended to be applied in contexts such as the 
Org agenda
 habit graph where faithfulness to the semantics of a color value
 is of paramount importance.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-graph-magenta-1 nil
   "Special prominent magenta face for use in graphs.
@@ -1480,7 +1564,8 @@ This is intended to be applied in contexts such as the 
Org agenda
 habit graph where faithfulness to the semantics of a color value
 is of paramount importance.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-graph-cyan-0 nil
   "Special subdued cyan face for use in graphs.
@@ -1488,7 +1573,8 @@ This is intended to be applied in contexts such as the 
Org agenda
 habit graph where faithfulness to the semantics of a color value
 is of paramount importance.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-graph-cyan-1 nil
   "Special prominent cyan face for use in graphs.
@@ -1496,28 +1582,32 @@ This is intended to be applied in contexts such as the 
Org agenda
 habit graph where faithfulness to the semantics of a color value
 is of paramount importance.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-lang-note nil
   "Generic face for linter or spell checker notes.
 The exact attributes and color combinations are controlled by
 `modus-themes-lang-checkers'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-lang-warning nil
   "Generic face for linter or spell checker warnings.
 The exact attributes and color combinations are controlled by
 `modus-themes-lang-checkers'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-lang-error nil
   "Generic face for linter or spell checker errors.
 The exact attributes and color combinations are controlled by
 `modus-themes-lang-checkers'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-reset-soft nil
   "Generic face to set most face properties to nil.
@@ -1527,7 +1617,8 @@ properties from their context (e.g. an overlay over an 
underlined
 text should not be underlined as well) yet still blend in.  Also
 see `modus-themes-reset-hard'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-reset-hard nil
   "Generic face to set all face properties to nil.
@@ -1537,28 +1628,68 @@ properties from their context (e.g. an overlay over an 
underlined
 text should not be underlined as well) and not blend in.  Also
 see `modus-themes-reset-soft'.
 
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-key-binding nil
   "Generic face for key bindings.
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-search-success nil
   "Generic face for successful search.
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-search-success-modeline nil
   "Generic mode line indicator for successful search.
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 (defface modus-themes-search-success-lazy nil
   "Generic face for successful, lazily highlighted search.
-The actual styling of the face is done by `modus-themes-faces'.")
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
+
+(defface modus-themes-prompt nil
+  "Generic face for command prompts.
+The actual styling of the face is done by `modus-themes-faces'."
+  :group 'modus-theme-faces)
 
 
 
 ;;; Customization variables
 
+(defcustom modus-themes-inhibit-reload t
+  "Control theme reload when setting options with Customize.
+
+By default, customizing a theme-related user option through the
+Custom interfaces or with `customize-set-variable' will not
+reload the currently active Modus theme.
+
+Enable this behaviour by setting this variable to nil."
+  :group 'modus-themes
+  :package-version '(modus-themes . "1.5.0")
+  :version "28.1"
+  :type 'boolean
+  :link '(info-link "(modus-themes) Custom reload theme"))
+
+(defun modus-themes--set-option (sym val)
+  "Custom setter for theme related user options.
+Will set SYM to VAL, and reload the current theme, unless
+`modus-themes-inhibit-reload' is non-nil."
+  (set-default sym val)
+  (unless (or modus-themes-inhibit-reload
+              ;; Check if a theme is being loaded, in which case we
+              ;; don't want to reload a theme if the setter is
+              ;; invoked. `custom--inhibit-theme-enable' is set to nil
+              ;; by `enable-theme'.
+              (null (bound-and-true-p custom--inhibit-theme-enable)))
+    (let ((modus-themes-inhibit-reload t))
+      (pcase (modus-themes--current-theme)
+        ('modus-operandi (modus-themes-load-operandi))
+        ('modus-vivendi (modus-themes-load-vivendi))))))
+
 (defcustom modus-themes-operandi-color-overrides nil
   "Override colors in the Modus Operandi palette.
 
@@ -1567,6 +1698,8 @@ For form, see `modus-themes-operandi-colors'."
   :package-version '(modus-themes . "1.1.0")
   :version "28.1"
   :type '(alist :key-type symbol :value-type color)
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Override colors (DIY)"))
 
 (defcustom modus-themes-vivendi-color-overrides nil
@@ -1577,6 +1710,8 @@ For form, see `modus-themes-vivendi-colors'."
   :package-version '(modus-themes . "1.1.0")
   :version "28.1"
   :type '(alist :key-type symbol :value-type color)
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Override colors (DIY)"))
 
 ;; The byte compiler complains when a defcustom isn't a top level form
@@ -1595,14 +1730,33 @@ For form, see `modus-themes-vivendi-colors'."
   :package-version '(modus-themes . "1.0.0")
   :version "28.1"
   :type 'boolean
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Slanted constructs"))
 
+(define-obsolete-variable-alias
+  'modus-themes-slanted-constructs
+  'modus-themes-italic-constructs
+  "1.5.0")
+
+(defcustom modus-themes-italic-constructs nil
+  "Use italic font forms in more code constructs."
+  :group 'modus-themes
+  :package-version '(modus-themes . "1.5.0")
+  :version "28.1"
+  :type 'boolean
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
+  :link '(info-link "(modus-themes) Italic constructs"))
+
 (defcustom modus-themes-bold-constructs nil
   "Use bold text in more code constructs."
   :group 'modus-themes
   :package-version '(modus-themes . "1.0.0")
   :version "28.1"
   :type 'boolean
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Bold constructs"))
 
 (defcustom modus-themes-variable-pitch-headings nil
@@ -1611,6 +1765,8 @@ For form, see `modus-themes-vivendi-colors'."
   :package-version '(modus-themes . "1.0.0")
   :version "28.1"
   :type 'boolean
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Headings' typeface"))
 
 (defcustom modus-themes-variable-pitch-ui nil
@@ -1620,6 +1776,8 @@ This includes the mode line, header line, tab bar, and 
tab line."
   :package-version '(modus-themes . "1.1.0")
   :version "28.1"
   :type 'boolean
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) UI typeface"))
 
 (defcustom modus-themes-no-mixed-fonts nil
@@ -1637,110 +1795,97 @@ mixing fonts."
   :package-version '(modus-themes . "1.0.0")
   :version "28.1"
   :type 'boolean
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) No mixed fonts"))
 
 (defconst modus-themes--headings-choice
-  '(choice
-    (const :format "[%v] %t\n" :tag "Fairly desaturated foreground with bold 
weight (default)" nil)
-    (const :format "[%v] %t\n" :tag "Same as the default 
(backward-compatible)" t)
-    (const :format "[%v] %t\n" :tag "Like the default without bold weight" 
no-bold)
-    (const :format "[%v] %t\n" :tag "Like the default plus overline" line)
-    (const :format "[%v] %t\n" :tag "Like `line' without bold weight" 
line-no-bold)
-    (const :format "[%v] %t\n" :tag "Like the default but with more colorful 
foreground" rainbow)
-    (const :format "[%v] %t\n" :tag "Like `rainbow' plus overline" 
rainbow-line)
-    (const :format "[%v] %t\n" :tag "Like `rainbow' without bold weight" 
rainbow-no-bold)
-    (const :format "[%v] %t\n" :tag "Like `rainbow-line' without bold weight" 
rainbow-line-no-bold)
-    (const :format "[%v] %t\n" :tag "Like the default plus subtle background" 
highlight)
-    (const :format "[%v] %t\n" :tag "Like `highlight' without bold weight" 
highlight-no-bold)
-    (const :format "[%v] %t\n" :tag "Like `highlight' with more colorful 
foreground" rainbow-highlight)
-    (const :format "[%v] %t\n" :tag "Like `rainbow-highlight' without bold 
weight" rainbow-highlight-no-bold)
-    (const :format "[%v] %t\n" :tag "Like `highlight' plus overline" section)
-    (const :format "[%v] %t\n" :tag "Like `section' without bold weight" 
section-no-bold)
-    (const :format "[%v] %t\n" :tag "Like `section' with more colorful 
foreground" rainbow-section)
-    (const :format "[%v] %t\n" :tag "Like `rainbow-section' without bold 
weight" rainbow-section-no-bold)
-    (const :format "[%v] %t\n" :tag "Do not use any distinct foreground color; 
just bold weight" no-color)
-    (const :format "[%v] %t\n" :tag "Like `no-bold' but without the distinct 
foreground color" no-color-no-bold))
+  '(set :tag "Properties" :greedy t
+        (const :tag "Background color" background)
+        (const :tag "Overline" overline)
+        (const :tag "No bold weight" no-bold)
+        (choice :tag "Colors"
+                (const :tag "Subtle colors" nil)
+                (const :tag "Rainbow colors" rainbow)
+                (const :tag "Monochrome" monochrome)))
   "Refer to the doc string of `modus-themes-headings'.
 This is a helper variable intended for internal use.")
 
 (defcustom modus-themes-headings nil
-  "Alist of styles for headings, with optional value per level.
-
-To control faces per level from 1-8, use something like this:
+  "Heading styles with optional list of values for levels 1-8.
 
-  (setq modus-themes-headings
-        '((1 . highlight)
-          (2 . line)
-          (t . rainbow-line-no-bold)))
+This is an alist that accepts a (key . list-of-values)
+combination.  The key is either a number, representing the
+heading's level or t, which pertains to the fallback style.  The
+list of values covers symbols that refer to properties, as
+described below.  Here is a sample, followed by a presentation of
+all available properties:
 
-To set a uniform value for all heading levels, use this pattern:
+    (setq modus-themes-headings
+          '((1 . (background overline))
+            (2 . (overline rainbow))
+            (t . (monochrome))))
 
-  (setq modus-themes-headings
-        '((t . rainbow-line-no-bold)))
+By default (a nil value for this variable), all headings have a
+bold typographic weight and use a desaturated text color.
 
-The default value uses a fairly desaturated foreground color in
-combination with a bold typographic weight.  To specify this
-style for a given level N (assuming you wish to have another
-fallback option), just specify the value nil like this:
+A `rainbow' property makes the text color more saturated.
 
-  (setq modus-themes-headings
-        '((1 . nil)
-          (2 . line)
-          (3) ; same as nil
-          (t . rainbow-line-no-bold)))
+An `overline' property draws a line above the area of the
+heading.
 
-A description of all other possible values:
+A `background' property adds a subtle tinted color to the
+background of the heading.
 
-+ `no-bold' retains the default text color while removing the
-  typographic weight.
+A `no-bold' property removes the bold weight from the heading's
+text.
 
-+ `line' is the same as the default plus an overline over the
-  heading.
+A `monochrome' property makes all headings the same base color,
+which is that of the default for the active theme (black/white).
+When `background' is also set, `monochrome' changes its color to
+gray.  If both `monochrome' and `rainbow' are set, the former
+takes precedence.
 
-+ `line-no-bold' is the same as `line' without bold weight.
+Combinations of any of those properties are expressed as a list,
+like in these examples:
 
-+ `rainbow' uses a more colorful foreground in combination with
-  bold weight.
+    (no-bold)
+    (rainbow background)
+    (overline monochrome no-bold)
 
-+ `rainbow-line' is the same as `rainbow' plus an overline.
+The order in which the properties are set is not significant.
 
-+ `rainbow-line-no-bold' is the same as `rainbow-line' without
-  the bold weight.
+In user configuration files the form may look like this:
 
-+ `highlight' retains the default style of a fairly desaturated
-  foreground combined with a bold weight and add to it a subtle
-  accented background.
+    (setq modus-themes-headings
+          '((1 . (background overline rainbow))
+            (2 . (background overline))
+            (t . (overline no-bold))))
 
-+ `highlight-no-bold' is the same as `highlight' without a bold
-  weight.
+When defining the styles per heading level, it is possible to
+pass a non-nil value (t) instead of a list of properties.  This
+will retain the original aesthetic for that level.  For example:
 
-+ `rainbow-highlight' is the same as `highlight' but with a more
-  colorful foreground.
+    (setq modus-themes-headings
+          '((1 . t)           ; keep the default style
+            (2 . (background overline))
+            (t . (rainbow)))) ; style for all other headings
 
-+ `rainbow-highlight-no-bold' is the same as `rainbow-highlight'
-  without a bold weight.
+    (setq modus-themes-headings
+          '((1 . (background overline))
+            (2 . (rainbow no-bold))
+            (t . t))) ; default style for all other levels
 
-+ `section' retains the default looks and adds to them both an
-  overline and a slightly accented background.  It is, in effect,
-  a combination of the `line' and `highlight' values.
+For Org users, the extent of the heading depends on the variable
+`org-fontify-whole-heading-line'.  This affects the `overline'
+and `background' properties.  Depending on the version of Org,
+there may be others, such as `org-fontify-done-headline'.
 
-+ `section-no-bold' is the same as `section' without a bold
-  weight.
-
-+ `rainbow-section' is the same as `section' but with a more
-  colorful foreground.
-
-+ `rainbow-section-no-bold' is the same as `rainbow-section'
-  without a bold weight.
-
-+ `no-color' does not apply any color to the heading, meaning
-  that it uses the foreground of the `default' face.  It still
-  renders the text with a bold typographic weight.
-
-+ `no-color-no-bold' is like `no-color' but without the bold
-  weight."
+Also read `modus-themes-scale-headings' to change the height of
+headings and `modus-themes-variable-pitch-headings' to make them
+use a proportionately spaced font."
   :group 'modus-themes
-  :package-version '(modus-themes . "1.3.0")
+  :package-version '(modus-themes . "1.5.0")
   :version "28.1"
   :type `(alist
           :options ,(mapcar (lambda (el)
@@ -1748,16 +1893,166 @@ A description of all other possible values:
                             '(1 2 3 4 5 6 7 8 t))
           :key-type symbol
           :value-type ,modus-themes--headings-choice)
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Heading styles"))
 
+(defcustom modus-themes-org-agenda nil
+  "Control the style of individual Org agenda constructs.
+
+This is an alist that accepts a (key . value) combination.  Here
+is a sample, followed by a description of all possible
+combinations:
+
+    (setq modus-themes-org-agenda
+          '((header-block . (variable-pitch scale-title))
+            (header-date . (grayscale workaholic bold-today))
+            (scheduled . uniform)
+            (habit . traffic-light)))
+
+A `header-block' key applies to elements that concern the
+headings which demarcate blocks in the structure of the agenda.
+By default (a nil value) those are rendered in a bold typographic
+weight, plus a height that is slightly taller than the default
+font size.  Acceptable values come in the form of a list that can
+include either or both of those properties:
+
+- `variable-pitch' to use a proportionately spaced typeface;
+- `scale-title' to increase height to `modus-themes-scale-title'
+  OR `no-scale' to set the font to the same height as the rest of
+  the buffer.
+
+In case both `scale-title' and `no-scale' are in the list, the
+latter takes precedence.
+
+Example usage:
+
+    (header-block . nil)
+    (header-block . (scale-title))
+    (header-block . (no-scale))
+    (header-block . (variable-pitch scale-title))
+
+A `header-date' key covers date headings.  Dates use only a
+foreground color by default (a nil value), with weekdays and
+weekends having a slight difference in hueness.  The current date
+has an added gray background.  This key accepts a list of values
+that can include any of the following properties:
+
+- `grayscale' to make weekdays use the main foreground color and
+  weekends a more subtle gray;
+- `workaholic' to make weekdays and weekends look the same in
+  terms of color;
+- `bold-today' to apply a bold typographic weight to the current
+  date;
+- `bold-all' to render all date headings in a bold weight.
+
+For example:
+
+    (header-date . nil)
+    (header-date . (workaholic))
+    (header-date . (grayscale bold-all))
+    (header-date . (grayscale workaholic))
+    (header-date . (grayscale workaholic bold-today))
+
+A `scheduled' key applies to tasks with a scheduled date.  By
+default (a nil value), these use varying shades of yellow to
+denote (i) a past or current date and (ii) a future date.  Valid
+values are symbols:
+
+- nil (default);
+- `uniform' to make all scheduled dates the same color;
+- `rainbow' to use contrasting colors for past, present, future
+  scheduled dates.
+
+For example:
+
+    (scheduled . nil)
+    (scheduled . uniform)
+    (scheduled . rainbow)
+
+A `habit' key applies to the `org-habit' graph.  All possible
+value are passed as a symbol.  Those are:
+
+- The default (nil) is meant to conform with the original
+  aesthetic of `org-habit'.  It employs all four color codes that
+  correspond to the org-habit states---clear, ready, alert, and
+  overdue---while distinguishing between their present and future
+  variants.  This results in a total of eight colors in use: red,
+  yellow, green, blue, in tinted and shaded versions.  They cover
+  the full set of information provided by the `org-habit'
+  consistency graph.
+- `simplified' is like the default except that it removes the
+  dichotomy between current and future variants by applying
+  uniform color-coded values.  It applies a total of four colors:
+  red, yellow, green, blue.  They produce a simplified
+  consistency graph that is more legible (or less \"busy\") than
+  the default.  The intent is to shift focus towards the
+  distinction between the four states of a habit task, rather
+  than each state's present/future outlook.
+- `traffic-light' further reduces the available colors to red,
+  yellow, and green.  As in `simplified', present and future
+  variants appear uniformly, but differently from it, the 'clear'
+  state is rendered in a green hue, instead of the original blue.
+  This is meant to capture the use-case where a habit task being
+  \"too early\" is less important than it being \"too late\".
+  The difference between ready and clear states is attenuated by
+  painting both of them using shades of green.  This option thus
+  highlights the alert and overdue states.
+- `traffic-light-deuteranopia' is like the `traffic-light' except
+  its three colors are red, yellow, and blue to be suitable for
+  users with red-green color deficiency (deuteranopia).
+
+For example:
+
+    (habit . nil)
+    (habit . simplified)
+    (habit . traffic-light)"
+  :group 'modus-themes
+  :package-version '(modus-themes . "1.5.0")
+  :version "28.1"
+  :type '(set
+          (cons :tag "Block header"
+                (const header-block)
+                (set :tag "Header presentation" :greedy t
+                     (choice :tag "Font style"
+                             (const :tag "Use the original typeface (default)" 
nil)
+                             (const :tag "Use `variable-pitch' font" 
variable-pitch))
+                     (choice :tag "Scaling"
+                             (const :tag "Slight increase in height (default)" 
nil)
+                             (const :tag "Do not scale" no-scale)
+                             (const :tag "Scale to match 
`modus-themes-scale-title'" scale-title))))
+          (cons :tag "Date header" :greedy t
+                (const header-date)
+                (set :tag "Header presentation" :greedy t
+                     (const :tag "Use grayscale for date headers" grayscale)
+                     (const :tag "Do not differentiate weekdays from weekends" 
workaholic)
+                     (const :tag "Make today bold" bold-today)
+                     (const :tag "Make all dates bold" bold-all)))
+          (cons :tag "Scheduled tasks"
+                (const scheduled)
+                (choice (const :tag "Yellow colors to distinguish current and 
future tasks (default)" nil)
+                        (const :tag "Uniform subtle warm color for all 
scheduled tasks" uniform)
+                        (const :tag "Rainbow-colored scheduled tasks" 
rainbow)))
+          (cons :tag "Habit graph"
+                (const habit)
+                (choice (const :tag "Follow the original design of `org-habit' 
(default)" nil)
+                        (const :tag "Do not distinguish between present and 
future variants" simplified)
+                        (const :tag "Use only red, yellow, green" 
traffic-light)
+                        (const :tag "Use only red, yellow, blue" 
traffic-light-deuteranopia))))
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
+  :link '(info-link "(modus-themes) Org agenda"))
+
 (defcustom modus-themes-scale-headings nil
   "Use font scaling for headings.
 
 For regular headings the scale is controlled by the variables
 `modus-themes-scale-1' (smallest) and its variants all the way up
-to `modus-themes-scale-4' (larger).  While `modus-themes-scale-5'
-is reserved for special headings that must be the largest on the
-scale.
+to `modus-themes-scale-4' (larger).
+
+While `modus-themes-scale-title' is reserved for special headings
+that nominally are the largest on the scale (though that is not a
+requirement).
 
 A special heading is, in this context, one that does not fit into
 the syntax for heading levels that apply to the given mode.  For
@@ -1768,6 +2063,8 @@ special heading."
   :package-version '(modus-themes . "1.2.0")
   :version "28.1"
   :type 'boolean
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Scaled headings"))
 
 (defcustom modus-themes-scale-1 1.05
@@ -1790,6 +2087,8 @@ accordance with it in cases where it changes, such as 
while using
   :package-version '(modus-themes . "1.2.0")
   :version "28.1"
   :type 'number
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Scaled heading sizes"))
 
 (defcustom modus-themes-scale-2 1.1
@@ -1812,6 +2111,8 @@ accordance with it in cases where it changes, such as 
while using
   :package-version '(modus-themes . "1.2.0")
   :version "28.1"
   :type 'number
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Scaled heading sizes"))
 
 (defcustom modus-themes-scale-3 1.15
@@ -1834,6 +2135,8 @@ accordance with it in cases where it changes, such as 
while using
   :package-version '(modus-themes . "1.2.0")
   :version "28.1"
   :type 'number
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Scaled heading sizes"))
 
 (defcustom modus-themes-scale-4 1.2
@@ -1856,6 +2159,8 @@ accordance with it in cases where it changes, such as 
while using
   :package-version '(modus-themes . "1.2.0")
   :version "28.1"
   :type 'number
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Scaled heading sizes"))
 
 (defcustom modus-themes-scale-5 1.3
@@ -1879,6 +2184,35 @@ accordance with it in cases where it changes, such as 
while using
   :package-version '(modus-themes . "1.2.0")
   :version "28.1"
   :type 'number
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
+  :link '(info-link "(modus-themes) Scaled heading sizes"))
+
+(define-obsolete-variable-alias 'modus-themes-scale-5 
'modus-themes-scale-title "1.5.0")
+
+(defcustom modus-themes-scale-title 1.3
+  "Font size slightly larger than `modus-themes-scale-4'.
+
+This size is only used for 'special' top level headings, such as
+Org's file title heading, denoted by the #+title key word, and
+the Org agenda structure headers (see `modus-themes-org-agenda').
+
+The default value is a floating point that is interpreted as a
+multiple of the base font size.  It is recommended to use such a
+value.
+
+However, the variable also accepts an integer, understood as an
+absolute height that is 1/10 of the typeface's point size (e.g. a
+value of 140 is the same as setting the font at 14 point size).
+This will ignore the base font size and, thus, will not scale in
+accordance with it in cases where it changes, such as while using
+`text-scale-adjust'."
+  :group 'modus-themes
+  :package-version '(modus-themes . "1.5.0")
+  :version "28.1"
+  :type 'number
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Scaled heading sizes"))
 
 (defcustom modus-themes-fringes nil
@@ -1895,40 +2229,62 @@ pronounced grayscale value."
           (const :format "[%v] %t\n" :tag "No visible fringes (default)" nil)
           (const :format "[%v] %t\n" :tag "Subtle grayscale background" subtle)
           (const :format "[%v] %t\n" :tag "Intense grayscale background" 
intense))
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Fringes"))
 
 (defcustom modus-themes-lang-checkers nil
   "Control the style of spelling and code checkers/linters.
 
-Nil (the default) applies a color-coded underline to the affected
-text, while it leaves the original foreground in tact.  If the
+The value is a list of properties, each designated by a symbol.
+The default (nil) applies a color-coded underline to the affected
+text, while it leaves the original foreground intact.  If the
 display spec of Emacs has support for it, the underline's style
 is that of a wave, otherwise it is a straight line.
 
-Options `subtle-foreground' and `intense-foreground' add a
-color-coded underline while also changing the text's foreground
-accordingly.  The style of the underline is the same as with the
-default option.
+The property `straight-underline' ensures that the underline
+under the affected text is always drawn as a straight line.
+
+The property `text-also' applies the same color of the underline
+to the affected text.
+
+The property `background' adds a color-coded background.
+
+The property `intense' amplifies the applicable colors if
+`background' and/or `text-only' are set.  If `intense' is set on
+its own, then it implies `text-only'.
 
-Option `straight-underline' is like the default but always
-applies a straight line under the affected text.  Same principle
-for `subtle-foreground-straight-underline' and its counterpart
-`intense-foreground-straight-underline'.
+To disable fringe indicators for Flymake or Flycheck, refer to
+variables `flymake-fringe-indicator-position' and
+`flycheck-indication-mode', respectively.
 
-Option `colored-background' uses a straight underline, a
-background, and a foreground.  All are color-coded.  This is the
-most intense combination of face properties."
+Combinations of any of those properties can be expressed in a
+list, as in those examples:
+
+    (background)
+    (straight-underline intense)
+    (background text-also straight-underline)
+
+The order in which the properties are set is not significant.
+
+In user configuration files the form may look like this:
+
+    (setq modus-themes-lang-checkers '(text-also background))
+
+NOTE: The placement of the straight underline, though not the
+wave style, is controlled by the built-in variables
+`underline-minimum-offset', `x-underline-at-descent-line',
+`x-use-underline-position-properties'."
   :group 'modus-themes
-  :package-version '(modus-themes . "1.1.0")
+  :package-version '(modus-themes . "1.5.0")
   :version "28.1"
-  :type '(choice
-          (const :format "[%v] %t\n" :tag "Only color-coded wavy underline 
(default)" nil)
-          (const :format "[%v] %t\n" :tag "Like the default, but with a 
straight underline" straight-underline)
-          (const :format "[%v] %t\n" :tag "Color-coded wavy underline; subtle 
foreground" subtle-foreground)
-          (const :format "[%v] %t\n" :tag "Combines `straight-underline' and 
`subtle-foreground'" subtle-foreground-straight-underline)
-          (const :format "[%v] %t\n" :tag "Color-coded wavy underline; intense 
foreground" intense-foreground)
-          (const :format "[%v] %t\n" :tag "Combines `straight-underline' and 
`intense-foreground'" intense-foreground-straight-underline)
-          (const :format "[%v] %t\n" :tag "Color-coded background, foreground, 
straight underline" colored-background))
+  :type '(set :tag "Properties" :greedy t
+              (const :tag "Straight underline" straight-underline)
+              (const :tag "Colorise text as well" text-also)
+              (const :tag "Increase color intensity" intense)
+              (const :tag "With background" background))
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Language checkers"))
 
 (defcustom modus-themes-org-blocks nil
@@ -1971,10 +2327,14 @@ respectively."
           (const :format "[%v] %t\n" :tag "Alias for `gray-background'" 
greyscale)
           (const :format "[%v] %t\n" :tag "Color-coded background per 
programming language" tinted-background)
           (const :format "[%v] %t\n" :tag "Alias for `tinted-background'" 
rainbow)) ; back compat
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Org mode blocks"))
 
 (defcustom modus-themes-org-habit nil
-  "Control the presentation of the `org-habit' graph.
+  "Deprecated in version 1.5.0 favor of `modus-themes-org-agenda'.
+
+Control the presentation of the `org-habit' graph.
 
 The default is meant to conform with the original aesthetic of
 `org-habit'.  It employs all four color codes that correspond to
@@ -2009,64 +2369,90 @@ highlights the alert and overdue states."
           (const :format "[%v] %t\n" :tag "Respect the original design of 
org-habit (default)" nil)
           (const :format "[%v] %t\n" :tag "Like the default, but do not 
distinguish between present and future variants" simplified)
           (const :format "[%v] %t\n" :tag "Like `simplified', but only use 
red, yellow, green" traffic-light))
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Org agenda habits"))
 
+(make-obsolete 'modus-themes-org-habit 'modus-themes-org-agenda "1.5.0")
+
 (defcustom modus-themes-mode-line nil
-  "Adjust the overall style of the mode line.
-
-The default (nil) is a two-dimensional rectangle with a border
-around it.  The active and the inactive mode lines use different
-shades of grayscale values for the background and foreground.
-
-A `3d' value will apply a three-dimensional effect to the active
-mode line.  The inactive mode lines remain two-dimensional and
-are toned down a bit, relative to the nil value.
-
-The `moody' option is meant to optimize the mode line for use
-with the library of the same name.  This practically means to
-remove the box effect and rely on underline and overline
-properties instead.  It also tones down the inactive mode lines.
-Despite its intended purpose, this option can also be used
-without the `moody' library.
-
-The `borderless' option uses the same colors as the default (nil
-value), but removes the border effect.  This is done by making
-the box property use the same color as the background,
-effectively blending the two and creating some padding.
-
-The `borderless-3d' and `borderless-moody' approximate the `3d'
-and `moody' options respectively, while removing the borders.
-However, to ensure that the inactive mode lines remain visible,
-they apply a slightly more prominent background to them than what
-their counterparts do (same inactive background as with the
-default).
-
-Similarly, `accented', `accented-3d', and `accented-moody'
-correspond to the default (nil), `3d', and `moody' styles
-respectively, except that the active mode line uses a colored
-background instead of the standard shade of gray.
-
-Same principle for styles `borderless-accented',
-`borderless-accented-3d', `borderless-accented-moody', which
-apply a colored background to the active mode line, while they
-remove any noticeable border around both the active and inactive
-the mode lines."
+  "Control the overall style of the mode line.
+
+The value is a list of properties, each designated by a symbol.
+The default (a nil value or an empty list) is a two-dimensional
+rectangle with a border around it.  The active and the inactive
+mode lines use different shades of grayscale values for the
+background, foreground, border.
+
+The `3d' property applies a three-dimensional effect to the
+active mode line.  The inactive mode lines remain two-dimensional
+and are toned down a bit, relative to the default style.
+
+The `moody' property optimizes the mode line for use with the
+library of the same name (hereinafter referred to as 'Moody').
+In practice, it removes the box effect and replaces it with
+underline and overline properties.  It also tones down the
+inactive mode lines.  Despite its intended purpose, this option
+can also be used without the Moody library (please consult the
+themes' manual on this point for more details).  If both `3d' and
+`moody' properties are set, the latter takes precedence.
+
+The `borderless' property removes the color of the borders.  It
+does not actually remove the borders, but only makes their color
+the same as the background, effectively creating some padding.
+
+The `accented' property ensures that the active mode line uses a
+colored background instead of the standard shade of gray.
+
+Combinations of any of those properties are expressed as a list,
+like in these examples:
+
+    (accented)
+    (borderless 3d)
+    (moody accented borderless)
+
+The order in which the properties are set is not significant.
+
+In user configuration files the form may look like this:
+
+    (setq modus-themes-mode-line '(borderless accented))
+
+Note that Moody does not expose any faces that the themes could
+style directly.  Instead it re-purposes existing ones to render
+its tabs and ribbons.  As such, there may be cases where the
+contrast ratio falls below the 7:1 target that the themes conform
+with (WCAG AAA).  To hedge against this, we configure a fallback
+foreground for the `moody' property, which will come into effect
+when the background of the mode line changes to something less
+accessible, such as Moody ribbons (read the doc string of
+`set-face-attribute', specifically `:distant-foreground').  This
+fallback is activated when Emacs determines that the background
+and foreground of the given construct are too close to each other
+in terms of color distance.  In practice, users will need to
+experiment with the variable `face-near-same-color-threshold' to
+trigger the effect.  We find that a value of 45000 shall suffice,
+contrary to the default 30000.  Though for the combinations that
+involve the `accented' and `moody' properties, as mentioned
+above, that should be raised up to 70000.  Do not set it too
+high, because it has the adverse effect of always overriding the
+default colors (which have been carefully designed to be highly
+accessible).
+
+Furthermore, because Moody expects an underline and overline
+instead of a box style, it is advised to set
+`x-underline-at-descent-line' to a non-nil value."
   :group 'modus-themes
-  :package-version '(modus-themes . "1.4.0")
+  :package-version '(modus-themes . "1.5.0")
   :version "28.1"
-  :type '(choice
-          (const :format "[%v] %t\n" :tag "Two-dimensional box (default)" nil)
-          (const :format "[%v] %t\n" :tag "Three-dimensional style for the 
active mode line" 3d)
-          (const :format "[%v] %t\n" :tag "No box effects, which are optimal 
for use with the `moody' library" moody)
-          (const :format "[%v] %t\n" :tag "Like the default, but without 
discernible border effects" borderless)
-          (const :format "[%v] %t\n" :tag "Like `3d', but without noticeable 
border" borderless-3d)
-          (const :format "[%v] %t\n" :tag "Like `moody', but without 
noticeable border" borderless-moody)
-          (const :format "[%v] %t\n" :tag "Two-dimensional box with a colored 
background" accented)
-          (const :format "[%v] %t\n" :tag "Like `3d', but with a colored 
background" accented-3d)
-          (const :format "[%v] %t\n" :tag "Like `moody', but with a colored 
background" accented-moody)
-          (const :format "[%v] %t\n" :tag "Like `accented', but without a 
noticeable border" borderless-accented)
-          (const :format "[%v] %t\n" :tag "Like `accented-3d', but with a 
noticeable border" borderless-accented-3d)
-          (const :format "[%v] %t\n" :tag "Like `accented-moody', but with a 
noticeable border" borderless-accented-moody))
+  :type '(set :tag "Properties" :greedy t
+              (choice :tag "Overall style"
+                      (const :tag "Rectangular Border" nil)
+                      (const :tag "3d borders" 3d)
+                      (const :tag "No box effects (Moody-compatible)" moody))
+              (const :tag "Colored background" accented)
+              (const :tag "Without border color" borderless))
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Mode line"))
 
 (defcustom modus-themes-diffs nil
@@ -2108,10 +2494,12 @@ interest of backward compatibility."
   :type '(choice
           (const :format "[%v] %t\n" :tag "Intensely colored backgrounds 
(default)" nil)
           (const :format "[%v] %t\n" :tag "Slightly accented backgrounds with 
tinted text" desaturated)
-          (const :format "[%v] %t\n" :tag "Apply color-coded backgrounds; keep 
syntax colors in tact" bg-only)
+          (const :format "[%v] %t\n" :tag "Apply color-coded backgrounds; keep 
syntax colors intact" bg-only)
           (const :format "[%v] %t\n" :tag "Like the default (nil), though 
optimized for red-green color defficiency" deuteranopia)
           (const :format "[%v] %t\n" :tag "No backgrounds, except for refined 
diffs" fg-only-deuteranopia)
           (const :format "[%v] %t\n" :tag "Alias of `fg-only-deuteranopia' for 
backward compatibility" fg-only))
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Diffs"))
 
 (defcustom modus-themes-completions nil
@@ -2155,36 +2543,57 @@ and `opinionated' possibilities."
           (const :format "[%v] %t\n" :tag "Respect the framework's established 
aesthetic (default)" nil)
           (const :format "[%v] %t\n" :tag "Subtle backgrounds for various 
elements" moderate)
           (const :format "[%v] %t\n" :tag "Radical alternative to the 
framework's looks" opinionated))
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Completion UIs"))
 
 (defcustom modus-themes-prompts nil
   "Use subtle or intense styles for minibuffer and REPL prompts.
 
-Nil means to only use an accented foreground color.
+The value is a list of properties, each designated by a symbol.
+The default (a nil value or an empty list) means to only use a
+subtle accented foreground color.
+
+The property `background' applies a background color to the
+prompt's text.  By default, this is a subtle accented value.
+
+The property `intense' makes the foreground color more prominent.
+If the `background' property is also set, it amplifies the value
+of the background as well.
+
+The property `gray' changes the prompt's colors to grayscale.
+This affects the foreground and, if the `background' property is
+also set, the background.  Its effect is subtle, unless it is
+combined with the `intense' property.
+
+The property `bold' makes the text use a bold typographic weight.
+Similarly, `italic' adds a slant to the font's forms (italic or
+oblique forms, depending on the typeface).
+
+Combinations of any of those properties are expressed as a list,
+like in these examples:
 
-Options `subtle-accented' and `intense-accented' will change both
-the background and the foreground values to use accented color
-combinations that follow the hue of the default styles'
-foreground (e.g. the default minibuffer prompt is cyan text, so
-these combinations will involved a cyan background and an
-appropriate cyan foreground).
+    (intense)
+    (bold intense)
+    (intense bold gray)
+    (intense background gray bold)
 
-Options `subtle-gray' and `intense-gray' are like their
-`subtle-accented' and `intense-accented' counterparts, except
-they use grayscale values instead of accented ones."
+The order in which the properties are set is not significant.
+
+In user configuration files the form may look like this:
+
+    (setq modus-themes-prompts '(background gray))"
   :group 'modus-themes
-  :package-version '(modus-themes . "1.1.0")
+  :package-version '(modus-themes . "1.5.0")
   :version "28.1"
-  :type '(choice
-          ;; `subtle' is the same as `subtle-accented', while `intense' is
-          ;; equal to `intense-accented' for backward compatibility
-          (const :format "[%v] %t\n" :tag "No prompt background (default)" nil)
-          (const :format "[%v] %t\n" :tag "Subtle accented background for the 
prompt" subtle-accented)
-          (const :format "[%v] %t\n" :tag "Same as `subtle-accented' for 
compatibility with older versions" subtle)
-          (const :format "[%v] %t\n" :tag "Intense accented background and 
foreground for the prompt" intense-accented)
-          (const :format "[%v] %t\n" :tag "Same as `intense-accented' for 
compatibility with older versions" intense)
-          (const :format "[%v] %t\n" :tag "Like `subtle-accented' but 
grayscale" subtle-gray)
-          (const :format "[%v] %t\n" :tag "Like `intense-accented' but 
grayscale" intense-gray))
+  :type '(set :tag "Properties" :greedy t
+              (const :tag "With Background" background)
+              (const :tag "Intense" intense)
+              (const :tag "Grayscale" gray)
+              (const :tag "Bold font weight" bold)
+              (const :tag "Italic font slant" italic))
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Command prompts"))
 
 (defcustom modus-themes-intense-hl-line nil
@@ -2193,6 +2602,8 @@ they use grayscale values instead of accented ones."
   :package-version '(modus-themes . "1.0.0")
   :version "28.1"
   :type 'boolean
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Line highlighting"))
 
 (make-obsolete 'modus-themes-intense-hl-line 'modus-themes-hl-line "1.3.0")
@@ -2200,39 +2611,44 @@ they use grayscale values instead of accented ones."
 (defcustom modus-themes-hl-line nil
   "Control the current line highlight of HL-line mode.
 
-The default (nil) is to apply a subtle neutral background to the
-current line.
+The value is a list of properties, each designated by a symbol.
+The default (a nil value or an empty list) is a subtle gray
+background color.
 
-Option `intense-background' uses a prominent neutral background.
+The property `accented' changes the background to a colored
+variant.
 
-Option `accented-background' is like the `intense-background' but
-with a more colorful background.
+An `underline' property draws a line below the highlighted area.
+Its color is similar to the background, so gray by default or an
+accent color when `accented' is also set.
 
-Option `underline-neutral' combines a subtle neutral background
-with a gray underline.
+An `intense' property amplifies the colors in use, which may be
+both the background and the underline.
 
-Option `underline-accented' draws an underline while applying a
-subtle colored background.
+Combinations of any of those properties are expressed as a list,
+like in these examples:
 
-Option `underline-only-neutral' uses just a neutral underline,
-without any added change to the background.
+    (intense)
+    (underline intense)
+    (accented intense underline)
 
-Option `underline-only-accented' uses just a colored underline,
-without any added change to the background.
+The order in which the properties are set is not significant.
+
+In user configuration files the form may look like this:
+
+    (setq modus-themes-hl-line '(underline accented))
 
 Set `x-underline-at-descent-line' to a non-nil value for better
 results with underlines."
   :group 'modus-themes
-  :package-version '(modus-themes . "1.4.0")
+  :package-version '(modus-themes . "1.5.0")
   :version "28.1"
-  :type '(choice
-          (const :format "[%v] %t\n" :tag "Subtle neutral background 
(default)" nil)
-          (const :format "[%v] %t\n" :tag "Prominent neutral background" 
intense-background)
-          (const :format "[%v] %t\n" :tag "Subtle colored background" 
accented-background)
-          (const :format "[%v] %t\n" :tag "Underline with a subtle neutral 
background" underline-neutral)
-          (const :format "[%v] %t\n" :tag "Underline with a subtle colored 
background" underline-accented)
-          (const :format "[%v] %t\n" :tag "Just a neutral underline, without a 
background" underline-only-neutral)
-          (const :format "[%v] %t\n" :tag "Just an accented underline, without 
a background" underline-only-accented))
+  :type '(set :tag "Properties" :greedy t
+              (const :tag "Colored background" accented)
+              (const :tag "Underline" underline)
+              (const :tag "Intense style" intense))
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Line highlighting"))
 
 (defcustom modus-themes-subtle-line-numbers nil
@@ -2241,145 +2657,208 @@ results with underlines."
   :package-version '(modus-themes . "1.2.0")
   :version "28.1"
   :type 'boolean
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Line numbers"))
 
 (defcustom modus-themes-paren-match nil
-  "Choose the style of matching parentheses or delimiters.
+  "Control the style of matching parentheses or delimiters.
 
-Nil means to use a subtle tinted background color (the default).
+The value is a list of properties, each designated by a symbol.
+The default (a nil value or an empty list) is a subtle background
+color.
 
-Option `intense' applies a saturated background color.
+The `bold' property adds a bold weight to the characters of the
+matching delimiters.
 
-Option `subtle-bold' is the same as the default, but also makes
-use of bold typographic weight (inherits the `bold' face).
+The `intense' property applies a more prominent background color
+to the delimiters.
 
-Option `intense-bold' is the same as `intense', while it also
-uses a bold weight."
+The `underline' property draws a straight line under the affected
+text.
+
+Combinations of any of those properties are expressed as a list,
+like in these examples:
+
+    (bold)
+    (underline intense)
+    (bold intense underline)
+
+The order in which the properties are set is not significant.
+
+In user configuration files the form may look like this:
+
+    (setq modus-themes-paren-match '(bold intense))"
   :group 'modus-themes
-  :package-version '(modus-themes . "1.0.0")
+  :package-version '(modus-themes . "1.5.0")
   :version "28.1"
-  :type '(choice
-          (const :format "[%v] %t\n" :tag "Sublte tinted background (default)" 
nil)
-          (const :format "[%v] %t\n" :tag "Like the default, but also use bold 
typographic weight" subtle-bold)
-          (const :format "[%v] %t\n" :tag "Intense saturated background" 
intense)
-          (const :format "[%v] %t\n" :tag "Like `intense' but with bold 
weight" intense-bold))
+  :type '(set :tag "Properties" :greedy t
+              (const :tag "Bold weight" bold)
+              (const :tag "Intense background color" intense)
+              (const :tag "Underline" underline))
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Matching parentheses"))
 
 (defcustom modus-themes-syntax nil
   "Control the overall style of code syntax highlighting.
 
-Nil (the default) means to use colors on the cyan-blue-magenta
-side of the spectrum.  There is little to no use of greens,
-yellows, and reds.
+The value is a list of properties, each designated by a symbol.
+The default (a nil value or an empty list) is to use a balanced
+combination of colors on the cyan-blue-magenta side of the
+spectrum.  There is little to no use of greens, yellows, and
+reds.  Comments are gray, strings are blue colored, doc strings
+are a shade of cyan, while color combinations are designed to
+avoid exaggerations.
+
+The property `faint' fades the saturation of all applicable
+colors, where that is possible or appropriate.
 
-Option `faint' is like the default in terms of the choice of
-palette but applies desaturated color values.
+The property `yellow-comments' applies a yellow color to
+comments.
 
-Option `yellow-comments' applies a yellow tint to comments.  The
-rest of the syntax is the same as the default.
+The property `green-strings' applies a green color to strings and
+a green tint to doc strings.
 
-Option `green-strings' replaces the blue/cyan/cold color variants
-in strings with greener alternatives.  The rest of the syntax
-remains the same.
+The property `alt-syntax' changes the combination of colors
+beyond strings and comments, so that the effective palette is
+broadened to provide greater variety relative to the default.
 
-Option `yellow-comments-green-strings' combines yellow comments
-with green strings and the rest of the default syntax
-highlighting style.
+Combinations of any of those properties are expressed as a list,
+like in these examples:
 
-Option `alt-syntax' expands the color palette and applies new
-color combinations.  Strings are green.  Doc strings are magenta
-tinted.  Comments are gray.
+    (faint)
+    (green-strings yellow-comments)
+    (alt-syntax green-strings yellow-comments)
+    (faint alt-syntax green-strings yellow-comments)
 
-Option `alt-syntax-yellow-comments' combines `alt-syntax' with
-`yellow-comments'.
+The order in which the properties are set is not significant.
 
-Option `faint-yellow-comments' combines the `faint' style with
-`yellow-comments'."
+In user configuration files the form may look like this:
+
+    (setq modus-themes-syntax '(faint alt-syntax))
+
+Independent of this variable, users may also control the use of a
+bold weight or italic text: `modus-themes-bold-constructs' and
+`modus-themes-italic-constructs'."
   :group 'modus-themes
-  :package-version '(modus-themes . "1.2.0")
+  :package-version '(modus-themes . "1.5.0")
   :version "28.1"
-  :type '(choice
-          (const :format "[%v] %t\n" :tag "Balanced use of blue, cyan, 
magenta, purple variants (default)" nil)
-          (const :format "[%v] %t\n" :tag "Like the default, but with 
desaturated color values" faint)
-          (const :format "[%v] %t\n" :tag "Apply yellow tint to comments, keep 
the default style for the rest" yellow-comments)
-          (const :format "[%v] %t\n" :tag "Use green for strings, keep the 
default style for the rest" green-strings)
-          (const :format "[%v] %t\n" :tag "Use green for strings, yellow for 
comments, keep the default style for the rest" yellow-comments-green-strings)
-          (const :format "[%v] %t\n" :tag "Refashion syntax highlighting with 
more colors, gray comments" alt-syntax)
-          (const :format "[%v] %t\n" :tag "Like `alt-syntax' but with yellow 
comments" alt-syntax-yellow-comments)
-          (const :format "[%v] %t\n" :tag "Like `faint' but with yellow 
comments" faint-yellow-comments))
+  :type '(set :tag "Properties" :greedy t
+              (const :tag "Faint colors" faint)
+              (const :tag "Yellow comments" yellow-comments)
+              (const :tag "Green strings" green-strings)
+              (const :tag "Alternative set of colors" alt-syntax))
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Syntax styles"))
 
 (defcustom modus-themes-links nil
   "Set the style of links.
 
-Nil means to use an underline that is the same color as the
-foreground.
+The value is a list of properties, each designated by a symbol.
+The default (a nil value or an empty list) is a prominent text
+color, typically blue, with an underline of the same color.
+
+For the style of the underline, a `neutral-underline' property
+turns the color of the line into a subtle gray, while the
+`no-underline' property removes the line altogether.  If both of
+those are set, the latter takes precedence.
+
+For text coloration, a `faint' property desaturates the color of
+the text and the underline, unless the underline is affected by
+the aforementioned properties.  While a `no-color' property
+removes the color from the text.  If both of those are set, the
+latter takes precedence.
+
+A `bold' property applies a heavy typographic weight to the text
+of the link.
+
+An `italic' property adds a slant to the link's text (italic or
+oblique forms, depending on the typeface).
 
-Option `faint' applies desaturated colors to the link's text and
-underline.
+A `background' property applies a subtle tinted background color.
 
-Option `neutral-underline' applies a subtle gray underline, while
-retaining the link's foreground.
+In case both `no-underline' and `no-color' are set, then a subtle
+gray background is applied to all links.  This can still be
+combined with the `bold' and `italic' properties.
 
-Option `faint-neutral-underline' combines a desaturated text
-color with a subtle gray underline.
+Combinations of any of those properties are expressed as a list,
+like in these examples:
 
-Option `no-underline' removes link underlines altogether, while
-retaining their original fairly vivid color.
+    (faint)
+    (no-underline faint)
+    (no-color no-underline bold)
+    (italic bold background no-color no-underline)
 
-Option `underline-only' applies an underline while making the
-affected text colorless (it uses the same foreground as the
-theme's default).
+The order in which the properties are set is not significant.
 
-Option `neutral-underline-only' makes the text colorless while
-using a subtle underline below it."
+In user configuration files the form may look like this:
+
+    (setq modus-themes-links '(neutral-underline background))
+
+The placement of the underline, meaning its proximity to the
+text, is controlled by `x-use-underline-position-properties',
+`x-underline-at-descent-line', `underline-minimum-offset'.
+Please refer to their documentation strings."
   :group 'modus-themes
-  :package-version '(modus-themes . "1.2.0")
+  :package-version '(modus-themes . "1.5.0")
   :version "28.1"
-  :type '(choice
-          (const :format "[%v] %t\n" :tag "Undeline link using the same color 
as the text (default)" nil)
-          (const :format "[%v] %t\n" :tag "Like the default, but apply less 
intense colors to links" faint)
-          (const :format "[%v] %t\n" :tag "Change the color of link underlines 
to a neutral gray" neutral-underline)
-          (const :format "[%v] %t\n" :tag "Desaturated foreground with neutral 
gray underline" faint-neutral-underline)
-          (const :format "[%v] %t\n" :tag "Remove underline property from 
links, keeping their foreground as-is" no-underline)
-          (const :format "[%v] %t\n" :tag "Apply underline only; use default 
foreground" underline-only)
-          (const :format "[%v] %t\n" :tag "Like `underline-only' but with a 
subtle underline" neutral-underline-only))
+  :type '(set :tag "Properties" :greedy t
+              (choice :tag "Text coloration"
+                      (const :tag "Saturared color (default)" nil)
+                      (const :tag "Faint coloration" faint)
+                      (const :tag "No color (use main black/white)" no-color))
+              (choice :tag "Underline"
+                      (const :tag "Same color as text (default)" nil)
+                      (const :tag "Neutral (gray) underline color" 
neutral-underline)
+                      (const :tag "No underline" no-underline))
+              (const :tag "Bold font weight" bold)
+              (const :tag "Italic font slant" italic)
+              (const :tag "Subtle background color" background))
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Link styles"))
 
 (defcustom modus-themes-region nil
-  "Change the overall appearance of the active region.
+  "Control the overall style of the active region.
 
-Nil (the default) means to only use a prominent gray background
-with a neutral foreground.  The foreground overrides all syntax
-highlighting.  The region extends to the edge of the window.
+The value is a list of properties, each designated by a symbol.
+The default (a nil value or an empty list) is a prominent gray
+background that overrides all foreground colors in the area it
+encompasses.  Its reach extends to the edge of the window.
 
-Option `no-extend' preserves the default aesthetic but prevents
-the region from extending to the edge of the window.
+The `no-extend' property limits the region to the end of the
+line, so that it does not reach the edge of the window.
 
-Option `bg-only' applies a faint tinted background that is
-distinct from all others used in the theme, while it does not
-override any existing colors.  It extends to the edge of the
-window.
+The `bg-only' property makes the region's background color more
+subtle to allow the underlying text to retain its foreground
+colors.
 
-Option `bg-only-no-extend' is a combination of the `bg-only' and
-`no-extend' options.
+The `accented' property applies a more colorful background to the
+region.
 
-Option `accent' uses a more colorful background with a neutral
-foreground.  It overrides all syntax highlighting and extends to
-the edge of the window.
+Combinations of any of those properties are expressed as a list,
+like in these examples:
 
-Option `accent-no-extend' is like the above, but stretches only
-to the end of each line within the region."
+    (no-extend)
+    (bg-only accented)
+    (accented bg-only no-extend)
+
+The order in which the properties are set is not significant.
+
+In user configuration files the form may look like this:
+
+    (setq modus-themes-region '(bg-only no-extend))"
   :group 'modus-themes
-  :package-version '(modus-themes . "1.3.0")
+  :package-version '(modus-themes . "1.5.0")
   :version "28.1"
-  :type '(choice
-          (const :format "[%v] %t\n" :tag "Intense background; overrides 
colors; extends to edge of window (default)" nil)
-          (const :format "[%v] %t\n" :tag "As with the default, but does not 
extend" no-extend)
-          (const :format "[%v] %t\n" :tag "Subtle background; preserves 
colors; extends to edge of window" bg-only)
-          (const :format "[%v] %t\n" :tag "As with the `subtle' option, but 
does not extend" bg-only-no-extend)
-          (const :format "[%v] %t\n" :tag "Like the default, but with an 
accented background" accent)
-          (const :format "[%v] %t\n" :tag "As with the `accent' option, but 
does not extend" accent-no-extend))
+  :type '(set :tag "Properties" :greedy t
+              (const :tag "Do not extend to the edge of the window" no-extend)
+              (const :tag "Background only (preserve underlying colors)" 
bg-only)
+              (const :tag "Accented background" accented))
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Active region"))
 
 (defcustom modus-themes-success-deuteranopia nil
@@ -2397,6 +2876,8 @@ configured to conform with deuteranopia: 
`modus-themes-diffs'."
   :package-version '(modus-themes . "1.4.0")
   :version "28.1"
   :type 'boolean
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Success' color-code"))
 
 (defcustom modus-themes-mail-citations nil
@@ -2420,6 +2901,8 @@ colored into a uniform shade of shade of gray."
           (const :format "[%v] %t\n" :tag "Like the default, but with less 
saturated colors" faint)
           (const :format "[%v] %t\n" :tag "Deprecated alias of `faint'" 
desaturated)
           (const :format "[%v] %t\n" :tag "Uniformly gray mail citations" 
monochrome))
+  :set #'modus-themes--set-option
+  :initialize #'custom-initialize-default
   :link '(info-link "(modus-themes) Mail citations"))
 
 
@@ -2474,17 +2957,17 @@ Those are stored in `modus-themes-faces' and
   (when modus-themes-bold-constructs
     (list :inherit 'bold)))
 
-(defun modus-themes--mixed-fonts ()
-  "Conditional application of `fixed-pitch' inheritance."
-  (unless modus-themes-no-mixed-fonts
-    (list :inherit 'fixed-pitch)))
-
 (defun modus-themes--slant ()
   "Conditional use of italics for slant attribute."
-  (if modus-themes-slanted-constructs
+  (if modus-themes-italic-constructs
       (list 'italic)
     (list 'normal)))
 
+(defun modus-themes--fixed-pitch ()
+  "Conditional application of `fixed-pitch' inheritance."
+  (unless modus-themes-no-mixed-fonts
+    (list :inherit 'fixed-pitch)))
+
 (defun modus-themes--variable-pitch ()
   "Conditional use of `variable-pitch' in headings."
   (when modus-themes-variable-pitch-headings
@@ -2512,43 +2995,113 @@ combines with the theme's primary background 
(white/black)."
       (list :background (or altbg 'unspecified) :foreground altfg)
     (list :background mainbg :foreground mainfg)))
 
-(defun modus-themes--lang-check (underline subtlefg intensefg bg)
+(defun modus-themes--lang-check (underline subtlefg intensefg intensefg-alt 
subtlebg intensebg)
   "Conditional use of foreground colors for language checkers.
 UNDERLINE is a color-code value for the affected text's underline
 property.  SUBTLEFG and INTENSEFG follow the same color-coding
 pattern and represent a value that is faint or vibrant
-respectively.  BG is a color-coded background."
-  (pcase modus-themes-lang-checkers
-    ('colored-background
-     (list :underline underline :background bg :foreground intensefg))
-    ('intense-foreground
-     (list :underline (list :color underline :style 'wave) :foreground 
intensefg))
-    ('intense-foreground-straight-underline
-     (list :underline underline :foreground intensefg))
-    ('subtle-foreground
-     (list :underline (list :color underline :style 'wave) :foreground 
subtlefg))
-    ('subtle-foreground-straight-underline
-     (list :underline underline :foreground subtlefg))
-    ('straight-underline
-     (list :underline underline))
-    (_ (list :underline (list :color underline :style 'wave)))))
-
-(defun modus-themes--prompt (mainfg subtlebg subtlefg intensebg intensefg)
-  "Conditional use of background colors for prompts.
-MAINFG is the prompt's standard foreground.  SUBTLEBG should be a
-subtle accented background that works with SUBTLEFG.  INTENSEBG
-must be a more pronounced accented color that should be
-combinable with INTENSEFG."
-  (pcase modus-themes-prompts
-    ;; `subtle' is the same as `subtle-accented', while `intense' is
-    ;; equal to `intense-accented' for backward compatibility
-    ('intense-accented (list :background intensebg :foreground intensefg))
-    ('intense (list :background intensebg :foreground intensefg))
-    ('subtle-accented (list :background subtlebg :foreground subtlefg))
-    ('subtle (list :background subtlebg :foreground subtlefg))
-    ('subtle-gray (list :inherit 'modus-themes-subtle-neutral))
-    ('intense-gray (list :inherit 'modus-themes-intense-neutral))
-    (_ (list :background 'unspecified :foreground mainfg))))
+respectively.  INTENSEFG-ALT is used when the intensity is high.
+SUBTLEBG and INTENSEBG are color-coded background colors that
+differ in overall intensity."
+  (let ((modus-themes-lang-checkers
+         (if (listp modus-themes-lang-checkers)
+             modus-themes-lang-checkers
+           (pcase modus-themes-lang-checkers
+             ('colored-background '(background intense))
+             ('intense-foreground '(intense))
+             ('intense-foreground-straight-underline '(intense 
straight-underline))
+             ('subtle-foreground '(text-also))
+             ('subtle-foreground-straight-underline '(text-also 
straight-underline))
+             ('straight-underline '(straight-underline))))))
+    (list :underline
+          (list :color
+                underline
+                :style
+                (if (memq 'straight-underline modus-themes-lang-checkers)
+                    'line 'wave))
+          :background
+          (cond
+           ((and (memq 'background modus-themes-lang-checkers)
+                 (memq 'intense modus-themes-lang-checkers))
+            intensebg)
+           ((memq 'background modus-themes-lang-checkers)
+            subtlebg))
+          :foreground
+          (cond
+           ((and (memq 'background modus-themes-lang-checkers)
+                 (memq 'intense modus-themes-lang-checkers))
+            intensefg-alt)
+           ((memq 'intense modus-themes-lang-checkers)
+            intensefg)
+           ((memq 'text-also modus-themes-lang-checkers)
+            subtlefg)))))
+
+(defun modus-themes--prompt (mainfg intensefg grayfg subtlebg intensebg 
intensebg-fg subtlebggray intensebggray)
+  "Conditional use of colors for prompts.
+MAINFG is the prompt's standard foreground.  INTENSEFG is a more
+prominent alternative to the main foreground, while GRAYFG is a
+less luminant shade of gray.
+
+SUBTLEBG is a subtle accented background that works with either
+MAINFG or INTENSEFG.
+
+INTENSEBG is a more pronounced accented background color that
+should be combinable with INTENSEBG-FG.
+
+SUBTLEBGGRAY and INTENSEBGGRAY are background values.  The former
+can be combined with GRAYFG, while the latter only works with the
+theme's fallback text color."
+  (let ((modus-themes-prompts
+         (if (listp modus-themes-prompts)
+             modus-themes-prompts
+           ;; translation layer for legacy values
+           (pcase modus-themes-prompts
+             ;; `subtle' is the same as `subtle-accented', while `intense' is
+             ;; equal to `intense-accented' for backward compatibility
+             ('subtle '(background))
+             ('subtle-accented '(background))
+             ('subtle-gray '(background gray))
+             ('intense '(background intense))
+             ('intense-accented '(background intense))
+             ('intense-gray '(background intense gray))))))
+    (list :foreground
+          (cond
+           ((and (memq 'gray modus-themes-prompts)
+                 (memq 'intense modus-themes-prompts))
+            'unspecified)
+           ((memq 'gray modus-themes-prompts)
+            grayfg)
+           ((and (memq 'background modus-themes-prompts)
+                 (memq 'intense modus-themes-prompts))
+            intensebg-fg)
+           ((memq 'intense modus-themes-prompts)
+            intensefg)
+           (mainfg))
+          :background
+          (cond
+           ((and (memq 'gray modus-themes-prompts)
+                 (memq 'background modus-themes-prompts)
+                 (memq 'intense modus-themes-prompts))
+            intensebggray)
+           ((and (memq 'gray modus-themes-prompts)
+                 (memq 'background modus-themes-prompts))
+            subtlebggray)
+           ((and (memq 'background modus-themes-prompts)
+                 (memq 'intense modus-themes-prompts))
+            intensebg)
+           ((memq 'background modus-themes-prompts)
+            subtlebg)
+           ('unspecified))
+          :inherit
+          (cond
+           ((and (memq 'bold modus-themes-prompts)
+                 (memq 'italic modus-themes-prompts))
+            'bold-italic)
+           ((memq 'italic modus-themes-prompts)
+            'italic)
+           ((memq 'bold modus-themes-prompts)
+            'bold)
+           ('unspecified)))))
 
 (defun modus-themes--paren (normalbg intensebg)
   "Conditional use of intense colors for matching parentheses.
@@ -2556,127 +3109,278 @@ NORMALBG should be the special palette color 
'bg-paren-match' or
 something similar.  INTENSEBG must be easier to discern next to
 other backgrounds, such as the special palette color
 'bg-paren-match-intense'."
-  (pcase modus-themes-paren-match
-    ('subtle-bold (list :inherit 'bold :background normalbg))
-    ('intense-bold (list :inherit 'bold :background intensebg))
-    ('intense (list :background intensebg))
-    (_ (list :background normalbg))))
+  (let ((modus-themes-paren-match
+         (if (listp modus-themes-paren-match)
+             modus-themes-paren-match
+           ;; translation layer for legacy values
+           (pcase modus-themes-paren-match
+             ;; `subtle' is the same as `subtle-accented', while `intense' is
+             ;; equal to `intense-accented' for backward compatibility
+             ('intense-bold '(intense bold))
+             ('subtle-bold '(bold))
+             ('intense '(intense))))))
+    (list :inherit
+          (if (memq 'bold modus-themes-paren-match)
+              'bold
+            'unspecified)
+          :background
+          (if (memq 'intense modus-themes-paren-match)
+              intensebg
+            normalbg)
+          :underline
+          (if (memq 'underline modus-themes-paren-match)
+              t
+            nil))))
 
 (defun modus-themes--syntax-foreground (fg faint)
   "Apply foreground value to code syntax.
 FG is the default.  FAINT is typically the same color in its
 desaturated version."
-  (pcase modus-themes-syntax
-    ('faint (list :foreground faint))
-    ('faint-yellow-comments (list :foreground faint))
-    (_ (list :foreground fg))))
-
-(defun modus-themes--syntax-extra (fg faint alt)
+  (let ((modus-themes-syntax
+         (if (listp modus-themes-syntax)
+             modus-themes-syntax
+           ;; translation layer for legacy values
+           (pcase modus-themes-syntax
+             ('faint '(faint))
+             ('faint-yellow-comments '(faint yellow-comments))
+             ('green-strings '(green-strings))
+             ('yellow-comments '(yellow-comments))
+             ('yellow-comments-green-strings '(green-strings yellow-comments))
+             ('alt-syntax '(alt-syntax))
+             ('alt-syntax-yellow-comments '(alt-syntax yellow-comments))))))
+    (list :foreground
+          (cond
+           ((memq 'faint modus-themes-syntax)
+            faint)
+           (fg)))))
+
+(defun modus-themes--syntax-extra (fg faint alt &optional faint-alt)
   "Apply foreground value to code syntax.
 FG is the default.  FAINT is typically the same color in its
-desaturated version.  ALT is another hue."
-  (pcase modus-themes-syntax
-    ('faint (list :foreground faint))
-    ('faint-yellow-comments (list :foreground faint))
-    ('alt-syntax (list :foreground alt))
-    ('alt-syntax-yellow-comments (list :foreground alt))
-    (_ (list :foreground fg))))
-
-(defun modus-themes--syntax-string (fg faint green alt)
-  "Apply foreground value to strings in code syntax.
-FG is the default.  FAINT is typically the same color in its
-desaturated version.  GREEN is a color variant in that side of
-the spectrum.  ALT is another hue."
-  (pcase modus-themes-syntax
-    ('faint (list :foreground faint))
-    ('faint-yellow-comments (list :foreground faint))
-    ('green-strings (list :foreground green))
-    ('yellow-comments-green-strings (list :foreground alt))
-    ('alt-syntax (list :foreground alt))
-    ('alt-syntax-yellow-comments (list :foreground alt))
-    (_ (list :foreground fg))))
-
-(defun modus-themes--syntax-docstring (fg faint green alt)
+desaturated version.  ALT is another hue while optional FAINT-ALT
+is its subtle alternative."
+  (let ((modus-themes-syntax
+         (if (listp modus-themes-syntax)
+             modus-themes-syntax
+           ;; translation layer for legacy values
+           (pcase modus-themes-syntax
+             ('faint '(faint))
+             ('faint-yellow-comments '(faint yellow-comments))
+             ('green-strings '(green-strings))
+             ('yellow-comments '(yellow-comments))
+             ('yellow-comments-green-strings '(green-strings yellow-comments))
+             ('alt-syntax '(alt-syntax))
+             ('alt-syntax-yellow-comments '(alt-syntax yellow-comments))))))
+    (list :foreground
+          (cond
+           ((and (memq 'alt-syntax modus-themes-syntax)
+                 (memq 'faint modus-themes-syntax))
+            (or faint-alt alt))
+           ((memq 'faint modus-themes-syntax)
+            faint)
+           ((memq 'alt-syntax modus-themes-syntax)
+            alt)
+           (fg)))))
+
+(defun modus-themes--syntax-string (fg faint green alt &optional faint-green 
faint-alt)
   "Apply foreground value to strings in code syntax.
 FG is the default.  FAINT is typically the same color in its
 desaturated version.  GREEN is a color variant in that side of
-the spectrum.  ALT is another hue."
-  (pcase modus-themes-syntax
-    ('faint (list :foreground faint))
-    ('faint-yellow-comments (list :foreground faint))
-    ('green-strings (list :foreground green))
-    ('yellow-comments-green-strings (list :foreground green))
-    ('alt-syntax (list :foreground alt))
-    ('alt-syntax-yellow-comments (list :foreground alt))
-    (_ (list :foreground fg))))
-
-(defun modus-themes--syntax-comment (fg yellow)
+the spectrum.  ALT is another hue.  Optional FAINT-GREEN is a
+subtle alternative to GREEN.  Optional FAINT-ALT is a subtle
+alternative to ALT."
+  (let ((modus-themes-syntax
+         (if (listp modus-themes-syntax)
+             modus-themes-syntax
+           ;; translation layer for legacy values
+           (pcase modus-themes-syntax
+             ('faint '(faint))
+             ('faint-yellow-comments '(faint yellow-comments))
+             ('green-strings '(green-strings))
+             ('yellow-comments '(yellow-comments))
+             ('yellow-comments-green-strings '(green-strings yellow-comments))
+             ('alt-syntax '(alt-syntax))
+             ('alt-syntax-yellow-comments '(alt-syntax yellow-comments))))))
+    (list :foreground
+          (cond
+           ((and (memq 'faint modus-themes-syntax)
+                 (memq 'green-strings modus-themes-syntax))
+            (or faint-green green))
+           ((and (memq 'alt-syntax modus-themes-syntax)
+                 (memq 'faint modus-themes-syntax))
+            (or faint-alt faint))
+           ((memq 'faint modus-themes-syntax)
+            faint)
+           ((memq 'green-strings modus-themes-syntax)
+            green)
+           ((memq 'alt-syntax modus-themes-syntax)
+            alt)
+           (fg)))))
+
+(defun modus-themes--syntax-comment (fg yellow &optional faint-yellow faint)
   "Apply foreground value to strings in code syntax.
-FG is the default.  YELLOW is a color variant of that name."
-  (pcase modus-themes-syntax
-    ('yellow-comments (list :foreground yellow))
-    ('yellow-comments-green-strings (list :foreground yellow))
-    ('alt-syntax-yellow-comments (list :foreground yellow))
-    ('faint-yellow-comments (list :foreground yellow))
-    (_ (list :foreground fg))))
-
-(defun modus-themes--heading-p (key)
-  "Query style of KEY in `modus-themes-headings'."
-  (cdr (assoc key modus-themes-headings)))
-
-(defun modus-themes--heading (level fg fg-alt bg border)
+FG is the default.  YELLOW is a color variant of that name while
+optional FAINT-YELLOW is its subtle variant.  Optional FAINT is
+an alternative to the default value."
+  (let ((modus-themes-syntax
+         (if (listp modus-themes-syntax)
+             modus-themes-syntax
+           ;; translation layer for legacy values
+           (pcase modus-themes-syntax
+             ('faint '(faint))
+             ('faint-yellow-comments '(faint yellow-comments))
+             ('green-strings '(green-strings))
+             ('yellow-comments '(yellow-comments))
+             ('yellow-comments-green-strings '(green-strings yellow-comments))
+             ('alt-syntax '(alt-syntax))
+             ('alt-syntax-yellow-comments '(alt-syntax yellow-comments))))))
+    (list :foreground
+          (cond
+           ((and (memq 'faint modus-themes-syntax)
+                 (memq 'yellow-comments modus-themes-syntax))
+            (or faint-yellow yellow))
+           ((and (memq 'alt-syntax modus-themes-syntax)
+                 (memq 'yellow-comments modus-themes-syntax)
+                 (not (memq 'green-strings modus-themes-syntax)))
+            (or faint-yellow yellow))
+           ((memq 'yellow-comments modus-themes-syntax)
+            yellow)
+           ((memq 'faint modus-themes-syntax)
+            (or faint fg))
+           (fg)))))
+
+(defun modus-themes--key-cdr (key alist)
+  "Get cdr of KEY in ALIST."
+  (cdr (assoc key alist)))
+
+(defun modus-themes--heading (level fg fg-alt bg bg-gray border)
   "Conditional styles for `modus-themes-headings'.
 
 LEVEL is the heading's position in their order.  FG is the
 default text color.  FG-ALT is an accented, more saturated value
 than the default.  BG is a nuanced, typically accented,
 background that can work well with either of the foreground
-values.  BORDER is a color value that combines well with the
-background and alternative foreground."
-  (let* ((key (modus-themes--heading-p level))
-         (style (or key (modus-themes--heading-p t)))
-         (var (when modus-themes-variable-pitch-headings
-                'variable-pitch))
+values.  BG-GRAY is a gray background.  BORDER is a color value
+that combines well with the background and foreground."
+  (let* ((key (modus-themes--key-cdr level modus-themes-headings))
+         (style (or key (modus-themes--key-cdr t modus-themes-headings)))
+         (modus-themes-headings
+          (if (listp style)
+              style
+            ;; translation layer for legacy values
+            (pcase style
+              ('highlight '(background))
+              ('highlight-no-bold '(background no-bold))
+              ('line '(overline))
+              ('line-no-bold '(no-bold overline))
+              ('no-bold '(no-bold))
+              ('no-color '(monochrome))
+              ('no-color-no-bold '(no-bold monochrome))
+              ('rainbow '(rainbow))
+              ('rainbow-highlight '(rainbow background))
+              ('rainbow-highlight-no-bold '(no-bold rainbow background))
+              ('rainbow-line '(rainbow overline))
+              ('rainbow-no-bold '(no-bold rainbow))
+              ('rainbow-line-no-bold '(rainbow overline no-bold))
+              ('rainbow-section '(rainbow overline background))
+              ('rainbow-section-no-bold '(no-bold rainbow background overline))
+              ('section '(background overline))
+              ('section-no-bold '(background overline no-bold)))))
+         (var (if modus-themes-variable-pitch-headings
+                  'variable-pitch
+                'unspecified))
          (varbold (if var
                       (append (list 'bold) (list var))
                     'bold)))
-    (pcase style
-      ('no-bold
-       (list :inherit var :foreground fg))
-      ('no-color
-       (list :inherit varbold))
-      ('no-color-no-bold
-       (list :inherit var))
-      ('line
-       (list :inherit varbold :foreground fg :overline border))
-      ('line-no-bold
-       (list :inherit var :foreground fg :overline border))
-      ('rainbow
-       (list :inherit varbold :foreground fg-alt))
-      ('rainbow-no-bold
-       (list :inherit var :foreground fg-alt))
-      ('rainbow-line
-       (list :inherit varbold :foreground fg-alt :overline border))
-      ('rainbow-line-no-bold
-       (list :inherit var :foreground fg-alt :overline border))
-      ('highlight
-       (list :inherit varbold :background bg :foreground fg))
-      ('highlight-no-bold
-       (list :inherit var :background bg :foreground fg))
-      ('rainbow-highlight
-       (list :inherit varbold :background bg :foreground fg-alt))
-      ('rainbow-highlight-no-bold
-       (list :inherit var :background bg :foreground fg-alt))
-      ('section
-       (list :inherit varbold :background bg :foreground fg :overline border 
:extend t))
-      ('section-no-bold
-       (list :inherit var :background bg :foreground fg :overline border 
:extend t))
-      ('rainbow-section
-       (list :inherit varbold :background bg :foreground fg-alt :overline 
border :extend t))
-      ('rainbow-section-no-bold
-       (list :inherit var :background bg :foreground fg-alt :overline border 
:extend t))
-      (_
-       (list :inherit varbold :foreground fg)))))
+    (list :inherit
+          (cond
+           ((memq 'no-bold modus-themes-headings)
+            var)
+           (varbold))
+          :background
+          (cond
+           ((and (memq 'monochrome modus-themes-headings)
+                 (memq 'background modus-themes-headings))
+            bg-gray)
+           ((memq 'background modus-themes-headings)
+            bg)
+           ('unspecified))
+          :foreground
+          (cond
+           ((memq 'monochrome modus-themes-headings)
+            'unspecified)
+           ((memq 'rainbow modus-themes-headings)
+            fg-alt)
+           (fg))
+          :overline
+          (if (memq 'overline modus-themes-headings)
+              border
+            'unspecified))))
+
+(defun modus-themes--agenda-structure (fg)
+  "Control the style of the Org agenda structure.
+FG is the foreground color to use."
+  (let* ((properties (modus-themes--key-cdr 'header-block 
modus-themes-org-agenda))
+         (inherit (cond ((memq 'variable-pitch properties)
+                         (list 'bold 'variable-pitch))
+                        ('bold)))
+         (height (cond ((memq 'no-scale properties)
+                        1.0)
+                       ((memq 'scale-title properties)
+                        modus-themes-scale-title)
+                       (1.15))))
+    (list :inherit inherit
+          :height height
+          :foreground fg)))
+
+(defun modus-themes--agenda-date (defaultfg grayscalefg &optional bold 
workaholicfg grayscaleworkaholicfg)
+  "Control the style of date headings in Org agenda buffers.
+DEFAULTFG is the original accent color for the foreground.
+GRAYSCALEFG is a neutral color.  Optional BOLD applies a bold
+weight.  Optional WORKAHOLICFG and GRAYSCALEWORKAHOLICFG are
+alternative foreground colors."
+  (let* ((properties (modus-themes--key-cdr 'header-date 
modus-themes-org-agenda))
+         (weight (cond ((memq 'bold-all properties)
+                        'bold)
+                       ((and bold (memq 'bold-today properties))
+                        'bold)
+                       (t
+                        nil)))
+         (fg (cond ((and (memq 'grayscale properties)
+                         (memq 'workaholic properties))
+                    (or grayscaleworkaholicfg grayscalefg))
+                   ((memq 'grayscale properties)
+                    grayscalefg)
+                   ((memq 'workaholic properties)
+                    (or workaholicfg defaultfg))
+                   (t
+                    defaultfg))))
+    (list :inherit weight
+          :foreground fg)))
+
+(defun modus-themes--agenda-scheduled (defaultfg uniformfg rainbowfg)
+  "Control the style of the Org agenda scheduled tasks.
+DEFAULTFG is an accented foreground color that is meant to
+differentiate between past or present and future tasks.
+UNIFORMFG is a more subtle color that eliminates the color coding
+for scheduled tasks.  RAINBOWFG is a prominent accent value that
+clearly distinguishes past, present, future tasks."
+  (pcase (modus-themes--key-cdr 'scheduled modus-themes-org-agenda)
+    ('uniform (list :foreground uniformfg))
+    ('rainbow (list :foreground rainbowfg))
+    (_ (list :foreground defaultfg))))
+
+(defun modus-themes--agenda-habit (default traffic simple &optional 
traffic-deuteran)
+  "Specify background values for `modus-themes-org-agenda' habits.
+DEFAULT is the original foregrounc color.  TRAFFIC is to be used
+when the 'traffic-light' style is applied, while SIMPLE
+corresponds to the 'simplified style'.  Optional TRAFFIC-DEUTERAN
+is an alternative to TRAFFIC, meant for deuteranopia."
+  (pcase (modus-themes--key-cdr 'habit modus-themes-org-agenda)
+    ('traffic-light (list :background traffic))
+    ('traffic-light-deuteranopia (list :background (or traffic-deuteran 
traffic)))
+    ('simplified (list :background simple))
+    (_ (list :background default))))
 
 (defun modus-themes--org-block (bgblk fgdefault &optional fgblk)
   "Conditionally set the background of Org blocks.
@@ -2715,15 +3419,6 @@ set to `rainbow'."
     ('rainbow (list :background bgaccent :foreground fgaccent))
     (_ (list :background bg :foreground fg))))
 
-(defun modus-themes--org-habit (default &optional traffic simple)
-  "Specify background values for `modus-themes-org-habit'.
-If no optional TRAFFIC argument is supplied, the DEFAULT is used
-instead.  Same for SIMPLE."
-  (pcase modus-themes-org-habit
-    ('traffic-light (list :background (or traffic default)))
-    ('simplified (list :background (or simple default)))
-    (_ (list :background default))))
-
 (defun modus-themes--mode-line-attrs
     (fg bg fg-alt bg-alt fg-accent bg-accent border border-3d &optional 
alt-style border-width fg-distant)
   "Color combinations for `modus-themes-mode-line'.
@@ -2743,51 +3438,60 @@ rectangle that produces the box effect.
 Optional FG-DISTANT should be close to the main background
 values.  It is intended to be used as a distant-foreground
 property."
-  (pcase modus-themes-mode-line
-    ('3d
-     `( :background ,bg-alt :foreground ,fg-alt
-        :box ( :line-width ,(or border-width 1)
-               :color ,border-3d
-               :style ,(and alt-style 'released-button))))
-    ('moody
-     `( :background ,bg-alt :foreground ,fg-alt
-        :underline ,border :overline ,border
-        :distant-foreground ,fg-distant))
-    ('borderless
-     `(:background ,bg :foreground ,fg :box ,bg))
-    ('borderless-3d
-     `( :background ,bg :foreground ,fg
-        :box ( :line-width ,(or border-width 1)
-               :color ,bg
-               :style ,(and alt-style 'released-button))))
-    ('borderless-moody
-     `( :background ,bg :foreground ,fg
-        :underline ,bg :overline ,bg
-        :distant-foreground ,fg-distant))
-    ('accented
-     `(:background ,bg-accent :foreground ,fg-accent :box ,border))
-    ('accented-3d
-     `( :background ,bg-accent :foreground ,fg-accent
-        :box ( :line-width ,(or border-width 1)
-               :color ,border-3d
-               :style ,(and alt-style 'released-button))))
-    ('accented-moody
-     `( :background ,bg-accent :foreground ,fg-accent
-        :underline ,border :overline ,border
-        :distant-foreground ,fg-distant))
-    ('borderless-accented
-     `(:background ,bg-accent :foreground ,fg-accent :box ,bg-accent))
-    ('borderless-accented-3d
-     `( :background ,bg-accent :foreground ,fg-accent
-        :box ( :line-width ,(or border-width 1)
-               :color ,bg-accent
-               :style ,(and alt-style 'released-button))))
-    ('borderless-accented-moody
-     `( :background ,bg-accent :foreground ,fg-accent
-        :underline ,bg-accent :overline ,bg-accent
-        :distant-foreground ,fg-distant))
-    (_
-     `(:background ,bg :foreground ,fg :box ,border))))
+  (let ((modus-themes-mode-line
+         (if (listp modus-themes-mode-line)
+             modus-themes-mode-line
+           ;; translation layer for legacy values
+           (alist-get modus-themes-mode-line
+                      '((3d . (3d))
+                        (moody . (moody))
+                        (borderless . (borderless))
+                        (borderless-3d . (borderless 3d))
+                        (borderless-moody . (borderless moody))
+                        (accented . (accented))
+                        (accented-3d . (accented 3d))
+                        (accented-moody . (accented moody))
+                        (borderless-accented . (borderless accented))
+                        (borderless-accented-3d . (borderless accented 3d))
+                        (borderless-accented-moody . (borderless accented 
moody)))))))
+    (let ((base (cond ((memq 'accented modus-themes-mode-line)
+                       (cons fg-accent bg-accent))
+                      ((and (or (memq 'moody modus-themes-mode-line)
+                                (memq '3d modus-themes-mode-line))
+                            (not (memq 'borderless modus-themes-mode-line)))
+                       (cons fg-alt bg-alt))
+                      ((cons fg bg))))
+          (box (cond ((memq 'moody modus-themes-mode-line)
+                      nil)
+                     ((memq '3d modus-themes-mode-line)
+                      (list :line-width (or border-width 1)
+                            :color
+                            (cond ((and (memq 'accented modus-themes-mode-line)
+                                        (memq 'borderless 
modus-themes-mode-line))
+                                   bg-accent)
+                                  ((memq 'borderless modus-themes-mode-line) 
bg)
+                                  (border-3d))
+                            :style (and alt-style 'released-button)))
+                     ((or (memq 'borderless modus-themes-mode-line)
+                          (memq 'moody modus-themes-mode-line))
+                      bg)
+                     (border)))
+          (line (cond ((not (memq 'moody modus-themes-mode-line))
+                       nil)
+                      ((and (memq 'borderless modus-themes-mode-line)
+                            (memq 'accented modus-themes-mode-line))
+                       bg-accent)
+                      ((memq 'borderless modus-themes-mode-line)
+                       bg)
+                      (border))))
+      (list :foreground (car base)
+            :background (cdr base)
+            :box box
+            :overline line
+            :underline line
+            :distant-foreground
+            (and (memq 'moody modus-themes-mode-line)
+                 fg-distant)))))
 
 (defun modus-themes--diff
     (fg-only-bg fg-only-fg mainbg mainfg altbg altfg &optional deuteranbg 
deuteranfg  bg-only-fg)
@@ -2867,30 +3571,85 @@ These are intended for Helm, Ivy, etc."
     ('moderate (list :inherit (list subtleface bold)))
     (_ (list :inherit (list intenseface bold)))))
 
-(defun modus-themes--link (fg fgfaint underline)
+(defun modus-themes--link (fg fgfaint underline bg bgneutral)
   "Conditional application of link styles.
 FG is the link's default color for its text and underline
 property.  FGFAINT is a desaturated color for the text and
-underline.  UNDERLINE is a gray color only for the undeline."
-  (pcase modus-themes-links
-    ('faint (list :foreground fgfaint :underline t))
-    ('neutral-underline (list :foreground fg :underline underline))
-    ('faint-neutral-underline (list :foreground fgfaint :underline underline))
-    ('no-underline (list :foreground fg :underline nil))
-    ('underline-only (list :underline t))
-    ('neutral-underline-only (list :underline underline))
-    (_ (list :foreground fg :underline t))))
+underline.  UNDERLINE is a gray color only for the undeline.  BG
+is a background color and BGNEUTRAL is its fallback value."
+  (let ((modus-themes-links
+         (if (listp modus-themes-links)
+             modus-themes-links
+           ;; translation layer for legacy values
+           (pcase modus-themes-links
+             ('faint '(faint))
+             ('neutral-underline '(neutral-underline))
+             ('faint-neutral-underline '(neutral-underline faint))
+             ('no-underline '(no-underline))
+             ('underline-only '(no-color))
+             ('neutral-underline-only '(no-color neutral-underline))))))
+    (list :inherit
+          (cond
+           ((and (memq 'bold modus-themes-links)
+                 (memq 'italic modus-themes-links))
+            'bold-italic)
+           ((memq 'italic modus-themes-links)
+            'italic)
+           ((memq 'bold modus-themes-links)
+            'bold)
+           ('unspecified))
+          :background
+          (cond
+           ((and (memq 'no-color modus-themes-links)
+                 (memq 'no-underline modus-themes-links))
+            bgneutral)
+           ((memq 'background modus-themes-links)
+            bg)
+           ('unspecified))
+          :foreground
+          (cond
+           ((memq 'no-color modus-themes-links)
+            'unspecified)
+           ((memq 'faint modus-themes-links)
+            fgfaint)
+           (fg))
+          :underline
+          (cond
+           ((memq 'no-underline modus-themes-links)
+            'unspecified)
+           ((memq 'neutral-underline modus-themes-links)
+            underline)
+           (t)))))
 
 (defun modus-themes--link-color (fg fgfaint &optional neutralfg)
   "Extends `modus-themes--link'.
 FG is the main accented foreground.  FGFAINT is also accented,
 yet desaturated.  Optional NEUTRALFG is a gray value."
-  (pcase modus-themes-links
-    ('faint (list :foreground fgfaint))
-    ('faint-neutral-underline (list :foreground fgfaint))
-    ('underline-only (list :underline t :foreground (or neutralfg 
'unspecified)))
-    ('neutral-underline-only (list :underline 'unspecified :foreground (or 
neutralfg 'unspecified)))
-    (_ (list :foreground fg))))
+  (let ((modus-themes-links
+         (if (listp modus-themes-links)
+             modus-themes-links
+           ;; translation layer for legacy values
+           (pcase modus-themes-links
+             ('faint '(faint))
+             ('neutral-underline '(neutral-underline))
+             ('faint-neutral-underline '(neutral-underline faint))
+             ('no-underline '(no-underline))
+             ('underline-only '(no-color))
+             ('neutral-underline-only '(no-color neutral-underline))))))
+    (list :foreground
+          (cond
+           ((memq 'no-color modus-themes-links)
+            (or neutralfg 'unspecified))
+           ((memq 'faint modus-themes-links)
+            fgfaint)
+           (fg))
+          :underline
+          (cond
+           ((memq 'no-underline modus-themes-links)
+            'unspecified)
+           ((memq 'neutral-underline modus-themes-links)
+            (or neutralfg 'unspecified))
+           (t)))))
 
 (defun modus-themes--scale (amount)
   "Scale heading by AMOUNT.
@@ -2898,39 +3657,96 @@ AMOUNT is a customization option."
   (when modus-themes-scale-headings
     (list :height amount)))
 
-(defun modus-themes--region (bg fg bgsubtle bgaccent)
+(defun modus-themes--region (bg fg bgsubtle bgaccent bgaccentsubtle)
   "Apply `modus-themes-region' styles.
 
 BG and FG are the main values that are used by default.  BGSUBTLE
 is a subtle background value that can be combined with all colors
 used to fontify text and code syntax.  BGACCENT is a colored
-background that combines well with FG."
-  (pcase modus-themes-region
-    ('bg-only (list :background bgsubtle))
-    ('bg-only-no-extend (list :background bgsubtle :extend nil))
-    ('no-extend (list :background bg :foreground fg :extend nil))
-    ('accent (list :background bgaccent :foreground fg))
-    ('accent-no-extend (list :background bgaccent :foreground fg :extend nil))
-    (_ (list :background bg :foreground fg))))
-
-(defun modus-themes--hl-line (bgdefault bgintense bgaccent bgaccentul 
lineneutral lineaccent)
+background that combines well with FG.  BGACCENTSUBTLE can be
+combined with all colors used to fontify text."
+  (let ((modus-themes-region
+         (if (listp modus-themes-region)
+             modus-themes-region
+           ;; translation layer for legacy values
+           (pcase modus-themes-region
+             ('bg-only '(bg-only))
+             ('bg-only-no-extend '(bg-only no-extend))
+             ('accent '(accented))
+             ('accent-no-extend '(accented no-extend))
+             ('no-extend '(no-extend))))))
+    (list :background
+          (cond
+           ((and (memq 'accented modus-themes-region)
+                 (memq 'bg-only modus-themes-region))
+            bgaccentsubtle)
+           ((memq 'accented modus-themes-region)
+            bgaccent)
+           ((memq 'bg-only modus-themes-region)
+            bgsubtle)
+           (bg))
+          :foreground
+          (cond
+           ((and (memq 'accented modus-themes-region)
+                 (memq 'bg-only modus-themes-region))
+            'unspecified)
+           ((memq 'bg-only modus-themes-region)
+            'unspecified)
+           (fg))
+          :extend
+          (cond
+           ((memq 'no-extend modus-themes-region)
+            nil)
+           (t)))))
+
+(defun modus-themes--hl-line
+    (bgdefault bgintense bgaccent bgaccentsubtle lineneutral lineaccent 
lineneutralintense lineaccentintense)
   "Apply `modus-themes-hl-line' styles.
 
 BGDEFAULT is a subtle neutral background.  BGINTENSE is like the
 default, but more prominent.  BGACCENT is a prominent accented
-background, while BGACCENTUL is more subtle and is meant to be
-used in tandem with an underline.  LINENEUTRAL and LINEACCENT are
-a color values that can remain distinct against the buffer's
-possible backgrounds: the former is neutral, the latter is
-accented."
-  (pcase modus-themes-hl-line
-    ('intense-background (list :background bgintense))
-    ('accented-background (list :background bgaccent))
-    ('underline-neutral (list :background bgdefault :underline lineneutral))
-    ('underline-accented (list :background bgaccentul :underline lineaccent))
-    ('underline-only-neutral (list :background 'unspecified :underline 
lineneutral))
-    ('underline-only-accented (list :background 'unspecified :underline 
lineaccent))
-    (_ (list :background bgdefault))))
+background, while BGACCENTSUBTLE is more subtle.  LINENEUTRAL and
+LINEACCENT are color values that can remain distinct against the
+buffer's possible backgrounds: the former is neutral, the latter
+is accented.  LINENEUTRALINTENSE and LINEACCENTINTENSE are their
+more prominent alternatives."
+  (let ((modus-themes-hl-line
+         (if (listp modus-themes-hl-line)
+             modus-themes-hl-line
+           ;; translation layer for legacy values
+           (pcase modus-themes-hl-line
+             ('intense-background '(intense))
+             ('accented-background '(accented))
+             ('underline-neutral '(underline))
+             ('underline-accented '(underline accented))
+             ('underline-only-neutral '(underline)) ; only underline styles 
have been removed
+             ('underline-only-accented '(underline accented))))))
+    (list :background
+          (cond
+           ((and (memq 'intense modus-themes-hl-line)
+                 (memq 'accented modus-themes-hl-line))
+            bgaccent)
+           ((memq 'accented modus-themes-hl-line)
+            bgaccentsubtle)
+           ((memq 'intense modus-themes-hl-line)
+            bgintense)
+           (bgdefault))
+          :underline
+          (cond
+           ((and (memq 'intense modus-themes-hl-line)
+                 (memq 'accented modus-themes-hl-line)
+                 (memq 'underline modus-themes-hl-line))
+            lineaccentintense)
+           ((and (memq 'accented modus-themes-hl-line)
+                 (memq 'underline modus-themes-hl-line))
+            lineaccent)
+           ((and (memq 'intense modus-themes-hl-line)
+                 (memq 'underline modus-themes-hl-line))
+            lineneutralintense)
+           ((or (memq 'no-background modus-themes-hl-line)
+                (memq 'underline modus-themes-hl-line))
+            lineneutral)
+           ('unspecified)))))
 
 (defun modus-themes--mail-cite (mainfg subtlefg)
   "Combinations for `modus-themes-mail-citations'.
@@ -3226,32 +4042,40 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     ;; styles for regular headings used in Org, Markdown, Info, etc.
     `(modus-themes-heading-1
       ((,class ,@(modus-themes--heading
-                  1 fg-main magenta-alt-other magenta-nuanced-bg bg-region)
+                  1 fg-main magenta-alt-other
+                  magenta-nuanced-bg bg-alt bg-region)
                ,@(modus-themes--scale modus-themes-scale-4))))
     `(modus-themes-heading-2
       ((,class ,@(modus-themes--heading
-                  2 fg-special-warm magenta-alt red-nuanced-bg bg-region)
+                  2 fg-special-warm magenta-alt
+                  red-nuanced-bg bg-alt bg-region)
                ,@(modus-themes--scale modus-themes-scale-3))))
     `(modus-themes-heading-3
       ((,class ,@(modus-themes--heading
-                  3 fg-special-cold blue blue-nuanced-bg bg-region)
+                  3 fg-special-cold blue
+                  blue-nuanced-bg bg-alt bg-region)
                ,@(modus-themes--scale modus-themes-scale-2))))
     `(modus-themes-heading-4
       ((,class ,@(modus-themes--heading
-                  4 fg-special-mild cyan cyan-nuanced-bg bg-region)
+                  4 fg-special-mild cyan
+                  cyan-nuanced-bg bg-alt bg-region)
                ,@(modus-themes--scale modus-themes-scale-1))))
     `(modus-themes-heading-5
       ((,class ,@(modus-themes--heading
-                  5 fg-special-calm green-alt-other green-nuanced-bg 
bg-region))))
+                  5 fg-special-calm green-alt-other
+                  green-nuanced-bg bg-alt bg-region))))
     `(modus-themes-heading-6
       ((,class ,@(modus-themes--heading
-                  6 yellow-nuanced-fg yellow-alt-other yellow-nuanced-bg 
bg-region))))
+                  6 yellow-nuanced-fg yellow-alt-other
+                  yellow-nuanced-bg bg-alt bg-region))))
     `(modus-themes-heading-7
       ((,class ,@(modus-themes--heading
-                  7 red-nuanced-fg red-alt red-nuanced-bg bg-region))))
+                  7 red-nuanced-fg red-alt
+                  red-nuanced-bg bg-alt bg-region))))
     `(modus-themes-heading-8
       ((,class ,@(modus-themes--heading
-                  8 magenta-nuanced-fg magenta bg-alt bg-region))))
+                  8 magenta-nuanced-fg magenta
+                  bg-alt bg-alt bg-region))))
 ;;;;; graph-specific faces
     `(modus-themes-graph-red-0 ((,class :background ,red-graph-0-bg)))
     `(modus-themes-graph-red-1 ((,class :background ,red-graph-1-bg)))
@@ -3267,25 +4091,27 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(modus-themes-graph-cyan-1 ((,class :background ,cyan-graph-1-bg)))
 ;;;;; language checkers
     `(modus-themes-lang-error ((,class ,@(modus-themes--lang-check
-                                          fg-lang-underline-error
-                                          fg-lang-error
-                                          red red-nuanced-bg))))
+                                          fg-lang-underline-error fg-lang-error
+                                          red red-refine-fg red-nuanced-bg 
red-refine-bg))))
     `(modus-themes-lang-note ((,class ,@(modus-themes--lang-check
-                                         fg-lang-underline-note
-                                         fg-lang-note
-                                         blue-alt blue-nuanced-bg))))
+                                         fg-lang-underline-note fg-lang-note
+                                         blue-alt blue-refine-fg 
blue-nuanced-bg blue-refine-bg))))
     `(modus-themes-lang-warning ((,class ,@(modus-themes--lang-check
-                                            fg-lang-underline-warning
-                                            fg-lang-warning
-                                            yellow yellow-nuanced-bg))))
+                                            fg-lang-underline-warning 
fg-lang-warning
+                                            yellow yellow-refine-fg 
yellow-nuanced-bg yellow-refine-bg))))
 ;;;;; other custom faces
     `(modus-themes-bold ((,class ,@(modus-themes--bold-weight))))
     `(modus-themes-hl-line ((,class ,@(modus-themes--hl-line
                                        bg-hl-line bg-hl-line-intense
                                        bg-hl-line-intense-accent 
blue-nuanced-bg
-                                       bg-region blue-intense-bg)
+                                       bg-region blue-intense-bg
+                                       fg-alt cyan-intense)
                                     :extend t)))
     `(modus-themes-key-binding ((,class :inherit bold :foreground 
,blue-alt-other)))
+    `(modus-themes-prompt ((,class ,@(modus-themes--prompt
+                                      cyan-alt-other blue-alt-other fg-alt
+                                      cyan-nuanced-bg blue-refine-bg fg-main
+                                      bg-alt bg-active))))
     `(modus-themes-reset-hard ((,class :inherit (fixed-pitch 
modus-themes-reset-soft))))
     `(modus-themes-reset-soft ((,class :background ,bg-main :foreground 
,fg-main
                                        :weight normal :slant normal 
:strike-through nil
@@ -3301,6 +4127,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
                                                                    
green-active))))
     `(modus-themes-slant ((,class :inherit italic :slant 
,@(modus-themes--slant))))
     `(modus-themes-variable-pitch ((,class ,@(modus-themes--variable-pitch))))
+    `(modus-themes-fixed-pitch ((,class ,@(modus-themes--fixed-pitch))))
 ;;;; standard faces
 ;;;;; absolute essentials
     `(default ((,class :background ,bg-main :foreground ,fg-main)))
@@ -3313,11 +4140,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(bold-italic ((,class :inherit (bold italic))))
     `(buffer-menu-buffer ((,class :inherit bold)))
     `(comint-highlight-input ((,class :inherit bold)))
-    `(comint-highlight-prompt ((,class :inherit modus-themes-bold
-                                       ,@(modus-themes--prompt
-                                          cyan
-                                          blue-nuanced-bg blue-alt
-                                          blue-refine-bg fg-main))))
+    `(comint-highlight-prompt ((,class :inherit modus-themes-prompt)))
     `(error ((,class :inherit bold :foreground ,red)))
     `(escape-glyph ((,class :foreground ,fg-escape-char-construct)))
     `(file-name-shadow ((,class :foreground ,fg-unfocused)))
@@ -3332,15 +4155,14 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(italic ((,class :slant italic)))
     `(nobreak-hyphen ((,class :foreground ,fg-escape-char-construct)))
     `(nobreak-space ((,class :foreground ,fg-escape-char-construct :underline 
t)))
-    `(minibuffer-prompt ((,class ,@(modus-themes--prompt
-                                    cyan-alt-other
-                                    cyan-nuanced-bg cyan
-                                    cyan-refine-bg fg-main))))
+    `(minibuffer-prompt ((,class :inherit modus-themes-prompt)))
     `(mm-command-output ((,class :foreground ,red-alt-other)))
     `(mm-uu-extract ((,class :background ,bg-dim :foreground 
,fg-special-mild)))
-    `(next-error ((,class :inherit modus-themes-subtle-red)))
+    `(next-error ((,class :inherit modus-themes-subtle-red :extend t)))
     `(rectangle-preview ((,class :inherit modus-themes-special-mild)))
-    `(region ((,class ,@(modus-themes--region bg-region fg-main 
bg-hl-alt-intense bg-region-accent))))
+    `(region ((,class ,@(modus-themes--region bg-region fg-main
+                                              bg-hl-alt-intense 
bg-region-accent
+                                              bg-region-accent-subtle))))
     `(secondary-selection ((,class :inherit modus-themes-special-cold)))
     `(shadow ((,class :foreground ,fg-alt)))
     `(success ((,class :inherit bold :foreground 
,@(modus-themes--success-deuteran blue green))))
@@ -3348,7 +4170,8 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(warning ((,class :inherit bold :foreground ,yellow)))
 ;;;;; buttons, links, widgets
     `(button ((,class ,@(modus-themes--link
-                         blue-alt-other blue-alt-other-faint bg-region))))
+                         blue-alt-other blue-alt-other-faint
+                         bg-region blue-nuanced-bg bg-alt))))
     `(link ((,class :inherit button)))
     `(link-visited ((,class :inherit button
                             ,@(modus-themes--link-color
@@ -3358,7 +4181,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(widget-button-pressed ((,class :inherit widget-button :foreground 
,magenta)))
     `(widget-documentation ((,class :foreground ,green)))
     `(widget-field ((,class :background ,bg-alt :foreground ,fg-dim)))
-    `(widget-inactive ((,class :background ,bg-inactive :foreground 
,fg-inactive)))
+    `(widget-inactive ((,class :foreground ,fg-alt)))
     `(widget-single-line-field ((,class :inherit widget-field)))
 ;;;;; ag
     `(ag-hit-face ((,class :foreground ,fg-special-cold)))
@@ -3419,21 +4242,24 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(anzu-replace-highlight ((,class :inherit modus-themes-refine-yellow 
:underline t)))
     `(anzu-replace-to ((,class :inherit (modus-themes-search-success bold))))
 ;;;;; apropos
+    `(apropos-button ((,class :inherit button
+                              ,@(modus-themes--link-color
+                                 magenta-alt-other magenta-alt-other-faint))))
     `(apropos-function-button ((,class :inherit button
                                        ,@(modus-themes--link-color
-                                          magenta-alt-other 
magenta-alt-other-faint))))
+                                          magenta magenta-faint))))
     `(apropos-keybinding ((,class :inherit modus-themes-key-binding)))
     `(apropos-misc-button ((,class :inherit button
                                    ,@(modus-themes--link-color
                                       cyan-alt-other cyan-alt-other-faint))))
     `(apropos-property ((,class :inherit modus-themes-bold :foreground 
,magenta-alt)))
-    `(apropos-symbol ((,class :inherit modus-themes-bold :foreground 
,magenta)))
+    `(apropos-symbol ((,class :inherit modus-themes-pseudo-header)))
     `(apropos-user-option-button ((,class :inherit button
                                           ,@(modus-themes--link-color
-                                             green-alt-other 
green-alt-other-faint))))
+                                             cyan cyan-faint))))
     `(apropos-variable-button ((,class :inherit button
                                        ,@(modus-themes--link-color
-                                          blue blue-faint))))
+                                          blue-alt blue-alt-faint))))
 ;;;;; apt-sources-list
     `(apt-sources-list-components ((,class :foreground ,cyan)))
     `(apt-sources-list-options ((,class :foreground ,yellow)))
@@ -3546,7 +4372,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(calendar-month-header ((,class :inherit modus-themes-pseudo-header)))
     `(calendar-today ((,class :inherit bold :underline t)))
     `(calendar-weekday-header ((,class :foreground ,fg-unfocused)))
-    `(calendar-weekend-header ((,class :foreground ,fg-unfocused)))
+    `(calendar-weekend-header ((,class :foreground ,red-faint)))
     `(diary ((,class :background ,blue-nuanced-bg :foreground 
,blue-alt-other)))
     `(diary-anniversary ((,class :foreground ,red-alt-other)))
     `(diary-time ((,class :foreground ,cyan)))
@@ -3566,7 +4392,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(cfw:face-sunday ((,class :inherit bold :foreground ,cyan-alt-other)))
     `(cfw:face-title ((,class :inherit modus-themes-variable-pitch
                               :foreground ,fg-special-cold
-                              ,@(modus-themes--scale modus-themes-scale-5))))
+                              ,@(modus-themes--scale 
modus-themes-scale-title))))
     `(cfw:face-today ((,class :background ,bg-inactive)))
     `(cfw:face-today-title ((,class :background ,bg-active)))
     `(cfw:face-toolbar ((,class :background ,bg-alt :foreground ,bg-alt)))
@@ -3618,7 +4444,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(cider-instrumented-face ((,class :box (:line-width -1 :color ,red :style 
nil) :background ,bg-dim)))
     `(cider-reader-conditional-face ((,class :inherit italic :foreground 
,fg-special-warm)))
     `(cider-repl-input-face ((,class :inherit bold)))
-    `(cider-repl-prompt-face ((,class :inherit comint-highlight-prompt)))
+    `(cider-repl-prompt-face ((,class :inherit modus-themes-prompt)))
     `(cider-repl-stderr-face ((,class :inherit bold :foreground ,red)))
     `(cider-repl-stdout-face ((,class :foreground ,blue)))
     `(cider-result-overlay-face ((,class :box (:line-width -1 :color ,blue 
:style nil) :background ,bg-dim)))
@@ -3642,7 +4468,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
 ;;;;; circe (and lui)
     `(circe-fool-face ((,class :inherit shadow)))
     `(circe-highlight-nick-face ((,class :inherit bold :foreground ,blue)))
-    `(circe-prompt-face ((,class :inherit comint-highlight-prompt)))
+    `(circe-prompt-face ((,class :inherit modus-themes-prompt)))
     `(circe-server-face ((,class :foreground ,fg-unfocused)))
     `(lui-button-face ((,class :inherit button)))
     `(lui-highlight-face ((,class :foreground ,magenta-alt)))
@@ -3755,6 +4581,9 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(cperl-nonoverridable-face ((,class :foreground unspecified)))
     `(cperl-array-face ((,class :inherit font-lock-keyword-face)))
     `(cperl-hash-face ((,class :inherit font-lock-variable-name-face)))
+;;;;; css-mode
+    `(css-property ((,class :inherit font-lock-type-face)))
+    `(css-selector ((,class :inherit font-lock-keyword-face)))
 ;;;;; csv-mode
     `(csv-separator-face ((,class :foreground ,red-intense)))
 ;;;;; ctrlf
@@ -3851,7 +4680,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
 ;;;;; diff-mode
     `(diff-added ((,class :inherit modus-themes-diff-added)))
     `(diff-changed ((,class :inherit modus-themes-diff-changed :extend t)))
-    `(diff-context ((,class :foreground ,fg-alt)))
+    `(diff-context ((,class ,@(unless (eq modus-themes-diffs 'bg-only) (list 
:foreground fg-unfocused)))))
     `(diff-error ((,class :inherit modus-themes-intense-red)))
     `(diff-file-header ((,class :inherit (bold diff-header))))
     `(diff-function ((,class :inherit modus-themes-diff-heading)))
@@ -4113,8 +4942,10 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
 ;;;;; embark
     `(embark-keybinding ((,class :inherit modus-themes-key-binding)))
 ;;;;; emms
-    `(emms-playlist-track-face ((,class :foreground ,blue)))
-    `(emms-playlist-selected-face ((,class :inherit bold :foreground 
,magenta)))
+    `(emms-playlist-track-face ((,class :foreground ,blue-alt)))
+    `(emms-playlist-selected-face ((,class :inherit bold :foreground 
,blue-alt-other)))
+    `(emms-metaplaylist-mode-current-face ((,class :inherit 
emms-playlist-selected-face)))
+    `(emms-metaplaylist-mode-face ((,class :foreground ,cyan)))
 ;;;;; enh-ruby-mode (enhanced-ruby-mode)
     `(enh-ruby-heredoc-delimiter-face ((,class :inherit 
font-lock-constant-face)))
     `(enh-ruby-op-face ((,class :foreground ,fg-main)))
@@ -4162,7 +4993,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(erc-nick-prefix-face ((,class :inherit erc-nick-default-face)))
     `(erc-notice-face ((,class :foreground ,fg-unfocused)))
     `(erc-pal-face ((,class :inherit bold :foreground ,red-alt)))
-    `(erc-prompt-face ((,class :inherit comint-highlight-prompt)))
+    `(erc-prompt-face ((,class :inherit modus-themes-prompt)))
     `(erc-timestamp-face ((,class :foreground ,blue-nuanced-fg)))
     `(erc-underline-face ((,class :underline t)))
     `(bg:erc-color-face0 ((,class :background "white")))
@@ -4215,7 +5046,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(eshell-ls-special ((,class :foreground ,magenta)))
     `(eshell-ls-symlink ((,class :foreground ,cyan)))
     `(eshell-ls-unreadable ((,class :background ,bg-inactive :foreground 
,fg-inactive)))
-    `(eshell-prompt ((,class :inherit comint-highlight-prompt)))
+    `(eshell-prompt ((,class :inherit modus-themes-prompt)))
 ;;;;; eshell-fringe-status
     `(eshell-fringe-status-failure ((,class :inherit error)))
     `(eshell-fringe-status-success ((,class :inherit success)))
@@ -4363,45 +5194,56 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
 ;;;;; font-lock
     `(font-lock-builtin-face ((,class :inherit modus-themes-bold
                                       ,@(modus-themes--syntax-extra
-                                         magenta-alt magenta-alt-faint 
blue-alt))))
+                                         magenta-alt magenta-alt-faint
+                                         magenta magenta-faint))))
     `(font-lock-comment-delimiter-face ((,class :inherit 
font-lock-comment-face)))
     `(font-lock-comment-face ((,class :inherit modus-themes-slant
                                       ,@(modus-themes--syntax-comment
-                                         fg-alt fg-comment-yellow))))
+                                         fg-alt fg-comment-yellow 
yellow-alt-other-faint))))
     `(font-lock-constant-face ((,class ,@(modus-themes--syntax-extra
-                                          blue-alt-other blue-alt-other-faint 
magenta-alt-other))))
+                                          blue-alt-other blue-alt-other-faint
+                                          magenta-alt-other 
magenta-alt-other-faint))))
     `(font-lock-doc-face ((,class :inherit modus-themes-slant
-                                  ,@(modus-themes--syntax-docstring
-                                     fg-docstring green-alt-other-faint
-                                     green-alt-other-faint 
magenta-nuanced-fg))))
+                                  ,@(modus-themes--syntax-string
+                                     fg-docstring fg-special-cold
+                                     fg-special-mild magenta-nuanced-fg
+                                     fg-special-mild magenta-nuanced-fg))))
     `(font-lock-function-name-face ((,class ,@(modus-themes--syntax-extra
-                                               magenta magenta-faint 
magenta-alt))))
+                                               magenta magenta-faint
+                                               magenta-alt 
magenta-alt-faint))))
     `(font-lock-keyword-face ((,class :inherit modus-themes-bold
                                       ,@(modus-themes--syntax-extra
-                                         magenta-alt-other 
magenta-alt-other-faint cyan-alt-other))))
+                                         magenta-alt-other 
magenta-alt-other-faint
+                                         cyan cyan-faint))))
     `(font-lock-negation-char-face ((,class :inherit modus-themes-bold
                                             ,@(modus-themes--syntax-foreground
                                                yellow yellow-faint))))
-    `(font-lock-preprocessor-face ((,class ,@(modus-themes--syntax-foreground
-                                              red-alt-other 
red-alt-other-faint))))
+    `(font-lock-preprocessor-face ((,class ,@(modus-themes--syntax-extra
+                                              red-alt-other red-alt-other-faint
+                                              blue-alt blue-alt-faint))))
     `(font-lock-regexp-grouping-backslash ((,class :inherit bold
                                                    
,@(modus-themes--syntax-string
                                                       fg-escape-char-backslash 
yellow-alt-faint
-                                                      magenta-alt-other 
blue-alt))))
+                                                      yellow magenta-alt
+                                                      yellow-faint 
red-faint))))
     `(font-lock-regexp-grouping-construct ((,class :inherit bold
                                                    
,@(modus-themes--syntax-string
                                                       fg-escape-char-construct 
red-alt-other-faint
-                                                      red magenta-alt))))
+                                                      blue blue-alt-other
+                                                      blue-faint 
blue-alt-other-faint))))
     `(font-lock-string-face ((,class ,@(modus-themes--syntax-string
-                                        blue-alt blue-alt-faint green 
green-alt))))
+                                        blue-alt blue-alt-faint
+                                        green red
+                                        green-faint red-faint))))
     `(font-lock-type-face ((,class :inherit modus-themes-bold
-                                   ,@(modus-themes--syntax-extra
-                                      cyan-alt-other cyan-alt-faint 
cyan-alt))))
+                                   ,@(modus-themes--syntax-foreground
+                                      cyan-alt-other cyan-alt-faint))))
     `(font-lock-variable-name-face ((,class ,@(modus-themes--syntax-extra
-                                               cyan cyan-faint 
blue-alt-faint))))
+                                               cyan cyan-faint
+                                               blue-alt-other 
blue-alt-other-faint))))
     `(font-lock-warning-face ((,class :inherit modus-themes-bold
-                                      ,@(modus-themes--syntax-foreground
-                                         yellow-active yellow-alt-faint))))
+                                      ,@(modus-themes--syntax-comment
+                                         yellow-active red-active red-faint 
yellow-faint))))
 ;;;;; forge
     `(forge-post-author ((,class :inherit bold :foreground ,fg-main)))
     `(forge-post-date ((,class :foreground ,fg-special-cold)))
@@ -4439,7 +5281,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(geiser-font-lock-image-button ((,class :inherit button :foreground 
,green-alt)))
     `(geiser-font-lock-repl-input ((,class :inherit bold)))
     `(geiser-font-lock-repl-output ((,class :inherit font-lock-keyword-face)))
-    `(geiser-font-lock-repl-prompt ((,class :inherit minibuffer-prompt)))
+    `(geiser-font-lock-repl-prompt ((,class :inherit modus-themes-prompt)))
     `(geiser-font-lock-xref-header ((,class :inherit bold)))
     `(geiser-font-lock-xref-link ((,class :inherit button)))
 ;;;;; git-commit
@@ -4580,7 +5422,13 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(gnus-summary-normal-ticked ((,class :foreground ,red-alt-other)))
     `(gnus-summary-normal-undownloaded ((,class :foreground ,yellow)))
     `(gnus-summary-normal-unread ((,class :foreground ,fg-main)))
-    `(gnus-summary-selected ((,class :inherit modus-themes-subtle-blue :extend 
t)))
+    `(gnus-summary-selected ((,class :inherit highlight :extend t)))
+;;;;; gotest
+    `(go-test--ok-face ((,class :inherit success)))
+    `(go-test--error-face ((,class :inherit error)))
+    `(go-test--warning-face ((,class :inherit warning)))
+    `(go-test--pointer-face ((,class :foreground ,magenta-alt-other)))
+    `(go-test--standard-face ((,class :foreground ,fg-special-cold)))
 ;;;;; golden-ratio-scroll-screen
     `(golden-ratio-scroll-highlight-line-face ((,class :background 
,cyan-subtle-bg :foreground ,fg-main)))
 ;;;;; helm
@@ -4681,7 +5529,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
                                   'modus-themes-subtle-cyan
                                   'modus-themes-nuanced-cyan
                                   cyan-alt-other))))
-    `(helm-minibuffer-prompt ((,class :inherit minibuffer-prompt)))
+    `(helm-minibuffer-prompt ((,class :inherit modus-themes-prompt)))
     `(helm-moccur-buffer ((,class :inherit button
                                   ,@(modus-themes--link-color
                                      cyan-alt-other cyan-alt-other-faint))))
@@ -4748,7 +5596,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(hi-red-b ((,class :inherit bold :background ,red-intense-bg :foreground 
,fg-main)))
     `(hi-salmon ((,class :background ,red-subtle-bg :foreground ,fg-main)))
     `(hi-yellow ((,class :background ,yellow-subtle-bg :foreground ,fg-main)))
-    `(highlight ((,class :inherit modus-themes-subtle-blue)))
+    `(highlight ((,class :background ,blue-subtle-bg :foreground ,fg-main)))
     `(highlight-changes ((,class :foreground ,red-alt :underline nil)))
     `(highlight-changes-delete ((,class :background ,red-nuanced-bg
                                         :foreground ,red :underline t)))
@@ -4791,11 +5639,11 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
 ;;;;; hl-todo
     `(hl-todo ((,class :inherit (bold modus-themes-slant) :foreground 
,red-alt-other)))
 ;;;;; hydra
-    `(hydra-face-amaranth ((,class :inherit bold :foreground ,yellow)))
-    `(hydra-face-blue ((,class :inherit bold :foreground ,blue-alt)))
-    `(hydra-face-pink ((,class :inherit bold :foreground ,magenta-alt)))
-    `(hydra-face-red ((,class :inherit bold :foreground ,red)))
-    `(hydra-face-teal ((,class :inherit bold :foreground ,cyan)))
+    `(hydra-face-amaranth ((,class :inherit bold :foreground ,yellow-alt)))
+    `(hydra-face-blue ((,class :inherit bold :foreground ,blue)))
+    `(hydra-face-pink ((,class :inherit bold :foreground ,magenta-alt-faint)))
+    `(hydra-face-red ((,class :inherit bold :foreground ,red-faint)))
+    `(hydra-face-teal ((,class :inherit bold :foreground ,cyan-alt-other)))
 ;;;;; hyperlist
     `(hyperlist-condition ((,class :foreground ,green)))
     `(hyperlist-hashtag ((,class :foreground ,yellow)))
@@ -4847,10 +5695,10 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(indium-keyword-face ((,class :inherit font-lock-keyword-face)))
     `(indium-litable-face ((,class :inherit modus-themes-slant :foreground 
,fg-special-warm)))
     `(indium-repl-error-face ((,class :inherit error)))
-    `(indium-repl-prompt-face ((,class :inherit comint-highlight-prompt)))
+    `(indium-repl-prompt-face ((,class :inherit modus-themes-prompt)))
     `(indium-repl-stdout-face ((,class :foreground ,fg-main)))
 ;;;;; info
-    `(Info-quoted ((,class ,@(modus-themes--mixed-fonts) ; the capitalization 
is canonical
+    `(Info-quoted ((,class :inherit modus-themes-fixed-pitch ; the 
capitalization is canonical
                            :background ,bg-alt :foreground ,fg-special-calm)))
     `(info-header-node ((,class :inherit bold :foreground ,fg-alt)))
     `(info-header-xref ((,class :foreground ,blue-active)))
@@ -5016,6 +5864,17 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
 ;;;;; keycast
     `(keycast-command ((,class :inherit bold :foreground ,blue-active)))
     `(keycast-key ((,class :background ,blue-active :foreground ,bg-main)))
+;;;;; ledger-mode
+    `(ledger-font-auto-xact-face ((,class :foreground ,magenta)))
+    `(ledger-font-account-name-face ((,class :foreground ,fg-special-cold)))
+    `(ledger-font-directive-face ((,class :foreground ,magenta-alt-other)))
+    `(ledger-font-posting-date-face ((,class :inherit bold :foreground 
,fg-main)))
+    `(ledger-font-periodic-xact-face ((,class :foreground ,cyan-alt-other)))
+    `(ledger-font-posting-amount-face ((,class :foreground ,fg-special-mild)))
+    `(ledger-font-payee-cleared-face ((,class :foreground ,blue-alt)))
+    `(ledger-font-payee-pending-face ((,class :foreground ,yellow)))
+    `(ledger-font-payee-uncleared-face ((,class :foreground ,red-alt-other)))
+    `(ledger-font-xact-highlight-face ((,class :background ,bg-hl-alt)))
 ;;;;; line numbers (display-line-numbers-mode and global variant)
     `(line-number
       ((,class :inherit default
@@ -5119,7 +5978,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
                                   bg-diff-changed fg-diff-changed
                                   yellow-nuanced-bg fg-diff-changed))))
     `(magit-diff-base-highlight ((,class :inherit 
modus-themes-diff-focus-changed)))
-    `(magit-diff-context ((,class :foreground ,fg-unfocused)))
+    `(magit-diff-context ((,class ,@(unless (eq modus-themes-diffs 'bg-only) 
(list :foreground fg-unfocused)))))
     `(magit-diff-context-highlight ((,class ,@(modus-themes--diff
                                                bg-dim fg-dim
                                                bg-inactive fg-inactive
@@ -5239,7 +6098,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
 ;;;;; markdown-mode
     `(markdown-blockquote-face ((,class :inherit modus-themes-slant 
:foreground ,fg-special-cold)))
     `(markdown-bold-face ((,class :inherit bold)))
-    `(markdown-code-face ((,class ,@(modus-themes--mixed-fonts) :background 
,bg-dim :extend t)))
+    `(markdown-code-face ((,class :inherit modus-themes-fixed-pitch 
:background ,bg-dim :extend t)))
     `(markdown-comment-face ((,class :inherit font-lock-comment-face)))
     `(markdown-footnote-marker-face ((,class :inherit bold :foreground 
,cyan-alt)))
     `(markdown-footnote-text-face ((,class :inherit modus-themes-slant 
:foreground ,fg-main)))
@@ -5254,22 +6113,22 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(markdown-header-face-6 ((,class :inherit modus-themes-heading-6)))
     `(markdown-header-rule-face ((,class :inherit bold :foreground 
,fg-special-warm)))
     `(markdown-hr-face ((,class :inherit bold :foreground ,fg-special-warm)))
-    `(markdown-html-attr-name-face ((,class ,@(modus-themes--mixed-fonts)
+    `(markdown-html-attr-name-face ((,class :inherit modus-themes-fixed-pitch
                                             :foreground ,cyan)))
-    `(markdown-html-attr-value-face ((,class ,@(modus-themes--mixed-fonts)
+    `(markdown-html-attr-value-face ((,class :inherit modus-themes-fixed-pitch
                                              :foreground ,blue)))
-    `(markdown-html-entity-face ((,class ,@(modus-themes--mixed-fonts)
+    `(markdown-html-entity-face ((,class :inherit modus-themes-fixed-pitch
                                          :foreground ,cyan)))
-    `(markdown-html-tag-delimiter-face ((,class ,@(modus-themes--mixed-fonts)
+    `(markdown-html-tag-delimiter-face ((,class :inherit 
modus-themes-fixed-pitch
                                                 :foreground ,fg-special-mild)))
-    `(markdown-html-tag-name-face ((,class ,@(modus-themes--mixed-fonts)
+    `(markdown-html-tag-name-face ((,class :inherit modus-themes-fixed-pitch
                                            :foreground ,magenta-alt)))
-    `(markdown-inline-code-face ((,class ,@(modus-themes--mixed-fonts)
+    `(markdown-inline-code-face ((,class :inherit modus-themes-fixed-pitch
                                          :background ,bg-alt :foreground 
,fg-special-calm)))
     `(markdown-italic-face ((,class :inherit italic :foreground 
,fg-special-cold)))
-    `(markdown-language-info-face ((,class ,@(modus-themes--mixed-fonts)
+    `(markdown-language-info-face ((,class :inherit modus-themes-fixed-pitch
                                            :foreground ,fg-special-cold)))
-    `(markdown-language-keyword-face ((,class ,@(modus-themes--mixed-fonts)
+    `(markdown-language-keyword-face ((,class :inherit modus-themes-fixed-pitch
                                               :background ,bg-alt
                                               :foreground ,fg-alt)))
     `(markdown-line-break-face ((,class :inherit modus-themes-refine-cyan 
:underline t)))
@@ -5285,46 +6144,53 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(markdown-pre-face ((,class :inherit markdown-code-face :foreground 
,fg-special-mild)))
     `(markdown-reference-face ((,class :inherit markdown-markup-face)))
     `(markdown-strike-through-face ((,class :strike-through t)))
-    `(markdown-table-face ((,class ,@(modus-themes--mixed-fonts)
+    `(markdown-table-face ((,class :inherit modus-themes-fixed-pitch
                                    :foreground ,fg-special-cold)))
     `(markdown-url-face ((,class :foreground ,blue-alt)))
 ;;;;; markup-faces (`adoc-mode')
-    `(markup-anchor-face ((,class :foreground ,fg-inactive)))
-    `(markup-attribute-face ((,class :inherit italic :foreground 
,fg-inactive)))
-    `(markup-big-face ((,class :height 1.3 :foreground ,blue-nuanced-fg)))
+    `(markup-attribute-face ((,class :inherit (italic markup-meta-face))))
     `(markup-bold-face ((,class :inherit bold :foreground ,red-nuanced-fg)))
-    `(markup-code-face ((,class :inherit fixed-pitch :foreground ,magenta)))
-    `(markup-command-face ((,class :foreground ,fg-inactive)))
+    `(markup-code-face ((,class :foreground ,magenta)))
     `(markup-comment-face ((,class :inherit font-lock-comment-face)))
-    `(markup-complex-replacement-face ((,class :box (:line-width 2 :color nil 
:style released-button)
-                                               :inherit 
modus-themes-refine-magenta)))
-    `(markup-emphasis-face ((,class :inherit italic :foreground 
,fg-special-cold)))
-    `(markup-error-face ((,class :inherit bold :foreground ,red)))
+    `(markup-complex-replacement-face ((,class :background ,magenta-nuanced-bg
+                                               :foreground ,magenta-alt-other
+                                               :underline ,magenta-alt-other)))
+    `(markup-emphasis-face ((,class :inherit markup-italic-face)))
+    `(markup-error-face ((,class :inherit error)))
     `(markup-gen-face ((,class :foreground ,magenta-alt)))
-    `(markup-internal-reference-face ((,class :inherit button :foreground 
,fg-alt)))
+    `(markup-internal-reference-face ((,class :foreground ,fg-alt :underline 
,bg-region)))
     `(markup-italic-face ((,class :inherit italic :foreground 
,fg-special-cold)))
-    `(markup-list-face ((,class :inherit modus-themes-special-calm)))
-    `(markup-meta-face ((,class :foreground ,fg-inactive)))
-    `(markup-meta-hide-face ((,class :inherit shadow)))
-    `(markup-passthrough-face ((,class :inherit fixed-pitch :foreground 
,cyan)))
-    `(markup-preprocessor-face ((,class :foreground ,red-alt-other)))
-    `(markup-replacement-face ((,class :foreground ,yellow-alt-other)))
-    `(markup-secondary-text-face ((,class :height 0.8 :foreground 
,magenta-nuanced-fg)))
-    `(markup-small-face ((,class :height 0.8 :foreground ,fg-main)))
-    `(markup-strong-face ((,class :inherit bold :foreground ,red-nuanced-fg)))
-    `(markup-subscript-face ((,class :height 0.8 :foreground 
,fg-special-cold)))
-    `(markup-superscript-face ((,class :height 0.8 :foreground 
,fg-special-cold)))
-    `(markup-table-cell-face ((,class :inherit modus-themes-special-cold)))
-    `(markup-table-face ((,class :inherit modus-themes-subtle-cyan)))
-    `(markup-table-row-face ((,class :inherit modus-themes-subtle-cyan)))
-    `(markup-title-0-face ((,class :height 3.0 :foreground ,blue-nuanced-fg)))
-    `(markup-title-1-face ((,class :height 2.4 :foreground ,blue-nuanced-fg)))
-    `(markup-title-2-face ((,class :height 1.8 :foreground ,blue-nuanced-fg)))
-    `(markup-title-3-face ((,class :height 1.4 :foreground ,blue-nuanced-fg)))
-    `(markup-title-4-face ((,class :height 1.2 :foreground ,blue-nuanced-fg)))
-    `(markup-title-5-face ((,class :height 1.2 :foreground ,blue-nuanced-fg 
:underline t)))
-    `(markup-value-face ((,class :foreground ,fg-inactive)))
-    `(markup-verbatim-face ((,class :inherit modus-themes-special-mild)))
+    `(markup-list-face ((,class :inherit modus-themes-special-cold)))
+    `(markup-meta-face ((,class :inherit shadow)))
+    `(markup-meta-hide-face ((,class :foreground "gray50")))
+    `(markup-reference-face ((,class :foreground ,blue-alt :underline 
,bg-region)))
+    `(markup-replacement-face ((,class :inherit fixed-pitch :foreground 
,red-alt)))
+    `(markup-secondary-text-face ((,class :height 0.9 :foreground 
,cyan-alt-other)))
+    `(markup-small-face ((,class :inherit markup-gen-face :height 0.9)))
+    `(markup-strong-face ((,class :inherit markup-bold-face)))
+    `(markup-subscript-face ((,class :height 0.9 :foreground 
,magenta-alt-other)))
+    `(markup-superscript-face ((,class :height 0.9 :foreground 
,magenta-alt-other)))
+    `(markup-table-cell-face ((,class :inherit modus-themes-subtle-neutral)))
+    `(markup-table-face ((,class :inherit modus-themes-subtle-neutral)))
+    `(markup-table-row-face ((,class :inherit modus-themes-special-cold)))
+    `(markup-title-0-face ((,class :inherit (bold modus-themes-variable-pitch)
+                                   :foreground ,blue-nuanced-fg
+                                   ,@(modus-themes--scale 
modus-themes-scale-title))))
+    `(markup-title-1-face ((,class :inherit (bold modus-themes-variable-pitch)
+                                   :foreground ,blue-nuanced-fg
+                                   ,@(modus-themes--scale 
modus-themes-scale-1))))
+    `(markup-title-2-face ((,class :inherit (bold modus-themes-variable-pitch)
+                                   :foreground ,blue-nuanced-fg
+                                   ,@(modus-themes--scale 
modus-themes-scale-2))))
+    `(markup-title-3-face ((,class :inherit (bold modus-themes-variable-pitch)
+                                   :foreground ,blue-nuanced-fg
+                                   ,@(modus-themes--scale 
modus-themes-scale-3))))
+    `(markup-title-4-face ((,class :inherit (bold modus-themes-variable-pitch)
+                                   :foreground ,blue-nuanced-fg
+                                   ,@(modus-themes--scale 
modus-themes-scale-4))))
+    `(markup-title-5-face ((,class :inherit (bold modus-themes-variable-pitch)
+                                   :foreground ,blue-nuanced-fg)))
+    `(markup-verbatim-face ((,class :background ,bg-alt)))
 ;;;;; mentor
     `(mentor-download-message ((,class :foreground ,fg-special-warm)))
     `(mentor-download-name ((,class :foreground ,fg-special-cold)))
@@ -5548,39 +6414,41 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
                                          yellow yellow-nuanced-bg
                                          yellow-refine-bg yellow-refine-fg))))
 ;;;;; org
-    `(org-agenda-calendar-event ((,class :foreground ,fg-main)))
-    `(org-agenda-calendar-sexp ((,class :foreground ,cyan-alt)))
+    `(org-agenda-calendar-event ((,class :inherit shadow)))
+    `(org-agenda-calendar-sexp ((,class :inherit (modus-themes-slant shadow))))
     `(org-agenda-clocking ((,class :inherit modus-themes-special-cold :extend 
t)))
     `(org-agenda-column-dateline ((,class :background ,bg-alt)))
-    `(org-agenda-current-time ((,class :inherit bold :foreground 
,blue-alt-other)))
-    `(org-agenda-date ((,class :foreground ,cyan)))
-    `(org-agenda-date-today ((,class :inherit bold :foreground ,fg-main 
:underline t)))
-    `(org-agenda-date-weekend ((,class :foreground ,cyan-alt-other)))
-    `(org-agenda-diary ((,class :foreground ,fg-main)))
-    `(org-agenda-dimmed-todo-face ((,class :inherit bold :foreground ,fg-alt)))
-    `(org-agenda-done ((,class :foreground ,green-alt)))
-    `(org-agenda-filter-category ((,class :inherit bold :foreground 
,magenta-active)))
-    `(org-agenda-filter-effort ((,class :inherit bold :foreground 
,magenta-active)))
-    `(org-agenda-filter-regexp ((,class :inherit bold :foreground 
,magenta-active)))
-    `(org-agenda-filter-tags ((,class :inherit bold :foreground 
,magenta-active)))
+    `(org-agenda-current-time ((,class :foreground ,blue-alt-other-faint)))
+    `(org-agenda-date ((,class ,@(modus-themes--agenda-date cyan fg-main 
nil))))
+    `(org-agenda-date-today ((,class :background ,bg-active
+                                     ,@(modus-themes--agenda-date blue-active 
fg-main t cyan-active))))
+    `(org-agenda-date-weekend ((,class ,@(modus-themes--agenda-date 
cyan-alt-other fg-alt nil cyan fg-main))))
+    `(org-agenda-diary ((,class :inherit shadow)))
+    `(org-agenda-dimmed-todo-face ((,class :inherit shadow)))
+    `(org-agenda-done ((,class :foreground ,@(modus-themes--success-deuteran
+                                              blue-nuanced-fg
+                                              green-nuanced-fg))))
+    `(org-agenda-filter-category ((,class :inherit bold :foreground 
,cyan-active)))
+    `(org-agenda-filter-effort ((,class :inherit bold :foreground 
,cyan-active)))
+    `(org-agenda-filter-regexp ((,class :inherit bold :foreground 
,cyan-active)))
+    `(org-agenda-filter-tags ((,class :inherit bold :foreground ,cyan-active)))
     `(org-agenda-restriction-lock ((,class :background ,bg-dim :foreground 
,fg-dim)))
-    `(org-agenda-structure ((,class ,@(modus-themes--scale 
modus-themes-scale-5)
-                                    :foreground ,blue-alt)))
+    `(org-agenda-structure ((,class ,@(modus-themes--agenda-structure 
blue-alt))))
     `(org-archived ((,class :background ,bg-alt :foreground ,fg-alt)))
-    `(org-block ((,class ,@(modus-themes--mixed-fonts)
+    `(org-block ((,class :inherit modus-themes-fixed-pitch
                          ,@(modus-themes--org-block bg-dim fg-main))))
-    `(org-block-begin-line ((,class ,@(modus-themes--mixed-fonts)
+    `(org-block-begin-line ((,class :inherit modus-themes-fixed-pitch
                                     ,@(modus-themes--org-block-delim
                                        bg-dim fg-special-cold
-                                       bg-alt fg-special-mild))))
+                                       bg-alt fg-alt))))
     `(org-block-end-line ((,class :inherit org-block-begin-line)))
     `(org-checkbox ((,class :box (:line-width 1 :color ,bg-active)
                             :background ,bg-inactive :foreground ,fg-active)))
     `(org-checkbox-statistics-done ((,class :inherit org-done)))
     `(org-checkbox-statistics-todo ((,class :inherit org-todo)))
     `(org-clock-overlay ((,class :inherit modus-themes-special-cold)))
-    `(org-code ((,class ,@(modus-themes--mixed-fonts)
-                        :background ,magenta-nuanced-bg :foreground 
,magenta-nuanced-fg)))
+    `(org-code ((,class :inherit modus-themes-fixed-pitch
+                        :background ,bg-alt :foreground ,fg-special-mild)))
     `(org-column ((,class :background ,bg-alt)))
     `(org-column-title ((,class :inherit bold :underline t :background 
,bg-alt)))
     `(org-date ((,class :inherit ,(if modus-themes-no-mixed-fonts
@@ -5591,51 +6459,52 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(org-date-selected ((,class :inherit bold :foreground ,blue-alt 
:inverse-video t)))
     `(org-dispatcher-highlight ((,class :inherit (bold 
modus-themes-mark-alt))))
     `(org-document-info ((,class :foreground ,fg-special-cold)))
-    `(org-document-info-keyword ((,class ,@(modus-themes--mixed-fonts)
-                                         :foreground ,fg-alt)))
+    `(org-document-info-keyword ((,class :inherit modus-themes-fixed-pitch 
:foreground ,fg-alt)))
     `(org-document-title ((,class :inherit (bold modus-themes-variable-pitch) 
:foreground ,fg-special-cold
-                                  ,@(modus-themes--scale 
modus-themes-scale-5))))
+                                  ,@(modus-themes--scale 
modus-themes-scale-title))))
     `(org-done ((,class :foreground ,@(modus-themes--success-deuteran blue 
green))))
-    `(org-drawer ((,class ,@(modus-themes--mixed-fonts)
-                          :foreground ,fg-alt)))
+    `(org-drawer ((,class :inherit modus-themes-fixed-pitch :foreground 
,fg-alt)))
     `(org-ellipsis (())) ; inherits from the heading's color
     `(org-footnote ((,class :inherit button
                             ,@(modus-themes--link-color
                                blue-alt blue-alt-faint))))
-    `(org-formula ((,class ,@(modus-themes--mixed-fonts)
-                           :foreground ,red-alt)))
-    `(org-habit-alert-face ((,class ,@(modus-themes--org-habit
+    `(org-formula ((,class :inherit modus-themes-fixed-pitch :foreground 
,red-alt)))
+    `(org-habit-alert-face ((,class ,@(modus-themes--agenda-habit
                                        yellow-graph-0-bg
                                        yellow-graph-0-bg
                                        yellow-graph-1-bg))))
-    `(org-habit-alert-future-face ((,class ,@(modus-themes--org-habit
+    `(org-habit-alert-future-face ((,class ,@(modus-themes--agenda-habit
                                               yellow-graph-1-bg
                                               yellow-graph-0-bg
                                               yellow-graph-1-bg))))
-    `(org-habit-clear-face ((,class ,@(modus-themes--org-habit
+    `(org-habit-clear-face ((,class ,@(modus-themes--agenda-habit
                                        blue-graph-0-bg
                                        green-graph-1-bg
+                                       blue-graph-1-bg
                                        blue-graph-1-bg))))
-    `(org-habit-clear-future-face ((,class ,@(modus-themes--org-habit
+    `(org-habit-clear-future-face ((,class ,@(modus-themes--agenda-habit
                                               blue-graph-1-bg
                                               green-graph-1-bg
+                                              blue-graph-1-bg
                                               blue-graph-1-bg))))
-    `(org-habit-overdue-face ((,class ,@(modus-themes--org-habit
+    `(org-habit-overdue-face ((,class ,@(modus-themes--agenda-habit
                                          red-graph-0-bg
                                          red-graph-0-bg
                                          red-graph-1-bg))))
-    `(org-habit-overdue-future-face ((,class ,@(modus-themes--org-habit
+    `(org-habit-overdue-future-face ((,class ,@(modus-themes--agenda-habit
                                                 red-graph-1-bg
                                                 red-graph-0-bg
                                                 red-graph-1-bg))))
-    `(org-habit-ready-face ((,class ,@(modus-themes--org-habit
+    `(org-habit-ready-face ((,class ,@(modus-themes--agenda-habit
                                        green-graph-0-bg
                                        green-graph-0-bg
-                                       green-graph-1-bg))))
-    `(org-habit-ready-future-face ((,class ,@(modus-themes--org-habit
+                                       green-graph-1-bg
+                                       blue-graph-0-bg))))
+    `(org-habit-ready-future-face ((,class ,@(modus-themes--agenda-habit
                                               green-graph-1-bg
                                               green-graph-0-bg
-                                              green-graph-1-bg))))
+                                              green-graph-1-bg
+                                              blue-graph-0-bg))))
     `(org-headline-done ((,class :inherit modus-themes-variable-pitch
                                  :foreground ,@(modus-themes--success-deuteran
                                                 blue-nuanced-fg
@@ -5654,23 +6523,20 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(org-level-8 ((,class :inherit modus-themes-heading-8)))
     `(org-link ((,class :inherit button)))
     `(org-list-dt ((,class :inherit bold)))
-    `(org-macro ((,class ,@(modus-themes--mixed-fonts)
+    `(org-macro ((,class :inherit modus-themes-fixed-pitch
                          :background ,cyan-nuanced-bg :foreground 
,cyan-nuanced-fg)))
-    `(org-meta-line ((,class ,@(modus-themes--mixed-fonts) :foreground 
,fg-alt)))
+    `(org-meta-line ((,class :inherit modus-themes-fixed-pitch :foreground 
,fg-alt)))
     `(org-mode-line-clock ((,class :foreground ,fg-main)))
-    `(org-mode-line-clock-overrun ((,class :inherit modus-themes-active-red)))
+    `(org-mode-line-clock-overrun ((,class :inherit bold :foreground 
,red-active)))
     `(org-priority ((,class :foreground ,magenta)))
-    `(org-property-value ((,class ,@(modus-themes--mixed-fonts)
-                                  :foreground ,fg-special-cold)))
+    `(org-property-value ((,class :inherit modus-themes-fixed-pitch 
:foreground ,fg-special-cold)))
     `(org-quote ((,class ,@(modus-themes--org-block bg-dim fg-special-cold 
fg-main))))
-    `(org-scheduled ((,class :foreground ,magenta-alt)))
-    `(org-scheduled-previously ((,class :foreground ,yellow-alt-other)))
-    `(org-scheduled-today ((,class :foreground ,magenta-alt-other)))
+    `(org-scheduled ((,class ,@(modus-themes--agenda-scheduled yellow-faint 
fg-special-warm magenta-alt))))
+    `(org-scheduled-previously ((,class ,@(modus-themes--agenda-scheduled 
yellow fg-special-warm yellow-alt-other))))
+    `(org-scheduled-today ((,class ,@(modus-themes--agenda-scheduled yellow 
fg-special-warm magenta-alt-other))))
     `(org-sexp-date ((,class :inherit org-date)))
-    `(org-special-keyword ((,class ,@(modus-themes--mixed-fonts)
-                                   :foreground ,fg-alt)))
-    `(org-table ((,class ,@(modus-themes--mixed-fonts)
-                         :foreground ,fg-special-cold)))
+    `(org-special-keyword ((,class :inherit modus-themes-fixed-pitch 
:foreground ,fg-alt)))
+    `(org-table ((,class :inherit modus-themes-fixed-pitch :foreground 
,fg-special-cold)))
     `(org-table-header ((,class :inherit (fixed-pitch 
modus-themes-intense-neutral))))
     `(org-tag ((,class :foreground ,magenta-nuanced-fg)))
     `(org-tag-group ((,class :inherit bold :foreground ,cyan-nuanced-fg)))
@@ -5678,8 +6544,8 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(org-time-grid ((,class :foreground ,fg-unfocused)))
     `(org-todo ((,class :foreground ,red)))
     `(org-upcoming-deadline ((,class :foreground ,red-alt-other)))
-    `(org-upcoming-distant-deadline ((,class :foreground ,red-nuanced-fg)))
-    `(org-verbatim ((,class ,@(modus-themes--mixed-fonts)
+    `(org-upcoming-distant-deadline ((,class :foreground ,red-faint)))
+    `(org-verbatim ((,class :inherit modus-themes-fixed-pitch
                             :background ,bg-alt :foreground ,fg-special-calm)))
     `(org-verse ((,class :inherit org-quote)))
     `(org-warning ((,class :inherit bold :foreground ,red-alt-other)))
@@ -5719,7 +6585,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(org-tree-slide-header-overlay-face
       ((,class :inherit (bold modus-themes-variable-pitch) :background ,bg-main
                :foreground ,fg-special-cold :overline nil
-               ,@(modus-themes--scale modus-themes-scale-5))))
+               ,@(modus-themes--scale modus-themes-scale-title))))
 ;;;;; org-treescope
     `(org-treescope-faces--markerinternal-midday ((,class :inherit 
modus-themes-intense-blue)))
     `(org-treescope-faces--markerinternal-range ((,class :inherit 
modus-themes-special-mild)))
@@ -5736,7 +6602,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(outline-7 ((,class :inherit modus-themes-heading-7)))
     `(outline-8 ((,class :inherit modus-themes-heading-8)))
 ;;;;; outline-minor-faces
-    `(outline-minor-0 ((,class :background ,bg-alt)))
+    `(outline-minor-0 (()))
 ;;;;; package (M-x list-packages)
     `(package-description ((,class :foreground ,fg-special-cold)))
     `(package-help-section-name ((,class :inherit bold :foreground 
,magenta-alt-other)))
@@ -5845,6 +6711,8 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(prodigy-green-face ((,class :foreground ,green)))
     `(prodigy-red-face ((,class :foreground ,red)))
     `(prodigy-yellow-face ((,class :foreground ,yellow)))
+;;;;; pulse
+    `(pulse-highlight-start-face ((,class :background ,bg-active-accent 
:extend t)))
 ;;;;; quick-peek
     `(quick-peek-background-face ((,class :background ,bg-alt)))
     `(quick-peek-border-face ((,class :background ,fg-window-divider-inner 
:height 1)))
@@ -5911,7 +6779,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(rcirc-nick-in-message ((,class :foreground ,magenta-alt-other)))
     `(rcirc-nick-in-message-full-line ((,class :inherit bold :foreground 
,fg-special-mild)))
     `(rcirc-other-nick ((,class :inherit bold :foreground ,fg-special-cold)))
-    `(rcirc-prompt ((,class :inherit comint-highlight-prompt)))
+    `(rcirc-prompt ((,class :inherit modus-themes-prompt)))
     `(rcirc-server ((,class :foreground ,fg-unfocused)))
     `(rcirc-timestamp ((,class :foreground ,blue-nuanced-fg)))
     `(rcirc-url ((,class :foreground ,blue :underline t)))
@@ -5997,6 +6865,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
                :background ,@(pcase modus-themes-completions
                                ('opinionated (list bg-active))
                                (_ (list bg-inactive))))))
+    `(selectrum-mouse-highlight ((,class :inherit highlight)))
     `(selectrum-primary-highlight
       ((,class :inherit bold
                ,@(modus-themes--standard-completions
@@ -6053,6 +6922,12 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(show-paren-match-expression ((,class :background ,bg-paren-expression)))
     `(show-paren-mismatch ((,class :inherit modus-themes-intense-red)))
 ;;;;; shr
+    `(shr-h1 ((,class :inherit modus-themes-heading-1)))
+    `(shr-h2 ((,class :inherit modus-themes-heading-2)))
+    `(shr-h3 ((,class :inherit modus-themes-heading-3)))
+    `(shr-h4 ((,class :inherit modus-themes-heading-4)))
+    `(shr-h5 ((,class :inherit modus-themes-heading-5)))
+    `(shr-h6 ((,class :inherit modus-themes-heading-6)))
     `(shr-abbreviation ((,class :inherit modus-themes-lang-note)))
     `(shr-selected-link ((,class :inherit modus-themes-subtle-red)))
 ;;;;; side-notes
@@ -6309,8 +7184,8 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(tomatinho-reset-face ((,class :inherit shadow)))
 ;;;;; transient
     `(transient-active-infix ((,class :inherit modus-themes-special-mild)))
-    `(transient-amaranth ((,class :inherit bold :foreground ,yellow)))
-    `(transient-argument ((,class :inherit bold :foreground ,red-alt)))
+    `(transient-amaranth ((,class :inherit bold :foreground ,yellow-alt)))
+    `(transient-argument ((,class :inherit bold :foreground ,green)))
     `(transient-blue ((,class :inherit bold :foreground ,blue)))
     `(transient-disabled-suffix ((,class :inherit modus-themes-intense-red)))
     `(transient-enabled-suffix ((,class :inherit 
,@(modus-themes--success-deuteran
@@ -6322,8 +7197,8 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(transient-key ((,class :inherit modus-themes-key-binding)))
     `(transient-mismatched-key ((,class :underline t)))
     `(transient-nonstandard-key ((,class :underline t)))
-    `(transient-pink ((,class :inherit bold :foreground ,magenta)))
-    `(transient-red ((,class :inherit bold :foreground ,red-intense)))
+    `(transient-pink ((,class :inherit bold :foreground ,magenta-alt-faint)))
+    `(transient-red ((,class :inherit bold :foreground ,red-faint)))
     `(transient-teal ((,class :inherit bold :foreground ,cyan-alt-other)))
     `(transient-unreachable ((,class :foreground ,fg-unfocused)))
     `(transient-unreachable-key ((,class :foreground ,fg-unfocused)))
@@ -6560,7 +7435,7 @@ by virtue of calling either of 
`modus-themes-load-operandi' and
     `(whitespace-empty ((,class :inherit modus-themes-intense-magenta)))
     `(whitespace-hspace ((,class :background ,bg-whitespace :foreground 
,fg-whitespace)))
     `(whitespace-indentation ((,class :background ,bg-whitespace :foreground 
,fg-whitespace)))
-    `(whitespace-line ((,class :background ,bg-alt)))
+    `(whitespace-line ((,class :inherit modus-themes-subtle-yellow)))
     `(whitespace-newline ((,class :background ,bg-whitespace :foreground 
,fg-whitespace)))
     `(whitespace-space ((,class :background ,bg-whitespace :foreground 
,fg-whitespace)))
     `(whitespace-space-after-tab ((,class :inherit 
modus-themes-subtle-magenta)))
diff --git a/etc/themes/modus-vivendi-theme.el 
b/etc/themes/modus-vivendi-theme.el
index fa8ba21..6ff359d 100644
--- a/etc/themes/modus-vivendi-theme.el
+++ b/etc/themes/modus-vivendi-theme.el
@@ -4,7 +4,7 @@
 
 ;; Author: Protesilaos Stavrou <info@protesilaos.com>
 ;; URL: https://gitlab.com/protesilaos/modus-themes
-;; Version: 1.4.0
+;; Version: 1.5.0
 ;; Package-Requires: ((emacs "26.1"))
 ;; Keywords: faces, theme, accessibility
 
diff --git a/lib-src/etags.c b/lib-src/etags.c
index c39c93d..88b49f8 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -340,7 +340,6 @@ typedef struct regexp
   struct re_pattern_buffer *pat; /* the compiled pattern */
   struct re_registers regs;    /* re registers */
   bool error_signaled;         /* already signaled for this regexp */
-  bool force_explicit_name;    /* do not allow implicit tag name */
   bool ignore_case;            /* ignore case when matching */
   bool multi_line;             /* do a multi-line match on the whole file */
 } regexp;
@@ -6910,7 +6909,6 @@ add_regex (char *regexp_pattern, language *lang)
   struct re_pattern_buffer *patbuf;
   regexp *rp;
   bool
-    force_explicit_name = true, /* do not use implicit tag names */
     ignore_case = false,       /* case is significant */
     multi_line = false,                /* matches are done one line at a time 
*/
     single_line = false;       /* dot does not match newline */
@@ -6949,7 +6947,8 @@ add_regex (char *regexp_pattern, language *lang)
       case 'N':
        if (modifiers == name)
          error ("forcing explicit tag name but no name, ignoring");
-       force_explicit_name = true;
+       /* This option has no effect and is present only for backward
+          compatibility.  */
        break;
       case 'i':
        ignore_case = true;
@@ -7004,7 +7003,6 @@ add_regex (char *regexp_pattern, language *lang)
   p_head->pat = patbuf;
   p_head->name = savestr (name);
   p_head->error_signaled = false;
-  p_head->force_explicit_name = force_explicit_name;
   p_head->ignore_case = ignore_case;
   p_head->multi_line = multi_line;
 }
@@ -7144,20 +7142,15 @@ regex_tag_multiline (void)
                name = NULL;
              else /* make a named tag */
                name = substitute (buffer, rp->name, &rp->regs);
-             if (rp->force_explicit_name)
-               {
-                 /* Force explicit tag name, if a name is there. */
-                 pfnote (name, true, buffer + linecharno,
-                         charno - linecharno + 1, lineno, linecharno);
-
-                 if (debug)
-                   fprintf (stderr, "%s on %s:%"PRIdMAX": %s\n",
-                            name ? name : "(unnamed)", curfdp->taggedfname,
-                            lineno, buffer + linecharno);
-               }
-             else
-               make_tag (name, strlen (name), true, buffer + linecharno,
-                         charno - linecharno + 1, lineno, linecharno);
+
+             /* Force explicit tag name, if a name is there. */
+             pfnote (name, true, buffer + linecharno,
+                     charno - linecharno + 1, lineno, linecharno);
+
+             if (debug)
+               fprintf (stderr, "%s on %s:%"PRIdMAX": %s\n",
+                        name ? name : "(unnamed)", curfdp->taggedfname,
+                        lineno, buffer + linecharno);
              break;
            }
        }
@@ -7471,18 +7464,14 @@ readline (linebuffer *lbp, FILE *stream)
                name = NULL;
              else /* make a named tag */
                name = substitute (lbp->buffer, rp->name, &rp->regs);
-             if (rp->force_explicit_name)
-               {
-                 /* Force explicit tag name, if a name is there. */
-                 pfnote (name, true, lbp->buffer, match, lineno, linecharno);
-                 if (debug)
-                   fprintf (stderr, "%s on %s:%"PRIdMAX": %s\n",
-                            name ? name : "(unnamed)", curfdp->taggedfname,
-                            lineno, lbp->buffer);
-               }
-             else
-               make_tag (name, strlen (name), true,
-                         lbp->buffer, match, lineno, linecharno);
+
+             /* Force explicit tag name, if a name is there. */
+             pfnote (name, true, lbp->buffer, match, lineno, linecharno);
+
+             if (debug)
+               fprintf (stderr, "%s on %s:%"PRIdMAX": %s\n",
+                        name ? name : "(unnamed)", curfdp->taggedfname,
+                        lineno, lbp->buffer);
              break;
            }
        }
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index cfdebcc..e683da1 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -270,6 +270,7 @@ main (int argc, char **argv)
         You might also wish to verify that your system is one which
         uses lock files for this purpose.  Some systems use other methods.  */
 
+      bool lockname_unlinked = false;
       inname_len = strlen (inname);
       lockname = xmalloc (inname_len + sizeof ".lock");
       strcpy (lockname, inname);
@@ -312,15 +313,10 @@ main (int argc, char **argv)
             Five minutes should be good enough to cope with crashes
             and wedgitude, and long enough to avoid being fooled
             by time differences between machines.  */
-         if (stat (lockname, &st) >= 0)
-           {
-             time_t now = time (0);
-             if (st.st_ctime < now - 300)
-               {
-                 unlink (lockname);
-                 lockname = 0;
-               }
-           }
+         if (!lockname_unlinked
+             && stat (lockname, &st) == 0
+             && st.st_ctime < time (0) - 300)
+           lockname_unlinked = unlink (lockname) == 0 || errno == ENOENT;
        }
 
       delete_lockname = lockname;
diff --git a/lisp/apropos.el b/lisp/apropos.el
index f246064..376c1b2 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -724,22 +724,27 @@ the output includes key-bindings of commands."
        ;; (autoload (push (cdr x) autoloads))
        ('require (push (cdr x) requires))
        ('provide (push (cdr x) provides))
-        ('t nil) ; Skip "was an autoload" entries.
+        ('t nil)                     ; Skip "was an autoload" entries.
         ;; FIXME: Print information about each individual method: both
         ;; its docstring and specializers (bug#21422).
         ('cl-defmethod (push (cadr x) provides))
        (_ (push (or (cdr-safe x) x) symbols))))
-    (let ((apropos-pattern "")) ;Dummy binding for apropos-symbols-internal.
-      (apropos-symbols-internal
-       symbols apropos-do-all
-       (concat
-        (format-message
-                "Library `%s' provides: %s\nand requires: %s"
-                file
-                (mapconcat #'apropos-library-button
-                           (or provides '(nil)) " and ")
-                (mapconcat #'apropos-library-button
-                           (or requires '(nil)) " and ")))))))
+    (let ((apropos-pattern "") ;Dummy binding for apropos-symbols-internal.
+          (text
+           (concat
+            (format-message
+             "Library `%s' provides: %s\nand requires: %s"
+             file
+             (mapconcat #'apropos-library-button
+                        (or provides '(nil)) " and ")
+             (mapconcat #'apropos-library-button
+                        (or requires '(nil)) " and ")))))
+      (if (null symbols)
+          (with-output-to-temp-buffer "*Apropos*"
+           (with-current-buffer standard-output
+             (apropos-mode)
+              (apropos--preamble text)))
+        (apropos-symbols-internal symbols apropos-do-all text)))))
 
 (defun apropos-symbols-internal (symbols keys &optional text)
   ;; Filter out entries that are marked as apropos-inhibit.
@@ -1154,10 +1159,7 @@ as a heading."
            symbol item)
        (set-buffer standard-output)
        (apropos-mode)
-       (insert (substitute-command-keys "Type \\[apropos-follow] on ")
-               (if apropos-multi-type "a type label" "an entry")
-               " to view its full documentation.\n\n")
-       (if text (insert text "\n\n"))
+        (apropos--preamble text)
        (dolist (apropos-item p)
          (when (and spacing (not (bobp)))
            (princ spacing))
@@ -1287,6 +1289,14 @@ as a heading."
          (fill-region opoint (point) nil t)))
       (or (bolp) (terpri)))))
 
+(defun apropos--preamble (text)
+  (let ((inhibit-read-only t))
+    (insert (substitute-command-keys "Type \\[apropos-follow] on ")
+           (if apropos-multi-type "a type label" "an entry")
+           " to view its full documentation.\n\n")
+    (when text
+      (insert text "\n\n"))))
+
 (defun apropos-follow ()
   "Invokes any button at point, otherwise invokes the nearest label button."
   (interactive)
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 31e41a9..52b96fd 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -467,18 +467,18 @@ See user option `bookmark-fontify'."
   "Remove a bookmark's colorized overlay.
 BM is a bookmark as returned from function `bookmark-get-bookmark'.
 See user option `bookmark-fontify'."
-  (let ((filename (assq 'filename bm))
-        (pos      (assq 'position bm))
+  (let ((filename (cdr (assq 'filename bm)))
+        (pos (cdr (assq 'position bm)))
         overlays found temp)
-    (when filename (setq filename (expand-file-name (cdr filename))))
-    (when pos (setq pos (cdr pos)))
-    (dolist (buf (buffer-list))
-      (with-current-buffer buf
-        (when (equal filename buffer-file-name)
-          (setq overlays (overlays-at pos))
-          (while (and (not found) (setq temp (pop overlays)))
-            (when (eq 'bookmark (overlay-get temp 'category))
-              (delete-overlay (setq found temp)))))))))
+    (when (and pos filename)
+      (setq filename (expand-file-name filename))
+      (dolist (buf (buffer-list))
+        (with-current-buffer buf
+          (when (equal filename buffer-file-name)
+            (setq overlays (overlays-at pos))
+            (while (and (not found) (setq temp (pop overlays)))
+              (when (eq 'bookmark (overlay-get temp 'category))
+                (delete-overlay (setq found temp))))))))))
 
 (defun bookmark-completing-read (prompt &optional default)
   "Prompting with PROMPT, read a bookmark name in completion.
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 0103d5c..5ec6af4 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1665,8 +1665,11 @@ Otherwise use brackets."
                   'custom-button-pressed
                 'custom-button-pressed-unraised))))
 
+(defvar custom--invocation-options nil)
+
 (defun custom-buffer-create-internal (options &optional _description)
   (Custom-mode)
+  (setq custom--invocation-options options)
   (let ((init-file (or custom-file user-init-file)))
     ;; Insert verbose help at the top of the custom buffer.
     (when custom-buffer-verbose-help
@@ -2821,7 +2824,7 @@ the present value is saved to its :shown-value property 
instead."
                          (list (widget-value
                                 (car-safe
                                  (widget-get widget :children)))))
-           (error "There are unsaved changes")))
+           (message "Note: There are unsaved changes")))
        (widget-put widget :documentation-shown nil)
        (widget-put widget :custom-state 'hidden))
       (custom-redraw widget)
@@ -5152,11 +5155,19 @@ if that value is non-nil."
                        :label (nth 5 arg)))
                     custom-commands)
                    (setq custom-tool-bar-map map))))
+  (setq-local custom--invocation-options nil)
+  (setq-local revert-buffer-function #'custom--revert-buffer)
   (make-local-variable 'custom-options)
   (make-local-variable 'custom-local-buffer)
   (custom--initialize-widget-variables)
   (add-hook 'widget-edit-functions 'custom-state-buffer-message nil t))
 
+(defun custom--revert-buffer (_ignore-auto _noconfirm)
+  (unless custom--invocation-options
+    (error "Insufficient data to revert"))
+  (custom-buffer-create custom--invocation-options
+                        (buffer-name)))
+
 (put 'Custom-mode 'mode-class 'special)
 
 (provide 'cus-edit)
diff --git a/lisp/desktop.el b/lisp/desktop.el
index ae8d026..b9467c8 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -759,7 +759,10 @@ is nil, ask the user where to save the desktop."
        (unless (yes-or-no-p "Error while saving the desktop.  Ignore? ")
         (signal (car err) (cdr err))))))
   ;; If we own it, we don't anymore.
-  (when (eq (emacs-pid) (desktop-owner)) (desktop-release-lock))
+  (when (eq (emacs-pid) (desktop-owner))
+    ;; Allow exiting Emacs even if we can't delete the desktop file.
+    (ignore-error 'file-error
+      (desktop-release-lock)))
   t)
 
 ;; ----------------------------------------------------------------------------
diff --git a/lisp/dired.el b/lisp/dired.el
index 9ddd2c5..28448be 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -163,7 +163,7 @@ always set this variable to t."
   :type 'boolean
   :group 'dired-mark)
 
-(defcustom dired-trivial-filenames (purecopy "\\`\\.\\.?\\'\\|\\`#")
+(defcustom dired-trivial-filenames (purecopy "\\`\\.\\.?\\'\\|\\`\\.?#")
   "Regexp of files to skip when finding first file of a directory.
 A value of nil means move to the subdir line.
 A value of t means move to first file."
@@ -356,6 +356,11 @@ is anywhere on its Dired line, except the beginning of the 
line."
   :group 'dired
   :version "28.1")
 
+(defcustom dired-kill-when-opening-new-dired-buffer nil
+  "If non-nil, kill the current buffer when selecting a new directory."
+  :type 'boolean
+  :version "28.1")
+
 
 ;;; Internal variables
 
@@ -615,6 +620,31 @@ Subexpression 2 must end right before the \\n.")
    (list dired-re-dir
         '(".+" (dired-move-to-filename) nil (0 dired-directory-face)))
    ;;
+   ;; Files suffixed with `completion-ignored-extensions'.
+   '(eval .
+     ;; It is quicker to first find just an extension, then go back to the
+     ;; start of that file name.  So we do this complex MATCH-ANCHORED form.
+          (list (concat
+                 "\\(" (regexp-opt completion-ignored-extensions)
+                 "\\|#\\|\\.#.+\\)$")
+          '(".+" (dired-move-to-filename) nil (0 dired-ignored-face))))
+   ;;
+   ;; Files suffixed with `completion-ignored-extensions'
+   ;; plus a character put in by -F.
+   '(eval .
+     (list (concat "\\(" (regexp-opt completion-ignored-extensions)
+                  "\\|#\\|\\.#.+\\)[*=|]$")
+          '(".+" (progn
+                   (end-of-line)
+                   ;; If the last character is not part of the filename,
+                   ;; move back to the start of the filename
+                   ;; so it can be fontified.
+                   ;; Otherwise, leave point at the end of the line;
+                   ;; that way, nothing is fontified.
+                   (unless (get-text-property (1- (point)) 'mouse-face)
+                     (dired-move-to-filename)))
+            nil (0 dired-ignored-face))))
+   ;;
    ;; Broken Symbolic link.
    (list dired-re-sym
          (list (lambda (end)
@@ -659,29 +689,6 @@ Subexpression 2 must end right before the \\n.")
    (list dired-re-special
         '(".+" (dired-move-to-filename) nil (0 'dired-special)))
    ;;
-   ;; Files suffixed with `completion-ignored-extensions'.
-   '(eval .
-     ;; It is quicker to first find just an extension, then go back to the
-     ;; start of that file name.  So we do this complex MATCH-ANCHORED form.
-     (list (concat "\\(" (regexp-opt completion-ignored-extensions) "\\|#\\)$")
-          '(".+" (dired-move-to-filename) nil (0 dired-ignored-face))))
-   ;;
-   ;; Files suffixed with `completion-ignored-extensions'
-   ;; plus a character put in by -F.
-   '(eval .
-     (list (concat "\\(" (regexp-opt completion-ignored-extensions)
-                  "\\|#\\)[*=|]$")
-          '(".+" (progn
-                   (end-of-line)
-                   ;; If the last character is not part of the filename,
-                   ;; move back to the start of the filename
-                   ;; so it can be fontified.
-                   ;; Otherwise, leave point at the end of the line;
-                   ;; that way, nothing is fontified.
-                   (unless (get-text-property (1- (point)) 'mouse-face)
-                     (dired-move-to-filename)))
-            nil (0 dired-ignored-face))))
-   ;;
    ;; Explicitly put the default face on file names ending in a colon to
    ;; avoid fontifying them as directory header.
    (list (concat dired-re-maybe-mark dired-re-inode-size dired-re-perms ".*:$")
@@ -2377,7 +2384,7 @@ directory in another window."
        (progn
          (if other-window
              (dired-other-window up)
-           (dired up))
+           (dired--find-possibly-alternative-file up))
          (dired-goto-file dir)))))
 
 (defun dired-get-file-for-visit ()
@@ -2401,7 +2408,16 @@ directory in another window."
 (defun dired-find-file ()
   "In Dired, visit the file or directory named on this line."
   (interactive)
-  (dired--find-file #'find-file (dired-get-file-for-visit)))
+  (dired--find-possibly-alternative-file (dired-get-file-for-visit)))
+
+(defun dired--find-possibly-alternative-file (file)
+  "Find FILE, but respect `dired-kill-when-opening-new-dired-buffer'."
+  (if (and dired-kill-when-opening-new-dired-buffer
+           (file-directory-p file))
+      (progn
+        (set-buffer-modified-p nil)
+        (dired--find-file #'find-alternate-file file))
+    (dired--find-file #'find-file file)))
 
 (defun dired--find-file (find-file-function file)
   "Call FIND-FILE-FUNCTION on FILE, but bind some relevant variables."
@@ -3834,13 +3850,13 @@ object files--just `.o' will mark more than you might 
think."
                         when (stringp file)
                         sum (file-attribute-size (file-attributes file)))))
     (if (zerop nmarked)
-        (message "No marked files"))
-    (message "%d marked file%s (%s total size)"
-             nmarked
-             (if (= nmarked 1)
-                 ""
-               "s")
-             (funcall byte-count-to-string-function size))))
+        (message "No marked files")
+      (message "%d marked file%s (%s total size)"
+               nmarked
+               (if (= nmarked 1)
+                   ""
+                 "s")
+               (funcall byte-count-to-string-function size)))))
 
 (defun dired-mark-files-containing-regexp (regexp &optional marker-char)
   "Mark all files with contents containing REGEXP for use in later commands.
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index b45984b..9d1ae70 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -250,7 +250,10 @@ expression, in which case we want to handle forms 
differently."
           (custom-autoload ',varname ,file
                             ,(condition-case nil
                                  (null (plist-get props :set))
-                               (error nil))))))
+                               (error nil)))
+           ;; Propagate the :safe property to the loaddefs file.
+           ,@(when-let ((safe (plist-get props :safe)))
+               `((put ',varname 'safe-local-variable ,safe))))))
 
      ((eq car 'defgroup)
       ;; In Emacs this is normally handled separately by cus-dep.el, but for
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 3e65db4..6970c8a 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1627,7 +1627,7 @@ the `\\\\=[command]' ones that are assumed to be of length
 `byte-compile--wide-docstring-substitution-len'.  Also ignore
 URLs."
   (string-match
-   (format "^.\\{%s,\\}$" (int-to-string (1+ col)))
+   (format "^.\\{%d,\\}$" (min (1+ col) #xffff)) ; Heed RE_DUP_MAX.
    (replace-regexp-in-string
     (rx (or
          ;; Ignore some URLs.
@@ -1857,8 +1857,7 @@ also be compiled."
                         (file-readable-p source)
                        (not (string-match "\\`\\.#" file))
                         (not (auto-save-file-name-p source))
-                        (not (string-equal dir-locals-file
-                                           (file-name-nondirectory source))))
+                        (not (member source (dir-locals--all-files 
directory))))
                    (progn (cl-incf
                            (pcase (byte-recompile-file source force arg)
                              ('no-byte-compile skip-count)
diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el
index f663710..f1579cd 100644
--- a/lisp/emacs-lisp/cconv.el
+++ b/lisp/emacs-lisp/cconv.el
@@ -259,7 +259,8 @@ Returns a form where all lambdas don't have any free 
variables."
               (not (intern-soft var))
               (eq ?_ (aref (symbol-name var) 0))
              ;; As a special exception, ignore "ignore".
-             (eq var 'ignored))
+             (eq var 'ignored)
+              (not (byte-compile-warning-enabled-p 'unbound var)))
        (let ((suggestions (help-uni-confusable-suggestions (symbol-name var))))
          (format "Unused lexical %s `%S'%s"
                  varkind var
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 1c8c372..b31ea42a 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -53,6 +53,7 @@
   (message eieio-version))
 
 (require 'eieio-core)
+(eval-when-compile (require 'subr-x))
 
 
 ;;; Defining a new class
@@ -740,31 +741,37 @@ Called from the constructor routine."
   "Construct the new object THIS based on SLOTS.")
 
 (cl-defmethod initialize-instance ((this eieio-default-superclass)
-                               &optional slots)
+                                  &optional args)
   "Construct the new object THIS based on SLOTS.
-SLOTS is a tagged list where odd numbered elements are tags, and
+ARGS is a property list where odd numbered elements are tags, and
 even numbered elements are the values to store in the tagged slot.
 If you overload the `initialize-instance', there you will need to
 call `shared-initialize' yourself, or you can call `call-next-method'
 to have this constructor called automatically.  If these steps are
 not taken, then new objects of your class will not have their values
-dynamically set from SLOTS."
-  ;; First, see if any of our defaults are `lambda', and
-  ;; re-evaluate them and apply the value to our slots.
+dynamically set from ARGS."
   (let* ((this-class (eieio--object-class this))
+         (initargs args)
          (slots (eieio--class-slots this-class)))
     (dotimes (i (length slots))
-      ;; For each slot, see if we need to evaluate it.
+      ;; For each slot, see if we need to evaluate its initform.
       (let* ((slot (aref slots i))
+             (slot-name (eieio-slot-descriptor-name slot))
              (initform (cl--slot-descriptor-initform slot)))
-        ;; Those slots whose initform is constant already have the right
-        ;; value set in the default-object.
-        (unless (macroexp-const-p initform)
-          ;; FIXME: We should be able to just do (aset this (+ i <cst>) dflt)!
-          (eieio-oset this (cl--slot-descriptor-name slot)
-                      (eval initform t))))))
-  ;; Shared initialize will parse our slots for us.
-  (shared-initialize this slots))
+        (unless (or (when-let ((initarg
+                                (car (rassq slot-name
+                                            (eieio--class-initarg-tuples
+                                             this-class)))))
+                      (plist-get initargs initarg))
+                    ;; Those slots whose initform is constant already have
+                    ;; the right value set in the default-object.
+                    (macroexp-const-p initform))
+          ;; FIXME: Use `aset' instead of `eieio-oset', relying on that
+          ;; vector returned by `eieio--class-slots'
+          ;; should be congruent with the object itself.
+          (eieio-oset this slot-name (eval initform t))))))
+  ;; Shared initialize will parse our args for us.
+  (shared-initialize this args))
 
 (cl-defgeneric slot-missing (object slot-name _operation &optional _new-value)
   "Method invoked when an attempt to access a slot in OBJECT fails.
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index df86446..f4bab9c 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -318,16 +318,20 @@ Assumes the caller has bound 
`macroexpand-all-environment'."
       (`(,(or 'function 'quote) . ,_) form)
       (`(,(and fun (or 'let 'let*)) . ,(or `(,bindings . ,body)
                                            pcase--dontcare))
-       (macroexp--cons fun
-                       (macroexp--cons (macroexp--all-clauses bindings 1)
-                                       (if (null body)
-                                           (macroexp-unprogn
-                                            (macroexp-warn-and-return
-                                             (format "Empty %s body" fun)
-                                             nil t))
-                                         (macroexp--all-forms body))
-                                       (cdr form))
-                       form))
+       (macroexp--cons
+        fun
+        (macroexp--cons
+         (macroexp--all-clauses bindings 1)
+         (if (null body)
+             (macroexp-unprogn
+              (macroexp-warn-and-return
+               (and (or (not (fboundp 'byte-compile-warning-enabled-p))
+                        (byte-compile-warning-enabled-p t))
+                    (format "Empty %s body" fun))
+               nil t))
+           (macroexp--all-forms body))
+         (cdr form))
+        form))
       (`(,(and fun `(lambda . ,_)) . ,args)
        ;; Embedded lambda in function position.
        ;; If the byte-optimizer is loaded, try to unfold this,
diff --git a/lisp/emacs-lisp/memory-report.el b/lisp/emacs-lisp/memory-report.el
index f4f0313..1125dde 100644
--- a/lisp/emacs-lisp/memory-report.el
+++ b/lisp/emacs-lisp/memory-report.el
@@ -44,6 +44,8 @@ by counted more than once."
   (pop-to-buffer "*Memory Report*")
   (special-mode)
   (button-mode 1)
+  (setq-local revert-buffer-function (lambda (_ignore-auto _noconfirm)
+                                       (memory-report)))
   (setq truncate-lines t)
   (message "Gathering data...")
   (let ((reports (append (memory-report--garbage-collect)
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index a0f1ab0..6bbd4c9 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -3954,9 +3954,14 @@ packages."
   (package--ensure-package-menu-mode)
   (if (or (not status) (string-empty-p status))
       (package-menu--generate t t)
-    (package-menu--filter-by (lambda (pkg-desc)
-                        (string-match-p status (package-desc-status pkg-desc)))
-                      (format "status:%s" status))))
+    (let ((status-list
+           (if (listp status)
+               status
+             (split-string status ","))))
+      (package-menu--filter-by
+       (lambda (pkg-desc)
+         (member (package-desc-status pkg-desc) status-list))
+       (format "status:%s" (string-join status-list ","))))))
 
 (defun package-menu-filter-by-version (version predicate)
   "Filter the \"*Packages*\" buffer by VERSION and PREDICATE.
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index 7d042a9..396949d 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -355,11 +355,16 @@ provided in the Commentary section of this library."
       (reb-delete-overlays))
     (setq reb-target-buffer (current-buffer)
           reb-target-window (selected-window))
-    (select-window (or (get-buffer-window reb-buffer)
-                      (progn
-                        (setq reb-window-config (current-window-configuration))
-                        (split-window (selected-window) (- (window-height) 
4)))))
-    (switch-to-buffer (get-buffer-create reb-buffer))
+    (select-window
+     (or (get-buffer-window reb-buffer)
+         (let ((dir (if (window-parameter nil 'window-side)
+                        'bottom 'down)))
+           (setq reb-window-config (current-window-configuration))
+           (display-buffer
+            (get-buffer-create reb-buffer)
+            `((display-buffer-in-direction)
+              (direction . ,dir)
+              (dedicated . t))))))
     (font-lock-mode 1)
     (reb-initialize-buffer)))
 
diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el
index c1d0594..02f2ad3 100644
--- a/lisp/emacs-lisp/shadow.el
+++ b/lisp/emacs-lisp/shadow.el
@@ -115,9 +115,12 @@ See the documentation for `list-load-path-shadows' for 
further information."
          ;; FILE now contains the current file name, with no suffix.
          (unless (or (member file files-seen-this-dir)
                      ;; Ignore these files.
-                     (member file (list "subdirs" "leim-list"
-                                        (file-name-sans-extension
-                                         dir-locals-file))))
+                     (member file
+                              (list "subdirs" "leim-list"
+                                   (file-name-sans-extension dir-locals-file)
+                                    (concat
+                                    (file-name-sans-extension dir-locals-file)
+                                     "-2"))))
            ;; File has not been seen yet in this directory.
            ;; This test prevents us declaring that XXX.el shadows
            ;; XXX.elc (or vice-versa) when they are in the same directory.
diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index 4df4040..4beba1d 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -162,6 +162,10 @@ There can be any number of :example/:result elements."
    :eval (split-string "foo bar")
    :eval (split-string "|foo|bar|" "|")
    :eval (split-string "|foo|bar|" "|" t))
+  (split-string-and-unquote
+   :eval (split-string-and-unquote "foo \"bar zot\""))
+  (split-string-shell-command
+   :eval (split-string-shell-command "ls /tmp/'foo bar'"))
   (string-lines
    :eval (string-lines "foo\n\nbar")
    :eval (string-lines "foo\n\nbar" t))
@@ -499,9 +503,13 @@ There can be any number of :example/:result elements."
   (flatten-tree
    :eval (flatten-tree '(1 (2 3) 4)))
   (car
-   :eval (car '(one two three)))
+   :eval (car '(one two three))
+   :eval (car '(one . two))
+   :eval (car nil))
   (cdr
-   :eval (cdr '(one two three)))
+   :eval (cdr '(one two three))
+   :eval (cdr '(one . two))
+   :eval (cdr nil))
   (last
    :eval (last '(one two three)))
   (butlast
@@ -1137,8 +1145,9 @@ There can be any number of :example/:result elements."
    :eval (sqrt -1)))
 
 ;;;###autoload
-(defun shortdoc-display-group (group)
-  "Pop to a buffer with short documentation summary for functions in GROUP."
+(defun shortdoc-display-group (group &optional function)
+  "Pop to a buffer with short documentation summary for functions in GROUP.
+If FUNCTION is non-nil, place point on the entry for FUNCTION (if any)."
   (interactive (list (completing-read "Show summary for functions in: "
                                       (mapcar #'car shortdoc--groups))))
   (when (stringp group)
@@ -1169,15 +1178,17 @@ There can be any number of :example/:result elements."
          (setq prev t)
          (shortdoc--display-function data))))
      (cdr (assq group shortdoc--groups))))
-  (goto-char (point-min)))
+  (goto-char (point-min))
+  (when function
+    (text-property-search-forward 'shortdoc-function function t)
+    (beginning-of-line)))
 
 (defun shortdoc--display-function (data)
   (let ((function (pop data))
         (start-section (point))
         arglist-start)
     ;; Function calling convention.
-    (insert (propertize "("
-                        'shortdoc-function t))
+    (insert (propertize "(" 'shortdoc-function function))
     (if (plist-get data :no-manual)
         (insert-text-button
          (symbol-name function)
@@ -1308,16 +1319,15 @@ Example:
 (define-derived-mode shortdoc-mode special-mode "shortdoc"
   "Mode for shortdoc.")
 
-(defmacro shortdoc--goto-section (arg sym &optional reverse)
-  `(progn
-     (unless (natnump ,arg)
-       (setq ,arg 1))
-     (while (< 0 ,arg)
-       (,(if reverse
-             'text-property-search-backward
-           'text-property-search-forward)
-        ,sym t)
-       (setq ,arg (1- ,arg)))))
+(defun shortdoc--goto-section (arg sym &optional reverse)
+  (unless (natnump arg)
+    (setq arg 1))
+  (while (> arg 0)
+    (funcall
+     (if reverse 'text-property-search-backward
+       'text-property-search-forward)
+     sym nil t t)
+    (setq arg (1- arg))))
 
 (defun shortdoc-next (&optional arg)
   "Move cursor to the next function.
diff --git a/lisp/emacs-lisp/tabulated-list.el 
b/lisp/emacs-lisp/tabulated-list.el
index 0b10dfd..04f3b70 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -36,6 +36,8 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'cl-lib))
+
 (defgroup tabulated-list nil
   "Tabulated-list customization group."
   :group 'convenience
@@ -645,18 +647,41 @@ this is the vector stored within it."
 
 (defun tabulated-list-sort (&optional n)
   "Sort Tabulated List entries by the column at point.
-With a numeric prefix argument N, sort the Nth column."
+With a numeric prefix argument N, sort the Nth column.
+
+If the numeric prefix is -1, restore order the list was
+originally displayed in."
   (interactive "P")
-  (let ((name (if n
-                 (car (aref tabulated-list-format n))
-               (get-text-property (point)
-                                  'tabulated-list-column-name))))
-    (if (nth 2 (assoc name (append tabulated-list-format nil)))
-        (tabulated-list--sort-by-column-name name)
-      (user-error "Cannot sort by %s" name))))
+  (if (equal n -1)
+      ;; Restore original order.
+      (progn
+        (unless tabulated-list--original-order
+          (error "Order is already in original order"))
+        (setq tabulated-list-entries
+              (sort tabulated-list-entries
+                    (lambda (e1 e2)
+                      (< (gethash e1 tabulated-list--original-order)
+                         (gethash e2 tabulated-list--original-order)))))
+        (setq tabulated-list-sort-key nil)
+        (tabulated-list-init-header)
+        (tabulated-list-print t))
+    ;; Sort based on a column name.
+    (let ((name (if n
+                   (car (aref tabulated-list-format n))
+                 (get-text-property (point)
+                                    'tabulated-list-column-name))))
+      (if (nth 2 (assoc name (append tabulated-list-format nil)))
+          (tabulated-list--sort-by-column-name name)
+        (user-error "Cannot sort by %s" name)))))
 
 (defun tabulated-list--sort-by-column-name (name)
   (when (and name (derived-mode-p 'tabulated-list-mode))
+    (unless tabulated-list--original-order
+      ;; Store the original order so that we can restore it later.
+      (setq tabulated-list--original-order (make-hash-table))
+      (cl-loop for elem in tabulated-list-entries
+               for i from 0
+               do (setf (gethash elem tabulated-list--original-order) i)))
     ;; Flip the sort order on a second click.
     (if (equal name (car tabulated-list-sort-key))
        (setcdr tabulated-list-sort-key
@@ -717,6 +742,8 @@ Interactively, N is the prefix numeric argument, and 
defaults to
 
 ;;; The mode definition:
 
+(defvar tabulated-list--original-order nil)
+
 (define-derived-mode tabulated-list-mode special-mode "Tabulated"
   "Generic major mode for browsing a list of items.
 This mode is usually not used directly; instead, other major
@@ -757,6 +784,7 @@ as the ewoc pretty-printer."
   (setq-local glyphless-char-display
               (tabulated-list-make-glyphless-char-display-table))
   (setq-local text-scale-remap-header-line t)
+  (setq-local tabulated-list--original-order nil)
   ;; Avoid messing up the entries' display just because the first
   ;; column of the first entry happens to begin with a R2L letter.
   (setq bidi-paragraph-direction 'left-to-right)
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 855ce0b..7229d61 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -244,6 +244,10 @@ return a string which is inserted.  It may set 
`facemenu-end-add-face'."
   (define-key map [fc] (cons "Face" 'facemenu-face-menu)))
 (defalias 'facemenu-menu facemenu-menu)
 
+;;;###autoload (autoload 'facemenu-menu "facemenu" nil nil 'keymap)
+;;;###autoload
+(define-key global-map [C-down-mouse-2] 'facemenu-menu)
+
 (easy-menu-add-item
  menu-bar-edit-menu nil
  ["Text Properties" facemenu-menu])
@@ -714,7 +718,13 @@ they are used to set the face information.
 As a special case, if FACE is `default', then the region is left with NO face
 text property.  Otherwise, selecting the default face would not have any
 effect.  See `facemenu-remove-face-function'."
-  (interactive "*xFace: \nr")
+  (interactive (list (progn
+                      (barf-if-buffer-read-only)
+                      (read-face-name "Use face" (face-at-point t)))
+                    (if (and mark-active (not current-prefix-arg))
+                        (region-beginning))
+                    (if (and mark-active (not current-prefix-arg))
+                        (region-end))))
   (cond
    ((and (eq face 'default)
          (not (eq facemenu-remove-face-function t)))
diff --git a/lisp/faces.el b/lisp/faces.el
index bc0c3f9..301b249 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2914,23 +2914,30 @@ It is used for characters of no fonts too."
 
 ;; Faces for TTY menus.
 (defface tty-menu-enabled-face
-  '((t
-     :foreground "yellow" :background "blue" :weight bold))
+  '((((class color))
+     :foreground "yellow" :background "blue" :weight bold)
+    (t :weight bold))
   "Face for displaying enabled items in TTY menus."
-  :group 'basic-faces)
+  :group 'basic-faces
+  :version "28.1")
 
 (defface tty-menu-disabled-face
   '((((class color) (min-colors 16))
      :foreground "lightgray" :background "blue")
-    (t
-     :foreground "white" :background "blue"))
+    (((class color))
+     :foreground "white" :background "blue")
+    (t :inherit shadow))
   "Face for displaying disabled items in TTY menus."
-  :group 'basic-faces)
+  :group 'basic-faces
+  :version "28.1")
 
 (defface tty-menu-selected-face
-  '((t :background "red"))
+  '((((class color))
+      :background "red")
+    (t :inverse-video t))
   "Face for displaying the currently selected item in TTY menus."
-  :group 'basic-faces)
+  :group 'basic-faces
+  :version "28.1")
 
 (defgroup paren-showing-faces nil
   "Faces used to highlight paren matches."
diff --git a/lisp/ffap.el b/lisp/ffap.el
index 6faf8d5..c31926e 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -260,6 +260,7 @@ ffap most of the time."
   :type 'boolean
   :group 'ffap)
 
+;;;###autoload
 (defcustom ffap-file-finder 'find-file
   "The command called by `find-file-at-point' to find a file."
   :type 'function
diff --git a/lisp/files.el b/lisp/files.el
index 859c193..d97c93e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -465,6 +465,31 @@ If `silently', don't ask the user before saving."
   :type '(choice (const t) (const nil) (const silently))
   :group 'abbrev)
 
+(defcustom lock-file-name-transforms nil
+  "Transforms to apply to buffer file name before making a lock file name.
+This has the same syntax as
+`auto-save-file-name-transforms' (which see), but instead of
+applying to auto-save file names, it's applied to lock file names.
+
+By default, a lock file is put into the same directory as the
+file it's locking, and it has the same name, but with \".#\" prepended."
+  :group 'files
+  :type '(repeat (list (regexp :tag "Regexp")
+                       (string :tag "Replacement")
+                      (boolean :tag "Uniquify")))
+  :version "28.1")
+
+(defcustom remote-file-name-inhibit-locks nil
+  "Whether to use file locks for remote files."
+  :group 'files
+  :version "28.1"
+  :type 'boolean)
+
+(define-minor-mode lock-file-mode
+  "Toggle file locking in the current buffer (Lock File mode)."
+  :version "28.1"
+  (setq-local create-lockfiles (and lock-file-mode t)))
+
 (defcustom find-file-run-dired t
   "Non-nil means allow `find-file' to visit directories.
 To visit the directory, `find-file' runs `find-directory-functions'."
@@ -2133,6 +2158,19 @@ think it does, because \"free\" is pretty hard to define 
in practice."
   :version "25.1"
   :type '(choice integer (const :tag "Never issue warning" nil)))
 
+(defcustom query-about-changed-file t
+  "If non-nil, query the user when re-visiting a file that has changed.
+This happens if the file is already visited in a buffer, the
+file was changed externally, and the user re-visits the file.
+
+If nil, don't prompt the user, but instead provide instructions for
+reverting, after switching to the buffer with its contents before
+the external changes."
+  :group 'files
+  :group 'find-file
+  :version "28.1"
+  :type 'boolean)
+
 (declare-function x-popup-dialog "menu.c" (position contents &optional header))
 
 (defun files--ask-user-about-large-file-help-text (op-type size)
@@ -2315,6 +2353,14 @@ the various files."
                           (message "Reverting file %s..." filename)
                           (revert-buffer t t)
                           (message "Reverting file %s...done" filename)))
+                        ((not query-about-changed-file)
+                         (message
+                          (substitute-command-keys
+                           "File %s changed on disk.  \\[revert-buffer] to 
load new contents%s")
+                          (file-name-nondirectory filename)
+                          (if (buffer-modified-p buf)
+                              " and discard your edits"
+                            "")))
                        ((yes-or-no-p
                          (if (string= (file-name-nondirectory filename)
                                       (buffer-name buf))
@@ -6664,67 +6710,15 @@ Does not consider `auto-save-visited-file-name' as that 
variable is checked
 before calling this function.
 See also `auto-save-file-name-p'."
   (if buffer-file-name
-      (let ((handler (find-file-name-handler buffer-file-name
-                                            'make-auto-save-file-name)))
+      (let ((handler (find-file-name-handler
+                      buffer-file-name 'make-auto-save-file-name)))
        (if handler
            (funcall handler 'make-auto-save-file-name)
-         (let ((list auto-save-file-name-transforms)
-               (filename buffer-file-name)
-               result uniq)
-           ;; Apply user-specified translations
-           ;; to the file name.
-           (while (and list (not result))
-             (if (string-match (car (car list)) filename)
-                 (setq result (replace-match (cadr (car list)) t nil
-                                             filename)
-                       uniq (car (cddr (car list)))))
-             (setq list (cdr list)))
-           (if result
-                (setq filename
-                      (cond
-                       ((memq uniq (secure-hash-algorithms))
-                        (concat
-                         (file-name-directory result)
-                         (secure-hash uniq filename)))
-                       (uniq
-                        (concat
-                        (file-name-directory result)
-                        (subst-char-in-string
-                         ?/ ?!
-                         (replace-regexp-in-string
-                           "!" "!!" filename))))
-                      (t result))))
-           (setq result
-                 (if (and (eq system-type 'ms-dos)
-                          (not (msdos-long-file-names)))
-                     ;; We truncate the file name to DOS 8+3 limits
-                     ;; before doing anything else, because the regexp
-                     ;; passed to string-match below cannot handle
-                     ;; extensions longer than 3 characters, multiple
-                     ;; dots, and other atrocities.
-                     (let ((fn (dos-8+3-filename
-                                (file-name-nondirectory buffer-file-name))))
-                       (string-match
-                        "\\`\\([^.]+\\)\\(\\.\\(..?\\)?.?\\|\\)\\'"
-                        fn)
-                       (concat (file-name-directory buffer-file-name)
-                               "#" (match-string 1 fn)
-                               "." (match-string 3 fn) "#"))
-                   (concat (file-name-directory filename)
-                           "#"
-                           (file-name-nondirectory filename)
-                           "#")))
-           ;; Make sure auto-save file names don't contain characters
-           ;; invalid for the underlying filesystem.
-           (if (and (memq system-type '(ms-dos windows-nt cygwin))
-                    ;; Don't modify remote filenames
-                     (not (file-remote-p result)))
-               (convert-standard-filename result)
-             result))))
-
+          (files--transform-file-name
+           buffer-file-name auto-save-file-name-transforms
+                                          "#" "#")))
     ;; Deal with buffers that don't have any associated files.  (Mail
     ;; mode tends to create a good number of these.)
-
     (let ((buffer-name (buffer-name))
          (limit 0)
          file-name)
@@ -6772,6 +6766,74 @@ See also `auto-save-file-name-p'."
        (file-error nil))
       file-name)))
 
+(defun files--transform-file-name (filename transforms prefix suffix)
+  "Transform FILENAME according to TRANSFORMS.
+See `auto-save-file-name-transforms' for the format of
+TRANSFORMS.  PREFIX is prepended to the non-directory portion of
+the resulting file name, and SUFFIX is appended."
+  (save-match-data
+    (let (result uniq)
+      ;; Apply user-specified translations to the file name.
+      (while (and transforms (not result))
+        (if (string-match (car (car transforms)) filename)
+           (setq result (replace-match (cadr (car transforms)) t nil
+                                       filename)
+                 uniq (car (cddr (car transforms)))))
+        (setq transforms (cdr transforms)))
+      (when result
+        (setq filename
+              (cond
+               ((memq uniq (secure-hash-algorithms))
+                (concat
+                 (file-name-directory result)
+                 (secure-hash uniq filename)))
+               (uniq
+                (concat
+                (file-name-directory result)
+                (subst-char-in-string
+                 ?/ ?!
+                 (replace-regexp-in-string
+                   "!" "!!" filename))))
+              (t result))))
+      (setq result
+           (if (and (eq system-type 'ms-dos)
+                    (not (msdos-long-file-names)))
+               ;; We truncate the file name to DOS 8+3 limits before
+               ;; doing anything else, because the regexp passed to
+               ;; string-match below cannot handle extensions longer
+               ;; than 3 characters, multiple dots, and other
+               ;; atrocities.
+               (let ((fn (dos-8+3-filename
+                          (file-name-nondirectory buffer-file-name))))
+                 (string-match
+                  "\\`\\([^.]+\\)\\(\\.\\(..?\\)?.?\\|\\)\\'"
+                  fn)
+                 (concat (file-name-directory buffer-file-name)
+                         prefix (match-string 1 fn)
+                         "." (match-string 3 fn) suffix))
+             (concat (file-name-directory filename)
+                     prefix
+                     (file-name-nondirectory filename)
+                     suffix)))
+      ;; Make sure auto-save file names don't contain characters
+      ;; invalid for the underlying filesystem.
+      (expand-file-name
+       (if (and (memq system-type '(ms-dos windows-nt cygwin))
+               ;; Don't modify remote filenames
+                (not (file-remote-p result)))
+          (convert-standard-filename result)
+         result)))))
+
+(defun make-lock-file-name (filename)
+  "Make a lock file name for FILENAME.
+By default, this just prepends \".#\" to the non-directory part
+of FILENAME, but the transforms in `lock-file-name-transforms'
+are done first."
+  (let ((handler (find-file-name-handler filename 'make-lock-file-name)))
+    (if handler
+       (funcall handler 'make-lock-file-name filename)
+      (files--transform-file-name filename lock-file-name-transforms ".#" 
""))))
+
 (defun auto-save-file-name-p (filename)
   "Return non-nil if FILENAME can be yielded by `make-auto-save-file-name'.
 FILENAME should lack slashes.
diff --git a/lisp/frame.el b/lisp/frame.el
index bb5da0d..302993e 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1397,7 +1397,7 @@ FRAME defaults to the selected frame."
 (declare-function x-list-fonts "xfaces.c"
                   (pattern &optional face frame maximum width))
 
-(defun set-frame-font (font &optional keep-size frames)
+(defun set-frame-font (font &optional keep-size frames inhibit-customize)
   "Set the default font to FONT.
 When called interactively, prompt for the name of a font, and use
 that font on the selected frame.  When called from Lisp, FONT
@@ -1414,7 +1414,10 @@ If FRAMES is non-nil, it should be a list of frames to 
act upon,
 or t meaning all existing graphical frames.
 Also, if FRAMES is non-nil, alter the user's Customization settings
 as though the font-related attributes of the `default' face had been
-\"set in this session\", so that the font is applied to future frames."
+\"set in this session\", so that the font is applied to future frames.
+
+If INHIBIT-CUSTOMIZE is non-nil, don't update the user's
+Customization settings."
   (interactive
    (let* ((completion-ignore-case t)
           (default (frame-parameter nil 'font))
@@ -1451,7 +1454,8 @@ as though the font-related attributes of the `default' 
face had been
               f
               (list (cons 'height (round height (frame-char-height f)))
                     (cons 'width  (round width  (frame-char-width f))))))))
-      (when frames
+      (when (and frames
+                 (not inhibit-customize))
        ;; Alter the user's Custom setting of the `default' face, but
        ;; only for font-related attributes.
        (let ((specs (cadr (assq 'user (get 'default 'theme-face))))
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index f2ec946..b989446 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -6039,7 +6039,28 @@ If nil, don't show those extra buttons."
        (ignored gnus-ignored-mime-types)
        (mm-inline-font-lock (gnus-visual-p 'article-highlight 'highlight))
        (not-attachment t)
-       display text)
+        ;; Arrange a callback from `mm-inline-message' if we're
+        ;; displaying a message/rfc822 part.
+        (mm-inline-message-prepare-function
+         (lambda (charset)
+           (let ((handles
+                  (let (gnus-article-mime-handles
+                       ;; disable prepare hook
+                       gnus-article-prepare-hook
+                       (gnus-newsgroup-charset
+                         ;; mm-uu might set it.
+                        (unless (eq charset 'gnus-decoded)
+                          (or charset gnus-newsgroup-charset))))
+                   (let ((gnus-original-article-buffer
+                           (mm-handle-buffer handle)))
+                     (run-hooks 'gnus-article-decode-hook))
+                   (gnus-article-prepare-display)
+                    gnus-article-mime-handles)))
+            (when handles
+              (setq gnus-article-mime-handles
+                    (mm-merge-handles gnus-article-mime-handles handles))))))
+       display text
+        gnus-displaying-mime)
     (catch 'ignored
       (progn
        (while ignored
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index bac987e..db54237 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -1597,6 +1597,10 @@ this is a reply."
                  (if (stringp gnus-gcc-externalize-attachments)
                      (string-match gnus-gcc-externalize-attachments group)
                    gnus-gcc-externalize-attachments))
+            ;; If we want to externalize stuff when GCC-ing, then we
+            ;; can't use the cache, because that has all the contents.
+            (when mml-externalize-attachments
+              (setq encoded-cache nil))
            (save-excursion
              (nnheader-set-temp-buffer " *acc*")
              (setq message-options (with-current-buffer cur message-options))
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index 70bde26..39bde83 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -448,10 +448,10 @@ auto-completion of contact names and addresses for keys 
like
 Date values (any key in `gnus-search-date-keys') can be provided
 in any format that `parse-time-string' can parse (note that this
 can produce weird results).  Dates with missing bits will be
-interpreted as the most recent occurence thereof (ie \"march 03\"
-is the most recent March 3rd).  Lastly, relative specifications
-such as 1d (one day ago) are understood.  This also accepts w, m,
-and y.  m is assumed to be 30 days.
+interpreted as the most recent occurrence thereof (i.e. \"march
+03\" is the most recent March 3rd).  Lastly, relative
+specifications such as 1d (one day ago) are understood.  This
+also accepts w, m, and y.  m is assumed to be 30 days.
 
 This function will accept pretty much anything as input.  Its
 only job is to parse the query into a sexp, and pass that on --
@@ -629,25 +629,30 @@ gnus-*-mark marks, and return an appropriate string."
     mark))
 
 (defun gnus-search-query-expand-key (key)
-  (cond ((test-completion key gnus-search-expandable-keys)
-        ;; We're done!
-        key)
-       ;; There is more than one possible completion.
-       ((consp (cdr (completion-all-completions
-                     key gnus-search-expandable-keys #'stringp 0)))
-        (signal 'gnus-search-parse-error
-                (list (format "Ambiguous keyword: %s" key))))
-       ;; Return KEY, either completed or untouched.
-       ((car-safe (completion-try-completion
-                   key gnus-search-expandable-keys
-                   #'stringp 0)))))
+  "Attempt to expand KEY to a full keyword.
+Use `gnus-search-expandable-keys' as a completion table; return
+KEY directly if it can't be completed.  Raise an error if KEY is
+ambiguous, meaning that it is a prefix of multiple known
+keywords.  This means that it's not possible to enter a custom
+keyword that happens to be a prefix of a known keyword."
+  (let ((comp (try-completion key gnus-search-expandable-keys)))
+    (if (or (eql comp 't)              ; Already a key.
+           (null comp))                ; An unknown key.
+       key
+      (if (null (member comp gnus-search-expandable-keys))
+         ;; KEY is a prefix of multiple known keywords, and could not
+         ;; be completed to something unique.
+         (signal 'gnus-search-parse-error
+                 (list (format "Ambiguous keyword: %s" key)))
+       ;; We completed to a unique known key.
+       comp))))
 
 (defun gnus-search-query-return-string (&optional delimited trim)
   "Return a string from the current buffer.
 If DELIMITED is non-nil, assume the next character is a delimiter
 character, and return everything between point and the next
-occurence of the delimiter, including the delimiters themselves.
-If TRIM is non-nil, do not return the delimiters. Otherwise,
+occurrence of the delimiter, including the delimiters themselves.
+If TRIM is non-nil, do not return the delimiters.  Otherwise,
 return one word."
   ;; This function cannot handle nested delimiters, as it's not a
   ;; proper parser.  Ie, you cannot parse "to:bob or (from:bob or
@@ -1351,68 +1356,59 @@ Returns a list of [group article score] vectors."
 
 (cl-defmethod gnus-search-indexed-parse-output ((engine gnus-search-indexed)
                                                server query &optional groups)
-  (let ((prefix (slot-value engine 'remove-prefix))
-       (group-regexp (when groups
-                       (mapconcat
-                        (lambda (group-name)
-                          (mapconcat #'regexp-quote
-                                     (split-string
-                                      (gnus-group-real-name group-name)
-                                      "[.\\/]")
-                                     "[.\\\\/]"))
-                        groups
-                        "\\|")))
-       artlist vectors article group)
+  (let ((prefix (or (slot-value engine 'remove-prefix)
+                    ""))
+       artlist article group)
     (goto-char (point-min))
+    ;; Prep prefix, we want to at least be removing the root
+    ;; filesystem separator.
+    (when (stringp prefix)
+      (setq prefix (file-name-as-directory
+                    (expand-file-name prefix "/"))))
     (while (not (or (eobp)
                     (looking-at-p
                      "\\(?:[[:space:]\n]+\\)?Process .+ finished")))
       (pcase-let ((`(,f-name ,score) (gnus-search-indexed-extract engine)))
        (when (and f-name
                    (file-readable-p f-name)
-                  (null (file-directory-p f-name))
-                  (or (null groups)
-                      (and (gnus-search-single-p query)
-                           (alist-get 'thread query))
-                      (string-match-p group-regexp f-name)))
-         (push (list f-name score) artlist))))
+                  (null (file-directory-p f-name)))
+          (setq group
+                (replace-regexp-in-string
+                "[/\\]" "."
+                (replace-regexp-in-string
+                 "/?\\(cur\\|new\\|tmp\\)?/\\'" ""
+                 (replace-regexp-in-string
+                  "\\`\\." ""
+                  (string-remove-prefix
+                    prefix (file-name-directory f-name))
+                   nil t)
+                 nil t)
+                nil t))
+          (setq group (gnus-group-full-name group server))
+          (setq article (file-name-nondirectory f-name)
+                article
+                ;; TODO: Provide a cleaner way of producing final
+                ;; article numbers for the various backends.
+                (if (string-match-p "\\`[[:digit:]]+\\'" article)
+                   (string-to-number article)
+                 (nnmaildir-base-name-to-article-number
+                  (substring article 0 (string-match ":" article))
+                  group (string-remove-prefix "nnmaildir:" server))))
+          (when (and (numberp article)
+                     (or (null groups)
+                         (member group groups)))
+           (push (list f-name article group score)
+                  artlist)))))
     ;; Are we running an additional grep query?
     (when-let ((grep-reg (alist-get 'grep query)))
       (setq artlist (gnus-search-grep-search engine artlist grep-reg)))
-    ;; Prep prefix.
-    (when (and prefix (null (string-empty-p prefix)))
-      (setq prefix (file-name-as-directory (expand-file-name prefix))))
-    ;; Turn (file-name score) into [group article score].
-    (pcase-dolist (`(,f-name ,score) artlist)
-      (setq article (file-name-nondirectory f-name)
-           group (file-name-directory f-name))
-      ;; Remove prefix.
-      (when prefix
-       (setq group (string-remove-prefix prefix group)))
-      ;; Break the directory name down until it's something that
-      ;; (probably) can be used as a group name.
-      (setq group
-           (replace-regexp-in-string
-            "[/\\]" "."
-            (replace-regexp-in-string
-             "/?\\(cur\\|new\\|tmp\\)?/\\'" ""
-             (replace-regexp-in-string
-              "^[./\\]" ""
-              group nil t)
-             nil t)
-            nil t))
-
-      (push (vector (gnus-group-full-name group server)
-                   (if (string-match-p "\\`[[:digit:]]+\\'" article)
-                       (string-to-number article)
-                     (nnmaildir-base-name-to-article-number
-                      (substring article 0 (string-match ":" article))
-                      group (string-remove-prefix "nnmaildir:" server)))
-                   (if (numberp score)
-                       score
-                     (string-to-number score)))
-           vectors))
-    vectors))
+    ;; Munge into the list of vectors expected by nnselect.
+    (mapcar (pcase-lambda (`(,_ ,article ,group ,score))
+              (vector group article
+                      (if (numberp score)
+                         score
+                       (string-to-number score))))
+            artlist)))
 
 (cl-defmethod gnus-search-indexed-extract ((_engine gnus-search-indexed))
   "Base implementation treats the whole line as a filename, and
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index a9be2d6..cdabdef 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -1658,6 +1658,11 @@ starting with `not' and followed by regexps."
   "Face used for displaying MML."
   :group 'message-faces)
 
+(defface message-signature-separator '((t :bold t))
+  "Face used for displaying the signature separator."
+  :group 'message-faces
+  :version "28.1")
+
 (defun message-match-to-eoh (_limit)
   (let ((start (point)))
     (rfc822-goto-eoh)
@@ -1751,9 +1756,22 @@ number of levels specified in the faces 
`message-cited-text-*'."
                 (0 ',cited-text-face))
               keywords))
        (setq level (1+ level)))
-     keywords))
+     keywords)
+   ;; Match signature.  This `field' stuff ensures that hitting `RET'
+   ;; after the signature separator doesn't remove the trailing space.
+   (list
+    '(message--match-signature (0 '( face message-signature-separator
+                                     rear-nonsticky t
+                                     field signature)))))
   "Additional expressions to highlight in Message mode.")
 
+(defun message--match-signature (limit)
+  (save-excursion
+    (and (re-search-forward message-signature-separator limit t)
+         ;; It's the last one in the buffer.
+         (not (save-excursion
+                (re-search-forward message-signature-separator nil t))))))
+
 (defvar message-face-alist
   '((bold . message-bold-region)
     (underline . underline-region)
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 3e36d67..2ec75a0 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -418,16 +418,18 @@ This is only used if `mm-inline-large-images' is set to
   (fundamental-mode)
   (goto-char (point-min)))
 
-(defvar gnus-original-article-buffer)
-(defvar gnus-article-prepare-hook)
-(defvar gnus-displaying-mime)
+(defvar mm-inline-message-prepare-function nil
+  "Function called by `mm-inline-message' to do client specific setup.
+It is called with one parameter -- the charset.")
 
 (defun mm-inline-message (handle)
+  "Insert HANDLE (a message/rfc822 part) into the current buffer.
+This function will call `mm-inline-message-prepare-function'
+after inserting the part."
   (let ((b (point))
        (bolp (bolp))
        (charset (mail-content-type-get
-                 (mm-handle-type handle) 'charset))
-       gnus-displaying-mime handles)
+                 (mm-handle-type handle) 'charset)))
     (when (and charset
               (stringp charset))
       (setq charset (intern (downcase charset)))
@@ -437,16 +439,8 @@ This is only used if `mm-inline-large-images' is set to
       (save-restriction
        (narrow-to-region b b)
        (mm-insert-part handle)
-       (let (gnus-article-mime-handles
-             ;; disable prepare hook
-             gnus-article-prepare-hook
-             (gnus-newsgroup-charset
-              (unless (eq charset 'gnus-decoded) ;; mm-uu might set it.
-                (or charset gnus-newsgroup-charset))))
-         (let ((gnus-original-article-buffer (mm-handle-buffer handle)))
-           (run-hooks 'gnus-article-decode-hook))
-         (gnus-article-prepare-display)
-         (setq handles gnus-article-mime-handles))
+        (when mm-inline-message-prepare-function
+         (funcall mm-inline-message-prepare-function charset))
        (goto-char (point-min))
        (unless bolp
          (insert "\n"))
@@ -454,9 +448,6 @@ This is only used if `mm-inline-large-images' is set to
        (unless (bolp)
          (insert "\n"))
        (insert "----------\n\n")
-       (when handles
-         (setq gnus-article-mime-handles
-               (mm-merge-handles gnus-article-mime-handles handles)))
        (mm-handle-set-undisplayer
         handle
         (let ((beg (point-min-marker))
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index afdb0d1..cb248b1 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -752,7 +752,7 @@ FILE is the file where FUNCTION was probably defined."
            (insert-text-button
             (symbol-name group)
             'action (lambda (_)
-                      (shortdoc-display-group group))
+                      (shortdoc-display-group group object))
             'follow-link t
             'help-echo (purecopy "mouse-1, RET: show documentation group")))
          groups)
@@ -1901,7 +1901,7 @@ documentation for the major and minor modes of that 
buffer."
                   ;; Ignore aliases.
                   (not (symbolp (symbol-function sym)))
                   ;; Ignore everything bound.
-                  (not (where-is-internal sym))
+                  (not (where-is-internal sym nil t))
                   (apply #'derived-mode-p (command-modes sym)))
          (push sym functions))))
     (with-temp-buffer
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 68f8cc5..37b88b3 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -111,7 +111,7 @@ highlighting will be applied throughout the buffer."
   :group 'hi-lock)
 
 (defcustom hi-lock-exclude-modes
-  '(rmail-mode mime/viewer-mode gnus-article-mode)
+  '(rmail-mode mime/viewer-mode gnus-article-mode term-mode)
   "List of major modes in which hi-lock will not run.
 For security reasons since font lock patterns can specify function
 calls."
diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el
index 3c3c407..8919e98 100644
--- a/lisp/hilit-chg.el
+++ b/lisp/hilit-chg.el
@@ -492,9 +492,9 @@ This allows you to manually remove highlighting from 
uninteresting changes."
   ;; otherwise an undone change shows up as changed.  While the properties
   ;; are automatically restored by undo, we must fix up the overlay.
   (save-match-data
-    (let (;;(beg-decr 1)
-          (end-incr 1)
-         (type 'hilit-chg))
+    (let ((end-incr 1)
+         (type 'hilit-chg)
+          (property 'hilit-chg))
       (if undo-in-progress
          (if (and highlight-changes-mode
                   highlight-changes-visible-mode)
@@ -515,7 +515,8 @@ This allows you to manually remove highlighting from 
uninteresting changes."
                 ;;     (setq beg-decr 0))))
                 ;; (setq beg (max (- beg beg-decr) (point-min)))
                 (setq end (min (+ end end-incr) (point-max)))
-                (setq type 'hilit-chg-delete))
+                (setq type 'hilit-chg-delete
+                      property 'hilit-chg-delete))
             ;; Not a deletion.
             ;; Most of the time the following is not necessary, but
             ;; if the current text was marked as a deletion then
@@ -523,14 +524,15 @@ This allows you to manually remove highlighting from 
uninteresting changes."
             ;; text where she earlier deleted text, we have to remove the
             ;; deletion marking, and replace it explicitly with a `changed'
             ;; marking, otherwise its highlighting would disappear.
-            (if (eq (get-text-property end 'hilit-chg) 'hilit-chg-delete)
-                (save-restriction
-                  (widen)
-                  (put-text-property end (+ end 1) 'hilit-chg 'hilit-chg)
-                  (if highlight-changes-visible-mode
-                      (hilit-chg-fixup end (+ end 1))))))
+            (when (eq (get-text-property end 'hilit-chg-delete)
+                      'hilit-chg-delete)
+              (save-restriction
+                (widen)
+                (put-text-property end (+ end 1) 'hilit-chg-delete nil)
+                (if highlight-changes-visible-mode
+                    (hilit-chg-fixup end (+ end 1))))))
           (unless no-property-change
-            (put-text-property beg end 'hilit-chg type))
+            (put-text-property beg end property type))
           (if (or highlight-changes-visible-mode no-property-change)
               (hilit-chg-make-ov type beg end)))))))
 
diff --git a/lisp/ido.el b/lisp/ido.el
index 9362904..ea5ff32 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1521,6 +1521,10 @@ Removes badly formatted data and ignored directories."
   :global t
   (remove-function read-file-name-function #'ido-read-file-name)
   (remove-function read-buffer-function #'ido-read-buffer)
+  (when (boundp 'ffap-file-finder)
+    (remove-function ffap-file-finder #'ido-find-file)
+    (when ido-mode
+      (add-function :override ffap-file-finder #'ido-find-file)))
   (when ido-everywhere
     (if (not ido-mode)
         (ido-mode 'both)
diff --git a/lisp/image.el b/lisp/image.el
index ee15294..494c26a 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -1191,7 +1191,9 @@ rotations by only multiples of 90 degrees."
                       360)))))
 
 (defun image-save ()
-  "Save the image under point."
+  "Save the image under point.
+This writes the original image data to a file.  Rotating or
+changing the displayed image size does not affect the saved image."
   (interactive)
   (let ((image (image--get-image)))
     (with-temp-buffer
diff --git a/lisp/info.el b/lisp/info.el
index cdf339f..b65728b 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -391,6 +391,14 @@ where SUPPORTS-INDEX-COOKIES can be either t or nil.")
 (defvar-local Info-index-alternatives nil
   "List of possible matches for last `Info-index' command.")
 
+(defvar-local Info--current-index-alternative 0
+  "Current displayed index alternative.")
+
+(defcustom Info-warn-on-index-alternatives-wrap t
+  "Warn when wrapping to the beginning/end when displaying index alternatives."
+  :type 'boolean
+  :version "28.1")
+
 (defvar Info-point-loc nil
   "Point location within a selected node.
 If string, the point is moved to the proper occurrence of the
@@ -3375,39 +3383,56 @@ Give an empty topic name to go to the Index node 
itself."
            (setq exact (cons found exact)
                  matches (delq found matches)))
           (setq Info-history-list ohist-list)
-         (setq Info-index-alternatives (nconc exact (nreverse matches)))
+         (setq Info-index-alternatives (nconc exact (nreverse matches))
+                Info--current-index-alternative 0)
          (Info-index-next 0)))))
 
 (defun Info-index-next (num)
-  "Go to the next matching index item from the last 
\\<Info-mode-map>\\[Info-index] command."
+  "Go to the next matching index item from the last 
\\<Info-mode-map>\\[Info-index] command.
+If given a numeric prefix, skip that many index items forward (or
+backward).
+
+Also see the `Info-warn-on-index-alternatives-wrap' user option."
   (interactive "p" Info-mode)
-  (or Info-index-alternatives
-      (user-error "No previous `i' command"))
-  (while (< num 0)
-    (setq num (+ num (length Info-index-alternatives))))
-  (while (> num 0)
-    (setq Info-index-alternatives
-         (nconc (cdr Info-index-alternatives)
-                (list (car Info-index-alternatives)))
-         num (1- num)))
-  (Info-goto-node (nth 1 (car Info-index-alternatives)))
-  (if (> (nth 3 (car Info-index-alternatives)) 0)
-      ;; Forward 2 lines less because `Info-find-node-2' initially
-      ;; puts point to the 2nd line.
-      (forward-line (- (nth 3 (car Info-index-alternatives)) 2))
-    (forward-line 3)                   ; don't search in headers
-    (let ((name (car (car Info-index-alternatives))))
-      (Info-find-index-name name)))
-  (message "Found `%s' in %s.  %s"
-          (car (car Info-index-alternatives))
-          (nth 2 (car Info-index-alternatives))
-          (if (cdr Info-index-alternatives)
-              (format-message
-               "(%s total; use `%s' for next)"
-               (length Info-index-alternatives)
-               (key-description (where-is-internal
-                                 'Info-index-next overriding-local-map t)))
-            "(Only match)")))
+  (unless Info-index-alternatives
+    (user-error "No previous `i' command"))
+  (let ((index (+ Info--current-index-alternative num))
+        (total (length Info-index-alternatives))
+        (next-key (key-description (where-is-internal
+                                   'Info-index-next overriding-local-map t))))
+    (if (and Info-warn-on-index-alternatives-wrap
+             (> total 1)
+             (cond
+              ((< index 0)
+               (setq Info--current-index-alternative (- total 2))
+               (message
+                "No previous matches, use `%s' to continue from end of list"
+                next-key)
+               t)
+              ((>= index total)
+               (setq Info--current-index-alternative -1)
+               (message
+                "No previous matches, use `%s' to continue from start of list"
+                next-key)
+               t)))
+        ()                              ; Do nothing
+      (setq index (mod index total)
+            Info--current-index-alternative index)
+      (let ((entry (nth index Info-index-alternatives)))
+        (Info-goto-node (nth 1 entry))
+        (if (> (nth 3 entry) 0)
+            ;; Forward 2 lines less because `Info-find-node-2' initially
+            ;; puts point to the 2nd line.
+            (forward-line (- (nth 3 entry) 2))
+          (forward-line 3)              ; don't search in headers
+          (Info-find-index-name (car entry)))
+        (message "Found `%s' in %s.  %s"
+                (car entry)
+                (nth 2 entry)
+                (if (> total 1)
+                    (format-message
+                      "(%s total; use `%s' for next)" total next-key)
+                  "(Only match)"))))))
 
 (defun Info-find-index-name (name)
   "Move point to the place within the current node where NAME is defined."
diff --git a/lisp/isearch.el b/lisp/isearch.el
index c8bd628..922ab0f 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -233,6 +233,7 @@ called with the positions of the start and the end of the 
text
 matched by Isearch and replace commands.  If this function
 returns nil, Isearch and replace commands will continue searching
 without stopping at resp. replacing this match.
+This function is expected to be careful not to clobber the match data.
 
 If you use `add-function' to modify this variable, you can use the
 `isearch-message-prefix' advice property to specify the prefix string
@@ -3529,11 +3530,14 @@ Optional third argument, if t, means if fail just 
return nil (no error).
          ;; Clear RETRY unless the search predicate says
          ;; to skip this search hit.
          (if (or (not isearch-success)
-                 (bobp) (eobp)
-                 (= (match-beginning 0) (match-end 0))
                  (funcall isearch-filter-predicate
                           (match-beginning 0) (match-end 0)))
-             (setq retry nil)))
+             (setq retry nil)
+           ;; Advance point on empty matches before retrying
+           (when (= (match-beginning 0) (match-end 0))
+             (if (if isearch-forward (eobp) (bobp))
+                 (setq retry nil isearch-success nil)
+               (forward-char (if isearch-forward 1 -1))))))
        (setq isearch-just-started nil)
        (when isearch-success
          (setq isearch-other-end
@@ -4044,7 +4048,6 @@ Attempt to do the search exactly the way the pending 
Isearch would."
          ;; Clear RETRY unless the search predicate says
          ;; to skip this search hit.
          (if (or (not success)
-                 (= (point) bound) ; like (bobp) (eobp) in `isearch-search'.
                  (= (match-beginning 0) (match-end 0))
                  (funcall isearch-filter-predicate
                           (match-beginning 0) (match-end 0)))
diff --git a/lisp/jka-cmpr-hook.el b/lisp/jka-cmpr-hook.el
index 11d93a6..6933a7c 100644
--- a/lisp/jka-cmpr-hook.el
+++ b/lisp/jka-cmpr-hook.el
@@ -104,6 +104,9 @@ Otherwise, it is nil.")
 (defun jka-compr-info-can-append           (info)  (aref info 7))
 (defun jka-compr-info-strip-extension      (info)  (aref info 8))
 (defun jka-compr-info-file-magic-bytes     (info)  (aref info 9))
+(defun jka-compr-info-uncompress-function  (info)
+  (and (> (length info) 10)
+       (aref info 10)))
 
 
 (defun jka-compr-get-compression-info (filename)
@@ -197,13 +200,15 @@ options through Custom does this automatically."
   ;;[regexp
   ;; compr-message  compr-prog  compr-args
   ;; uncomp-message uncomp-prog uncomp-args
-  ;; can-append strip-extension-flag file-magic-bytes]
+  ;; can-append strip-extension-flag file-magic-bytes
+  ;; uncompress-function]
   (mapcar 'purecopy
   '(["\\.Z\\'"
      "compressing"    "compress"     ("-c")
      ;; gzip is more common than uncompress. It can only read, not write.
      "uncompressing"  "gzip"   ("-c" "-q" "-d")
-     nil t "\037\235"]
+     nil t "\037\235"
+     zlib-decompress-region]
      ;; Formerly, these had an additional arg "-c", but that fails with
      ;; "Version 0.1pl2, 29-Aug-97." (RedHat 5.1 GNU/Linux) and
      ;; "Version 0.9.0b, 9-Sept-98".
@@ -218,11 +223,13 @@ options through Custom does this automatically."
     ["\\.\\(?:tgz\\|svgz\\|sifz\\)\\'"
      "compressing"        "gzip"         ("-c" "-q")
      "uncompressing"      "gzip"         ("-c" "-q" "-d")
-     t nil "\037\213"]
+     t nil "\037\213"
+     zlib-decompress-region]
     ["\\.g?z\\'"
      "compressing"        "gzip"         ("-c" "-q")
      "uncompressing"      "gzip"         ("-c" "-q" "-d")
-     t t "\037\213"]
+     t t "\037\213"
+     zlib-decompress-region]
     ["\\.lz\\'"
      "Lzip compressing"   "lzip"         ("-c" "-q")
      "Lzip uncompressing" "lzip"         ("-c" "-q" "-d")
@@ -259,7 +266,7 @@ options through Custom does this automatically."
 Each element, which describes a compression technique, is a vector of
 the form [REGEXP COMPRESS-MSG COMPRESS-PROGRAM COMPRESS-ARGS
 UNCOMPRESS-MSG UNCOMPRESS-PROGRAM UNCOMPRESS-ARGS
-APPEND-FLAG STRIP-EXTENSION-FLAG FILE-MAGIC-CHARS], where:
+APPEND-FLAG STRIP-EXTENSION-FLAG FILE-MAGIC-CHARS UNCOMPRESS-FUNCTION], where:
 
    regexp                is a regexp that matches filenames that are
                          compressed with this format
@@ -275,7 +282,7 @@ APPEND-FLAG STRIP-EXTENSION-FLAG FILE-MAGIC-CHARS], where:
    uncompress-msg        is the message to issue to the user when doing this
                          type of uncompression (nil means no message)
 
-   uncompress-program    is a program that performs this compression
+   uncompress-program    is a program that performs this uncompression
 
    uncompress-args       is a list of args to pass to the uncompress program
 
@@ -288,6 +295,9 @@ APPEND-FLAG STRIP-EXTENSION-FLAG FILE-MAGIC-CHARS], where:
    file-magic-chars      is a string of characters that you would find
                         at the beginning of a file compressed in this way.
 
+   uncompress-function   is a function that performs uncompression, if
+                         uncompress-program is not found.
+
 If you set this outside Custom while Auto Compression mode is
 already enabled \(as it is by default), you have to call
 `jka-compr-update' after setting it to properly update other
@@ -309,9 +319,12 @@ variables.  Setting this through Custom does that 
automatically."
                         (repeat :tag "Uncompress Arguments" string)
                         (boolean :tag "Append")
                         (boolean :tag "Strip Extension")
-                        (string :tag "Magic Bytes")))
+                        (string :tag "Magic Bytes")
+                        (choice :tag "Uncompress Function"
+                                (symbol)
+                                (const :tag "None" nil))))
   :set 'jka-compr-set
-  :version "24.1"                      ; removed version extension piece
+  :version "28.1"                      ; add uncompress-function
   :group 'jka-compr)
 
 (defcustom jka-compr-mode-alist-additions
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el
index 2f98c8d..658ea44 100644
--- a/lisp/jka-compr.el
+++ b/lisp/jka-compr.el
@@ -386,6 +386,7 @@ There should be no more than seven characters after the 
final `/'."
 
       (let ((uncompress-message (jka-compr-info-uncompress-message info))
             (uncompress-program (jka-compr-info-uncompress-program info))
+            (uncompress-function (jka-compr-info-uncompress-function info))
             (uncompress-args (jka-compr-info-uncompress-args info))
             (base-name (file-name-nondirectory filename))
             (notfound nil)
@@ -409,58 +410,76 @@ There should be no more than seven characters after the 
final `/'."
               jka-compr-verbose
                (message "%s %s..." uncompress-message base-name))
 
-              (condition-case error-code
-
-                  (let ((coding-system-for-read 'no-conversion))
-                    (if replace
-                        (goto-char (point-min)))
-                    (setq start (point))
-                    (if (or beg end)
-                        (jka-compr-partial-uncompress uncompress-program
-                                                      (concat 
uncompress-message
-                                                              " " base-name)
-                                                      uncompress-args
-                                                      local-file
-                                                      (or beg 0)
-                                                      (if (and beg end)
-                                                          (- end beg)
-                                                        end))
-                      ;; If visiting, bind off buffer-file-name so that
-                      ;; file-locking will not ask whether we should
-                      ;; really edit the buffer.
-                      (let ((buffer-file-name
-                             (if visit nil buffer-file-name)))
-                        (jka-compr-call-process uncompress-program
-                                                (concat uncompress-message
-                                                        " " base-name)
-                                                local-file
-                                                t
-                                                nil
-                                                uncompress-args)))
-                    (setq size (- (point) start))
-                    (if replace
-                        (delete-region (point) (point-max)))
-                    (goto-char start))
-                (error
-                 ;; If the file we wanted to uncompress does not exist,
-                 ;; handle that according to VISIT as `insert-file-contents'
-                 ;; would, maybe signaling the same error it normally would.
-                 (if (and (eq (car error-code) 'file-missing)
-                          (eq (nth 3 error-code) local-file))
-                     (if visit
-                         (setq notfound error-code)
-                       (signal 'file-missing
-                               (cons "Opening input file"
-                                     (nthcdr 2 error-code))))
-                   ;; If the uncompression program can't be found,
-                   ;; signal that as a non-file error
-                   ;; so that find-file-noselect-1 won't handle it.
-                   (if (and (memq 'file-error (get (car error-code)
-                                                   'error-conditions))
-                            (equal (cadr error-code) "Searching for program"))
-                       (error "Uncompression program `%s' not found"
-                              (nth 3 error-code)))
-                   (signal (car error-code) (cdr error-code))))))
+              (if (and (not (executable-find uncompress-program))
+                       uncompress-function
+                       (fboundp uncompress-function))
+                  ;; If we don't have the uncompression program, then use the
+                  ;; internal uncompression function (if we have one).
+                  (let ((buf (current-buffer)))
+                    (with-temp-buffer
+                      (set-buffer-multibyte nil)
+                      (insert-file-contents-literally file)
+                      (funcall uncompress-function (point-min) (point-max))
+                      (when end
+                        (delete-region end (point-max)))
+                      (when beg
+                        (delete-region (point-min) beg))
+                      (setq size (buffer-size))
+                      (insert-into-buffer buf))
+                    (goto-char (point-min)))
+                ;; Use the external uncompression program.
+                (condition-case error-code
+
+                    (let ((coding-system-for-read 'no-conversion))
+                      (if replace
+                          (goto-char (point-min)))
+                      (setq start (point))
+                      (if (or beg end)
+                          (jka-compr-partial-uncompress
+                           uncompress-program
+                           (concat uncompress-message " " base-name)
+                           uncompress-args
+                           local-file
+                           (or beg 0)
+                           (if (and beg end)
+                               (- end beg)
+                             end))
+                        ;; If visiting, bind off buffer-file-name so that
+                        ;; file-locking will not ask whether we should
+                        ;; really edit the buffer.
+                        (let ((buffer-file-name
+                               (if visit nil buffer-file-name)))
+                          (jka-compr-call-process uncompress-program
+                                                  (concat uncompress-message
+                                                          " " base-name)
+                                                  local-file
+                                                  t
+                                                  nil
+                                                  uncompress-args)))
+                      (setq size (- (point) start))
+                      (if replace
+                          (delete-region (point) (point-max)))
+                      (goto-char start))
+                  (error
+                   ;; If the file we wanted to uncompress does not exist,
+                   ;; handle that according to VISIT as `insert-file-contents'
+                   ;; would, maybe signaling the same error it normally would.
+                   (if (and (eq (car error-code) 'file-missing)
+                            (eq (nth 3 error-code) local-file))
+                       (if visit
+                           (setq notfound error-code)
+                         (signal 'file-missing
+                                 (cons "Opening input file"
+                                       (nthcdr 2 error-code))))
+                     ;; If the uncompression program can't be found,
+                     ;; signal that as a non-file error
+                     ;; so that find-file-noselect-1 won't handle it.
+                     (if (and (memq 'file-error (get (car error-code)
+                                                     'error-conditions))
+                              (equal (cadr error-code) "Searching for 
program"))
+                         (error "Uncompression program `%s' not found"
+                                (nth 3 error-code)))
+                     (signal (car error-code) (cdr error-code)))))))
 
           (and
            local-copy
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 9cd2c62..ab355b6 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -570,7 +570,9 @@
 (defun clipboard-yank ()
   "Insert the clipboard contents, or the last stretch of killed text."
   (interactive "*")
-  (let ((select-enable-clipboard t))
+  (let ((select-enable-clipboard t)
+        ;; Ensure that we defeat the DWIM login in `gui-selection-value'.
+        (gui--last-selected-text-clipboard nil))
     (yank)))
 
 (defun clipboard-kill-ring-save (beg end &optional region)
diff --git a/lisp/mouse.el b/lisp/mouse.el
index ab260d4..89e5d7c 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1208,7 +1208,7 @@ overlay property, the value of that property determines 
what to do.
 for the `follow-link' event, the binding of that event determines
 what to do.
 
-The resulting value determine whether POS is inside a link:
+The resulting value determines whether POS is inside a link:
 
 - If the value is `mouse-face', POS is inside a link if there
 is a non-nil `mouse-face' property at POS.  Return t in this case.
@@ -2881,8 +2881,8 @@ is copied instead of being cut."
           (set-marker (nth 2 state) nil))
         (with-current-buffer (window-buffer window)
           (setq cursor-type (nth 3 state)))))))
-
 
+
 ;;; Bindings for mouse commands.
 
 (global-set-key [down-mouse-1] 'mouse-drag-region)
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 873f045..85d81b6 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -183,6 +183,33 @@ temporarily blinks with this face."
   "Face for <abbr> elements."
   :version "27.1")
 
+(defface shr-h1
+  '((t :height 1.3 :weight bold))
+  "Face for <h1> elements."
+  :version "28.1")
+
+(defface shr-h2
+  '((t :weight bold))
+  "Face for <h2> elements."
+  :version "28.1")
+
+(defface shr-h3
+  '((t :slant italic))
+  "Face for <h3> elements."
+  :version "28.1")
+
+(defface shr-h4 nil
+  "Face for <h4> elements."
+  :version "28.1")
+
+(defface shr-h5 nil
+  "Face for <h5> elements."
+  :version "28.1")
+
+(defface shr-h6 nil
+  "Face for <h6> elements."
+  :version "28.1")
+
 (defcustom shr-inhibit-images nil
   "If non-nil, inhibit loading images."
   :version "28.1"
@@ -1939,24 +1966,22 @@ BASE is the URL of the HTML being rendered."
   (shr-generic dom))
 
 (defun shr-tag-h1 (dom)
-  (shr-heading dom (if shr-use-fonts
-                      '(variable-pitch (:height 1.3 :weight bold))
-                    'bold)))
+  (shr-heading dom 'shr-h1))
 
 (defun shr-tag-h2 (dom)
-  (shr-heading dom 'bold))
+  (shr-heading dom 'shr-h2))
 
 (defun shr-tag-h3 (dom)
-  (shr-heading dom 'italic))
+  (shr-heading dom 'shr-h3))
 
 (defun shr-tag-h4 (dom)
-  (shr-heading dom))
+  (shr-heading dom 'shr-h4))
 
 (defun shr-tag-h5 (dom)
-  (shr-heading dom))
+  (shr-heading dom 'shr-h5))
 
 (defun shr-tag-h6 (dom)
-  (shr-heading dom))
+  (shr-heading dom 'shr-h6))
 
 (defun shr-tag-hr (_dom)
   (shr-ensure-newline)
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 7fb0ff5..8138d9a 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -133,6 +133,7 @@ It is used for TCP/IP devices."
     (file-exists-p . tramp-handle-file-exists-p)
     (file-in-directory-p . tramp-handle-file-in-directory-p)
     (file-local-copy . tramp-adb-handle-file-local-copy)
+    (file-locked-p . tramp-handle-file-locked-p)
     (file-modes . tramp-handle-file-modes)
     (file-name-all-completions . tramp-adb-handle-file-name-all-completions)
     (file-name-as-directory . tramp-handle-file-name-as-directory)
@@ -159,9 +160,11 @@ It is used for TCP/IP devices."
     (insert-directory . tramp-handle-insert-directory)
     (insert-file-contents . tramp-handle-insert-file-contents)
     (load . tramp-handle-load)
+    (lock-file . tramp-handle-lock-file)
     (make-auto-save-file-name . tramp-handle-make-auto-save-file-name)
     (make-directory . tramp-adb-handle-make-directory)
     (make-directory-internal . ignore)
+    (make-lock-file-name . tramp-handle-make-lock-file-name)
     (make-nearby-temp-file . tramp-handle-make-nearby-temp-file)
     (make-process . tramp-adb-handle-make-process)
     (make-symbolic-link . tramp-handle-make-symbolic-link)
@@ -180,6 +183,7 @@ It is used for TCP/IP devices."
     (tramp-get-remote-uid . ignore)
     (tramp-set-file-uid-gid . ignore)
     (unhandled-file-name-directory . ignore)
+    (unlock-file . tramp-handle-unlock-file)
     (vc-registered . ignore)
     (verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)
     (write-region . tramp-adb-handle-write-region))
@@ -535,7 +539,8 @@ But handle the case, if the \"test\" command is not 
available."
 (defun tramp-adb-handle-write-region
   (start end filename &optional append visit lockname mustbenew)
   "Like `write-region' for Tramp files."
-  (setq filename (expand-file-name filename))
+  (setq filename (expand-file-name filename)
+       lockname (file-truename (or lockname filename)))
   (with-parsed-tramp-file-name filename nil
     (when (and mustbenew (file-exists-p filename)
               (or (eq mustbenew 'excl)
@@ -544,15 +549,26 @@ But handle the case, if the \"test\" command is not 
available."
                     (format "File %s exists; overwrite anyway? " filename)))))
       (tramp-error v 'file-already-exists filename))
 
-    (let* ((curbuf (current-buffer))
-          (tmpfile (tramp-compat-make-temp-file filename)))
+    (let (file-locked
+         (curbuf (current-buffer))
+         (tmpfile (tramp-compat-make-temp-file filename)))
+
+      ;; Lock file.
+      (when (and (not (auto-save-file-name-p (file-name-nondirectory 
filename)))
+                (file-remote-p lockname)
+                (not (eq (file-locked-p lockname) t)))
+       (setq file-locked t)
+       ;; `lock-file' exists since Emacs 28.1.
+       (tramp-compat-funcall 'lock-file lockname))
+
       (when (and append (file-exists-p filename))
        (copy-file filename tmpfile 'ok)
        (set-file-modes tmpfile (logior (or (file-modes tmpfile) 0) #o0600)))
-      (write-region start end tmpfile append 'no-message lockname)
+      (let (create-lockfiles)
+        (write-region start end tmpfile append 'no-message))
       (with-tramp-progress-reporter
-        v 3 (format-message
-             "Moving tmp file `%s' to `%s'" tmpfile filename)
+         v 3 (format-message
+              "Moving tmp file `%s' to `%s'" tmpfile filename)
        (unwind-protect
            (unless (tramp-adb-execute-adb-command
                     v "push" tmpfile (tramp-compat-file-name-unquote 
localname))
@@ -575,6 +591,11 @@ But handle the case, if the \"test\" command is not 
available."
              (file-attributes filename))
             (current-time))))
 
+      ;; Unlock file.
+      (when (and file-locked (eq (file-locked-p lockname) t))
+       ;; `unlock-file' exists since Emacs 28.1.
+       (tramp-compat-funcall 'unlock-file lockname))
+
       ;; The end.
       (when (and (null noninteractive)
                 (or (eq visit t) (null visit) (stringp visit)))
@@ -782,7 +803,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
   (when (and (numberp destination) (zerop destination))
     (error "Implementation does not handle immediate return"))
 
-  (with-parsed-tramp-file-name default-directory nil
+  (with-parsed-tramp-file-name (expand-file-name default-directory) nil
     (let (command input tmpinput stderr tmpstderr outbuf ret)
       ;; Compute command.
       (setq command (mapconcat #'tramp-shell-quote-argument
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el
index d723fd5..67798e8 100644
--- a/lisp/net/tramp-archive.el
+++ b/lisp/net/tramp-archive.el
@@ -236,6 +236,7 @@ It must be supported by libarchive(3).")
     (file-exists-p . tramp-handle-file-exists-p)
     (file-in-directory-p . tramp-handle-file-in-directory-p)
     (file-local-copy . tramp-archive-handle-file-local-copy)
+    (file-locked-p . ignore)
     (file-modes . tramp-handle-file-modes)
     (file-name-all-completions . 
tramp-archive-handle-file-name-all-completions)
     ;; `file-name-as-directory' performed by default handler.
@@ -262,9 +263,11 @@ It must be supported by libarchive(3).")
     (insert-directory . tramp-archive-handle-insert-directory)
     (insert-file-contents . tramp-archive-handle-insert-file-contents)
     (load . tramp-archive-handle-load)
+    (lock-file . ignore)
     (make-auto-save-file-name . ignore)
     (make-directory . tramp-archive-handle-not-implemented)
     (make-directory-internal . tramp-archive-handle-not-implemented)
+    (make-lock-file-name . ignore)
     (make-nearby-temp-file . tramp-handle-make-nearby-temp-file)
     (make-process . ignore)
     (make-symbolic-link . tramp-archive-handle-not-implemented)
@@ -283,6 +286,7 @@ It must be supported by libarchive(3).")
     (tramp-get-remote-uid . ignore)
     (tramp-set-file-uid-gid . ignore)
     (unhandled-file-name-directory . ignore)
+    (unlock-file . ignore)
     (vc-registered . ignore)
     (verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)
     (write-region . tramp-archive-handle-not-implemented))
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index a41620a..579234f 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -49,6 +49,8 @@
 ;;   an open connection.  Examples: "scripts" keeps shell script
 ;;   definitions already sent to the remote shell, "last-cmd-time" is
 ;;   the time stamp a command has been sent to the remote process.
+;;   "lock-pid" is the timestamp a (network) process is created, it is
+;;   used instead of the pid in file locks.
 ;;
 ;; - The key is nil.  These are temporary properties related to the
 ;;   local machine.  Examples: "parse-passwd" and "parse-group" keep
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 54cfb6f..9d5e5f7 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -353,6 +353,16 @@ A nil value for either argument stands for the current 
time."
     (lambda (fromstring tostring instring)
       (replace-regexp-in-string (regexp-quote fromstring) tostring instring))))
 
+;; Function `make-lock-file-name' is new in Emacs 28.1.
+(defalias 'tramp-compat-make-lock-file-name
+  (if (fboundp 'make-lock-file-name)
+      #'make-lock-file-name
+    (lambda (filename)
+      (expand-file-name
+       (concat
+        ".#" (file-name-nondirectory filename))
+       (file-name-directory filename)))))
+
 (dolist (elt (all-completions "tramp-compat-" obarray 'functionp))
   (put (intern elt) 'tramp-suppress-trace t))
 
diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el
index 1d8c0ad..fdb2907 100644
--- a/lisp/net/tramp-crypt.el
+++ b/lisp/net/tramp-crypt.el
@@ -182,6 +182,7 @@ If NAME doesn't belong to a crypted remote directory, retun 
nil."
     (file-exists-p . tramp-handle-file-exists-p)
     (file-in-directory-p . tramp-handle-file-in-directory-p)
     (file-local-copy . tramp-handle-file-local-copy)
+    (file-locked-p . tramp-crypt-handle-file-locked-p)
     (file-modes . tramp-handle-file-modes)
     (file-name-all-completions . tramp-crypt-handle-file-name-all-completions)
     ;; `file-name-as-directory' performed by default handler.
@@ -208,9 +209,11 @@ If NAME doesn't belong to a crypted remote directory, 
retun nil."
     (insert-directory . tramp-crypt-handle-insert-directory)
     ;; `insert-file-contents' performed by default handler.
     (load . tramp-handle-load)
+    (lock-file . tramp-crypt-handle-lock-file)
     (make-auto-save-file-name . tramp-handle-make-auto-save-file-name)
     (make-directory . tramp-crypt-handle-make-directory)
     (make-directory-internal . ignore)
+    (make-lock-file-name . tramp-handle-make-lock-file-name)
     (make-nearby-temp-file . tramp-handle-make-nearby-temp-file)
     (make-process . ignore)
     (make-symbolic-link . tramp-handle-make-symbolic-link)
@@ -229,6 +232,7 @@ If NAME doesn't belong to a crypted remote directory, retun 
nil."
     ;; `tramp-get-remote-uid' performed by default handler.
     (tramp-set-file-uid-gid . tramp-crypt-handle-set-file-uid-gid)
     (unhandled-file-name-directory . ignore)
+    (unlock-file . tramp-crypt-handle-unlock-file)
     (vc-registered . ignore)
     (verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)
     (write-region . tramp-handle-write-region))
@@ -734,6 +738,11 @@ absolute file names."
   (let (tramp-crypt-enabled)
     (file-executable-p (tramp-crypt-encrypt-file-name filename))))
 
+(defun tramp-crypt-handle-file-locked-p (filename)
+  "Like `file-locked-p' for Tramp files."
+  (let (tramp-crypt-enabled)
+    (file-locked-p (tramp-crypt-encrypt-file-name filename))))
+
 (defun tramp-crypt-handle-file-name-all-completions (filename directory)
   "Like `file-name-all-completions' for Tramp files."
   (all-completions
@@ -797,6 +806,13 @@ WILDCARD is not supported."
          (delete-region (prop-match-beginning match) (prop-match-end match))
          (insert (propertize string 'dired-filename t)))))))
 
+(defun tramp-crypt-handle-lock-file (filename)
+  "Like `lock-file' for Tramp files."
+  (let (tramp-crypt-enabled)
+    ;; `lock-file' exists since Emacs 28.1.
+    (tramp-compat-funcall
+     'lock-file (tramp-crypt-encrypt-file-name filename))))
+
 (defun tramp-crypt-handle-make-directory (dir &optional parents)
   "Like `make-directory' for Tramp files."
   (with-parsed-tramp-file-name (expand-file-name dir) nil
@@ -848,6 +864,13 @@ WILDCARD is not supported."
       (tramp-set-file-uid-gid
        (tramp-crypt-encrypt-file-name filename) uid gid))))
 
+(defun tramp-crypt-handle-unlock-file (filename)
+  "Like `unlock-file' for Tramp files."
+  (let (tramp-crypt-enabled)
+    ;; `unlock-file' exists since Emacs 28.1.
+    (tramp-compat-funcall
+     'unlock-file (tramp-crypt-encrypt-file-name filename))))
+
 (add-hook 'tramp-unload-hook
          (lambda ()
            (unload-feature 'tramp-crypt 'force)))
diff --git a/lisp/net/tramp-fuse.el b/lisp/net/tramp-fuse.el
index ec1db86..93b184a 100644
--- a/lisp/net/tramp-fuse.el
+++ b/lisp/net/tramp-fuse.el
@@ -164,10 +164,9 @@
     (or (tramp-get-connection-property
          (tramp-get-connection-process vec) "mounted" nil)
         (let* ((default-directory (tramp-compat-temporary-file-directory))
-               (fuse (concat "fuse." (tramp-file-name-method vec)))
-               (mount (shell-command-to-string (format "mount -t %s" fuse))))
-          (tramp-message vec 6 "%s %s" "mount -t" fuse)
-          (tramp-message vec 6 "\n%s" mount)
+               (command (format "mount -t fuse.%s" (tramp-file-name-method 
vec)))
+              (mount (shell-command-to-string command)))
+          (tramp-message vec 6 "%s\n%s" command mount)
           (tramp-set-connection-property
            (tramp-get-connection-process vec) "mounted"
            (when (string-match
@@ -176,6 +175,16 @@
                  mount)
              (match-string 1 mount)))))))
 
+(defun tramp-fuse-unmount (vec)
+  "Unmount fuse volume determined by VEC."
+  (let ((default-directory (tramp-compat-temporary-file-directory))
+        (command (format "fusermount3 -u %s" (tramp-fuse-mount-point vec))))
+    (tramp-message vec 6 "%s\n%s" command (shell-command-to-string command))
+    (tramp-flush-connection-property
+     (tramp-get-connection-process vec) "mounted")
+    ;; Give the caches a chance to expire.
+    (sleep-for 1)))
+
 (defun tramp-fuse-local-file-name (filename)
   "Return local mount name of FILENAME."
   (setq filename (tramp-compat-file-name-unquote (expand-file-name filename)))
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index f1d24dc..022fdee 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -774,6 +774,7 @@ It has been changed in GVFS 1.14.")
     (file-exists-p . tramp-handle-file-exists-p)
     (file-in-directory-p . tramp-handle-file-in-directory-p)
     (file-local-copy . tramp-handle-file-local-copy)
+    (file-locked-p . tramp-handle-file-locked-p)
     (file-modes . tramp-handle-file-modes)
     (file-name-all-completions . tramp-gvfs-handle-file-name-all-completions)
     (file-name-as-directory . tramp-handle-file-name-as-directory)
@@ -800,9 +801,11 @@ It has been changed in GVFS 1.14.")
     (insert-directory . tramp-handle-insert-directory)
     (insert-file-contents . tramp-handle-insert-file-contents)
     (load . tramp-handle-load)
+    (lock-file . tramp-handle-lock-file)
     (make-auto-save-file-name . tramp-handle-make-auto-save-file-name)
     (make-directory . tramp-gvfs-handle-make-directory)
     (make-directory-internal . ignore)
+    (make-lock-file-name . tramp-handle-make-lock-file-name)
     (make-nearby-temp-file . tramp-handle-make-nearby-temp-file)
     (make-process . ignore)
     (make-symbolic-link . tramp-handle-make-symbolic-link)
@@ -821,6 +824,7 @@ It has been changed in GVFS 1.14.")
     (tramp-get-remote-uid . tramp-gvfs-handle-get-remote-uid)
     (tramp-set-file-uid-gid . tramp-gvfs-handle-set-file-uid-gid)
     (unhandled-file-name-directory . ignore)
+    (unlock-file . tramp-handle-unlock-file)
     (vc-registered . ignore)
     (verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)
     (write-region . tramp-handle-write-region))
@@ -2144,6 +2148,9 @@ connection if a previous connection has died for some 
reason."
       (process-put p 'vector vec)
       (set-process-query-on-exit-flag p nil)
 
+      ;; Mark process for filelock.
+      (tramp-set-connection-property p "lock-pid" (truncate (time-to-seconds)))
+
       ;; Set connection-local variables.
       (tramp-set-connection-local-variables vec)))
 
diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el
index 3b6de3e..49e366c 100644
--- a/lisp/net/tramp-rclone.el
+++ b/lisp/net/tramp-rclone.el
@@ -96,6 +96,7 @@
     (file-exists-p . tramp-handle-file-exists-p)
     (file-in-directory-p . tramp-handle-file-in-directory-p)
     (file-local-copy . tramp-handle-file-local-copy)
+    (file-locked-p . tramp-handle-file-locked-p)
     (file-modes . tramp-handle-file-modes)
     (file-name-all-completions . tramp-fuse-handle-file-name-all-completions)
     (file-name-as-directory . tramp-handle-file-name-as-directory)
@@ -122,9 +123,11 @@
     (insert-directory . tramp-handle-insert-directory)
     (insert-file-contents . tramp-handle-insert-file-contents)
     (load . tramp-handle-load)
+    (lock-file . tramp-handle-lock-file)
     (make-auto-save-file-name . tramp-handle-make-auto-save-file-name)
     (make-directory . tramp-fuse-handle-make-directory)
     (make-directory-internal . ignore)
+    (make-lock-file-name . tramp-handle-make-lock-file-name)
     (make-nearby-temp-file . tramp-handle-make-nearby-temp-file)
     (make-process . ignore)
     (make-symbolic-link . tramp-handle-make-symbolic-link)
@@ -143,6 +146,7 @@
     (tramp-get-remote-uid . ignore)
     (tramp-set-file-uid-gid . ignore)
     (unhandled-file-name-directory . ignore)
+    (unlock-file . tramp-handle-unlock-file)
     (vc-registered . ignore)
     (verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)
     (write-region . tramp-handle-write-region))
@@ -358,6 +362,10 @@ connection if a previous connection has died for some 
reason."
          (process-put p 'vector vec)
          (set-process-query-on-exit-flag p nil)
 
+         ;; Mark process for filelock.
+         (tramp-set-connection-property
+          p "lock-pid" (truncate (time-to-seconds)))
+
          ;; Set connection-local variables.
          (tramp-set-connection-local-variables vec)))
 
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 88caa2f..e6bd42a 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -962,6 +962,7 @@ Format specifiers \"%s\" are replaced before the script is 
used.")
     (file-exists-p . tramp-sh-handle-file-exists-p)
     (file-in-directory-p . tramp-handle-file-in-directory-p)
     (file-local-copy . tramp-sh-handle-file-local-copy)
+    (file-locked-p . tramp-handle-file-locked-p)
     (file-modes . tramp-handle-file-modes)
     (file-name-all-completions . tramp-sh-handle-file-name-all-completions)
     (file-name-as-directory . tramp-handle-file-name-as-directory)
@@ -988,9 +989,11 @@ Format specifiers \"%s\" are replaced before the script is 
used.")
     (insert-directory . tramp-sh-handle-insert-directory)
     (insert-file-contents . tramp-handle-insert-file-contents)
     (load . tramp-handle-load)
+    (lock-file . tramp-handle-lock-file)
     (make-auto-save-file-name . tramp-handle-make-auto-save-file-name)
     (make-directory . tramp-sh-handle-make-directory)
     ;; `make-directory-internal' performed by default handler.
+    (make-lock-file-name . tramp-handle-make-lock-file-name)
     (make-nearby-temp-file . tramp-handle-make-nearby-temp-file)
     (make-process . tramp-sh-handle-make-process)
     (make-symbolic-link . tramp-sh-handle-make-symbolic-link)
@@ -1009,6 +1012,7 @@ Format specifiers \"%s\" are replaced before the script 
is used.")
     (tramp-get-remote-uid . tramp-sh-handle-get-remote-uid)
     (tramp-set-file-uid-gid . tramp-sh-handle-set-file-uid-gid)
     (unhandled-file-name-directory . ignore)
+    (unlock-file . tramp-handle-unlock-file)
     (vc-registered . tramp-sh-handle-vc-registered)
     (verify-visited-file-modtime . tramp-sh-handle-verify-visited-file-modtime)
     (write-region . tramp-sh-handle-write-region))
@@ -3025,7 +3029,7 @@ implementation will be used."
   (when (and (numberp destination) (zerop destination))
     (error "Implementation does not handle immediate return"))
 
-  (with-parsed-tramp-file-name default-directory nil
+  (with-parsed-tramp-file-name (expand-file-name default-directory) nil
     (let (command env uenv input tmpinput stderr tmpstderr outbuf ret)
       ;; Compute command.
       (setq command (mapconcat #'tramp-shell-quote-argument
@@ -3235,7 +3239,8 @@ implementation will be used."
 (defun tramp-sh-handle-write-region
   (start end filename &optional append visit lockname mustbenew)
   "Like `write-region' for Tramp files."
-  (setq filename (expand-file-name filename))
+  (setq filename (expand-file-name filename)
+       lockname (file-truename (or lockname filename)))
   (with-parsed-tramp-file-name filename nil
     (when (and mustbenew (file-exists-p filename)
               (or (eq mustbenew 'excl)
@@ -3244,23 +3249,31 @@ implementation will be used."
                     (format "File %s exists; overwrite anyway? " filename)))))
       (tramp-error v 'file-already-exists filename))
 
-    (let ((uid (or (tramp-compat-file-attribute-user-id
+    (let (file-locked
+         (uid (or (tramp-compat-file-attribute-user-id
                    (file-attributes filename 'integer))
                   (tramp-get-remote-uid v 'integer)))
          (gid (or (tramp-compat-file-attribute-group-id
                    (file-attributes filename 'integer))
                   (tramp-get-remote-gid v 'integer))))
 
+      ;; Lock file.
+      (when (and (not (auto-save-file-name-p (file-name-nondirectory 
filename)))
+                (file-remote-p lockname)
+                (not (eq (file-locked-p lockname) t)))
+       (setq file-locked t)
+       ;; `lock-file' exists since Emacs 28.1.
+       (tramp-compat-funcall 'lock-file lockname))
+
       (if (and (tramp-local-host-p v)
               ;; `file-writable-p' calls `file-expand-file-name'.  We
               ;; cannot use `tramp-run-real-handler' therefore.
-              (let (file-name-handler-alist)
-                (and
-                 (file-writable-p (file-name-directory localname))
-                 (or (file-directory-p localname)
-                     (file-writable-p localname)))))
+              (file-writable-p (file-name-directory localname))
+              (or (file-directory-p localname)
+                  (file-writable-p localname)))
          ;; Short track: if we are on the local host, we can run directly.
-         (write-region start end localname append 'no-message lockname)
+         (let ((create-lockfiles (not file-locked)))
+           (write-region start end localname append 'no-message lockname))
 
        (let* ((modes (tramp-default-file-modes
                       filename (and (eq mustbenew 'excl) 'nofollow)))
@@ -3294,9 +3307,10 @@ implementation will be used."
          ;; on.  We must ensure that `file-coding-system-alist'
          ;; matches `tmpfile'.
          (let ((file-coding-system-alist
-                (tramp-find-file-name-coding-system-alist filename tmpfile)))
+                (tramp-find-file-name-coding-system-alist filename tmpfile))
+                create-lockfiles)
            (condition-case err
-               (write-region start end tmpfile append 'no-message lockname)
+               (write-region start end tmpfile append 'no-message)
              ((error quit)
               (setq tramp-temp-buffer-file-name nil)
               (delete-file tmpfile)
@@ -3465,6 +3479,12 @@ implementation will be used."
        ;; Set the ownership.
         (when need-chown
           (tramp-set-file-uid-gid filename uid gid))
+
+       ;; Unlock file.
+       (when (and file-locked (eq (file-locked-p lockname) t))
+         ;; `unlock-file' exists since Emacs 28.1.
+         (tramp-compat-funcall 'unlock-file lockname))
+
        (when (and (null noninteractive)
                   (or (eq visit t) (null visit) (stringp visit)))
          (tramp-message v 0 "Wrote %s" filename))
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 6fbf088..4008c25 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -247,6 +247,7 @@ See `tramp-actions-before-shell' for more info.")
     (file-exists-p . tramp-handle-file-exists-p)
     (file-in-directory-p . tramp-handle-file-in-directory-p)
     (file-local-copy . tramp-smb-handle-file-local-copy)
+    (file-locked-p . tramp-handle-file-locked-p)
     (file-modes . tramp-handle-file-modes)
     (file-name-all-completions . tramp-smb-handle-file-name-all-completions)
     (file-name-as-directory . tramp-handle-file-name-as-directory)
@@ -273,9 +274,11 @@ See `tramp-actions-before-shell' for more info.")
     (insert-directory . tramp-smb-handle-insert-directory)
     (insert-file-contents . tramp-handle-insert-file-contents)
     (load . tramp-handle-load)
+    (lock-file . tramp-handle-lock-file)
     (make-auto-save-file-name . tramp-handle-make-auto-save-file-name)
     (make-directory . tramp-smb-handle-make-directory)
     (make-directory-internal . tramp-smb-handle-make-directory-internal)
+    (make-lock-file-name . tramp-handle-make-lock-file-name)
     (make-nearby-temp-file . tramp-handle-make-nearby-temp-file)
     (make-process . ignore)
     (make-symbolic-link . tramp-smb-handle-make-symbolic-link)
@@ -294,6 +297,7 @@ See `tramp-actions-before-shell' for more info.")
     (tramp-get-remote-uid . ignore)
     (tramp-set-file-uid-gid . ignore)
     (unhandled-file-name-directory . ignore)
+    (unlock-file . tramp-handle-unlock-file)
     (vc-registered . ignore)
     (verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)
     (write-region . tramp-smb-handle-write-region))
@@ -532,7 +536,7 @@ arguments to pass to the OPERATION."
                      (tramp-process-actions p v nil tramp-smb-actions-with-tar)
 
                      (while (process-live-p p)
-                       (sit-for 0.1))
+                       (sleep-for 0.1))
                      (tramp-message v 6 "\n%s" (buffer-string))))
 
                ;; Reset the transfer process properties.
@@ -1255,7 +1259,7 @@ component is used as the target of the symlink."
   (when (and (numberp destination) (zerop destination))
     (error "Implementation does not handle immediate return"))
 
-  (with-parsed-tramp-file-name default-directory nil
+  (with-parsed-tramp-file-name (expand-file-name default-directory) nil
     (let* ((name (file-name-nondirectory program))
           (name1 name)
           (i 0)
@@ -1575,7 +1579,8 @@ errors for shares like \"C$/\", which are common in 
Microsoft Windows."
 (defun tramp-smb-handle-write-region
   (start end filename &optional append visit lockname mustbenew)
   "Like `write-region' for Tramp files."
-  (setq filename (expand-file-name filename))
+  (setq filename (expand-file-name filename)
+       lockname (file-truename (or lockname filename)))
   (with-parsed-tramp-file-name filename nil
     (when (and mustbenew (file-exists-p filename)
               (or (eq mustbenew 'excl)
@@ -1584,15 +1589,25 @@ errors for shares like \"C$/\", which are common in 
Microsoft Windows."
                     (format "File %s exists; overwrite anyway? " filename)))))
       (tramp-error v 'file-already-exists filename))
 
-    (let ((curbuf (current-buffer))
+    (let (file-locked
+         (curbuf (current-buffer))
          (tmpfile (tramp-compat-make-temp-file filename)))
+
+      ;; Lock file.
+      (when (and (not (auto-save-file-name-p (file-name-nondirectory 
filename)))
+                (file-remote-p lockname)
+                (not (eq (file-locked-p lockname) t)))
+       (setq file-locked t)
+       ;; `lock-file' exists since Emacs 28.1.
+       (tramp-compat-funcall 'lock-file lockname))
+
       (when (and append (file-exists-p filename))
        (copy-file filename tmpfile 'ok))
       ;; We say `no-message' here because we don't want the visited file
       ;; modtime data to be clobbered from the temp file.  We call
       ;; `set-visited-file-modtime' ourselves later on.
-      (tramp-run-real-handler
-       #'write-region (list start end tmpfile append 'no-message lockname))
+      (let (create-lockfiles)
+        (write-region start end tmpfile append 'no-message))
 
       (with-tramp-progress-reporter
          v 3 (format "Moving tmp file %s to %s" tmpfile filename)
@@ -1619,6 +1634,11 @@ errors for shares like \"C$/\", which are common in 
Microsoft Windows."
              (file-attributes filename))
             (current-time))))
 
+      ;; Unlock file.
+      (when (and file-locked (eq (file-locked-p lockname) t))
+       ;; `unlock-file' exists since Emacs 28.1.
+       (tramp-compat-funcall 'unlock-file lockname))
+
       ;; The end.
       (when (and (null noninteractive)
                 (or (eq visit t) (null visit) (stringp visit)))
diff --git a/lisp/net/tramp-sshfs.el b/lisp/net/tramp-sshfs.el
index c4a36fe..99f4063 100644
--- a/lisp/net/tramp-sshfs.el
+++ b/lisp/net/tramp-sshfs.el
@@ -96,6 +96,7 @@
     (file-exists-p . tramp-handle-file-exists-p)
     (file-in-directory-p . tramp-handle-file-in-directory-p)
     (file-local-copy . tramp-handle-file-local-copy)
+    (file-locked-p . tramp-handle-file-locked-p)
     (file-modes . tramp-handle-file-modes)
     (file-name-all-completions . tramp-fuse-handle-file-name-all-completions)
     (file-name-as-directory . tramp-handle-file-name-as-directory)
@@ -122,9 +123,11 @@
     (insert-directory . tramp-handle-insert-directory)
     (insert-file-contents . tramp-sshfs-handle-insert-file-contents)
     (load . tramp-handle-load)
+    (lock-file . tramp-handle-lock-file)
     (make-auto-save-file-name . tramp-handle-make-auto-save-file-name)
     (make-directory . tramp-fuse-handle-make-directory)
     (make-directory-internal . ignore)
+    (make-lock-file-name . tramp-handle-make-lock-file-name)
     (make-nearby-temp-file . tramp-handle-make-nearby-temp-file)
     (make-process . tramp-handle-make-process)
     (make-symbolic-link . tramp-handle-make-symbolic-link)
@@ -143,6 +146,7 @@
     (tramp-get-remote-uid . ignore)
     (tramp-set-file-uid-gid . ignore)
     (unhandled-file-name-directory . ignore)
+    (unlock-file . tramp-handle-unlock-file)
     (vc-registered . ignore)
     (verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)
     (write-region . tramp-sshfs-handle-write-region))
@@ -231,7 +235,7 @@ arguments to pass to the OPERATION."
   (when (and (numberp destination) (zerop destination))
     (error "Implementation does not handle immediate return"))
 
-  (with-parsed-tramp-file-name default-directory nil
+  (with-parsed-tramp-file-name (expand-file-name default-directory) nil
     (let ((command
           (format
            "cd %s && exec %s"
@@ -281,7 +285,8 @@ arguments to pass to the OPERATION."
 (defun tramp-sshfs-handle-write-region
   (start end filename &optional append visit lockname mustbenew)
   "Like `write-region' for Tramp files."
-  (setq filename (expand-file-name filename))
+  (setq filename (expand-file-name filename)
+       lockname (file-truename (or lockname filename)))
   (with-parsed-tramp-file-name filename nil
     (when (and mustbenew (file-exists-p filename)
               (or (eq mustbenew 'excl)
@@ -290,15 +295,31 @@ arguments to pass to the OPERATION."
                     (format "File %s exists; overwrite anyway? " filename)))))
       (tramp-error v 'file-already-exists filename))
 
-    (write-region
-     start end (tramp-fuse-local-file-name filename) append 'nomessage 
lockname)
-    (tramp-flush-file-properties v localname)
+    (let (file-locked)
+
+      ;; Lock file.
+      (when (and (not (auto-save-file-name-p (file-name-nondirectory 
filename)))
+                (file-remote-p lockname)
+                (not (eq (file-locked-p lockname) t)))
+       (setq file-locked t)
+       ;; `lock-file' exists since Emacs 28.1.
+       (tramp-compat-funcall 'lock-file lockname))
+
+      (let (create-lockfiles)
+       (write-region
+        start end (tramp-fuse-local-file-name filename) append 'nomessage)
+       (tramp-flush-file-properties v localname))
 
-    ;; The end.
-    (when (and (null noninteractive)
-              (or (eq visit t) (null visit) (stringp visit)))
-      (tramp-message v 0 "Wrote %s" filename))
-    (run-hooks 'tramp-handle-write-region-hook)))
+      ;; Unlock file.
+      (when (and file-locked (eq (file-locked-p lockname) t))
+       ;; `unlock-file' exists since Emacs 28.1.
+       (tramp-compat-funcall 'unlock-file lockname))
+
+      ;; The end.
+      (when (and (null noninteractive)
+                (or (eq visit t) (null visit) (stringp visit)))
+       (tramp-message v 0 "Wrote %s" filename))
+      (run-hooks 'tramp-handle-write-region-hook))))
 
 
 ;; File name conversions.
@@ -321,6 +342,9 @@ connection if a previous connection has died for some 
reason."
       (process-put p 'vector vec)
       (set-process-query-on-exit-flag p nil)
 
+      ;; Mark process for filelock.
+      (tramp-set-connection-property p "lock-pid" (truncate (time-to-seconds)))
+
       ;; Set connection-local variables.
       (tramp-set-connection-local-variables vec)
 
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index d641709..45d9fab 100644
--- a/lisp/net/tramp-sudoedit.el
+++ b/lisp/net/tramp-sudoedit.el
@@ -88,6 +88,7 @@ See `tramp-actions-before-shell' for more info.")
     (file-exists-p . tramp-sudoedit-handle-file-exists-p)
     (file-in-directory-p . tramp-handle-file-in-directory-p)
     (file-local-copy . tramp-handle-file-local-copy)
+    (file-locked-p . tramp-handle-file-locked-p)
     (file-modes . tramp-handle-file-modes)
     (file-name-all-completions
      . tramp-sudoedit-handle-file-name-all-completions)
@@ -115,9 +116,11 @@ See `tramp-actions-before-shell' for more info.")
     (insert-directory . tramp-handle-insert-directory)
     (insert-file-contents . tramp-handle-insert-file-contents)
     (load . tramp-handle-load)
+    (lock-file . tramp-handle-lock-file)
     (make-auto-save-file-name . tramp-handle-make-auto-save-file-name)
     (make-directory . tramp-sudoedit-handle-make-directory)
     (make-directory-internal . ignore)
+    (make-lock-file-name . tramp-handle-make-lock-file-name)
     (make-nearby-temp-file . tramp-handle-make-nearby-temp-file)
     (make-process . ignore)
     (make-symbolic-link . tramp-sudoedit-handle-make-symbolic-link)
@@ -136,6 +139,7 @@ See `tramp-actions-before-shell' for more info.")
     (tramp-get-remote-uid . tramp-sudoedit-handle-get-remote-uid)
     (tramp-set-file-uid-gid . tramp-sudoedit-handle-set-file-uid-gid)
     (unhandled-file-name-directory . ignore)
+    (unlock-file . tramp-handle-unlock-file)
     (vc-registered . ignore)
     (verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)
     (write-region . tramp-sudoedit-handle-write-region))
@@ -713,6 +717,7 @@ ID-FORMAT valid values are `string' and `integer'."
 (defun tramp-sudoedit-handle-write-region
   (start end filename &optional append visit lockname mustbenew)
   "Like `write-region' for Tramp files."
+  (setq filename (expand-file-name filename))
   (with-parsed-tramp-file-name filename nil
     (let* ((uid (or (tramp-compat-file-attribute-user-id
                     (file-attributes filename 'integer))
@@ -776,6 +781,9 @@ connection if a previous connection has died for some 
reason."
       (process-put p 'vector vec)
       (set-process-query-on-exit-flag p nil)
 
+      ;; Mark process for filelock.
+      (tramp-set-connection-property p "lock-pid" (truncate (time-to-seconds)))
+
       ;; Set connection-local variables.
       (tramp-set-connection-local-variables vec)
 
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 75e4455..736c7ef 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2455,6 +2455,8 @@ Must be handled by the callers."
              file-name-case-insensitive-p
              ;; Emacs 27+ only.
              file-system-info
+             ;; Emacs 28+ only.
+             file-locked-p lock-file make-lock-file-name unlock-file
              ;; Tramp internal magic file name function.
              tramp-set-file-uid-gid))
     (if (file-name-absolute-p (nth 0 args))
@@ -3628,7 +3630,7 @@ User is always nil."
             (file-writable-p (file-name-directory filename)))))))
 
 (defcustom tramp-allow-unsafe-temporary-files nil
-  "Whether root-owned auto-save or backup files can be written to \"/tmp\"."
+  "Whether root-owned auto-save, backup or lock files can be written to 
\"/tmp\"."
   :version "28.1"
   :type 'boolean)
 
@@ -3816,6 +3818,100 @@ User is always nil."
       ;; Result.
       (cons (expand-file-name filename) (cdr result)))))
 
+(defun tramp-get-lock-file (file)
+  "Read lockfile info of FILE.
+Return nil when there is no lockfile."
+  (when-let ((lockname (tramp-compat-make-lock-file-name file)))
+    (or (file-symlink-p lockname)
+       (and (file-readable-p lockname)
+            (with-temp-buffer
+              (insert-file-contents-literally lockname)
+              (buffer-string))))))
+
+(defun tramp-get-lock-pid (file)
+  "Determine pid for lockfile of FILE."
+  ;; Some Tramp methods do not offer a connection process, but just a
+  ;; network process as a place holder.  Those processes use the
+  ;; "lock-pid" connection property as fake pid, in fact it is the
+  ;; time stamp the process is created.
+  (let ((p (tramp-get-process  (tramp-dissect-file-name file))))
+    (number-to-string
+     (or (process-id p)
+        (tramp-get-connection-property p "lock-pid" (emacs-pid))))))
+
+(defconst tramp-lock-file-info-regexp
+  ;; USER@HOST.PID[:BOOT_TIME]
+  "\\`\\(.+\\)@\\(.+\\)\\.\\([[:digit:]]+\\)\\(?::\\([[:digit:]]+\\)\\)?\\'"
+  "The format of a lock file.")
+
+(defun tramp-handle-file-locked-p (file)
+  "Like `file-locked-p' for Tramp files."
+  (when-let ((info (tramp-get-lock-file file))
+            (match (string-match tramp-lock-file-info-regexp info)))
+    (or (and (string-equal (match-string 1 info) (user-login-name))
+            (string-equal (match-string 2 info) (system-name))
+            (string-equal (match-string 3 info) (tramp-get-lock-pid file)))
+       (match-string 1 info))))
+
+(defun tramp-handle-lock-file (file)
+  "Like `lock-file' for Tramp files."
+  ;; See if this file is visited and has changed on disk since it
+  ;; was visited.
+  (catch 'dont-lock
+    (unless (eq (file-locked-p file) t) ;; Locked by me.
+      (when-let ((info (tramp-get-lock-file file))
+                (match (string-match tramp-lock-file-info-regexp info)))
+       (unless (ask-user-about-lock
+                file (format
+                      "%s@%s (pid %s)" (match-string 1 info)
+                      (match-string 2 info) (match-string 3 info)))
+         (throw 'dont-lock nil)))
+
+      (when-let ((lockname (tramp-compat-make-lock-file-name file))
+                ;; USER@HOST.PID[:BOOT_TIME]
+                (info
+                 (format
+                  "%s@%s.%s" (user-login-name) (system-name)
+                  (tramp-get-lock-pid file))))
+
+       ;; Protect against security hole.
+       (with-parsed-tramp-file-name file nil
+         (when (and (not tramp-allow-unsafe-temporary-files)
+                    (file-in-directory-p lockname temporary-file-directory)
+                    (zerop (or (tramp-compat-file-attribute-user-id
+                                (file-attributes file 'integer))
+                               tramp-unknown-id-integer))
+                    (not (with-tramp-connection-property
+                             (tramp-get-process v) "unsafe-temporary-file"
+                           (yes-or-no-p
+                            (concat
+                             "Lock file on local temporary directory, "
+                             "do you want to continue? ")))))
+           (tramp-error v 'file-error "Unsafe lock file name")))
+
+       ;; Do the lock.
+        (let (create-lockfiles signal-hook-function)
+         (condition-case nil
+             (make-symbolic-link info lockname 'ok-if-already-exists)
+           (error
+            (with-file-modes #o0644
+               (write-region info nil lockname)))))))))
+
+(defun tramp-handle-make-lock-file-name (file)
+  "Like `make-lock-file-name' for Tramp files."
+  (and create-lockfiles
+       ;; This variable has been introduced with Emacs 28.1.
+       (not (bound-and-true-p remote-file-name-inhibit-locks))
+       (tramp-run-real-handler 'make-lock-file-name (list file))))
+
+(defun tramp-handle-unlock-file (file)
+  "Like `unlock-file' for Tramp files."
+  (when-let ((lockname (tramp-compat-make-lock-file-name file)))
+    (condition-case err
+        (delete-file lockname)
+      ;; `userlock--handle-unlock-error' exists since Emacs 28.1.
+      (error (tramp-compat-funcall 'userlock--handle-unlock-error err)))))
+
 (defun tramp-handle-load (file &optional noerror nomessage nosuffix 
must-suffix)
   "Like `load' for Tramp files."
   (with-parsed-tramp-file-name (expand-file-name file) nil
@@ -4357,7 +4453,8 @@ of."
 (defun tramp-handle-write-region
   (start end filename &optional append visit lockname mustbenew)
   "Like `write-region' for Tramp files."
-  (setq filename (expand-file-name filename))
+  (setq filename (expand-file-name filename)
+       lockname (file-truename (or lockname filename)))
   (with-parsed-tramp-file-name filename nil
     (when (and mustbenew (file-exists-p filename)
               (or (eq mustbenew 'excl)
@@ -4366,7 +4463,8 @@ of."
                     (format "File %s exists; overwrite anyway? " filename)))))
       (tramp-error v 'file-already-exists filename))
 
-    (let ((tmpfile (tramp-compat-make-temp-file filename))
+    (let (file-locked
+         (tmpfile (tramp-compat-make-temp-file filename))
          (modes (tramp-default-file-modes
                  filename (and (eq mustbenew 'excl) 'nofollow)))
          (uid (or (tramp-compat-file-attribute-user-id
@@ -4375,6 +4473,15 @@ of."
          (gid (or (tramp-compat-file-attribute-group-id
                    (file-attributes filename 'integer))
                   (tramp-get-remote-gid v 'integer))))
+
+      ;; Lock file.
+      (when (and (not (auto-save-file-name-p (file-name-nondirectory 
filename)))
+                (file-remote-p lockname)
+                (not (eq (file-locked-p lockname) t)))
+       (setq file-locked t)
+       ;; `lock-file' exists since Emacs 28.1.
+       (tramp-compat-funcall 'lock-file lockname))
+
       (when (and append (file-exists-p filename))
        (copy-file filename tmpfile 'ok))
       ;; The permissions of the temporary file should be set.  If
@@ -4386,7 +4493,8 @@ of."
       ;; We say `no-message' here because we don't want the visited file
       ;; modtime data to be clobbered from the temp file.  We call
       ;; `set-visited-file-modtime' ourselves later on.
-      (write-region start end tmpfile append 'no-message lockname)
+      (let (create-lockfiles)
+        (write-region start end tmpfile append 'no-message))
       (condition-case nil
          (rename-file tmpfile filename 'ok-if-already-exists)
        (error
@@ -4404,13 +4512,18 @@ of."
             (current-time))))
 
       ;; Set the ownership.
-      (tramp-set-file-uid-gid filename uid gid))
-
-    ;; The end.
-    (when (and (null noninteractive)
-              (or (eq visit t) (null visit) (stringp visit)))
-      (tramp-message v 0 "Wrote %s" filename))
-    (run-hooks 'tramp-handle-write-region-hook)))
+      (tramp-set-file-uid-gid filename uid gid)
+
+      ;; Unlock file.
+      (when (and file-locked (eq (file-locked-p lockname) t))
+       ;; `unlock-file' exists since Emacs 28.1.
+       (tramp-compat-funcall 'unlock-file lockname))
+
+      ;; The end.
+      (when (and (null noninteractive)
+                (or (eq visit t) (null visit) (stringp visit)))
+       (tramp-message v 0 "Wrote %s" filename))
+      (run-hooks 'tramp-handle-write-region-hook))))
 
 ;; This is used in tramp-sh.el and tramp-sudoedit.el.
 (defconst tramp-stat-marker "/////"
diff --git a/lisp/outline.el b/lisp/outline.el
index 68b8f4b..0bb74ff 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -182,7 +182,6 @@ in the file it applies to.")
                          ;; Only takes effect if point is on a heading.
                          :filter ,(lambda (cmd)
                                     (when (outline-on-heading-p) cmd)))))
-      (define-key map [tab]       tab-binding)
       (define-key map (kbd "TAB") tab-binding)
       (define-key map (kbd "<backtab>") #'outline-cycle-buffer))
     map)
diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el
index c1aaf82..e1d104f 100644
--- a/lisp/pcmpl-unix.el
+++ b/lisp/pcmpl-unix.el
@@ -82,7 +82,8 @@ being via `pcmpl-ssh-known-hosts-file'."
 ;;;###autoload
 (defun pcomplete/xargs ()
   "Completion for `xargs'."
-  ;; FIXME: Add completion of xargs-specific arguments.
+  (while (string-prefix-p "-" (pcomplete-arg 0))
+    (pcomplete-here (funcall pcomplete-default-completion-function)))
   (funcall pcomplete-command-completion-function)
   (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
               pcomplete-default-completion-function)))
diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el
index e502cbb..755211b 100644
--- a/lisp/progmodes/bug-reference.el
+++ b/lisp/progmodes/bug-reference.el
@@ -25,10 +25,13 @@
 
 ;; This file provides minor modes for putting clickable overlays on
 ;; references to bugs.  A bug reference is text like "PR foo/29292";
-;; this is mapped to a URL using a user-supplied format.
+;; this is mapped to a URL using a user-supplied format; see
+;; `bug-reference-url-format' and `bug-reference-bug-regexp'. More
+;; extensive documentation is in (info "(emacs) Bug Reference").
 
 ;; Two minor modes are provided.  One works on any text in the buffer;
-;; the other operates only on comments and strings.
+;; the other operates only on comments and strings. By default, the
+;; URL link is followed by invoking C-c RET or mouse-2.
 
 ;;; Code:
 
@@ -126,6 +129,9 @@ The second subexpression should match the bug reference 
(usually a number)."
   "Open URL corresponding to the bug reference at POS."
   (interactive
    (list (if (integerp last-command-event) (point) last-command-event)))
+  (when (null bug-reference-url-format)
+    (user-error
+     "You must customize some bug-reference variables; see Emacs info node Bug 
Reference"))
   (if (and (not (integerp pos)) (eventp pos))
       ;; POS is a mouse event; switch to the proper window/buffer
       (let ((posn (event-start pos)))
@@ -178,6 +184,22 @@ The second subexpression should match the bug reference 
(usually a number)."
                     "/issues/"
                     (match-string 2))))))
     ;;
+    ;; Codeberg projects.
+    ;;
+    ;; The systematics is exactly as for Github projects.
+    ("[/@]codeberg.org[/:]\\([.A-Za-z0-9_/-]+\\)\\.git"
+     "\\([.A-Za-z0-9_/-]+\\)?\\(?:#\\)\\([0-9]+\\)\\>"
+     ,(lambda (groups)
+        (let ((ns-project (nth 1 groups)))
+          (lambda ()
+            (concat "https://codeberg.org/";
+                    (or
+                     ;; Explicit user/proj#18 link.
+                     (match-string 1)
+                     ns-project)
+                    "/issues/"
+                    (match-string 2))))))
+    ;;
     ;; GitLab projects.
     ;;
     ;; Here #18 is an issue and !17 is a merge request.  Explicit
@@ -195,6 +217,30 @@ The second subexpression should match the bug reference 
(usually a number)."
                     (if (string= (match-string 3) "#")
                         "issues/"
                       "merge_requests/")
+                    (match-string 2))))))
+    ;;
+    ;; Sourcehut projects.
+    ;;
+    ;; #19 is an issue.  Other project's issues can be referenced as
+    ;; #~user/project#19.
+    ;;
+    ;; Caveat: The code assumes that a project on git.sr.ht or
+    ;; hg.sr.ht has a tracker of the same name on todo.sh.ht.  That's
+    ;; a very common setup but all sr.ht services are loosely coupled,
+    ;; so you can have a repo without tracker, or a repo with a
+    ;; tracker using a different name, etc.  So we can only try to
+    ;; make a good guess.
+    ("[/@]\\(?:git\\|hg\\).sr.ht[/:]\\(~[.A-Za-z0-9_/-]+\\)"
+     "\\(~[.A-Za-z0-9_/-]+\\)?\\(?:#\\)\\([0-9]+\\)\\>"
+     ,(lambda (groups)
+        (let ((ns-project (nth 1 groups)))
+          (lambda ()
+            (concat "https://todo.sr.ht/";
+                    (or
+                     ;; Explicit user/proj#18 link.
+                     (match-string 1)
+                     ns-project)
+                    "/"
                     (match-string 2)))))))
   "An alist for setting up `bug-reference-mode' based on VC URL.
 
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 462ea51..91c72a9 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -1345,6 +1345,13 @@ command before it's run."
         (grep-highlight-matches 'always))
     (rgrep regexp files dir confirm)))
 
+(defun grep-file-at-point (point)
+  "Return the name of the file at POINT a `grep-mode' buffer.
+The returned file name is relative."
+  (when-let ((msg (get-text-property point 'compilation-message))
+             (loc (compilation--message->loc msg)))
+    (caar (compilation--loc->file-struct loc))))
+
 ;;;###autoload
 (defalias 'rzgrep 'zrgrep)
 
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el
index 0a72ae9..e69a9ff 100644
--- a/lisp/progmodes/inf-lisp.el
+++ b/lisp/progmodes/inf-lisp.el
@@ -62,6 +62,7 @@
 
 (require 'comint)
 (require 'lisp-mode)
+(require 'shell)
 
 
 (defgroup inferior-lisp nil
@@ -289,15 +290,20 @@ to continue it."
   "Run an inferior Lisp process, input and output via buffer `*inferior-lisp*'.
 If there is a process already running in `*inferior-lisp*', just switch
 to that buffer.
+
 With argument, allows you to edit the command line (default is value
 of `inferior-lisp-program').  Runs the hooks from
 `inferior-lisp-mode-hook' (after the `comint-mode-hook' is run).
+
+If any parts of the command name contains spaces, they should be
+quoted using shell quote syntax.
+
 \(Type \\[describe-mode] in the process buffer for a list of commands.)"
   (interactive (list (if current-prefix-arg
                         (read-string "Run lisp: " inferior-lisp-program)
                       inferior-lisp-program)))
   (if (not (comint-check-proc "*inferior-lisp*"))
-      (let ((cmdlist (split-string cmd)))
+      (let ((cmdlist (split-string-shell-command cmd)))
        (set-buffer (apply (function make-comint)
                           "inferior-lisp" (car cmdlist) nil (cdr cmdlist)))
        (inferior-lisp-mode)))
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index 3f466e1..4d27775 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -272,7 +272,7 @@ not be enclosed in { } or ( )."
   "Regex used to find macro assignment lines in a makefile.")
 
 (defconst makefile-var-use-regex
-  "[^$]\\$[({]\\([-a-zA-Z0-9_.]+\\|[@%<?^+*][FD]?\\)"
+  "\\(^\\|[^$]\\)\\$[({]\\([-a-zA-Z0-9_.]+\\|[@%<?^+*][FD]?\\)"
   "Regex used to find $(macro) uses in a makefile.")
 
 (defconst makefile-ignored-files-in-pickup-regex
@@ -346,7 +346,7 @@ not be enclosed in { } or ( )."
      (3 font-lock-builtin-face prepend t))
 
     ;; Variable references even in targets/strings/comments.
-    (,var 1 font-lock-variable-name-face prepend)
+    (,var 2 font-lock-variable-name-face prepend)
 
     ;; Automatic variable references and single character variable references,
     ;; but not shell variables references.
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index c3a12c5..91db4ae 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -2192,6 +2192,8 @@ Point should be before the newline."
 When used interactively, insert the proper starting #!-line,
 and make the visited file executable via `executable-set-magic',
 perhaps querying depending on the value of `executable-query'.
+(If given a prefix (i.e., `C-u') don't insert any starting #!
+line.)
 
 When this function is called noninteractively, INSERT-FLAG (the third
 argument) controls whether to insert a #!-line and think about making
@@ -2215,7 +2217,7 @@ whose value is the shell name (don't quote it)."
                               '("csh" "rc" "sh"))
                       nil nil nil nil sh-shell-file)
                     (eq executable-query 'function)
-                    t))
+                    (not current-prefix-arg)))
   (if (string-match "\\.exe\\'" shell)
       (setq shell (substring shell 0 (match-beginning 0))))
   (setq sh-shell (sh-canonicalize-shell shell))
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index b7a926f..e2cd904 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -959,7 +959,9 @@ GROUP is a string for decoration purposes and XREF is an
                              (prefix
                               (cond
                                ((not line) "  ")
-                               ((equal line prev-line) "")
+                               ((and (equal line prev-line)
+                                     (equal prev-group group))
+                                "")
                                (t (propertize (format line-format line)
                                               'face 'xref-line-number)))))
                         ;; Render multiple matches on the same line, together.
diff --git a/lisp/repeat.el b/lisp/repeat.el
index 503cb34..cec3cb6 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -397,7 +397,7 @@ When Repeat mode is enabled, and the command symbol has the 
property named
                                    (and (commandp s)
                                         (get s 'repeat-map)
                                         (push (get s 'repeat-map) keymaps))))))
-      (message "Repeat mode is enabled for %d commands and %d keymaps; see 
`describe-repeat'."
+      (message "Repeat mode is enabled for %d commands and %d keymaps; see 
`describe-repeat-maps'."
                (length commands)
                (length (delete-dups keymaps))))))
 
@@ -489,10 +489,10 @@ When Repeat mode is enabled, and the command symbol has 
the property named
                                             repeat-echo-mode-line-string)))
     (force-mode-line-update t)))
 
-(defun describe-repeat ()
-  "Describe repeatable commands and keymaps."
+(defun describe-repeat-maps ()
+  "Describe mappings of commands repeatable by symbol property `repeat-map'."
   (interactive)
-  (help-setup-xref (list #'describe-repeat)
+  (help-setup-xref (list #'describe-repeat-maps)
                    (called-interactively-p 'interactive))
   (let ((keymaps nil))
     (all-completions
@@ -502,7 +502,7 @@ When Repeat mode is enabled, and the command symbol has the 
property named
                        (push s (alist-get (get s 'repeat-map) keymaps)))))
     (with-help-window (help-buffer)
       (with-current-buffer standard-output
-        (princ "This is a list of repeatable keymaps and commands.\n\n")
+        (princ "A list of keymaps used by commands with the symbol property 
`repeat-map'.\n\n")
 
         (dolist (keymap (sort keymaps (lambda (a b) (string-lessp (car a) (car 
b)))))
           (princ (format-message "`%s' keymap is repeatable by these 
commands:\n"
diff --git a/lisp/replace.el b/lisp/replace.el
index fe2cbc4..ed81097 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1089,17 +1089,17 @@ a previously found match."
              rend (point-max)))
       (goto-char rstart))
     (let ((count 0)
-         opoint
          (case-fold-search
           (if (and case-fold-search search-upper-case)
               (isearch-no-upper-case-p regexp t)
             case-fold-search)))
       (while (and (< (point) rend)
-                 (progn (setq opoint (point))
-                        (re-search-forward regexp rend t)))
-       (if (= opoint (point))
-           (forward-char 1)
-         (setq count (1+ count))))
+                 (re-search-forward regexp rend t))
+        ;; Ensure forward progress on zero-length matches like "^$".
+        (when (and (= (match-beginning 0) (match-end 0))
+                   (not (eobp)))
+          (forward-char 1))
+       (setq count (1+ count)))
       (when interactive (message (ngettext "%d occurrence"
                                           "%d occurrences"
                                           count)
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index f654702..2a95b39 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -87,6 +87,11 @@ this happens automatically before saving `save-place-alist' 
to
 `save-place-file'."
   :type 'boolean)
 
+(defcustom save-place-abbreviate-file-names nil
+  "If non-nil, abbreviate file names before saving them."
+  :type 'boolean
+  :version "28.1")
+
 (defcustom save-place-save-skipped t
   "If non-nil, remember files matching `save-place-skip-check-regexp'.
 
@@ -177,7 +182,10 @@ file:
   "Add current buffer filename and position to `save-place-alist'.
 Put filename and point in a cons box and then cons that onto the
 front of the `save-place-alist', if `save-place-mode' is non-nil.
-Otherwise, just delete that file from the alist."
+Otherwise, just delete that file from the alist.
+
+If `save-place-abbreviate-file-names' is non-nil, abbreviate the
+file names."
   ;; First check to make sure alist has been loaded in from the master
   ;; file.  If not, do so, then feel free to modify the alist.  It
   ;; will be saved again when Emacs is killed.
@@ -195,6 +203,8 @@ Otherwise, just delete that file from the alist."
                (or (not save-place-ignore-files-regexp)
                    (not (string-match save-place-ignore-files-regexp
                                       item))))
+      (when save-place-abbreviate-file-names
+        (setq item (abbreviate-file-name item)))
       (let ((cell (assoc item save-place-alist))
             (position (cond ((eq major-mode 'hexl-mode)
                             (with-no-warnings
diff --git a/lisp/select.el b/lisp/select.el
index 72f03e7..ab744ef 100644
--- a/lisp/select.el
+++ b/lisp/select.el
@@ -187,11 +187,17 @@ decoded.  If `gui-get-selection' signals an error, return 
nil."
   (let ((clip-text
          (when select-enable-clipboard
            (let ((text (gui--selection-value-internal 'CLIPBOARD)))
-             (if (string= text "") (setq text nil))
-
-             ;; Check the CLIPBOARD selection for 'newness', is it different
-             ;; from what we remembered them to be last time we did a
-             ;; cut/paste operation.
+             (when (string= text "")
+               (setq text nil))
+             ;; When `select-enable-clipboard' is non-nil,
+             ;; killing/copying text (with, say, `C-w') will push the
+             ;; text to the clipboard (and store it in
+             ;; `gui--last-selected-text-clipboard').  We check
+             ;; whether the text on the clipboard is identical to this
+             ;; text, and if so, we report that the clipboard is
+             ;; empty.  See (bug#27442) for further discussion about
+             ;; this DWIM action, and possible ways to make this check
+             ;; less fragile, if so desired.
              (prog1
                  (unless (equal text gui--last-selected-text-clipboard)
                    text)
diff --git a/lisp/shell.el b/lisp/shell.el
index 4339e8c..5aab80d 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -459,6 +459,16 @@ Useful for shells like zsh that has this feature."
           (push (mapconcat #'identity (nreverse arg) "") args)))
       (cons (nreverse args) (nreverse begins)))))
 
+;;;###autoload
+(defun split-string-shell-command (string)
+  "Split STRING (a shell command) into a list of strings.
+General shell syntax, like single and double quoting, as well as
+backslash quoting, is respected."
+  (with-temp-buffer
+    (insert string)
+    (let ((comint-file-name-quote-list shell-file-name-quote-list))
+      (car (shell--parse-pcomplete-arguments)))))
+
 (defun shell-command-completion-function ()
   "Completion function for shell command names.
 This is the value of `pcomplete-command-completion-function' for
diff --git a/lisp/simple.el b/lisp/simple.el
index cceb171..f4d28c9 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5842,7 +5842,13 @@ Can be `untabify' -- turn a tab to many spaces, then 
delete one space;
 (defun backward-delete-char-untabify (arg &optional killp)
   "Delete characters backward, changing tabs into spaces.
 The exact behavior depends on `backward-delete-char-untabify-method'.
+
 Delete ARG chars, and kill (save in kill ring) if KILLP is non-nil.
+
+If Transient Mark mode is enabled, the mark is active, and ARG is 1,
+delete the text in the region and deactivate the mark instead.
+To disable this, set option ‘delete-active-region’ to nil.
+
 Interactively, ARG is the prefix arg (default 1)
 and KILLP is t if a prefix arg was specified."
   (interactive "*p\nP")
diff --git a/lisp/subr.el b/lisp/subr.el
index e49c277..c7e1864 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3850,6 +3850,14 @@ Before insertion, process text properties according to
     (insert-buffer-substring buffer start end)
     (remove-yank-excluded-properties opoint (point))))
 
+(defun insert-into-buffer (buffer &optional start end)
+  "Insert the contents of the current buffer into BUFFER.
+If START/END, only insert that region from the current buffer.
+Point in BUFFER will be placed after the inserted text."
+  (let ((current (current-buffer)))
+    (with-current-buffer buffer
+      (insert-buffer-substring current start end))))
+
 (defun yank-handle-font-lock-face-property (face start end)
   "If `font-lock-defaults' is nil, apply FACE as a `face' property.
 START and END denote the start and end of the text to act on.
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 0d97da8..d5fad35 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -471,7 +471,10 @@ should return the formatted tab name to display in the tab 
line."
     (dolist (fn tab-line-tab-face-functions)
       (setf face (funcall fn tab tabs face buffer-p selected-p)))
     (apply 'propertize
-           (concat (propertize name 'keymap tab-line-tab-map)
+           (concat (propertize name
+                               'keymap tab-line-tab-map
+                               ;; Don't turn mouse-1 into mouse-2 (bug#49247)
+                               'follow-link 'ignore)
                    (or (and (or buffer-p (assq 'buffer tab) (assq 'close tab))
                             tab-line-close-button-show
                             (not (eq tab-line-close-button-show
diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el
index ba8fac8..877658a 100644
--- a/lisp/textmodes/enriched.el
+++ b/lisp/textmodes/enriched.el
@@ -38,7 +38,7 @@
 
 ;;; Code:
 
-(provide 'enriched)
+(require 'facemenu)
 
 ;;;
 ;;; Variables controlling the display
@@ -538,4 +538,6 @@ the range of text to assign text property SYMBOL with value 
VALUE."
         (list start end 'display prop)
       (list start end 'display (list 'disable-eval prop)))))
 
+(provide 'enriched)
+
 ;;; enriched.el ends here
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 8b8108c..ababd77 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1427,7 +1427,9 @@ on the line for the invalidity you want to see."
                    (forward-line 1)
                    (setq num-matches (1+ num-matches))
                    (insert-buffer-substring buffer start end)
-                   (let (text-beg (text-end (point-marker)))
+                   (let ((text-end (point-marker))
+                          (inhibit-read-only t)
+                          text-beg)
                      (forward-char (- start end))
                      (setq text-beg (point-marker))
                      (insert (format "%3d: " linenum))
@@ -1439,7 +1441,8 @@ on the line for the invalidity you want to see."
                      (put-text-property text-beg (- text-end 1)
                                         'occur-target tem))))))))
       (with-current-buffer standard-output
-       (let ((no-matches (zerop num-matches)))
+       (let ((no-matches (zerop num-matches))
+              (inhibit-read-only t))
          (if no-matches
              (insert "None!\n"))
          (if (called-interactively-p 'interactive)
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 8ca0f42..4c2470f 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -677,14 +677,14 @@ Signal an error if the entire string was not used."
   "Return the number at point, or nil if none is found.
 Decimal numbers like \"14\" or \"-14.5\", as well as hex numbers
 like \"0xBEEF09\" or \"#xBEEF09\", are recognized."
-  (when (thing-at-point-looking-at
-         "\\(-?[0-9]+\\.?[0-9]*\\)\\|\\(0x\\|#x\\)\\([a-zA-Z0-9]+\\)" 500)
-    (if (match-beginning 1)
-        (string-to-number
-         (buffer-substring (match-beginning 1) (match-end 1)))
-      (string-to-number
-       (buffer-substring (match-beginning 3) (match-end 3))
-       16))))
+  (cond
+   ((thing-at-point-looking-at "\\(0x\\|#x\\)\\([a-fA-F0-9]+\\)" 500)
+    (string-to-number
+     (buffer-substring (match-beginning 2) (match-end 2))
+     16))
+   ((thing-at-point-looking-at "-?[0-9]+\\.?[0-9]*" 500)
+    (string-to-number
+     (buffer-substring (match-beginning 0) (match-end 0))))))
 
 (put 'number 'thing-at-point 'number-at-point)
 ;;;###autoload
diff --git a/lisp/userlock.el b/lisp/userlock.el
index 4a75815..38aaf6a 100644
--- a/lisp/userlock.el
+++ b/lisp/userlock.el
@@ -230,7 +230,7 @@ to get the latest version of the file, then make the change 
again."
   (display-warning
    '(unlock-file)
    ;; There is no need to explain that this is an unlock error because
-   ;; ERR is a `file-error' condition, which explains this.
+   ;; ERROR is a `file-error' condition, which explains this.
    (message "%s, ignored" (error-message-string error))
    :warning))
 
diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index b2b92b1..0cbea2c 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -563,8 +563,9 @@ to invocation.")
            (set-visited-file-name merge-buffer-file))))
     (ediff-with-current-buffer ediff-buffer-C
       (setq buffer-offer-save t) ; ask before killing buffer
-      ;; make sure the contents is auto-saved
-      (auto-save-mode 1))
+      (when make-backup-files
+        ;; make sure the contents is auto-saved
+        (auto-save-mode 1)))
     ))
 
 
diff --git a/lisp/window.el b/lisp/window.el
index c0511be..0346397 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -8733,6 +8733,13 @@ documentation for additional customization information."
 BUFFER-OR-NAME may be a buffer, a string (a buffer name), or
 nil.  Return the buffer switched to.
 
+This uses the function `display-buffer' as a subroutine to
+display the buffer; see its documentation for additional
+customization information.  By default, if the buffer is already
+displayed (even in the current frame), that window is selected.
+If the buffer isn't displayed in any frame, a new frame is popped
+up and the buffer is displayed there.
+
 If called interactively, read the buffer name using `read-buffer'.
 The variable `confirm-nonexistent-file-or-buffer' determines
 whether to request confirmation before creating a new buffer.
@@ -8744,10 +8751,7 @@ buffer, create a new buffer with that name.  If 
BUFFER-OR-NAME is
 nil, switch to the buffer returned by `other-buffer'.
 
 Optional second arg NORECORD non-nil means do not put this
-buffer at the front of the list of recently selected ones.
-
-This uses the function `display-buffer' as a subroutine; see its
-documentation for additional customization information."
+buffer at the front of the list of recently selected ones."
   (interactive
    (list (read-buffer-to-switch "Switch to buffer in other frame: ")))
   (pop-to-buffer buffer-or-name display-buffer--other-frame-action norecord))
diff --git a/oldXMenu/Create.c b/oldXMenu/Create.c
index 7eb17c5..e209bbe 100644
--- a/oldXMenu/Create.c
+++ b/oldXMenu/Create.c
@@ -598,6 +598,8 @@ XMenuCreate(Display *display, Window parent, register char 
const *def_env)
    * Create pane, active, and inactive GC's.
    */
   values = (XGCValues *)malloc(sizeof(XGCValues));
+  if (!values)
+    return NULL;
   valuemask = (GCForeground | GCBackground | GCFont | GCLineWidth);
 
   /*
diff --git a/oldXMenu/Internal.c b/oldXMenu/Internal.c
index f489e27..3e97f9a 100644
--- a/oldXMenu/Internal.c
+++ b/oldXMenu/Internal.c
@@ -534,7 +534,6 @@ _XMRecomputePane(register Display *display, register XMenu 
*menu, register XMPan
     register int window_y;     /* Recomputed window Y coordinate. */
 
     unsigned long change_mask; /* Value mask to reconfigure window. */
-    XWindowChanges *changes;   /* Values to use in configure window. */
 
     register Bool config_p = False;    /* Reconfigure pane window? */
 
@@ -612,21 +611,19 @@ _XMRecomputePane(register Display *display, register 
XMenu *menu, register XMPan
         * it for creation with the new configuration.
         */
        if (p_ptr->window) {
+           XWindowChanges changes;
            change_mask = (CWX | CWY | CWWidth | CWHeight);
-           changes = (XWindowChanges *)malloc(sizeof(XWindowChanges));
-           changes->x = p_ptr->window_x;
-           changes->y = p_ptr->window_y;
-           changes->width = p_ptr->window_w;
-           changes->height = p_ptr->window_h;
+           changes.x = p_ptr->window_x;
+           changes.y = p_ptr->window_y;
+           changes.width = p_ptr->window_w;
+           changes.height = p_ptr->window_h;
 
            XConfigureWindow(
                             display,
                             p_ptr->window,
                             change_mask,
-                            changes
+                            &changes
                             );
-           free(changes);
-
        }
        else {
            if (_XMWinQueAddPane(display, menu, p_ptr) == _FAILURE) {
@@ -681,7 +678,6 @@ _XMRecomputeSelection(register Display *display, register 
XMenu *menu, register
                                        /* Selection sequence number. */
 {
     register Bool config_s = False;    /* Reconfigure selection window? */
-    XWindowChanges *changes;           /* Values to change in configure. */
     unsigned long change_mask;         /* Value mask for XConfigureWindow. */
 
     /*
@@ -738,22 +734,19 @@ _XMRecomputeSelection(register Display *display, register 
XMenu *menu, register
         * for creation with the new configuration.
         */
        if (s_ptr->window) {
-           changes = (XWindowChanges *)malloc(sizeof(XWindowChanges));
+           XWindowChanges changes;
            change_mask = (CWX | CWY | CWWidth | CWHeight);
-           changes = (XWindowChanges *)malloc(sizeof(XWindowChanges));
-           changes->x = s_ptr->window_x;
-           changes->y = s_ptr->window_y;
-           changes->width = s_ptr->window_w;
-           changes->height = s_ptr->window_h;
+           changes.x = s_ptr->window_x;
+           changes.y = s_ptr->window_y;
+           changes.width = s_ptr->window_w;
+           changes.height = s_ptr->window_h;
 
            XConfigureWindow(
                             display,
                             s_ptr->window,
                             change_mask,
-                            changes
+                            &changes
                             );
-           free(changes);
-
        }
        else {
            if (_XMWinQueAddSelection(display, menu, s_ptr) == _FAILURE) {
diff --git a/oldXMenu/XMakeAssoc.c b/oldXMenu/XMakeAssoc.c
index 9bbde2c..2530e8e 100644
--- a/oldXMenu/XMakeAssoc.c
+++ b/oldXMenu/XMakeAssoc.c
@@ -69,6 +69,8 @@ XMakeAssoc(register Display *dpy, register XAssocTable 
*table, register XID x_id
        /* before the current value of "Entry". */
        /* Create a new XAssoc and load it with new provided data. */
        new_entry = (XAssoc *) malloc(sizeof(XAssoc));
+       if (!new_entry)
+         return; /* This obsolete API has no way to report failure!  */
        new_entry->display = dpy;
        new_entry->x_id = x_id;
        new_entry->data = data;
diff --git a/src/alloc.c b/src/alloc.c
index e57bec1..a17488e 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4740,7 +4740,7 @@ live_small_vector_p (struct mem_node *m, void *p)
    marked.  */
 
 static void
-mark_maybe_pointer (void *p)
+mark_maybe_pointer (void *p, bool symbol_only)
 {
   struct mem_node *m;
 
@@ -4755,14 +4755,32 @@ mark_maybe_pointer (void *p)
      definitely _don't_ have an object.  */
   if (pdumper_object_p (p))
     {
+      /* FIXME: This code assumes that every reachable pdumper object
+        is addressed either by a pointer to the object start, or by
+        the same pointer with an LSB-style tag.  This assumption
+        fails if a pdumper object is reachable only via machine
+        addresses of non-initial object components.  Although such
+        addressing is rare in machine code generated by C compilers
+        from Emacs source code, it can occur in some cases.  To fix
+        this problem, the pdumper code should grok non-initial
+        addresses, as the non-pdumper code does.  */
+      uintptr_t mask = VALMASK & UINTPTR_MAX;
+      uintptr_t masked_p = (uintptr_t) p & mask;
+      void *po = (void *) masked_p;
+      char *cp = p;
+      char *cpo = po;
       /* Don't use pdumper_object_p_precise here! It doesn't check the
          tag bits. OBJ here might be complete garbage, so we need to
          verify both the pointer and the tag.  */
-      int type = pdumper_find_object_type (p);
-      if (pdumper_valid_object_type_p (type))
-        mark_object (type == Lisp_Symbol
-                     ? make_lisp_symbol (p)
-                     : make_lisp_ptr (p, type));
+      int type = pdumper_find_object_type (po);
+      if (pdumper_valid_object_type_p (type)
+         && (!USE_LSB_TAG || p == po || cp - cpo == type))
+       {
+         if (type == Lisp_Symbol)
+           mark_object (make_lisp_symbol (po));
+         else if (!symbol_only)
+           mark_object (make_lisp_ptr (po, type));
+       }
       return;
     }
 
@@ -4780,6 +4798,8 @@ mark_maybe_pointer (void *p)
 
        case MEM_TYPE_CONS:
          {
+           if (symbol_only)
+             return;
            struct Lisp_Cons *h = live_cons_holding (m, p);
            if (!h)
              return;
@@ -4789,6 +4809,8 @@ mark_maybe_pointer (void *p)
 
        case MEM_TYPE_STRING:
          {
+           if (symbol_only)
+             return;
            struct Lisp_String *h = live_string_holding (m, p);
            if (!h)
              return;
@@ -4807,6 +4829,8 @@ mark_maybe_pointer (void *p)
 
        case MEM_TYPE_FLOAT:
          {
+           if (symbol_only)
+             return;
            struct Lisp_Float *h = live_float_holding (m, p);
            if (!h)
              return;
@@ -4816,6 +4840,8 @@ mark_maybe_pointer (void *p)
 
        case MEM_TYPE_VECTORLIKE:
          {
+           if (symbol_only)
+             return;
            struct Lisp_Vector *h = live_large_vector_holding (m, p);
            if (!h)
              return;
@@ -4825,6 +4851,8 @@ mark_maybe_pointer (void *p)
 
        case MEM_TYPE_VECTOR_BLOCK:
          {
+           if (symbol_only)
+             return;
            struct Lisp_Vector *h = live_small_vector_holding (m, p);
            if (!h)
              return;
@@ -4886,7 +4914,7 @@ mark_memory (void const *start, void const *end)
   for (pp = start; (void const *) pp < end; pp += GC_POINTER_ALIGNMENT)
     {
       void *p = *(void *const *) pp;
-      mark_maybe_pointer (p);
+      mark_maybe_pointer (p, false);
 
       /* Unmask any struct Lisp_Symbol pointer that make_lisp_symbol
         previously disguised by adding the address of 'lispsym'.
@@ -4895,7 +4923,7 @@ mark_memory (void const *start, void const *end)
         non-adjacent words and P might be the low-order word's value.  */
       intptr_t ip;
       INT_ADD_WRAPV ((intptr_t) p, (intptr_t) lispsym, &ip);
-      mark_maybe_pointer ((void *) ip);
+      mark_maybe_pointer ((void *) ip, true);
     }
 }
 
diff --git a/src/buffer.c b/src/buffer.c
index 565577e..02ca23e 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1449,9 +1449,9 @@ state of the current buffer.  Use with care.  */)
         {
           bool already = SAVE_MODIFF < MODIFF;
           if (!already && !NILP (flag))
-           lock_file (fn);
+           Flock_file (fn);
           else if (already && NILP (flag))
-           unlock_file (fn);
+           Funlock_file (fn);
         }
     }
 
@@ -1757,7 +1757,7 @@ cleaning up all windows currently displaying the buffer 
to be killed. */)
   if (thread_check_current_buffer (b))
     return Qnil;
 
-  /* Run hooks with the buffer to be killed the current buffer.  */
+  /* Run hooks with the buffer to be killed as the current buffer.  */
   {
     ptrdiff_t count = SPECPDL_INDEX ();
 
diff --git a/src/data.c b/src/data.c
index 059f31e..9adfafa 100644
--- a/src/data.c
+++ b/src/data.c
@@ -581,8 +581,8 @@ DEFUN ("condition-variable-p", Fcondition_variable_p, 
Scondition_variable_p,
 /* Extract and set components of lists.  */
 
 DEFUN ("car", Fcar, Scar, 1, 1, 0,
-       doc: /* Return the car of LIST.  If arg is nil, return nil.
-Error if arg is not nil and not a cons cell.  See also `car-safe'.
+       doc: /* Return the car of LIST.  If LIST is nil, return nil.
+Error if LIST is not nil and not a cons cell.  See also `car-safe'.
 
 See Info node `(elisp)Cons Cells' for a discussion of related basic
 Lisp concepts such as car, cdr, cons cell and list.  */)
@@ -599,8 +599,8 @@ DEFUN ("car-safe", Fcar_safe, Scar_safe, 1, 1, 0,
 }
 
 DEFUN ("cdr", Fcdr, Scdr, 1, 1, 0,
-       doc: /* Return the cdr of LIST.  If arg is nil, return nil.
-Error if arg is not nil and not a cons cell.  See also `cdr-safe'.
+       doc: /* Return the cdr of LIST.  If LIST is nil, return nil.
+Error if LIST is not nil and not a cons cell.  See also `cdr-safe'.
 
 See Info node `(elisp)Cons Cells' for a discussion of related basic
 Lisp concepts such as cdr, car, cons cell and list.  */)
diff --git a/src/dispnew.c b/src/dispnew.c
index ab420bc..b79d0c4 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -473,6 +473,10 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix 
*matrix, int x, int y
                = row->glyphs[LEFT_MARGIN_AREA] + left;
              row->glyphs[RIGHT_MARGIN_AREA]
                = row->glyphs[TEXT_AREA] + dim.width - left - right;
+             /* Leave room for a border glyph.  */
+             if (!FRAME_WINDOW_P (XFRAME (w->frame))
+                 && !WINDOW_RIGHTMOST_P (w))
+               row->glyphs[RIGHT_MARGIN_AREA] -= 1;
              row->glyphs[LAST_AREA]
                = row->glyphs[LEFT_MARGIN_AREA] + dim.width;
            }
@@ -1140,7 +1144,13 @@ prepare_desired_row (struct window *w, struct glyph_row 
*row, bool mode_line_p)
        row->glyphs[TEXT_AREA] = row->glyphs[LEFT_MARGIN_AREA] + left;
       if (w->right_margin_cols > 0
          && (right != row->glyphs[LAST_AREA] - row->glyphs[RIGHT_MARGIN_AREA]))
-       row->glyphs[RIGHT_MARGIN_AREA] = row->glyphs[LAST_AREA] - right;
+       {
+         row->glyphs[RIGHT_MARGIN_AREA] = row->glyphs[LAST_AREA] - right;
+         /* Leave room for a border glyph.  */
+         if (!FRAME_WINDOW_P (XFRAME (w->frame))
+             && !WINDOW_RIGHTMOST_P (w))
+           row->glyphs[RIGHT_MARGIN_AREA] -= 1;
+       }
     }
 }
 
diff --git a/src/editfns.c b/src/editfns.c
index aa0f46f..8ab17eb 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2137,7 +2137,7 @@ nil.  */)
         the file now.  */
       if (SAVE_MODIFF == MODIFF
          && STRINGP (BVAR (a, file_truename)))
-       unlock_file (BVAR (a, file_truename));
+       Funlock_file (BVAR (a, file_truename));
     }
 
   return Qt;
diff --git a/src/emacs.c b/src/emacs.c
index fd265b4..7fd0049 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -670,7 +670,9 @@ argmatch (char **argv, int argc, const char *sstr, const 
char *lstr,
     }
   arglen = (valptr != NULL && (p = strchr (arg, '=')) != NULL
            ? p - arg : strlen (arg));
-  if (lstr == 0 || arglen < minlen || strncmp (arg, lstr, arglen) != 0)
+  if (!lstr)
+    return 0;
+  if (arglen < minlen || strncmp (arg, lstr, arglen) != 0)
     return 0;
   else if (valptr == NULL)
     {
diff --git a/src/eval.c b/src/eval.c
index 18faa0b..b76ced7 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -462,7 +462,7 @@ DEFUN ("progn", Fprogn, Sprogn, 0, UNEVALLED, 0,
 usage: (progn BODY...)  */)
   (Lisp_Object body)
 {
-  Lisp_Object val = Qnil;
+  Lisp_Object CACHEABLE val = Qnil;
 
   while (CONSP (body))
     {
@@ -1429,7 +1429,7 @@ internal_lisp_condition_case (Lisp_Object var, 
Lisp_Object bodyform,
        }
     }
 
-  Lisp_Object result = eval_sub (bodyform);
+  Lisp_Object CACHEABLE result = eval_sub (bodyform);
   handlerlist = oldhandlerlist;
   if (!NILP (success_handler))
     {
diff --git a/src/fileio.c b/src/fileio.c
index c0d1a50..04c9d7d 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4544,7 +4544,7 @@ by calling `format-decode', which see.  */)
   if (inserted == 0)
     {
       if (we_locked_file)
-       unlock_file (BVAR (current_buffer, file_truename));
+       Funlock_file (BVAR (current_buffer, file_truename));
       Vdeactivate_mark = old_Vdeactivate_mark;
     }
   else
@@ -4706,8 +4706,8 @@ by calling `format-decode', which see.  */)
       if (NILP (handler))
        {
          if (!NILP (BVAR (current_buffer, file_truename)))
-           unlock_file (BVAR (current_buffer, file_truename));
-         unlock_file (filename);
+           Funlock_file (BVAR (current_buffer, file_truename));
+         Funlock_file (filename);
        }
       if (not_regular)
        xsignal2 (Qfile_error,
@@ -5168,7 +5168,7 @@ write_region (Lisp_Object start, Lisp_Object end, 
Lisp_Object filename,
 
   if (open_and_close_file && !auto_saving)
     {
-      lock_file (lockname);
+      Flock_file (lockname);
       file_locked = 1;
     }
 
@@ -5193,7 +5193,7 @@ write_region (Lisp_Object start, Lisp_Object end, 
Lisp_Object filename,
        {
          int open_errno = errno;
          if (file_locked)
-           unlock_file (lockname);
+           Funlock_file (lockname);
          report_file_errno ("Opening output file", filename, open_errno);
        }
 
@@ -5208,7 +5208,7 @@ write_region (Lisp_Object start, Lisp_Object end, 
Lisp_Object filename,
        {
          int lseek_errno = errno;
          if (file_locked)
-           unlock_file (lockname);
+           Funlock_file (lockname);
          report_file_errno ("Lseek error", filename, lseek_errno);
        }
     }
@@ -5345,7 +5345,7 @@ write_region (Lisp_Object start, Lisp_Object end, 
Lisp_Object filename,
   unbind_to (count, Qnil);
 
   if (file_locked)
-    unlock_file (lockname);
+    Funlock_file (lockname);
 
   /* Do this before reporting IO error
      to avoid a "file has changed on disk" warning on
@@ -5370,14 +5370,14 @@ write_region (Lisp_Object start, Lisp_Object end, 
Lisp_Object filename,
       bset_filename (current_buffer, visit_file);
       update_mode_lines = 14;
       if (auto_saving_into_visited_file)
-       unlock_file (lockname);
+       Funlock_file (lockname);
     }
   else if (quietly)
     {
       if (auto_saving_into_visited_file)
        {
          SAVE_MODIFF = MODIFF;
-         unlock_file (lockname);
+         Funlock_file (lockname);
        }
 
       return Qnil;
diff --git a/src/filelock.c b/src/filelock.c
index 446a262..106633f 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -51,7 +51,6 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #ifdef WINDOWSNT
 #include <share.h>
 #include <sys/socket.h>        /* for fcntl */
-#include "w32.h"       /* for dostounix_filename */
 #endif
 
 #ifndef MSDOS
@@ -294,25 +293,6 @@ typedef struct
   char user[MAX_LFINFO + 1 + sizeof " (pid )" - sizeof "."];
 } lock_info_type;
 
-/* Write the name of the lock file for FNAME into LOCKNAME.  Length
-   will be that of FNAME plus two more for the leading ".#", plus one
-   for the null.  */
-#define MAKE_LOCK_NAME(lockname, fname) \
-  (lockname = SAFE_ALLOCA (SBYTES (fname) + 2 + 1), \
-   fill_in_lock_file_name (lockname, fname))
-
-static void
-fill_in_lock_file_name (char *lockfile, Lisp_Object fn)
-{
-  char *last_slash = memrchr (SSDATA (fn), '/', SBYTES (fn));
-  char *base = last_slash + 1;
-  ptrdiff_t dirlen = base - SSDATA (fn);
-  memcpy (lockfile, SSDATA (fn), dirlen);
-  lockfile[dirlen] = '.';
-  lockfile[dirlen + 1] = '#';
-  strcpy (lockfile + dirlen + 2, base);
-}
-
 /* For some reason Linux kernels return EPERM on file systems that do
    not support hard or symbolic links.  This symbol documents the quirk.
    There is no way to tell whether a symlink call fails due to
@@ -639,6 +619,12 @@ lock_if_free (lock_info_type *clasher, char *lfname)
   return err;
 }
 
+static Lisp_Object
+make_lock_file_name (Lisp_Object fn)
+{
+  return call1 (Qmake_lock_file_name, Fexpand_file_name (fn, Qnil));
+}
+
 /* lock_file locks file FN,
    meaning it serves notice on the world that you intend to edit that file.
    This should be done only when about to modify a file-visiting
@@ -657,86 +643,78 @@ lock_if_free (lock_info_type *clasher, char *lfname)
    This function can signal an error, or return t meaning
    take away the lock, or return nil meaning ignore the lock.  */
 
-void
+static Lisp_Object
 lock_file (Lisp_Object fn)
 {
-  Lisp_Object orig_fn, encoded_fn;
-  char *lfname = NULL;
   lock_info_type lock_info;
-  USE_SAFE_ALLOCA;
 
   /* Don't do locking while dumping Emacs.
      Uncompressing wtmp files uses call-process, which does not work
      in an uninitialized Emacs.  */
   if (will_dump_p ())
-    return;
+    return Qnil;
 
-  orig_fn = fn;
-  fn = Fexpand_file_name (fn, Qnil);
-#ifdef WINDOWSNT
-  /* Ensure we have only '/' separators, to avoid problems with
-     looking (inside fill_in_lock_file_name) for backslashes in file
-     names encoded by some DBCS codepage.  */
-  dostounix_filename (SSDATA (fn));
-#endif
-  encoded_fn = ENCODE_FILE (fn);
-  if (create_lockfiles)
-    /* Create the name of the lock-file for file fn */
-    MAKE_LOCK_NAME (lfname, encoded_fn);
+  /* If the file name has special constructs in it,
+     call the corresponding file name handler.  */
+  Lisp_Object handler;
+  handler = Ffind_file_name_handler (fn, Qlock_file);
+  if (!NILP (handler))
+    {
+      return call2 (handler, Qlock_file, fn);
+    }
+
+  Lisp_Object lock_filename = make_lock_file_name (fn);
+  if (NILP (lock_filename))
+    return Qnil;
+  char *lfname = SSDATA (ENCODE_FILE (lock_filename));
 
   /* See if this file is visited and has changed on disk since it was
      visited.  */
-  Lisp_Object subject_buf = get_truename_buffer (orig_fn);
+  Lisp_Object subject_buf = get_truename_buffer (fn);
   if (!NILP (subject_buf)
       && NILP (Fverify_visited_file_modtime (subject_buf))
-      && !NILP (Ffile_exists_p (fn))
-      && !(lfname && current_lock_owner (NULL, lfname) == -2))
+      && !NILP (Ffile_exists_p (lock_filename))
+      && current_lock_owner (NULL, lfname) != -2)
     call1 (intern ("userlock--ask-user-about-supersession-threat"), fn);
 
-  /* Don't do locking if the user has opted out.  */
-  if (lfname)
+  /* Try to lock the lock.  FIXME: This ignores errors when
+     lock_if_free returns a positive errno value.  */
+  if (lock_if_free (&lock_info, lfname) < 0)
     {
-      /* Try to lock the lock.  FIXME: This ignores errors when
-        lock_if_free returns a positive errno value.  */
-      if (lock_if_free (&lock_info, lfname) < 0)
-       {
-         /* Someone else has the lock.  Consider breaking it.  */
-         Lisp_Object attack;
-         char *dot = lock_info.dot;
-         ptrdiff_t pidlen = lock_info.colon - (dot + 1);
-         static char const replacement[] = " (pid ";
-         int replacementlen = sizeof replacement - 1;
-         memmove (dot + replacementlen, dot + 1, pidlen);
-         strcpy (dot + replacementlen + pidlen, ")");
-         memcpy (dot, replacement, replacementlen);
-         attack = call2 (intern ("ask-user-about-lock"), fn,
-                         build_string (lock_info.user));
-         /* Take the lock if the user said so.  */
-         if (!NILP (attack))
-           lock_file_1 (lfname, 1);
-       }
-      SAFE_FREE ();
+      /* Someone else has the lock.  Consider breaking it.  */
+      Lisp_Object attack;
+      char *dot = lock_info.dot;
+      ptrdiff_t pidlen = lock_info.colon - (dot + 1);
+      static char const replacement[] = " (pid ";
+      int replacementlen = sizeof replacement - 1;
+      memmove (dot + replacementlen, dot + 1, pidlen);
+      strcpy (dot + replacementlen + pidlen, ")");
+      memcpy (dot, replacement, replacementlen);
+      attack = call2 (intern ("ask-user-about-lock"), fn,
+                     build_string (lock_info.user));
+      /* Take the lock if the user said so.  */
+      if (!NILP (attack))
+       lock_file_1 (lfname, 1);
     }
+  return Qnil;
 }
 
 static Lisp_Object
-unlock_file_body (Lisp_Object fn)
+unlock_file (Lisp_Object fn)
 {
   char *lfname;
-  USE_SAFE_ALLOCA;
-
-  Lisp_Object filename = Fexpand_file_name (fn, Qnil);
-  fn = ENCODE_FILE (filename);
 
-  MAKE_LOCK_NAME (lfname, fn);
+  Lisp_Object lock_filename = make_lock_file_name (fn);
+  if (NILP (lock_filename))
+    return Qnil;
+  lfname = SSDATA (ENCODE_FILE (lock_filename));
 
   int err = current_lock_owner (0, lfname);
   if (err == -2 && unlink (lfname) != 0 && errno != ENOENT)
     err = errno;
   if (0 < err)
-    report_file_errno ("Unlocking file", filename, err);
+    report_file_errno ("Unlocking file", fn, err);
 
-  SAFE_FREE ();
   return Qnil;
 }
 
@@ -747,26 +725,6 @@ unlock_file_handle_error (Lisp_Object err)
   return Qnil;
 }
 
-void
-unlock_file (Lisp_Object fn)
-{
-  internal_condition_case_1 (unlock_file_body,
-                            fn,
-                            list1(Qfile_error),
-                            unlock_file_handle_error);
-}
-
-#else  /* MSDOS */
-void
-lock_file (Lisp_Object fn)
-{
-}
-
-void
-unlock_file (Lisp_Object fn)
-{
-}
-
 #endif /* MSDOS */
 
 void
@@ -780,10 +738,51 @@ unlock_all_files (void)
       b = XBUFFER (buf);
       if (STRINGP (BVAR (b, file_truename))
          && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b))
-       unlock_file (BVAR (b, file_truename));
+       Funlock_file (BVAR (b, file_truename));
     }
 }
 
+DEFUN ("lock-file", Flock_file, Slock_file, 1, 1, 0,
+       doc: /* Lock FILE.
+If the option `create-lockfiles' is nil, this does nothing.  */)
+  (Lisp_Object file)
+{
+#ifndef MSDOS
+  /* Don't do locking if the user has opted out.  */
+  if (create_lockfiles)
+    {
+      CHECK_STRING (file);
+      lock_file (file);
+    }
+#endif /* MSDOS */
+  return Qnil;
+}
+
+DEFUN ("unlock-file", Funlock_file, Sunlock_file, 1, 1, 0,
+       doc: /* Unlock FILE.  */)
+  (Lisp_Object file)
+{
+#ifndef MSDOS
+  CHECK_STRING (file);
+
+  /* If the file name has special constructs in it,
+     call the corresponding file name handler.  */
+  Lisp_Object handler;
+  handler = Ffind_file_name_handler (file, Qunlock_file);
+  if (!NILP (handler))
+    {
+      call2 (handler, Qunlock_file, file);
+      return Qnil;
+    }
+
+  internal_condition_case_1 (unlock_file,
+                            file,
+                            list1 (Qfile_error),
+                            unlock_file_handle_error);
+#endif /* MSDOS */
+  return Qnil;
+}
+
 DEFUN ("lock-buffer", Flock_buffer, Slock_buffer,
        0, 1, 0,
        doc: /* Lock FILE, if current buffer is modified.
@@ -799,7 +798,7 @@ If the option `create-lockfiles' is nil, this does nothing. 
 */)
     CHECK_STRING (file);
   if (SAVE_MODIFF < MODIFF
       && !NILP (file))
-    lock_file (file);
+    Flock_file (file);
   return Qnil;
 }
 
@@ -815,7 +814,7 @@ error did not occur.  */)
 {
   if (SAVE_MODIFF < MODIFF
       && STRINGP (BVAR (current_buffer, file_truename)))
-    unlock_file (BVAR (current_buffer, file_truename));
+    Funlock_file (BVAR (current_buffer, file_truename));
   return Qnil;
 }
 
@@ -826,7 +825,7 @@ unlock_buffer (struct buffer *buffer)
 {
   if (BUF_SAVE_MODIFF (buffer) < BUF_MODIFF (buffer)
       && STRINGP (BVAR (buffer, file_truename)))
-    unlock_file (BVAR (buffer, file_truename));
+    Funlock_file (BVAR (buffer, file_truename));
 }
 
 DEFUN ("file-locked-p", Ffile_locked_p, Sfile_locked_p, 1, 1, 0,
@@ -839,14 +838,22 @@ t if it is locked by you, else a string saying which user 
has locked it.  */)
   return Qnil;
 #else
   Lisp_Object ret;
-  char *lfname;
   int owner;
   lock_info_type locker;
-  USE_SAFE_ALLOCA;
 
-  filename = Fexpand_file_name (filename, Qnil);
-  Lisp_Object encoded_filename = ENCODE_FILE (filename);
-  MAKE_LOCK_NAME (lfname, encoded_filename);
+  /* If the file name has special constructs in it,
+     call the corresponding file name handler.  */
+  Lisp_Object handler;
+  handler = Ffind_file_name_handler (filename, Qfile_locked_p);
+  if (!NILP (handler))
+    {
+      return call2 (handler, Qfile_locked_p, filename);
+    }
+
+  Lisp_Object lock_filename = make_lock_file_name (filename);
+  if (NILP (lock_filename))
+    return Qnil;
+  char *lfname = SSDATA (ENCODE_FILE (lock_filename));
 
   owner = current_lock_owner (&locker, lfname);
   switch (owner)
@@ -857,7 +864,6 @@ t if it is locked by you, else a string saying which user 
has locked it.  */)
     default: report_file_errno ("Testing file lock", filename, owner);
     }
 
-  SAFE_FREE ();
   return ret;
 #endif
 }
@@ -876,7 +882,14 @@ The name of the (per-buffer) lockfile is constructed by 
prepending a
 Info node `(emacs)Interlocking'.  */);
   create_lockfiles = true;
 
-  defsubr (&Sunlock_buffer);
+  DEFSYM (Qlock_file, "lock-file");
+  DEFSYM (Qunlock_file, "unlock-file");
+  DEFSYM (Qfile_locked_p, "file-locked-p");
+  DEFSYM (Qmake_lock_file_name, "make-lock-file-name");
+
+  defsubr (&Slock_file);
+  defsubr (&Sunlock_file);
   defsubr (&Slock_buffer);
+  defsubr (&Sunlock_buffer);
   defsubr (&Sfile_locked_p);
 }
diff --git a/src/gtkutil.c b/src/gtkutil.c
index ee8b925..40d1d17 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3617,7 +3617,7 @@ xg_update_menu_item (widget_value *val,
       gtk_label_set_text (wkey, utf8_key);
     }
 
-  if (! old_label || strcmp (utf8_label, old_label) != 0)
+  if (utf8_label && (! old_label || strcmp (utf8_label, old_label) != 0))
     {
       label_changed = true;
       gtk_label_set_text (wlbl, utf8_label);
diff --git a/src/image.c b/src/image.c
index 916edd5..7a6f406 100644
--- a/src/image.c
+++ b/src/image.c
@@ -5121,7 +5121,7 @@ xpm_load_image (struct frame *f,
 
   while (num_colors-- > 0)
     {
-      char *color, *max_color;
+      char *color, *max_color = NULL;
       int key, next_key, max_key = 0;
       Lisp_Object symbol_color = Qnil, color_val;
       Emacs_Color cdef;
@@ -5182,7 +5182,7 @@ xpm_load_image (struct frame *f,
                                                   cdef.blue));
            }
        }
-      if (NILP (color_val) && max_key > 0)
+      if (NILP (color_val) && max_color)
        {
          if (xstrcasecmp (max_color, "None") == 0)
            color_val = Qt;
@@ -7904,6 +7904,13 @@ tiff_image_p (Lisp_Object object)
 
 # include <tiffio.h>
 
+/* libtiff version 4.3.0 deprecated uint32 typedef.  */
+#if TIFFLIB_VERSION >= 20210416
+# define UINT32 uint32_t
+#else
+# define UINT32 uint32
+#endif
+
 # ifdef WINDOWSNT
 
 /* TIFF library details.  */
@@ -7915,7 +7922,7 @@ DEF_DLL_FN (TIFF *, TIFFClientOpen,
             TIFFReadWriteProc, TIFFSeekProc, TIFFCloseProc, TIFFSizeProc,
             TIFFMapFileProc, TIFFUnmapFileProc));
 DEF_DLL_FN (int, TIFFGetField, (TIFF *, ttag_t, ...));
-DEF_DLL_FN (int, TIFFReadRGBAImage, (TIFF *, uint32, uint32, uint32 *, int));
+DEF_DLL_FN (int, TIFFReadRGBAImage, (TIFF *, UINT32, UINT32, UINT32 *, int));
 DEF_DLL_FN (void, TIFFClose, (TIFF *));
 DEF_DLL_FN (int, TIFFSetDirectory, (TIFF *, tdir_t));
 
@@ -8107,7 +8114,7 @@ tiff_load (struct frame *f, struct image *img)
   Lisp_Object specified_data;
   TIFF *tiff;
   int width, height, x, y, count;
-  uint32 *buf;
+  UINT32 *buf;
   int rc;
   Emacs_Pix_Container ximg;
   tiff_memory_source memsrc;
@@ -8233,11 +8240,11 @@ tiff_load (struct frame *f, struct image *img)
   /* Process the pixel raster.  Origin is in the lower-left corner.  */
   for (y = 0; y < height; ++y)
     {
-      uint32 *row = buf + y * width;
+      UINT32 *row = buf + y * width;
 
       for (x = 0; x < width; ++x)
        {
-         uint32 abgr = row[x];
+         UINT32 abgr = row[x];
          int r = TIFFGetR (abgr) << 8;
          int g = TIFFGetG (abgr) << 8;
          int b = TIFFGetB (abgr) << 8;
diff --git a/src/insdel.c b/src/insdel.c
index e38b091..e66120e 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1989,7 +1989,7 @@ prepare_to_modify_buffer_1 (ptrdiff_t start, ptrdiff_t 
end,
       /* Make binding buffer-file-name to nil effective.  */
       && !NILP (BVAR (base_buffer, filename))
       && SAVE_MODIFF >= MODIFF)
-    lock_file (BVAR (base_buffer, file_truename));
+    Flock_file (BVAR (base_buffer, file_truename));
 
   /* If `select-active-regions' is non-nil, save the region text.  */
   /* FIXME: Move this to Elisp (via before-change-functions).  */
diff --git a/src/keyboard.c b/src/keyboard.c
index 87a9512..7d04564 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -12149,10 +12149,11 @@ terminal device.  See Info node `(elisp)Multiple 
Terminals'.  */);
   DEFVAR_LISP ("overriding-local-map", Voverriding_local_map,
               doc: /* Keymap that replaces (overrides) local keymaps.
 If this variable is non-nil, Emacs looks up key bindings in this
-keymap INSTEAD OF the keymap char property, minor mode maps, and the
-buffer's local map.  Hence, the only active keymaps would be
-`overriding-terminal-local-map', this keymap, and `global-keymap', in
-order of precedence.  */);
+keymap INSTEAD OF `keymap' text properties, `local-map' and `keymap'
+overlay properties, minor mode maps, and the buffer's local map.
+
+Hence, the only active keymaps would be `overriding-terminal-local-map',
+this keymap, and `global-keymap', in order of precedence.  */);
   Voverriding_local_map = Qnil;
 
   DEFVAR_LISP ("overriding-local-map-menu-flag", 
Voverriding_local_map_menu_flag,
diff --git a/src/lisp.h b/src/lisp.h
index 4fb8923..1795b9d 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4621,8 +4621,6 @@ extern int str_collate (Lisp_Object, Lisp_Object, 
Lisp_Object, Lisp_Object);
 extern void syms_of_sysdep (void);
 
 /* Defined in filelock.c.  */
-extern void lock_file (Lisp_Object);
-extern void unlock_file (Lisp_Object);
 extern void unlock_all_files (void);
 extern void unlock_buffer (struct buffer *);
 extern void syms_of_filelock (void);
diff --git a/src/process.c b/src/process.c
index cc1afa8..13dedde 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5232,7 +5232,10 @@ wait_reading_process_output (intmax_t time_limit, int 
nsecs, int read_kbd,
 #ifdef HAVE_GNUTLS
                /* Continue TLS negotiation. */
                if (p->gnutls_initstage == GNUTLS_STAGE_HANDSHAKE_TRIED
-                   && p->is_non_blocking_client)
+                   && p->is_non_blocking_client
+                   /* Don't proceed until we have established a connection. */
+                   && !(fd_callback_info[p->outfd].flags
+                        & NON_BLOCKING_CONNECT_FD))
                  {
                    gnutls_try_handshake (p);
                    p->gnutls_handshakes_tried++;
diff --git a/src/sysdep.c b/src/sysdep.c
index b8ec22d..8eaee22 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2744,6 +2744,138 @@ cfsetspeed (struct termios *termios_p, speed_t vitesse)
 }
 #endif
 
+/* The following is based on the glibc implementation of cfsetspeed.  */
+
+struct speed_struct
+{
+  speed_t value;
+  speed_t internal;
+};
+
+static const struct speed_struct speeds[] =
+  {
+#ifdef B0
+    { 0, B0 },
+#endif
+#ifdef B50
+    { 50, B50 },
+#endif
+#ifdef B75
+    { 75, B75 },
+#endif
+#ifdef B110
+    { 110, B110 },
+#endif
+#ifdef B134
+    { 134, B134 },
+#endif
+#ifdef B150
+    { 150, B150 },
+#endif
+#ifdef B200
+    { 200, B200 },
+#endif
+#ifdef B300
+    { 300, B300 },
+#endif
+#ifdef B600
+    { 600, B600 },
+#endif
+#ifdef B1200
+    { 1200, B1200 },
+#endif
+#ifdef B1200
+    { 1200, B1200 },
+#endif
+#ifdef B1800
+    { 1800, B1800 },
+#endif
+#ifdef B2400
+    { 2400, B2400 },
+#endif
+#ifdef B4800
+    { 4800, B4800 },
+#endif
+#ifdef B9600
+    { 9600, B9600 },
+#endif
+#ifdef B19200
+    { 19200, B19200 },
+#endif
+#ifdef B38400
+    { 38400, B38400 },
+#endif
+#ifdef B57600
+    { 57600, B57600 },
+#endif
+#ifdef B76800
+    { 76800, B76800 },
+#endif
+#ifdef B115200
+    { 115200, B115200 },
+#endif
+#ifdef B153600
+    { 153600, B153600 },
+#endif
+#ifdef B230400
+    { 230400, B230400 },
+#endif
+#ifdef B307200
+    { 307200, B307200 },
+#endif
+#ifdef B460800
+    { 460800, B460800 },
+#endif
+#ifdef B500000
+    { 500000, B500000 },
+#endif
+#ifdef B576000
+    { 576000, B576000 },
+#endif
+#ifdef B921600
+    { 921600, B921600 },
+#endif
+#ifdef B1000000
+    { 1000000, B1000000 },
+#endif
+#ifdef B1152000
+    { 1152000, B1152000 },
+#endif
+#ifdef B1500000
+    { 1500000, B1500000 },
+#endif
+#ifdef B2000000
+    { 2000000, B2000000 },
+#endif
+#ifdef B2500000
+    { 2500000, B2500000 },
+#endif
+#ifdef B3000000
+    { 3000000, B3000000 },
+#endif
+#ifdef B3500000
+    { 3500000, B3500000 },
+#endif
+#ifdef B4000000
+    { 4000000, B4000000 },
+#endif
+  };
+
+/* Convert a numerical speed (e.g., 9600) to a Bnnn constant (e.g.,
+   B9600); see bug#49524.  */
+static speed_t
+convert_speed (speed_t speed)
+{
+  for (size_t i = 0; i < sizeof speeds / sizeof speeds[0]; i++)
+    {
+      if (speed == speeds[i].internal)
+       return speed;
+      else if (speed == speeds[i].value)
+       return speeds[i].internal;
+    }
+  return speed;
+}
+
 /* For serial-process-configure  */
 void
 serial_configure (struct Lisp_Process *p,
@@ -2775,7 +2907,7 @@ serial_configure (struct Lisp_Process *p,
   else
     tem = Fplist_get (p->childp, QCspeed);
   CHECK_FIXNUM (tem);
-  err = cfsetspeed (&attr, XFIXNUM (tem));
+  err = cfsetspeed (&attr, convert_speed (XFIXNUM (tem)));
   if (err != 0)
     report_file_error ("Failed cfsetspeed", tem);
   childp2 = Fplist_put (childp2, QCspeed, tem);
diff --git a/src/window.c b/src/window.c
index db324ef..a6e8ee0 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1723,14 +1723,16 @@ have been if redisplay had finished, do this:
 
 DEFUN ("window-end", Fwindow_end, Swindow_end, 0, 2, 0,
        doc: /* Return position at which display currently ends in WINDOW.
-WINDOW must be a live window and defaults to the selected one.
-This is updated by redisplay, when it runs to completion.
-Simply changing the buffer text or setting `window-start'
-does not update this value.
+This is the position after the final character in WINDOW.
+
+WINDOW must be a live window and defaults to the selected one.  This
+is updated by redisplay, when it runs to completion.  Simply changing
+the buffer text or setting `window-start' does not update this value.
+
 Return nil if there is no recorded value.  (This can happen if the
-last redisplay of WINDOW was preempted, and did not finish.)
-If UPDATE is non-nil, compute the up-to-date position
-if it isn't already recorded.  */)
+last redisplay of WINDOW was preempted, and did not finish.)  If
+UPDATE is non-nil, compute the up-to-date position if it isn't already
+recorded.  */)
   (Lisp_Object window, Lisp_Object update)
 {
   Lisp_Object value;
diff --git a/src/xdisp.c b/src/xdisp.c
index 290a91e..34e4640 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -33251,7 +33251,8 @@ note_mode_line_or_margin_highlight (Lisp_Object window, 
int x, int y,
      of the mode line without any text (e.g. past the right edge of
      the mode line text), use that windows's mode line help echo if it
      has been set.  */
-  if (STRINGP (string) || area == ON_MODE_LINE)
+  if (STRINGP (string) || area == ON_MODE_LINE || area == ON_HEADER_LINE
+      || area == ON_TAB_LINE)
     {
       /* Arrange to display the help by setting the global variables
         help_echo_string, help_echo_object, and help_echo_pos.  */
@@ -33308,6 +33309,19 @@ note_mode_line_or_margin_highlight (Lisp_Object 
window, int x, int y,
            }
          else if (draggable && area == ON_MODE_LINE)
            cursor = FRAME_OUTPUT_DATA (f)->vertical_drag_cursor;
+         else if ((area == ON_MODE_LINE
+                   && WINDOW_BOTTOMMOST_P (w)
+                   && !FRAME_HAS_MINIBUF_P (f)
+                   && !NILP (Fframe_parameter
+                             (w->frame, Qdrag_with_mode_line)))
+                  || (((area == ON_HEADER_LINE
+                        && !NILP (Fframe_parameter
+                                  (w->frame, Qdrag_with_header_line)))
+                       || (area == ON_TAB_LINE
+                           && !NILP (Fframe_parameter
+                                     (w->frame, Qdrag_with_tab_line))))
+                      && WINDOW_TOPMOST_P (w)))
+           cursor = FRAME_OUTPUT_DATA (f)->hand_cursor;
          else
            cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
        }
@@ -34897,6 +34911,10 @@ be let-bound around code that needs to disable 
messages temporarily. */);
   DEFSYM (Qdragging, "dragging");
   DEFSYM (Qdropping, "dropping");
 
+  DEFSYM (Qdrag_with_mode_line, "drag-with-mode-line");
+  DEFSYM (Qdrag_with_header_line, "drag-with-header-line");
+  DEFSYM (Qdrag_with_tab_line, "drag-with-tab-line");
+
   DEFSYM (Qinhibit_free_realized_faces, "inhibit-free-realized-faces");
 
   list_of_error = list1 (list2 (Qerror, Qvoid_variable));
diff --git a/src/xfns.c b/src/xfns.c
index e46616e..81349d0 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3361,17 +3361,19 @@ x_icon (struct frame *f, Lisp_Object parms)
     = gui_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, 
RES_TYPE_NUMBER);
   int icon_xval, icon_yval;
 
-  if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
+  bool xgiven = !EQ (icon_x, Qunbound);
+  bool ygiven = !EQ (icon_y, Qunbound);
+  if (xgiven != ygiven)
+    error ("Both left and top icon corners of icon must be specified");
+  if (xgiven)
     {
       icon_xval = check_integer_range (icon_x, INT_MIN, INT_MAX);
       icon_yval = check_integer_range (icon_y, INT_MIN, INT_MAX);
     }
-  else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound))
-    error ("Both left and top icon corners of icon must be specified");
 
   block_input ();
 
-  if (! EQ (icon_x, Qunbound))
+  if (xgiven)
     x_wm_set_icon_position (f, icon_xval, icon_yval);
 
 #if false /* gui_display_get_arg removes the visibility parameter as a
diff --git a/src/xfont.c b/src/xfont.c
index 0570ee9..81d3561 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -596,7 +596,10 @@ xfont_list_family (struct frame *f)
   char **names;
   int num_fonts, i;
   Lisp_Object list;
-  char *last_family UNINIT;
+  char const *last_family;
+#if defined GCC_LINT || defined lint
+  last_family = "";
+#endif
   int last_len;
 
   block_input ();
diff --git a/test/Makefile.in b/test/Makefile.in
index c1518d3..7047c24 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -49,6 +49,8 @@ SEPCHAR = @SEPCHAR@
 
 HAVE_NATIVE_COMP = @HAVE_NATIVE_COMP@
 
+REPLACE_FREE = @REPLACE_FREE@
+
 -include ${top_builddir}/src/verbose.mk
 
 # Load any GNU ELPA dependencies that are present, for optional tests.
@@ -274,6 +276,9 @@ MODULE_CFLAGS = -I../src -I$(srcdir)/../src -I../lib 
-I$(srcdir)/../lib \
 test_module = $(test_module_dir)/mod-test${SO}
 src/emacs-module-tests.log src/emacs-module-tests.elc: $(test_module)
 
+FREE_SOURCE_0 =
+FREE_SOURCE_1 = $(srcdir)/../lib/free.c
+
 # In the compilation command, we can't use any object or archive file
 # as source because those are not compiled with -fPIC.  Therefore we
 # use only source files.
@@ -282,7 +287,7 @@ $(test_module): $(test_module:${SO}=.c) 
../src/emacs-module.h
        $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \
          -o $@ $< $(LIBGMP) \
          $(and $(GMP_H),$(srcdir)/../lib/mini-gmp-gnulib.c) \
-         $(if $(OMIT_GNULIB_MODULE_free-posix),,$(srcdir)/../lib/free.c) \
+         $(FREE_SOURCE_$(REPLACE_FREE)) \
          $(srcdir)/../lib/timespec.c $(srcdir)/../lib/gettime.c
 endif
 
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el 
b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
index 11ffc11..3ec4234 100644
--- a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
+++ b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
@@ -574,7 +574,21 @@ METHOD is the method that was attempting to be called."
   (setf (get-slot-3 eitest-t1) 'setf-emu)
   (should (eq (get-slot-3 eitest-t1) 'setf-emu))
   ;; Roll back
-  (setf (get-slot-3 eitest-t1) 'emu))
+  (setf (get-slot-3 eitest-t1) 'emu)
+  (defvar eieio-tests-initform-was-evaluated)
+  (defclass eieio-tests-initform-not-evaluated-when-initarg-is-present ()
+    ((slot-with-initarg-and-initform
+      :initarg :slot-with-initarg-and-initform
+      :initform (setf eieio-tests-initform-was-evaluated t))))
+  (setq eieio-tests-initform-was-evaluated nil)
+  (make-instance
+   'eieio-tests-initform-not-evaluated-when-initarg-is-present)
+  (should eieio-tests-initform-was-evaluated)
+  (setq eieio-tests-initform-was-evaluated nil)
+  (make-instance
+   'eieio-tests-initform-not-evaluated-when-initarg-is-present
+   :slot-with-initarg-and-initform t)
+  (should-not eieio-tests-initform-was-evaluated))
 
 (defvar eitest-t2 nil)
 (ert-deftest eieio-test-26-default-inheritance ()
diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el
index e0fa66a..6125069 100644
--- a/test/lisp/filenotify-tests.el
+++ b/test/lisp/filenotify-tests.el
@@ -927,7 +927,7 @@ delivered."
     (file-notify--test-cleanup)))
 
 (file-notify--deftest-remote file-notify-test03-events
-  "Check file creation/change/removal notifications for remote files.")
+  "Check file creation/change/removal notifications for remote files." t)
 
 (require 'autorevert)
 (setq auto-revert-notify-exclude-dir-regexp "nothing-to-be-excluded"
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 257cbc2..a6b0c90 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -949,6 +949,44 @@ unquoted file names."
                              (make-auto-save-file-name)
                            (kill-buffer)))))))
 
+(ert-deftest files-test-auto-save-name-default ()
+  (with-temp-buffer
+    (let ((auto-save-file-name-transforms nil))
+      (setq buffer-file-name "/tmp/foo.txt")
+      (should (equal (make-auto-save-file-name) "/tmp/#foo.txt#")))))
+
+(ert-deftest files-test-auto-save-name-transform ()
+  (with-temp-buffer
+    (setq buffer-file-name "/tmp/foo.txt")
+    (let ((auto-save-file-name-transforms
+           '(("\\`/.*/\\([^/]+\\)\\'" "/var/tmp/\\1" nil))))
+      (should (equal (make-auto-save-file-name) "/var/tmp/#foo.txt#")))))
+
+(ert-deftest files-test-auto-save-name-unique ()
+  (with-temp-buffer
+    (setq buffer-file-name "/tmp/foo.txt")
+    (let ((auto-save-file-name-transforms
+           '(("\\`/.*/\\([^/]+\\)\\'" "/var/tmp/\\1" t))))
+      (should (equal (make-auto-save-file-name) "/var/tmp/#!tmp!foo.txt#")))
+    (let ((auto-save-file-name-transforms
+           '(("\\`/.*/\\([^/]+\\)\\'" "/var/tmp/\\1" sha1))))
+      (should (equal (make-auto-save-file-name)
+                     "/var/tmp/#b57c5a04f429a83305859d3350ecdab8315a9037#")))))
+
+(ert-deftest files-test-lock-name-default ()
+  (let ((lock-file-name-transforms nil))
+    (should (equal (make-lock-file-name "/tmp/foo.txt") "/tmp/.#foo.txt"))))
+
+(ert-deftest files-test-lock-name-unique ()
+  (let ((lock-file-name-transforms
+         '(("\\`/.*/\\([^/]+\\)\\'" "/var/tmp/\\1" t))))
+    (should (equal (make-lock-file-name "/tmp/foo.txt")
+                   "/var/tmp/.#!tmp!foo.txt")))
+  (let ((lock-file-name-transforms
+         '(("\\`/.*/\\([^/]+\\)\\'" "/var/tmp/\\1" sha1))))
+    (should (equal (make-lock-file-name "/tmp/foo.txt")
+                   "/var/tmp/.#b57c5a04f429a83305859d3350ecdab8315a9037"))))
+
 (ert-deftest files-tests-file-name-non-special-make-directory ()
   (files-tests--with-temp-non-special (tmpdir nospecial-dir t)
     (let ((default-directory nospecial-dir))
diff --git a/test/lisp/gnus/gnus-search-tests.el 
b/test/lisp/gnus/gnus-search-tests.el
index e30ed9a..6148da6 100644
--- a/test/lisp/gnus/gnus-search-tests.el
+++ b/test/lisp/gnus/gnus-search-tests.el
@@ -49,7 +49,9 @@
          (default-value 'gnus-search-expandable-keys))
         (pairs
          '(("su" . "subject")
-           ("sin" . "since"))))
+           ("sin" . "since")
+           ("body" . "body")
+           ("list-id" . "list-id"))))
     (dolist (p pairs)
       (should (equal (gnus-search-query-expand-key (car p))
                      (cdr p))))
diff --git a/test/lisp/net/tramp-archive-tests.el 
b/test/lisp/net/tramp-archive-tests.el
index ca1163b..aac1b13 100644
--- a/test/lisp/net/tramp-archive-tests.el
+++ b/test/lisp/net/tramp-archive-tests.el
@@ -856,7 +856,7 @@ This tests also `file-executable-p', `file-writable-p' and 
`set-file-modes'."
       (tramp-archive-cleanup-hash))))
 
 ;; The functions were introduced in Emacs 26.1.
-(ert-deftest tramp-archive-test39-make-nearby-temp-file ()
+(ert-deftest tramp-archive-test40-make-nearby-temp-file ()
   "Check `make-nearby-temp-file' and `temporary-file-directory'."
   (skip-unless tramp-archive-enabled)
   ;; Since Emacs 26.1.
@@ -893,7 +893,7 @@ This tests also `file-executable-p', `file-writable-p' and 
`set-file-modes'."
     (delete-directory tmp-file)
     (should-not (file-exists-p tmp-file))))
 
-(ert-deftest tramp-archive-test42-file-system-info ()
+(ert-deftest tramp-archive-test43-file-system-info ()
   "Check that `file-system-info' returns proper values."
   (skip-unless tramp-archive-enabled)
   ;; Since Emacs 27.1.
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 6aa8629..3dd22ac 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -33,7 +33,7 @@
 ;; remote host, set this environment variable to "/dev/null" or
 ;; whatever is appropriate on your system.
 
-;; For slow remote connections, `tramp-test43-asynchronous-requests'
+;; For slow remote connections, `tramp-test44-asynchronous-requests'
 ;; might be too heavy.  Setting $REMOTE_PARALLEL_PROCESSES to a proper
 ;; value less than 10 could help.
 
@@ -63,6 +63,8 @@
 (declare-function tramp-smb-get-localname "tramp-smb")
 (defvar ange-ftp-make-backup-files)
 (defvar auto-save-file-name-transforms)
+(defvar lock-file-name-transforms)
+(defvar remote-file-name-inhibit-locks)
 (defvar tramp-connection-properties)
 (defvar tramp-copy-size-limit)
 (defvar tramp-display-escape-sequence-regexp)
@@ -122,6 +124,7 @@
 (setq auth-source-save-behavior nil
       password-cache-expiry nil
       remote-file-name-inhibit-cache nil
+      tramp-allow-unsafe-temporary-files t
       tramp-cache-read-persistent-data t ;; For auth-sources.
       tramp-copy-size-limit nil
       tramp-persistency-file-name nil
@@ -2463,6 +2466,8 @@ This checks also `file-name-as-directory', 
`file-name-directory',
                          "^\\'")
                        tramp--test-messages))))))))
 
+           ;; We do not test lockname here.  See `tramp-test39-lock-file'.
+
            ;; Do not overwrite if excluded.
            (cl-letf (((symbol-function #'y-or-n-p) #'tramp--test-always)
                      ;; Ange-FTP.
@@ -2833,8 +2838,7 @@ This tests also `file-directory-p' and 
`file-accessible-directory-p'."
           (delete-directory tmp-name1 nil 'trash)
           ;; tramp-rclone.el and tramp-sshfs.el call the local
           ;; `delete-directory'.  This raises another error.
-          :type (if (or (tramp--test-rclone-p) (tramp--test-sshfs-p))
-                    'error 'file-error))
+          :type (if (tramp--test-fuse-p) 'error 'file-error))
          (delete-directory tmp-name1 'recursive 'trash)
          (should-not (file-directory-p tmp-name1))
          (should
@@ -5480,7 +5484,8 @@ Use direct async.")
 
   (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
     (let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
-         (tmp-name2 (tramp--test-make-temp-name nil quoted)))
+         (tmp-name2 (tramp--test-make-temp-name nil quoted))
+         tramp-allow-unsafe-temporary-files)
 
       (unwind-protect
          (progn
@@ -5568,8 +5573,7 @@ Use direct async.")
 
            ;; Create temporary file.  This shall check for sensible
            ;; files, owned by root.
-           (let ((tramp-auto-save-directory temporary-file-directory)
-                 tramp-allow-unsafe-temporary-files)
+           (let ((tramp-auto-save-directory temporary-file-directory))
              (write-region "foo" nil tmp-name1)
              (when (zerop (or (tramp-compat-file-attribute-user-id
                                (file-attributes tmp-name1))
@@ -5605,6 +5609,7 @@ Use direct async.")
     (let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
          (tmp-name2 (tramp--test-make-temp-name nil quoted))
          (ange-ftp-make-backup-files t)
+         tramp-allow-unsafe-temporary-files
          ;; These settings are not used by Tramp, so we ignore them.
          version-control delete-old-versions
          (kept-old-versions (default-toplevel-value 'kept-old-versions))
@@ -5715,7 +5720,6 @@ Use direct async.")
          ;; Create temporary file.  This shall check for sensible
          ;; files, owned by root.
          (let ((backup-directory-alist `(("." . ,temporary-file-directory)))
-               tramp-allow-unsafe-temporary-files
                tramp-backup-directory-alist)
            (write-region "foo" nil tmp-name1)
            (when (zerop (or (tramp-compat-file-attribute-user-id
@@ -5741,8 +5745,135 @@ Use direct async.")
        (ignore-errors (delete-file tmp-name1))
        (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)))))
 
+;; The functions were introduced in Emacs 28.1.
+(ert-deftest tramp-test39-lock-file ()
+  "Check `lock-file', `unlock-file' and `file-locked-p'."
+  (skip-unless (tramp--test-enabled))
+  (skip-unless (not (tramp--test-ange-ftp-p)))
+  ;; Since Emacs 28.1.
+  (skip-unless (and (fboundp 'lock-file) (fboundp 'unlock-file)))
+  (skip-unless (and (fboundp 'file-locked-p) (fboundp 'make-lock-file-name)))
+
+  ;; `lock-file', `unlock-file', `file-locked-p' and
+  ;; `make-lock-file-name' exists since Emacs 28.1.  We don't want to
+  ;; see compiler warnings for older Emacsen.
+  (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
+    (let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
+         (tmp-name2 (tramp--test-make-temp-name nil quoted))
+         (remote-file-name-inhibit-cache t)
+         (remote-file-name-inhibit-locks nil)
+         (create-lockfiles t)
+         tramp-allow-unsafe-temporary-files
+          (inhibit-message t)
+         ;; tramp-rclone.el and tramp-sshfs.el cache the mounted files.
+         (tramp-cleanup-connection-hook
+          (append
+           (and (tramp--test-fuse-p) '(tramp-fuse-unmount))
+           tramp-cleanup-connection-hook))
+         noninteractive)
+
+      (unwind-protect
+         (progn
+           ;; A simple file lock.
+           (should-not (with-no-warnings (file-locked-p tmp-name1)))
+           (with-no-warnings (lock-file tmp-name1))
+           (should (eq (with-no-warnings (file-locked-p tmp-name1)) t))
+
+           ;; If it is locked already, nothing changes.
+           (with-no-warnings (lock-file tmp-name1))
+           (should (eq (with-no-warnings (file-locked-p tmp-name1)) t))
+
+           ;; A new connection changes process id, and also the
+           ;; lockname contents.
+           (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
+           (should (stringp (with-no-warnings (file-locked-p tmp-name1))))
+
+           ;; When `remote-file-name-inhibit-locks' is set, nothing happens.
+           (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
+           (let ((remote-file-name-inhibit-locks t))
+             (with-no-warnings (lock-file tmp-name1))
+             (should-not (with-no-warnings (file-locked-p tmp-name1))))
+
+           ;; When `lock-file-name-transforms' is set, another lock
+           ;; file is used.
+           (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
+           (let ((lock-file-name-transforms `((".*" ,tmp-name2))))
+             (should
+              (string-equal
+               (with-no-warnings (make-lock-file-name tmp-name1))
+               (with-no-warnings (make-lock-file-name tmp-name2))))
+             (with-no-warnings (lock-file tmp-name1))
+             (should (eq (with-no-warnings (file-locked-p tmp-name1)) t))
+             (with-no-warnings (unlock-file tmp-name1))
+             (should-not (with-no-warnings (file-locked-p tmp-name1))))
+
+           ;; Steal the file lock.
+           (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
+           (cl-letf (((symbol-function #'read-char) (lambda (&rest _args) ?s)))
+             (with-no-warnings (lock-file tmp-name1)))
+           (should (eq (with-no-warnings (file-locked-p tmp-name1)) t))
+
+           ;; Ignore the file lock.
+           (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
+           (cl-letf (((symbol-function #'read-char) (lambda (&rest _args) ?p)))
+             (with-no-warnings (lock-file tmp-name1)))
+           (should (stringp (with-no-warnings (file-locked-p tmp-name1))))
+
+           ;; Quit the file lock machinery.
+           (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
+           (cl-letf (((symbol-function #'read-char) (lambda (&rest _args) ?q)))
+             (with-no-warnings
+               (should-error
+                (lock-file tmp-name1)
+                :type 'file-locked))
+             ;; The same for `write-region'.
+             (should-error
+              (write-region "foo" nil tmp-name1)
+              :type 'file-locked)
+             (should-error
+              (write-region "foo" nil tmp-name1 nil nil tmp-name1)
+               :type 'file-locked)
+             ;; The same for `set-visited-file-name'.
+              (with-temp-buffer
+               (should-error
+                 (set-visited-file-name tmp-name1)
+                :type 'file-locked)))
+           (should (stringp (with-no-warnings (file-locked-p tmp-name1))))
+           (should-not (file-exists-p tmp-name1)))
+
+       ;; Cleanup.
+       (ignore-errors (delete-file tmp-name1))
+       (with-no-warnings (unlock-file tmp-name1))
+       (with-no-warnings (unlock-file tmp-name2))
+       (should-not (with-no-warnings (file-locked-p tmp-name1)))
+       (should-not (with-no-warnings (file-locked-p tmp-name2))))
+
+      (unwind-protect
+         ;; Create temporary file.  This shall check for sensible
+         ;; files, owned by root.
+         (let ((lock-file-name-transforms auto-save-file-name-transforms))
+           (write-region "foo" nil tmp-name1)
+           (when (zerop (or (tramp-compat-file-attribute-user-id
+                             (file-attributes tmp-name1))
+                            tramp-unknown-id-integer))
+             (tramp-cleanup-connection
+              tramp-test-vec 'keep-debug 'keep-password)
+             (cl-letf (((symbol-function #'yes-or-no-p) #'ignore))
+               (should-error
+                (write-region "foo" nil tmp-name1)
+                :type 'file-error))
+             (tramp-cleanup-connection
+              tramp-test-vec 'keep-debug 'keep-password)
+             (cl-letf (((symbol-function #'yes-or-no-p)
+                        #'tramp--test-always))
+               (write-region "foo" nil tmp-name1))))
+
+       ;; Cleanup.
+       (ignore-errors (delete-file tmp-name1))
+       (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)))))
+
 ;; The functions were introduced in Emacs 26.1.
-(ert-deftest tramp-test39-make-nearby-temp-file ()
+(ert-deftest tramp-test40-make-nearby-temp-file ()
   "Check `make-nearby-temp-file' and `temporary-file-directory'."
   (skip-unless (tramp--test-enabled))
   (skip-unless (not (tramp--test-ange-ftp-p)))
@@ -5825,6 +5956,10 @@ This does not support globbing characters in file names 
(yet)."
   (string-match-p
    "ftp$" (file-remote-p tramp-test-temporary-file-directory 'method)))
 
+(defun tramp--test-fuse-p ()
+  "Check, whether an FUSE file system isused."
+  (or (tramp--test-rclone-p) (tramp--test-sshfs-p)))
+
 (defun tramp--test-gdrive-p ()
   "Check, whether the gdrive method is used."
   (string-equal
@@ -5935,7 +6070,9 @@ This requires restrictions of file name syntax."
            (file-truename tramp-test-temporary-file-directory))
           (tmp-name1 (tramp--test-make-temp-name nil quoted))
           (tmp-name2 (tramp--test-make-temp-name 'local quoted))
-          (files (delq nil files))
+          (files
+            (delq
+             nil (mapcar (lambda (x) (unless (string-empty-p x) x)) files)))
           (process-environment process-environment)
           (sorted-files (sort (copy-sequence files) #'string-lessp))
           buffer)
@@ -5945,7 +6082,7 @@ This requires restrictions of file name syntax."
            (make-directory tmp-name2)
 
            (dolist (elt files)
-             ;(tramp--test-message "%s" elt)
+              ;(tramp--test-message "'%s'" elt)
              (let* ((file1 (expand-file-name elt tmp-name1))
                     (file2 (expand-file-name elt tmp-name2))
                     (file3 (expand-file-name (concat elt "foo") tmp-name1)))
@@ -6113,7 +6250,7 @@ This requires restrictions of file name syntax."
        (ignore-errors (delete-directory tmp-name2 'recursive))))))
 
 (defun tramp--test-special-characters ()
-  "Perform the test in `tramp-test40-special-characters*'."
+  "Perform the test in `tramp-test41-special-characters*'."
   ;; Newlines, slashes and backslashes in file names are not
   ;; supported.  So we don't test.  And we don't test the tab
   ;; character on Windows or Cygwin, because the backslash is
@@ -6171,7 +6308,7 @@ This requires restrictions of file name syntax."
               files (list (mapconcat #'identity files ""))))))
 
 ;; These tests are inspired by Bug#17238.
-(ert-deftest tramp-test40-special-characters ()
+(ert-deftest tramp-test41-special-characters ()
   "Check special characters in file names."
   (skip-unless (tramp--test-enabled))
   (skip-unless (not (tramp--test-rsync-p)))
@@ -6179,7 +6316,7 @@ This requires restrictions of file name syntax."
 
   (tramp--test-special-characters))
 
-(ert-deftest tramp-test40-special-characters-with-stat ()
+(ert-deftest tramp-test41-special-characters-with-stat ()
   "Check special characters in file names.
 Use the `stat' command."
   :tags '(:expensive-test)
@@ -6197,7 +6334,7 @@ Use the `stat' command."
          tramp-connection-properties)))
     (tramp--test-special-characters)))
 
-(ert-deftest tramp-test40-special-characters-with-perl ()
+(ert-deftest tramp-test41-special-characters-with-perl ()
   "Check special characters in file names.
 Use the `perl' command."
   :tags '(:expensive-test)
@@ -6218,7 +6355,7 @@ Use the `perl' command."
          tramp-connection-properties)))
     (tramp--test-special-characters)))
 
-(ert-deftest tramp-test40-special-characters-with-ls ()
+(ert-deftest tramp-test41-special-characters-with-ls ()
   "Check special characters in file names.
 Use the `ls' command."
   :tags '(:expensive-test)
@@ -6239,7 +6376,7 @@ Use the `ls' command."
     (tramp--test-special-characters)))
 
 (defun tramp--test-utf8 ()
-  "Perform the test in `tramp-test41-utf8*'."
+  "Perform the test in `tramp-test42-utf8*'."
   (let* ((utf8 (if (and (eq system-type 'darwin)
                        (memq 'utf-8-hfs (coding-system-list)))
                   'utf-8-hfs 'utf-8))
@@ -6285,7 +6422,7 @@ Use the `ls' command."
             (replace-regexp-in-string "[ \t\n/.?]" "" x)))
          language-info-alist)))))))
 
-(ert-deftest tramp-test41-utf8 ()
+(ert-deftest tramp-test42-utf8 ()
   "Check UTF8 encoding in file names and file contents."
   (skip-unless (tramp--test-enabled))
   (skip-unless (not (tramp--test-docker-p)))
@@ -6298,7 +6435,7 @@ Use the `ls' command."
 
   (tramp--test-utf8))
 
-(ert-deftest tramp-test41-utf8-with-stat ()
+(ert-deftest tramp-test42-utf8-with-stat ()
   "Check UTF8 encoding in file names and file contents.
 Use the `stat' command."
   :tags '(:expensive-test)
@@ -6320,7 +6457,7 @@ Use the `stat' command."
          tramp-connection-properties)))
     (tramp--test-utf8)))
 
-(ert-deftest tramp-test41-utf8-with-perl ()
+(ert-deftest tramp-test42-utf8-with-perl ()
   "Check UTF8 encoding in file names and file contents.
 Use the `perl' command."
   :tags '(:expensive-test)
@@ -6345,7 +6482,7 @@ Use the `perl' command."
          tramp-connection-properties)))
     (tramp--test-utf8)))
 
-(ert-deftest tramp-test41-utf8-with-ls ()
+(ert-deftest tramp-test42-utf8-with-ls ()
   "Check UTF8 encoding in file names and file contents.
 Use the `ls' command."
   :tags '(:expensive-test)
@@ -6369,7 +6506,7 @@ Use the `ls' command."
          tramp-connection-properties)))
     (tramp--test-utf8)))
 
-(ert-deftest tramp-test42-file-system-info ()
+(ert-deftest tramp-test43-file-system-info ()
   "Check that `file-system-info' returns proper values."
   (skip-unless (tramp--test-enabled))
   ;; Since Emacs 27.1.
@@ -6386,11 +6523,11 @@ Use the `ls' command."
                 (numberp (nth 1 fsi))
                 (numberp (nth 2 fsi))))))
 
-;; `tramp-test43-asynchronous-requests' could be blocked.  So we set a
+;; `tramp-test44-asynchronous-requests' could be blocked.  So we set a
 ;; timeout of 300 seconds, and we send a SIGUSR1 signal after 300
 ;; seconds.  Similar check is performed in the timer function.
 (defconst tramp--test-asynchronous-requests-timeout 300
-  "Timeout for `tramp-test43-asynchronous-requests'.")
+  "Timeout for `tramp-test44-asynchronous-requests'.")
 
 (defmacro tramp--test-with-proper-process-name-and-buffer (proc &rest body)
   "Set \"process-name\" and \"process-buffer\" connection properties.
@@ -6426,7 +6563,7 @@ This is needed in timer functions as well as process 
filters and sentinels."
         (tramp-flush-connection-property v "process-buffer")))))
 
 ;; This test is inspired by Bug#16928.
-(ert-deftest tramp-test43-asynchronous-requests ()
+(ert-deftest tramp-test44-asynchronous-requests ()
   "Check parallel asynchronous requests.
 Such requests could arrive from timers, process filters and
 process sentinels.  They shall not disturb each other."
@@ -6626,11 +6763,11 @@ process sentinels.  They shall not disturb each other."
         (ignore-errors (cancel-timer timer))
         (ignore-errors (delete-directory tmp-name 'recursive))))))
 
-;; (tramp--test--deftest-direct-async-process 
tramp-test43-asynchronous-requests
+;; (tramp--test--deftest-direct-async-process 
tramp-test44-asynchronous-requests
 ;;   "Check parallel direct asynchronous requests." 'unstable)
 
 ;; This test is inspired by Bug#29163.
-(ert-deftest tramp-test44-auto-load ()
+(ert-deftest tramp-test45-auto-load ()
   "Check that Tramp autoloads properly."
   ;; If we use another syntax but `default', Tramp is already loaded
   ;; due to the `tramp-change-syntax' call.
@@ -6655,7 +6792,7 @@ process sentinels.  They shall not disturb each other."
        (mapconcat #'shell-quote-argument load-path " -L ")
        (shell-quote-argument code)))))))
 
-(ert-deftest tramp-test44-delay-load ()
+(ert-deftest tramp-test45-delay-load ()
   "Check that Tramp is loaded lazily, only when needed."
   ;; The autoloaded Tramp objects are different since Emacs 26.1.  We
   ;; cannot test older Emacsen, therefore.
@@ -6688,7 +6825,7 @@ process sentinels.  They shall not disturb each other."
          (mapconcat #'shell-quote-argument load-path " -L ")
          (shell-quote-argument (format code tm)))))))))
 
-(ert-deftest tramp-test44-recursive-load ()
+(ert-deftest tramp-test45-recursive-load ()
   "Check that Tramp does not fail due to recursive load."
   (skip-unless (tramp--test-enabled))
 
@@ -6712,7 +6849,7 @@ process sentinels.  They shall not disturb each other."
          (mapconcat #'shell-quote-argument load-path " -L ")
          (shell-quote-argument code))))))))
 
-(ert-deftest tramp-test44-remote-load-path ()
+(ert-deftest tramp-test45-remote-load-path ()
   "Check that Tramp autoloads its packages with remote `load-path'."
   ;; The autoloaded Tramp objects are different since Emacs 26.1.  We
   ;; cannot test older Emacsen, therefore.
@@ -6741,7 +6878,7 @@ process sentinels.  They shall not disturb each other."
        (mapconcat #'shell-quote-argument load-path " -L ")
        (shell-quote-argument code)))))))
 
-(ert-deftest tramp-test45-unload ()
+(ert-deftest tramp-test46-unload ()
   "Check that Tramp and its subpackages unload completely.
 Since it unloads Tramp, it shall be the last test to run."
   :tags '(:expensive-test)
@@ -6824,7 +6961,7 @@ If INTERACTIVE is non-nil, the tests are run 
interactively."
 ;; * Implement `tramp-test31-interrupt-process' for `adb', `sshfs' and
 ;;   for direct async processes.
 ;; * Check, why direct async processes do not work for
-;;   `tramp-test43-asynchronous-requests'.
+;;   `tramp-test44-asynchronous-requests'.
 
 (provide 'tramp-tests)
 
diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el
index 2db570c..6d004e6 100644
--- a/test/lisp/replace-tests.el
+++ b/test/lisp/replace-tests.el
@@ -601,4 +601,15 @@ bound to HIGHLIGHT-LOCUS."
          (if (match-string 2) "R" "L")))
       (should (equal (buffer-string) after)))))
 
+(ert-deftest test-count-matches ()
+  (with-temp-buffer
+    (insert "oooooooooo")
+    (goto-char (point-min))
+    (should (= (count-matches "oo") 5))
+    (should (= (count-matches "o+") 1)))
+  (with-temp-buffer
+    (insert "o\n\n\n\no\n\n")
+    (goto-char (point-min))
+    (should (= (count-matches "^$") 4))))
+
 ;;; replace-tests.el ends here
diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el
index 7c9d05a..268bb64 100644
--- a/test/lisp/shadowfile-tests.el
+++ b/test/lisp/shadowfile-tests.el
@@ -70,7 +70,7 @@
   "Temporary directory for Tramp tests.")
 
 (setq password-cache-expiry nil
-      shadow-debug (getenv "EMACS_HYDRA_CI")
+      shadow-debug (or (getenv "EMACS_HYDRA_CI") (getenv "EMACS_EMBA_CI"))
       tramp-verbose 0
       ;; When the remote user id is 0, Tramp refuses unsafe temporary files.
       tramp-allow-unsafe-temporary-files
@@ -732,6 +732,7 @@ guaranteed by the originator of a cluster definition."
   (skip-unless (file-writable-p shadow-test-remote-temporary-file-directory))
 
   (let ((backup-inhibited t)
+        create-lockfiles
         (shadow-info-file shadow-test-info-file)
        (shadow-todo-file shadow-test-todo-file)
         (shadow-inhibit-message t)
@@ -877,6 +878,7 @@ guaranteed by the originator of a cluster definition."
   (skip-unless (file-writable-p shadow-test-remote-temporary-file-directory))
 
   (let ((backup-inhibited t)
+        create-lockfiles
         (shadow-info-file shadow-test-info-file)
        (shadow-todo-file shadow-test-todo-file)
         (shadow-inhibit-message t)
diff --git a/test/lisp/shell-tests.el b/test/lisp/shell-tests.el
index d918de7..223a185 100644
--- a/test/lisp/shell-tests.el
+++ b/test/lisp/shell-tests.el
@@ -45,4 +45,23 @@
     (should (equal (shell--parse-pcomplete-arguments)
                    '(("cd" "ba" "") 1 4 7)))))
 
+(ert-deftest shell-tests-split-string ()
+  (should (equal (split-string-shell-command "ls /tmp")
+                 '("ls" "/tmp")))
+  (should (equal (split-string-shell-command "ls '/tmp/foo bar'")
+                 '("ls" "/tmp/foo bar")))
+  (should (equal (split-string-shell-command "ls \"/tmp/foo bar\"")
+                 '("ls" "/tmp/foo bar")))
+  (should (equal (split-string-shell-command "ls /tmp/'foo bar'")
+                 '("ls" "/tmp/foo bar")))
+  (should (equal (split-string-shell-command "ls /tmp/'foo\"bar'")
+                 '("ls" "/tmp/foo\"bar")))
+  (should (equal (split-string-shell-command "ls /tmp/\"foo''bar\"")
+                 '("ls" "/tmp/foo''bar")))
+  (should (equal (split-string-shell-command "ls /tmp/'foo\\ bar'")
+                 '("ls" "/tmp/foo\\ bar")))
+  (unless (memq system-type '(windows-nt ms-dos))
+    (should (equal (split-string-shell-command "ls /tmp/foo\\ bar")
+                   '("ls" "/tmp/foo bar")))))
+
 ;;; shell-tests.el ends here
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index 375251c..b57982a 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -477,7 +477,7 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350.";
   (add-hook 'subr-tests--hook 'f7 90)
   (add-hook 'subr-tests--hook 'f8 t)
   (should (equal subr-tests--hook '(f5 f6 f2 f1 f4 f3 f7 f8)))
-  ;; Make sue `nil' is equivalent to 0.
+  ;; Make sure `nil' is equivalent to 0.
   (add-hook 'subr-tests--hook 'f9 0)
   (add-hook 'subr-tests--hook 'f10)
   (should (equal subr-tests--hook '(f5 f10 f9 f6 f2 f1 f4 f3 f7 f8)))
diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el
index 07eb8bb..fba6f21 100644
--- a/test/lisp/thingatpt-tests.el
+++ b/test/lisp/thingatpt-tests.el
@@ -190,4 +190,37 @@ position to retrieve THING.")
     (goto-char 2)
     (should (eq (symbol-at-point) nil))))
 
+(defun test--number (number pos)
+  (with-temp-buffer
+    (insert (format "%s\n" number))
+    (goto-char (point-min))
+    (forward-char pos)
+    (number-at-point)))
+
+(ert-deftest test-numbers-none ()
+  (should (equal (test--number "foo" 0) nil)))
+
+(ert-deftest test-numbers-decimal ()
+  (should (equal (test--number "42" 0) 42))
+  (should (equal (test--number "42" 1) 42))
+  (should (equal (test--number "42" 2) 42)))
+
+(ert-deftest test-numbers-hex-lisp ()
+  (should (equal (test--number "#x42" 0) 66))
+  (should (equal (test--number "#x42" 1) 66))
+  (should (equal (test--number "#x42" 2) 66))
+  (should (equal (test--number "#xf00" 0) 3840))
+  (should (equal (test--number "#xf00" 1) 3840))
+  (should (equal (test--number "#xf00" 2) 3840))
+  (should (equal (test--number "#xf00" 3) 3840)))
+
+(ert-deftest test-numbers-hex-c ()
+  (should (equal (test--number "0x42" 0) 66))
+  (should (equal (test--number "0x42" 1) 66))
+  (should (equal (test--number "0x42" 2) 66))
+  (should (equal (test--number "0xf00" 0) 3840))
+  (should (equal (test--number "0xf00" 1) 3840))
+  (should (equal (test--number "0xf00" 2) 3840))
+  (should (equal (test--number "0xf00" 3) 3840)))
+
 ;;; thingatpt.el ends here
diff --git a/test/src/emacs-module-resources/mod-test.c 
b/test/src/emacs-module-resources/mod-test.c
index ad59cfc..5720af8 100644
--- a/test/src/emacs-module-resources/mod-test.c
+++ b/test/src/emacs-module-resources/mod-test.c
@@ -288,6 +288,8 @@ struct super_struct
   char large_unused_buffer[512];
 };
 
+static void signal_errno (emacs_env *, char const *);
+
 /* Return a new user-pointer to a super_struct, with amazing_int set
    to the passed parameter.  */
 static emacs_value
@@ -295,6 +297,8 @@ Fmod_test_userptr_make (emacs_env *env, ptrdiff_t nargs, 
emacs_value args[],
                        void *data)
 {
   struct super_struct *p = calloc (1, sizeof *p);
+  if (!p)
+    signal_errno (env, "calloc");
   p->amazing_int = env->extract_integer (env, args[0]);
   return env->make_user_ptr (env, free, p);
 }
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index b64c82c..9bab523 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -28,6 +28,7 @@
 (require 'puny)
 (require 'subr-x)
 (require 'dns)
+(require 'url-http)
 
 ;; Timeout in seconds; the test fails if the timeout is reached.
 (defvar process-test-sentinel-wait-timeout 2.0)
@@ -626,6 +627,8 @@ FD_SETSIZE file descriptors (Bug#24325)."
 FD_SETSIZE file descriptors (Bug#24325)."
   (skip-unless (featurep 'make-network-process '(:server t)))
   (skip-unless (featurep 'make-network-process '(:family local)))
+  ;; Avoid hang due to connect/accept handshake on Cygwin (bug#49496).
+  (skip-unless (not (eq system-type 'cygwin)))
   (with-timeout (60 (ert-fail "Test timed out"))
     (process-tests--with-temp-directory directory
       (process-tests--with-processes processes
@@ -914,5 +917,34 @@ Return nil if FILENAME doesn't exist."
       ;; ...and the change description should be "interrupt".
       (should (equal '("interrupt\n") events)))))
 
+(ert-deftest process-async-https-with-delay ()
+  "Bug#49449: asynchronous TLS connection with delayed completion."
+  (skip-unless (and internet-is-working (gnutls-available-p)))
+  (let* ((status nil)
+         (buf (url-http
+                 #s(url "https" nil nil "elpa.gnu.org" nil
+                        "/packages/archive-contents" nil nil t silent t t)
+                 (lambda (s) (setq status s))
+                 '(nil) nil 'tls)))
+    (unwind-protect
+        (progn
+          ;; Busy-wait for 1 s to allow for the TCP connection to complete.
+          (let ((delay 1.0)
+                (t0 (float-time)))
+            (while (< (float-time) (+ t0 delay))))
+          ;; Wait for the entire operation to finish.
+          (let ((limit 4.0)
+                (t0 (float-time)))
+            (while (and (null status)
+                        (< (float-time) (+ t0 limit)))
+              (sit-for 0.1)))
+          (should status)
+          (should-not (assq :error status))
+          (should buf)
+          (should (> (buffer-size buf) 0))
+          )
+      (when buf
+        (kill-buffer buf)))))
+
 (provide 'process-tests)
 ;;; process-tests.el ends here



reply via email to

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