emacs-diffs
[Top][All Lists]
Advanced

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

feature/native-comp 715a1ca 3/3: Merge remote-tracking branch 'savannah/


From: Andrea Corallo
Subject: feature/native-comp 715a1ca 3/3: Merge remote-tracking branch 'savannah/master' into HEAD
Date: Sun, 6 Dec 2020 12:36:22 -0500 (EST)

branch: feature/native-comp
commit 715a1ca1744f9a5918376bf7662c81302f0b20c0
Merge: 27f666e 40e1174
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    Merge remote-tracking branch 'savannah/master' into HEAD
---
 INSTALL                                            |   3 +
 doc/emacs/cmdargs.texi                             |   3 +-
 doc/emacs/misc.texi                                |   2 +-
 doc/lispref/tips.texi                              |  13 +-
 doc/lispref/windows.texi                           |  14 +-
 doc/misc/cl.texi                                   |  15 +-
 doc/misc/gnus.texi                                 |  16 +-
 doc/misc/tramp.texi                                |  37 +-
 etc/NEWS                                           |  34 +-
 lisp/align.el                                      |   2 +-
 lisp/apropos.el                                    |   2 -
 lisp/arc-mode.el                                   |   2 +-
 lisp/autorevert.el                                 |  29 +-
 lisp/bookmark.el                                   |  27 +-
 lisp/calc/calccomp.el                              |  37 +-
 lisp/cedet/data-debug.el                           |   6 +-
 lisp/cedet/ede/custom.el                           |   3 +-
 lisp/cedet/ede/project-am.el                       |   3 +-
 lisp/cedet/mode-local.el                           |   2 +-
 lisp/cedet/semantic.el                             |   3 +-
 lisp/cedet/semantic/analyze/debug.el               |   2 +-
 lisp/cedet/semantic/grammar.el                     |  55 +-
 lisp/cedet/semantic/senator.el                     |  18 +-
 lisp/cedet/semantic/symref/list.el                 |   4 +-
 lisp/cedet/semantic/util-modes.el                  |   4 +-
 lisp/cedet/semantic/wisent/python.el               |   4 +-
 lisp/cedet/srecode/srt-mode.el                     |  24 +-
 lisp/cus-edit.el                                   |   5 +-
 lisp/dired-aux.el                                  |   8 +-
 lisp/dired.el                                      |   3 +-
 lisp/emacs-lisp/advice.el                          |   5 +-
 lisp/emacs-lisp/bytecomp.el                        | 132 +---
 lisp/emacs-lisp/chart.el                           |   2 +-
 lisp/emacs-lisp/cl-print.el                        |   2 -
 lisp/emacs-lisp/copyright.el                       |   2 +-
 lisp/emacs-lisp/debug.el                           |   1 -
 lisp/emacs-lisp/eieio-custom.el                    |  10 +-
 lisp/emacs-lisp/elint.el                           |  13 +-
 lisp/emacs-lisp/ert.el                             |  22 +-
 lisp/emacs-lisp/lisp-mode.el                       |   2 +-
 lisp/emacs-lisp/pp.el                              |   2 +-
 lisp/emacs-lisp/re-builder.el                      |   6 +-
 lisp/emacs-lisp/shadow.el                          |   5 +-
 lisp/emacs-lisp/smie.el                            |   4 +-
 lisp/emacs-lisp/syntax.el                          |   2 +-
 lisp/emacs-lisp/trace.el                           |   2 +-
 lisp/emulation/edt.el                              |   2 +-
 lisp/emulation/viper-cmd.el                        |  14 +-
 lisp/emulation/viper-util.el                       |   2 +-
 lisp/emulation/viper.el                            |   2 +-
 lisp/erc/erc-goodies.el                            |   3 +-
 lisp/erc/erc-list.el                               |  12 +-
 lisp/erc/erc-pcomplete.el                          |  22 +-
 lisp/erc/erc.el                                    |  13 +-
 lisp/eshell/em-cmpl.el                             |  72 +-
 lisp/eshell/em-dirs.el                             |   6 +-
 lisp/eshell/em-glob.el                             |   4 +-
 lisp/eshell/em-hist.el                             |  11 +-
 lisp/eshell/em-prompt.el                           |   5 +-
 lisp/eshell/em-rebind.el                           |   5 +-
 lisp/eshell/em-script.el                           |   6 +-
 lisp/eshell/em-smart.el                            |   6 +-
 lisp/eshell/em-term.el                             |   8 +-
 lisp/eshell/em-tramp.el                            |   7 +-
 lisp/eshell/em-unix.el                             |  20 +-
 lisp/eshell/esh-arg.el                             |   4 +-
 lisp/eshell/esh-cmd.el                             |  12 +-
 lisp/eshell/esh-io.el                              |   4 +-
 lisp/eshell/esh-mode.el                            |  37 +-
 lisp/eshell/esh-var.el                             |   8 +-
 lisp/facemenu.el                                   |   4 -
 lisp/gnus/message.el                               |  17 +-
 lisp/gnus/nnimap.el                                |  20 +-
 lisp/gnus/spam.el                                  |  26 +-
 lisp/help-mode.el                                  |   1 -
 lisp/hi-lock.el                                    |   2 -
 lisp/htmlfontify.el                                |  10 +-
 lisp/ibuffer.el                                    |   1 -
 lisp/icomplete.el                                  |   7 +-
 lisp/international/iso-transl.el                   |  10 -
 lisp/jsonrpc.el                                    |  27 +-
 lisp/ldefs-boot.el                                 | 785 ++++++++++----------
 lisp/loadup.el                                     |   1 +
 lisp/mail/emacsbug.el                              |   9 +-
 lisp/mail/rfc822.el                                |   3 +-
 lisp/mail/rmail.el                                 |  57 +-
 lisp/mail/rmailedit.el                             |  22 +-
 lisp/mail/rmailout.el                              |   2 +-
 lisp/mail/rmailsum.el                              |  15 +-
 lisp/mail/sendmail.el                              |  26 +-
 lisp/man.el                                        |   2 -
 lisp/mwheel.el                                     |   1 -
 lisp/net/ange-ftp.el                               |  22 +-
 lisp/net/eudc-vars.el                              |   2 -
 lisp/net/eww.el                                    |   2 +-
 lisp/net/imap.el                                   |   3 +-
 lisp/net/ldap.el                                   |   1 -
 lisp/net/net-utils.el                              |  15 +-
 lisp/net/newst-plainview.el                        |  14 +-
 lisp/net/newst-treeview.el                         |   9 +-
 lisp/net/rlogin.el                                 |   6 +-
 lisp/net/secrets.el                                |   4 +-
 lisp/net/sieve-mode.el                             |  19 +-
 lisp/net/sieve.el                                  |   7 +-
 lisp/net/snmp-mode.el                              |  66 +-
 lisp/net/telnet.el                                 |   6 +-
 lisp/net/tramp-adb.el                              |   6 +-
 lisp/net/tramp-cmds.el                             |   3 +-
 lisp/net/tramp-compat.el                           |   7 +
 lisp/net/tramp-ftp.el                              |   1 -
 lisp/net/tramp-gvfs.el                             |  37 +-
 lisp/net/tramp-sh.el                               | 236 ++++---
 lisp/net/tramp-smb.el                              |  14 +-
 lisp/net/tramp.el                                  | 126 ++--
 lisp/net/trampver.el                               |   2 +-
 lisp/nxml/xsd-regexp.el                            |   8 +-
 lisp/obsolete/cl-compat.el                         |  17 +-
 lisp/obsolete/cl.el                                |   4 +-
 lisp/obsolete/terminal.el                          |   7 +-
 lisp/org/org.el                                    |   2 -
 lisp/play/decipher.el                              |   4 +-
 lisp/play/doctor.el                                | 786 ++++++++++-----------
 lisp/play/dunnet.el                                |  16 +-
 lisp/play/gomoku.el                                |   5 +-
 lisp/progmodes/antlr-mode.el                       |   4 +-
 lisp/progmodes/cc-engine.el                        |   2 +-
 lisp/progmodes/cperl-mode.el                       |  21 +-
 lisp/progmodes/cwarn.el                            |   2 -
 lisp/progmodes/etags.el                            |   1 -
 lisp/progmodes/executable.el                       |   2 +-
 lisp/progmodes/f90.el                              |  41 +-
 lisp/progmodes/flymake-cc.el                       |   2 +-
 lisp/progmodes/fortran.el                          |  61 +-
 lisp/progmodes/gud.el                              |  64 +-
 lisp/progmodes/hideshow.el                         |   2 +-
 lisp/progmodes/icon.el                             |  33 +-
 lisp/progmodes/ld-script.el                        |   7 +-
 lisp/progmodes/mixal-mode.el                       |  22 +-
 lisp/progmodes/modula2.el                          |  16 +-
 lisp/progmodes/perl-mode.el                        |  39 +-
 lisp/progmodes/project.el                          |  66 +-
 lisp/progmodes/python.el                           |   6 +
 lisp/progmodes/simula.el                           |  32 +-
 lisp/progmodes/sql.el                              |   1 -
 lisp/progmodes/subword.el                          |   2 +-
 lisp/progmodes/which-func.el                       |   2 +-
 lisp/progmodes/xref.el                             | 103 ++-
 lisp/savehist.el                                   |   2 -
 lisp/shell.el                                      |  24 +-
 lisp/simple.el                                     |  22 +-
 lisp/so-long.el                                    |  13 +-
 lisp/subr.el                                       |   8 +-
 lisp/term.el                                       |  21 +-
 lisp/term/ns-win.el                                |   1 -
 lisp/term/w32-win.el                               |   1 -
 lisp/term/x-win.el                                 |   1 -
 lisp/term/xterm.el                                 |   3 +-
 lisp/textmodes/artist.el                           |  40 +-
 lisp/textmodes/bibtex.el                           | 240 ++++---
 lisp/textmodes/dns-mode.el                         |  10 +-
 lisp/textmodes/enriched.el                         |   5 +-
 lisp/textmodes/ispell.el                           |   2 +-
 lisp/textmodes/nroff-mode.el                       |  39 +-
 lisp/textmodes/picture.el                          |  15 +-
 lisp/textmodes/refill.el                           |  12 +-
 lisp/textmodes/reftex.el                           |   4 -
 lisp/textmodes/two-column.el                       |   5 +-
 lisp/url/url-cookie.el                             |   2 +-
 lisp/url/url-http.el                               |  12 +-
 lisp/url/url-util.el                               |   4 +-
 lisp/vc/add-log.el                                 |  46 +-
 lisp/vc/cvs-status.el                              |   4 +-
 lisp/vc/diff-mode.el                               |  57 +-
 lisp/vc/diff.el                                    |   6 +-
 lisp/vc/ediff-util.el                              |   3 +-
 lisp/vc/log-edit.el                                |  11 +-
 lisp/vc/log-view.el                                |  10 +-
 lisp/vc/pcvs.el                                    |  37 +-
 lisp/vc/smerge-mode.el                             |  16 +-
 lisp/vc/vc-annotate.el                             |  18 +-
 lisp/vc/vc-bzr.el                                  |  12 +-
 lisp/vc/vc-dir.el                                  |  14 +-
 lisp/vc/vc-dispatcher.el                           |  18 +-
 lisp/vc/vc-git.el                                  |  18 +-
 lisp/vc/vc-hg.el                                   |  20 +-
 lisp/vc/vc-hooks.el                                |   2 +-
 lisp/vc/vc-mtn.el                                  |  10 +-
 lisp/vc/vc-svn.el                                  |   2 +-
 lisp/vc/vc.el                                      |  40 +-
 lisp/view.el                                       |   9 +-
 lisp/wid-browse.el                                 |   1 -
 lisp/windmove.el                                   |   6 +-
 lisp/window.el                                     |  23 +-
 lisp/woman.el                                      |   1 -
 src/alloc.c                                        |  25 +
 src/buffer.c                                       |   5 +-
 src/doprnt.c                                       |  26 +-
 src/emacs-module.c                                 |   4 +-
 src/emacs.c                                        |   9 +-
 src/eval.c                                         |  15 +-
 src/lisp.h                                         |   2 +
 src/search.c                                       |   4 +-
 src/xdisp.c                                        |   9 +-
 test/lisp/autorevert-tests.el                      |  85 ++-
 .../error-lexical-var-with-add-hook.el             |   4 +
 .../error-lexical-var-with-remove-hook.el          |   4 +
 ...al-var-with-run-hook-with-args-until-failure.el |   3 +
 ...al-var-with-run-hook-with-args-until-success.el |   3 +
 .../error-lexical-var-with-run-hook-with-args.el   |   3 +
 .../error-lexical-var-with-symbol-value.el         |   4 +
 .../warn-autoload-not-on-top-level.el              |   3 +
 .../emacs-lisp/bytecomp-resources/warn-callargs.el |   5 +
 .../bytecomp-resources/warn-defcustom-nogroup.el   |   3 +
 .../bytecomp-resources/warn-defcustom-notype.el    |   3 +
 .../bytecomp-resources/warn-defvar-lacks-prefix.el |   2 +
 .../emacs-lisp/bytecomp-resources/warn-format.el   |   2 +
 .../bytecomp-resources/warn-free-setq.el           |   2 +
 .../warn-free-variable-reference.el                |   4 +
 .../bytecomp-resources/warn-interactive-only.el    |   3 +
 .../warn-lambda-malformed-interactive-spec.el      |   4 +
 .../warn-make-variable-buffer-local.el             |   4 +
 .../bytecomp-resources/warn-obsolete-defun.el      |   8 +
 .../bytecomp-resources/warn-obsolete-hook.el       |   3 +
 .../warn-obsolete-variable-same-file.el            |  13 +
 .../bytecomp-resources/warn-obsolete-variable.el   |   4 +
 .../warn-redefine-defun-as-macro.el                |   3 +
 .../bytecomp-resources/warn-redefine-defun.el      |   3 +
 .../warn-redefine-macro-as-defun.el                |   3 +
 .../bytecomp-resources/warn-save-excursion.el      |   5 +
 .../warn-variable-let-bind-constant.el             |   3 +
 .../warn-variable-let-bind-nonvariable.el          |   3 +
 .../warn-variable-set-constant.el                  |   3 +
 .../warn-variable-set-nonvariable.el               |   3 +
 test/lisp/emacs-lisp/bytecomp-tests.el             | 106 +++
 test/lisp/erc/erc-track-tests.el                   |   1 -
 test/lisp/faces-tests.el                           |   1 -
 test/lisp/net/tramp-tests.el                       |  31 +-
 test/lisp/nxml/xsd-regexp-tests.el                 |  30 +
 test/lisp/subr-tests.el                            |  24 +
 test/manual/indent/perl.perl                       |  14 +
 test/src/emacs-module-resources/mod-test.c         |   6 +
 test/src/eval-tests.el                             |  33 +
 242 files changed, 2927 insertions(+), 2396 deletions(-)

diff --git a/INSTALL b/INSTALL
index 5909e8c..324ef60 100644
--- a/INSTALL
+++ b/INSTALL
@@ -113,6 +113,7 @@ sections if you need to.
 
                 make help
 
+
 ADDITIONAL DISTRIBUTION FILES
 
 * Complex Text Layout support libraries
@@ -222,6 +223,8 @@ like 'apt-get build-dep emacs' (on older systems, replace 
'emacs' with
 eg 'emacs25').  On Red Hat-based systems, the corresponding command is
 'dnf builddep emacs' (on older systems, use 'yum-builddep' instead).
 
+On FreeBSD, the command is 'pkg install -y `pkg rquery %dn emacs-devel`'.
+
 
 DETAILED BUILDING AND INSTALLATION:
 
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi
index 3dd1fe9..a828eee 100644
--- a/doc/emacs/cmdargs.texi
+++ b/doc/emacs/cmdargs.texi
@@ -654,7 +654,8 @@ Used by the Gnus package.
 @item SHELL
 @vindex SHELL@r{, environment variable}
 The name of an interpreter used to parse and execute programs run from
-inside Emacs.
+inside Emacs.  This is used to initialize the variable
+@code{shell-file-name} (@pxref{Single Shell}).
 @item SMTPSERVER
 @vindex SMTPSERVER@r{, environment variable}
 The name of the outgoing mail server.  This is used to initialize the
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 4865ee1..5b5134b 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -810,6 +810,7 @@ to @command{gpg}.  This will output the list of keys to the
 buffer whose name is the value of @code{shell-command-buffer-name}.
 
 @vindex shell-file-name
+@cindex @env{SHELL} environment variable
   The above commands use the shell specified by the variable
 @code{shell-file-name}.  Its default value is determined by the
 @env{SHELL} environment variable when Emacs is started.  If the file
@@ -889,7 +890,6 @@ Subshells in different buffers run independently and in 
parallel.
 @vindex explicit-shell-file-name
 @cindex environment variables for subshells
 @cindex @env{ESHELL} environment variable
-@cindex @env{SHELL} environment variable
   To specify the shell file name used by @kbd{M-x shell}, customize
 the variable @code{explicit-shell-file-name}.  If this is @code{nil}
 (the default), Emacs uses the environment variable @env{ESHELL} if it
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index 40d01d4..c9a43e0 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -139,17 +139,8 @@ your file do not need to load the extra library.
 
 @item
 If you need Common Lisp extensions, use the @code{cl-lib} library
-rather than the old @code{cl} library.  The latter does not
-use a clean namespace (i.e., its definitions do not
-start with a @samp{cl-} prefix).  If your package loads @code{cl} at
-run time, that could cause name clashes for users who don't use that
-package.
-
-There is no problem with using the @code{cl} package at @emph{compile}
-time, with @code{(eval-when-compile (require 'cl))}.  That's
-sufficient for using the macros in the @code{cl} package, because the
-compiler expands them before generating the byte-code.  It is still
-better to use the more modern @code{cl-lib} in this case, though.
+rather than the old @code{cl} library.  The latter library is
+deprecated and will be removed in a future version of Emacs.
 
 @item
 When defining a major mode, please follow the major mode
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 2d092e1..db80b49 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -365,7 +365,7 @@ appears right below @var{window}.
 @end defun
 
 @cindex window in direction
-@defun window-in-direction direction &optional window ignore sign wrap mini
+@defun window-in-direction direction &optional window ignore sign wrap minibuf
 This function returns the nearest live window in direction
 @var{direction} as seen from the position of @code{window-point} in
 window @var{window}.  The argument @var{direction} must be one of
@@ -392,11 +392,13 @@ is at the top of the frame and @var{direction} is 
@code{above}, then
 this function usually returns the frame's minibuffer window if it's
 active and a window at the bottom of the frame otherwise.
 
-If the optional argument @var{mini} is @code{nil}, this means to return
-the minibuffer window if and only if it is currently active.  If
-@var{mini} is non-@code{nil}, this function may return the minibuffer
-window even when it's not active.  However, if @var{wrap} is
-non-@code{nil}, it always acts as if @var{mini} were @code{nil}.
+If the optional argument @var{minibuf} is @code{t}, this function may
+return the minibuffer window even when it's not active.  If the
+optional argument @var{minibuf} is @code{nil}, this means to return
+the minibuffer window if and only if it is currently active.
+If @var{minibuf} is neither @code{nil} nor @code{t}, this function
+never returns the minibuffer window.  However, if @var{wrap} is
+non-@code{nil}, it always acts as if @var{minibuf} were @code{nil}.
 
 If it doesn't find a suitable window, this function returns
 @code{nil}.
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index 2b38544..084edd1 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -210,17 +210,10 @@ behave in exactly the same way as the @file{cl-lib.el} 
versions.
 @c There is also cl-mapc, which was called cl-mapc even before cl-lib.el.
 @c But not autoloaded, so maybe not much used?
 
-Since the old @file{cl.el} does not use a clean namespace, Emacs has a
-policy that packages distributed with Emacs must not load @code{cl} at
-run time.  (It is ok for them to load @code{cl} at @emph{compile}
-time, with @code{eval-when-compile}, and use the macros it provides.)
-There is no such restriction on the use of @code{cl-lib}.  New code
-should use @code{cl-lib} rather than @code{cl}.
-
-There is one more file, @file{cl-compat.el}, which defines some
-routines from the older Quiroz @file{cl.el} package that are not otherwise
-present in the new package.  This file is obsolete and should not be
-used in new code.
+The old file @file{cl.el}, as well as the even older
+@file{cl-compat.el}, are deprecated and will be removed in a future
+version of Emacs.  Any existing code that uses them should be updated
+to use @file{cl-lib.el} instead.
 
 @node Naming Conventions
 @section Naming Conventions
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 81ce139..4aa07ce 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -14521,6 +14521,14 @@ The default is @samp{(%Deleted %Seen)}.
 
 @end table
 
+@vindex nnimap-split-download-body
+By default, the nnimap back end only retrieves the message headers;
+the option @code{nnimap-split-download-body} (which is a regular
+customization option, not a server variable) tells it to retrieve the
+message bodies as well.  We don't set this by default because it will
+slow @acronym{IMAP} down, and that is not an appropriate decision to
+make on behalf of the user.
+
 Here's a complete example @code{nnimap} backend with a client-side
 ``fancy'' splitting method:
 
@@ -24622,13 +24630,7 @@ the value @samp{spam} means 
@samp{nnimap+your-server:spam}.  The value
 Note for IMAP users: if you use the @code{spam-check-bogofilter},
 @code{spam-check-ifile}, and @code{spam-check-stat} spam back ends,
 you should also set the variable @code{nnimap-split-download-body} to
-@code{t}.  These spam back ends are most useful when they can ``scan''
-the full message body.  By default, the nnimap back end only retrieves
-the message headers; @code{nnimap-split-download-body} tells it to
-retrieve the message bodies as well.  We don't set this by default
-because it will slow @acronym{IMAP} down, and that is not an
-appropriate decision to make on behalf of the user.  @xref{Client-Side
-IMAP Splitting}.
+@code{t}.  @xref{Client-Side IMAP Splitting}.
 
 You have to specify one or more spam back ends for @code{spam-split}
 to use, by setting the @code{spam-use-*} variables.  @xref{Spam Back
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 3a6e425..59b8bdb 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -319,14 +319,14 @@ behind the scenes when you open a file with @value{tramp}.
 @uref{https://ftp.gnu.org/gnu/tramp/}.  The version number of
 @value{tramp} can be obtained by the variable @code{tramp-version}.
 For released @value{tramp} versions, this is a three-number string
-like ``2.4.3''.
+like ``2.4.5''.
 
 A @value{tramp} release, which is packaged with Emacs, could differ
 slightly from the corresponding standalone release.  This is because
 it isn't always possible to synchronize release dates between Emacs
 and @value{tramp}.  Such version numbers have the Emacs version number
-as suffix, like ``2.4.3.27.1''.  This means @w{@value{tramp} 2.4.3} as
-integrated in @w{Emacs 27.1}.  A complete list of @value{tramp}
+as suffix, like ``2.4.5.27.2''.  This means @w{@value{tramp} 2.4.5} as
+integrated in @w{Emacs 27.2}.  A complete list of @value{tramp}
 versions packaged with Emacs can be retrieved by
 
 @vindex customize-package-emacs-version-alist
@@ -338,7 +338,7 @@ versions packaged with Emacs can be retrieved by
 ELPA} package.  Besides the standalone releases, further minor version
 of @value{tramp} will appear on GNU ELPA, until the next @value{tramp}
 release appears.  These minor versions have a four-number string, like
-``2.4.3.1''.
+``2.4.5.1''.
 
 @value{tramp} development versions are available on Git servers.
 Development versions contain new and incomplete features.  The
@@ -2335,7 +2335,7 @@ string of that environment variable looks always like
 @example
 @group
 echo $INSIDE_EMACS
-@result{} 27.1,tramp:2.4.3
+@result{} 27.2,tramp:2.4.5
 @end group
 @end example
 
@@ -3193,9 +3193,9 @@ integrated to work with @value{tramp}: @file{shell.el},
 @value{tramp} always modifies the @env{INSIDE_EMACS} environment
 variable for remote processes.  Per default, this environment variable
 shows the Emacs version.  @value{tramp} adds its own version string,
-so it looks like @samp{27.1,tramp:2.4.3.1}.  However, other packages
+so it looks like @samp{27.2,tramp:2.4.5.1}.  However, other packages
 might also add their name to this environment variable, like
-@samp{27.1,comint,tramp:2.4.3.1}.
+@samp{27.2,comint,tramp:2.4.5.1}.
 
 For @value{tramp} to find the command on the remote, it must be
 accessible through the default search path as setup by @value{tramp}
@@ -3948,7 +3948,7 @@ row are possible, like 
@file{/path/to/dir/file.tar.gz.uu/dir/file}.
 
 @vindex tramp-archive-all-gvfs-methods
 An archive file name could be a remote file name, as in
-@file{/ftp:anonymous@@ftp.gnu.org:/gnu/tramp/tramp-2.4.3.tar.gz/INSTALL}.
+@file{/ftp:anonymous@@ftp.gnu.org:/gnu/tramp/tramp-2.4.5.tar.gz/INSTALL}.
 Since all file operations are mapped internally to @acronym{GVFS}
 operations, remote file names supported by @code{tramp-gvfs} perform
 better, because no local copy of the file archive must be downloaded
@@ -3959,7 +3959,7 @@ the similar @samp{/scp:user@@host:...}.  See the constant
 
 If @code{url-handler-mode} is enabled, archives could be visited via
 URLs, like
-@file{https://ftp.gnu.org/gnu/tramp/tramp-2.4.3.tar.gz/INSTALL}.  This
+@file{https://ftp.gnu.org/gnu/tramp/tramp-2.4.5.tar.gz/INSTALL}.  This
 allows complex file operations like
 
 @lisp
@@ -3967,8 +3967,8 @@ allows complex file operations like
 (progn
   (url-handler-mode 1)
   (ediff-directories
-   "https://ftp.gnu.org/gnu/tramp/tramp-2.4.2.tar.gz/tramp-2.4.2";
-   "https://ftp.gnu.org/gnu/tramp/tramp-2.4.3.tar.gz/tramp-2.4.3"; ""))
+   "https://ftp.gnu.org/gnu/tramp/tramp-2.4.4.tar.gz/tramp-2.4.4";
+   "https://ftp.gnu.org/gnu/tramp/tramp-2.4.5.tar.gz/tramp-2.4.5"; ""))
 @end group
 @end lisp
 
@@ -5043,6 +5043,7 @@ root-directory, it is most likely sufficient to make the
 @node Traces and Profiles
 @chapter How to Customize Traces
 @vindex tramp-verbose
+@vindex tramp-debug-to-file
 
 @value{tramp} messages are raised with verbosity levels ranging from 0
 to 10.  @value{tramp} does not display all messages; only those with a
@@ -5095,6 +5096,20 @@ If @code{tramp-verbose} is greater than or equal to 10, 
Lisp
 backtraces are also added to the @value{tramp} debug buffer in case of
 errors.
 
+In very rare cases it could happen, that @value{tramp} blocks Emacs.
+Killing Emacs does not allow to inspect the debug buffer.  In that
+case, you might instruct @value{tramp} to mirror the debug buffer to
+file:
+
+@lisp
+(customize-set-variable 'tramp-debug-to-file t)
+@end lisp
+
+The debug buffer is written as file in your
+@code{temporary-file-directory}, which is usually @file{/tmp/}.  Use
+this option with care, because it could decrease the performance of
+@value{tramp} actions.
+
 To enable stepping through @value{tramp} function call traces, they
 have to be specifically enabled as shown in this code:
 
diff --git a/etc/NEWS b/etc/NEWS
index e42a1bc..6444e21 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -192,6 +192,9 @@ have been replaced with "chat.freenode.net" throughout 
Emacs.
 These functions return the connection local value of the respective
 variables.  This can be used for remote hosts.
 
+** Emacs now prints a backtrace when signaling an error in batch mode.  This
+makes debugging Emacs Lisp scripts run in batch mode easier.
+
 
 * Editing Changes in Emacs 28.1
 
@@ -490,7 +493,7 @@ tags to be considered as well.
 
 +++
 *** New user option 'gnus-paging-select-next'.
-This controls what happens when using commands like `SPC' and `DEL' to
+This controls what happens when using commands like 'SPC' and 'DEL' to
 page the current article.  If non-nil (the default), go to the
 next/prev article, but if nil, do nothing at the end/start of the article.
 
@@ -842,6 +845,12 @@ performance of asynchronous remote processes" node of the 
Tramp manual
 for details, and also for a discussion or restrictions.  This feature
 is experimental.
 
++++
+*** New user option 'tramp-debug-to-file'.
+When non-nil, this user option instructs Tramp to mirror the debug
+buffer to a file under the "/tmp/" directory.  This is useful, if (in
+rare cases) Tramp blocks Emacs, and we need further debug information.
+
 ** Tempo
 
 ---
@@ -1185,6 +1194,11 @@ project's root directory, respectively.
 So typing 'C-u RET' in the "*xref*" buffer quits its window
 before navigating to the selected location.
 
+*** New options xref-search-program and xref-search-program-alist.
+So far Grep and ripgrep are supported.  ripgrep seems to offer better
+performance in certain cases, in particular for case-insensitive
+searches.
+
 ** json.el
 
 ---
@@ -1345,6 +1359,12 @@ This new command (bound to 'C-c C-l') regenerates the 
current hunk.
 
 ** Miscellaneous
 
+---
+*** iso-transl is now preloaded.
+This means that keystrokes like 'Alt-[' are defined by default,
+instead of only becoming available after doing (for instance)
+'C-x 8 <letter>'.
+
 *** New user option 'completions-detailed'.
 When non-nil, some commands like 'describe-symbol' show more detailed
 completions with more information in completion prefix and suffix.
@@ -1353,7 +1373,7 @@ completions with more information in completion prefix 
and suffix.
 *** User option 'completions-format' supports a new value 'one-column'.
 
 ---
-*** New user option 'bibtex-unify-case-convert'.
+*** New user option 'bibtex-unify-case-function'.
 This new option allows the user to customize how case is converted
 when unifying entries.
 
@@ -1530,7 +1550,7 @@ mouse now pops up a TTY menu by default instead of 
running the command
 ** text-scale-mode
 
 ---
-*** text-scale-mode can now adjust font size of the header line.
+*** 'text-scale-mode' can now adjust font size of the header line.
 When the new buffer local variable 'text-scale-remap-header-line'
 is non-nil, 'text-scale-adjust' will also scale the text in the header
 line when displaying that buffer.
@@ -1815,8 +1835,10 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el.
 
 * Lisp Changes in Emacs 28.1
 
+** New function `garbage-collect-maybe` to trigger GC early
+
 ---
-** `defvar` detects the error of defining a variable currently lexically bound.
+** 'defvar' detects the error of defining a variable currently lexically bound.
 Such mixes are always signs that the outer lexical binding was an
 error and should have used dynamic binding instead.
 
@@ -1829,7 +1851,7 @@ a prefix string, and a suffix string.
 +++
 ** 'read-char-from-minibuffer' and 'y-or-n-p' support 'help-form'.
 If you bind 'help-form' to a non-nil value while calling these functions,
-then pressing 'C-h' (help-char) causes the function to evaluate 'help-form'
+then pressing 'C-h' ('help-char') causes the function to evaluate 'help-form'
 and display the result.
 
 +++
@@ -2022,7 +2044,7 @@ file can affect code in another.  For details, see the 
manual section
 "(Elisp) Converting to Lexical Binding".
 
 +++
-** 'byte-recompile-directory' can now compile symlinked .el files.
+** 'byte-recompile-directory' can now compile symlinked ".el" files.
 This is achieved by giving a non-nil FOLLOW-SYMLINKS parameter.
 
 ---
diff --git a/lisp/align.el b/lisp/align.el
index b2cab1c..a11d834 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -412,7 +412,7 @@ The possible settings for `align-region-separate' are:
 
     (c-variable-declaration
      (regexp   . ,(concat "[*&0-9A-Za-z_]>?[&*]*\\(\\s-+[*&]*\\)"
-                         "[A-Za-z_][0-9A-Za-z:_]*\\s-*\\(\\()\\|"
+                         "[A-Za-z_][][0-9A-Za-z:_]*\\s-*\\(\\()\\|"
                          "=[^=\n].*\\|(.*)\\|\\(\\[.*\\]\\)*\\)"
                          "\\s-*[;,]\\|)\\s-*$\\)"))
      (group    . 1)
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 9debdfb..595db1d 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -56,8 +56,6 @@
 
 ;;; Code:
 
-(require 'button)
-
 (defgroup apropos nil
   "Apropos commands for users and programmers."
   :group 'help
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 69a159a..3516af6 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -646,7 +646,7 @@ Does not signal an error if optional argument NOERROR is 
non-nil."
              (< no (length archive-files)))
        (let ((item (aref archive-files no)))
          (if (and (archive--file-desc-p item)
-                  (let ((mode (archive--file-desc-mode item)))
+                  (let ((mode (or (archive--file-desc-mode item) 0)))
                     (zerop (logand 16384 mode))))
              item
            (if (not noerror)
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 046ea2b..d5bb75c 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -650,30 +650,15 @@ will use an up-to-date value of `auto-revert-interval'."
               (string-match auto-revert-notify-exclude-dir-regexp
                            (expand-file-name default-directory))
              (file-symlink-p (or buffer-file-name default-directory)))
-    ;; Check, whether this has been activated already.
     (let ((file (if buffer-file-name
                    (expand-file-name buffer-file-name default-directory)
                  (expand-file-name default-directory))))
-      (maphash
-       (lambda (key _value)
-         (when (and
-                (file-notify-valid-p key)
-                (equal (file-notify--watch-absolute-filename
-                        (gethash key file-notify-descriptors))
-                       (directory-file-name file))
-                (equal (file-notify--watch-callback
-                        (gethash key file-notify-descriptors))
-                       'auto-revert-notify-handler))
-         (setq auto-revert-notify-watch-descriptor key)))
-       auto-revert--buffers-by-watch-descriptor)
-      ;; Create a new watch if needed.
-      (unless auto-revert-notify-watch-descriptor
-        (setq auto-revert-notify-watch-descriptor
-             (ignore-errors
-               (file-notify-add-watch
-                file
-                 (if buffer-file-name '(change attribute-change) '(change))
-                 'auto-revert-notify-handler))))
+      (setq auto-revert-notify-watch-descriptor
+           (ignore-errors
+             (file-notify-add-watch
+              file
+               (if buffer-file-name '(change attribute-change) '(change))
+               'auto-revert-notify-handler))))
       (when auto-revert-notify-watch-descriptor
         (setq auto-revert-notify-modified-p t)
         (puthash
@@ -682,7 +667,7 @@ will use an up-to-date value of `auto-revert-interval'."
               (gethash auto-revert-notify-watch-descriptor
                        auto-revert--buffers-by-watch-descriptor))
          auto-revert--buffers-by-watch-descriptor)
-        (add-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch nil t)))))
+        (add-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch nil t))))
 
 ;; If we have file notifications, we want to update the auto-revert buffers
 ;; immediately when a notification occurs. Since file updates can happen very
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index d703458..b9bdbe8 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1483,7 +1483,32 @@ for a file, defaulting to the file defined by variable
                ((eq 'nospecial bookmark-version-control) version-control)
                (t t))))
          (condition-case nil
-             (write-region (point-min) (point-max) file)
+              ;; There was a stretch of time (about 15 years) when we
+              ;; used `write-region' below instead of `write-file',
+              ;; before going back to `write-file' again.  So if you're
+              ;; considering changing it to `write-region', please see
+              ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=12507.
+              ;; That bug tells the story of how we first started using
+              ;; `write-region' in 2005...
+              ;;
+              ;;   commit a506054af7cd86a63fda996056c09310966f32ef
+              ;;   Author:     Karl Fogel <kfogel@red-bean.com>
+              ;;   AuthorDate: Sat Nov 12 20:30:22 2005 +0000
+              ;;
+              ;;       (bookmark-write-file): Don't visit the
+              ;;       destination file, just write the data to it
+              ;;       using write-region.  This is similar to
+              ;;       2005-05-29T08:36:26Z!rms@gnu.org of saveplace.el,
+              ;;       but with an additional change to avoid visiting
+              ;;       the  file in the first place.
+              ;;
+              ;; ...and of how further inquiry led us to investigate (in
+              ;; 2012 and then again in 2020) and eventually decide that
+              ;; matching the saveplace.el change doesn't make sense for
+              ;; bookmark.el.  Therefore we reverted to `write-file',
+              ;; which means numbered backups may now be created,
+              ;; depending on `bookmark-version-control' as per above.
+             (write-file file)
            (file-error (message "Can't write %s" file)))
          (setq bookmark-file-coding-system coding-system-for-write)
          (kill-buffer (current-buffer))
diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el
index e4f6e98..0631eb4 100644
--- a/lisp/calc/calccomp.el
+++ b/lisp/calc/calccomp.el
@@ -1054,17 +1054,36 @@
                                         (nth 1 a)) 185))
              (calc-language 'flat)
              (low (and (nth 3 a) (math-compose-expr (nth 3 a) 0)))
-             (high (and (nth 4 a) (math-compose-expr (nth 4 a) 0))))
+             (high (and (nth 4 a) (math-compose-expr (nth 4 a) 0)))
+              ;; Check if we have Unicode integral top/bottom parts.
+              (fancy (and (char-displayable-p ?⌠)
+                          (char-displayable-p ?⌡)))
+              ;; If we do, find the most suitable middle part.
+              (fancy-stem (cond ((not fancy))
+                                ;; U+23AE INTEGRAL EXTENSION
+                                ((char-displayable-p ?⎮) "⎮ ")
+                                ;; U+2502 BOX DRAWINGS LIGHT VERTICAL
+                                ((char-displayable-p ?│) "│ ")
+                                ;; U+007C VERTICAL LINE
+                                (t "| "))))
         (list 'horiz
               (if parens "(" "")
-              (append (list 'vcent (if high 3 2))
-                      (and high (list (list 'horiz "  " high)))
-                      '("  /"
-                        " | "
-                        " | "
-                        " | "
-                        "/  ")
-                      (and low (list (list 'horiz low "  "))))
+              (append (list 'vcent (if fancy
+                                        (if high 2 1)
+                                      (if high 3 2)))
+                      (and high (list (if fancy
+                                           (list 'horiz high " ")
+                                         (list 'horiz "  " high))))
+                       (if fancy
+                           (list "⌠ " fancy-stem "⌡ ")
+                        '("  /"
+                          " | "
+                          " | "
+                          " | "
+                          "/  "))
+                      (and low (list (if fancy
+                                          (list 'horiz low " ")
+                                        (list 'horiz low "  ")))))
               expr
               (if over
                   ""
diff --git a/lisp/cedet/data-debug.el b/lisp/cedet/data-debug.el
index 44cce38..8037c31 100644
--- a/lisp/cedet/data-debug.el
+++ b/lisp/cedet/data-debug.el
@@ -42,7 +42,6 @@
 ;;       (data-debug-show-stuff stuff "myStuff"))
 ;;     stuff))
 
-(require 'font-lock)
 (require 'ring)
 
 ;;; Code:
@@ -882,9 +881,8 @@ If PARENT is non-nil, it is somehow related as a parent to 
thing."
   (setq-local comment-start-skip
        "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
   (buffer-disable-undo)
-  (set (make-local-variable 'font-lock-global-modes) nil)
-  (font-lock-mode -1)
-  )
+  (setq-local font-lock-global-modes nil)
+  (font-lock-mode -1))
 
 ;;;###autoload
 (defun data-debug-new-buffer (name)
diff --git a/lisp/cedet/ede/custom.el b/lisp/cedet/ede/custom.el
index 18621ad..63d8b02 100644
--- a/lisp/cedet/ede/custom.el
+++ b/lisp/cedet/ede/custom.el
@@ -50,8 +50,7 @@
   (let* ((ov (oref (ede-current-project) local-variables))
         (cp (ede-current-project)))
     (ede-customize cp)
-    (make-local-variable 'eieio-ede-old-variables)
-    (setq eieio-ede-old-variables ov)))
+    (setq-local eieio-ede-old-variables ov)))
 
 ;;;###autoload
 (defalias 'customize-project 'ede-customize-project)
diff --git a/lisp/cedet/ede/project-am.el b/lisp/cedet/ede/project-am.el
index 61dc8a1..9bd3bab 100644
--- a/lisp/cedet/ede/project-am.el
+++ b/lisp/cedet/ede/project-am.el
@@ -493,8 +493,7 @@ This is used when subprojects are made in named 
subdirectories."
                    :file fn)))
        (oset ampf directory (file-name-directory fn))
        (oset ampf configureoutputfiles cof)
-       (make-local-variable 'ede-object)
-       (setq ede-object ampf)
+        (setq-local ede-object ampf)
        ;; Move the rescan after we set ede-object to prevent recursion
        (project-rescan ampf)
        ampf))))
diff --git a/lisp/cedet/mode-local.el b/lisp/cedet/mode-local.el
index a1aea30..b965496 100644
--- a/lisp/cedet/mode-local.el
+++ b/lisp/cedet/mode-local.el
@@ -314,7 +314,7 @@ Elements are (SYMBOL . PREVIOUS-VALUE), describing one 
variable."
     ;; Do the normal thing.
     (let (modes table old-locals)
       (unless mode
-       (set (make-local-variable 'mode-local--init-mode) major-mode)
+        (setq-local mode-local--init-mode major-mode)
        (setq mode major-mode))
       ;; Get MODE's parents & MODE in the right order.
       (while mode
diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el
index 1be0e33..805582c 100644
--- a/lisp/cedet/semantic.el
+++ b/lisp/cedet/semantic.el
@@ -495,8 +495,7 @@ is requested."
   (setq semantic--buffer-cache tagtable
         semantic-unmatched-syntax-cache-check nil)
   ;; This is specific to the bovine parser.
-  (set (make-local-variable 'semantic-bovinate-nonterminal-check-obarray)
-       nil)
+  (setq-local semantic-bovinate-nonterminal-check-obarray nil)
   (semantic-parse-tree-set-up-to-date)
   (add-hook 'after-change-functions 'semantic-change-function nil t)
   (run-hook-with-args 'semantic-after-toplevel-cache-change-hook
diff --git a/lisp/cedet/semantic/analyze/debug.el 
b/lisp/cedet/semantic/analyze/debug.el
index 6ea54a2..db5b096 100644
--- a/lisp/cedet/semantic/analyze/debug.el
+++ b/lisp/cedet/semantic/analyze/debug.el
@@ -590,7 +590,7 @@ Look for key expressions, and add push-buttons near them."
     (with-current-buffer "*Help*"
       (let ((inhibit-read-only t))
        (goto-char (point-min))
-       (set (make-local-variable 'semantic-analyzer-debug-orig) orig-buffer)
+        (setq-local semantic-analyzer-debug-orig orig-buffer)
        ;; First, add do-in buttons to recommendations.
        (while (re-search-forward "^\\s-*M-x \\(\\(\\w\\|\\s_\\)+\\) " nil t)
          (let ((fcn (match-string 1)))
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index b7670ef..d337946 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -1303,28 +1303,25 @@ the change bounds to encompass the whole nonterminal 
tag."
   "Initialize a buffer for editing Semantic grammars.
 
 \\{semantic-grammar-mode-map}"
-  (set (make-local-variable 'parse-sexp-ignore-comments) t)
-  (set (make-local-variable 'comment-start) ";;")
+  (setq-local parse-sexp-ignore-comments t)
+  (setq-local comment-start ";;")
   ;; Look within the line for a ; following an even number of backslashes
   ;; after either a non-backslash or the line beginning.
-  (set (make-local-variable 'comment-start-skip)
-       "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
-  (set (make-local-variable 'indent-line-function)
-       'semantic-grammar-indent)
-  (set (make-local-variable 'fill-paragraph-function)
-       'lisp-fill-paragraph)
-  (set (make-local-variable 'font-lock-multiline)
-       'undecided)
-  (set (make-local-variable 'font-lock-defaults)
-       '((semantic-grammar-mode-keywords
-          semantic-grammar-mode-keywords-1
-          semantic-grammar-mode-keywords-2
-          semantic-grammar-mode-keywords-3)
-         nil  ;; perform string/comment fontification
-         nil  ;; keywords are case sensitive.
-         ;; This puts _ & - as a word constituent,
-         ;; simplifying our keywords significantly
-         ((?_ . "w") (?- . "w"))))
+  (setq-local comment-start-skip
+              "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
+  (setq-local indent-line-function #'semantic-grammar-indent)
+  (setq-local fill-paragraph-function #'lisp-fill-paragraph)
+  (setq-local font-lock-multiline 'undecided)
+  (setq-local font-lock-defaults
+              '((semantic-grammar-mode-keywords
+                 semantic-grammar-mode-keywords-1
+                 semantic-grammar-mode-keywords-2
+                 semantic-grammar-mode-keywords-3)
+                nil  ;; perform string/comment fontification
+                nil  ;; keywords are case sensitive.
+                ;; This puts _ & - as a word constituent,
+                ;; simplifying our keywords significantly
+                ((?_ . "w") (?- . "w"))))
   ;; Setup Semantic to parse grammar
   (semantic-grammar-wy--install-parser)
   (setq semantic-lex-comment-regex ";;"
@@ -1338,16 +1335,14 @@ the change bounds to encompass the whole nonterminal 
tag."
           (nonterminal  . "Nonterminal")
           (rule         . "Rule")
           ))
-  (set (make-local-variable 'semantic-format-face-alist)
-       '(
-         (code         . default)
-         (keyword      . font-lock-keyword-face)
-         (token        . font-lock-type-face)
-         (nonterminal  . font-lock-function-name-face)
-         (rule         . default)
-         ))
-  (set (make-local-variable 'semantic-stickyfunc-sticky-classes)
-       '(nonterminal))
+  (setq-local semantic-format-face-alist
+              '((code         . default)
+                (keyword      . font-lock-keyword-face)
+                (token        . font-lock-type-face)
+                (nonterminal  . font-lock-function-name-face)
+                (rule         . default)))
+  (setq-local semantic-stickyfunc-sticky-classes
+              '(nonterminal))
   ;; Before each change, clear the cached regexp used to highlight
   ;; macros local in this grammar.
   (add-hook 'before-change-functions
diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el
index e594232..49c1933 100644
--- a/lisp/cedet/semantic/senator.el
+++ b/lisp/cedet/semantic/senator.el
@@ -472,9 +472,9 @@ filters in `senator-search-tag-filter-functions' remain 
active."
   (if classes
       (let ((tag   (make-symbol "tag"))
             (names (mapconcat 'symbol-name classes "', `")))
-        (set (make-local-variable 'senator--search-filter)
-             `(lambda (,tag)
-                (memq (semantic-tag-class ,tag) ',classes)))
+        (setq-local senator--search-filter
+                    `(lambda (,tag)
+                       (memq (semantic-tag-class ,tag) ',classes)))
         (add-hook 'senator-search-tag-filter-functions
                   senator--search-filter nil t)
         (message "Limit search to `%s' tags" names))
@@ -857,17 +857,17 @@ Use a senator search function when semantic isearch mode 
is enabled."
        ;; senator one.
        (when (and (local-variable-p 'isearch-search-fun-function)
                   (not (local-variable-p 'senator-old-isearch-search-fun)))
-         (set (make-local-variable 'senator-old-isearch-search-fun)
-              isearch-search-fun-function))
-       (set (make-local-variable 'isearch-search-fun-function)
-            'senator-isearch-search-fun))
+          (setq-local senator-old-isearch-search-fun
+                      isearch-search-fun-function))
+        (setq-local isearch-search-fun-function
+                    'senator-isearch-search-fun))
     ;; When `senator-isearch-semantic-mode' is off restore the
     ;; previous `isearch-search-fun-function'.
     (when (eq isearch-search-fun-function 'senator-isearch-search-fun)
       (if (local-variable-p 'senator-old-isearch-search-fun)
          (progn
-           (set (make-local-variable 'isearch-search-fun-function)
-                senator-old-isearch-search-fun)
+            (setq-local isearch-search-fun-function
+                        senator-old-isearch-search-fun)
            (kill-local-variable 'senator-old-isearch-search-fun))
        (kill-local-variable 'isearch-search-fun-function)))))
 
diff --git a/lisp/cedet/semantic/symref/list.el 
b/lisp/cedet/semantic/symref/list.el
index fc7f9db..d64d4dd 100644
--- a/lisp/cedet/semantic/symref/list.el
+++ b/lisp/cedet/semantic/symref/list.el
@@ -176,7 +176,7 @@ Display the references in `semantic-symref-results-mode'."
     (switch-to-buffer-other-window buff)
     (set-buffer buff)
     (semantic-symref-results-mode)
-    (set (make-local-variable 'semantic-symref-current-results) res)
+    (setq-local semantic-symref-current-results res)
     (semantic-symref-results-dump res)
     (goto-char (point-min))))
 
@@ -184,7 +184,7 @@ Display the references in `semantic-symref-results-mode'."
   "Major-mode for displaying Semantic Symbol Reference results."
   (buffer-disable-undo)
   ;; FIXME: Why bother turning off font-lock?
-  (set (make-local-variable 'font-lock-global-modes) nil)
+  (setq-local font-lock-global-modes nil)
   (font-lock-mode -1))
 
 (defcustom semantic-symref-results-summary-function 
'semantic-format-tag-prototype
diff --git a/lisp/cedet/semantic/util-modes.el 
b/lisp/cedet/semantic/util-modes.el
index 24df009..776c6b1 100644
--- a/lisp/cedet/semantic/util-modes.el
+++ b/lisp/cedet/semantic/util-modes.el
@@ -701,8 +701,8 @@ non-nil if the minor mode is enabled."
        (when (and (local-variable-p 'header-line-format (current-buffer))
                   (not (eq header-line-format
                            semantic-stickyfunc-header-line-format)))
-         (set (make-local-variable 'semantic-stickyfunc-old-hlf)
-              header-line-format))
+          (setq-local semantic-stickyfunc-old-hlf
+                      header-line-format))
        (setq header-line-format semantic-stickyfunc-header-line-format))
     ;; Disable sticky func mode
     ;; Restore previous buffer local value of header line format if
diff --git a/lisp/cedet/semantic/wisent/python.el 
b/lisp/cedet/semantic/wisent/python.el
index 4e35192..66d21f7 100644
--- a/lisp/cedet/semantic/wisent/python.el
+++ b/lisp/cedet/semantic/wisent/python.el
@@ -503,10 +503,10 @@ Shortens `code' tags, but passes through for others."
 (defun wisent-python-default-setup ()
   "Setup buffer for parse."
   (wisent-python-wy--install-parser)
-  (set (make-local-variable 'parse-sexp-ignore-comments) t)
+  (setq-local parse-sexp-ignore-comments t)
   ;; Give python modes the possibility to overwrite this:
   (if (not comment-start-skip)
-      (set (make-local-variable 'comment-start-skip) "#+\\s-*"))
+      (setq-local comment-start-skip "#+\\s-*"))
   (setq
   ;; Character used to separation a parent/child relationship
    semantic-type-relation-separator-character '(".")
diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el
index 4c1e030..d82da40 100644
--- a/lisp/cedet/srecode/srt-mode.el
+++ b/lisp/cedet/srecode/srt-mode.el
@@ -191,18 +191,18 @@ we can tell font lock about them.")
 (define-derived-mode srecode-template-mode fundamental-mode "SRecode"
   ;; FIXME: Shouldn't it derive from prog-mode?
   "Major-mode for writing SRecode macros."
-  (set (make-local-variable 'comment-start) ";;")
-  (set (make-local-variable 'comment-end) "")
-  (set (make-local-variable 'parse-sexp-ignore-comments) t)
-  (set (make-local-variable 'comment-start-skip)
-       "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
-  (set (make-local-variable 'font-lock-defaults)
-       '(srecode-font-lock-keywords
-         nil  ;; perform string/comment fontification
-         nil  ;; keywords are case sensitive.
-         ;; This puts _ & - as a word constituent,
-         ;; simplifying our keywords significantly
-         ((?_ . "w") (?- . "w")))))
+  (setq-local comment-start ";;")
+  (setq-local comment-end "")
+  (setq-local parse-sexp-ignore-comments t)
+  (setq-local comment-start-skip
+              "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
+  (setq-local font-lock-defaults
+              '(srecode-font-lock-keywords
+                nil  ;; perform string/comment fontification
+                nil  ;; keywords are case sensitive.
+                ;; This puts _ & - as a word constituent,
+                ;; simplifying our keywords significantly
+                ((?_ . "w") (?- . "w")))))
 
 ;;;###autoload
 (defalias 'srt-mode 'srecode-template-mode)
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index a00cb17..3a36cb0 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -4717,8 +4717,9 @@ if only the first line of the docstring is shown."))
       (let ((inhibit-read-only t)
            (print-length nil)
            (print-level nil))
-       (custom-save-variables)
-       (custom-save-faces))
+        (atomic-change-group
+         (custom-save-variables)
+         (custom-save-faces)))
       (let ((file-precious-flag t))
        (save-buffer))
       (if old-buffer
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 94a2bbf..2615519 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -3140,7 +3140,13 @@ REGEXP should use constructs supported by your local 
`grep' command."
           (query-replace-read-args
            "Query replace regexp in marked files" t t)))
      (list (nth 0 common) (nth 1 common))))
-  (with-current-buffer (dired-do-find-regexp from)
+  (require 'xref)
+  (defvar xref-show-xrefs-function)
+  (with-current-buffer
+      (let ((xref-show-xrefs-function
+             ;; Some future-proofing (bug#44905).
+             (eval (car (get 'xref-show-xrefs-function 'standard-value)))))
+        (dired-do-find-regexp from))
     (xref-query-replace-in-results from to)))
 
 (defun dired-nondirectory-p (file)
diff --git a/lisp/dired.el b/lisp/dired.el
index 08b19a0..30b9f5b 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1509,8 +1509,7 @@ see `dired-use-ls-dired' for more details.")
                     (script (format "ls %s %s" switches (cdr dir-wildcard)))
                     (remotep (file-remote-p dir))
                     (sh (or (and remotep "/bin/sh")
-                            (and (bound-and-true-p explicit-shell-file-name)
-                                 (executable-find explicit-shell-file-name))
+                            (executable-find shell-file-name)
                             (executable-find "sh")))
                     (switch (if remotep "-c" shell-command-switch)))
                ;; Enable globstar
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index e16ce9f..4c9d709 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -1840,8 +1840,7 @@ function at point for which PREDICATE returns non-nil)."
        (or default
            ;; Prefer func name at point, if it's an advised function etc.
            (let ((function (progn
-                             (require 'help)
-                             (function-called-at-point))))
+                              (function-called-at-point))))
              (and function
                   (member (symbol-name function) ad-advised-functions)
                   (or (null predicate)
@@ -2229,8 +2228,6 @@ For that it has to be fbound with a non-autoload 
definition."
   (let ((byte-compile-warnings byte-compile-warnings)
         ;; Don't pop up windows showing byte-compiler warnings.
         (warning-suppress-types '((bytecomp))))
-    (if (featurep 'cl)
-        (byte-compile-disable-warning 'cl-functions))
     (byte-compile (ad-get-advice-info-field function 'advicefunname))))
 
 ;; @@@ Accessing argument lists:
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 28c53bf..02605f3 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -296,7 +296,7 @@ The information is logged to `byte-compile-log-buffer'."
 
 (defconst byte-compile-warning-types
   '(redefine callargs free-vars unresolved
-            obsolete noruntime cl-functions interactive-only
+             obsolete noruntime interactive-only
             make-local mapcar constants suspicious lexical lexical-dynamic)
   "The list of warning types used when `byte-compile-warnings' is t.")
 (defcustom byte-compile-warnings t
@@ -312,8 +312,6 @@ Elements of the list may be:
   obsolete    obsolete variables and functions.
   noruntime   functions that may not be defined at runtime (typically
               defined only under `eval-when-compile').
-  cl-functions    calls to runtime functions (as distinguished from macros and
-                  aliases) from the old CL package (not the newer cl-lib).
   interactive-only
              commands that normally shouldn't be called from Lisp code.
   lexical     global/dynamic variables lacking a prefix.
@@ -1017,11 +1015,6 @@ CONST2 may be evaluated multiple times."
 
 ;;; compile-time evaluation
 
-(defun byte-compile-cl-file-p (file)
-  "Return non-nil if FILE is one of the CL files."
-  (and (stringp file)
-       (string-match "^cl\\.el" (file-name-nondirectory file))))
-
 (defun byte-compile-eval (form)
   "Eval FORM and mark the functions defined therein.
 Each function's symbol gets added to `byte-compile-noruntime-functions'."
@@ -1052,18 +1045,7 @@ Each function's symbol gets added to 
`byte-compile-noruntime-functions'."
                (when (and (symbolp s) (not (memq s old-autoloads)))
                  (push s byte-compile-noruntime-functions))
                (when (and (consp s) (eq t (car s)))
-                 (push (cdr s) old-autoloads)))))))
-      (when (byte-compile-warning-enabled-p 'cl-functions)
-       (let ((hist-new load-history))
-         ;; Go through load-history, looking for the cl files.
-         ;; Since new files are added at the start of load-history,
-         ;; we scan the new history until the tail matches the old.
-         (while (and (not byte-compile-cl-functions)
-                     hist-new (not (eq hist-new hist-orig)))
-           ;; We used to check if the file had already been loaded,
-           ;; but it is better to check non-nil byte-compile-cl-functions.
-           (and (byte-compile-cl-file-p (car (pop hist-new)))
-                (byte-compile-find-cl-functions))))))))
+                  (push (cdr s) old-autoloads))))))))))
 
 (defun byte-compile-eval-before-compile (form)
   "Evaluate FORM for `eval-and-compile'."
@@ -1074,9 +1056,7 @@ Each function's symbol gets added to 
`byte-compile-noruntime-functions'."
       ;; There are other ways to do this nowadays.
       (let ((tem current-load-list))
        (while (not (eq tem hist-nil-orig))
-         (when (equal (car tem) '(require . cl))
-            (byte-compile-disable-warning 'cl-functions))
-         (setq tem (cdr tem)))))))
+          (setq tem (cdr tem)))))))
 
 ;;; byte compiler messages
 
@@ -1626,45 +1606,6 @@ extra args."
            (if (equal sig1 '(1 . 1)) "argument" "arguments")
            (byte-compile-arglist-signature-string sig2)))))))
 
-(defvar byte-compile-cl-functions nil
-  "List of functions defined in CL.")
-
-;; Can't just add this to cl-load-hook, because that runs just before
-;; the forms from cl.el get added to load-history.
-(defun byte-compile-find-cl-functions ()
-  (unless byte-compile-cl-functions
-    (dolist (elt load-history)
-      (and (byte-compile-cl-file-p (car elt))
-          (dolist (e (cdr elt))
-            ;; Includes the cl-foo functions that cl autoloads.
-            (when (memq (car-safe e) '(autoload defun))
-              (push (cdr e) byte-compile-cl-functions)))))))
-
-(defun byte-compile-cl-warn (form)
-  "Warn if FORM is a call of a function from the CL package."
-  (let ((func (car-safe form)))
-    (if (and byte-compile-cl-functions
-            (memq func byte-compile-cl-functions)
-            ;; Aliases which won't have been expanded at this point.
-            ;; These aren't all aliases of subrs, so not trivial to
-            ;; avoid hardwiring the list.
-            (not (memq func
-                       '(cl--block-wrapper cl--block-throw
-                         multiple-value-call nth-value
-                         copy-seq first second rest endp cl-member
-                         ;; These are included in generated code
-                         ;; that can't be called except at compile time
-                         ;; or unless cl is loaded anyway.
-                         cl--defsubst-expand cl-struct-setf-expander
-                         ;; These would sometimes be warned about
-                         ;; but such warnings are never useful,
-                         ;; so don't warn about them.
-                         macroexpand
-                         cl--compiling-file))))
-       (byte-compile-warn "function `%s' from cl package called at runtime"
-                          func)))
-  form)
-
 (defun byte-compile-print-syms (str1 strn syms)
   (when syms
     (byte-compile-set-symbol-position (car syms) t))
@@ -1766,7 +1707,6 @@ extra args."
           (and (markerp warning-series)
                (eq (marker-buffer warning-series)
                    (get-buffer byte-compile-log-buffer)))))
-     (byte-compile-find-cl-functions)
      (if (or (eq warning-series 'byte-compile-warning-series)
             warning-series-started)
         ;; warning-series does come from compilation,
@@ -2582,8 +2522,7 @@ list that represents a doc string reference.
 (put 'require 'byte-hunk-handler 'byte-compile-file-form-require)
 (defun byte-compile-file-form-require (form)
   (let ((args (mapcar 'eval (cdr form)))
-       (hist-orig load-history)
-       hist-new prov-cons)
+        hist-new prov-cons)
     (apply 'require args)
 
     ;; Record the functions defined by the require in 
`byte-compile-new-defuns'.
@@ -2596,21 +2535,7 @@ list that represents a doc string reference.
       (dolist (x (car hist-new))
         (when (and (consp x)
                    (memq (car x) '(defun t)))
-          (push (cdr x) byte-compile-new-defuns))))
-
-    (when (byte-compile-warning-enabled-p 'cl-functions)
-      ;; Detect (require 'cl) in a way that works even if cl is already loaded.
-      (if (member (car args) '("cl" cl))
-         (progn
-           (byte-compile-warn "cl package required at runtime")
-           (byte-compile-disable-warning 'cl-functions))
-       ;; We may have required something that causes cl to be loaded, eg
-       ;; the uncompiled version of a file that requires cl when compiling.
-       (setq hist-new load-history)
-       (while (and (not byte-compile-cl-functions)
-                   hist-new (not (eq hist-new hist-orig)))
-         (and (byte-compile-cl-file-p (car (pop hist-new)))
-              (byte-compile-find-cl-functions))))))
+          (push (cdr x) byte-compile-new-defuns)))))
   (byte-compile-keep-pending form 'byte-compile-normal-call))
 
 (put 'progn 'byte-hunk-handler 'byte-compile-file-form-progn)
@@ -3291,7 +3216,7 @@ for symbols generated by the byte compiler itself."
                              run-hook-with-args-until-failure))
           (pcase (cdr form)
             (`(',var . ,_)
-             (when (assq var byte-compile-lexical-variables)
+             (when (memq var byte-compile-lexical-variables)
                (byte-compile-report-error
                 (format-message "%s cannot use lexical var `%s'" fn var))))))
         ;; Warn about using obsolete hooks.
@@ -3327,9 +3252,7 @@ for symbols generated by the byte compiler itself."
                       ;; differently now).
                       (not (eq handler 'cl-byte-compile-compiler-macro))))
             (funcall handler form)
-          (byte-compile-normal-call form))
-        (if (byte-compile-warning-enabled-p 'cl-functions)
-            (byte-compile-cl-warn form))))
+          (byte-compile-normal-call form))))
      ((and (byte-code-function-p (car form))
            (memq byte-optimize '(t lap)))
       (byte-compile-unfold-bcf form))
@@ -3520,6 +3443,27 @@ for symbols generated by the byte compiler itself."
   (push var byte-compile-bound-variables)
   (byte-compile-dynamic-variable-op 'byte-varbind var))
 
+(defun byte-compile-free-vars-warn (var &optional assignment)
+  "Warn if symbol VAR refers to a free variable.
+VAR must not be lexically bound.
+If optional argument ASSIGNMENT is non-nil, this is treated as an
+assignment (i.e. `setq'). "
+  (unless (or (not (byte-compile-warning-enabled-p 'free-vars var))
+              (boundp var)
+              (memq var byte-compile-bound-variables)
+              (memq var (if assignment
+                            byte-compile-free-assignments
+                          byte-compile-free-references)))
+    (let* ((varname (prin1-to-string var))
+           (desc (if assignment "assignment" "reference"))
+           (suggestions (help-uni-confusable-suggestions varname)))
+      (byte-compile-warn "%s to free variable `%s'%s"
+                         desc varname
+                         (if suggestions (concat "\n  " suggestions) "")))
+    (push var (if assignment
+                  byte-compile-free-assignments
+                byte-compile-free-references))))
+
 (defun byte-compile-variable-ref (var)
   "Generate code to push the value of the variable VAR on the stack."
   (byte-compile-check-variable var 'reference)
@@ -3528,15 +3472,7 @@ for symbols generated by the byte compiler itself."
        ;; VAR is lexically bound
         (byte-compile-stack-ref (cdr lex-binding))
       ;; VAR is dynamically bound
-      (unless (or (not (byte-compile-warning-enabled-p 'free-vars var))
-                 (boundp var)
-                 (memq var byte-compile-bound-variables)
-                 (memq var byte-compile-free-references))
-        (let* ((varname (prin1-to-string var))
-               (suggestions (help-uni-confusable-suggestions varname)))
-          (byte-compile-warn "reference to free variable `%s'%s" varname
-                             (if suggestions (concat "\n  " suggestions) "")))
-       (push var byte-compile-free-references))
+      (byte-compile-free-vars-warn var)
       (byte-compile-dynamic-variable-op 'byte-varref var))))
 
 (defun byte-compile-variable-set (var)
@@ -3547,15 +3483,7 @@ for symbols generated by the byte compiler itself."
        ;; VAR is lexically bound.
         (byte-compile-stack-set (cdr lex-binding))
       ;; VAR is dynamically bound.
-      (unless (or (not (byte-compile-warning-enabled-p 'free-vars var))
-                 (boundp var)
-                 (memq var byte-compile-bound-variables)
-                 (memq var byte-compile-free-assignments))
-        (let* ((varname (prin1-to-string var))
-               (suggestions (help-uni-confusable-suggestions varname)))
-          (byte-compile-warn "assignment to free variable `%s'%s" varname
-                             (if suggestions (concat "\n  " suggestions) "")))
-       (push var byte-compile-free-assignments))
+      (byte-compile-free-vars-warn var t)
       (byte-compile-dynamic-variable-op 'byte-varset var))))
 
 (defmacro byte-compile-get-constant (const)
diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el
index 1777100..c1c6e3b 100644
--- a/lisp/emacs-lisp/chart.el
+++ b/lisp/emacs-lisp/chart.el
@@ -120,7 +120,7 @@ too much in text characters anyways.")
 (define-derived-mode chart-mode special-mode "Chart"
   "Define a mode in Emacs for displaying a chart."
   (buffer-disable-undo)
-  (set (make-local-variable 'font-lock-global-modes) nil)
+  (setq-local font-lock-global-modes nil)
   (font-lock-mode -1)                   ;Isn't it off already?  --Stef
   )
 
diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el
index 1043cf7..0375c57 100644
--- a/lisp/emacs-lisp/cl-print.el
+++ b/lisp/emacs-lisp/cl-print.el
@@ -33,8 +33,6 @@
 
 ;;; Code:
 
-(require 'button)
-
 (defvar cl-print-readably nil
   "If non-nil, try and make sure the result can be `read'.")
 
diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el
index 9828ca6..edeeb03 100644
--- a/lisp/emacs-lisp/copyright.el
+++ b/lisp/emacs-lisp/copyright.el
@@ -256,7 +256,7 @@ interactively."
                                  (match-string-no-properties 1)
                                  copyright-current-gpl-version)))))
                 (replace-match copyright-current-gpl-version t t nil 1))))
-       (set (make-local-variable 'copyright-update) nil)))
+        (setq-local copyright-update nil)))
     ;; If a write-file-hook returns non-nil, the file is presumed to be 
written.
     nil))
 
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 0e4135b..11ef836 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -29,7 +29,6 @@
 
 (require 'cl-lib)
 (require 'backtrace)
-(require 'button)
 
 (defgroup debugger nil
   "Debuggers and related commands for Emacs."
diff --git a/lisp/emacs-lisp/eieio-custom.el b/lisp/emacs-lisp/eieio-custom.el
index e26dc9e..c1378cb 100644
--- a/lisp/emacs-lisp/eieio-custom.el
+++ b/lisp/emacs-lisp/eieio-custom.el
@@ -33,7 +33,6 @@
 (require 'eieio)
 (require 'widget)
 (require 'wid-edit)
-(require 'custom)
 
 ;;; Compatibility
 
@@ -366,8 +365,7 @@ These groups are specified with the `:group' slot flag."
     (widget-insert "\n\n")
     (widget-insert "Edit object " (eieio-object-name obj) "\n\n")
     ;; Create the widget editing the object.
-    (make-local-variable 'eieio-wo)
-    (setq eieio-wo (eieio-custom-widget-insert obj :eieio-group g))
+    (setq-local eieio-wo (eieio-custom-widget-insert obj :eieio-group g))
     ;;Now generate the apply buttons
     (widget-insert "\n")
     (eieio-custom-object-apply-reset obj)
@@ -376,10 +374,8 @@ These groups are specified with the `:group' slot flag."
     ;;(widget-minor-mode)
     (goto-char (point-min))
     (widget-forward 3)
-    (make-local-variable 'eieio-co)
-    (setq eieio-co obj)
-    (make-local-variable 'eieio-cog)
-    (setq eieio-cog g)))
+    (setq-local eieio-co obj)
+    (setq-local eieio-cog g)))
 
 (cl-defmethod eieio-custom-object-apply-reset ((_obj eieio-default-superclass))
   "Insert an Apply and Reset button into the object editor.
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el
index e2cffed..ef97c82 100644
--- a/lisp/emacs-lisp/elint.el
+++ b/lisp/emacs-lisp/elint.el
@@ -355,15 +355,14 @@ Returns the forms."
       ;; Env is up to date
       elint-buffer-forms
     ;; Remake env
-    (set (make-local-variable 'elint-buffer-forms) (elint-get-top-forms))
-    (set (make-local-variable 'elint-features) nil)
-    (set (make-local-variable 'elint-buffer-env)
-        (elint-init-env elint-buffer-forms))
+    (setq-local elint-buffer-forms (elint-get-top-forms))
+    (setq-local elint-features nil)
+    (setq-local elint-buffer-env (elint-init-env elint-buffer-forms))
     (if elint-preloaded-env
         ;; FIXME: This doesn't do anything!  Should we setq the result to
         ;; elint-buffer-env?
        (elint-env-add-env elint-preloaded-env elint-buffer-env))
-    (set (make-local-variable 'elint-last-env-time) (buffer-modified-tick))
+    (setq-local elint-last-env-time (buffer-modified-tick))
     elint-buffer-forms))
 
 (defun elint-get-top-forms ()
@@ -456,8 +455,8 @@ Return nil if there are no more forms, t otherwise."
         (= 4 (length form))
         (eq (car-safe (cadr form)) 'quote)
         (equal (nth 2 form) '(quote error-conditions)))
-    (set (make-local-variable 'elint-extra-errors)
-        (cons (cadr (cadr form)) elint-extra-errors)))
+    (setq-local elint-extra-errors
+                (cons (cadr (cadr form)) elint-extra-errors)))
    ((eq (car form) 'provide)
     (add-to-list 'elint-features (eval (cadr form))))
    ;; Import variable definitions
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index baa04f2..5f29c26 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -58,13 +58,11 @@
 ;;; Code:
 
 (require 'cl-lib)
-(require 'button)
 (require 'debug)
 (require 'backtrace)
 (require 'easymenu)
 (require 'ewoc)
 (require 'find-func)
-(require 'help)
 (require 'pp)
 
 ;;; UI customization options.
@@ -1804,8 +1802,8 @@ Also sets `ert--results-progress-bar-button-begin'."
            ;; `progress-bar-button-begin' will be the right position
            ;; even in the results buffer.
            (with-current-buffer results-buffer
-             (set (make-local-variable 'ert--results-progress-bar-button-begin)
-                  progress-bar-button-begin))))
+             (setq-local ert--results-progress-bar-button-begin
+                         progress-bar-button-begin))))
        (insert "\n\n")
        (buffer-string))
      ;; footer
@@ -1981,15 +1979,15 @@ BUFFER-NAME, if non-nil, is the buffer name to use."
         ;; from ert-results-mode to ert-results-mode when
         ;; font-lock-mode turns itself off in change-major-mode-hook.)
         (erase-buffer)
-        (set (make-local-variable 'font-lock-function)
-             'ert--results-font-lock-function)
+        (setq-local font-lock-function
+                    'ert--results-font-lock-function)
         (let ((ewoc (ewoc-create 'ert--print-test-for-ewoc nil nil t)))
-          (set (make-local-variable 'ert--results-ewoc) ewoc)
-          (set (make-local-variable 'ert--results-stats) stats)
-          (set (make-local-variable 'ert--results-progress-bar-string)
-               (make-string (ert-stats-total stats)
-                            (ert-char-for-test-result nil t)))
-          (set (make-local-variable 'ert--results-listener) listener)
+          (setq-local ert--results-ewoc ewoc)
+          (setq-local ert--results-stats stats)
+          (setq-local ert--results-progress-bar-string
+                      (make-string (ert-stats-total stats)
+                                   (ert-char-for-test-result nil t)))
+          (setq-local ert--results-listener listener)
           (cl-loop for test across (ert--stats-tests stats) do
                    (ewoc-enter-last ewoc
                                     (make-ert--ewoc-entry :test test
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index cc40af7..081ef8d 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -634,7 +634,7 @@ font-lock keywords will not be case sensitive."
   ;; and should make no difference for explicit fill
   ;; because lisp-fill-paragraph should do the job.
   ;;  I believe that newcomment's auto-fill code properly deals with it  -stef
-  ;;(set (make-local-variable 'adaptive-fill-mode) nil)
+  ;;(setq-local adaptive-fill-mode nil)
   (setq-local indent-line-function 'lisp-indent-line)
   (setq-local indent-region-function 'lisp-indent-region)
   (setq-local comment-indent-function #'lisp-comment-indent)
diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el
index 458f803..de7d202 100644
--- a/lisp/emacs-lisp/pp.el
+++ b/lisp/emacs-lisp/pp.el
@@ -118,7 +118,7 @@ after OUT-BUFFER-NAME."
       (with-current-buffer standard-output
        (emacs-lisp-mode)
        (setq buffer-read-only nil)
-       (set (make-local-variable 'font-lock-verbose) nil)))))
+        (setq-local font-lock-verbose nil)))))
 
 ;;;###autoload
 (defun pp-eval-expression (expression)
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index 78ae3a8..ffbf3b4 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -271,7 +271,7 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
 
 (define-derived-mode reb-mode nil "RE Builder"
   "Major mode for interactively building Regular Expressions."
-  (set (make-local-variable 'blink-matching-paren) nil)
+  (setq-local blink-matching-paren nil)
   (reb-mode-common))
 
 (defvar reb-lisp-mode-map
@@ -832,8 +832,8 @@ If SUBEXP is non-nil mark only the corresponding 
sub-expressions."
     (let ((font-lock-is-on font-lock-mode))
       (font-lock-mode -1)
       (kill-local-variable 'font-lock-set-defaults)
-      ;;(set (make-local-variable 'reb-re-syntax) 'string)
-      ;;(set (make-local-variable 'reb-re-syntax) 'rx)
+      ;;(setq-local reb-re-syntax 'string)
+      ;;(setq-local reb-re-syntax 'rx)
       (setq font-lock-defaults
             (cond
              ((memq reb-re-syntax '(read string))
diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el
index dd614dd..68f58f6 100644
--- a/lisp/emacs-lisp/shadow.el
+++ b/lisp/emacs-lisp/shadow.el
@@ -177,13 +177,12 @@ See the documentation for `list-load-path-shadows' for 
further information."
 
 (define-derived-mode load-path-shadows-mode fundamental-mode "LP-Shadows"
   "Major mode for load-path shadows buffer."
-  (set (make-local-variable 'font-lock-defaults)
-       '((load-path-shadows-font-lock-keywords)))
+  (setq-local font-lock-defaults
+              '((load-path-shadows-font-lock-keywords)))
   (setq buffer-undo-list t
        buffer-read-only t))
 
 ;; TODO use text-properties instead, a la dired.
-(require 'button)
 (define-button-type 'load-path-shadows-find-file
   'follow-link t
 ;;  'face 'default
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index 1b700af..355dd0f 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -1891,9 +1891,9 @@ KEYWORDS are additional arguments, which can use the 
following keywords:
           (v (pop keywords)))
       (pcase k
         (:forward-token
-         (set (make-local-variable 'smie-forward-token-function) v))
+         (setq-local smie-forward-token-function v))
         (:backward-token
-         (set (make-local-variable 'smie-backward-token-function) v))
+         (setq-local smie-backward-token-function v))
         (_ (message "smie-setup: ignoring unknown keyword %s" k)))))
   (let ((ca (cdr (assq :smie-closer-alist grammar))))
     (when ca
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el
index 62f1b16..e35f9d8 100644
--- a/lisp/emacs-lisp/syntax.el
+++ b/lisp/emacs-lisp/syntax.el
@@ -353,7 +353,7 @@ set by `syntax-propertize'")
         (setq syntax-propertize--done (max (point-max) pos))
       ;; (message "Needs to syntax-propertize from %s to %s"
       ;;          syntax-propertize--done pos)
-      (set (make-local-variable 'parse-sexp-lookup-properties) t)
+      (setq-local parse-sexp-lookup-properties t)
       (when (< syntax-propertize--done (point-min))
         ;; *Usually* syntax-propertize is called via syntax-ppss which
         ;; takes care of adding syntax-ppss-flush-cache to b-c-f, but this
diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el
index 6273056..28e964e 100644
--- a/lisp/emacs-lisp/trace.el
+++ b/lisp/emacs-lisp/trace.el
@@ -225,7 +225,7 @@ be printed along with the arguments in the trace."
           (ctx (funcall context)))
       (unless inhibit-trace
         (with-current-buffer trace-buffer
-          (set (make-local-variable 'window-point-insertion-type) t)
+          (setq-local window-point-insertion-type t)
           (unless background (trace--display-buffer trace-buffer))
           (goto-char (point-max))
           ;; Insert a separator from previous trace output:
diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el
index b29ad77..f61de92 100644
--- a/lisp/emulation/edt.el
+++ b/lisp/emulation/edt.el
@@ -788,7 +788,7 @@ Argument NUM is the number of lines to delete."
 In select mode, selected text is highlighted."
   (if arg
       (progn
-       (set (make-local-variable 'edt-select-mode) 'edt-select-mode-current)
+        (setq-local edt-select-mode 'edt-select-mode-current)
        (setq rect-start-point (window-point)))
     (progn
       (kill-local-variable 'edt-select-mode)))
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index dd7648c..938ebb1 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -474,7 +474,7 @@
 
 ;; Modifies mode-line-buffer-identification.
 (defun viper-refresh-mode-line ()
-  (set (make-local-variable 'viper-mode-string)
+  (setq-local viper-mode-string
        (cond ((eq viper-current-state 'emacs-state) viper-emacs-state-id)
              ((eq viper-current-state 'vi-state) viper-vi-state-id)
              ((eq viper-current-state 'replace-state) viper-replace-state-id)
@@ -1865,14 +1865,10 @@ Undo previous insertion and inserts new."
     ;; minibuffer and vice versa. Otherwise, command arguments will affect
     ;; minibuffer ops and insertions from the minibuffer will change those in
     ;; the normal buffers
-    (make-local-variable 'viper-d-com)
-    (make-local-variable 'viper-last-insertion)
-    (make-local-variable 'viper-command-ring)
-    (setq viper-d-com nil
-         viper-last-insertion nil
-         viper-command-ring nil)
-    (funcall hook)
-    ))
+    (setq-local viper-d-com nil)
+    (setq-local viper-last-insertion nil)
+    (setq-local viper-command-ring nil)
+    (funcall hook)))
 
 ;; This is a temp hook that uses free variables viper--init-message and 
viper-initial.
 ;; A dirty feature, but it is the simplest way to have it do the right thing.
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index 9da493d..208a2ee 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -596,7 +596,7 @@ Otherwise return the normal value."
 (defun viper-save-setting (var message file &optional erase-msg)
   (let* ((var-name (symbol-name var))
         (var-val (if (boundp var) (eval var)))
-        (regexp (format "^[^;]*%s[ \t\n]*[a-zA-Z---_']*[ \t\n)]" var-name))
+        (regexp (format "^[^;]*%s[ \t\n]*[a-zA-Z0-9---_']*[ \t\n)]" var-name))
         (buf (find-file-noselect (substitute-in-file-name file)))
        )
     (message "%s" (or message ""))
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index 59ca629..8510928 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -617,7 +617,7 @@ This startup message appears whenever you load Viper, 
unless you type `y' now."
 
 ;; This hook designed to enable Vi-style editing in comint-based modes."
 (defun viper-comint-mode-hook ()
-  (set (make-local-variable 'require-final-newline) nil)
+  (setq-local require-final-newline nil)
   (setq viper-ex-style-editing nil
        viper-ex-style-motion nil)
   (viper-change-state-to-insert))
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index a475f0a..350eb89 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -35,8 +35,7 @@
 
 (defun erc-imenu-setup ()
   "Setup Imenu support in an ERC buffer."
-  (set (make-local-variable 'imenu-create-index-function)
-       'erc-create-imenu-index))
+  (setq-local imenu-create-index-function #'erc-create-imenu-index))
 
 (add-hook 'erc-mode-hook 'erc-imenu-setup)
 (autoload 'erc-create-imenu-index "erc-imenu" "Imenu index creation function")
diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el
index 036d773..ae7c2e5 100644
--- a/lisp/erc/erc-list.el
+++ b/lisp/erc/erc-list.el
@@ -188,15 +188,15 @@
      (lambda (_proc _parsed)
        (remove-hook 'erc-server-322-functions 'erc-list-handle-322 t)))
     ;; Find the list buffer, empty it, and display it.
-    (set (make-local-variable 'erc-list-buffer)
-        (get-buffer-create (concat "*Channels of "
-                                   erc-server-announced-name
-                                   "*")))
+    (setq-local erc-list-buffer
+                (get-buffer-create (concat "*Channels of "
+                                           erc-server-announced-name
+                                           "*")))
     (with-current-buffer erc-list-buffer
       (erc-list-menu-mode)
       (setq buffer-read-only nil)
       (erase-buffer)
-      (set (make-local-variable 'erc-list-server-buffer) server-buffer)
+      (setq-local erc-list-server-buffer server-buffer)
       (setq buffer-read-only t))
     (pop-to-buffer erc-list-buffer))
   t)
@@ -211,7 +211,7 @@ should usually be one or more channels, separated by commas.
 Please note that this function only works with IRC servers which conform
 to RFC and send the LIST header (#321) at start of list transmission."
   (erc-with-server-buffer
-   (set (make-local-variable 'erc-list-last-argument) line)
+   (setq-local erc-list-last-argument line)
    (erc-once-with-server-event
     321
     (let ((buf (current-buffer)))
diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el
index f8b7e13..c4932f2 100644
--- a/lisp/erc/erc-pcomplete.el
+++ b/lisp/erc/erc-pcomplete.el
@@ -89,18 +89,16 @@ for use on `completion-at-point-function'."
 
 (defun pcomplete-erc-setup ()
   "Setup `erc-mode' to use pcomplete."
-  (set (make-local-variable 'pcomplete-ignore-case)
-       t)
-  (set (make-local-variable 'pcomplete-use-paring)
-       nil)
-  (set (make-local-variable 'pcomplete-parse-arguments-function)
-       'pcomplete-erc-parse-arguments)
-  (set (make-local-variable 'pcomplete-command-completion-function)
-       'pcomplete/erc-mode/complete-command)
-  (set (make-local-variable 'pcomplete-command-name-function)
-       'pcomplete-erc-command-name)
-  (set (make-local-variable 'pcomplete-default-completion-function)
-       (lambda () (pcomplete-here (pcomplete-erc-nicks)))))
+  (setq-local pcomplete-ignore-case t)
+  (setq-local pcomplete-use-paring nil)
+  (setq-local pcomplete-parse-arguments-function
+              #'pcomplete-erc-parse-arguments)
+  (setq-local pcomplete-command-completion-function
+              #'pcomplete/erc-mode/complete-command)
+  (setq-local pcomplete-command-name-function
+              #'pcomplete-erc-command-name)
+  (setq-local pcomplete-default-completion-function
+              (lambda () (pcomplete-here (pcomplete-erc-nicks)))))
 
 ;;; Programmable completion logic
 
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 94ea0de..d0b511d 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1488,12 +1488,12 @@ Defaults to the server buffer."
 (define-derived-mode erc-mode fundamental-mode "ERC"
   "Major mode for Emacs IRC."
   (setq local-abbrev-table erc-mode-abbrev-table)
-  (set (make-local-variable 'next-line-add-newlines) nil)
+  (setq-local next-line-add-newlines nil)
   (setq line-move-ignore-invisible t)
-  (set (make-local-variable 'paragraph-separate)
-       (concat "\C-l\\|\\(^" (regexp-quote (erc-prompt)) "\\)"))
-  (set (make-local-variable 'paragraph-start)
-       (concat "\\(" (regexp-quote (erc-prompt)) "\\)"))
+  (setq-local paragraph-separate
+              (concat "\C-l\\|\\(^" (regexp-quote (erc-prompt)) "\\)"))
+  (setq-local paragraph-start
+              (concat "\\(" (regexp-quote (erc-prompt)) "\\)"))
   (setq-local completion-ignore-case t)
   (add-hook 'completion-at-point-functions 'erc-complete-word-at-point nil t))
 
@@ -6493,8 +6493,7 @@ if `erc-away' is non-nil."
                           (format-spec erc-header-line-format spec)
                         nil)))
           (cond (erc-header-line-uses-tabbar-p
-                 (set (make-local-variable 'tabbar--local-hlf)
-                      header-line-format)
+                 (setq-local tabbar--local-hlf header-line-format)
                  (kill-local-variable 'header-line-format))
                 ((null header)
                  (setq header-line-format nil))
diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el
index 53a0cda..d0d7aff 100644
--- a/lisp/eshell/em-cmpl.el
+++ b/lisp/eshell/em-cmpl.el
@@ -267,48 +267,48 @@ to writing a completion function."
 
 (defun eshell-cmpl-initialize ()    ;Called from `eshell-mode' via intern-soft!
   "Initialize the completions module."
-  (set (make-local-variable 'pcomplete-command-completion-function)
-       eshell-command-completion-function)
-  (set (make-local-variable 'pcomplete-command-name-function)
-       eshell-cmpl-command-name-function)
-  (set (make-local-variable 'pcomplete-default-completion-function)
-       eshell-default-completion-function)
-  (set (make-local-variable 'pcomplete-parse-arguments-function)
-       'eshell-complete-parse-arguments)
-  (set (make-local-variable 'pcomplete-file-ignore)
-       eshell-cmpl-file-ignore)
-  (set (make-local-variable 'pcomplete-dir-ignore)
-       eshell-cmpl-dir-ignore)
-  (set (make-local-variable 'pcomplete-ignore-case)
-       eshell-cmpl-ignore-case)
-  (set (make-local-variable 'pcomplete-autolist)
-       eshell-cmpl-autolist)
+  (setq-local pcomplete-command-completion-function
+              eshell-command-completion-function)
+  (setq-local pcomplete-command-name-function
+              eshell-cmpl-command-name-function)
+  (setq-local pcomplete-default-completion-function
+              eshell-default-completion-function)
+  (setq-local pcomplete-parse-arguments-function
+              'eshell-complete-parse-arguments)
+  (setq-local pcomplete-file-ignore
+              eshell-cmpl-file-ignore)
+  (setq-local pcomplete-dir-ignore
+              eshell-cmpl-dir-ignore)
+  (setq-local pcomplete-ignore-case
+              eshell-cmpl-ignore-case)
+  (setq-local pcomplete-autolist
+              eshell-cmpl-autolist)
   (if (boundp 'pcomplete-suffix-list)
-      (set (make-local-variable 'pcomplete-suffix-list)
-           eshell-cmpl-suffix-list))
-  (set (make-local-variable 'pcomplete-recexact)
-       eshell-cmpl-recexact)
-  (set (make-local-variable 'pcomplete-man-function)
-       eshell-cmpl-man-function)
-  (set (make-local-variable 'pcomplete-compare-entry-function)
-       eshell-cmpl-compare-entry-function)
-  (set (make-local-variable 'pcomplete-expand-before-complete)
-       eshell-cmpl-expand-before-complete)
-  (set (make-local-variable 'pcomplete-cycle-completions)
-       eshell-cmpl-cycle-completions)
-  (set (make-local-variable 'pcomplete-cycle-cutoff-length)
-       eshell-cmpl-cycle-cutoff-length)
-  (set (make-local-variable 'pcomplete-restore-window-delay)
-       eshell-cmpl-restore-window-delay)
-  (set (make-local-variable 'pcomplete-use-paring)
-       eshell-cmpl-use-paring)
+      (setq-local pcomplete-suffix-list
+                  eshell-cmpl-suffix-list))
+  (setq-local pcomplete-recexact
+              eshell-cmpl-recexact)
+  (setq-local pcomplete-man-function
+              eshell-cmpl-man-function)
+  (setq-local pcomplete-compare-entry-function
+              eshell-cmpl-compare-entry-function)
+  (setq-local pcomplete-expand-before-complete
+              eshell-cmpl-expand-before-complete)
+  (setq-local pcomplete-cycle-completions
+              eshell-cmpl-cycle-completions)
+  (setq-local pcomplete-cycle-cutoff-length
+              eshell-cmpl-cycle-cutoff-length)
+  (setq-local pcomplete-restore-window-delay
+              eshell-cmpl-restore-window-delay)
+  (setq-local pcomplete-use-paring
+              eshell-cmpl-use-paring)
   ;; `comint-file-name-quote-list' should only be set after all the
   ;; load-hooks for any other extension modules have been run, which
   ;; is true at the time `eshell-mode-hook' is run
   (add-hook 'eshell-mode-hook
             (lambda ()
-              (set (make-local-variable 'comint-file-name-quote-list)
-                   eshell-special-chars-outside-quoting))
+              (setq-local comint-file-name-quote-list
+                          eshell-special-chars-outside-quoting))
             nil t)
   (add-hook 'pcomplete-quote-arg-hook #'eshell-quote-backslash nil t)
   (add-hook 'completion-at-point-functions
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
index b4ed379..c0c2539 100644
--- a/lisp/eshell/em-dirs.el
+++ b/lisp/eshell/em-dirs.el
@@ -175,8 +175,7 @@ Thus, this does not include the current directory.")
 
 (defun eshell-dirs-initialize ()    ;Called from `eshell-mode' via intern-soft!
   "Initialize the builtin functions for Eshell."
-  (make-local-variable 'eshell-variable-aliases-list)
-  (setq eshell-variable-aliases-list
+  (setq-local eshell-variable-aliases-list
        (append
         eshell-variable-aliases-list
          `(("-" ,(lambda (indices)
@@ -199,8 +198,7 @@ Thus, this does not include the current directory.")
             t))))
 
   (when eshell-cd-on-directory
-    (make-local-variable 'eshell-interpreter-alist)
-    (setq eshell-interpreter-alist
+    (setq-local eshell-interpreter-alist
          (cons (cons #'(lambda (file _args)
                           (eshell-lone-directory-p file))
                      'eshell-dirs-substitute-cd)
diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el
index a32a6ab..9ae2dd9 100644
--- a/lisp/eshell/em-glob.el
+++ b/lisp/eshell/em-glob.el
@@ -129,7 +129,7 @@ This option slows down recursive glob processing by quite a 
bit."
   "Initialize the extended globbing code."
   ;; it's important that `eshell-glob-chars-list' come first
   (when (boundp 'eshell-special-chars-outside-quoting)
-    (set (make-local-variable 'eshell-special-chars-outside-quoting)
+    (setq-local eshell-special-chars-outside-quoting
         (append eshell-glob-chars-list eshell-special-chars-outside-quoting)))
   (add-hook 'eshell-parse-argument-hook 'eshell-parse-glob-chars t t)
   (add-hook 'eshell-pre-rewrite-command-hook
@@ -205,7 +205,7 @@ resulting regular expression."
        regexp)
     (while (string-match
            (or eshell-glob-chars-regexp
-               (set (make-local-variable 'eshell-glob-chars-regexp)
+                (setq-local eshell-glob-chars-regexp
                     (format "[%s]+" (apply 'string eshell-glob-chars-list))))
            pattern matched-in-pattern)
       (let* ((op-begin (match-beginning 0))
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index c27e450..490b8b6 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -243,11 +243,10 @@ Returns nil if INPUT is prepended by blank space, 
otherwise non-nil."
   (if (and (eshell-using-module 'eshell-rebind)
           (not eshell-non-interactive-p))
       (let ((rebind-alist eshell-rebind-keys-alist))
-       (make-local-variable 'eshell-rebind-keys-alist)
-       (setq eshell-rebind-keys-alist
+        (setq-local eshell-rebind-keys-alist
              (append rebind-alist eshell-hist-rebind-keys-alist))
-       (set (make-local-variable 'search-invisible) t)
-       (set (make-local-variable 'search-exit-option) t)
+        (setq-local search-invisible t)
+        (setq-local search-exit-option t)
        (add-hook 'isearch-mode-hook
                   (lambda ()
                     (if (>= (point) eshell-last-output-end)
@@ -278,8 +277,8 @@ Returns nil if INPUT is prepended by blank space, otherwise 
non-nil."
   (make-local-variable 'eshell-save-history-index)
 
   (if (minibuffer-window-active-p (selected-window))
-      (set (make-local-variable 'eshell-save-history-on-exit) nil)
-    (set (make-local-variable 'eshell-history-ring) nil)
+      (setq-local eshell-save-history-on-exit nil)
+    (setq-local eshell-history-ring nil)
     (if eshell-history-file-name
        (eshell-read-history nil t))
 
diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el
index dcee1e7..c6afc5a 100644
--- a/lisp/eshell/em-prompt.el
+++ b/lisp/eshell/em-prompt.el
@@ -117,10 +117,9 @@ arriving, or after."
 
     (make-local-variable 'eshell-prompt-regexp)
     (if eshell-prompt-regexp
-       (set (make-local-variable 'paragraph-start) eshell-prompt-regexp))
+        (setq-local paragraph-start eshell-prompt-regexp))
 
-    (set (make-local-variable 'eshell-skip-prompt-function)
-        'eshell-skip-prompt)
+    (setq-local eshell-skip-prompt-function #'eshell-skip-prompt)
     (eshell-prompt-mode)))
 
 (defun eshell-emit-prompt ()
diff --git a/lisp/eshell/em-rebind.el b/lisp/eshell/em-rebind.el
index 7991c63..ab10211 100644
--- a/lisp/eshell/em-rebind.el
+++ b/lisp/eshell/em-rebind.el
@@ -163,7 +163,7 @@ This is default behavior of shells like bash."
     (add-hook 'pre-command-hook 'eshell-save-previous-point nil t)
     (make-local-variable 'overriding-local-map)
     (add-hook 'post-command-hook 'eshell-rebind-input-map nil t)
-    (set (make-local-variable 'eshell-lock-keymap) nil)
+    (setq-local eshell-lock-keymap nil)
     (eshell-rebind-mode)))
 
 (defun eshell-lock-local-map (&optional arg)
@@ -219,8 +219,7 @@ lock it at that."
 
 (defun eshell-setup-input-keymap ()
   "Setup the input keymap to be used during input editing."
-  (make-local-variable 'eshell-input-keymap)
-  (setq eshell-input-keymap (make-sparse-keymap))
+  (setq-local eshell-input-keymap (make-sparse-keymap))
   (set-keymap-parent eshell-input-keymap eshell-mode-map)
   (let ((bindings eshell-rebind-keys-alist))
     (while bindings
diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el
index 5c2f145..857ae6a 100644
--- a/lisp/eshell/em-script.el
+++ b/lisp/eshell/em-script.el
@@ -58,15 +58,13 @@ This includes when running `eshell-command'."
 
 (defun eshell-script-initialize ()  ;Called from `eshell-mode' via intern-soft!
   "Initialize the script parsing code."
-  (make-local-variable 'eshell-interpreter-alist)
-  (setq eshell-interpreter-alist
+  (setq-local eshell-interpreter-alist
        (cons (cons #'(lambda (file _args)
                         (string= (file-name-nondirectory file)
                                  "eshell"))
                     'eshell/source)
              eshell-interpreter-alist))
-  (make-local-variable 'eshell-complex-commands)
-  (setq eshell-complex-commands
+  (setq-local eshell-complex-commands
        (append '("source" ".") eshell-complex-commands))
   ;; these two variables are changed through usage, but we don't want
   ;; to ruin it for other modules
diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el
index a28bb1d..8bc88f2 100644
--- a/lisp/eshell/em-smart.el
+++ b/lisp/eshell/em-smart.el
@@ -170,9 +170,9 @@ The options are `begin', `after' or `end'."
   (unless eshell-non-interactive-p
     ;; override a few variables, since they would interfere with the
     ;; smart display functionality.
-    (set (make-local-variable 'eshell-scroll-to-bottom-on-output) nil)
-    (set (make-local-variable 'eshell-scroll-to-bottom-on-input) nil)
-    (set (make-local-variable 'eshell-scroll-show-maximum-output) t)
+    (setq-local eshell-scroll-to-bottom-on-output nil)
+    (setq-local eshell-scroll-to-bottom-on-input nil)
+    (setq-local eshell-scroll-show-maximum-output t)
 
     (add-hook 'window-scroll-functions 'eshell-smart-scroll-window nil t)
     (add-hook 'window-configuration-change-hook 'eshell-refresh-windows)
diff --git a/lisp/eshell/em-term.el b/lisp/eshell/em-term.el
index f52b3cd..be91cf7 100644
--- a/lisp/eshell/em-term.el
+++ b/lisp/eshell/em-term.el
@@ -143,8 +143,7 @@ behavior for short-lived processes, see bug#18108."
 
 (defun eshell-term-initialize ()    ;Called from `eshell-mode' via intern-soft!
   "Initialize the `term' interface code."
-  (make-local-variable 'eshell-interpreter-alist)
-  (setq eshell-interpreter-alist
+  (setq-local eshell-interpreter-alist
        (cons (cons #'eshell-visual-command-p
                    'eshell-exec-visual)
              eshell-interpreter-alist)))
@@ -179,9 +178,8 @@ allowed."
     (save-current-buffer
       (switch-to-buffer term-buf)
       (term-mode)
-      (set (make-local-variable 'term-term-name) eshell-term-name)
-      (make-local-variable 'eshell-parent-buffer)
-      (setq eshell-parent-buffer eshell-buf)
+      (setq-local term-term-name eshell-term-name)
+      (setq-local eshell-parent-buffer eshell-buf)
       (term-exec term-buf program program nil args)
       (let ((proc (get-buffer-process term-buf)))
        (if (and proc (eq 'run (process-status proc)))
diff --git a/lisp/eshell/em-tramp.el b/lisp/eshell/em-tramp.el
index 01f7038..c2d3c3e 100644
--- a/lisp/eshell/em-tramp.el
+++ b/lisp/eshell/em-tramp.el
@@ -51,10 +51,9 @@
   (when (eshell-using-module 'eshell-cmpl)
     (add-hook 'pcomplete-try-first-hook
              'eshell-complete-host-reference nil t))
-  (make-local-variable 'eshell-complex-commands)
-  (setq eshell-complex-commands
-       (append '("su" "sudo")
-               eshell-complex-commands)))
+  (setq-local eshell-complex-commands
+              (append '("su" "sudo")
+                      eshell-complex-commands)))
 
 (autoload 'eshell-parse-command "esh-cmd")
 
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index 1881864..2d6bd32 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -144,8 +144,7 @@ Otherwise, Emacs will attempt to use rsh to invoke du on 
the remote machine."
   (when (eshell-using-module 'eshell-cmpl)
     (add-hook 'pcomplete-try-first-hook
              'eshell-complete-host-reference nil t))
-  (make-local-variable 'eshell-complex-commands)
-  (setq eshell-complex-commands
+  (setq-local eshell-complex-commands
        (append '("grep" "egrep" "fgrep" "agrep" "glimpse" "locate"
                  "cat" "time" "cp" "mv" "make" "du" "diff")
                eshell-complex-commands)))
@@ -754,15 +753,12 @@ external command."
                                      (eshell-stringify-list
                                       (flatten-tree args)))
                              " "))
-            (cmd (progn
-                   (set-text-properties 0 (length args)
-                                        '(invisible t) args)
-                   (format "%s -n %s"
-                           (pcase command
-                             ("egrep" "grep -E")
-                             ("fgrep" "grep -F")
-                             (x x))
-                           args)))
+            (cmd (format "%s -nH %s"
+                         (pcase command
+                           ("egrep" "grep -E")
+                           ("fgrep" "grep -F")
+                           (x x))
+                         args))
             compilation-scroll-output)
        (grep cmd)))))
 
@@ -1011,7 +1007,7 @@ Show wall-clock time elapsed during execution of 
COMMAND.")
             (lambda (buff _msg)
                (with-current-buffer buff
                  (diff-mode)
-                 (set (make-local-variable 'eshell-diff-window-config) config)
+                  (setq-local eshell-diff-window-config config)
                  (local-set-key [?q] #'eshell-diff-quit)
                  (if (fboundp 'turn-on-font-lock-if-enabled)
                      (turn-on-font-lock-if-enabled))
diff --git a/lisp/eshell/esh-arg.el b/lisp/eshell/esh-arg.el
index aefda64..cecb6f7 100644
--- a/lisp/eshell/esh-arg.el
+++ b/lisp/eshell/esh-arg.el
@@ -168,8 +168,8 @@ treated as a literal character."
 (defun eshell-arg-initialize ()     ;Called from `eshell-mode' via intern-soft!
   "Initialize the argument parsing code."
   (eshell-arg-mode)
-  (set (make-local-variable 'eshell-inside-quote-regexp) nil)
-  (set (make-local-variable 'eshell-outside-quote-regexp) nil))
+  (setq-local eshell-inside-quote-regexp nil)
+  (setq-local eshell-outside-quote-regexp nil))
 
 (defun eshell-insert-buffer-name (buffer-name)
   "Insert BUFFER-NAME into the current buffer at point."
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 68b3483..8112441 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -290,12 +290,12 @@ otherwise t.")
 
 (defun eshell-cmd-initialize ()     ;Called from `eshell-mode' via intern-soft!
   "Initialize the Eshell command processing module."
-  (set (make-local-variable 'eshell-current-command) nil)
-  (set (make-local-variable 'eshell-command-name) nil)
-  (set (make-local-variable 'eshell-command-arguments) nil)
-  (set (make-local-variable 'eshell-last-arguments) nil)
-  (set (make-local-variable 'eshell-last-command-name) nil)
-  (set (make-local-variable 'eshell-last-async-proc) nil)
+  (setq-local eshell-current-command nil)
+  (setq-local eshell-command-name nil)
+  (setq-local eshell-command-arguments nil)
+  (setq-local eshell-last-arguments nil)
+  (setq-local eshell-last-command-name nil)
+  (setq-local eshell-last-async-proc nil)
 
   (add-hook 'eshell-kill-hook #'eshell-resume-command nil t)
 
diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
index b0443a4..de41fcc 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -344,8 +344,8 @@ it defaults to `insert'."
            (if buffer-file-read-only
                (error "Cannot write to read-only file `%s'" target))
            (setq buffer-read-only nil)
-           (set (make-local-variable 'eshell-output-file-buffer)
-                (if (eq exists buf) 0 t))
+            (setq-local eshell-output-file-buffer
+                        (if (eq exists buf) 0 t))
            (cond ((eq mode 'overwrite)
                   (erase-buffer))
                  ((eq mode 'append)
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index a80c2fc..81d0ec2 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -312,45 +312,38 @@ and the hook `eshell-exit-hook'."
       (if mode-line-elt
          (setcar mode-line-elt 'eshell-command-running-string))))
 
-  (set (make-local-variable 'bookmark-make-record-function)
-       'eshell-bookmark-make-record)
+  (setq-local bookmark-make-record-function #'eshell-bookmark-make-record)
   (setq local-abbrev-table eshell-mode-abbrev-table)
 
-  (set (make-local-variable 'list-buffers-directory)
-       (expand-file-name default-directory))
+  (setq-local list-buffers-directory (expand-file-name default-directory))
 
   ;; always set the tab width to 8 in Eshell buffers, since external
   ;; commands which do their own formatting almost always expect this
-  (set (make-local-variable 'tab-width) 8)
+  (setq-local tab-width 8)
 
   ;; don't ever use auto-fill in Eshell buffers
   (setq auto-fill-function nil)
 
   ;; always display everything from a return value
-  (if (boundp 'print-length)
-      (set (make-local-variable 'print-length) nil))
-  (if (boundp 'print-level)
-      (set (make-local-variable 'print-level) nil))
+  (setq-local print-length nil)
+  (setq-local print-level nil)
 
   ;; set require-final-newline to nil; otherwise, all redirected
   ;; output will end with a newline, whether or not the source
   ;; indicated it!
-  (set (make-local-variable 'require-final-newline) nil)
+  (setq-local require-final-newline nil)
 
-  (set (make-local-variable 'max-lisp-eval-depth)
-       (max 3000 max-lisp-eval-depth))
-  (set (make-local-variable 'max-specpdl-size)
-       (max 6000 max-lisp-eval-depth))
+  (setq-local max-lisp-eval-depth (max 3000 max-lisp-eval-depth))
+  (setq-local max-specpdl-size (max 6000 max-lisp-eval-depth))
 
-  (set (make-local-variable 'eshell-last-input-start) (point-marker))
-  (set (make-local-variable 'eshell-last-input-end) (point-marker))
-  (set (make-local-variable 'eshell-last-output-start) (point-marker))
-  (set (make-local-variable 'eshell-last-output-end) (point-marker))
-  (set (make-local-variable 'eshell-last-output-block-begin) (point))
+  (setq-local eshell-last-input-start (point-marker))
+  (setq-local eshell-last-input-end (point-marker))
+  (setq-local eshell-last-output-start (point-marker))
+  (setq-local eshell-last-output-end (point-marker))
+  (setq-local eshell-last-output-block-begin (point))
 
   (let ((modules-list (copy-sequence eshell-modules-list)))
-    (make-local-variable 'eshell-modules-list)
-    (setq eshell-modules-list modules-list))
+    (setq-local eshell-modules-list modules-list))
 
   ;; This is to avoid making the paragraph base direction
   ;; right-to-left if the first word just happens to start with a
@@ -391,7 +384,7 @@ and the hook `eshell-exit-hook'."
       (add-hook 'pre-command-hook #'eshell-preinput-scroll-to-bottom t t))
 
   (when eshell-scroll-show-maximum-output
-    (set (make-local-variable 'scroll-conservatively) 1000))
+    (setq-local scroll-conservatively 1000))
 
   (when eshell-status-in-mode-line
     (add-hook 'eshell-pre-command-hook #'eshell-command-started nil t)
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index f91fb89..9aea543 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -113,7 +113,6 @@
 (require 'esh-io)
 
 (require 'pcomplete)
-(require 'env)
 (require 'ring)
 
 (defgroup eshell-var nil
@@ -228,12 +227,11 @@ environment of created subprocesses."
   ;; Break the association with our parent's environment.  Otherwise,
   ;; changing a variable will affect all of Emacs.
   (unless eshell-modify-global-environment
-    (set (make-local-variable 'process-environment)
-        (eshell-copy-environment)))
+    (setq-local process-environment (eshell-copy-environment)))
 
-  (set (make-local-variable 'eshell-special-chars-inside-quoting)
+  (setq-local eshell-special-chars-inside-quoting
        (append eshell-special-chars-inside-quoting '(?$)))
-  (set (make-local-variable 'eshell-special-chars-outside-quoting)
+  (setq-local eshell-special-chars-outside-quoting
        (append eshell-special-chars-outside-quoting '(?$)))
 
   (add-hook 'eshell-parse-argument-hook #'eshell-interpolate-variable t t)
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 3ed4b54..cdff4b8 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -85,10 +85,6 @@
 
 ;;; Code:
 
-(eval-when-compile
-  (require 'help)
-  (require 'button))
-
 ;; Global bindings:
 (define-key global-map [C-down-mouse-2] 'facemenu-menu)
 (define-key global-map "\M-o" 'facemenu-keymap)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 288ccc4..2ab3eb6 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -2090,14 +2090,21 @@ is used by default."
       (goto-char (point-min))
       (looking-at message-unix-mail-delimiter))))
 
-(defun message-fetch-field (header &optional not-all)
-  "The same as `mail-fetch-field', only remove all newlines.
+(defun message-fetch-field (header &optional first)
+  "Return the value of the header field named HEADER.
+Continuation lines are folded (i.e., newlines are removed).
 Surrounding whitespace is also removed.
 
+By default, if there's more than one header field named HEADER,
+all the values are returned as one concatenated string, and
+values are comma-separated.
+
+If FIRST is non-nil, only the first value is returned.
+
 The buffer is expected to be narrowed to just the header of the message;
 see `message-narrow-to-headers-or-head'."
   (let* ((inhibit-point-motion-hooks t)
-        (value (mail-fetch-field header nil (not not-all))))
+        (value (mail-fetch-field header nil (not first))))
     (when value
       (while (string-match "\n[\t ]+" value)
        (setq value (replace-match " " t t value)))
@@ -2105,12 +2112,12 @@ see `message-narrow-to-headers-or-head'."
       ;; we have initial or trailing white space; remove it.
       (string-trim value))))
 
-(defun message-field-value (header &optional not-all)
+(defun message-field-value (header &optional first)
   "The same as `message-fetch-field', only narrow to the headers first."
   (save-excursion
     (save-restriction
       (message-narrow-to-headers-or-head)
-      (message-fetch-field header not-all))))
+      (message-fetch-field header first))))
 
 (defun message-narrow-to-field ()
   "Narrow the buffer to the header on the current line."
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 7984998..c8b700e 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -146,13 +146,24 @@ textual parts.")
   :version "24.4"
   :group 'nnimap)
 
+(define-obsolete-variable-alias
+  'nnimap-split-download-body-default 'nnimap-split-download-body
+  "28.1")
+
+(defcustom nnimap-split-download-body nil
+  "If non-nil, make message bodies available for consideration during 
splitting.
+This requires downloading the full message from the IMAP server
+during splitting, which may be slow."
+  :version "28.1"
+  :type 'boolean)
+
+(defvar nnimap--split-download-body nil
+  "Like `nnimap-split-download-body', but for internal use.")
+
 (defvar nnimap-process nil)
 
 (defvar nnimap-status-string "")
 
-(defvar nnimap-split-download-body-default nil
-  "Internal variable with default value for `nnimap-split-download-body'.")
-
 (defvar nnimap-keepalive-timer nil)
 (defvar nnimap-process-buffers nil)
 
@@ -2100,7 +2111,8 @@ Return the server's response to the SELECT or EXAMINE 
command."
                 "BODY.PEEK"
               "RFC822.PEEK"))
            (cond
-            (nnimap-split-download-body-default
+             ((or nnimap-split-download-body
+                  nnimap--split-download-body)
              "[]")
             ((nnimap-ver4-p)
              "[HEADER]")
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el
index 96a7da2..e74aef3 100644
--- a/lisp/gnus/spam.el
+++ b/lisp/gnus/spam.el
@@ -44,12 +44,9 @@
 ;;; for the definitions of group content classification and spam processors
 (require 'gnus)
 
-(eval-when-compile (require 'hashcash))
-
-;; for nnimap-split-download-body-default
-(eval-when-compile (require 'nnimap))
-
-(eval-when-compile (require 'cl-lib))
+(eval-when-compile
+  (require 'cl-lib)
+  (require 'hashcash))
 
 ;; autoload query-dig
 (autoload 'query-dig "dig")
@@ -1228,10 +1225,20 @@ Will not return a nil score."
 
 ;;{{{ set up widening, processor checks
 
-;;; set up IMAP widening if it's necessary
+(defconst spam--widened (list ())
+  "Unique value identifying changes to `nnimap--split-download-body'.")
+
 (defun spam-setup-widening ()
-  (when (spam-widening-needed-p)
-    (setq nnimap-split-download-body-default t)))
+  "Set up IMAP widening if it's necessary."
+  (and (boundp 'nnimap--split-download-body)
+       (not nnimap--split-download-body)
+       (spam-widening-needed-p)
+       (setq nnimap--split-download-body spam--widened)))
+
+(defun spam-teardown-widening ()
+  "Tear down IMAP widening."
+  (when (eq (bound-and-true-p nnimap--split-download-body) spam--widened)
+    (setq nnimap--split-download-body nil)))
 
 (defun spam-widening-needed-p (&optional force-symbols)
   (let (found)
@@ -2865,6 +2872,7 @@ installed through `spam-necessary-extra-headers'."
 (defun spam-unload-hook ()
   "Uninstall the spam.el hooks."
   (interactive)
+  (spam-teardown-widening)
   (remove-hook 'gnus-save-newsrc-hook 'spam-maybe-spam-stat-save)
   (remove-hook 'gnus-get-top-new-news-hook 'spam-maybe-spam-stat-load)
   (remove-hook 'gnus-startup-hook 'spam-maybe-spam-stat-load)
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index f0770fb..732e6cc 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -29,7 +29,6 @@
 
 ;;; Code:
 
-(require 'button)
 (require 'cl-lib)
 (eval-when-compile (require 'easymenu))
 
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 536a1af..51887b7 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -87,8 +87,6 @@
 
 ;;; Code:
 
-(require 'font-lock)
-
 (defgroup hi-lock nil
   "Interactively add and remove font-lock patterns for highlighting text."
   :link '(custom-manual "(emacs)Highlight Interactively")
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index ed2cd26..c9ede65 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -78,12 +78,6 @@
 
 ;;; Code:
 (eval-when-compile (require 'cl-lib))
-(require 'faces)
-;;  (`facep' `face-attr-construct' `x-color-values' `color-values' `face-name')
-(require 'custom)
-;;  (`defgroup' `defcustom')
-(require 'font-lock)
-;;  (`font-lock-fontify-region')
 (require 'cus-edit)
 
 (require 'htmlfontify-loaddefs)
@@ -1857,9 +1851,7 @@ Hardly bombproof, but good enough in the context in which 
it is being used."
 adding an extension of `hfy-extn'.  Fontification is actually done by
 `htmlfontify-buffer'.  If the buffer is not fontified, just copy it."
   ;;(message "hfy-copy-and-fontify-file");;DBUG
-  (let (;;(fast-lock-minimum-size      hfy-fast-lock-save)
-        ;;(font-lock-support-mode         'fast-lock-mode)
-        ;;(window-system  (or window-system 'htmlfontify))
+  (let (;;(window-system  (or window-system 'htmlfontify))
         (target nil)
         (source nil)
         (html   nil))
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 8ff3b56..00ba868 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -48,7 +48,6 @@
   (require 'ibuf-macs)
   (require 'dired))
 
-(require 'font-core)
 (require 'seq)
 
 (require 'ibuffer-loaddefs)
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 4e54680..9c14708 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -75,7 +75,12 @@ everything preceding the ~/ is discarded so the interactive
 selection process starts again from the user's $HOME.")
 
 (defcustom icomplete-show-matches-on-no-input nil
-  "When non-nil, show completions when first prompting for input.
+  "If nil, don't wait for completions before showing the prompt.
+Instead, when there's no input, completions may be displayed
+asynchronously later, when the completions have been computed.
+
+If non-nil, always compute the completions first.
+
 This also means that if you traverse the list of completions with
 commands like `C-.' and just hit RET without typing any
 characters, the match under point will be chosen instead of the
diff --git a/lisp/international/iso-transl.el b/lisp/international/iso-transl.el
index bde989d..39fd75e 100644
--- a/lisp/international/iso-transl.el
+++ b/lisp/international/iso-transl.el
@@ -30,22 +30,12 @@
 ;; A-umlaut as `C-x 8 " A' or `Alt-" A' (if you have an Alt key) or
 ;; `umlaut A' (if you have an umlaut/diaeresis key).
 
-;; C-x 8 is set up to autoload this package,
-;; but Alt keys and dead accent keys are only defined
-;; once you have loaded the package.  It is nontrivial
-;; to make all of the Alt keys autoload, and it is not clear
-;; that the dead accent keys SHOULD autoload this package.
-
 ;; This package supports all characters defined by ISO 8859-1, along
 ;; with a few other ISO 10646 characters commonly used in English and
 ;; basic math.
 
 ;;; Code:
 
-;;; Provide some binding for startup:
-;;;###autoload (define-key key-translation-map "\C-x8" 'iso-transl-ctl-x-8-map)
-;;;###autoload (autoload 'iso-transl-ctl-x-8-map "iso-transl" "Keymap for C-x 
8 prefix." t 'keymap)
-
 (defvar iso-transl-dead-key-alist
   '((?\' . mute-acute)
     (?\` . mute-grave)
diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
index 0b33940..1aebeae 100644
--- a/lisp/jsonrpc.el
+++ b/lisp/jsonrpc.el
@@ -138,18 +138,15 @@ immediately."
 
 (defun jsonrpc-events-buffer (connection)
   "Get or create JSONRPC events buffer for CONNECTION."
-  (let* ((probe (jsonrpc--events-buffer connection))
-         (buffer (or (and (buffer-live-p probe)
-                          probe)
-                     (let ((buffer (get-buffer-create
-                                    (format "*%s events*"
-                                            (jsonrpc-name connection)))))
-                       (with-current-buffer buffer
-                         (buffer-disable-undo)
-                         (read-only-mode t)
-                         (setf (jsonrpc--events-buffer connection) buffer))
-                       buffer))))
-    buffer))
+  (let ((probe (jsonrpc--events-buffer connection)))
+    (if (buffer-live-p probe)
+        probe
+      (with-current-buffer
+          (get-buffer-create (format "*%s events*" (jsonrpc-name connection)))
+        (buffer-disable-undo)
+        (setq buffer-read-only t)
+        (setf (jsonrpc--events-buffer connection)
+              (current-buffer))))))
 
 (defun jsonrpc-forget-pending-continuations (connection)
   "Stop waiting for responses from the current JSONRPC CONNECTION."
@@ -406,7 +403,7 @@ connection object, called when the process dies .")
           (ignore-errors (kill-buffer hidden-name))
           (rename-buffer hidden-name)
           (process-put proc 'jsonrpc-stderr (current-buffer))
-          (read-only-mode t))))
+          (setq buffer-read-only t))))
     (setf (jsonrpc--process conn) proc)
     (set-process-buffer proc (get-buffer-create (format " *%s output*" name)))
     (set-process-filter proc #'jsonrpc--process-filter)
@@ -414,7 +411,9 @@ connection object, called when the process dies .")
     (with-current-buffer (process-buffer proc)
       (buffer-disable-undo)
       (set-marker (process-mark proc) (point-min))
-      (let ((inhibit-read-only t)) (erase-buffer) (read-only-mode t)))
+      (let ((inhibit-read-only t))
+        (erase-buffer))
+      (setq buffer-read-only t))
     (process-put proc 'jsonrpc-connection conn)))
 
 (cl-defmethod jsonrpc-connection-send ((connection jsonrpc-process-connection)
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index f5ae3ad..ed1b2c7 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -515,9 +515,9 @@ If called interactively, toggle `Allout mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -836,9 +836,9 @@ If called interactively, toggle `Allout-Widgets mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -1260,9 +1260,9 @@ If called interactively, toggle `Artist mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -1598,9 +1598,9 @@ If called interactively, toggle `Autoarg-Kp mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -1660,9 +1660,9 @@ If called interactively, toggle `Auto-Insert mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -1753,9 +1753,9 @@ If called interactively, toggle `Auto-Revert mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -1786,9 +1786,9 @@ If called interactively, toggle `Auto-Revert-Tail mode'.  
If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -1833,9 +1833,9 @@ If called interactively, toggle `Global Auto-Revert 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -1970,9 +1970,9 @@ If called interactively, toggle `Display-Battery mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -1994,7 +1994,7 @@ seconds.
 
 (autoload 'benchmark-run "benchmark" "\
 Time execution of FORMS.
-If REPETITIONS is supplied as a number, run forms that many times,
+If REPETITIONS is supplied as a number, run FORMS that many times,
 accounting for the overhead of the resulting loop.  Otherwise run
 FORMS once.
 Return a list of the total elapsed time for execution, the number of
@@ -2952,9 +2952,9 @@ If called interactively, toggle `Bug-Reference mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -2968,9 +2968,9 @@ If called interactively, toggle `Bug-Reference-Prog 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -3038,7 +3038,11 @@ before scanning it.
 If the third argument FORCE is non-nil, recompile every `.el' file
 that already has a `.elc' file.
 
-\(fn DIRECTORY &optional ARG FORCE)" t nil)
+This command will normally not follow symlinks when compiling
+files.  If FOLLOW-SYMLINKS is non-nil, symlinked `.el' files will
+also be compiled.
+
+\(fn DIRECTORY &optional ARG FORCE FOLLOW-SYMLINKS)" t nil)
 (put 'no-byte-compile 'safe-local-variable 'booleanp)
 
 (autoload 'byte-compile-file "bytecomp" "\
@@ -4713,9 +4717,9 @@ If called interactively, toggle `Checkdoc minor mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -4829,9 +4833,9 @@ If called interactively, toggle `Cl-Font-Lock-Built-In 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -5047,9 +5051,9 @@ If called interactively, toggle `Cl-Old-Struct-Compat 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -5486,9 +5490,9 @@ If called interactively, toggle `Compilation-Shell minor 
mode'.  If
 the prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -5507,9 +5511,9 @@ If called interactively, toggle `Compilation minor mode'. 
 If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -5550,9 +5554,9 @@ If called interactively, toggle `Dynamic-Completion 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -6117,9 +6121,9 @@ If called interactively, toggle `Cua mode'.  If the 
prefix argument is
 positive, enable the mode, and if it is zero or negative, disable the
 mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -6171,9 +6175,9 @@ If called interactively, toggle `Cua-Rectangle-Mark 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -6200,9 +6204,9 @@ If called interactively, toggle `Cursor-Intangible mode'. 
 If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -6221,9 +6225,9 @@ If called interactively, toggle `Cursor-Sensor mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -6607,9 +6611,9 @@ If called interactively, toggle `Cwarn mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -7062,9 +7066,9 @@ If called interactively, toggle `Delete-Selection mode'.  
If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -7237,9 +7241,9 @@ If called interactively, toggle `Desktop-Save mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -7636,9 +7640,9 @@ If called interactively, toggle `Diff minor mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -7828,9 +7832,9 @@ If called interactively, toggle `Dirtrack mode'.  If the 
prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -8005,9 +8009,9 @@ If called interactively, toggle 
`Display-Fill-Column-Indicator mode'.
 If the prefix argument is positive, enable the mode, and if it is zero
 or negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -8082,9 +8086,9 @@ If called interactively, toggle `Display-Line-Numbers 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -8225,9 +8229,9 @@ If called interactively, toggle `Doc-View minor mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -8293,9 +8297,9 @@ If called interactively, toggle `Double mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -9143,9 +9147,9 @@ If called interactively, toggle `Global Ede mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -9997,9 +10001,9 @@ If called interactively, toggle `Electric-Pair mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -10021,9 +10025,9 @@ If called interactively, toggle `Electric-Pair-Local 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -10244,9 +10248,9 @@ If called interactively, toggle `Enriched mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -10509,9 +10513,9 @@ If called interactively, toggle `epa-mail mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -10579,9 +10583,9 @@ If called interactively, toggle `Epa-Global-Mail mode'. 
 If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -11962,9 +11966,9 @@ If called interactively, toggle `Buffer-Face mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -12011,7 +12015,7 @@ Besides the choice of face, it is the same as 
`buffer-face-mode'.
 
 \(fn &optional ARG)" t nil)
 
-(register-definition-prefixes "face-remap" '("buffer-face-mode-" "face-" 
"internal-lisp-face-attributes" "text-scale-m"))
+(register-definition-prefixes "face-remap" '("buffer-face-mode-" "face-" 
"internal-lisp-face-attributes" "text-scale-"))
 
 ;;;***
 
@@ -12385,6 +12389,12 @@ Execute BODY, and unwind connection-local variables.
 
 \(fn &rest BODY)" nil t)
 
+(autoload 'path-separator "files-x" "\
+The connection-local value of `path-separator'." nil nil)
+
+(autoload 'null-device "files-x" "\
+The connection-local value of `null-device'." nil nil)
+
 (register-definition-prefixes "files-x" '("connection-local-" 
"dir-locals-to-string" "hack-connection-local-variables" "modify-" 
"read-file-local-variable"))
 
 ;;;***
@@ -12884,9 +12894,9 @@ If called interactively, toggle `Flymake mode'.  If the 
prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -12972,9 +12982,9 @@ If called interactively, toggle `Flyspell mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -13055,9 +13065,9 @@ If called interactively, toggle `Follow mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -13185,9 +13195,9 @@ If called interactively, toggle `Footnote mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -13652,9 +13662,9 @@ If called interactively, toggle `Gdb-Enable-Debug 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -13836,9 +13846,9 @@ If called interactively, toggle `Glasses mode'.  If the 
prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -14451,9 +14461,9 @@ If called interactively, toggle `Gnus-Mailing-List 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero
 or negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.
-Enable the mode if ARG is nil, omitted, or is a positive number.
-All other values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when
 it is disabled.
@@ -14731,6 +14741,14 @@ Initialize the Gnus registry." t nil)
 
 ;;;***
 
+;;;### (autoloads nil "gnus-search" "gnus/gnus-search.el" (0 0 0
+;;;;;;  0))
+;;; Generated autoloads from gnus/gnus-search.el
+
+(register-definition-prefixes "gnus-search" '("gnus-search-"))
+
+;;;***
+
 ;;;### (autoloads nil "gnus-sieve" "gnus/gnus-sieve.el" (0 0 0 0))
 ;;; Generated autoloads from gnus/gnus-sieve.el
 
@@ -14908,9 +14926,9 @@ If called interactively, toggle `Goto-Address mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -14950,9 +14968,9 @@ If called interactively, toggle `Goto-Address-Prog 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -15290,9 +15308,9 @@ If called interactively, toggle `Gud-Tooltip mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -16011,9 +16029,9 @@ If called interactively, toggle `Hi-Lock mode'.  If the 
prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -16223,9 +16241,9 @@ If called interactively, toggle `Hide-Ifdef mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -16308,9 +16326,9 @@ If called interactively, toggle `Hs minor mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -16358,9 +16376,9 @@ If called interactively, toggle `Highlight-Changes 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -16389,9 +16407,9 @@ If called interactively, toggle 
`Highlight-Changes-Visible mode'.  If
 the prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -16539,9 +16557,9 @@ If called interactively, toggle `Hl-Line mode'.  If the 
prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -16577,9 +16595,9 @@ If called interactively, toggle `Global Hl-Line mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -16995,9 +17013,9 @@ If called interactively, toggle `Fido mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -17024,9 +17042,9 @@ If called interactively, toggle `Icomplete mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -17572,9 +17590,9 @@ If called interactively, toggle `Iimage mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -17886,9 +17904,9 @@ If called interactively, toggle `Image-Dired minor 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -17988,9 +18006,9 @@ If called interactively, toggle `Auto-Image-File mode'. 
 If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -18023,9 +18041,9 @@ If called interactively, toggle `Image minor mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -18648,8 +18666,13 @@ See Info node `(elisp)Defining Functions' for more 
details.
 Declare that you need either EMACS-VER, XEMACS-VER or SXEMACS-ver.
 Only checks one based on which kind of Emacs is being run.
 
+This function is obsolete; do this instead:
+    (when (version<= \"28.1\" emacs-version) ...)
+
 \(fn EMACS-VER XEMACS-VER SXEMACS-VER)" nil nil)
 
+(make-obsolete 'inversion-require-emacs 'nil '"28.1")
+
 (register-definition-prefixes "inversion" '("inversion-"))
 
 ;;;***
@@ -18664,6 +18687,9 @@ Select an input method and turn it on in interactive 
search." t nil)
 (autoload 'isearch-toggle-input-method "isearch-x" "\
 Toggle input method in interactive search." t nil)
 
+(autoload 'isearch-transient-input-method "isearch-x" "\
+Activate transient input method in interactive search." t nil)
+
 (autoload 'isearch-process-search-multibyte-characters "isearch-x" "\
 
 
@@ -18984,9 +19010,9 @@ If called interactively, toggle `ISpell minor mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -19185,7 +19211,7 @@ one of the aforementioned options instead of using this 
mode.
 
 ;;;### (autoloads nil "jsonrpc" "jsonrpc.el" (0 0 0 0))
 ;;; Generated autoloads from jsonrpc.el
-(push (purecopy '(jsonrpc 1 0 12)) package--builtin-versions)
+(push (purecopy '(jsonrpc 1 0 14)) package--builtin-versions)
 
 (register-definition-prefixes "jsonrpc" '("jsonrpc-"))
 
@@ -19679,9 +19705,9 @@ If called interactively, toggle `Linum mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -20259,9 +20285,9 @@ If called interactively, toggle `Mail-Abbrevs mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -20601,9 +20627,9 @@ If called interactively, toggle `Master mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -20643,9 +20669,9 @@ If called interactively, toggle 
`Minibuffer-Depth-Indicate mode'.  If
 the prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -21190,9 +21216,9 @@ If called interactively, toggle `Midnight mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -21242,9 +21268,9 @@ If called interactively, toggle 
`Minibuffer-Electric-Default mode'.
 If the prefix argument is positive, enable the mode, and if it is zero
 or negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -21818,9 +21844,9 @@ If called interactively, toggle `Msb mode'.  If the 
prefix argument is
 positive, enable the mode, and if it is zero or negative, disable the
 mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -22558,13 +22584,6 @@ This command does not work if you use short group 
names." t nil)
 
 ;;;***
 
-;;;### (autoloads nil "nnir" "gnus/nnir.el" (0 0 0 0))
-;;; Generated autoloads from gnus/nnir.el
-
-(register-definition-prefixes "nnir" '("nnir-"))
-
-;;;***
-
 ;;;### (autoloads nil "nnmail" "gnus/nnmail.el" (0 0 0 0))
 ;;; Generated autoloads from gnus/nnmail.el
 
@@ -24346,9 +24365,9 @@ If called interactively, toggle `Org-Num mode'.  If the 
prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -24440,9 +24459,9 @@ If called interactively, toggle `Outline minor mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -24648,9 +24667,9 @@ If called interactively, toggle `Show-Paren mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -25361,9 +25380,9 @@ If called interactively, toggle `Pixel-Scroll mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -26147,13 +26166,15 @@ pattern to search for.
 
 (autoload 'project-find-file "project" "\
 Visit a file (with completion) in the current project.
-The completion default is the filename at point, if one is
-recognized." t nil)
+
+The completion default is the filename at point, determined by
+`thing-at-point' (whether such file exists or not)." t nil)
 
 (autoload 'project-or-external-find-file "project" "\
 Visit a file (with completion) in the current project or external roots.
-The completion default is the filename at point, if one is
-recognized." t nil)
+
+The completion default is the filename at point, determined by
+`thing-at-point' (whether such file exists or not)." t nil)
 
 (autoload 'project-dired "project" "\
 Start Dired in the current project's root." t nil)
@@ -27112,9 +27133,9 @@ If called interactively, toggle `Rcirc-Track minor 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -27164,9 +27185,9 @@ If called interactively, toggle `Recentf mode'.  If the 
prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -27322,9 +27343,9 @@ If called interactively, toggle `Rectangle-Mark mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -27361,9 +27382,9 @@ If called interactively, toggle `Refill mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -27398,9 +27419,9 @@ If called interactively, toggle `Reftex mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -27679,9 +27700,9 @@ If called interactively, toggle `Reveal mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -27711,9 +27732,9 @@ If called interactively, toggle `Global Reveal mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -28245,9 +28266,9 @@ If called interactively, toggle `Rng-Validate mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -28402,9 +28423,9 @@ If called interactively, toggle `Rst minor mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -28436,7 +28457,7 @@ Major mode for editing Ruby code.
 
 \(fn)" t nil)
 
-(add-to-list 'auto-mode-alist (cons (purecopy (concat "\\(?:\\.\\(?:" 
"rbw?\\|ru\\|rake\\|thor" "\\|jbuilder\\|rabl\\|gemspec\\|podspec" "\\)" "\\|/" 
"\\(?:Gem\\|Rake\\|Cap\\|Thor" "\\|Puppet\\|Berks" 
"\\|Vagrant\\|Guard\\|Pod\\)file" "\\)\\'")) 'ruby-mode))
+(add-to-list 'auto-mode-alist (cons (purecopy (concat "\\(?:\\.\\(?:" 
"rbw?\\|ru\\|rake\\|thor" "\\|jbuilder\\|rabl\\|gemspec\\|podspec" "\\)" "\\|/" 
"\\(?:Gem\\|Rake\\|Cap\\|Thor" "\\|Puppet\\|Berks\\|Brew" 
"\\|Vagrant\\|Guard\\|Pod\\)file" "\\)\\'")) 'ruby-mode))
 
 (dolist (name (list "ruby" "rbx" "jruby" "ruby1.9" "ruby1.8")) (add-to-list 
'interpreter-mode-alist (cons (purecopy name) 'ruby-mode)))
 
@@ -28458,9 +28479,9 @@ If called interactively, toggle `Ruler mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -28661,6 +28682,29 @@ For more details, see Info node `(elisp) Extending Rx'.
 
 (function-put 'rx-define 'lisp-indent-function 'defun)
 
+(autoload 'rx--pcase-macroexpander "rx" "\
+A pattern that matches strings against `rx' REGEXPS in sexp form.
+REGEXPS are interpreted as in `rx'.  The pattern matches any
+string that is a match for REGEXPS, as if by `string-match'.
+
+In addition to the usual `rx' syntax, REGEXPS can contain the
+following constructs:
+
+  (let REF RX...)  binds the symbol REF to a submatch that matches
+                   the regular expressions RX.  REF is bound in
+                   CODE to the string of the submatch or nil, but
+                   can also be used in `backref'.
+  (backref REF)    matches whatever the submatch REF matched.
+                   REF can be a number, as usual, or a name
+                   introduced by a previous (let REF ...)
+                   construct.
+
+\(fn &rest REGEXPS)" nil nil)
+
+(define-symbol-prop 'rx--pcase-macroexpander 'edebug-form-spec 'nil)
+
+(define-symbol-prop 'rx 'pcase-macroexpander #'rx--pcase-macroexpander)
+
 (register-definition-prefixes "rx" '("rx-"))
 
 ;;;***
@@ -28729,9 +28773,9 @@ If called interactively, toggle `Savehist mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -28790,9 +28834,9 @@ If called interactively, toggle `Save-Place mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -28809,9 +28853,9 @@ If called interactively, toggle `Save-Place-Local 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -28903,9 +28947,9 @@ If called interactively, toggle `Scroll-All mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -28936,9 +28980,9 @@ If called interactively, toggle `Scroll-Lock mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -28983,7 +29027,6 @@ The possible elements of this list include the 
following:
  `global-semantic-stickyfunc-mode'     - Show current fun in header line.
  `global-semantic-mru-bookmark-mode'   - Provide `switch-to-buffer'-like
                                          keybinding for tag names.
- `global-cedet-m3-minor-mode'          - A mouse 3 context menu.
  `global-semantic-idle-local-symbol-highlight-mode' - Highlight references
                                          of the symbol under point.
 The following modes are more targeted at people who want to see
@@ -29013,9 +29056,9 @@ If called interactively, toggle `Semantic mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -29653,9 +29696,9 @@ If called interactively, toggle `Server mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -30290,9 +30333,9 @@ If called interactively, toggle `Smerge mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -30423,9 +30466,9 @@ If called interactively, toggle `So-Long minor mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -30505,9 +30548,9 @@ If called interactively, toggle `Global So-Long mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -31623,9 +31666,9 @@ If called interactively, toggle `Strokes mode'.  If the 
prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -31733,9 +31776,9 @@ If called interactively, toggle `Subword mode'.  If the 
prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -31793,9 +31836,9 @@ If called interactively, toggle `Superword mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -31899,9 +31942,9 @@ If called interactively, toggle `Gpm-Mouse mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -31930,9 +31973,9 @@ If called interactively, toggle `Tab-Line mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -32346,9 +32389,9 @@ If called interactively, toggle `Table-Fixed-Width 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -33537,9 +33580,9 @@ If called interactively, toggle `Tildify mode'.  If the 
prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -33592,9 +33635,9 @@ If called interactively, toggle `Display-Time mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -34484,9 +34527,9 @@ If called interactively, toggle `Type-Break mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -35015,9 +35058,9 @@ If called interactively, toggle `Url-Handler mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -37176,9 +37219,9 @@ If called interactively, toggle `View mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -37555,9 +37598,9 @@ If called interactively, toggle `Which-Function mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -37583,9 +37626,9 @@ If called interactively, toggle `Whitespace mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -37602,9 +37645,9 @@ If called interactively, toggle `Whitespace-Newline 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -37635,9 +37678,9 @@ If called interactively, toggle `Global Whitespace 
mode'.  If the
 prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -37664,9 +37707,9 @@ If called interactively, toggle `Global 
Whitespace-Newline mode'.  If
 the prefix argument is positive, enable the mode, and if it is zero or
 negative, disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -37994,9 +38037,9 @@ If called interactively, toggle `Widget minor mode'.  
If the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -38234,9 +38277,9 @@ If called interactively, toggle `Winner mode'.  If the 
prefix argument
 is positive, enable the mode, and if it is zero or negative, disable
 the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -38526,9 +38569,9 @@ If called interactively, toggle `Xterm-Mouse mode'.  If 
the prefix
 argument is positive, enable the mode, and if it is zero or negative,
 disable the mode.
 
-If called from Lisp, toggle the mode if if ARG is `toggle'.  Enable
-the mode if ARG is nil, omitted, or is a positive number.  All other
-values will disable the mode.
+If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
+mode if ARG is nil, omitted, or is a positive number.  Disable the
+mode if ARG is a negative number.
 
 The mode's hook is called both when the mode is enabled and when it is
 disabled.
@@ -38682,27 +38725,27 @@ Zone out, completely." t nil)
 ;;;;;;  "leim/quail/PY-b5.el" "leim/quail/PY.el" "leim/quail/Punct-b5.el"
 ;;;;;;  "leim/quail/Punct.el" "leim/quail/QJ-b5.el" "leim/quail/QJ.el"
 ;;;;;;  "leim/quail/SW.el" "leim/quail/TONEPY.el" "leim/quail/ZIRANMA.el"
-;;;;;;  "leim/quail/ZOZY.el" "leim/quail/arabic.el" "leim/quail/croatian.el"
-;;;;;;  "leim/quail/cyril-jis.el" "leim/quail/cyrillic.el" 
"leim/quail/czech.el"
-;;;;;;  "leim/quail/georgian.el" "leim/quail/greek.el" 
"leim/quail/hanja-jis.el"
-;;;;;;  "leim/quail/hanja.el" "leim/quail/hanja3.el" "leim/quail/hebrew.el"
-;;;;;;  "leim/quail/ipa-praat.el" "leim/quail/latin-alt.el" 
"leim/quail/latin-ltx.el"
-;;;;;;  "leim/quail/latin-post.el" "leim/quail/latin-pre.el" 
"leim/quail/persian.el"
-;;;;;;  "leim/quail/programmer-dvorak.el" "leim/quail/py-punct.el"
-;;;;;;  "leim/quail/pypunct-b5.el" "leim/quail/quick-b5.el" 
"leim/quail/quick-cns.el"
-;;;;;;  "leim/quail/rfc1345.el" "leim/quail/sami.el" "leim/quail/sgml-input.el"
-;;;;;;  "leim/quail/slovak.el" "leim/quail/symbol-ksc.el" 
"leim/quail/tamil-dvorak.el"
-;;;;;;  "leim/quail/tsang-b5.el" "leim/quail/tsang-cns.el" 
"leim/quail/vntelex.el"
-;;;;;;  "leim/quail/vnvni.el" "leim/quail/welsh.el" "loadup.el" 
"mail/blessmail.el"
-;;;;;;  "mail/rmailedit.el" "mail/rmailkwd.el" "mail/rmailmm.el"
-;;;;;;  "mail/rmailmsc.el" "mail/rmailsort.el" "mail/rmailsum.el"
-;;;;;;  "mail/undigest.el" "menu-bar.el" "mh-e/mh-gnus.el" 
"mh-e/mh-loaddefs.el"
-;;;;;;  "minibuffer.el" "mouse.el" "net/tramp-loaddefs.el" "newcomment.el"
-;;;;;;  "obarray.el" "org/ob-core.el" "org/ob-lob.el" "org/ob-matlab.el"
-;;;;;;  "org/ob-tangle.el" "org/ob.el" "org/ol-bbdb.el" "org/ol-irc.el"
-;;;;;;  "org/org-archive.el" "org/org-attach.el" "org/org-clock.el"
-;;;;;;  "org/org-datetree.el" "org/org-element.el" "org/org-feed.el"
-;;;;;;  "org/org-footnote.el" "org/org-id.el" "org/org-indent.el"
+;;;;;;  "leim/quail/ZOZY.el" "leim/quail/arabic.el" "leim/quail/compose.el"
+;;;;;;  "leim/quail/croatian.el" "leim/quail/cyril-jis.el" 
"leim/quail/cyrillic.el"
+;;;;;;  "leim/quail/czech.el" "leim/quail/georgian.el" "leim/quail/greek.el"
+;;;;;;  "leim/quail/hanja-jis.el" "leim/quail/hanja.el" "leim/quail/hanja3.el"
+;;;;;;  "leim/quail/hebrew.el" "leim/quail/ipa-praat.el" 
"leim/quail/latin-alt.el"
+;;;;;;  "leim/quail/latin-ltx.el" "leim/quail/latin-post.el" 
"leim/quail/latin-pre.el"
+;;;;;;  "leim/quail/persian.el" "leim/quail/programmer-dvorak.el"
+;;;;;;  "leim/quail/py-punct.el" "leim/quail/pypunct-b5.el" 
"leim/quail/quick-b5.el"
+;;;;;;  "leim/quail/quick-cns.el" "leim/quail/rfc1345.el" "leim/quail/sami.el"
+;;;;;;  "leim/quail/sgml-input.el" "leim/quail/slovak.el" 
"leim/quail/symbol-ksc.el"
+;;;;;;  "leim/quail/tamil-dvorak.el" "leim/quail/tsang-b5.el" 
"leim/quail/tsang-cns.el"
+;;;;;;  "leim/quail/vntelex.el" "leim/quail/vnvni.el" "leim/quail/welsh.el"
+;;;;;;  "loadup.el" "mail/blessmail.el" "mail/rmailedit.el" "mail/rmailkwd.el"
+;;;;;;  "mail/rmailmm.el" "mail/rmailmsc.el" "mail/rmailsort.el"
+;;;;;;  "mail/rmailsum.el" "mail/undigest.el" "menu-bar.el" "mh-e/mh-gnus.el"
+;;;;;;  "mh-e/mh-loaddefs.el" "minibuffer.el" "mouse.el" 
"net/tramp-loaddefs.el"
+;;;;;;  "newcomment.el" "obarray.el" "org/ob-core.el" "org/ob-lob.el"
+;;;;;;  "org/ob-matlab.el" "org/ob-tangle.el" "org/ob.el" "org/ol-bbdb.el"
+;;;;;;  "org/ol-irc.el" "org/org-archive.el" "org/org-attach.el"
+;;;;;;  "org/org-clock.el" "org/org-datetree.el" "org/org-element.el"
+;;;;;;  "org/org-feed.el" "org/org-footnote.el" "org/org-id.el" 
"org/org-indent.el"
 ;;;;;;  "org/org-install.el" "org/org-mobile.el" "org/org-plot.el"
 ;;;;;;  "org/org-table.el" "org/org-timer.el" "org/ox-ascii.el" 
"org/ox-beamer.el"
 ;;;;;;  "org/ox-html.el" "org/ox-icalendar.el" "org/ox-latex.el"
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 158a4bf..e0174fc 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -351,6 +351,7 @@
 (load "cus-start") ;Late to reduce customize-rogue (needs loaddefs.el anyway)
 (if (not (eq system-type 'ms-dos))
     (load "tooltip"))
+(load "international/iso-transl") ; Binds Alt-[ and friends.
 
 ;; This file doesn't exist when building a development version of Emacs
 ;; from the repository.  It is generated just after temacs is built.
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 4af8780..7348324 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -241,12 +241,12 @@ Already submitted bugs can be found in the Emacs bug 
tracker:
       ;; that report-emacs-bug-orig-text remains valid.  (Bug#5178)
       (message-sort-headers)
       ;; Stop message-mode stealing the properties we will add.
-      (set (make-local-variable 'message-strip-special-text-properties) nil)
+      (setq-local message-strip-special-text-properties nil)
       ;; Make sure we default to the From: address as envelope when sending
       ;; through sendmail.  FIXME: Why?
       (when (and (not (message--sendmail-envelope-from))
                 (message-bogus-recipient-p (message-make-address)))
-       (set (make-local-variable 'message-sendmail-envelope-from) 'header)))
+        (setq-local message-sendmail-envelope-from 'header)))
     (rfc822-goto-eoh)
     (forward-line 1)
     ;; Move the mail signature to the proper place.
@@ -381,9 +381,8 @@ usually do not have translators for other languages.\n\n")))
         (add-hook report-emacs-bug-send-hook 'report-emacs-bug-hook nil t))
     (goto-char (point-max))
     (skip-chars-backward " \t\n")
-    (make-local-variable 'report-emacs-bug-orig-text)
-    (setq report-emacs-bug-orig-text
-          (buffer-substring-no-properties (point-min) (point)))
+    (setq-local report-emacs-bug-orig-text
+                (buffer-substring-no-properties (point-min) (point)))
     (goto-char user-point)))
 
 (defun emacs-bug--system-description ()
diff --git a/lisp/mail/rfc822.el b/lisp/mail/rfc822.el
index 4572f27..70480d4 100644
--- a/lisp/mail/rfc822.el
+++ b/lisp/mail/rfc822.el
@@ -279,8 +279,7 @@
     (let ((buf (generate-new-buffer " rfc822")))
       (unwind-protect
           (with-current-buffer buf
-            (make-local-variable 'case-fold-search)
-            (setq case-fold-search nil)        ;For speed(?)
+            (setq-local case-fold-search nil)  ;For speed(?)
             (insert header-text)
             ;; unfold continuation lines
             (goto-char (point-min))
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 2c972ee..63d992d 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1431,27 +1431,23 @@ If so restore the actual mbox message collection."
 (defun rmail-perm-variables ()
   (make-local-variable 'rmail-last-regexp)
   (make-local-variable 'rmail-deleted-vector)
-  (make-local-variable 'rmail-buffer)
-  (make-local-variable 'rmail-was-converted)
-  (setq rmail-was-converted nil)
-  (make-local-variable 'rmail-seriously-modified)
-  (setq rmail-seriously-modified nil)
-  (setq rmail-buffer (current-buffer))
+  (setq-local rmail-was-converted nil)
+  (setq-local rmail-seriously-modified nil)
+  (setq-local rmail-buffer (current-buffer))
   (set-buffer-multibyte nil)
   (with-current-buffer (setq rmail-view-buffer (rmail-generate-viewer-buffer))
     (setq buffer-undo-list t)
     ;; Note that this does not erase the buffer.  Should it?
     ;; It depends on how this is called.  If somehow called with the
     ;; rmail buffers swapped, it would erase the message collection.
-    (set (make-local-variable 'rmail-overlay-list) nil)
+    (setq-local rmail-overlay-list nil)
     (set-buffer-multibyte t)
     ;; Force C-x C-s write Unix EOLs.
     (set-buffer-file-coding-system 'undecided-unix))
   (make-local-variable 'rmail-summary-buffer)
   (make-local-variable 'rmail-summary-vector)
   (make-local-variable 'rmail-current-message)
-  (make-local-variable 'rmail-total-messages)
-  (setq rmail-total-messages 0)
+  (setq-local rmail-total-messages 0)
   (make-local-variable 'rmail-message-vector)
   (make-local-variable 'rmail-msgref-vector)
   (make-local-variable 'rmail-inbox-list)
@@ -1466,39 +1462,30 @@ If so restore the actual mbox message collection."
                           ;; FIXME expand-file-name?
                           (concat rmail-spool-directory
                                   (user-login-name)))))))
-  (set (make-local-variable 'tool-bar-map) rmail-tool-bar-map))
+  (setq-local tool-bar-map rmail-tool-bar-map))
 
 ;; Set up the non-permanent locals associated with Rmail mode.
 (defun rmail-variables ()
   ;; Turn off undo.  We turn it back on in rmail-edit.
   (setq buffer-undo-list t)
   ;; Don't let a local variables list in a message cause confusion.
-  (make-local-variable 'local-enable-local-variables)
-  (setq local-enable-local-variables nil)
+  (setq-local local-enable-local-variables nil)
   ;; Don't turn off auto-saving based on the size of the buffer
   ;; because that code does not understand buffer-swapping.
-  (make-local-variable 'auto-save-include-big-deletions)
-  (setq auto-save-include-big-deletions t)
-  (make-local-variable 'revert-buffer-function)
-  (setq revert-buffer-function 'rmail-revert)
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults
-       '(rmail-font-lock-keywords
-         t t nil nil
-         (font-lock-maximum-size . nil)
-          (font-lock-dont-widen . t)
-         (font-lock-inhibit-thing-lock . (lazy-lock-mode fast-lock-mode))))
-  (make-local-variable 'require-final-newline)
-  (setq require-final-newline nil)
-  (make-local-variable 'version-control)
-  (setq version-control 'never)
+  (setq-local auto-save-include-big-deletions t)
+  (setq-local revert-buffer-function 'rmail-revert)
+  (setq-local font-lock-defaults
+              '(rmail-font-lock-keywords
+                t t nil nil
+                (font-lock-maximum-size . nil)
+                (font-lock-dont-widen . t)
+                (font-lock-inhibit-thing-lock . (lazy-lock-mode 
fast-lock-mode))))
+  (setq-local require-final-newline nil)
+  (setq-local version-control 'never)
   (add-hook 'kill-buffer-hook #'rmail-mode-kill-summary nil t)
-  (make-local-variable 'file-precious-flag)
-  (setq file-precious-flag t)
-  (make-local-variable 'desktop-save-buffer)
-  (setq desktop-save-buffer t)
-  (make-local-variable 'save-buffer-coding-system)
-  (setq save-buffer-coding-system 'no-conversion)
+  (setq-local file-precious-flag t)
+  (setq-local desktop-save-buffer t)
+  (setq-local save-buffer-coding-system 'no-conversion)
   (setq next-error-move-function 'rmail-next-error-move))
 
 ;; Handle M-x revert-buffer done in an rmail-mode buffer.
@@ -2787,7 +2774,7 @@ The current mail message becomes the message displayed."
          ;; rmail-header-style based on the binding in effect when
           ;; this function is called; `rmail-toggle-header' can
          ;; inspect this value to determine how to toggle.
-         (set (make-local-variable 'rmail-header-style) header-style)
+          (setq-local rmail-header-style header-style)
           ;; In case viewing the previous message sets the paragraph
           ;; direction non-nil, we reset it here to allow independent
           ;; dynamic determination of paragraph direction in every
@@ -2798,7 +2785,7 @@ The current mail message becomes the message displayed."
                 (re-search-forward "mime-version: 1.0" nil t))
            (let ((rmail-buffer mbox-buf)
                  (rmail-view-buffer view-buf))
-             (set (make-local-variable 'rmail-mime-decoded) t)
+              (setq-local rmail-mime-decoded t)
              (funcall rmail-show-mime-function))
          (setq body-start (search-forward "\n\n" nil t))
          (narrow-to-region beg (point))
diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el
index 3026283..72a5603 100644
--- a/lisp/mail/rmailedit.el
+++ b/lisp/mail/rmailedit.el
@@ -66,8 +66,7 @@ This function runs the hooks `text-mode-hook' and 
`rmail-edit-mode-hook'.
     (setq mode-line-modified (default-value 'mode-line-modified))
     ;; Don't turn off auto-saving based on the size of the buffer
     ;; because that code does not understand buffer-swapping.
-    (make-local-variable 'auto-save-include-big-deletions)
-    (setq auto-save-include-big-deletions t)
+    (setq-local auto-save-include-big-deletions t)
     ;; If someone uses C-x C-s, don't clobber the rmail file (bug#2625).
     (add-hook 'write-region-annotate-functions
              'rmail-write-region-annotate nil t)
@@ -98,10 +97,9 @@ This function runs the hooks `text-mode-hook' and 
`rmail-edit-mode-hook'.
   (if (zerop rmail-total-messages)
       (error "No messages in this buffer"))
   (rmail-modify-format)
-  (make-local-variable 'rmail-old-pruned)
-  (setq rmail-old-pruned (rmail-msg-is-pruned))
+  (setq-local rmail-old-pruned (rmail-msg-is-pruned))
   (rmail-edit-mode)
-  (set (make-local-variable 'rmail-old-mime-state)
+  (setq-local rmail-old-mime-state
        (and rmail-enable-mime
            ;; If you use something else, you are on your own.
            (eq rmail-mime-feature 'rmailmm)
@@ -125,13 +123,11 @@ This function runs the hooks `text-mode-hook' and 
`rmail-edit-mode-hook'.
                (goto-char (point-min))
                ;; t = decoded; raw = raw.
                (aref (aref (rmail-mime-entity-display entity) 0) 0)))))
-  (make-local-variable 'rmail-old-text)
-  (setq rmail-old-text
-       (save-restriction
-         (widen)
-         (buffer-substring (point-min) (point-max))))
-  (make-local-variable 'rmail-old-headers)
-  (setq rmail-old-headers (rmail-edit-headers-alist t))
+  (setq-local rmail-old-text
+              (save-restriction
+                (widen)
+                (buffer-substring (point-min) (point-max))))
+  (setq-local rmail-old-headers (rmail-edit-headers-alist t))
   (setq buffer-read-only nil)
   (setq buffer-undo-list nil)
   ;; Whether the buffer is initially marked as modified or not
@@ -209,7 +205,7 @@ This function runs the hooks `text-mode-hook' and 
`rmail-edit-mode-hook'.
       (kill-all-local-variables)
       (rmail-mode-1)
       (if (boundp 'tool-bar-map)
-         (set (make-local-variable 'tool-bar-map) rmail-tool-bar-map))
+          (setq-local tool-bar-map rmail-tool-bar-map))
       (setq buffer-undo-list t)
       (rmail-variables))
     ;; If text has really changed, mark message as edited.
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index 49531ea..cfde335 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -579,7 +579,7 @@ from a non-Rmail buffer.  In this case, COUNT is ignored."
                      (progn
                        (if rmail-delete-after-output
                            (rmail-delete-message))
-                       (if (> count 0)
+                       (if (>= count 0)
                            (let ((msgnum rmail-current-message))
                              (rmail-next-message 1)
                              (eq rmail-current-message (1+ msgnum)))))
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 521659b..a085e0b 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -532,8 +532,7 @@ message."
        ;; Set up the rest of its state and local variables.
        (setq buffer-read-only t)
        (rmail-summary-mode)
-       (make-local-variable 'minor-mode-alist)
-       (setq minor-mode-alist (list (list t (concat ": " description))))
+        (setq-local minor-mode-alist (list (list t (concat ": " description))))
        (setq rmail-buffer rbuf
              rmail-summary-redo redo
              rmail-total-messages total)))
@@ -1089,13 +1088,10 @@ Commands for sorting the summary:
   (set-syntax-table text-mode-syntax-table)
   (make-local-variable 'rmail-buffer)
   (make-local-variable 'rmail-total-messages)
-  (make-local-variable 'rmail-current-message)
-  (setq rmail-current-message nil)
-  (make-local-variable 'rmail-summary-redo)
-  (setq rmail-summary-redo nil)
+  (setq-local rmail-current-message nil)
+  (setq-local rmail-summary-redo nil)
   (make-local-variable 'revert-buffer-function)
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults '(rmail-summary-font-lock-keywords t))
+  (setq-local font-lock-defaults '(rmail-summary-font-lock-keywords t))
   (rmail-summary-enable))
 
 ;; Summary features need to be disabled during edit mode.
@@ -1288,8 +1284,7 @@ Returns non-nil if message N was found."
   ;; Make sure we have an overlay to use.
   (or rmail-summary-overlay
       (progn
-       (make-local-variable 'rmail-summary-overlay)
-       (setq rmail-summary-overlay (make-overlay (point) (point)))
+        (setq-local rmail-summary-overlay (make-overlay (point) (point)))
        (overlay-put rmail-summary-overlay 'rmail-summary t)))
   ;; If this message is in the summary, use the overlay to highlight it.
   ;; Otherwise, don't highlight anything.
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 7610939..02a852f 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -691,29 +691,25 @@ Turning on Mail mode runs the normal hooks 
`text-mode-hook' and
   (make-local-variable 'mail-reply-action)
   (make-local-variable 'mail-send-actions)
   (make-local-variable 'mail-return-action)
-  (make-local-variable 'mail-encode-mml)
-  (setq mail-encode-mml nil)
+  (setq-local mail-encode-mml nil)
   (setq buffer-offer-save t)
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults '(mail-font-lock-keywords t t))
+  (setq-local font-lock-defaults '(mail-font-lock-keywords t t))
   (make-local-variable 'paragraph-separate)
   (setq-local normal-auto-fill-function #'mail-mode-auto-fill)
   (setq-local fill-paragraph-function #'mail-mode-fill-paragraph)
   ;; Allow using comment commands to add/remove quoting (this only does
   ;; anything if mail-yank-prefix is set to a non-nil value).
-  (set (make-local-variable 'comment-start) mail-yank-prefix)
+  (setq-local comment-start mail-yank-prefix)
   (if mail-yank-prefix
-      (set (make-local-variable 'comment-start-skip)
-          (concat "^" (regexp-quote mail-yank-prefix) "[ \t]*")))
-  (make-local-variable 'adaptive-fill-regexp)
+      (setq-local comment-start-skip
+                  (concat "^" (regexp-quote mail-yank-prefix) "[ \t]*")))
   ;; Also update the paragraph-separate entry if you change this.
-  (setq adaptive-fill-regexp
-       (concat "[ \t]*[-[:alnum:]]+>+[ \t]*\\|"
-               adaptive-fill-regexp))
-  (make-local-variable 'adaptive-fill-first-line-regexp)
-  (setq adaptive-fill-first-line-regexp
-       (concat "[ \t]*[-[:alnum:]]*>+[ \t]*\\|"
-               adaptive-fill-first-line-regexp))
+  (setq-local adaptive-fill-regexp
+              (concat "[ \t]*[-[:alnum:]]+>+[ \t]*\\|"
+                      adaptive-fill-regexp))
+  (setq-local adaptive-fill-first-line-regexp
+              (concat "[ \t]*[-[:alnum:]]*>+[ \t]*\\|"
+                      adaptive-fill-first-line-regexp))
   (add-hook 'completion-at-point-functions #'mail-completion-at-point-function
             nil 'local)
   ;; `-- ' precedes the signature.  `-----' appears at the start of the
diff --git a/lisp/man.el b/lisp/man.el
index bd55d7e..991b1bb 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -90,7 +90,6 @@
 
 (require 'ansi-color)
 (require 'cl-lib)
-(require 'button)
 
 (defgroup man nil
   "Browse UNIX manual pages."
@@ -1109,7 +1108,6 @@ Return the buffer in which the manpage will appear."
         (buffer  (get-buffer bufname)))
     (if buffer
        (Man-notify-when-ready buffer)
-      (require 'env)
       (message "Invoking %s %s in the background" manual-program man-args)
       (setq buffer (generate-new-buffer bufname))
       (with-current-buffer buffer
diff --git a/lisp/mwheel.el b/lisp/mwheel.el
index 1d9fe68..9fd050f 100644
--- a/lisp/mwheel.el
+++ b/lisp/mwheel.el
@@ -37,7 +37,6 @@
 ;; 'mwheel-down', but I cannot find a way to do this very easily (or
 ;; portably), so for now I just live with it.
 
-(require 'custom)
 (require 'timer)
 
 (defvar mouse-wheel-mode)
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index e0c162d..c627e1a 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -1556,7 +1556,7 @@ good, skip, fatal, or unknown."
          ;; This looks like an error, but we have to keep reading the output
          ;; to see if it was fixed or not.  E.g. it may indicate that IPv6
          ;; failed, but maybe a subsequent IPv4 fallback succeeded.
-         (set (make-local-variable 'ange-ftp-pending-error-line) line)
+         (setq-local ange-ftp-pending-error-line line)
          t)
        ((string-match ange-ftp-fatal-msgs line)
         (delete-process proc)
@@ -1970,30 +1970,24 @@ on the gateway machine to do the FTP instead."
   "Major mode for interacting with the FTP process.
 
 \\{comint-mode-map}"
-  (make-local-variable 'ange-ftp-process-string)
-  (setq ange-ftp-process-string "")
+  (setq-local ange-ftp-process-string "")
   (make-local-variable 'ange-ftp-process-busy)
   (make-local-variable 'ange-ftp-process-result)
   (make-local-variable 'ange-ftp-process-msg)
   (make-local-variable 'ange-ftp-process-multi-skip)
-  (make-local-variable 'ange-ftp-process-result-line)
   (make-local-variable 'ange-ftp-process-continue)
-  (make-local-variable 'ange-ftp-hash-mark-count)
   (make-local-variable 'ange-ftp-binary-hash-mark-size)
   (make-local-variable 'ange-ftp-ascii-hash-mark-size)
   (make-local-variable 'ange-ftp-hash-mark-unit)
-  (make-local-variable 'ange-ftp-xfer-size)
   (make-local-variable 'ange-ftp-last-percent)
-  (setq ange-ftp-hash-mark-count 0)
-  (setq ange-ftp-xfer-size 0)
-  (setq ange-ftp-process-result-line "")
+  (setq-local ange-ftp-hash-mark-count 0)
+  (setq-local ange-ftp-xfer-size 0)
+  (setq-local ange-ftp-process-result-line "")
   (setq comint-prompt-regexp "^ftp> ")
-  (make-local-variable 'comint-password-prompt-regexp)
   ;; This is a regexp that can't match anything.
   ;; ange-ftp has its own ways of handling passwords.
-  (setq comint-password-prompt-regexp regexp-unmatchable)
-  (make-local-variable 'paragraph-start)
-  (setq paragraph-start comint-prompt-regexp))
+  (setq-local comint-password-prompt-regexp regexp-unmatchable)
+  (setq-local paragraph-start comint-prompt-regexp))
 
 (defcustom ange-ftp-raw-login nil
   "Use raw FTP commands for login, if account password is not nil.
@@ -3662,7 +3656,7 @@ so return the size on the remote host exactly. See RFC 
3659."
 ;;     (set-process-sentinel proc 'ange-ftp-copy-file-locally-sentinel)
 ;;     (set-process-query-on-exit-flag proc nil)
 ;;     (with-current-buffer (process-buffer proc)
-;;       (set (make-local-variable 'copy-cont) cont))))
+;;       (setq-local copy-cont cont))))
 ;;
 ;; (defun ange-ftp-copy-file-locally-sentinel (proc status)
 ;;   (with-current-buffer (process-buffer proc)
diff --git a/lisp/net/eudc-vars.el b/lisp/net/eudc-vars.el
index bb1474b..2306d7b 100644
--- a/lisp/net/eudc-vars.el
+++ b/lisp/net/eudc-vars.el
@@ -27,8 +27,6 @@
 
 ;;; Code:
 
-(require 'custom)
-
 ;;{{{      EUDC Main Custom Group
 
 (defgroup eudc nil
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 0c43fc6..ce49e32 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1832,7 +1832,7 @@ Use link at point if there is one, else the current 
page's URL."
         (suffix ""))
     (when (string-match "\\`\\(.*\\)\\([.][^.]+\\)" file)
       (setq stem (match-string 1 file)
-            suffix (match-string 2)))
+            suffix (match-string 2 file)))
     (while (file-exists-p (expand-file-name file directory))
       (setq file (format "%s(%d)%s" stem count suffix))
       (setq count (1+ count)))
diff --git a/lisp/net/imap.el b/lisp/net/imap.el
index 22b5908..0394f0e 100644
--- a/lisp/net/imap.el
+++ b/lisp/net/imap.el
@@ -1726,8 +1726,7 @@ See `imap-enable-exchange-bug-workaround'."
              (string-match "The specified message set is invalid"
                            (cadr data)))
         (with-current-buffer (or buffer (current-buffer))
-          (set (make-local-variable 'imap-enable-exchange-bug-workaround)
-               t)
+           (setq-local imap-enable-exchange-bug-workaround t)
           (imap-fetch (cdr uids) props receive nouidfetch))
        (signal (car data) (cdr data))))))
 
diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el
index 5639d52..0016af2 100644
--- a/lisp/net/ldap.el
+++ b/lisp/net/ldap.el
@@ -33,7 +33,6 @@
 
 ;;; Code:
 
-(require 'custom)
 (require 'password-cache)
 
 (autoload 'auth-source-search "auth-source")
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index 8777fe4..994a0bf 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -307,8 +307,8 @@ This variable is only used if the variable
 
 (define-derived-mode net-utils-mode special-mode "NetworkUtil"
   "Major mode for interacting with an external network utility."
-  (set (make-local-variable 'font-lock-defaults)
-       '((net-utils-font-lock-keywords)))
+  (setq-local font-lock-defaults
+              '((net-utils-font-lock-keywords)))
   (setq-local revert-buffer-function #'net-utils--revert-function))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -624,9 +624,8 @@ This command uses `nslookup-program' to look up DNS 
records."
 ;; Using a derived mode gives us keymaps, hooks, etc.
 (define-derived-mode nslookup-mode comint-mode "Nslookup"
   "Major mode for interacting with the nslookup program."
-  (set
-   (make-local-variable 'font-lock-defaults)
-   '((nslookup-font-lock-keywords)))
+  (setq-local font-lock-defaults
+              '((nslookup-font-lock-keywords)))
   (setq comint-prompt-regexp nslookup-prompt-regexp)
   (setq comint-input-autoexpand t))
 
@@ -971,10 +970,8 @@ The port is deduced from 
`network-connection-service-alist'."
   "Major mode for interacting with the network-connection program.")
 
 (defun network-connection-mode-setup (host service)
-  (make-local-variable 'network-connection-host)
-  (setq network-connection-host host)
-  (make-local-variable 'network-connection-service)
-  (setq network-connection-service service))
+  (setq-local network-connection-host host)
+  (setq-local network-connection-service service))
 
 ;;;###autoload
 (defun network-connection-to-service (host service)
diff --git a/lisp/net/newst-plainview.el b/lisp/net/newst-plainview.el
index d4c53b1..98f55a7 100644
--- a/lisp/net/newst-plainview.el
+++ b/lisp/net/newst-plainview.el
@@ -445,17 +445,17 @@ images."
   "NewsTicker"
   "Viewing news feeds in Emacs."
   (if (boundp 'tool-bar-map)
-      (set (make-local-variable 'tool-bar-map)
-           newsticker--plainview-tool-bar-map))
-  (set (make-local-variable 'imenu-sort-function) nil)
-  (set (make-local-variable 'scroll-conservatively) 999)
+      (setq-local tool-bar-map
+                  newsticker--plainview-tool-bar-map))
+  (setq-local imenu-sort-function nil)
+  (setq-local scroll-conservatively 999)
   (setq imenu-create-index-function 'newsticker--imenu-create-index)
   (setq imenu-default-goto-function 'newsticker--imenu-goto)
   (setq buffer-read-only t)
   (auto-fill-mode -1) ;; turn auto-fill off!
   (font-lock-mode -1) ;; turn off font-lock!!
-  (set (make-local-variable 'font-lock-defaults) nil)
-  (set (make-local-variable 'line-move-ignore-invisible) t)
+  (setq-local font-lock-defaults nil)
+  (setq-local line-move-ignore-invisible t)
   (setq mode-line-format
         (list "-"
               'mode-line-mule-info
@@ -533,7 +533,7 @@ Unless FORCE is t this is done only if necessary, i.e. when 
the
        (set-buffer-file-coding-system 'utf-8)
 
        (if newsticker-use-full-width
-           (set (make-local-variable 'fill-column) (1- (window-width))))
+           (setq-local fill-column (1- (window-width))))
        (newsticker--buffer-insert-all-items)
 
        ;; FIXME: needed for methods buffer in ecb
diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el
index ff8a447..30db1a3 100644
--- a/lisp/net/newst-treeview.el
+++ b/lisp/net/newst-treeview.el
@@ -719,9 +719,8 @@ for the button."
                               (window-width (newsticker--treeview-item-window))
                             fill-column))))
           (if newsticker-use-full-width
-              (set (make-local-variable 'fill-column) wwidth))
-          (set (make-local-variable 'fill-column) (min fill-column
-                                                       wwidth)))
+              (setq-local fill-column wwidth))
+          (setq-local fill-column (min fill-column wwidth)))
         (let ((desc (newsticker--desc item)))
           (insert "\n" (or desc "[No Description]")))
         (set-marker marker1 (1+ (point-min)))
@@ -2024,8 +2023,8 @@ Return t if groups have changed, nil otherwise."
   "Major mode for Newsticker Treeview.
 \\{newsticker-treeview-mode-map}"
   (if (boundp 'tool-bar-map)
-      (set (make-local-variable 'tool-bar-map)
-           newsticker-treeview-tool-bar-map))
+      (setq-local tool-bar-map
+                  newsticker-treeview-tool-bar-map))
   (setq buffer-read-only t
         truncate-lines t))
 
diff --git a/lisp/net/rlogin.el b/lisp/net/rlogin.el
index 766d644..6c960a1 100644
--- a/lisp/net/rlogin.el
+++ b/lisp/net/rlogin.el
@@ -208,10 +208,8 @@ variable."
     (unless (comint-check-proc buffer-name)
       (comint-exec buffer buffer-name rlogin-program nil args)
       (rlogin-mode)
-      (make-local-variable 'rlogin-host)
-      (setq rlogin-host host)
-      (make-local-variable 'rlogin-remote-user)
-      (setq rlogin-remote-user user)
+      (setq-local rlogin-host host)
+      (setq-local rlogin-remote-user user)
       (ignore-errors
         (cond ((eq rlogin-directory-tracking-mode t)
                ;; Do this here, rather than calling the tracking mode
diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el
index f98ded4..e8ef185 100644
--- a/lisp/net/secrets.el
+++ b/lisp/net/secrets.el
@@ -792,8 +792,8 @@ In this mode, widgets represent the search results.
 
 \\{secrets-mode-map}"
   (setq buffer-undo-list t)
-  (set (make-local-variable 'revert-buffer-function)
-       #'secrets-show-collections)
+  (setq-local revert-buffer-function
+              #'secrets-show-collections)
   ;; When we toggle, we must set temporary widgets.
   (add-hook 'tree-widget-after-toggle-functions
             #'secrets-tree-widget-after-toggle-function nil t))
diff --git a/lisp/net/sieve-mode.el b/lisp/net/sieve-mode.el
index 05e9747..b3d511c 100644
--- a/lisp/net/sieve-mode.el
+++ b/lisp/net/sieve-mode.el
@@ -185,16 +185,15 @@ inherits from C mode's and it has the same variables for 
customizing
 indentation.  It has its own abbrev table and its own syntax table.
 
 Turning on Sieve mode runs `sieve-mode-hook'."
-  (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter))
-  (set (make-local-variable 'paragraph-separate) paragraph-start)
-  (set (make-local-variable 'comment-start) "#")
-  (set (make-local-variable 'comment-end) "")
-  ;;(set (make-local-variable 'comment-start-skip) "\\(^\\|\\s-\\);?#+ *")
-  (set (make-local-variable 'comment-start-skip) "#+ *")
-  (set (make-local-variable 'syntax-propertize-function)
-       #'sieve-syntax-propertize)
-  (set (make-local-variable 'font-lock-defaults)
-       '(sieve-font-lock-keywords nil nil ((?_ . "w"))))
+  (setq-local paragraph-start (concat "$\\|" page-delimiter))
+  (setq-local paragraph-separate paragraph-start)
+  (setq-local comment-start "#")
+  (setq-local comment-end "")
+  ;; (setq-local comment-start-skip "\\(^\\|\\s-\\);?#+ *")
+  (setq-local comment-start-skip "#+ *")
+  (setq-local syntax-propertize-function #'sieve-syntax-propertize)
+  (setq-local font-lock-defaults
+              '(sieve-font-lock-keywords nil nil ((?_ . "w"))))
   (easy-menu-add-item nil nil sieve-mode-menu))
 
 (provide 'sieve-mode)
diff --git a/lisp/net/sieve.el b/lisp/net/sieve.el
index 75bb4e2..ae96134 100644
--- a/lisp/net/sieve.el
+++ b/lisp/net/sieve.el
@@ -272,8 +272,7 @@ Used to bracket operations which move point in the 
sieve-buffer."
   (let* ((port (or port sieve-manage-default-port))
          (header (format "Server : %s:%s\n\n" server port)))
     (insert header))
-  (set (make-local-variable 'sieve-buffer-header-end)
-       (point-max)))
+  (setq-local sieve-buffer-header-end (point-max)))
 
 (defun sieve-script-at-point (&optional pos)
   "Return name of sieve script at point POS, or nil."
@@ -304,8 +303,8 @@ Used to bracket operations which move point in the 
sieve-buffer."
   "Open SERVER (on PORT) and authenticate."
   (with-current-buffer
       (or ;; open server
-       (set (make-local-variable 'sieve-manage-buffer)
-           (sieve-manage-open server port))
+       (setq-local sieve-manage-buffer
+                   (sieve-manage-open server port))
        (error "Error opening server %s" server))
     (sieve-manage-authenticate)))
 
diff --git a/lisp/net/snmp-mode.el b/lisp/net/snmp-mode.el
index 76d9ced..df0fd1d 100644
--- a/lisp/net/snmp-mode.el
+++ b/lisp/net/snmp-mode.el
@@ -304,46 +304,34 @@ This is used during Tempo template completion."
   (setq local-abbrev-table abbrev)
 
   ;; Set up paragraphs (?)
-  (make-local-variable 'paragraph-start)
-  (setq paragraph-start (concat "$\\|" page-delimiter))
-  (make-local-variable 'paragraph-separate)
-  (setq paragraph-separate paragraph-start)
-  (make-local-variable 'paragraph-ignore-fill-prefix)
-  (setq paragraph-ignore-fill-prefix t)
+  (setq-local paragraph-start (concat "$\\|" page-delimiter))
+  (setq-local paragraph-separate paragraph-start)
+  (setq-local paragraph-ignore-fill-prefix t)
 
   ;; Set up comments
-  (make-local-variable 'comment-start)
-  (setq comment-start "-- ")
-  (make-local-variable 'comment-start-skip)
-  (setq comment-start-skip "--+[ \t]*")
-  (make-local-variable 'comment-column)
-  (setq comment-column 40)
-  (make-local-variable 'parse-sexp-ignore-comments)
-  (setq parse-sexp-ignore-comments t)
+  (setq-local comment-start "-- ")
+  (setq-local comment-start-skip "--+[ \t]*")
+  (setq-local comment-column 40)
+  (setq-local parse-sexp-ignore-comments t)
 
   ;; Set up indentation
   (if snmp-special-indent
-      (set (make-local-variable 'indent-line-function) 'snmp-indent-line))
-  (set (make-local-variable 'tab-always-indent) snmp-tab-always-indent)
+      (setq-local indent-line-function 'snmp-indent-line))
+  (setq-local tab-always-indent snmp-tab-always-indent)
 
   ;; Font Lock
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults (cons font-keywords '(nil nil ((?- . "w 1234")))))
+  (setq-local font-lock-defaults (cons font-keywords '(nil nil ((?- . "w 
1234")))))
 
   ;; Imenu
-  (make-local-variable 'imenu-create-index-function)
-  (setq imenu-create-index-function imenu-index)
+  (setq-local imenu-create-index-function imenu-index)
 
   ;; Tempo
   (tempo-use-tag-list tempo-tags)
-  (make-local-variable 'tempo-match-finder)
-  (setq tempo-match-finder "\\b\\(.+\\)\\=")
-  (make-local-variable 'tempo-interactive)
-  (setq tempo-interactive t)
+  (setq-local tempo-match-finder "\\b\\(.+\\)\\=")
+  (setq-local tempo-interactive t)
 
   ;; Miscellaneous customization
-  (make-local-variable 'require-final-newline)
-  (setq require-final-newline mode-require-final-newline))
+  (setq-local require-final-newline mode-require-final-newline))
 
 
 ;; SNMPv1 MIB Editing Mode.
@@ -370,14 +358,11 @@ Turning on snmp-mode runs the hooks in 
`snmp-common-mode-hook', then
                    'snmp-tempo-tags)
 
   ;; Completion lists
-  (make-local-variable 'snmp-mode-syntax-list)
-  (setq snmp-mode-syntax-list (append snmp-rfc1155-types
-                                     snmp-rfc1213-types
-                                     snmp-mode-syntax-list))
-  (make-local-variable 'snmp-mode-access-list)
-  (setq snmp-mode-access-list snmp-rfc1155-access)
-  (make-local-variable 'snmp-mode-status-list)
-  (setq snmp-mode-status-list snmp-rfc1212-status)
+  (setq-local snmp-mode-syntax-list (append snmp-rfc1155-types
+                                            snmp-rfc1213-types
+                                            snmp-mode-syntax-list))
+  (setq-local snmp-mode-access-list snmp-rfc1155-access)
+  (setq-local snmp-mode-status-list snmp-rfc1212-status)
 
   ;; Run hooks
   (run-mode-hooks 'snmp-common-mode-hook 'snmp-mode-hook))
@@ -405,14 +390,11 @@ then `snmpv2-mode-hook'."
                    'snmpv2-tempo-tags)
 
   ;; Completion lists
-  (make-local-variable 'snmp-mode-syntax-list)
-  (setq snmp-mode-syntax-list (append snmp-rfc1902-types
-                                     snmp-rfc1903-types
-                                     snmp-mode-syntax-list))
-  (make-local-variable 'snmp-mode-access-list)
-  (setq snmp-mode-access-list snmp-rfc1902-access)
-  (make-local-variable 'snmp-mode-status-list)
-  (setq snmp-mode-status-list snmp-rfc1902-status)
+  (setq-local snmp-mode-syntax-list (append snmp-rfc1902-types
+                                            snmp-rfc1903-types
+                                            snmp-mode-syntax-list))
+  (setq-local snmp-mode-access-list snmp-rfc1902-access)
+  (setq-local snmp-mode-status-list snmp-rfc1902-status)
 
   ;; Run hooks
   (run-mode-hooks 'snmp-common-mode-hook 'snmpv2-mode-hook))
diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el
index 29c415e..872c9f6 100644
--- a/lisp/net/telnet.el
+++ b/lisp/net/telnet.el
@@ -253,9 +253,9 @@ There is a variable `telnet-interrupt-string' which is the 
character
 sent to try to stop execution of a job on the remote host.
 Data is sent to the remote host when RET is typed."
   (setq-local revert-buffer-function 'telnet-revert-buffer)
-  (set (make-local-variable 'window-point-insertion-type) t)
-  (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern)
-  (set (make-local-variable 'comint-use-prompt-regexp) t))
+  (setq-local window-point-insertion-type t)
+  (setq-local comint-prompt-regexp telnet-prompt-pattern)
+  (setq-local comint-use-prompt-regexp t))
 
 ;;;###autoload
 (defun rsh (host)
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 51cb316..4947d16 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -217,7 +217,7 @@ ARGUMENTS to pass to the OPERATION."
         (lambda (line)
           (when (string-match "^\\(\\S-+\\)[[:space:]]+device$" line)
             ;; Replace ":" by "#".
-            `(nil ,(replace-regexp-in-string
+            `(nil ,(tramp-compat-string-replace
                     ":" tramp-prefix-port-format (match-string 1 line)))))
         (tramp-process-lines nil tramp-adb-program "devices"))))
 
@@ -1074,7 +1074,7 @@ E.g. a host name \"192.168.1.1#5555\" returns 
\"192.168.1.1:5555\"
     (let* ((host (tramp-file-name-host vec))
           (port (tramp-file-name-port-or-default vec))
           (devices (mapcar #'cadr (tramp-adb-parse-device-names nil))))
-      (replace-regexp-in-string
+      (tramp-compat-string-replace
        tramp-prefix-port-format ":"
        (cond ((member host devices) host)
             ;; This is the case when the host is connected to the default port.
@@ -1090,7 +1090,7 @@ E.g. a host name \"192.168.1.1#5555\" returns 
\"192.168.1.1:5555\"
                   (not (zerop (length host)))
                   (tramp-adb-execute-adb-command
                     vec "connect"
-                    (replace-regexp-in-string
+                    (tramp-compat-string-replace
                     tramp-prefix-port-format ":" host)))
              ;; When new device connected, running other adb command (e.g.
              ;; adb shell) immediately will fail.  To get around this
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 827d5f6..622116d 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -387,8 +387,7 @@ ESC or `q' to quit without changing further buffers,
           (switch-to-buffer buffer)
          (let* ((bfn (buffer-file-name))
                 (new-bfn (and (stringp bfn)
-                              (replace-regexp-in-string
-                               (regexp-quote source) target bfn)))
+                              (tramp-compat-string-replace source target bfn)))
                 (prompt (format-message
                          "Set visited file name to `%s' [Type yn!eq or %s] "
                          new-bfn (key-description (vector help-char)))))
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 7fae9ba..b44eabc 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -341,6 +341,13 @@ A nil value for either argument stands for the current 
time."
     (lambda ()
       (if (tramp-tramp-file-p default-directory) "/dev/null" null-device))))
 
+;; Function `string-replace' is new in Emacs 28.1.
+(defalias 'tramp-compat-string-replace
+  (if (fboundp 'string-replace)
+      #'string-replace
+    (lambda (fromstring tostring instring)
+      (replace-regexp-in-string (regexp-quote fromstring) tostring instring))))
+
 (add-hook 'tramp-unload-hook
          (lambda ()
            (unload-feature 'tramp-loaddefs 'force)
diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el
index 996a924..329a490 100644
--- a/lisp/net/tramp-ftp.el
+++ b/lisp/net/tramp-ftp.el
@@ -31,7 +31,6 @@
 (require 'tramp)
 
 ;; Pacify byte-compiler.
-(eval-when-compile (require 'custom))
 (defvar ange-ftp-ftp-name-arg)
 (defvar ange-ftp-ftp-name-res)
 (defvar ange-ftp-name-format)
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 098fba5..f3d03d0 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -108,8 +108,6 @@
 (require 'url-util)
 
 ;; Pacify byte-compiler.
-(eval-when-compile (require 'custom))
-
 (declare-function zeroconf-init "zeroconf")
 (declare-function zeroconf-list-service-types "zeroconf")
 (declare-function zeroconf-list-services "zeroconf")
@@ -1020,14 +1018,23 @@ file names."
          (with-tramp-progress-reporter
              v 0 (format "%s %s to %s" msg-operation filename newname)
            (unless
-               (apply
-                #'tramp-gvfs-send-command v gvfs-operation
-                (append
-                 (and (eq op 'copy) (or keep-date preserve-uid-gid)
-                      '("--preserve"))
-                 (list
-                  (tramp-gvfs-url-file-name filename)
-                  (tramp-gvfs-url-file-name newname))))
+               (and (apply
+                     #'tramp-gvfs-send-command v gvfs-operation
+                     (append
+                      (and (eq op 'copy) (or keep-date preserve-uid-gid)
+                           '("--preserve"))
+                      (list
+                       (tramp-gvfs-url-file-name filename)
+                       (tramp-gvfs-url-file-name newname))))
+                    ;; Some backends do not return a proper error
+                    ;; code in case of direct copy/move.  Apply sanity checks.
+                    (or (not equal-remote)
+                        (tramp-gvfs-send-command
+                         v "gvfs-info" (tramp-gvfs-url-file-name newname))
+                        (eq op 'copy)
+                        (not (tramp-gvfs-send-command
+                              v "gvfs-info"
+                              (tramp-gvfs-url-file-name filename)))))
 
              (if (or (not equal-remote)
                      (and equal-remote
@@ -1441,11 +1448,11 @@ If FILE-SYSTEM is non-nil, return file system 
attributes."
     (tramp-message proc 6 "%S\n%s" proc string)
     (setq string (concat rest-string string)
           ;; Fix action names.
-          string (replace-regexp-in-string
+          string (tramp-compat-string-replace
                  "attributes changed" "attribute-changed" string)
-          string (replace-regexp-in-string
+          string (tramp-compat-string-replace
                  "changes done" "changes-done-hint" string)
-          string (replace-regexp-in-string
+          string (tramp-compat-string-replace
                  "renamed to" "moved" string))
     ;; https://bugs.launchpad.net/bugs/1742946
     (when
@@ -2050,7 +2057,7 @@ and \"org.gtk.Private.RemoteVolumeMonitor.VolumeRemoved\" 
signals."
           (vec (make-tramp-file-name
                 :method "media"
                 ;; A host name cannot contain spaces.
-                :host (replace-regexp-in-string " " "_" (nth 1 volume))))
+                :host (tramp-compat-string-replace " " "_" (nth 1 volume))))
           (media (make-tramp-media-device
                   :method method
                   :host (tramp-gvfs-url-host (nth 5 volume))
@@ -2355,7 +2362,7 @@ VEC is used only for traces."
               (vec (make-tramp-file-name
                     :method "media"
                     ;; A host name cannot contain spaces.
-                    :host (replace-regexp-in-string " " "_" (nth 1 volume))))
+                    :host (tramp-compat-string-replace " " "_" (nth 1 
volume))))
               (media (make-tramp-media-device
                       :method method
                       :host (tramp-gvfs-url-host (nth 5 volume))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 2851110..137f085 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -480,7 +480,7 @@ The string is used in `tramp-methods'.")
 ;; Solaris: /usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin
 ;; GNU/Linux (Debian, Suse, RHEL): /bin:/usr/bin
 ;; FreeBSD, DragonFly: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"!
-;; Darwin: /usr/bin:/bin:/usr/sbin:/sbin
+;; FreeBSD 12.1, Darwin: /usr/bin:/bin:/usr/sbin:/sbin
 ;; IRIX64: /usr/bin
 ;; QNAP QTS: ---
 ;; Hydra: /run/current-system/sw/bin:/bin:/usr/bin
@@ -595,10 +595,12 @@ rm -f %t"
   "Shell function to implement `uudecode' to standard output.
 Many systems support `uudecode -o /dev/stdout' or `uudecode -o -'
 for this or `uudecode -p', but some systems don't, and for them
-we have this shell function.")
+we have this shell function.
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 (defconst tramp-perl-file-truename
-  "%s -e '
+  "%p -e '
 use File::Spec;
 use Cwd \"realpath\";
 
@@ -633,14 +635,14 @@ if (!$result) {
 
 $result =~ s/\"/\\\\\"/g;
 print \"\\\"$result\\\"\\n\";
-' \"$1\" 2>/dev/null"
+' \"$1\" %n"
   "Perl script to produce output suitable for use with `file-truename'
 on the remote file system.
-Escape sequence %s is replaced with name of Perl binary.
-This string is passed to `format', so percent characters need to be doubled.")
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 (defconst tramp-perl-file-name-all-completions
-  "%s -e '
+  "%p -e '
 opendir(d, $ARGV[0]) || die(\"$ARGV[0]: $!\\nfail\\n\");
 @files = readdir(d); closedir(d);
 foreach $f (@files) {
@@ -652,11 +654,11 @@ foreach $f (@files) {
  }
 }
 print \"ok\\n\"
-' \"$1\" 2>/dev/null"
+' \"$1\" %n"
   "Perl script to produce output suitable for use with
-`file-name-all-completions' on the remote file system.  Escape
-sequence %s is replaced with name of Perl binary.  This string is
-passed to `format', so percent characters need to be doubled.")
+`file-name-all-completions' on the remote file system.
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 ;; Perl script to implement `file-attributes' in a Lisp `read'able
 ;; output.  If you are hacking on this, note that you get *no* output
@@ -665,7 +667,7 @@ passed to `format', so percent characters need to be 
doubled.")
 ;; The device number is returned as "-1", because there will be a virtual
 ;; device number set in `tramp-sh-handle-file-attributes'.
 (defconst tramp-perl-file-attributes
-  "%s -e '
+  "%p -e '
 @stat = lstat($ARGV[0]);
 if (!@stat) {
     print \"nil\\n\";
@@ -702,14 +704,14 @@ printf(
     $stat[7],
     $stat[2],
     $stat[1]
-);' \"$1\" \"$2\" 2>/dev/null"
+);' \"$1\" \"$2\" %n"
   "Perl script to produce output suitable for use with `file-attributes'
 on the remote file system.
-Escape sequence %s is replaced with name of Perl binary.
-This string is passed to `format', so percent characters need to be doubled.")
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 (defconst tramp-perl-directory-files-and-attributes
-  "%s -e '
+  "%p -e '
 chdir($ARGV[0]) or printf(\"\\\"Cannot change to $ARGV[0]: $''!''\\\"\\n\"), 
exit();
 opendir(DIR,\".\") or printf(\"\\\"Cannot open directory $ARGV[0]: 
$''!''\\\"\\n\"), exit();
 @list = readdir(DIR);
@@ -754,31 +756,31 @@ for($i = 0; $i < $n; $i++)
         $stat[2],
         $stat[1]);
 }
-printf(\")\\n\");' \"$1\" \"$2\" 2>/dev/null"
+printf(\")\\n\");' \"$1\" \"$2\" %n"
   "Perl script implementing `directory-files-and-attributes' as Lisp `read'able
 output.
-Escape sequence %s is replaced with name of Perl binary.
-This string is passed to `format', so percent characters need to be doubled.")
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 ;; These two use base64 encoding.
 (defconst tramp-perl-encode-with-module
-  "%s -MMIME::Base64 -0777 -ne 'print encode_base64($_)' %n"
+  "%p -MMIME::Base64 -0777 -ne 'print encode_base64($_)' %n"
   "Perl program to use for encoding a file.
-Escape sequence %s is replaced with name of Perl binary.
-This string is passed to `format', so percent characters need to be doubled.
 This implementation requires the MIME::Base64 Perl module to be installed
-on the remote host.")
+on the remote host.
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 (defconst tramp-perl-decode-with-module
-  "%s -MMIME::Base64 -0777 -ne 'print decode_base64($_)' %n"
+  "%p -MMIME::Base64 -0777 -ne 'print decode_base64($_)' %n"
   "Perl program to use for decoding a file.
-Escape sequence %s is replaced with name of Perl binary.
-This string is passed to `format', so percent characters need to be doubled.
 This implementation requires the MIME::Base64 Perl module to be installed
-on the remote host.")
+on the remote host.
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 (defconst tramp-perl-encode
-  "%s -e '
+  "%p -e '
 # This script contributed by Juanma Barranquero <lektu@terra.es>.
 # Copyright (C) 2002-2020 Free Software Foundation, Inc.
 use strict;
@@ -813,11 +815,11 @@ while (read STDIN, $data, 54) {
                 qq(\\n);
 }' %n"
   "Perl program to use for encoding a file.
-Escape sequence %s is replaced with name of Perl binary.
-This string is passed to `format', so percent characters need to be doubled.")
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 (defconst tramp-perl-decode
-  "%s -e '
+  "%p -e '
 # This script contributed by Juanma Barranquero <lektu@terra.es>.
 # Copyright (C) 2002-2020 Free Software Foundation, Inc.
 use strict;
@@ -857,22 +859,25 @@ while (my $data = <STDIN>) {
     last if $finished;
 }' %n"
   "Perl program to use for decoding a file.
-Escape sequence %s is replaced with name of Perl binary.
-This string is passed to `format', so percent characters need to be doubled.")
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 (defconst tramp-perl-pack
-  "%s -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)'"
+  "%p -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)' %n"
   "Perl program to use for encoding a file.
-Escape sequence %s is replaced with name of Perl binary.")
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 (defconst tramp-perl-unpack
-  "%s -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)'"
+  "%p -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)' %n"
   "Perl program to use for decoding a file.
-Escape sequence %s is replaced with name of Perl binary.")
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 (defconst tramp-hexdump-encode "%h -v -e '16/1 \" %%02x\" \"\\n\"'"
   "`hexdump' program to use for encoding a file.
-This string is passed to `format', so percent characters need to be doubled.")
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 (defconst tramp-awk-encode
   "%a '\\
@@ -906,21 +911,24 @@ END {
   printf tail
 }'"
   "`awk' program to use for encoding a file.
-This string is passed to `format', so percent characters need to be doubled.")
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 (defconst tramp-hexdump-awk-encode
   (format "%s | %s" tramp-hexdump-encode tramp-awk-encode)
   "`hexdump' / `awk' pipe to use for encoding a file.
-This string is passed to `format', so percent characters need to be doubled.")
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 (defconst tramp-od-encode "%o -v -t x1 -A n"
   "`od' program to use for encoding a file.
-This string is passed to `format', so percent characters need to be doubled.")
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
-(defconst tramp-od-awk-encode
-  (format "%s | %s" tramp-od-encode tramp-awk-encode)
+(defconst tramp-od-awk-encode (format "%s | %s" tramp-od-encode 
tramp-awk-encode)
   "`od' / `awk' pipe to use for encoding a file.
-This string is passed to `format', so percent characters need to be doubled.")
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 (defconst tramp-awk-decode
   "%a '\\
@@ -946,7 +954,8 @@ BEGIN {
   }
 }'"
   "Awk program to use for decoding a file.
-This string is passed to `format', so percent characters need to be doubled.")
+Format specifiers are replaced by `tramp-expand-script', percent
+characters need to be doubled.")
 
 (defconst tramp-vc-registered-read-file-names
   "echo \"(\"
@@ -968,7 +977,8 @@ echo \")\""
 It must be send formatted with two strings; the tests for file
 existence, and file readability.  Input shall be read via
 here-document, otherwise the command could exceed maximum length
-of command line.")
+of command line.
+Format specifiers \"%s\" are replaced before the script is used.")
 
 ;; New handlers should be added here.
 ;;;###tramp-autoload
@@ -3296,7 +3306,9 @@ implementation will be used."
                  ;; correctly.  Unset `file-name-handler-alist'.
                  ;; Otherwise, epa-file gets confused.
                  (let (file-name-handler-alist
-                       (coding-system-for-write 'binary))
+                       (coding-system-for-write 'binary)
+                       (default-directory
+                         (tramp-compat-temporary-file-directory)))
                    (with-temp-file tmpfile
                      (set-buffer-multibyte nil)
                      (insert-buffer-substring (tramp-get-buffer v))
@@ -3764,7 +3776,7 @@ Fall back to normal file name handler if no Tramp handler 
exists."
              ;; Make events a list of symbols.
              events
              (mapcar
-              (lambda (x) (intern-soft (replace-regexp-in-string "_" "-" x)))
+              (lambda (x) (intern-soft (tramp-compat-string-replace "_" "-" 
x)))
               (split-string events "," 'omit))))
        ;; "gio monitor".
        ((setq command (tramp-get-remote-gio-monitor v))
@@ -3836,11 +3848,11 @@ Fall back to normal file name handler if no Tramp 
handler exists."
     (tramp-message proc 6 "%S\n%s" proc string)
     (setq string (concat rest-string string)
           ;; Fix action names.
-          string (replace-regexp-in-string
+          string (tramp-compat-string-replace
                  "attributes changed" "attribute-changed" string)
-          string (replace-regexp-in-string
+          string (tramp-compat-string-replace
                  "changes done" "changes-done-hint" string)
-          string (replace-regexp-in-string
+          string (tramp-compat-string-replace
                  "renamed to" "moved" string))
     ;; https://bugs.launchpad.net/bugs/1742946
     (when
@@ -3848,7 +3860,7 @@ Fall back to normal file name handler if no Tramp handler 
exists."
       (delete-process proc))
 
     ;; Delete empty lines.
-    (setq string (replace-regexp-in-string "\n\n" "\n" string))
+    (setq string (tramp-compat-string-replace "\n\n" "\n" string))
 
     (while (string-match
            (eval-when-compile
@@ -3896,7 +3908,7 @@ Fall back to normal file name handler if no Tramp handler 
exists."
     (tramp-message proc 6 "%S\n%s" proc string)
     (setq string (concat rest-string string)
          ;; Attribute change is returned in unused wording.
-         string (replace-regexp-in-string
+         string (tramp-compat-string-replace
                  "ATTRIB CHANGED" "ATTRIBUTE_CHANGED" string))
 
     (while (string-match
@@ -3913,7 +3925,7 @@ Fall back to normal file name handler if no Tramp handler 
exists."
               proc
               (list
                (intern-soft
-                (replace-regexp-in-string
+                (tramp-compat-string-replace
                  "_" "-" (downcase (match-string 4 string)))))
               ;; File names are returned as absolute paths.  We must
               ;; add the remote prefix.
@@ -3952,7 +3964,7 @@ Fall back to normal file name handler if no Tramp handler 
exists."
              (mapcar
               (lambda (x)
                 (intern-soft
-                 (replace-regexp-in-string "_" "-" (downcase x))))
+                 (tramp-compat-string-replace "_" "-" (downcase x))))
               (split-string (match-string 1 line) "," 'omit))
              (or (match-string 3 line)
                  (file-name-nondirectory (process-get proc 'watch-name))))))
@@ -3994,6 +4006,51 @@ Fall back to normal file name handler if no Tramp 
handler exists."
 
 ;;; Internal Functions:
 
+(defun tramp-expand-script (vec script)
+  "Expand SCRIPT with remote files or commands.
+\"%a\", \"%h\", \"%o\" and \"%p\" format specifiers are replaced
+by the respective `awk', `hexdump', `od' and `perl' commands.
+\"%n\" is replaced by \"2>/dev/null\", and \"%t\" is replaced by
+a temporary file name.
+If VEC is nil, the respective local commands are used.
+If there is a format specifier which cannot be expanded, this
+function returns nil."
+  (if (not (string-match-p "\\(^\\|[^%]\\)%[ahnopt]" script))
+      script
+    (catch 'wont-work
+      (let ((awk (when (string-match-p "\\(^\\|[^%]\\)%a" script)
+                  (or
+                   (if vec (tramp-get-remote-awk vec) (executable-find "awk"))
+                   (throw 'wont-work nil))))
+           (hdmp (when (string-match-p "\\(^\\|[^%]\\)%h" script)
+                   (or
+                    (if vec (tramp-get-remote-hexdump vec)
+                      (executable-find "hexdump"))
+                    (throw 'wont-work nil))))
+           (dev (when (string-match-p "\\(^\\|[^%]\\)%n" script)
+                  (or
+                   (if vec (concat "2>" (tramp-get-remote-null-device vec))
+                     (if (eq system-type 'windows-nt) ""
+                       (concat "2>" null-device)))
+                   (throw 'wont-work nil))))
+           (od (when (string-match-p "\\(^\\|[^%]\\)%o" script)
+                 (or (if vec (tramp-get-remote-od vec) (executable-find "od"))
+                     (throw 'wont-work nil))))
+           (perl (when (string-match-p "\\(^\\|[^%]\\)%p" script)
+                   (or
+                    (if vec
+                        (tramp-get-remote-perl vec) (executable-find "perl"))
+                    (throw 'wont-work nil))))
+           (tmp (when (string-match-p "\\(^\\|[^%]\\)%t" script)
+                  (or
+                   (if vec
+                       (tramp-file-local-name (tramp-make-tramp-temp-name vec))
+                     (tramp-compat-make-temp-name))
+                   (throw 'wont-work nil)))))
+       (format-spec
+        script
+        (format-spec-make ?a awk ?h hdmp ?n dev ?o od ?p perl ?t tmp))))))
+
 (defun tramp-maybe-send-script (vec script name)
   "Define in remote shell function NAME implemented as SCRIPT.
 Only send the definition if it has not already been done."
@@ -4006,16 +4063,17 @@ Only send the definition if it has not already been 
done."
          vec 5 (format-message "Sending script `%s'" name)
        ;; In bash, leading TABs like in `tramp-vc-registered-read-file-names'
        ;; could result in unwanted command expansion.  Avoid this.
-       (setq script (replace-regexp-in-string
+       (setq script (tramp-compat-string-replace
                      (make-string 1 ?\t) (make-string 8 ? ) script))
-       ;; The script could contain a call of Perl.  This is masked with `%s'.
-       (when (and (string-match-p "%s" script)
-                  (not (tramp-get-remote-perl vec)))
-         (tramp-error vec 'file-error "No Perl available on remote host"))
+       ;; Expand format specifiers.
+       (unless (setq script (tramp-expand-script vec script))
+         (tramp-error
+          vec 'file-error
+          (format "Script %s is not applicable on remote host" name)))
+       ;; Send it.
        (tramp-barf-unless-okay
         vec
-        (format "%s () {\n%s\n}"
-                name (format script (tramp-get-remote-perl vec)))
+        (format "%s () {\n%s\n}" name script)
         "Script %s sending failed" name)
        (tramp-set-connection-property
         (tramp-get-connection-process vec) "scripts" (cons name scripts))))))
@@ -4523,7 +4581,7 @@ process to set up.  VEC specifies the connection."
 (defconst tramp-local-coding-commands
   `((b64 base64-encode-region base64-decode-region)
     (uu  tramp-uuencode-region uudecode-decode-region)
-    (pack ,(format tramp-perl-pack "perl") ,(format tramp-perl-unpack "perl")))
+    (pack ,tramp-perl-pack ,tramp-perl-unpack))
   "List of local coding commands for inline transfer.
 Each item is a list that looks like this:
 
@@ -4613,6 +4671,8 @@ Goes through the list `tramp-local-coding-commands' and
                 vec 5 "Checking local encoding function `%s'" loc-enc)
              (tramp-message
               vec 5 "Checking local encoding command `%s' for sanity" loc-enc)
+             (unless (stringp (setq loc-enc (tramp-expand-script nil loc-enc)))
+               (throw 'wont-work-local nil))
              (unless (zerop (tramp-call-local-coding-command loc-enc nil nil))
                (throw 'wont-work-local nil)))
            (if (not (stringp loc-dec))
@@ -4620,6 +4680,8 @@ Goes through the list `tramp-local-coding-commands' and
                 vec 5 "Checking local decoding function `%s'" loc-dec)
              (tramp-message
               vec 5 "Checking local decoding command `%s' for sanity" loc-dec)
+             (unless (stringp (setq loc-dec (tramp-expand-script nil loc-dec)))
+               (throw 'wont-work-local nil))
              (unless (zerop (tramp-call-local-coding-command loc-dec nil nil))
                (throw 'wont-work-local nil)))
            ;; Search for remote coding commands with the same format
@@ -4647,35 +4709,8 @@ Goes through the list `tramp-local-coding-commands' and
                  (unless (stringp rem-enc)
                    (let ((name (symbol-name rem-enc))
                          (value (symbol-value rem-enc)))
-                     ;; Check if remote perl exists when necessary.
-                     (and (string-match-p "perl" name)
-                          (not (tramp-get-remote-perl vec))
-                          (throw 'wont-work-remote nil))
-                     ;; Check if remote awk exists when necessary.
-                     (and (string-match-p "\\(^\\|[^%]\\)%a" value)
-                          (not (tramp-get-remote-awk vec))
-                          (throw 'wont-work-remote nil))
-                     ;; Check if remote hexdump exists when necessary.
-                     (and (string-match-p "\\(^\\|[^%]\\)%h" value)
-                          (not (tramp-get-remote-hexdump vec))
-                          (throw 'wont-work-remote nil))
-                     ;; Check if remote od exists when necessary.
-                     (and (string-match-p "\\(^\\|[^%]\\)%o" value)
-                          (not (tramp-get-remote-od vec))
-                          (throw 'wont-work-remote nil))
                      (while (string-match "-" name)
                        (setq name (replace-match "_" nil t name)))
-                     (when (string-match-p "\\(^\\|[^%]\\)%[aho]" value)
-                       (setq value
-                             (format-spec
-                              value
-                              (format-spec-make
-                               ?a (tramp-get-remote-awk vec)
-                               ?h (tramp-get-remote-hexdump vec)
-                               ?n (concat
-                                    "2>" (tramp-get-remote-null-device vec))
-                               ?o (tramp-get-remote-od vec)))
-                             value (replace-regexp-in-string "%" "%%" value)))
                      (tramp-maybe-send-script vec value name)
                      (setq rem-enc name)))
                  (tramp-message
@@ -4690,28 +4725,9 @@ Goes through the list `tramp-local-coding-commands' and
 
                  (unless (stringp rem-dec)
                    (let ((name (symbol-name rem-dec))
-                         (value (symbol-value rem-dec))
-                         tmpfile)
+                         (value (symbol-value rem-dec)))
                      (while (string-match "-" name)
                        (setq name (replace-match "_" nil t name)))
-                     (when (string-match-p "\\(^\\|[^%]\\)%[aho]" value)
-                       (setq value
-                             (format-spec
-                              value
-                              (format-spec-make
-                               ?a (tramp-get-remote-awk vec)
-                               ?h (tramp-get-remote-hexdump vec)
-                               ?n (concat
-                                    "2>" (tramp-get-remote-null-device vec))
-                               ?o (tramp-get-remote-od vec)))
-                             value (replace-regexp-in-string "%" "%%" value)))
-                     (when (string-match-p "\\(^\\|[^%]\\)%t" value)
-                       (setq tmpfile (tramp-make-tramp-temp-name vec)
-                             value
-                             (format-spec
-                              value
-                              (format-spec-make
-                               ?t (tramp-file-local-name tmpfile)))))
                      (tramp-maybe-send-script vec value name)
                      (setq rem-dec name)))
                  (tramp-message
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index cafa97c..e521371 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -464,8 +464,8 @@ pass to the OPERATION."
 
            (let* ((share (tramp-smb-get-share v))
                   (localname (file-name-as-directory
-                              (replace-regexp-in-string
-                               "\\\\" "/" (tramp-smb-get-localname v))))
+                              (tramp-compat-string-replace
+                               "\\" "/" (tramp-smb-get-localname v))))
                   (tmpdir    (tramp-compat-make-temp-name))
                   (args      (list (concat "//" host "/" share) "-E"))
                   (options   tramp-smb-options))
@@ -777,8 +777,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
       (with-tramp-file-property v localname "file-acl"
        (when (executable-find tramp-smb-acl-program)
          (let* ((share     (tramp-smb-get-share v))
-                (localname (replace-regexp-in-string
-                            "\\\\" "/" (tramp-smb-get-localname v)))
+                (localname (tramp-compat-string-replace
+                            "\\" "/" (tramp-smb-get-localname v)))
                 (args      (list (concat "//" host "/" share) "-E"))
                 (options   tramp-smb-options))
 
@@ -1445,10 +1445,10 @@ component is used as the target of the symlink."
 
       (when (and (stringp acl-string) (executable-find tramp-smb-acl-program))
        (let* ((share     (tramp-smb-get-share v))
-              (localname (replace-regexp-in-string
-                          "\\\\" "/" (tramp-smb-get-localname v)))
+              (localname (tramp-compat-string-replace
+                          "\\" "/" (tramp-smb-get-localname v)))
               (args      (list (concat "//" host "/" share) "-E" "-S"
-                               (replace-regexp-in-string
+                               (tramp-compat-string-replace
                                 "\n" "," acl-string)))
               (options   tramp-smb-options))
 
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 6ae79be..b3853aa 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -112,6 +112,13 @@ Any level x includes messages for all levels 1 .. x-1.  
The levels are
 10  traces (huge)."
   :type 'integer)
 
+(defcustom tramp-debug-to-file nil
+  "Whether Tramp debug messages shall be saved to file.
+The debug file has the same name as the debug buffer, written to
+`temporary-file-directory'."
+  :version "28.1"
+  :type 'boolean)
+
 (defcustom tramp-backup-directory-alist nil
   "Alist of filename patterns and backup directory names.
 Each element looks like (REGEXP . DIRECTORY), with the same meaning like
@@ -1722,8 +1729,7 @@ The outline level is equal to the verbosity of the Tramp 
message."
 
 (defun tramp-get-debug-buffer (vec)
   "Get the debug buffer for VEC."
-  (with-current-buffer
-      (get-buffer-create (tramp-debug-buffer-name vec))
+  (with-current-buffer (get-buffer-create (tramp-debug-buffer-name vec))
     (when (bobp)
       (setq buffer-undo-list t)
       ;; Activate `outline-mode'.  This runs `text-mode-hook' and
@@ -1732,67 +1738,83 @@ The outline level is equal to the verbosity of the 
Tramp message."
       ;; `(custom-declare-variable outline-minor-mode-prefix ...)'
       ;; raises on error in `(outline-mode)', we don't want to see it
       ;; in the traces.
-      (let ((default-directory (tramp-compat-temporary-file-directory))
-           signal-hook-function)
+      (let ((default-directory (tramp-compat-temporary-file-directory)))
        (outline-mode))
-      (set (make-local-variable 'outline-level) 'tramp-debug-outline-level)
-      (set (make-local-variable 'font-lock-keywords)
-          `(t (eval ,tramp-debug-font-lock-keywords)
-              ,(eval tramp-debug-font-lock-keywords)))
+      (setq-local outline-level 'tramp-debug-outline-level)
+      (setq-local font-lock-keywords
+                  `(t (eval ,tramp-debug-font-lock-keywords)
+                      ,(eval tramp-debug-font-lock-keywords)))
       ;; Do not edit the debug buffer.
       (use-local-map special-mode-map))
     (current-buffer)))
 
+(defun tramp-get-debug-file-name (vec)
+  "Get the debug buffer for VEC."
+  (expand-file-name
+   (tramp-compat-string-replace "/" " " (tramp-debug-buffer-name vec))
+   (tramp-compat-temporary-file-directory)))
+
 (defsubst tramp-debug-message (vec fmt-string &rest arguments)
   "Append message to debug buffer of VEC.
 Message is formatted with FMT-STRING as control string and the remaining
 ARGUMENTS to actually emit the message (if applicable)."
-  (with-current-buffer (tramp-get-debug-buffer vec)
-    (goto-char (point-max))
-    ;; Headline.
-    (when (bobp)
-      (insert
-       (format
-       ";; Emacs: %s Tramp: %s -*- mode: outline; -*-"
-       emacs-version tramp-version))
-      (when (>= tramp-verbose 10)
-       (let ((tramp-verbose 0))
+  (let ((inhibit-message t)
+       file-name-handler-alist message-log-max signal-hook-function)
+    (with-current-buffer (tramp-get-debug-buffer vec)
+      (goto-char (point-max))
+      (let ((point (point)))
+       ;; Headline.
+       (when (bobp)
          (insert
           (format
-           "\n;; Location: %s Git: %s/%s"
-           (locate-library "tramp")
-           (or tramp-repository-branch "")
-           (or tramp-repository-version ""))))))
-    (unless (bolp)
-      (insert "\n"))
-    ;; Timestamp.
-    (let ((now (current-time)))
-      (insert (format-time-string "%T." now))
-      (insert (format "%06d " (nth 2 now))))
-    ;; Calling Tramp function.  We suppress compat and trace functions
-    ;; from being displayed.
-    (let ((btn 1) btf fn)
-      (while (not fn)
-       (setq btf (nth 1 (backtrace-frame btn)))
-       (if (not btf)
-           (setq fn "")
-         (and (symbolp btf) (setq fn (symbol-name btf))
-              (or (not (string-match-p "^tramp" fn))
-                  (get btf 'tramp-suppress-trace))
-              (setq fn nil))
-         (setq btn (1+ btn))))
-      ;; The following code inserts filename and line number.  Should
-      ;; be inactive by default, because it is time consuming.
-;      (let ((ffn (find-function-noselect (intern fn))))
-;      (insert
-;       (format
-;        "%s:%d: "
-;        (file-name-nondirectory (buffer-file-name (car ffn)))
-;        (with-current-buffer (car ffn)
-;          (1+ (count-lines (point-min) (cdr ffn)))))))
-      (insert (format "%s " fn)))
-    ;; The message.
-    (insert (apply #'format-message fmt-string arguments))))
+           ";; Emacs: %s Tramp: %s -*- mode: outline; -*-"
+           emacs-version tramp-version))
+         (when (>= tramp-verbose 10)
+           (let ((tramp-verbose 0))
+             (insert
+              (format
+               "\n;; Location: %s Git: %s/%s"
+               (locate-library "tramp")
+               (or tramp-repository-branch "")
+               (or tramp-repository-version "")))))
+         ;; Delete debug file.
+         (when (and tramp-debug-to-file (tramp-get-debug-file-name vec))
+           (ignore-errors (delete-file (tramp-get-debug-file-name vec)))))
+       (unless (bolp)
+         (insert "\n"))
+       ;; Timestamp.
+       (let ((now (current-time)))
+         (insert (format-time-string "%T." now))
+         (insert (format "%06d " (nth 2 now))))
+       ;; Calling Tramp function.  We suppress compat and trace
+       ;; functions from being displayed.
+       (let ((btn 1) btf fn)
+         (while (not fn)
+           (setq btf (nth 1 (backtrace-frame btn)))
+           (if (not btf)
+               (setq fn "")
+             (and (symbolp btf) (setq fn (symbol-name btf))
+                  (or (not (string-match-p "^tramp" fn))
+                      (get btf 'tramp-suppress-trace))
+                  (setq fn nil))
+             (setq btn (1+ btn))))
+         ;; The following code inserts filename and line number.
+         ;; Should be inactive by default, because it is time consuming.
+         ;; (let ((ffn (find-function-noselect (intern fn))))
+         ;;   (insert
+         ;;    (format
+         ;;     "%s:%d: "
+         ;;     (file-name-nondirectory (buffer-file-name (car ffn)))
+         ;;     (with-current-buffer (car ffn)
+         ;;       (1+ (count-lines (point-min) (cdr ffn)))))))
+         (insert (format "%s " fn)))
+       ;; The message.
+       (insert (apply #'format-message fmt-string arguments))
+       ;; Write message to debug file.
+       (when tramp-debug-to-file
+         (ignore-errors
+           (write-region
+            point (point-max) (tramp-get-debug-file-name vec) 'append)))))))
 
 (put #'tramp-debug-message 'tramp-suppress-trace t)
 
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 8d21133..d6b582e 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -92,7 +92,7 @@
         ("2.2.13.25.2" . "25.3")
          ("2.3.3" . "26.1") ("2.3.3.26.1" . "26.1") ("2.3.5.26.2" . "26.2")
          ("2.3.5.26.3" . "26.3")
-         ("2.4.3.27.1" . "27.1")))
+         ("2.4.3.27.1" . "27.1") ("2.4.5.27.2" . "27.2")))
 
 (add-hook 'tramp-unload-hook
          (lambda ()
diff --git a/lisp/nxml/xsd-regexp.el b/lisp/nxml/xsd-regexp.el
index 622ba91..3ce59b7 100644
--- a/lisp/nxml/xsd-regexp.el
+++ b/lisp/nxml/xsd-regexp.el
@@ -387,9 +387,15 @@ consisting of a single char alternative delimited with []."
                        ((eq first ?-)
                         (setq hyphen t)
                         (setq first (1+ first)))
+                       ((eq last ?-)
+                        (setq hyphen t)
+                        (setq last (1- last)))
                        ((eq first ?\])
                         (setq close-bracket t)
-                        (setq first (1+ first))))
+                        (setq first (1+ first)))
+                       ((eq last ?\])
+                        (setq close-bracket t)
+                        (setq last (1- last))))
                  (<= first last)))
       (when (<= first last)
        (setq chars
diff --git a/lisp/obsolete/cl-compat.el b/lisp/obsolete/cl-compat.el
index b247152..c37fc8e 100644
--- a/lisp/obsolete/cl-compat.el
+++ b/lisp/obsolete/cl-compat.el
@@ -111,8 +111,9 @@
 (defun build-klist (arglist keys &optional allow-others)
   (let ((res (Multiple-value-call 'mapcar* 'cons (unzip-lists arglist))))
     (or allow-others
-       (let ((bad (set-difference (mapcar 'car res) keys)))
-         (if bad (error "Bad keywords: %s not in %s" bad keys))))
+        (with-suppressed-warnings ((obsolete set-difference))
+          (let ((bad (set-difference (mapcar 'car res) keys)))
+            (if bad (error "Bad keywords: %s not in %s" bad keys)))))
     res))
 
 (defun extract-from-klist (klist key &optional def)
@@ -130,16 +131,18 @@
       (funcall (or test 'eql) item elt))))
 
 (defun safe-idiv (a b)
-  (let* ((q (/ (abs a) (abs b)))
-         (s (* (signum a) (signum b))))
-    (Values q (- a (* s q b)) s)))
+  (with-suppressed-warnings ((obsolete signum))
+    (let* ((q (/ (abs a) (abs b)))
+           (s (* (signum a) (signum b))))
+      (Values q (- a (* s q b)) s))))
 
 
 ;; Internal routines.
 
 (defun pair-with-newsyms (oldforms)
-  (let ((newsyms (mapcar (lambda (x) (make-symbol "--cl-var--")) oldforms)))
-    (Values (mapcar* 'list newsyms oldforms) newsyms)))
+  (with-suppressed-warnings ((obsolete mapcar*))
+    (let ((newsyms (mapcar (lambda (x) (make-symbol "--cl-var--")) oldforms)))
+      (Values (mapcar* 'list newsyms oldforms) newsyms))))
 
 (defun zip-lists (evens odds)
   (cl-mapcan 'list evens odds))
diff --git a/lisp/obsolete/cl.el b/lisp/obsolete/cl.el
index 20bffff..6a628f3 100644
--- a/lisp/obsolete/cl.el
+++ b/lisp/obsolete/cl.el
@@ -113,7 +113,7 @@
                most-positive-float
                ;; custom-print-functions
                ))
-  (defvaralias var (intern (format "cl-%s" var))))
+  (define-obsolete-variable-alias var (intern (format "cl-%s" var)) "27.1"))
 
 (dolist (fun '(
                (get* . cl-get)
@@ -291,7 +291,7 @@
                ))
   (let ((new (if (consp fun) (prog1 (cdr fun) (setq fun (car fun)))
                (intern (format "cl-%s" fun)))))
-    (defalias fun new)))
+    (define-obsolete-function-alias fun new "27.1")))
 
 (defun cl--wrap-in-nil-block (fun &rest args)
   `(cl-block nil ,(apply fun args)))
diff --git a/lisp/obsolete/terminal.el b/lisp/obsolete/terminal.el
index 6ee53af..3d73c03 100644
--- a/lisp/obsolete/terminal.el
+++ b/lisp/obsolete/terminal.el
@@ -44,6 +44,7 @@
 ;;>>   more-processing enabled.
 
 (require 'ehelp)
+(require 'shell)
 
 (defgroup terminal nil
   "Terminal emulator for Emacs."
@@ -1056,12 +1057,6 @@ move to start of new line, clear to end of line."
 ;; This used to have `new' in it, but that loses outside BSD
 ;; and it's apparently not needed in BSD.
 
-(defcustom explicit-shell-file-name nil
-  "If non-nil, is file name to use for explicitly requested inferior shell."
-  :type '(choice (const :tag "None" nil)
-                file)
-  :group 'terminal)
-
 ;;;###autoload
 (defun terminal-emulator (buffer program args &optional width height)
   "Under a display-terminal emulator in BUFFER, run PROGRAM on arguments ARGS.
diff --git a/lisp/org/org.el b/lisp/org/org.el
index de7dded..5dc9fa9 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -5004,8 +5004,6 @@ the rounding returns a past time."
 
 ;;;; Font-Lock stuff, including the activators
 
-(require 'font-lock)
-
 (defconst org-match-sexp-depth 3
   "Number of stacked braces for sub/superscript matching.")
 
diff --git a/lisp/play/decipher.el b/lisp/play/decipher.el
index 7a7f96c..674ddce 100644
--- a/lisp/play/decipher.el
+++ b/lisp/play/decipher.el
@@ -292,8 +292,8 @@ The most useful commands are:
   (set-syntax-table decipher-mode-syntax-table)
   (unless (= (point-min) (point-max))
     (decipher-read-alphabet))
-  (set (make-local-variable 'font-lock-defaults)
-       '(decipher-font-lock-keywords t))
+  (setq-local font-lock-defaults
+              '(decipher-font-lock-keywords t))
   ;; Make the buffer writable when we exit Decipher mode:
   (add-hook 'change-major-mode-hook
             (lambda () (setq buffer-read-only nil
diff --git a/lisp/play/doctor.el b/lisp/play/doctor.el
index a6f9288..8fc207d 100644
--- a/lisp/play/doctor.el
+++ b/lisp/play/doctor.el
@@ -145,399 +145,399 @@ reads the sentence before point, and prints the 
Doctor's answer."
   (insert "\n"))
 
 (defun make-doctor-variables ()
-  (set (make-local-variable 'doctor--typos)
-       (mapcar (lambda (x)
-                (put (car x) 'doctor-correction  (cadr x))
-                (put (cadr x) 'doctor-expansion (car (cddr x)))
-                (car x))
-              '((theyll they\'ll (they will))
-                (theyre they\'re (they are))
-                (hes he\'s (he is))
-                (he7s he\'s (he is))
-                (im i\'m (you are))
-                (i7m i\'m (you are))
-                (isa is\ a (is a))
-                (thier their (their))
-                (dont don\'t (do not))
-                (don7t don\'t (do not))
-                (you7re you\'re (i am))
-                (you7ve you\'ve (i have))
-                (you7ll you\'ll (i will)))))
-  (set (make-local-variable 'doctor-sent) nil)
-  (set (make-local-variable 'doctor-found) nil)
-  (set (make-local-variable 'doctor-owner) nil)
-  (set (make-local-variable 'doctor--history) nil)
-  (set (make-local-variable 'doctor--inter) '((well\,)
-                                     (hmmm \.\.\.\ so\,)
-                                     (so)
-                                     (\.\.\.and)
-                                     (then)))
-  (set (make-local-variable 'doctor--continue) '((continue)
-                                                (proceed)
-                                                (go on)
-                                                (keep going)))
-  (set (make-local-variable 'doctor--relation)
-       '((your relationship with)
-        (something you remember about)
-        (your feelings toward)
-        (some experiences you have had with)
-        (how you feel about)))
-  (set (make-local-variable 'doctor--fears)
-       '(((doc$ doctor--whysay) you are (doc$ doctor--afraidof) (doc// 
doctor--feared) \?)
-        (you seem terrified by (doc// doctor--feared) \.)
-        (when did you first feel (doc$ doctor--afraidof) (doc// 
doctor--feared) \?)))
-  (set (make-local-variable 'doctor--sure) '((sure)
-                                            (positive)
-                                            (certain)
-                                            (absolutely sure)))
-  (set (make-local-variable 'doctor--afraidof) '((afraid of)
-                                        (frightened by)
-                                        (scared of)))
-  (set (make-local-variable 'doctor--areyou) '((are you)
-                                      (have you been)
-                                      (have you been)))
-  (set (make-local-variable 'doctor--isrelated)
-       '((has something to do with)
-        (is related to)
-        (could be the reason for)
-        (is caused by)
-        (is because of)))
-  (set (make-local-variable 'doctor--arerelated) '((have something to do with)
-                                          (are related to)
-                                          (could have caused)
-                                          (could be the reason for)
-                                          (are caused by)
-                                          (are because of)))
-  (set (make-local-variable 'doctor--moods)
-       '(((doc$ doctor--areyou) (doc// doctor-found) often \?)
-        (what causes you to be (doc// doctor-found) \?)
-        ((doc$ doctor--whysay) you are (doc// doctor-found) \?)))
-  (set (make-local-variable 'doctor--maybe) '((maybe)
-                                     (perhaps)
-                                     (possibly)))
-  (set (make-local-variable 'doctor--whatwhen) '((what happened when)
-                                                (what would happen if)))
-  (set (make-local-variable 'doctor--hello) '((how do you do \?)
-                                     (hello \.)
-                                     (howdy!)
-                                     (hello \.)
-                                     (hi \.)
-                                     (hi there \.)))
-  (set (make-local-variable 'doctor--drnk)
-       '((do you drink a lot of (doc// doctor-found) \?)
-        (do you get drunk often \?)
-        ((doc$ doctor--describe) your drinking habits \.)))
-  (set (make-local-variable 'doctor--drugs)
-       '((do you use (doc// doctor-found) often \?)
-        ((doc$ doctor--areyou) addicted to (doc// doctor-found) \?)
-        (do you realize that drugs can be very harmful \?)
-        ((doc$ doctor--maybe) you should try to quit using (doc// 
doctor-found) \.)))
-  (set (make-local-variable 'doctor--whywant)
-       '(((doc$ doctor--whysay) (doc// doctor-subj) might (doc$ doctor--want) 
(doc// doctor-obj) \?)
-        (how does it feel to want \?)
-        (why should (doc// doctor-subj) get (doc// doctor-obj) \?)
-        (when did (doc// doctor-subj) first (doc$ doctor--want) (doc// 
doctor-obj) \?)
-        ((doc$ doctor--areyou) obsessed with (doc// doctor-obj) \?)
-        (why should i give (doc// doctor-obj) to (doc// doctor-subj) \?)
-        (have you ever gotten (doc// doctor-obj) \?)))
-  (set (make-local-variable 'doctor--canyou)
-       '((of course i can \.)
-        (why should i \?)
-        (what makes you think i would even want to \?)
-        (i am the doctor\, i can do anything i damn please \.)
-        (not really\, it\'s not up to me \.)
-        (depends\, how important is it \?)
-        (i could\, but i don\'t think it would be a wise thing to do \.)
-        (can you \?)
-        (maybe i can\, maybe i can\'t \.\.\.)
-        (i don\'t think i should do that \.)))
-  (set (make-local-variable 'doctor--want) '((want) (desire) (wish) (want) 
(hope)))
-  (set (make-local-variable 'doctor--shortlst)
-       '((can you elaborate on that \?)
-        ((doc$ doctor--please) continue \.)
-        (go on\, don\'t be afraid \.)
-        (i need a little more detail please \.)
-        (you\'re being a bit brief\, (doc$ doctor--please) go into detail \.)
-        (can you be more explicit \?)
-        (and \?)
-        ((doc$ doctor--please) go into more detail \?)
-        (you aren\'t being very talkative today\!)
-        (is that all there is to it \?)
-        (why must you respond so briefly \?)))
-  (set (make-local-variable 'doctor--famlst)
-       '((tell me (doc$ doctor--something) about (doc// doctor-owner) family 
\.)
-        (you seem to dwell on (doc// doctor-owner) family \.)
-        ((doc$ doctor--areyou) hung up on (doc// doctor-owner) family \?)))
-  (set (make-local-variable 'doctor--huhlst)
-       '(((doc$ doctor--whysay) (doc// doctor-sent) \?)
-        (is it because of (doc$ doctor--things) that you say (doc// 
doctor-sent) \?)))
-  (set (make-local-variable 'doctor--longhuhlst)
-       '(((doc$ doctor--whysay) that \?)
-        (i don\'t understand \.)
-        ((doc$ doctor--thlst))
-        ((doc$ doctor--areyou) (doc$ doctor--afraidof) that \?)))
-  (set (make-local-variable 'doctor--feelings-about) '((feelings about)
-                                              (apprehensions toward)
-                                              (thoughts on)
-                                              (emotions toward)))
-  (set (make-local-variable 'doctor--random-adjective)
-       '((vivid)
-        (emotionally stimulating)
-        (exciting)
-        (boring)
-        (interesting)
-        (recent)
-        (random) ; how can we omit this?
-        (unusual)
-        (shocking)
-        (embarrassing)))
-  (set (make-local-variable 'doctor--whysay) '((why do you say)
-                                      (what makes you believe)
-                                      (are you sure that)
-                                      (do you really think)
-                                      (what makes you think)))
-  (set (make-local-variable 'doctor--isee) '((i see \.\.\.)
-                                    (yes\,)
-                                    (i understand \.)
-                                    (oh \.) ))
-  (set (make-local-variable 'doctor--please) '((please\,)
-                                      (i would appreciate it if you would)
-                                      (perhaps you could)
-                                      (please\,)
-                                      (would you please)
-                                      (why don\'t you)
-                                      (could you)))
-  (set (make-local-variable 'doctor--bye)
-       '((my secretary will send you a bill \.)
-        (bye bye \.)
-        (see ya \.)
-        (ok\, talk to you some other time \.)
-        (talk to you later \.)
-        (ok\, have fun \.)
-        (ciao \.)))
-  (set (make-local-variable 'doctor--something) '((something)
-                                                 (more)
-                                                 (how you feel)))
-  (set (make-local-variable 'doctor--thing) '((your life)
-                                     (your sex life)))
-  (set (make-local-variable 'doctor--things) '((your plans)
-                                      (the people you hang around with)
-                                      (problems at school)
-                                      (any hobbies you have)
-                                      (hangups you have)
-                                      (your inhibitions)
-                                      (some problems in your childhood)
-                                      (some problems at home)))
-  (set (make-local-variable 'doctor--describe) '((describe)
-                                        (tell me about)
-                                        (talk about)
-                                        (discuss)
-                                        (tell me more about)
-                                        (elaborate on)))
-  (set (make-local-variable 'doctor--ibelieve)
-       '((i believe) (i think) (i have a feeling) (it seems to me that)
-        (it looks like)))
-  (set (make-local-variable 'doctor--problems) '((problems)
-                                        (inhibitions)
-                                        (hangups)
-                                        (difficulties)
-                                        (anxieties)
-                                        (frustrations)))
-  (set (make-local-variable 'doctor--bother) '((does it bother you that)
-                                      (are you annoyed that)
-                                      (did you ever regret)
-                                      (are you sorry)
-                                      (are you satisfied with the fact that)))
-  (set (make-local-variable 'doctor--machlst)
-       '((you have your mind on (doc// doctor-found) \, it seems \.)
-        (you think too much about  (doc// doctor-found) \.)
-        (you should try taking your mind off of (doc// doctor-found)\.)
-        (are you a computer hacker \?)))
-  (set (make-local-variable 'doctor--qlist)
-       '((what do you think \?)
-        (i\'ll ask the questions\, if you don\'t mind!)
-        (i could ask the same thing myself \.)
-        ((doc$ doctor--please) allow me to do the questioning \.)
-        (i have asked myself that question many times \.)
-        ((doc$ doctor--please) try to answer that question yourself \.)))
-  (set (make-local-variable 'doctor--foullst)
-       '(((doc$ doctor--please) watch your tongue!)
-        ((doc$ doctor--please) avoid such unwholesome thoughts \.)
-        ((doc$ doctor--please) get your mind out of the gutter \.)
-        (such lewdness is not appreciated \.)))
-  (set (make-local-variable 'doctor--deathlst)
-       '((this is not a healthy way of thinking \.)
-        ((doc$ doctor--bother) you\, too\, may die someday \?)
-        (i am worried by your obsession with this topic!)
-        (did you watch a lot of crime and violence on television as a child 
\?)))
-  (set (make-local-variable 'doctor--sexlst)
-       '(((doc$ doctor--areyou) (doc$ doctor--afraidof) sex \?)
-        ((doc$ doctor--describe) (doc$ doctor--something) about your sexual 
history \.)
-        ((doc$ doctor--please) (doc$ doctor--describe) your sex life \.\.\.)
-        ((doc$ doctor--describe) your (doc$ doctor--feelings-about) your 
sexual partner \.)
-        ((doc$ doctor--describe) your most (doc$ doctor--random-adjective) 
sexual experience \.)
-        ((doc$ doctor--areyou) satisfied with (doc// doctor--lover) \.\.\. 
\?)))
-  (set (make-local-variable 'doctor--neglst) '((why not \?)
-                                      ((doc$ doctor--bother) i ask that \?)
-                                      (why not \?)
-                                      (why not \?)
-                                      (how come \?)
-                                      ((doc$ doctor--bother) i ask that \?)))
-  (set (make-local-variable 'doctor--beclst)
-       '((is it because (doc// doctor-sent) that you came to me \?)
-        ((doc$ doctor--bother) (doc// doctor-sent) \?)
-        (when did you first know that (doc// doctor-sent) \?)
-        (is the fact that (doc// doctor-sent) the real reason \?)
-        (does the fact that (doc// doctor-sent) explain anything else \?)
-        ((doc$ doctor--areyou) (doc$ doctor--sure) (doc// doctor-sent) \? )))
-  (set (make-local-variable 'doctor--shortbeclst)
-   '(((doc$ doctor--bother) i ask you that \?)
-     (that\'s not much of an answer!)
-     ((doc$ doctor--inter) why won\'t you talk about it \?)
-     (speak up!)
-     ((doc$ doctor--areyou) (doc$ doctor--afraidof) talking about it \?)
-     (don\'t be (doc$ doctor--afraidof) elaborating \.)
-     ((doc$ doctor--please) go into more detail \.)))
-  (set (make-local-variable 'doctor--thlst)
-       '(((doc$ doctor--maybe) (doc$ doctor--thing) (doc$ doctor--isrelated) 
this \.)
-        ((doc$ doctor--maybe) (doc$ doctor--things) (doc$ doctor--arerelated) 
this \.)
-        (is it because of (doc$ doctor--things) that you are going through all 
this \?)
-        (how do you reconcile (doc$ doctor--things) \? )
-        ((doc$ doctor--maybe) this (doc$ doctor--isrelated) (doc$ 
doctor--things) \?)))
-  (set (make-local-variable 'doctor--remlst)
-       '((earlier you said (doc$ doctor--history) \?)
-        (you mentioned that (doc$ doctor--history) \?)
-        ((doc$ doctor--whysay) (doc$ doctor--history) \? )))
-  (set (make-local-variable 'doctor--toklst)
-       '((is this how you relax \?)
-        (how long have you been smoking        grass \?)
-        ((doc$ doctor--areyou) (doc$ doctor--afraidof) of being drawn to using 
harder stuff \?)))
-  (set (make-local-variable 'doctor--states)
-       '((do you get (doc// doctor-found) often \?)
-        (do you enjoy being (doc// doctor-found) \?)
-        (what makes you (doc// doctor-found) \?)
-        (how often (doc$ doctor--areyou) (doc// doctor-found) \?)
-        (when were you last (doc// doctor-found) \?)))
-  (set (make-local-variable 'doctor--replist) '((i . (you))
-                                       (my . (your))
-                                       (me . (you))
-                                       (you . (me))
-                                       (your . (my))
-                                       (mine . (yours))
-                                       (yours . (mine))
-                                       (our . (your))
-                                       (ours . (yours))
-                                       (we . (you))
-                                       (dunno . (do not know))
-                                       ;;        (yes . ())
-                                       (no\, . ())
-                                       (yes\, . ())
-                                       (ya . (i))
-                                       (aint . (am not))
-                                       (wanna . (want to))
-                                       (gimme . (give me))
-                                       (gotta . (have to))
-                                       (gonna . (going to))
-                                       (never . (not ever))
-                                       (doesn\'t . (does not))
-                                       (don\'t . (do not))
-                                       (aren\'t . (are not))
-                                       (isn\'t . (is not))
-                                       (won\'t . (will not))
-                                       (can\'t . (cannot))
-                                       (haven\'t . (have not))
-                                       (i\'m . (you are))
-                                       (ourselves . (yourselves))
-                                       (myself . (yourself))
-                                       (yourself . (myself))
-                                       (you\'re . (i am))
-                                       (you\'ve . (i have))
-                                       (i\'ve . (you have))
-                                       (i\'ll . (you will))
-                                       (you\'ll . (i shall))
-                                       (i\'d . (you would))
-                                       (you\'d . (i would))
-                                       (here . (there))
-                                       (please . ())
-                                       (eh\, . ())
-                                       (eh . ())
-                                       (oh\, . ())
-                                       (oh . ())
-                                       (shouldn\'t . (should not))
-                                       (wouldn\'t . (would not))
-                                       (won\'t . (will not))
-                                       (hasn\'t . (has not))))
-  (set (make-local-variable 'doctor--stallmanlst)
-       '(((doc$ doctor--describe) your (doc$ doctor--feelings-about) him \.)
-        ((doc$ doctor--areyou) a friend of Stallman \?)
-        ((doc$ doctor--bother) Stallman is (doc$ doctor--random-adjective) \?)
-        ((doc$ doctor--ibelieve) you are (doc$ doctor--afraidof) him \.)))
-  (set (make-local-variable 'doctor--schoollst)
-       '(((doc$ doctor--describe) your (doc// doctor-found) \.)
-        ((doc$ doctor--bother) your grades could (doc$ doctor--improve) \?)
-        ((doc$ doctor--areyou) (doc$ doctor--afraidof) (doc// doctor-found) \?)
-        ((doc$ doctor--maybe) this (doc$ doctor--isrelated) to your attitude 
\.)
-        ((doc$ doctor--areyou) absent often \?)
-        ((doc$ doctor--maybe) you should study (doc$ doctor--something) \.)))
-  (set (make-local-variable 'doctor--improve)
-       '((improve) (be better) (be improved) (be higher)))
-  (set (make-local-variable 'doctor--elizalst)
-       '(((doc$ doctor--areyou) (doc$ doctor--sure) \?)
-        ((doc$ doctor--ibelieve) you have (doc$ doctor--problems) with (doc// 
doctor-found) \.)
-        ((doc$ doctor--whysay) (doc// doctor-sent) \?)))
-  (set (make-local-variable 'doctor--sportslst)
-       '((tell me (doc$ doctor--something) about (doc// doctor-found) \.)
-        ((doc$ doctor--describe) (doc$ doctor--relation) (doc// doctor-found) 
\.)
-        (do you find (doc// doctor-found) (doc$ doctor--random-adjective) \?)))
-  (set (make-local-variable 'doctor--mathlst)
-       '(((doc$ doctor--describe) (doc$ doctor--something) about math \.)
-        ((doc$ doctor--maybe) your (doc$ doctor--problems) (doc$ 
doctor--arerelated) (doc// doctor-found) \.)
-        (i don\'t know much (doc// doctor-found) \, but (doc$ doctor--continue)
-           anyway \.)))
-  (set (make-local-variable 'doctor--zippylst)
-       '(((doc$ doctor--areyou) Zippy \?)
-        ((doc$ doctor--ibelieve) you have some serious (doc$ doctor--problems) 
\.)
-        ((doc$ doctor--bother) you are a pinhead \?)))
-  (set (make-local-variable 'doctor--chatlst)
-       '(((doc$ doctor--maybe) we could chat \.)
-        ((doc$ doctor--please) (doc$ doctor--describe) (doc$ 
doctor--something) about chat mode \.)
-        ((doc$ doctor--bother) our discussion is so (doc$ 
doctor--random-adjective) \?)))
-  (set (make-local-variable 'doctor--abuselst)
-       '(((doc$ doctor--please) try to be less abusive \.)
-        ((doc$ doctor--describe) why you call me (doc// doctor-found) \.)
-        (i\'ve had enough of you!)))
-  (set (make-local-variable 'doctor--abusewords)
-       '(boring bozo clown clumsy cretin dumb dummy
-               fool foolish gnerd gnurd idiot jerk
-               lose loser louse lousy luse luser
-               moron nerd nurd oaf oafish reek
-               stink stupid tool toolish twit))
-  (set (make-local-variable 'doctor--howareyoulst)
-       '((how are you) (hows it going) (hows it going eh)
-        (how\'s it going) (how\'s it going eh) (how goes it)
-        (whats up) (whats new) (what\'s up) (what\'s new)
-        (howre you) (how\'re you) (how\'s everything)
-        (how is everything) (how do you do)
-        (how\'s it hanging) (que pasa)
-        (how are you doing) (what do you say)))
-  (set (make-local-variable 'doctor--whereoutp) '(huh remem rthing))
-  (set (make-local-variable 'doctor-subj) nil)
-  (set (make-local-variable 'doctor-verb) nil)
-  (set (make-local-variable 'doctor-obj) nil)
-  (set (make-local-variable 'doctor--feared) nil)
-  (set (make-local-variable 'doctor--repetitive-shortness) '(0 . 0))
-  (set (make-local-variable 'doctor--**mad**) nil)
-  (set (make-local-variable 'doctor--rms-flag) nil)
-  (set (make-local-variable 'doctor--eliza-flag) nil)
-  (set (make-local-variable 'doctor--zippy-flag) nil)
-  (set (make-local-variable 'doctor--suicide-flag) nil)
-  (set (make-local-variable 'doctor--lover) '(your partner))
-  (set (make-local-variable 'doctor--bak) nil)
-  (set (make-local-variable 'doctor--lincount) 0)
-  (set (make-local-variable 'doctor--*print-upcase*) nil)
-  (set (make-local-variable 'doctor--*print-space*) nil)
-  (set (make-local-variable 'doctor--howdyflag) nil)
-  (set (make-local-variable 'doctor-object) nil))
+  (setq-local doctor--typos
+              (mapcar (lambda (x)
+                        (put (car x) 'doctor-correction  (cadr x))
+                        (put (cadr x) 'doctor-expansion (car (cddr x)))
+                        (car x))
+                      '((theyll they\'ll (they will))
+                        (theyre they\'re (they are))
+                        (hes he\'s (he is))
+                        (he7s he\'s (he is))
+                        (im i\'m (you are))
+                        (i7m i\'m (you are))
+                        (isa is\ a (is a))
+                        (thier their (their))
+                        (dont don\'t (do not))
+                        (don7t don\'t (do not))
+                        (you7re you\'re (i am))
+                        (you7ve you\'ve (i have))
+                        (you7ll you\'ll (i will)))))
+  (setq-local doctor-sent nil)
+  (setq-local doctor-found nil)
+  (setq-local doctor-owner nil)
+  (setq-local doctor--history nil)
+  (setq-local doctor--inter '((well\,)
+                              (hmmm \.\.\.\ so\,)
+                              (so)
+                              (\.\.\.and)
+                              (then)))
+  (setq-local doctor--continue '((continue)
+                                 (proceed)
+                                 (go on)
+                                 (keep going)))
+  (setq-local doctor--relation
+              '((your relationship with)
+                (something you remember about)
+                (your feelings toward)
+                (some experiences you have had with)
+                (how you feel about)))
+  (setq-local doctor--fears
+              '(((doc$ doctor--whysay) you are (doc$ doctor--afraidof) (doc// 
doctor--feared) \?)
+                (you seem terrified by (doc// doctor--feared) \.)
+                (when did you first feel (doc$ doctor--afraidof) (doc// 
doctor--feared) \?)))
+  (setq-local doctor--sure '((sure)
+                             (positive)
+                             (certain)
+                             (absolutely sure)))
+  (setq-local doctor--afraidof '((afraid of)
+                                 (frightened by)
+                                 (scared of)))
+  (setq-local doctor--areyou '((are you)
+                               (have you been)
+                               (have you been)))
+  (setq-local doctor--isrelated
+              '((has something to do with)
+                (is related to)
+                (could be the reason for)
+                (is caused by)
+                (is because of)))
+  (setq-local doctor--arerelated '((have something to do with)
+                                   (are related to)
+                                   (could have caused)
+                                   (could be the reason for)
+                                   (are caused by)
+                                   (are because of)))
+  (setq-local doctor--moods
+              '(((doc$ doctor--areyou) (doc// doctor-found) often \?)
+                (what causes you to be (doc// doctor-found) \?)
+                ((doc$ doctor--whysay) you are (doc// doctor-found) \?)))
+  (setq-local doctor--maybe '((maybe)
+                              (perhaps)
+                              (possibly)))
+  (setq-local doctor--whatwhen '((what happened when)
+                                 (what would happen if)))
+  (setq-local doctor--hello '((how do you do \?)
+                              (hello \.)
+                              (howdy!)
+                              (hello \.)
+                              (hi \.)
+                              (hi there \.)))
+  (setq-local doctor--drnk
+              '((do you drink a lot of (doc// doctor-found) \?)
+                (do you get drunk often \?)
+                ((doc$ doctor--describe) your drinking habits \.)))
+  (setq-local doctor--drugs
+              '((do you use (doc// doctor-found) often \?)
+                ((doc$ doctor--areyou) addicted to (doc// doctor-found) \?)
+                (do you realize that drugs can be very harmful \?)
+                ((doc$ doctor--maybe) you should try to quit using (doc// 
doctor-found) \.)))
+  (setq-local doctor--whywant
+              '(((doc$ doctor--whysay) (doc// doctor-subj) might (doc$ 
doctor--want) (doc// doctor-obj) \?)
+                (how does it feel to want \?)
+                (why should (doc// doctor-subj) get (doc// doctor-obj) \?)
+                (when did (doc// doctor-subj) first (doc$ doctor--want) (doc// 
doctor-obj) \?)
+                ((doc$ doctor--areyou) obsessed with (doc// doctor-obj) \?)
+                (why should i give (doc// doctor-obj) to (doc// doctor-subj) 
\?)
+                (have you ever gotten (doc// doctor-obj) \?)))
+  (setq-local doctor--canyou
+              '((of course i can \.)
+                (why should i \?)
+                (what makes you think i would even want to \?)
+                (i am the doctor\, i can do anything i damn please \.)
+                (not really\, it\'s not up to me \.)
+                (depends\, how important is it \?)
+                (i could\, but i don\'t think it would be a wise thing to do 
\.)
+                (can you \?)
+                (maybe i can\, maybe i can\'t \.\.\.)
+                (i don\'t think i should do that \.)))
+  (setq-local doctor--want '((want) (desire) (wish) (want) (hope)))
+  (setq-local doctor--shortlst
+              '((can you elaborate on that \?)
+                ((doc$ doctor--please) continue \.)
+                (go on\, don\'t be afraid \.)
+                (i need a little more detail please \.)
+                (you\'re being a bit brief\, (doc$ doctor--please) go into 
detail \.)
+                (can you be more explicit \?)
+                (and \?)
+                ((doc$ doctor--please) go into more detail \?)
+                (you aren\'t being very talkative today\!)
+                (is that all there is to it \?)
+                (why must you respond so briefly \?)))
+  (setq-local doctor--famlst
+              '((tell me (doc$ doctor--something) about (doc// doctor-owner) 
family \.)
+                (you seem to dwell on (doc// doctor-owner) family \.)
+                ((doc$ doctor--areyou) hung up on (doc// doctor-owner) family 
\?)))
+  (setq-local doctor--huhlst
+              '(((doc$ doctor--whysay) (doc// doctor-sent) \?)
+                (is it because of (doc$ doctor--things) that you say (doc// 
doctor-sent) \?)))
+  (setq-local doctor--longhuhlst
+              '(((doc$ doctor--whysay) that \?)
+                (i don\'t understand \.)
+                ((doc$ doctor--thlst))
+                ((doc$ doctor--areyou) (doc$ doctor--afraidof) that \?)))
+  (setq-local doctor--feelings-about '((feelings about)
+                                       (apprehensions toward)
+                                       (thoughts on)
+                                       (emotions toward)))
+  (setq-local doctor--random-adjective
+              '((vivid)
+                (emotionally stimulating)
+                (exciting)
+                (boring)
+                (interesting)
+                (recent)
+                (random) ; how can we omit this?
+                (unusual)
+                (shocking)
+                (embarrassing)))
+  (setq-local doctor--whysay '((why do you say)
+                               (what makes you believe)
+                               (are you sure that)
+                               (do you really think)
+                               (what makes you think)))
+  (setq-local doctor--isee '((i see \.\.\.)
+                             (yes\,)
+                             (i understand \.)
+                             (oh \.) ))
+  (setq-local doctor--please '((please\,)
+                               (i would appreciate it if you would)
+                               (perhaps you could)
+                               (please\,)
+                               (would you please)
+                               (why don\'t you)
+                               (could you)))
+  (setq-local doctor--bye
+              '((my secretary will send you a bill \.)
+                (bye bye \.)
+                (see ya \.)
+                (ok\, talk to you some other time \.)
+                (talk to you later \.)
+                (ok\, have fun \.)
+                (ciao \.)))
+  (setq-local doctor--something '((something)
+                                  (more)
+                                  (how you feel)))
+  (setq-local doctor--thing '((your life)
+                              (your sex life)))
+  (setq-local doctor--things '((your plans)
+                               (the people you hang around with)
+                               (problems at school)
+                               (any hobbies you have)
+                               (hangups you have)
+                               (your inhibitions)
+                               (some problems in your childhood)
+                               (some problems at home)))
+  (setq-local doctor--describe '((describe)
+                                 (tell me about)
+                                 (talk about)
+                                 (discuss)
+                                 (tell me more about)
+                                 (elaborate on)))
+  (setq-local doctor--ibelieve
+              '((i believe) (i think) (i have a feeling) (it seems to me that)
+                (it looks like)))
+  (setq-local doctor--problems '((problems)
+                                 (inhibitions)
+                                 (hangups)
+                                 (difficulties)
+                                 (anxieties)
+                                 (frustrations)))
+  (setq-local doctor--bother '((does it bother you that)
+                               (are you annoyed that)
+                               (did you ever regret)
+                               (are you sorry)
+                               (are you satisfied with the fact that)))
+  (setq-local doctor--machlst
+              '((you have your mind on (doc// doctor-found) \, it seems \.)
+                (you think too much about  (doc// doctor-found) \.)
+                (you should try taking your mind off of (doc// doctor-found)\.)
+                (are you a computer hacker \?)))
+  (setq-local doctor--qlist
+              '((what do you think \?)
+                (i\'ll ask the questions\, if you don\'t mind!)
+                (i could ask the same thing myself \.)
+                ((doc$ doctor--please) allow me to do the questioning \.)
+                (i have asked myself that question many times \.)
+                ((doc$ doctor--please) try to answer that question yourself 
\.)))
+  (setq-local doctor--foullst
+              '(((doc$ doctor--please) watch your tongue!)
+                ((doc$ doctor--please) avoid such unwholesome thoughts \.)
+                ((doc$ doctor--please) get your mind out of the gutter \.)
+                (such lewdness is not appreciated \.)))
+  (setq-local doctor--deathlst
+              '((this is not a healthy way of thinking \.)
+                ((doc$ doctor--bother) you\, too\, may die someday \?)
+                (i am worried by your obsession with this topic!)
+                (did you watch a lot of crime and violence on television as a 
child \?)))
+  (setq-local doctor--sexlst
+              '(((doc$ doctor--areyou) (doc$ doctor--afraidof) sex \?)
+                ((doc$ doctor--describe) (doc$ doctor--something) about your 
sexual history \.)
+                ((doc$ doctor--please) (doc$ doctor--describe) your sex life 
\.\.\.)
+                ((doc$ doctor--describe) your (doc$ doctor--feelings-about) 
your sexual partner \.)
+                ((doc$ doctor--describe) your most (doc$ 
doctor--random-adjective) sexual experience \.)
+                ((doc$ doctor--areyou) satisfied with (doc// doctor--lover) 
\.\.\. \?)))
+  (setq-local doctor--neglst '((why not \?)
+                               ((doc$ doctor--bother) i ask that \?)
+                               (why not \?)
+                               (why not \?)
+                               (how come \?)
+                               ((doc$ doctor--bother) i ask that \?)))
+  (setq-local doctor--beclst
+              '((is it because (doc// doctor-sent) that you came to me \?)
+                ((doc$ doctor--bother) (doc// doctor-sent) \?)
+                (when did you first know that (doc// doctor-sent) \?)
+                (is the fact that (doc// doctor-sent) the real reason \?)
+                (does the fact that (doc// doctor-sent) explain anything else 
\?)
+                ((doc$ doctor--areyou) (doc$ doctor--sure) (doc// doctor-sent) 
\? )))
+  (setq-local doctor--shortbeclst
+              '(((doc$ doctor--bother) i ask you that \?)
+                (that\'s not much of an answer!)
+                ((doc$ doctor--inter) why won\'t you talk about it \?)
+                (speak up!)
+                ((doc$ doctor--areyou) (doc$ doctor--afraidof) talking about 
it \?)
+                (don\'t be (doc$ doctor--afraidof) elaborating \.)
+                ((doc$ doctor--please) go into more detail \.)))
+  (setq-local doctor--thlst
+              '(((doc$ doctor--maybe) (doc$ doctor--thing) (doc$ 
doctor--isrelated) this \.)
+                ((doc$ doctor--maybe) (doc$ doctor--things) (doc$ 
doctor--arerelated) this \.)
+                (is it because of (doc$ doctor--things) that you are going 
through all this \?)
+                (how do you reconcile (doc$ doctor--things) \? )
+                ((doc$ doctor--maybe) this (doc$ doctor--isrelated) (doc$ 
doctor--things) \?)))
+  (setq-local doctor--remlst
+              '((earlier you said (doc$ doctor--history) \?)
+                (you mentioned that (doc$ doctor--history) \?)
+                ((doc$ doctor--whysay) (doc$ doctor--history) \? )))
+  (setq-local doctor--toklst
+              '((is this how you relax \?)
+                (how long have you been smoking        grass \?)
+                ((doc$ doctor--areyou) (doc$ doctor--afraidof) of being drawn 
to using harder stuff \?)))
+  (setq-local doctor--states
+              '((do you get (doc// doctor-found) often \?)
+                (do you enjoy being (doc// doctor-found) \?)
+                (what makes you (doc// doctor-found) \?)
+                (how often (doc$ doctor--areyou) (doc// doctor-found) \?)
+                (when were you last (doc// doctor-found) \?)))
+  (setq-local doctor--replist '((i . (you))
+                                (my . (your))
+                                (me . (you))
+                                (you . (me))
+                                (your . (my))
+                                (mine . (yours))
+                                (yours . (mine))
+                                (our . (your))
+                                (ours . (yours))
+                                (we . (you))
+                                (dunno . (do not know))
+                                ;;       (yes . ())
+                                (no\, . ())
+                                (yes\, . ())
+                                (ya . (i))
+                                (aint . (am not))
+                                (wanna . (want to))
+                                (gimme . (give me))
+                                (gotta . (have to))
+                                (gonna . (going to))
+                                (never . (not ever))
+                                (doesn\'t . (does not))
+                                (don\'t . (do not))
+                                (aren\'t . (are not))
+                                (isn\'t . (is not))
+                                (won\'t . (will not))
+                                (can\'t . (cannot))
+                                (haven\'t . (have not))
+                                (i\'m . (you are))
+                                (ourselves . (yourselves))
+                                (myself . (yourself))
+                                (yourself . (myself))
+                                (you\'re . (i am))
+                                (you\'ve . (i have))
+                                (i\'ve . (you have))
+                                (i\'ll . (you will))
+                                (you\'ll . (i shall))
+                                (i\'d . (you would))
+                                (you\'d . (i would))
+                                (here . (there))
+                                (please . ())
+                                (eh\, . ())
+                                (eh . ())
+                                (oh\, . ())
+                                (oh . ())
+                                (shouldn\'t . (should not))
+                                (wouldn\'t . (would not))
+                                (won\'t . (will not))
+                                (hasn\'t . (has not))))
+  (setq-local doctor--stallmanlst
+              '(((doc$ doctor--describe) your (doc$ doctor--feelings-about) 
him \.)
+                ((doc$ doctor--areyou) a friend of Stallman \?)
+                ((doc$ doctor--bother) Stallman is (doc$ 
doctor--random-adjective) \?)
+                ((doc$ doctor--ibelieve) you are (doc$ doctor--afraidof) him 
\.)))
+  (setq-local doctor--schoollst
+              '(((doc$ doctor--describe) your (doc// doctor-found) \.)
+                ((doc$ doctor--bother) your grades could (doc$ 
doctor--improve) \?)
+                ((doc$ doctor--areyou) (doc$ doctor--afraidof) (doc// 
doctor-found) \?)
+                ((doc$ doctor--maybe) this (doc$ doctor--isrelated) to your 
attitude \.)
+                ((doc$ doctor--areyou) absent often \?)
+                ((doc$ doctor--maybe) you should study (doc$ 
doctor--something) \.)))
+  (setq-local doctor--improve
+              '((improve) (be better) (be improved) (be higher)))
+  (setq-local doctor--elizalst
+              '(((doc$ doctor--areyou) (doc$ doctor--sure) \?)
+                ((doc$ doctor--ibelieve) you have (doc$ doctor--problems) with 
(doc// doctor-found) \.)
+                ((doc$ doctor--whysay) (doc// doctor-sent) \?)))
+  (setq-local doctor--sportslst
+              '((tell me (doc$ doctor--something) about (doc// doctor-found) 
\.)
+                ((doc$ doctor--describe) (doc$ doctor--relation) (doc// 
doctor-found) \.)
+                (do you find (doc// doctor-found) (doc$ 
doctor--random-adjective) \?)))
+  (setq-local doctor--mathlst
+              '(((doc$ doctor--describe) (doc$ doctor--something) about math 
\.)
+                ((doc$ doctor--maybe) your (doc$ doctor--problems) (doc$ 
doctor--arerelated) (doc// doctor-found) \.)
+                (i don\'t know much (doc// doctor-found) \, but (doc$ 
doctor--continue)
+                   anyway \.)))
+  (setq-local doctor--zippylst
+              '(((doc$ doctor--areyou) Zippy \?)
+                ((doc$ doctor--ibelieve) you have some serious (doc$ 
doctor--problems) \.)
+                ((doc$ doctor--bother) you are a pinhead \?)))
+  (setq-local doctor--chatlst
+              '(((doc$ doctor--maybe) we could chat \.)
+                ((doc$ doctor--please) (doc$ doctor--describe) (doc$ 
doctor--something) about chat mode \.)
+                ((doc$ doctor--bother) our discussion is so (doc$ 
doctor--random-adjective) \?)))
+  (setq-local doctor--abuselst
+              '(((doc$ doctor--please) try to be less abusive \.)
+                ((doc$ doctor--describe) why you call me (doc// doctor-found) 
\.)
+                (i\'ve had enough of you!)))
+  (setq-local doctor--abusewords
+              '(boring bozo clown clumsy cretin dumb dummy
+                       fool foolish gnerd gnurd idiot jerk
+                       lose loser louse lousy luse luser
+                       moron nerd nurd oaf oafish reek
+                       stink stupid tool toolish twit))
+  (setq-local doctor--howareyoulst
+              '((how are you) (hows it going) (hows it going eh)
+                (how\'s it going) (how\'s it going eh) (how goes it)
+                (whats up) (whats new) (what\'s up) (what\'s new)
+                (howre you) (how\'re you) (how\'s everything)
+                (how is everything) (how do you do)
+                (how\'s it hanging) (que pasa)
+                (how are you doing) (what do you say)))
+  (setq-local doctor--whereoutp '(huh remem rthing))
+  (setq-local doctor-subj nil)
+  (setq-local doctor-verb nil)
+  (setq-local doctor-obj nil)
+  (setq-local doctor--feared nil)
+  (setq-local doctor--repetitive-shortness '(0 . 0))
+  (setq-local doctor--**mad** nil)
+  (setq-local doctor--rms-flag nil)
+  (setq-local doctor--eliza-flag nil)
+  (setq-local doctor--zippy-flag nil)
+  (setq-local doctor--suicide-flag nil)
+  (setq-local doctor--lover '(your partner))
+  (setq-local doctor--bak nil)
+  (setq-local doctor--lincount 0)
+  (setq-local doctor--*print-upcase* nil)
+  (setq-local doctor--*print-space* nil)
+  (setq-local doctor--howdyflag nil)
+  (setq-local doctor-object nil))
 
 ;; Define equivalence classes of words that get treated alike.
 
diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el
index 8a69f9d..1df28a0 100644
--- a/lisp/play/dunnet.el
+++ b/lisp/play/dunnet.el
@@ -1144,8 +1144,7 @@ treasures for points?" "4" "four")
 
 (define-derived-mode dun-mode text-mode "Dungeon"
   "Major mode for running dunnet."
-  (make-local-variable 'scroll-step)
-  (setq scroll-step 2))
+  (setq-local scroll-step 2))
 
 (defun dun-parse (_arg)
   "Function called when return is pressed in interactive mode to parse line."
@@ -2351,15 +2350,10 @@ for a moment, then straighten yourself up.\n")
 
 (define-key dun-mode-map "\r" 'dun-parse)
 (defvar dungeon-batch-map (make-keymap))
-(if (string= (substring emacs-version 0 2) "18")
-    (let (n)
-      (setq n 32)
-      (while (< 0 (setq n (- n 1)))
-       (aset dungeon-batch-map n 'dungeon-nil)))
-  (let (n)
-    (setq n 32)
-    (while (< 0 (setq n (- n 1)))
-      (aset (car (cdr dungeon-batch-map)) n 'dungeon-nil))))
+(let (n)
+  (setq n 32)
+  (while (< 0 (setq n (- n 1)))
+    (aset (car (cdr dungeon-batch-map)) n 'dungeon-nil)))
 (define-key dungeon-batch-map "\r" 'exit-minibuffer)
 (define-key dungeon-batch-map "\n" 'exit-minibuffer)
 
diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el
index 4033986..8ede82a 100644
--- a/lisp/play/gomoku.el
+++ b/lisp/play/gomoku.el
@@ -195,9 +195,8 @@ You play by moving the cursor over the square you choose 
and hitting \\[gomoku-h
 Other useful commands:\n
 \\{gomoku-mode-map}"
   (gomoku-display-statistics)
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults '(gomoku-font-lock-keywords t)
-       buffer-read-only t)
+  (setq-local font-lock-defaults '(gomoku-font-lock-keywords t))
+  (setq buffer-read-only t)
   (add-hook 'post-command-hook #'gomoku--intangible nil t))
 
 ;;;
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index dc727aa..2d86f88 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -75,8 +75,8 @@
 ;;   (add-hook 'speedbar-load-hook  ; would be too late in antlr-mode.el
 ;;            (lambda () (speedbar-add-supported-extension ".g")))
 
-;; I strongly recommend to use font-lock with a support mode like fast-lock,
-;; lazy-lock or better jit-lock (Emacs-21.1+) / lazy-shot (XEmacs).
+;; I strongly recommend to use font-lock with a support mode like
+;; jit-lock (Emacs) / lazy-shot (XEmacs).
 
 ;; To customize, use menu item "Antlr" -> "Customize Antlr".
 
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 252eec1..5e2ce71 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -3148,7 +3148,7 @@ comment at the start of cc-engine.el for more info."
                      ((nth 7 s) 'c++)
                      (t 'c)))
            (setq start (nth 8 s))
-           (unless end
+           (unless (and end (>= end here))
              (setq s1 (parse-partial-sexp here (point-max)
                                           nil            ; TARGETDEPTH
                                           nil            ; STOPBEFORE
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index dd36c68..48f0a34 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -931,19 +931,12 @@ In regular expressions (including character classes):
 (defun cperl-putback-char (c)          ; Emacs 19
   (push c unread-command-events))       ; Avoid undefined warning
 
-(defvar cperl-do-not-fontify
-  ;; FIXME: This is not doing what it claims!
-  (if (string< emacs-version "19.30")
-      'fontified
-    'lazy-lock)
-  "Text property which inhibits refontification.")
-
 (defsubst cperl-put-do-not-fontify (from to &optional post)
   ;; If POST, do not do it with postponed fontification
   (if (and post cperl-syntaxify-by-font-lock)
       nil
     (put-text-property (max (point-min) (1- from))
-                      to cperl-do-not-fontify t)))
+                       to 'fontified t)))
 
 (defcustom cperl-mode-hook nil
   "Hook run by CPerl mode."
@@ -1254,11 +1247,7 @@ versions of Emacs."
          ["Speed" (describe-variable 'cperl-speed) t]
          ["Praise" (describe-variable 'cperl-praise) t]
          ["Faces" (describe-variable 'cperl-tips-faces) t]
-         ["CPerl mode" (describe-function 'cperl-mode) t]
-         ["CPerl version"
-          (message "The version of master-file for this CPerl is %s-Emacs"
-                   cperl-version)
-           t]))))
+          ["CPerl mode" (describe-function 'cperl-mode) t]))))
   (error nil))
 
 (autoload 'c-macro-expand "cmacexp"
@@ -5468,7 +5457,6 @@ indentation and initial hashes.  Behaves usually outside 
of comment."
 (defun cperl-init-faces ()
   (condition-case errs
       (progn
-       (require 'font-lock)
        (let (t-font-lock-keywords t-font-lock-keywords-1 font-lock-anchored)
          (setq font-lock-anchored t)
          (setq
@@ -8530,6 +8518,11 @@ do extra unwind via `cperl-unwind-to-safe'."
     (string-match ":\\s *\\([0-9.]+\\)" v)
     (substring v (match-beginning 1) (match-end 1)))
   "Version of IZ-supported CPerl package this file is based on.")
+(make-obsolete-variable 'cperl-version 'emacs-version "28.1")
+
+(defvar cperl-do-not-fontify 'fontified
+  "Text property which inhibits refontification.")
+(make-obsolete-variable 'cperl-do-not-fontify nil "28.1")
 
 (provide 'cperl-mode)
 
diff --git a/lisp/progmodes/cwarn.el b/lisp/progmodes/cwarn.el
index 6e84f4f..b09a2ed 100644
--- a/lisp/progmodes/cwarn.el
+++ b/lisp/progmodes/cwarn.el
@@ -104,8 +104,6 @@
 
 ;;{{{ Dependencies
 
-(require 'custom)
-(require 'font-lock)
 (require 'cc-mode)
 
 ;;}}}
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 8879726..104d889 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -34,7 +34,6 @@
 ;;   prefixes but somewhere within the name.
 
 (require 'ring)
-(require 'button)
 (require 'xref)
 (require 'fileloop)
 
diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el
index bae2bb6..cc72809 100644
--- a/lisp/progmodes/executable.el
+++ b/lisp/progmodes/executable.el
@@ -197,7 +197,7 @@ command to find the next error.  The buffer is also in 
`comint-mode' and
                                      buffer-file-name))))
   (require 'compile)
   (save-some-buffers (not compilation-ask-about-save))
-  (set (make-local-variable 'executable-command) command)
+  (setq-local executable-command command)
   (let ((compilation-error-regexp-alist executable-error-regexp-alist))
     (compilation-start command t (lambda (_x) "*interpretation*"))))
 
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index 1fbbc89..3c5c29b 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -1179,29 +1179,26 @@ Turning on F90 mode calls the value of the variable 
`f90-mode-hook'
 with no args, if that value is non-nil."
   :group 'f90
   :abbrev-table f90-mode-abbrev-table
-  (set (make-local-variable 'indent-line-function) 'f90-indent-line)
-  (set (make-local-variable 'indent-region-function) 'f90-indent-region)
-  (set (make-local-variable 'comment-start) "!")
-  (set (make-local-variable 'comment-start-skip) "!+ *")
-  (set (make-local-variable 'comment-indent-function) 'f90-comment-indent)
-  (set (make-local-variable 'abbrev-all-caps) t)
-  (set (make-local-variable 'normal-auto-fill-function) 'f90-do-auto-fill)
+  (setq-local indent-line-function #'f90-indent-line)
+  (setq-local indent-region-function #'f90-indent-region)
+  (setq-local comment-start "!")
+  (setq-local comment-start-skip "!+ *")
+  (setq-local comment-indent-function 'f90-comment-indent)
+  (setq-local abbrev-all-caps t)
+  (setq-local normal-auto-fill-function #'f90-do-auto-fill)
   (setq indent-tabs-mode nil)           ; auto buffer local
-  (set (make-local-variable 'fill-paragraph-function) 'f90-fill-paragraph)
-  (set (make-local-variable 'font-lock-defaults)
-       '((f90-font-lock-keywords f90-font-lock-keywords-1
-                                 f90-font-lock-keywords-2
-                                 f90-font-lock-keywords-3
-                                 f90-font-lock-keywords-4)
-         nil t))
-  (set (make-local-variable 'imenu-case-fold-search) t)
-  (set (make-local-variable 'imenu-generic-expression)
-       f90-imenu-generic-expression)
-  (set (make-local-variable 'beginning-of-defun-function)
-       'f90-beginning-of-subprogram)
-  (set (make-local-variable 'end-of-defun-function) 'f90-end-of-subprogram)
-  (set (make-local-variable 'add-log-current-defun-function)
-       #'f90-current-defun))
+  (setq-local fill-paragraph-function #'f90-fill-paragraph)
+  (setq-local font-lock-defaults
+              '((f90-font-lock-keywords f90-font-lock-keywords-1
+                                        f90-font-lock-keywords-2
+                                        f90-font-lock-keywords-3
+                                        f90-font-lock-keywords-4)
+                nil t))
+  (setq-local imenu-case-fold-search t)
+  (setq-local imenu-generic-expression f90-imenu-generic-expression)
+  (setq-local beginning-of-defun-function #'f90-beginning-of-subprogram)
+  (setq-local end-of-defun-function #'f90-end-of-subprogram)
+  (setq-local add-log-current-defun-function #'f90-current-defun))
 
 
 ;; Inline-functions.
diff --git a/lisp/progmodes/flymake-cc.el b/lisp/progmodes/flymake-cc.el
index d1985b4..19cef85 100644
--- a/lisp/progmodes/flymake-cc.el
+++ b/lisp/progmodes/flymake-cc.el
@@ -50,7 +50,7 @@ SOURCE."
   ;; TODO: if you can understand it, use `compilation-mode's regexps
   ;; or even some of its machinery here.
   ;;
-  ;;    (set (make-local-variable 'compilation-locs)
+  ;;    (setq-local compilation-locs
   ;;         (make-hash-table :test 'equal :weakness 'value))
   ;;    (compilation-parse-errors (point-min) (point-max)
   ;;                              'gnu 'gcc-include)
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index d84c379..3a0274c 100644
--- a/lisp/progmodes/fortran.el
+++ b/lisp/progmodes/fortran.el
@@ -861,36 +861,34 @@ with no args, if that value is non-nil."
   :group 'fortran
   :syntax-table fortran-mode-syntax-table
   :abbrev-table fortran-mode-abbrev-table
-  (set (make-local-variable 'indent-line-function) 'fortran-indent-line)
-  (set (make-local-variable 'indent-region-function)
+  (setq-local indent-line-function 'fortran-indent-line)
+  (setq-local indent-region-function
        (lambda (start end)
          (let (fortran-blink-matching-if ; avoid blinking delay
                indent-region-function)
            (indent-region start end nil))))
-  (set (make-local-variable 'require-final-newline) mode-require-final-newline)
+  (setq-local require-final-newline mode-require-final-newline)
   ;; The syntax tables don't understand the column-0 comment-markers.
-  (set (make-local-variable 'comment-use-syntax) nil)
-  (set (make-local-variable 'comment-padding) "$$$")
-  (set (make-local-variable 'comment-start) fortran-comment-line-start)
-  (set (make-local-variable 'comment-start-skip)
+  (setq-local comment-use-syntax nil)
+  (setq-local comment-padding "$$$")
+  (setq-local comment-start fortran-comment-line-start)
+  (setq-local comment-start-skip
        ;; We can't reuse `fortran-comment-line-start-skip' directly because
        ;; it contains backrefs whereas we need submatch-1 to end at the
        ;; beginning of the comment delimiter.
        ;; (concat "\\(\\)\\(![ \t]*\\|" fortran-comment-line-start-skip "\\)")
        "\\(\\)\\(?:^[CcDd*]\\|!\\)\\(?:\\([^ \t\n]\\)\\2+\\)?[ \t]*")
-  (set (make-local-variable 'comment-indent-function) 'fortran-comment-indent)
-  (set (make-local-variable 'comment-region-function) 'fortran-comment-region)
-  (set (make-local-variable 'uncomment-region-function)
-       'fortran-uncomment-region)
-  (set (make-local-variable 'comment-insert-comment-function)
-       'fortran-indent-comment)
-  (set (make-local-variable 'abbrev-all-caps) t)
-  (set (make-local-variable 'normal-auto-fill-function) 'fortran-auto-fill)
-  (set (make-local-variable 'indent-tabs-mode) (fortran-analyze-file-format))
+  (setq-local comment-indent-function 'fortran-comment-indent)
+  (setq-local comment-region-function 'fortran-comment-region)
+  (setq-local uncomment-region-function 'fortran-uncomment-region)
+  (setq-local comment-insert-comment-function 'fortran-indent-comment)
+  (setq-local abbrev-all-caps t)
+  (setq-local normal-auto-fill-function 'fortran-auto-fill)
+  (setq-local indent-tabs-mode (fortran-analyze-file-format))
   (setq mode-line-process '(indent-tabs-mode fortran-tab-mode-string))
-  (set (make-local-variable 'fill-column) fortran-line-length)
-  (set (make-local-variable 'fill-paragraph-function) 'fortran-fill-paragraph)
-  (set (make-local-variable 'font-lock-defaults)
+  (setq-local fill-column fortran-line-length)
+  (setq-local fill-paragraph-function 'fortran-fill-paragraph)
+  (setq-local font-lock-defaults
        '((fortran-font-lock-keywords
           fortran-font-lock-keywords-1
           fortran-font-lock-keywords-2
@@ -898,20 +896,19 @@ with no args, if that value is non-nil."
           fortran-font-lock-keywords-4)
          nil t ((?/ . "$/") ("_$" . "w"))
          fortran-beginning-of-subprogram))
-  (set (make-local-variable 'syntax-propertize-function)
+  (setq-local syntax-propertize-function
        (fortran-make-syntax-propertize-function fortran-line-length))
-  (set (make-local-variable 'imenu-case-fold-search) t)
-  (set (make-local-variable 'imenu-generic-expression)
-       fortran-imenu-generic-expression)
-  (set (make-local-variable 'imenu-syntax-alist) '(("_$" . "w")))
-  (set (make-local-variable 'beginning-of-defun-function)
-       #'fortran-beginning-of-subprogram)
-  (set (make-local-variable 'end-of-defun-function)
-       #'fortran-end-of-subprogram)
-  (set (make-local-variable 'add-log-current-defun-function)
-       #'fortran-current-defun)
-  (set (make-local-variable 'dabbrev-case-fold-search) 'case-fold-search)
-  (set (make-local-variable 'gud-find-expr-function) 'fortran-gud-find-expr)
+  (setq-local imenu-case-fold-search t)
+  (setq-local imenu-generic-expression fortran-imenu-generic-expression)
+  (setq-local imenu-syntax-alist '(("_$" . "w")))
+  (setq-local beginning-of-defun-function
+              #'fortran-beginning-of-subprogram)
+  (setq-local end-of-defun-function
+              #'fortran-end-of-subprogram)
+  (setq-local add-log-current-defun-function
+              #'fortran-current-defun)
+  (setq-local dabbrev-case-fold-search 'case-fold-search)
+  (setq-local gud-find-expr-function 'fortran-gud-find-expr)
   (add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t))
 
 
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 81021bc..279a70b 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -758,7 +758,7 @@ the buffer in which this command was invoked."
      "Multiple debugging requires restarting in text command mode"))
 
   (gud-common-init command-line nil 'gud-gdb-marker-filter)
-  (set (make-local-variable 'gud-minor-mode) 'gdb)
+  (setq-local gud-minor-mode 'gdb)
 
   (gud-def gud-break  "break %f:%l"  "\C-b" "Set breakpoint at current line.")
   (gud-def gud-tbreak "tbreak %f:%l" "\C-t"
@@ -788,7 +788,7 @@ the buffer in which this command was invoked."
 
   (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
             nil 'local)
-  (set (make-local-variable 'gud-gdb-completion-function) 'gud-gdb-completions)
+  (setq-local gud-gdb-completion-function 'gud-gdb-completions)
 
   (local-set-key "\C-i" 'completion-at-point)
   (setq comint-prompt-regexp "^(.*gdb[+]?) *")
@@ -1044,7 +1044,7 @@ and source-file directory for your debugger."
       (error "The sdb support requires a valid tags table to work"))
 
   (gud-common-init command-line nil 'gud-sdb-marker-filter 'gud-sdb-find-file)
-  (set (make-local-variable 'gud-minor-mode) 'sdb)
+  (setq-local gud-minor-mode 'sdb)
 
   (gud-def gud-break  "%l b" "\C-b"   "Set breakpoint at current line.")
   (gud-def gud-tbreak "%l c" "\C-t"   "Set temporary breakpoint at current 
line.")
@@ -1323,7 +1323,7 @@ and source-file directory for your debugger."
     (gud-common-init command-line 'gud-dbx-massage-args
                     'gud-dbx-marker-filter)))
 
-  (set (make-local-variable 'gud-minor-mode) 'dbx)
+  (setq-local gud-minor-mode 'dbx)
 
   (cond
    (gud-mips-p
@@ -1424,7 +1424,7 @@ directories if your program contains sources from more 
than one directory."
 
   (gud-common-init command-line 'gud-xdb-massage-args
                   'gud-xdb-marker-filter)
-  (set (make-local-variable 'gud-minor-mode) 'xdb)
+  (setq-local gud-minor-mode 'xdb)
 
   (gud-def gud-break  "b %f:%l"    "\C-b" "Set breakpoint at current line.")
   (gud-def gud-tbreak "b %f:%l\\t" "\C-t"
@@ -1578,7 +1578,7 @@ and source-file directory for your debugger."
 
   (gud-common-init command-line 'gud-perldb-massage-args
                   'gud-perldb-marker-filter)
-  (set (make-local-variable 'gud-minor-mode) 'perldb)
+  (setq-local gud-minor-mode 'perldb)
 
   (gud-def gud-break  "b %l"         "\C-b" "Set breakpoint at current line.")
   (gud-def gud-remove "B %l"         "\C-d" "Remove breakpoint at current 
line")
@@ -1696,7 +1696,7 @@ directory and source-file directory for your debugger."
    (list (gud-query-cmdline 'pdb)))
 
   (gud-common-init command-line nil 'gud-pdb-marker-filter)
-  (set (make-local-variable 'gud-minor-mode) 'pdb)
+  (setq-local gud-minor-mode 'pdb)
 
   (gud-def gud-break  "break %d%f:%l"  "\C-b" "Set breakpoint at current 
line.")
   (gud-def gud-remove "clear %d%f:%l"  "\C-d" "Remove breakpoint at current 
line")
@@ -2418,7 +2418,7 @@ gud, see `gud-mode'."
 
   (gud-common-init command-line 'gud-jdb-massage-args
                   'gud-jdb-marker-filter)
-  (set (make-local-variable 'gud-minor-mode) 'jdb)
+  (setq-local gud-minor-mode 'jdb)
 
   ;; If a -classpath option was provided, set gud-jdb-classpath
   (if gud-jdb-classpath-string
@@ -2569,14 +2569,14 @@ Other commands for interacting with the debugger 
process are inherited from
 comint mode, which see."
   (setq mode-line-process '(":%s"))
   (define-key (current-local-map) "\C-c\C-l" 'gud-refresh)
-  (set (make-local-variable 'gud-last-frame) nil)
+  (setq-local gud-last-frame nil)
   (if (boundp 'tool-bar-map)            ; not --without-x
       (setq-local tool-bar-map gud-tool-bar-map))
   (make-local-variable 'comint-prompt-regexp)
   ;; Don't put repeated commands in command history many times.
-  (set (make-local-variable 'comint-input-ignoredups) t)
+  (setq-local comint-input-ignoredups t)
   (make-local-variable 'paragraph-start)
-  (set (make-local-variable 'gud-delete-prompt-marker) (make-marker))
+  (setq-local gud-delete-prompt-marker (make-marker))
   (add-hook 'kill-buffer-hook 'gud-kill-buffer-hook nil t))
 
 (defcustom gud-chdir-before-run t
@@ -2649,10 +2649,10 @@ comint mode, which see."
           (if massage-args (funcall massage-args file args) args))
     ;; Since comint clobbered the mode, we don't set it until now.
     (gud-mode)
-    (set (make-local-variable 'gud-target-name)
+    (setq-local gud-target-name
         (and file-word (file-name-nondirectory file))))
-  (set (make-local-variable 'gud-marker-filter) marker-filter)
-  (if find-file (set (make-local-variable 'gud-find-file) find-file))
+  (setq-local gud-marker-filter marker-filter)
+  (if find-file (setq-local gud-find-file find-file))
   (setq gud-last-last-frame nil)
 
   (set-process-filter (get-buffer-process (current-buffer)) 'gud-filter)
@@ -3348,23 +3348,23 @@ Treats actions as defuns."
 ;;;###autoload
 (define-derived-mode gdb-script-mode prog-mode "GDB-Script"
   "Major mode for editing GDB scripts."
-  (set (make-local-variable 'comment-start) "#")
-  (set (make-local-variable 'comment-start-skip) "#+\\s-*")
-  (set (make-local-variable 'outline-regexp) "[ \t]")
-  (set (make-local-variable 'imenu-generic-expression)
-       '((nil "^define[ \t]+\\(\\w+\\)" 1)))
-  (set (make-local-variable 'indent-line-function) 'gdb-script-indent-line)
-  (set (make-local-variable 'beginning-of-defun-function)
-       #'gdb-script-beginning-of-defun)
-  (set (make-local-variable 'end-of-defun-function)
-       #'gdb-script-end-of-defun)
-  (set (make-local-variable 'font-lock-defaults)
-       '(gdb-script-font-lock-keywords nil nil ((?_ . "w")) nil
-        (font-lock-syntactic-face-function
-         . gdb-script-font-lock-syntactic-face)))
+  (setq-local comment-start "#")
+  (setq-local comment-start-skip "#+\\s-*")
+  (setq-local outline-regexp "[ \t]")
+  (setq-local imenu-generic-expression
+              '((nil "^define[ \t]+\\(\\w+\\)" 1)))
+  (setq-local indent-line-function 'gdb-script-indent-line)
+  (setq-local beginning-of-defun-function
+              #'gdb-script-beginning-of-defun)
+  (setq-local end-of-defun-function
+              #'gdb-script-end-of-defun)
+  (setq-local font-lock-defaults
+              '(gdb-script-font-lock-keywords nil nil ((?_ . "w")) nil
+                (font-lock-syntactic-face-function
+                 . gdb-script-font-lock-syntactic-face)))
   ;; Recognize docstrings.
-  (set (make-local-variable 'syntax-propertize-function)
-       gdb-script-syntax-propertize-function)
+  (setq-local syntax-propertize-function
+              gdb-script-syntax-propertize-function)
   (add-hook 'syntax-propertize-extend-region-functions
             #'syntax-propertize-multiline 'append 'local))
 
@@ -3471,8 +3471,8 @@ only tooltips in the buffer containing the overlay arrow."
 ACTIVATEP non-nil means activate mouse motion events."
   (if activatep
       (progn
-        (set (make-local-variable 'gud-tooltip-mouse-motions-active) t)
-        (set (make-local-variable 'track-mouse) t))
+        (setq-local gud-tooltip-mouse-motions-active t)
+        (setq-local track-mouse t))
     (when gud-tooltip-mouse-motions-active
       (kill-local-variable 'gud-tooltip-mouse-motions-active)
       (kill-local-variable 'track-mouse))))
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index 4dee72c..c882b7b 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -948,7 +948,7 @@ Key bindings:
         (add-hook 'change-major-mode-hook
                   #'turn-off-hideshow
                   nil t)
-        (set (make-local-variable 'line-move-ignore-invisible) t)
+        (setq-local line-move-ignore-invisible t)
         (add-to-invisibility-spec '(hs . t)))
     (remove-from-invisibility-spec '(hs . t))
     ;; hs-show-all does nothing unless h-m-m is non-nil.
diff --git a/lisp/progmodes/icon.el b/lisp/progmodes/icon.el
index bb43215..dd0ee95 100644
--- a/lisp/progmodes/icon.el
+++ b/lisp/progmodes/icon.el
@@ -163,25 +163,24 @@ Variables controlling indentation style:
 Turning on Icon mode calls the value of the variable `icon-mode-hook'
 with no args, if that value is non-nil."
   :abbrev-table icon-mode-abbrev-table
-  (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter))
-  (set (make-local-variable 'paragraph-separate) paragraph-start)
-  (set (make-local-variable 'indent-line-function) #'icon-indent-line)
-  (set (make-local-variable 'comment-start) "# ")
-  (set (make-local-variable 'comment-end) "")
-  (set (make-local-variable 'comment-start-skip) "# *")
-  (set (make-local-variable 'comment-indent-function) 'icon-comment-indent)
-  (set (make-local-variable 'indent-line-function) 'icon-indent-line)
+  (setq-local paragraph-start (concat "$\\|" page-delimiter))
+  (setq-local paragraph-separate paragraph-start)
+  (setq-local indent-line-function #'icon-indent-line)
+  (setq-local comment-start "# ")
+  (setq-local comment-end "")
+  (setq-local comment-start-skip "# *")
+  (setq-local comment-indent-function 'icon-comment-indent)
+  (setq-local indent-line-function 'icon-indent-line)
   ;; font-lock support
-  (set (make-local-variable 'font-lock-defaults)
-       '((icon-font-lock-keywords
-          icon-font-lock-keywords-1 icon-font-lock-keywords-2)
-         nil nil ((?_ . "w")) beginning-of-defun
-         ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP.
-         ;;(font-lock-comment-start-regexp . "#")
-         (font-lock-mark-block-function . mark-defun)))
+  (setq-local font-lock-defaults
+              '((icon-font-lock-keywords
+                 icon-font-lock-keywords-1 icon-font-lock-keywords-2)
+                nil nil ((?_ . "w")) beginning-of-defun
+                ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP.
+                ;;(font-lock-comment-start-regexp . "#")
+                (font-lock-mark-block-function . mark-defun)))
   ;; imenu support
-  (set (make-local-variable 'imenu-generic-expression)
-       icon-imenu-generic-expression)
+  (setq-local imenu-generic-expression icon-imenu-generic-expression)
   ;; hideshow support
   ;; we start from the assertion that `hs-special-modes-alist' is autoloaded.
   (unless (assq 'icon-mode hs-special-modes-alist)
diff --git a/lisp/progmodes/ld-script.el b/lisp/progmodes/ld-script.el
index b17f255..656af69 100644
--- a/lisp/progmodes/ld-script.el
+++ b/lisp/progmodes/ld-script.el
@@ -173,10 +173,9 @@
 ;;;###autoload
 (define-derived-mode ld-script-mode prog-mode "LD-Script"
    "A major mode to edit GNU ld script files"
-  (set (make-local-variable 'comment-start) "/* ")
-  (set (make-local-variable 'comment-end)   " */")
-  (set (make-local-variable 'font-lock-defaults)
-       '(ld-script-font-lock-keywords nil)))
+  (setq-local comment-start "/* ")
+  (setq-local comment-end   " */")
+  (setq-local font-lock-defaults '(ld-script-font-lock-keywords nil)))
 
 (provide 'ld-script)
 
diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el
index b9f6059..1f88e87 100644
--- a/lisp/progmodes/mixal-mode.el
+++ b/lisp/progmodes/mixal-mode.el
@@ -1141,18 +1141,18 @@ Assumes that file has been compiled with debugging 
support."
 ;;;###autoload
 (define-derived-mode mixal-mode prog-mode "mixal"
   "Major mode for the mixal asm language."
-  (set (make-local-variable 'comment-start) "*")
-  (set (make-local-variable 'comment-start-skip) "^\\*[ \t]*")
-  (set (make-local-variable 'font-lock-defaults)
-       '(mixal-font-lock-keywords))
-  (set (make-local-variable 'syntax-propertize-function)
-       mixal-syntax-propertize-function)
+  (setq-local comment-start "*")
+  (setq-local comment-start-skip "^\\*[ \t]*")
+  (setq-local font-lock-defaults
+              '(mixal-font-lock-keywords))
+  (setq-local syntax-propertize-function
+              mixal-syntax-propertize-function)
   ;; might add an indent function in the future
-  ;;  (set (make-local-variable 'indent-line-function) 'mixal-indent-line)
-  (set (make-local-variable 'compile-command)
-       (concat "mixasm "
-              (if buffer-file-name
-                  (shell-quote-argument buffer-file-name)))))
+  ;;  (setq-local indent-line-function 'mixal-indent-line)
+  (setq-local compile-command
+              (concat "mixasm "
+                      (if buffer-file-name
+                          (shell-quote-argument buffer-file-name)))))
 
 (provide 'mixal-mode)
 
diff --git a/lisp/progmodes/modula2.el b/lisp/progmodes/modula2.el
index aa41230..a77a4e2 100644
--- a/lisp/progmodes/modula2.el
+++ b/lisp/progmodes/modula2.el
@@ -308,14 +308,14 @@ followed by the first character of the construct.
    `m2-indent' controls the number of spaces for each indentation.
    `m2-compile-command' holds the command to compile a Modula-2 program.
    `m2-link-command' holds the command to link a Modula-2 program."
-  (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter))
-  (set (make-local-variable 'paragraph-separate) paragraph-start)
-  (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
-  (set (make-local-variable 'comment-start) "(* ")
-  (set (make-local-variable 'comment-end) " *)")
-  (set (make-local-variable 'comment-start-skip) "\\(?:(\\*+\\|//+\\) *")
-  (set (make-local-variable 'parse-sexp-ignore-comments) t)
-  (set (make-local-variable 'font-lock-defaults)
+  (setq-local paragraph-start (concat "$\\|" page-delimiter))
+  (setq-local paragraph-separate paragraph-start)
+  (setq-local paragraph-ignore-fill-prefix t)
+  (setq-local comment-start "(* ")
+  (setq-local comment-end " *)")
+  (setq-local comment-start-skip "\\(?:(\\*+\\|//+\\) *")
+  (setq-local parse-sexp-ignore-comments t)
+  (setq-local font-lock-defaults
        '((m3-font-lock-keywords
           m3-font-lock-keywords-1 m3-font-lock-keywords-2)
          nil nil ((?_ . "w") (?. . "w") (?< . ". 1") (?> . ". 4")) nil
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index bb19436..fd8a51b 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -299,12 +299,21 @@
                ;; $a = "foo y \"toto\" bar" where we'd end up changing the
                ;; syntax of the backslash and hence de-escaping the embedded
                ;; double quote.
-               (put-text-property (match-beginning 3) (match-end 3)
-                                  'syntax-table
-                                  (if (assoc (char-after (match-beginning 3))
-                                             perl-quote-like-pairs)
-                                      (string-to-syntax "|")
-                                    (string-to-syntax "\"")))
+               (let* ((b3 (match-beginning 3))
+                      (c (char-after b3)))
+                 (put-text-property
+                  b3 (match-end 3) 'syntax-table
+                  (cond
+                   ((assoc c perl-quote-like-pairs)
+                    (string-to-syntax "|"))
+                   ;; If the separator is a normal quote and the operation
+                   ;; only takes a single arg, then there's nothing
+                   ;; special to do.
+                   ((and (memq c '(?\" ?\'))
+                         (memq (char-after (match-beginning 2)) '(?m ?q)))
+                    nil)
+                   (t
+                    (string-to-syntax "\"")))))
                (perl-syntax-propertize-special-constructs end))))))
       ;; Here documents.
       ((concat
@@ -379,7 +388,8 @@
             (put-text-property (1- (point)) (point) 'syntax-table
                                (string-to-syntax "> c"))))))
      ((or (null (setq char (nth 3 state)))
-          (and (characterp char) (eq (char-syntax (nth 3 state)) ?\")))
+          (and (characterp char)
+               (null (get-text-property (nth 8 state) 'syntax-table))))
       ;; Normal text, or comment, or docstring, or normal string.
       nil)
      ((eq (nth 3 state) ?\n)
@@ -400,6 +410,7 @@
                                                (point)))
                                '("tr" "s" "y"))))
             (close (cdr (assq char perl-quote-like-pairs)))
+            (middle nil)
             (st (perl-quote-syntax-table char)))
         (when (with-syntax-table st
                (if close
@@ -430,6 +441,7 @@
                           ;; In the case of s{...}{...}, we only handle the
                           ;; first part here and the next below.
                           (when (and twoargs (not close))
+                            (setq middle (point))
                             (nth 8 (parse-partial-sexp
                                     (point) limit
                                     nil nil state 'syntax-table)))))))
@@ -437,11 +449,14 @@
          (when (eq (char-before (1- (point))) ?$)
            (put-text-property (- (point) 2) (1- (point))
                               'syntax-table '(1)))
-         (put-text-property (1- (point)) (point)
-                            'syntax-table
-                            (if close
-                                (string-to-syntax "|")
-                              (string-to-syntax "\"")))
+         (if (and middle (memq char '(?\" ?\')))
+             (put-text-property (1- middle) middle
+                            'syntax-table '(1))
+           (put-text-property (1- (point)) (point)
+                              'syntax-table
+                              (if close
+                                  (string-to-syntax "|")
+                                (string-to-syntax "\""))))
          ;; If we have two args with a non-self-paired starter (e.g.
          ;; s{...}{...}) we're right after the first arg, so we still have to
          ;; handle the second part.
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index a395453..449eadc 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -322,7 +322,7 @@ to find the list of ignores for each directory."
   :group 'project)
 
 (defcustom project-vc-ignores nil
-  "List of patterns to include in `project-ignores'."
+  "List of patterns to add to `project-ignores'."
   :type '(repeat string)
   :safe #'listp)
 
@@ -434,16 +434,17 @@ backend implementation of `project-external-roots'.")
 (cl-defmethod project-files ((project (head vc)) &optional dirs)
   (mapcan
    (lambda (dir)
-     (let (backend)
+     (let ((ignores (project--value-in-dir 'project-vc-ignores dir))
+           backend)
        (if (and (file-equal-p dir (cdr project))
                 (setq backend (vc-responsible-backend dir))
                 (cond
                  ((eq backend 'Hg))
                  ((and (eq backend 'Git)
                        (or
-                        (not project-vc-ignores)
+                        (not ignores)
                         (version<= "1.9" (vc-git--program-version)))))))
-           (project--vc-list-files dir backend project-vc-ignores)
+           (project--vc-list-files dir backend ignores)
          (project--files-in-directory
           dir
           (project--dir-ignores project dir)))))
@@ -467,9 +468,26 @@ backend implementation of `project-external-roots'.")
                             (cons "--"
                                   (mapcar
                                    (lambda (i)
-                                     (if (string-match "\\./" i)
-                                         (format ":!/:%s" (substring i 2))
-                                       (format ":!:%s" i)))
+                                     (format
+                                      ":(exclude,glob,top)%s"
+                                      (if (string-match "\\*\\*" i)
+                                          ;; Looks like pathspec glob
+                                          ;; format already.
+                                          i
+                                        (if (string-match "\\./" i)
+                                            ;; ./abc -> abc
+                                            (setq i (substring i 2))
+                                          ;; abc -> **/abc
+                                          (setq i (concat "**/" i))
+                                          ;; FIXME: '**/abc' should also
+                                          ;; match a directory with that
+                                          ;; name, but doesn't (git 2.25.1).
+                                          ;; Maybe we should replace
+                                          ;; such entries with two.
+                                          (if (string-match "/\\'" i)
+                                              ;; abc/ -> abc/**
+                                              (setq i (concat i "**"))))
+                                        i)))
                                    extra-ignores)))))
        (setq files
              (mapcar
@@ -534,12 +552,26 @@ backend implementation of `project-external-roots'.")
     (append
      (when (file-equal-p dir root)
        (setq backend (vc-responsible-backend root))
-       (mapcar
-        (lambda (entry)
-          (if (string-match "\\`/" entry)
-              (replace-match "./" t t entry)
-            entry))
-        (vc-call-backend backend 'ignore-completion-table root)))
+       (delq
+        nil
+        (mapcar
+         (lambda (entry)
+           (cond
+            ((eq ?! (aref entry 0))
+             ;; No support for whitelisting (yet).
+             nil)
+            ((string-match "\\(/\\)[^/]" entry)
+             ;; FIXME: This seems to be Git-specific.
+             ;; And / in the entry (start or even the middle) means
+             ;; the pattern is "rooted".  Or actually it is then
+             ;; relative to its respective .gitignore (of which there
+             ;; could be several), but we only support .gitignore at
+             ;; the root.
+             (if (= (match-beginning 0) 0)
+                 (replace-match "./" t t entry 1)
+               (concat "./" entry)))
+            (t entry)))
+         (vc-call-backend backend 'ignore-completion-table root))))
      (project--value-in-dir 'project-vc-ignores root)
      (mapcar
       (lambda (dir)
@@ -745,7 +777,9 @@ pattern to search for."
 ;;;###autoload
 (defun project-find-file ()
   "Visit a file (with completion) in the current project.
-The completion default is the string at point."
+
+The completion default is the filename at point, determined by
+`thing-at-point' (whether such file exists or not)."
   (interactive)
   (let* ((pr (project-current t))
          (dirs (list (project-root pr))))
@@ -754,7 +788,9 @@ The completion default is the string at point."
 ;;;###autoload
 (defun project-or-external-find-file ()
   "Visit a file (with completion) in the current project or external roots.
-The completion default is the string at point."
+
+The completion default is the filename at point, determined by
+`thing-at-point' (whether such file exists or not)."
   (interactive)
   (let* ((pr (project-current t))
          (dirs (cons
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 091456a..e9c3b39 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3197,6 +3197,8 @@ the python shell:
            (line-beginning-position) (line-end-position))))
       (buffer-substring-no-properties (point-min) (point-max)))))
 
+(declare-function compilation-forget-errors "compile")
+
 (defun python-shell-send-region (start end &optional send-main msg
                                        no-cookie)
   "Send the region delimited by START and END to inferior Python process.
@@ -3214,6 +3216,10 @@ process running; defaults to t when called 
interactively."
          (original-string (buffer-substring-no-properties start end))
          (_ (string-match "\\`\n*\\(.*\\)" original-string)))
     (message "Sent: %s..." (match-string 1 original-string))
+    ;; Recalculate positions to avoid landing on the wrong line if
+    ;; lines have been removed/added.
+    (with-current-buffer (process-buffer process)
+      (compilation-forget-errors))
     (python-shell-send-string string process)))
 
 (defun python-shell-send-statement (&optional send-main msg)
diff --git a/lisp/progmodes/simula.el b/lisp/progmodes/simula.el
index be3edfd..44d4a9c 100644
--- a/lisp/progmodes/simula.el
+++ b/lisp/progmodes/simula.el
@@ -365,22 +365,22 @@ Variables controlling indentation style:
 
 Turning on SIMULA mode calls the value of the variable simula-mode-hook
 with no arguments, if that value is non-nil."
-  (set (make-local-variable 'comment-column) 40)
-  ;; (set (make-local-variable 'end-comment-column) 75)
-  (set (make-local-variable 'paragraph-start) "[ \t]*$\\|\f")
-  (set (make-local-variable 'paragraph-separate) paragraph-start)
-  (set (make-local-variable 'indent-line-function) 'simula-indent-line)
-  (set (make-local-variable 'comment-start) "! ")
-  (set (make-local-variable 'comment-end) " ;")
-  (set (make-local-variable 'comment-start-skip) "!+ *")
-  (set (make-local-variable 'parse-sexp-ignore-comments) nil)
-  (set (make-local-variable 'comment-multi-line) t)
-  (set (make-local-variable 'font-lock-defaults)
-       '((simula-font-lock-keywords simula-font-lock-keywords-1
-          simula-font-lock-keywords-2 simula-font-lock-keywords-3)
-         nil t ((?_ . "w"))))
-  (set (make-local-variable 'syntax-propertize-function)
-       simula-syntax-propertize-function)
+  (setq-local comment-column 40)
+  ;; (setq-local end-comment-column 75)
+  (setq-local paragraph-start "[ \t]*$\\|\f")
+  (setq-local paragraph-separate paragraph-start)
+  (setq-local indent-line-function 'simula-indent-line)
+  (setq-local comment-start "! ")
+  (setq-local comment-end " ;")
+  (setq-local comment-start-skip "!+ *")
+  (setq-local parse-sexp-ignore-comments nil)
+  (setq-local comment-multi-line t)
+  (setq-local font-lock-defaults
+              '((simula-font-lock-keywords simula-font-lock-keywords-1
+                 simula-font-lock-keywords-2 simula-font-lock-keywords-3)
+                nil t ((?_ . "w"))))
+  (setq-local syntax-propertize-function
+              simula-syntax-propertize-function)
   (abbrev-mode 1))
 
 (defun simula-indent-exp ()
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 2209939..0bf9a51 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -232,7 +232,6 @@
 
 (require 'cl-lib)
 (require 'comint)
-(require 'custom)
 (require 'thingatpt)
 (require 'view)
 (eval-when-compile (require 'subr-x))   ; string-empty-p
diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el
index 0f2c943..b0df909 100644
--- a/lisp/progmodes/subword.el
+++ b/lisp/progmodes/subword.el
@@ -332,7 +332,7 @@ as parts of words: e.g., in `superword-mode',
 searching subwords in order to avoid unwanted reentrancy.")
 
 (defun subword-setup-buffer ()
-  (set (make-local-variable 'find-word-boundary-function-table)
+  (setq-local find-word-boundary-function-table
        (if (or subword-mode superword-mode)
            subword-find-word-boundary-function-table
          subword-empty-char-table)))
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index 266f40a..a524bba 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -293,7 +293,7 @@ If no function name is found, return nil."
                 (null which-function-imenu-failed))
         (ignore-errors (imenu--make-index-alist t))
         (unless imenu--index-alist
-          (set (make-local-variable 'which-function-imenu-failed) t)))
+          (setq-local which-function-imenu-failed t)))
       ;; If we have an index alist, use it.
       (when (and (null name)
                 (boundp 'imenu--index-alist) imenu--index-alist)
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index e1dd6e5..9f5fc57 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -931,6 +931,46 @@ local keymap that binds `RET' to 
`xref-quit-and-goto-xref'."
                        '(display-buffer-in-direction . ((direction . below))))
         (current-buffer))))))
 
+(defun xref--show-defs-minibuffer (fetcher alist)
+  (let* ((xrefs (funcall fetcher))
+         (xref-alist (xref--analyze xrefs))
+         xref-alist-with-line-info
+         xref
+         (group-prefix-length
+          ;; FIXME: Groups are not always file names, but they often
+          ;; are.  At least this shouldn't make the other kinds of
+          ;; groups look worse.
+          (let ((common-prefix (try-completion "" xref-alist)))
+            (if (> (length common-prefix) 0)
+                (length (file-name-directory common-prefix))
+              0))))
+
+    (cl-loop for ((group . xrefs) . more1) on xref-alist
+             do
+             (cl-loop for (xref . more2) on xrefs do
+                      (with-slots (summary location) xref
+                        (let* ((line (xref-location-line location))
+                               (line-fmt
+                                (if line
+                                    (format #("%d:" 0 2 (face 
xref-line-number))
+                                            line)
+                                  ""))
+                               (group-fmt
+                                (propertize
+                                 (substring group group-prefix-length)
+                                 'face 'xref-file-header))
+                               (candidate
+                                (format "%s:%s%s" group-fmt line-fmt summary)))
+                          (push (cons candidate xref) 
xref-alist-with-line-info)))))
+
+    (setq xref (if (not (cdr xrefs))
+                   (car xrefs)
+                 (cdr (assoc (completing-read "Jump to definition: "
+                                              (reverse 
xref-alist-with-line-info))
+                             xref-alist-with-line-info))))
+
+    (xref-pop-to-location xref (assoc-default 'display-action alist))))
+
 
 (defcustom xref-show-xrefs-function 'xref--show-xref-buffer
   "Function to display a list of search results.
@@ -1262,12 +1302,57 @@ IGNORES is a list of glob patterns for files to ignore."
 (declare-function tramp-tramp-file-p "tramp")
 (declare-function tramp-file-local-name "tramp")
 
+;; TODO: Experiment with 'xargs -P4' (or any other number).
+;; This speeds up either command, even more than rg's '-j4' does.
+;; Ripgrep gets jumbled output, though, even with --line-buffered.
+;; But Grep seems to be stable. Even without --line-buffered.
+(defcustom xref-search-program-alist
+  '((grep
+     .
+     ;; '-s' because 'git ls-files' can output broken symlinks.
+     "xargs -0 grep <C> -snHE -e <R>")
+    (ripgrep
+     .
+     ;; Note: by default, ripgrep's output order is non-deterministic
+     ;; (https://github.com/BurntSushi/ripgrep/issues/152)
+     ;; because it does the search in parallel.  You can use the template
+     ;; without the '| sort ...' part if GNU sort is not available on
+     ;; your system and/or stable ordering is not important to you.
+     ;; Note#2: '!*/' is there to filter out dirs (e.g. submodules).
+     "xargs -0 rg <C> -nH --no-messages -g '!*/' -e <R> | sort -t: -k1,1 
-k2n,2"
+     ))
+  "Associative list mapping program identifiers to command templates.
+
+Program identifier should be a symbol, named after the search program.
+
+The command template must be a shell command (or usually a
+pipeline) that will search the files based on the list of file
+names that is piped from stdin, separated by null characters.
+The template should have the following fields:
+
+  <C> for extra arguments such as -i and --color
+  <R> for the regexp itself (in Extended format)"
+  :type '(repeat
+          (cons (symbol :tag "Program identifier")
+                (string :tag "Command template"))))
+
+(defcustom xref-search-program 'grep
+  "The program to use for regexp search inside files.
+
+This must reference a corresponding entry in `xref-search-program-alist'."
+  :type `(choice
+          (const :tag "Use Grep" grep)
+          (const :tag "Use ripgrep" ripgrep)
+          (symbol :tag "User defined")))
+
 ;;;###autoload
 (defun xref-matches-in-files (regexp files)
   "Find all matches for REGEXP in FILES.
 Return a list of xref values.
 FILES must be a list of absolute file names."
   (cl-assert (consp files))
+  (require 'grep)
+  (defvar grep-highlight-matches)
   (pcase-let*
       ((output (get-buffer-create " *project grep output*"))
        (`(,grep-re ,file-group ,line-group . ,_) (car grep-regexp-alist))
@@ -1277,13 +1362,17 @@ FILES must be a list of absolute file names."
        ;; first file is remote, they all are, and on the same host.
        (dir (file-name-directory (car files)))
        (remote-id (file-remote-p dir))
-       ;; 'git ls-files' can output broken symlinks.
-       (command (format "xargs -0 grep %s -snHE -e %s"
-                        (if (and case-fold-search
-                                 (isearch-no-upper-case-p regexp t))
-                            "-i"
-                          "")
-                        (shell-quote-argument (xref--regexp-to-extended 
regexp)))))
+       ;; The 'auto' default would be fine too, but ripgrep can't handle
+       ;; the options we pass in that case.
+       (grep-highlight-matches nil)
+       (command (grep-expand-template (cdr
+                                       (or
+                                        (assoc
+                                         xref-search-program
+                                         xref-search-program-alist)
+                                        (user-error "Unknown search program 
`%s'"
+                                                    xref-search-program)))
+                                      (xref--regexp-to-extended regexp))))
     (when remote-id
       (require 'tramp)
       (setq files (mapcar
diff --git a/lisp/savehist.el b/lisp/savehist.el
index 5d20239..8931e83 100644
--- a/lisp/savehist.el
+++ b/lisp/savehist.el
@@ -47,8 +47,6 @@
 
 ;;; Code:
 
-(require 'custom)
-
 ;; User variables
 
 (defgroup savehist nil
diff --git a/lisp/shell.el b/lisp/shell.el
index 51937cd..5fed651 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -265,10 +265,11 @@ see the function `dirtrack-mode'."
   :group 'shell-directories)
 
 (defcustom explicit-shell-file-name nil
-  "If non-nil, is file name to use for explicitly requested inferior shell.
-When nil, such interactive shell sessions fallback to using either
-the shell specified in $ESHELL or in `shell-file-name'."
-  :type '(choice (const :tag "None" nil) file)
+  "If non-nil, the file name to use for explicitly requested inferior shells.
+When nil, such interactive shell sessions fall back to using the
+shell specified in either the environment variable \"ESHELL\" or
+`shell-file-name'."
+  :type '(choice (const :tag "Default" nil) file)
   :group 'shell)
 
 ;; Note: There are no explicit references to the variable `explicit-csh-args'.
@@ -748,16 +749,15 @@ Make the shell buffer the current buffer, and return it.
 
   (with-connection-local-variables
    ;; On remote hosts, the local `shell-file-name' might be useless.
-   (when (file-remote-p default-directory)
-     (if (and (called-interactively-p 'any)
+   (when (and (file-remote-p default-directory)
+              (called-interactively-p 'any)
               (null explicit-shell-file-name)
               (null (getenv "ESHELL")))
-         (set (make-local-variable 'explicit-shell-file-name)
-              (file-local-name
-              (expand-file-name
-                (read-file-name
-                 "Remote shell path: " default-directory shell-file-name
-                 t shell-file-name))))))
+     (setq-local explicit-shell-file-name
+                 (file-local-name
+                  (expand-file-name
+                   (read-file-name "Remote shell path: " default-directory
+                                   shell-file-name t shell-file-name)))))
 
    ;; Rain or shine, BUFFER must be current by now.
    (unless (comint-check-proc buffer)
diff --git a/lisp/simple.el b/lisp/simple.el
index 93fda7d..3c4f756 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3786,6 +3786,7 @@ a shell (with its need to quote arguments)."
   (shell-command command output-buffer error-buffer))
 
 (declare-function comint-output-filter "comint" (process string))
+(declare-function comint-term-environment "comint" ())
 
 (defun shell-command (command &optional output-buffer error-buffer)
   "Execute string COMMAND in inferior shell; display output, if any.
@@ -3964,15 +3965,19 @@ impose the use of a shell (with its need to quote 
arguments)."
                (with-current-buffer buffer
                   (shell-command-save-pos-or-erase)
                  (setq default-directory directory)
-                 (let ((process-environment
-                        (if (natnump async-shell-command-width)
-                            (cons (format "COLUMNS=%d" 
async-shell-command-width)
-                                  process-environment)
-                          process-environment)))
+                  (require 'shell)
+                  (let ((process-environment
+                         (append
+                          (and (natnump async-shell-command-width)
+                               (list
+                                (format "COLUMNS=%d"
+                                        async-shell-command-width)))
+                          (comint-term-environment)
+                          process-environment)))
                    (setq proc
                          (start-process-shell-command "Shell" buffer command)))
                  (setq mode-line-process '(":%s"))
-                 (require 'shell) (shell-mode)
+                  (shell-mode)
                   (set-process-sentinel proc #'shell-command-sentinel)
                  ;; Use the comint filter for proper handling of
                  ;; carriage motion (see comint-inhibit-carriage-motion).
@@ -5459,6 +5464,8 @@ With ARG, rotate that many kills forward (or backward, if 
negative)."
 (defvar read-from-kill-ring-history)
 (defun read-from-kill-ring ()
   "Read a string from `kill-ring' using completion and minibuffer history."
+  ;; `current-kill' updates `kill-ring' with a possible interprogram-paste
+  (current-kill 0)
   (let* ((history-add-new-input nil)
          (ellipsis (if (char-displayable-p ?…) "…" "..."))
          ;; Remove keymaps from text properties of copied string,
@@ -6419,7 +6426,8 @@ for it.")
             (<= position (point-max)))
        (if widen-automatically
            (widen)
-         (error "Global mark position is outside accessible part of buffer")))
+         (error "Global mark position is outside accessible part of buffer %s"
+                 (buffer-name buffer))))
     (goto-char position)
     (switch-to-buffer buffer)))
 
diff --git a/lisp/so-long.el b/lisp/so-long.el
index 6ae8d0a..431073a 100644
--- a/lisp/so-long.el
+++ b/lisp/so-long.el
@@ -50,15 +50,14 @@
 ;; performance further, as well as making the so-long activity more obvious to
 ;; the user.  These kinds of minified files are typically not intended to be
 ;; edited, so not providing the usual editing mode in such cases will rarely be
-;; an issue.  However, should the user wish to do so, the original state of the
-;; buffer may be reinstated by calling `so-long-revert' (the key binding for
-;; which is advertised when the major mode change occurs).  If you prefer that
-;; the major mode not be changed, the `so-long-minor-mode' action can be
-;; configured.
+;; an issue.  However, you can reinstate the original state of the buffer by
+;; calling `so-long-revert' (the key binding of which is advertised when the 
major
+;; mode change occurs).  If you prefer that the major mode not be changed, you
+;; can customize the `so-long-minor-mode' action.
 ;;
 ;; The user options `so-long-action' and `so-long-action-alist' determine what
-;; will happen when `so-long' and `so-long-revert' are invoked, allowing
-;; alternative actions (including custom actions) to be configured.  As well as
+;; actions `so-long' and `so-long-revert' will take.  This allows you to 
configure
+;; alternative actions (including custom actions).  As well as
 ;; the major and minor mode actions provided by this library, `longlines-mode'
 ;; is also supported by default as an alternative action.
 ;;
diff --git a/lisp/subr.el b/lisp/subr.el
index c07d615..9f78471 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4264,11 +4264,7 @@ Optional FIXEDCASE, LITERAL, STRING and SUBEXP have the 
same
 meaning as for `replace-match'."
   (let ((match (match-string 0 string)))
     (save-match-data
-      (set-match-data (mapcar (lambda (x)
-                               (if (numberp x)
-                                   (- x (match-beginning 0))
-                                 x))
-                             (match-data t)))
+      (match-data--translate (- (match-beginning 0)))
       (replace-match replacement fixedcase literal match subexp))))
 
 
@@ -5267,6 +5263,8 @@ use `called-interactively-p'.
 
 To test whether a function can be called interactively, use
 `commandp'."
+  ;; Kept around for now.  See discussion at:
+  ;; https://lists.gnu.org/r/emacs-devel/2020-08/msg00564.html
   (declare (obsolete called-interactively-p "23.2"))
   (called-interactively-p 'interactive))
 
diff --git a/lisp/term.el b/lisp/term.el
index 148d7a7..34dc287 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -299,17 +299,13 @@
 ;; so it is important to increase it if there are protocol-relevant changes.
 (defconst term-protocol-version "0.96")
 
-(eval-when-compile (require 'ange-ftp))
-(eval-when-compile (require 'cl-lib))
-(require 'ring)
-(require 'ehelp)
+(eval-when-compile
+  (require 'ange-ftp)
+  (require 'cl-lib))
 (require 'comint) ; Password regexp.
-
-(declare-function ring-empty-p "ring" (ring))
-(declare-function ring-ref "ring" (ring index))
-(declare-function ring-insert-at-beginning "ring" (ring item))
-(declare-function ring-length "ring" (ring))
-(declare-function ring-insert "ring" (ring item))
+(require 'ehelp)
+(require 'ring)
+(require 'shell)
 
 (defgroup term nil
   "General command interpreter in a window."
@@ -393,11 +389,6 @@ by moving term-home-marker.  It is set to t if there is a
 (defvar-local term-line-mode-buffer-read-only nil
   "The `buffer-read-only' state to set in `term-line-mode'.")
 
-(defcustom explicit-shell-file-name nil
-  "If non-nil, is file name to use for explicitly requested inferior shell."
-  :type '(choice (const nil) file)
-  :group 'term)
-
 (defvar term-prompt-regexp "^"
   "Regexp to recognize prompts in the inferior process.
 Defaults to \"^\", the null string at BOL.
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 8273c06..99cead9 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -47,7 +47,6 @@
 ;; Documentation-purposes only: actually loaded in loadup.el.
 (require 'frame)
 (require 'mouse)
-(require 'faces)
 (require 'menu-bar)
 (require 'fontset)
 (require 'dnd)
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index 375a23e..4ed2710 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -72,7 +72,6 @@
 (require 'frame)
 (require 'mouse)
 (require 'scroll-bar)
-(require 'faces)
 (require 'select)
 (require 'menu-bar)
 (require 'dnd)
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 42a6f40..6069272 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -75,7 +75,6 @@
 (require 'frame)
 (require 'mouse)
 (require 'scroll-bar)
-(require 'faces)
 (require 'select)
 (require 'menu-bar)
 (require 'fontset)
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 1a727e3..7094100 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -767,7 +767,8 @@ Can be nil to mean \"no timeout\".")
 By not redisplaying right away for xterm queries, we can avoid
 unsightly flashing during initialization. Give up and redisplay
 anyway if we've been waiting a little while."
-  (let ((start-time (current-time)))
+  (let ((start-time (current-time))
+        (inhibit--record-char t))
     (or (let ((inhibit-redisplay t))
           (read-event nil nil xterm-query-redisplay-timeout))
         (read-event nil nil
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index 90e8d36..cc2eaf1 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -1413,32 +1413,20 @@ Keymap summary
   (aset artist-replacement-table ?\t ?\s)
   (aset artist-replacement-table 0 ?\s)
   ;; More setup
-  (make-local-variable 'artist-key-is-drawing)
-  (make-local-variable 'artist-key-endpoint1)
-  (make-local-variable 'artist-key-poly-point-list)
-  (make-local-variable 'artist-key-shape)
-  (make-local-variable 'artist-key-draw-how)
-  (make-local-variable 'artist-popup-menu-table)
-  (make-local-variable 'artist-key-compl-table)
-  (make-local-variable 'artist-prev-next-op-alist)
-  (make-local-variable 'artist-rb-save-data)
-  (make-local-variable 'artist-arrow-point-1)
-  (make-local-variable 'artist-arrow-point-2)
-  (setq artist-key-is-drawing nil)
-  (setq artist-key-endpoint1 nil)
-  (setq artist-key-poly-point-list nil)
-  (setq artist-key-shape nil)
-  (setq artist-popup-menu-table (artist-compute-popup-menu-table artist-mt))
-  (setq artist-key-compl-table (artist-compute-key-compl-table artist-mt))
-  (setq artist-prev-next-op-alist
-       (artist-make-prev-next-op-alist artist-key-compl-table))
-  (setq artist-rb-save-data (make-vector 7 0))
-  (setq artist-arrow-point-1 nil)
-  (setq artist-arrow-point-2 nil)
-  (make-local-variable 'next-line-add-newlines)
-  (setq next-line-add-newlines t)
-  (setq artist-key-draw-how
-       (artist-go-get-draw-how-from-symbol artist-curr-go))
+  (setq-local artist-key-is-drawing nil)
+  (setq-local artist-key-endpoint1 nil)
+  (setq-local artist-key-poly-point-list nil)
+  (setq-local artist-key-shape nil)
+  (setq-local artist-popup-menu-table (artist-compute-popup-menu-table 
artist-mt))
+  (setq-local artist-key-compl-table (artist-compute-key-compl-table 
artist-mt))
+  (setq-local artist-prev-next-op-alist
+              (artist-make-prev-next-op-alist artist-key-compl-table))
+  (setq-local artist-rb-save-data (make-vector 7 0))
+  (setq-local artist-arrow-point-1 nil)
+  (setq-local artist-arrow-point-2 nil)
+  (setq-local next-line-add-newlines t)
+  (setq-local artist-key-draw-how
+              (artist-go-get-draw-how-from-symbol artist-curr-go))
   (if (and artist-picture-compatibility (not (eq major-mode 'picture-mode)))
       (progn
        (picture-mode)
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index c9e21e5..0a0a582 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -40,8 +40,6 @@
 
 ;;; Code:
 
-(require 'button)
-
 
 ;; User Options:
 
@@ -88,16 +86,6 @@ If this is a function, call it to generate the initial field 
text."
                  (const :tag "Default" t))
   :risky t)
 
-(defcustom bibtex-unify-case-convert #'identity
-  "Function called when unifying case on entry and field names.
-It is called with one argument, the entry or field name."
-  :version "28.1"
-  :type '(choice (const :tag "Same case as in `bibtex-field-alist'" identity)
-                (const :tag "Downcase" downcase)
-                (const :tag "Capitalize" capitalize)
-                (const :tag "Upcase" upcase)
-                 (function :tag "Conversion function")))
-
 (defcustom bibtex-user-optional-fields
   '(("annote" "Personal annotation (ignored)"))
   "List of optional fields the user wants to have always present.
@@ -133,7 +121,7 @@ last-comma          Add or delete comma on end of last 
field in entry,
 delimiters          Change delimiters according to variables
                       `bibtex-field-delimiters' and `bibtex-entry-delimiters'.
 unify-case          Change case of entry and field names according to
-                      `bibtex-unify-case-convert'.
+                      `bibtex-unify-case-function'.
 braces              Enclose parts of field entries by braces according to
                       `bibtex-field-braces-alist'.
 strings             Replace parts of field entries by string constants
@@ -193,6 +181,17 @@ Space characters in REGEXP will be replaced by \"[ 
\\t\\n]+\"."
                        (regexp :tag "From regexp")
                        (regexp :tag "To string constant"))))
 
+(defcustom bibtex-unify-case-function #'identity
+  "Function for unifying case of entry and field names.
+It is called with one argument, the entry or field name."
+  :version "28.1"
+  :type '(choice (const :tag "Same case as in `bibtex-field-alist'" identity)
+                (const :tag "Downcase" downcase)
+                (const :tag "Capitalize" capitalize)
+                (const :tag "Upcase" upcase)
+                 (function :tag "Conversion function"))
+  :safe (lambda (x) (memq x '(upcase downcase capitalize identity))))
+
 (defcustom bibtex-clean-entry-hook nil
   "List of functions to call when entry has been cleaned.
 Functions are called with point inside the cleaned entry, and the buffer
@@ -901,7 +900,8 @@ If nil prefix OPT is always removed."
 (defcustom bibtex-comment-start "@Comment"
   "String starting a BibTeX comment."
   :group 'bibtex
-  :type 'string)
+  :type 'string
+  :safe #'stringp)
 
 (defcustom bibtex-add-entry-hook nil
   "List of functions to call when BibTeX entry has been inserted."
@@ -1230,7 +1230,8 @@ and must return a string (the key to use)."
   "Offset for BibTeX entries.
 Added to the value of all other variables which determine columns."
   :group 'bibtex
-  :type 'integer)
+  :type 'integer
+  :safe #'integerp)
 
 (defcustom bibtex-field-indentation 2
   "Starting column for the name part in BibTeX fields."
@@ -1243,13 +1244,15 @@ Added to the value of all other variables which 
determine columns."
   "Starting column for the text part in BibTeX fields.
 Should be equal to the space needed for the longest name part."
   :group 'bibtex
-  :type 'integer)
+  :type 'integer
+  :safe #'integerp)
 
 (defcustom bibtex-contline-indentation
   (+ bibtex-text-indentation 1)
   "Starting column for continuation lines of BibTeX fields."
   :group 'bibtex
-  :type 'integer)
+  :type 'integer
+  :safe #'integerp)
 
 (defcustom bibtex-align-at-equal-sign nil
   "If non-nil, align fields at equal sign instead of field text.
@@ -1736,7 +1739,7 @@ BibTeX field as necessary."
          ;; It can be confusing if non-editing commands try to
          ;; modify the buffer.
          (if buffer-read-only
-             (error "Comma missing at buffer position %s" (point)))
+             (user-error "Comma missing at buffer position %s" (point)))
          (insert ",")
          (forward-char -1)
          ;; Now try again.
@@ -1935,18 +1938,22 @@ If `bibtex-expand-strings' is non-nil, also expand 
BibTeX strings."
                                     (bibtex-end-of-text-in-field bounds))))
 
 (defun bibtex-text-in-field (field &optional follow-crossref)
-  "Get content of field FIELD of current BibTeX entry.
-Return nil if not found.
+  "Return content of field FIELD of current BibTeX entry or nil if not found.
+FIELD may also be a list of fields that are tried in order.
 If optional arg FOLLOW-CROSSREF is non-nil, follow crossref."
   (save-excursion
-    (let* ((end (if follow-crossref (bibtex-end-of-entry) t))
-           (beg (bibtex-beginning-of-entry)) ; move point
-           (bounds (bibtex-search-forward-field field end)))
+    (let ((end (if (and (not follow-crossref) (stringp field))
+                   t ; try to minimize parsing
+                 (bibtex-end-of-entry)))
+          bounds)
+      (bibtex-beginning-of-entry) ; move point
+      (let ((field (if (stringp field) (list field) field)))
+        (while (and field (not bounds))
+          (setq bounds (bibtex-search-forward-field (pop field) end))))
       (cond (bounds (bibtex-text-in-field-bounds bounds t))
             ((and follow-crossref
-                  (progn (goto-char beg)
-                         (setq bounds (bibtex-search-forward-field
-                                       "\\(OPT\\)?crossref" end))))
+                  (setq bounds (bibtex-search-forward-field
+                                "\\(OPT\\)?crossref" end)))
              (let ((crossref-field (bibtex-text-in-field-bounds bounds t)))
                (if (bibtex-search-crossref crossref-field)
                    ;; Do not pass FOLLOW-CROSSREF because we want
@@ -2256,7 +2263,7 @@ On success return bounds, nil otherwise.  Do not move 
point."
                   (>= (bibtex-end-of-field bounds) (point)))
              bounds)
             ((not noerr)
-             (error "Can't find enclosing BibTeX field"))))))
+             (user-error "Can't find enclosing BibTeX field"))))))
 
 (defun bibtex-beginning-first-field (&optional beg)
   "Move point to beginning of first field.
@@ -2268,7 +2275,7 @@ Optional arg BEG is beginning of entry."
 (defun bibtex-insert-kill (n &optional comma)
   "Reinsert the Nth stretch of killed BibTeX text (field or entry).
 Optional arg COMMA is as in `bibtex-enclosing-field'."
-  (unless bibtex-last-kill-command (error "BibTeX kill ring is empty"))
+  (unless bibtex-last-kill-command (user-error "BibTeX kill ring is empty"))
   (let ((fun (lambda (kryp kr) ; adapted from `current-kill'
                (car (set kryp (nthcdr (mod (- n (length (symbol-value kryp)))
                                            (length kr))
@@ -2347,7 +2354,7 @@ Formats current entry according to variable 
`bibtex-entry-format'."
               ;; identify entry type
               (goto-char (point-min))
               (or (re-search-forward bibtex-entry-type nil t)
-                  (error "Not inside a BibTeX entry"))
+                  (user-error "Not inside a BibTeX entry"))
               (let* ((beg-type (1+ (match-beginning 0)))
                      (end-type (match-end 0))
                      (entry-list (assoc-string (buffer-substring-no-properties
@@ -2357,7 +2364,7 @@ Formats current entry according to variable 
`bibtex-entry-format'."
                 ;; unify case of entry type
                 (when (memq 'unify-case format)
                   (delete-region beg-type end-type)
-                  (insert (funcall bibtex-unify-case-convert (car 
entry-list))))
+                  (insert (funcall bibtex-unify-case-function (car 
entry-list))))
 
                 ;; update left entry delimiter
                 (when (memq 'delimiters format)
@@ -2557,7 +2564,7 @@ Formats current entry according to variable 
`bibtex-entry-format'."
                                (memq 'required-fields format)
                                (assoc-string field-name req-field-list t))
                       (setq error-field-name field-name)
-                      (error "Mandatory field `%s' is empty" field-name))
+                      (user-error "Mandatory field `%s' is empty" field-name))
 
                     ;; unify case of field name
                     (when (memq 'unify-case format)
@@ -2566,7 +2573,7 @@ Formats current entry according to variable 
`bibtex-entry-format'."
                            (curname (buffer-substring beg-name end-name)))
                        (delete-region beg-name end-name)
                        (goto-char beg-name)
-                       (insert (funcall bibtex-unify-case-convert
+                       (insert (funcall bibtex-unify-case-function
                                         (or fname curname)))))
 
                     ;; update point
@@ -2588,20 +2595,20 @@ Formats current entry according to variable 
`bibtex-entry-format'."
                           ;; we have deleted by now.  Nonetheless we can
                           ;; move point on this empty field.
                           (setq error-field-name (car fname))
-                          (error "Mandatory field `%s' is missing"
-                                  (car fname)))))
+                          (user-error "Mandatory field `%s' is missing"
+                                       (car fname)))))
                  (dotimes (idx num-alt)
                    (cond ((= 0 (aref alt-found idx))
                           (setq error-field-name
                                  (car (last (aref alt-fields idx))))
-                          (error "Alternative mandatory field `%s' is missing"
-                                 (aref alt-expect idx)))
+                          (user-error "Alternative mandatory field `%s' is 
missing"
+                                       (aref alt-expect idx)))
                          ((< 1 (aref alt-found idx))
                           (setq error-field-name
                                  (car (last (aref alt-fields idx))))
-                          (error "Alternative fields `%s' are defined %s times"
-                                 (aref alt-expect idx)
-                                 (length (aref alt-fields idx))))))))
+                          (user-error "Alternative fields `%s' are defined %s 
times"
+                                       (aref alt-expect idx)
+                                       (length (aref alt-fields idx))))))))
 
               ;; update comma after last field
               (if (memq 'last-comma format)
@@ -2684,6 +2691,7 @@ is returned unchanged."
 
 (defun bibtex-autokey-get-field (field &optional change-list)
   "Get content of BibTeX field FIELD.  Return empty string if not found.
+FIELD may also be a list of fields that are tried in order.
 Optional arg CHANGE-LIST is a list of substitution patterns that is
 applied to the content of FIELD.  It is an alist with pairs
 \(OLD-REGEXP . NEW-STRING)."
@@ -2746,13 +2754,17 @@ and `bibtex-autokey-names-stretch'."
                       ;; name is of the form "First Middle Last" or "Last"
                       ;; --> take the last token
                       (match-string 1 fullname))
-                     (t (error "Name `%s' is incorrectly formed" fullname)))))
+                     (t (user-error "Name `%s' is incorrectly formed"
+                                    fullname)))))
     (funcall bibtex-autokey-name-case-convert-function
              (bibtex-autokey-abbrev name bibtex-autokey-name-length))))
 
 (defun bibtex-autokey-get-year ()
   "Return year field contents as a string obeying 
`bibtex-autokey-year-length'."
-  (let ((yearfield (bibtex-autokey-get-field "year")))
+  (let ((yearfield (bibtex-autokey-get-field '("year" "date"))))
+    ;; biblatex date field has format yyyy-mm-dd
+    (if (< 4 (length yearfield))
+        (setq yearfield (substring yearfield 0 4)))
     (substring yearfield (max 0 (- (length yearfield)
                                    bibtex-autokey-year-length)))))
 
@@ -2953,7 +2965,7 @@ for parsing BibTeX keys.  If parsing fails, try to set 
this variable to nil."
                                          (1+ (match-beginning 3)) (1- 
(match-end 3)))))
                                (unless (assoc key crossref-keys)
                                  (push (list key) crossref-keys))))
-                            ;; We have probably have a non-bibtex file.
+                            ;; We probably have a non-bibtex file.
                             ((not (match-beginning bibtex-type-in-head))
                              (throw 'userkey nil))
                             ;; only keys of known entries
@@ -3041,15 +3053,15 @@ Use `bibtex-predefined-strings' and BibTeX files 
`bibtex-string-files'."
         (if (file-name-absolute-p filename)
             (if (file-readable-p filename)
                 (push filename string-files)
-              (error "BibTeX strings file %s not found" filename))
+              (user-error "BibTeX strings file %s not found" filename))
           (dolist (dir dirlist)
             (when (file-readable-p
                    (setq fullfilename (expand-file-name filename dir)))
               (push fullfilename string-files)
               (setq found t)))
           (unless found
-            (error "File %s not in paths defined via bibtex-string-file-path"
-                   filename))))
+            (user-error "File %s not in paths defined via 
bibtex-string-file-path"
+                        filename))))
       ;; parse string files
       (dolist (filename string-files)
         (with-temp-buffer
@@ -3124,11 +3136,11 @@ does not use `bibtex-mode'."
                    (push expanded-file-name file-list)
                    (setq found t)))
                (unless found
-                 (error "File `%s' not in paths defined via bibtex-file-path"
-                        file))))))
+                 (user-error "File `%s' not in paths defined via 
bibtex-file-path"
+                             file))))))
     (dolist (file file-list)
       (unless (file-readable-p file)
-        (error "BibTeX file `%s' not found" file)))
+        (user-error "BibTeX file `%s' not found" file)))
     ;; expand dir-list
     (dolist (dir dir-list)
       (setq file-list
@@ -3205,7 +3217,7 @@ that is generated by calling `bibtex-url'."
       (bibtex-beginning-of-entry)
       (if (looking-at bibtex-entry-maybe-empty-head)
           (kill-new (message "%s" (funcall bibtex-summary-function)))
-        (error "No entry found")))))
+        (user-error "No entry found")))))
 
 (defun bibtex-summary ()
   "Return summary of current BibTeX entry.
@@ -3237,7 +3249,7 @@ Used as default value of `bibtex-summary-function'."
                    `((" " . ,names) (" " . ,year) (": " . ,title)
                      (", " . ,journal) (" " . ,volume) (":" . ,pages))
                    ""))
-    (error "Entry not found")))
+    (user-error "Entry not found")))
 
 (defun bibtex-pop (arg direction)
   "Fill current field from the ARGth same field's text in DIRECTION.
@@ -3271,8 +3283,8 @@ Generic function used by `bibtex-pop-previous' and 
`bibtex-pop-next'."
               (goto-char (bibtex-end-of-field bounds))
             (setq failure t))))
       (if failure
-          (error "No %s matching BibTeX field"
-                 (if (eq direction 'previous) "previous" "next"))
+          (user-error "No %s matching BibTeX field"
+                      (if (eq direction 'previous) "previous" "next"))
         ;; Found a matching field.  Remember boundaries.
         (let ((new-text (bibtex-text-in-field-bounds bounds))
               (nbeg (copy-marker (bibtex-start-of-field bounds)))
@@ -3446,37 +3458,41 @@ if that value is non-nil.
     (setq bibtex-parse-idle-timer (run-with-idle-timer
                                    bibtex-parse-keys-timeout t
                                    'bibtex-parse-buffers-stealthily)))
-  (set (make-local-variable 'paragraph-start) "[ \f\n\t]*$")
-  (set (make-local-variable 'comment-start) bibtex-comment-start)
-  (set (make-local-variable 'comment-start-skip)
-       (concat (regexp-quote bibtex-comment-start) "\\>[ \t]*"))
-  (set (make-local-variable 'comment-column) 0)
-  (set (make-local-variable 'defun-prompt-regexp) "^[ \t]*@[[:alnum:]]+[ \t]*")
-  (set (make-local-variable 'outline-regexp) "[ \t]*@")
-  (set (make-local-variable 'fill-paragraph-function) #'bibtex-fill-field)
-  (set (make-local-variable 'fill-prefix)
-       (make-string (+ bibtex-entry-offset bibtex-contline-indentation) ?\s))
-  (set (make-local-variable 'font-lock-defaults)
-       '(bibtex-font-lock-keywords
-         nil t ((?$ . "\"")
-                ;; Mathematical expressions should be fontified as strings
-                (?\" . ".")
-                ;; Quotes are field delimiters and quote-delimited
-                ;; entries should be fontified in the same way as
-                ;; brace-delimited ones
-                )
-         nil
-         (font-lock-extra-managed-props . (category))
-        (font-lock-mark-block-function
-         . (lambda ()
-              (set-mark (bibtex-end-of-entry))
-             (bibtex-beginning-of-entry)))))
-  (set (make-local-variable 'syntax-propertize-function)
-       (syntax-propertize-via-font-lock
-        bibtex-font-lock-syntactic-keywords))
-  (bibtex-set-dialect nil t)
-  ;; Allow `bibtex-dialect' as a file-local variable.
-  (add-hook 'hack-local-variables-hook #'bibtex-set-dialect nil t))
+  (setq-local paragraph-start "[ \f\n\t]*$")
+  (setq-local comment-column 0)
+  (setq-local defun-prompt-regexp "^[ \t]*@[[:alnum:]]+[ \t]*")
+  (setq-local outline-regexp "[ \t]*@")
+  (setq-local fill-paragraph-function #'bibtex-fill-field)
+  (setq-local font-lock-defaults
+              '(bibtex-font-lock-keywords
+                nil t ((?$ . "\"")
+                       ;; Mathematical expressions should be fontified as 
strings
+                       (?\" . ".")
+                       ;; Quotes are field delimiters and quote-delimited
+                       ;; entries should be fontified in the same way as
+                       ;; brace-delimited ones
+                       )
+                nil
+                (font-lock-extra-managed-props . (category))
+                (font-lock-mark-block-function
+                 . (lambda ()
+                     (set-mark (bibtex-end-of-entry))
+                     (bibtex-beginning-of-entry)))))
+  (setq-local syntax-propertize-function
+              (syntax-propertize-via-font-lock
+               bibtex-font-lock-syntactic-keywords))
+  (let ((fun (lambda ()
+               (bibtex-set-dialect)
+               (setq-local comment-start bibtex-comment-start)
+               (setq-local comment-start-skip
+                           (concat (regexp-quote bibtex-comment-start) "\\>[ 
\t]*"))
+               (setq-local fill-prefix
+                           (make-string (+ bibtex-entry-offset
+                                           bibtex-contline-indentation)
+                                        ?\s)))))
+    (if (and buffer-file-name enable-local-variables)
+        (add-hook 'hack-local-variables-hook fun nil t)
+      (funcall fun))))
 
 (defun bibtex-entry-alist (dialect)
   "Return entry-alist for DIALECT."
@@ -3484,7 +3500,7 @@ if that value is non-nil.
         entry-alist)
     (if (boundp var)
         (setq entry-alist (symbol-value var))
-      (error "BibTeX dialect `%s' undefined" dialect))
+      (user-error "BibTeX dialect `%s' undefined" dialect))
     (if (not (consp (nth 1 (car entry-alist))))
         ;; new format
         entry-alist
@@ -3538,8 +3554,8 @@ LOCAL is t for interactive calls."
                                         bibtex-dialect))))
                (if (boundp var)
                    (symbol-value var)
-                 (error "Field types for BibTeX dialect `%s' undefined"
-                        bibtex-dialect))))
+                 (user-error "Field types for BibTeX dialect `%s' undefined"
+                             bibtex-dialect))))
     (funcall setfun 'bibtex-entry-type
              (concat "@[ \t]*\\(?:"
                      (regexp-opt (mapcar #'car bibtex-entry-alist)) "\\)"))
@@ -3610,7 +3626,7 @@ and `bibtex-user-optional-fields'."
   (let ((e-list (assoc-string entry-type bibtex-entry-alist t))
         required optional)
     (unless e-list
-      (error "Fields for BibTeX entry type %s not defined" entry-type))
+      (user-error "Fields for BibTeX entry type %s not defined" entry-type))
     (if (member-ignore-case entry-type bibtex-include-OPTcrossref)
         (setq required (nth 2 e-list)
               optional (append (nth 3 e-list) (nth 4 e-list)))
@@ -3618,7 +3634,7 @@ and `bibtex-user-optional-fields'."
             optional (nth 4 e-list)))
     (if bibtex-include-OPTkey
         (push (list "key"
-                    "Used for reference key creation if author and editor 
fields are missing"
+                    "Crossref key"
                     (if (or (stringp bibtex-include-OPTkey)
                             (functionp bibtex-include-OPTkey))
                         bibtex-include-OPTkey))
@@ -3641,7 +3657,7 @@ is non-nil."
                  (bibtex-read-key (format "%s key: " entry-type))))
         (field-list (bibtex-field-list entry-type)))
     (unless (bibtex-prepare-new-entry (list key nil entry-type))
-      (error "Entry with key `%s' already exists" key))
+      (user-error "Entry with key `%s' already exists" key))
     (indent-to-column bibtex-entry-offset)
     (insert "@" entry-type (bibtex-entry-left-delimiter))
     (if key (insert key))
@@ -3853,7 +3869,7 @@ INIT is surrounded by field delimiters, unless NODELIM is 
non-nil."
   (let ((init (nth 2 field)))
     (if (not init) (setq init "")
       (if (functionp init) (setq init (funcall init)))
-      (unless (stringp init) (error "`%s' is not a string" init)))
+      (unless (stringp init) (user-error "`%s' is not a string" init)))
     ;; NODELIM is required by `bibtex-insert-kill'
     (if nodelim (insert init)
       (insert (bibtex-field-left-delimiter) init
@@ -3891,7 +3907,7 @@ Return the new location of point."
            (goto-char (bibtex-end-of-string bounds)))
           ((looking-at bibtex-any-valid-entry-type)
            ;; Parsing of entry failed
-           (error "Syntactically incorrect BibTeX entry starts here"))
+           (user-error "Syntactically incorrect BibTeX entry starts here"))
           (t (if (called-interactively-p 'interactive)
                 (message "Not on a known BibTeX entry."))
              (goto-char pnt)))
@@ -3966,7 +3982,7 @@ If mark is active count entries in region, if not in 
whole buffer."
     (if bounds
         (ispell-region (bibtex-start-of-text-in-field bounds)
                        (bibtex-end-of-text-in-field bounds))
-      (error "No abstract in entry"))))
+      (user-error "No abstract in entry"))))
 
 (defun bibtex-narrow-to-entry ()
   "Narrow buffer to current BibTeX entry."
@@ -3999,15 +4015,15 @@ of the head of the entry found.  Return nil if no entry 
found."
 (defun bibtex-init-sort-entry-class-alist ()
   "Initialize `bibtex-sort-entry-class-alist' (buffer-local)."
   (unless (local-variable-p 'bibtex-sort-entry-class-alist)
-    (set (make-local-variable 'bibtex-sort-entry-class-alist)
-         (let ((i -1) alist)
-           (dolist (class bibtex-sort-entry-class)
-             (setq i (1+ i))
-             (dolist (entry class)
-               ;; All entry types should be downcase (for ease of comparison).
-               (push (cons (if (stringp entry) (downcase entry) entry) i)
-                     alist)))
-           alist))))
+    (setq-local bibtex-sort-entry-class-alist
+                (let ((i -1) alist)
+                  (dolist (class bibtex-sort-entry-class)
+                    (setq i (1+ i))
+                    (dolist (entry class)
+                      ;; All entry types should be downcase (for ease of 
comparison).
+                      (push (cons (if (stringp entry) (downcase entry) entry) 
i)
+                            alist)))
+                  alist))))
 
 (defun bibtex-lessp (index1 index2)
   "Predicate for sorting BibTeX entries with indices INDEX1 and INDEX2.
@@ -4083,7 +4099,7 @@ for a crossref key, t otherwise."
      (let* ((pnt (point))
             (_ (bibtex-beginning-of-entry))
             (end (cdr (bibtex-valid-entry t)))
-            (_ (unless end (error "Not inside valid entry")))
+            (_ (unless end (user-error "Not inside valid entry")))
             (beg (match-end 0)) ; set by `bibtex-valid-entry'
             (bounds (bibtex-search-forward-field "\\(OPT\\)?crossref" end))
             case-fold-search best temp crossref-key)
@@ -4123,7 +4139,7 @@ for a crossref key, t otherwise."
              (bibtex-reposition-window pos)
              (beginning-of-line)
              (if (and eqb (> pnt pos) (not noerror))
-                 (error "The referencing entry must precede the crossrefed 
entry!"))))
+                 (user-error "The referencing entry must precede the 
crossrefed entry"))))
           ;; `bibtex-search-crossref' is called noninteractively during
           ;; clean-up of an entry.  Then it is not possible to check
           ;; whether the current entry and the crossrefed entry have
@@ -4544,7 +4560,7 @@ interactive calls."
              (if (memq (preceding-char) '(?} ?\"))
                  (forward-char -1)))
            (if help (bibtex-print-help-message (car bounds))))
-          ((not noerror) (error "Not on BibTeX field")))))
+          ((not noerror) (user-error "Not on BibTeX field")))))
 
 (defun bibtex-find-text-internal (&optional noerror subfield comma)
   "Find text part of current BibTeX field or entry head.
@@ -4620,8 +4636,8 @@ Optional arg COMMA is as in `bibtex-enclosing-field'."
       (cond ((not failure)
              (list name start-text end-text end string-const))
             ((and no-sub (not noerror))
-             (error "Not on text part of BibTeX field"))
-            ((not noerror) (error "Not on BibTeX field"))))))
+             (user-error "Not on text part of BibTeX field"))
+            ((not noerror) (user-error "Not on BibTeX field"))))))
 
 (defun bibtex-remove-OPT-or-ALT (&optional comma)
   "Remove the string starting optional/alternative fields.
@@ -4759,7 +4775,7 @@ The sequence of kills wraps around, so that after the 
oldest one
 comes the newest one."
   (interactive "*p")
   (unless (eq last-command 'bibtex-yank)
-    (error "Previous command was not a BibTeX yank"))
+    (user-error "Previous command was not a BibTeX yank"))
   (setq this-command 'bibtex-yank)
   (let ((inhibit-read-only t) key)
     ;; point is at end of yanked entry
@@ -4817,12 +4833,12 @@ At end of the cleaning process, the functions in
   (let ((case-fold-search t)
         (start (bibtex-beginning-of-entry))
         (_ (or (looking-at bibtex-any-entry-maybe-empty-head)
-              (error "Not inside a BibTeX entry")))
+              (user-error "Not inside a BibTeX entry")))
         (entry-type (bibtex-type-in-head))
         (key (bibtex-key-in-head)))
     (cond ((bibtex-string= entry-type "preamble")
            ;; (bibtex-format-preamble)
-           (error "No clean up of @Preamble entries"))
+           (user-error "No clean up of @Preamble entries"))
           ((bibtex-string= entry-type "string")
            (setq entry-type 'string))
           ;; (bibtex-format-string)
@@ -4872,11 +4888,11 @@ At end of the cleaning process, the functions in
           (setq error (or (/= (point) start)
                           (bibtex-search-entry key nil end))))
         (if error
-            (error "New inserted entry yields duplicate key"))
+            (user-error "New inserted entry yields duplicate key"))
         (dolist (buffer (bibtex-initialize))
           (with-current-buffer buffer
             (if (cdr (assoc-string key bibtex-reference-keys))
-                (error "Duplicate key in %s" (buffer-file-name)))))
+                (user-error "Duplicate key in %s" (buffer-file-name)))))
 
         ;; Only update `bibtex-strings' and `bibtex-reference-keys'
         ;; if they have been built already.
@@ -5178,7 +5194,7 @@ entries from minibuffer."
            bibtex-maintain-sorted-entries))
         endpos)
     (unless (bibtex-prepare-new-entry (list key nil "String"))
-      (error "Entry with key `%s' already exists" key))
+      (user-error "Entry with key `%s' already exists" key))
     (if (zerop (length key)) (setq key nil))
     (indent-to-column bibtex-entry-offset)
     (insert "@String"
diff --git a/lisp/textmodes/dns-mode.el b/lisp/textmodes/dns-mode.el
index 712955e..dd28cb8 100644
--- a/lisp/textmodes/dns-mode.el
+++ b/lisp/textmodes/dns-mode.el
@@ -178,11 +178,11 @@ variables for customizing indentation.  It has its own 
abbrev
 table and its own syntax table.
 
 Turning on DNS mode runs `dns-mode-hook'."
-  (set (make-local-variable 'comment-start) ";")
-  (set (make-local-variable 'comment-end) "")
-  (set (make-local-variable 'comment-start-skip) ";+ *")
-  (set (make-local-variable 'font-lock-defaults)
-       '(dns-mode-font-lock-keywords nil nil ((?_ . "w"))))
+  (setq-local comment-start ";")
+  (setq-local comment-end "")
+  (setq-local comment-start-skip ";+ *")
+  (setq-local font-lock-defaults
+              '(dns-mode-font-lock-keywords nil nil ((?_ . "w"))))
   (add-hook 'before-save-hook 'dns-mode-soa-maybe-increment-serial
             nil t))
 
diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el
index 1656f3c..919e090 100644
--- a/lisp/textmodes/enriched.el
+++ b/lisp/textmodes/enriched.el
@@ -247,9 +247,8 @@ Commands:
               (list 'buffer-display-table buffer-display-table
                     'default-text-properties default-text-properties
                     'use-hard-newlines use-hard-newlines))
-        (make-local-variable 'enriched-default-text-properties-local-flag)
-        (setq enriched-default-text-properties-local-flag
-              (local-variable-p 'default-text-properties))
+         (setq-local enriched-default-text-properties-local-flag
+                     (local-variable-p 'default-text-properties))
         (make-local-variable 'default-text-properties)
         (setq buffer-display-table  enriched-display-table)
         (use-hard-newlines 1 (if enriched-rerun-flag 'never nil))
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 14de77c..ba7f36d 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -4098,7 +4098,7 @@ Includes LaTeX/Nroff modes and extended character mode."
       (progn
        (ispell-send-string "+\n")      ; set ispell mode to tex
        (if (not (eq ispell-parser 'tex))
-           (set (make-local-variable 'ispell-parser) 'tex)))
+            (setq-local ispell-parser 'tex)))
     (ispell-send-string "-\n"))                ; set mode to normal (nroff)
   ;; If needed, test for SGML & HTML modes and set a buffer local nil/t value.
   (if (and ispell-skip-html (not (eq ispell-skip-html t)))
diff --git a/lisp/textmodes/nroff-mode.el b/lisp/textmodes/nroff-mode.el
index bb2582c..2d7ab13 100644
--- a/lisp/textmodes/nroff-mode.el
+++ b/lisp/textmodes/nroff-mode.el
@@ -134,35 +134,32 @@
 Turning on Nroff mode runs `text-mode-hook', then `nroff-mode-hook'.
 Also, try `nroff-electric-mode', for automatically inserting
 closing requests for requests that are used in matched pairs."
-  (set (make-local-variable 'font-lock-defaults)
-       ;; SYNTAX-BEGIN is set to backward-paragraph to avoid slow-down
-       ;; near the end of large buffers due to searching to buffer's
-       ;; beginning.
-       '(nroff-font-lock-keywords nil t nil backward-paragraph))
-  (set (make-local-variable 'outline-regexp) "\\.H[ ]+[1-7]+ ")
-  (set (make-local-variable 'outline-level) 'nroff-outline-level)
+  (setq-local font-lock-defaults
+              ;; SYNTAX-BEGIN is set to backward-paragraph to avoid slow-down
+              ;; near the end of large buffers due to searching to buffer's
+              ;; beginning.
+              '(nroff-font-lock-keywords nil t nil backward-paragraph))
+  (setq-local outline-regexp "\\.H[ ]+[1-7]+ ")
+  (setq-local outline-level 'nroff-outline-level)
   ;; now define a bunch of variables for use by commands in this mode
-  (set (make-local-variable 'page-delimiter) "^\\.\\(bp\\|SK\\|OP\\)")
-  (set (make-local-variable 'paragraph-start)
-       (concat "[.']\\|" paragraph-start))
-  (set (make-local-variable 'paragraph-separate)
-       (concat "[.']\\|" paragraph-separate))
+  (setq-local page-delimiter "^\\.\\(bp\\|SK\\|OP\\)")
+  (setq-local paragraph-start (concat "[.']\\|" paragraph-start))
+  (setq-local paragraph-separate (concat "[.']\\|" paragraph-separate))
   ;; Don't auto-fill directive lines starting . or ' since they normally
   ;; have to be one line.  But do auto-fill comments .\" .\# and '''.
   ;; Comment directives (those starting . or ') are [.'][ \t]*\\[#"]
   ;; or ''', and this regexp is everything except those.  So [.']
   ;; followed by not backslash and not ' or followed by backslash but
   ;; then not # or "
-  (set (make-local-variable 'auto-fill-inhibit-regexp)
-       "[.'][ \t]*\\([^ \t\\']\\|\\\\[^#\"]\\)")
+  (setq-local auto-fill-inhibit-regexp
+              "[.'][ \t]*\\([^ \t\\']\\|\\\\[^#\"]\\)")
   ;; comment syntax added by mit-erl!gildea 18 Apr 86
-  (set (make-local-variable 'comment-start) "\\\" ")
-  (set (make-local-variable 'comment-start-skip) "\\\\[\"#][ \t]*")
-  (set (make-local-variable 'comment-column) 24)
-  (set (make-local-variable 'comment-indent-function) 'nroff-comment-indent)
-  (set (make-local-variable 'comment-insert-comment-function)
-       'nroff-insert-comment-function)
-  (set (make-local-variable 'imenu-generic-expression) nroff-imenu-expression))
+  (setq-local comment-start "\\\" ")
+  (setq-local comment-start-skip "\\\\[\"#][ \t]*")
+  (setq-local comment-column 24)
+  (setq-local comment-indent-function #'nroff-comment-indent)
+  (setq-local comment-insert-comment-function #'nroff-insert-comment-function)
+  (setq-local imenu-generic-expression nroff-imenu-expression))
 
 (defun nroff-outline-level ()
   (save-excursion
diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el
index 5216812..9cf61c6 100644
--- a/lisp/textmodes/picture.el
+++ b/lisp/textmodes/picture.el
@@ -764,18 +764,17 @@ they are not by default assigned to keys."
   (interactive)
   (if (eq major-mode 'picture-mode)
       (error "You are already editing a picture")
-    (set (make-local-variable 'picture-mode-old-local-map) (current-local-map))
+    (setq-local picture-mode-old-local-map (current-local-map))
     (use-local-map picture-mode-map)
-    (set (make-local-variable 'picture-mode-old-mode-name) mode-name)
-    (set (make-local-variable 'picture-mode-old-major-mode) major-mode)
+    (setq-local picture-mode-old-mode-name mode-name)
+    (setq-local picture-mode-old-major-mode major-mode)
     (setq major-mode 'picture-mode)
-    (set (make-local-variable 'picture-killed-rectangle) nil)
-    (set (make-local-variable 'tab-stop-list) (default-value 'tab-stop-list))
-    (set (make-local-variable 'picture-tab-chars)
-        (default-value 'picture-tab-chars))
+    (setq-local picture-killed-rectangle nil)
+    (setq-local tab-stop-list (default-value 'tab-stop-list))
+    (setq-local picture-tab-chars (default-value 'picture-tab-chars))
     (make-local-variable 'picture-vertical-step)
     (make-local-variable 'picture-horizontal-step)
-    (set (make-local-variable 'picture-mode-old-truncate-lines) truncate-lines)
+    (setq-local picture-mode-old-truncate-lines truncate-lines)
     (setq truncate-lines t)
     (picture-set-motion 0 1)
 
diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el
index a83e6b3..139221f 100644
--- a/lisp/textmodes/refill.el
+++ b/lisp/textmodes/refill.el
@@ -237,16 +237,14 @@ For true \"word wrap\" behavior, use `visual-line-mode' 
instead."
        (add-hook 'after-change-functions 'refill-after-change-function nil t)
        (add-hook 'post-command-hook 'refill-post-command-function nil t)
        (add-hook 'pre-command-hook 'refill-pre-command-function nil t)
-       (set (make-local-variable 'refill-saved-state)
-            (mapcar (lambda (s) (cons s (symbol-value s)))
-                    '(fill-paragraph-function auto-fill-function)))
+        (setq-local refill-saved-state
+                    (mapcar (lambda (s) (cons s (symbol-value s)))
+                            '(fill-paragraph-function auto-fill-function)))
        ;; This provides the test for recursive paragraph filling.
-       (set (make-local-variable 'fill-paragraph-function)
-            'refill-fill-paragraph)
+        (setq-local fill-paragraph-function #'refill-fill-paragraph)
        ;; When using justification, doing DEL on 2 spaces should remove
        ;; both, otherwise, the subsequent refill will undo the DEL.
-       (set (make-local-variable 'backward-delete-char-untabify-method)
-            'hungry)
+        (setq-local backward-delete-char-untabify-method 'hungry)
        (setq refill-ignorable-overlay (make-overlay 1 1 nil nil t))
        (overlay-put refill-ignorable-overlay 'modification-hooks
                     '(refill-adjust-ignorable-overlay))
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 29ebab5..b1fa79a 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -51,10 +51,6 @@
 ;;; Code:
 
 (eval-when-compile (require 'cl-lib))
-
-;; Stuff that needs to be there when we use defcustom
-(require 'custom)
-
 (require 'easymenu)
 
 (defvar reftex-tables-dirty t
diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el
index e75ff7a..227e2df 100644
--- a/lisp/textmodes/two-column.el
+++ b/lisp/textmodes/two-column.el
@@ -388,9 +388,8 @@ First column's text    sSs  Second column's text
       (backward-char arg)
       (setq chars (buffer-substring (point) point))
       (skip-chars-forward " \t" point)
-      (make-local-variable '2C-separator)
-      (setq 2C-separator (buffer-substring (point) point)
-           2C-window-width (+ (fringe-columns 'left)
+      (setq-local 2C-separator (buffer-substring (point) point))
+      (setq 2C-window-width (+ (fringe-columns 'left)
                               (fringe-columns 'right)
                               (scroll-bar-columns 'left)
                               (scroll-bar-columns 'right)
diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el
index bee3a6b..e185a79 100644
--- a/lisp/url/url-cookie.el
+++ b/lisp/url/url-cookie.el
@@ -162,7 +162,7 @@ i.e. 1970-1-1) are loaded as expiring one year from now 
instead."
               ";; version-control: never\n"
               ";; no-byte-compile: t\n"
               ";; End:\n")
-      (set (make-local-variable 'version-control) 'never)
+      (setq-local version-control 'never)
       (write-file fname))
     (setq url-cookies-changed-since-last-save nil))))
 
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 75330d3..1271b9b 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -741,12 +741,12 @@ should be shown to the user."
                   ;; without changing the API.  Instead url-retrieve should
                   ;; either simply not return the "destination" buffer, or it
                   ;; should take an optional `dest-buf' argument.
-                  (set (make-local-variable 'url-redirect-buffer)
-                       (url-retrieve-internal
-                        redirect-uri url-callback-function
-                        url-callback-arguments
-                        (url-silent url-current-object)
-                        (not (url-use-cookies url-current-object))))
+                   (setq-local url-redirect-buffer
+                               (url-retrieve-internal
+                                redirect-uri url-callback-function
+                                url-callback-arguments
+                                (url-silent url-current-object)
+                                (not (url-use-cookies url-current-object))))
                   (url-mark-buffer-as-dead buffer))
               ;; We hit url-max-redirections, so issue an error and
               ;; stop redirecting.
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index 0a7e7e2..bd9543b 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -574,8 +574,8 @@ Has a preference for looking backward when not directly on 
a symbol."
   (save-excursion
     (goto-char (point-min))
     (unless url-current-mime-headers
-      (set (make-local-variable 'url-current-mime-headers)
-          (mail-header-extract)))))
+      (setq-local url-current-mime-headers
+                  (mail-header-extract)))))
 
 (defun url-make-private-file (file)
   "Make FILE only readable and writable by the current user.
diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el
index 54bb356..e177a5a 100644
--- a/lisp/vc/add-log.el
+++ b/lisp/vc/add-log.el
@@ -779,7 +779,7 @@ Optional arg BUFFER-FILE overrides `buffer-file-name'."
                             found)))))))
            (if root (setq file-name (expand-file-name cbase root))))))
     ;; Make a local variable in this buffer so we needn't search again.
-    (set (make-local-variable 'change-log-default-name) file-name))
+    (setq-local change-log-default-name file-name))
   file-name)
 
 (defun add-log-file-name (buffer-file log-file)
@@ -1134,40 +1134,40 @@ Runs `change-log-mode-hook'.
        indent-tabs-mode t
        tab-width 8
        show-trailing-whitespace t)
-  (set (make-local-variable 'fill-forward-paragraph-function)
-       'change-log-fill-forward-paragraph)
-  (set (make-local-variable 'comment-start) nil)
+  (setq-local fill-forward-paragraph-function
+              'change-log-fill-forward-paragraph)
+  (setq-local comment-start nil)
   ;; Make sure we call `change-log-indent' when filling.
-  (set (make-local-variable 'fill-indent-according-to-mode) t)
+  (setq-local fill-indent-according-to-mode t)
   ;; Avoid that filling leaves behind a single "*" on a line.
   (add-hook 'fill-nobreak-predicate
            (lambda ()
               (looking-back "^\\s *\\*\\s *" (line-beginning-position)))
            nil t)
-  (set (make-local-variable 'indent-line-function) 'change-log-indent)
-  (set (make-local-variable 'tab-always-indent) nil)
-  (set (make-local-variable 'copyright-at-end-flag) t)
+  (setq-local indent-line-function 'change-log-indent)
+  (setq-local tab-always-indent nil)
+  (setq-local copyright-at-end-flag t)
   ;; We really do want "^" in paragraph-start below: it is only the
   ;; lines that begin at column 0 (despite the left-margin of 8) that
   ;; we are looking for.  Adding `* ' allows eliding the blank line
   ;; between entries for different files.
-  (set (make-local-variable 'paragraph-start) "\\s *$\\|\f\\|^\\<")
-  (set (make-local-variable 'paragraph-separate) paragraph-start)
+  (setq-local paragraph-start "\\s *$\\|\f\\|^\\<")
+  (setq-local paragraph-separate paragraph-start)
   ;; Match null string on the date-line so that the date-line
   ;; is grouped with what follows.
-  (set (make-local-variable 'page-delimiter) "^\\<\\|^\f")
-  (set (make-local-variable 'version-control) 'never)
-  (set (make-local-variable 'smerge-resolve-function)
-       'change-log-resolve-conflict)
-  (set (make-local-variable 'adaptive-fill-regexp) "\\s *")
-  (set (make-local-variable 'font-lock-defaults)
-       '(change-log-font-lock-keywords t nil nil backward-paragraph))
-  (set (make-local-variable 'multi-isearch-next-buffer-function)
-       'change-log-next-buffer)
-  (set (make-local-variable 'beginning-of-defun-function)
-       'change-log-beginning-of-defun)
-  (set (make-local-variable 'end-of-defun-function)
-       'change-log-end-of-defun)
+  (setq-local page-delimiter "^\\<\\|^\f")
+  (setq-local version-control 'never)
+  (setq-local smerge-resolve-function
+              'change-log-resolve-conflict)
+  (setq-local adaptive-fill-regexp "\\s *")
+  (setq-local font-lock-defaults
+              '(change-log-font-lock-keywords t nil nil backward-paragraph))
+  (setq-local multi-isearch-next-buffer-function
+              'change-log-next-buffer)
+  (setq-local beginning-of-defun-function
+              'change-log-beginning-of-defun)
+  (setq-local end-of-defun-function
+              'change-log-end-of-defun)
   ;; next-error function glue
   (setq next-error-function 'change-log-next-error))
 
diff --git a/lisp/vc/cvs-status.el b/lisp/vc/cvs-status.el
index 6192b93..093c17b 100644
--- a/lisp/vc/cvs-status.el
+++ b/lisp/vc/cvs-status.el
@@ -92,8 +92,8 @@
 ;;;###autoload
 (define-derived-mode cvs-status-mode fundamental-mode "CVS-Status"
   "Mode used for cvs status output."
-  (set (make-local-variable 'font-lock-defaults) cvs-status-font-lock-defaults)
-  (set (make-local-variable 'cvs-minor-wrap-function) 'cvs-status-minor-wrap))
+  (setq-local font-lock-defaults cvs-status-font-lock-defaults)
+  (setq-local cvs-minor-wrap-function #'cvs-status-minor-wrap))
 
 ;; Define cvs-status-next and cvs-status-prev
 (easy-mmode-define-navigation cvs-status cvs-status-entry-leader-re "entry")
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 51f4180..bf83601 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -741,7 +741,7 @@ If the prefix ARG is given, restrict the view to the 
current file instead."
   (interactive "P")
   (apply 'narrow-to-region
         (if arg (diff-bounds-of-file) (diff-bounds-of-hunk)))
-  (set (make-local-variable 'diff-narrowed-to) (if arg 'file 'hunk)))
+  (setq-local diff-narrowed-to (if arg 'file 'hunk)))
 
 (defun diff--some-hunks-p ()
   (save-excursion
@@ -969,8 +969,8 @@ Non-nil NOPROMPT means to prefer returning nil than to 
prompt the user.
 PREFIX is only used internally: don't use it."
   (unless (equal diff-remembered-defdir default-directory)
     ;; Flush diff-remembered-files-alist if the default-directory is changed.
-    (set (make-local-variable 'diff-remembered-defdir) default-directory)
-    (set (make-local-variable 'diff-remembered-files-alist) nil))
+    (setq-local diff-remembered-defdir default-directory)
+    (setq-local diff-remembered-files-alist nil))
   (save-excursion
     (save-restriction
       (widen)
@@ -1016,8 +1016,8 @@ PREFIX is only used internally: don't use it."
                   (read-file-name (format "Use file %s: " file)
                                   (file-name-directory file) file t
                                   (file-name-nondirectory file)))
-             (set (make-local-variable 'diff-remembered-files-alist)
-                  (cons (cons fs file) diff-remembered-files-alist))
+             (setq-local diff-remembered-files-alist
+                         (cons (cons fs file) diff-remembered-files-alist))
              file)))))))
 
 
@@ -1475,27 +1475,25 @@ a diff with \\[diff-reverse-direction].
 
 \\{diff-mode-map}"
 
-  (set (make-local-variable 'font-lock-defaults) diff-font-lock-defaults)
+  (setq-local font-lock-defaults diff-font-lock-defaults)
   (add-hook 'font-lock-mode-hook #'diff--font-lock-cleanup nil 'local)
-  (set (make-local-variable 'outline-regexp) diff-outline-regexp)
-  (set (make-local-variable 'imenu-generic-expression)
-       diff-imenu-generic-expression)
+  (setq-local outline-regexp diff-outline-regexp)
+  (setq-local imenu-generic-expression
+              diff-imenu-generic-expression)
   ;; These are not perfect.  They would be better done separately for
   ;; context diffs and unidiffs.
-  ;; (set (make-local-variable 'paragraph-start)
+  ;; (setq-local paragraph-start
   ;;        (concat "@@ "                      ; unidiff hunk
   ;;          "\\|\\*\\*\\* "          ; context diff hunk or file start
   ;;          "\\|--- [^\t]+\t"))      ; context or unidiff file
   ;;                                   ; start (first or second line)
-  ;;   (set (make-local-variable 'paragraph-separate) paragraph-start)
-  ;;   (set (make-local-variable 'page-delimiter) "--- [^\t]+\t")
+  ;;   (setq-local paragraph-separate paragraph-start)
+  ;;   (setq-local page-delimiter "--- [^\t]+\t")
   ;; compile support
-  (set (make-local-variable 'next-error-function) #'diff-next-error)
+  (setq-local next-error-function #'diff-next-error)
 
-  (set (make-local-variable 'beginning-of-defun-function)
-       #'diff-beginning-of-file-and-junk)
-  (set (make-local-variable 'end-of-defun-function)
-       #'diff-end-of-file)
+  (setq-local beginning-of-defun-function #'diff-beginning-of-file-and-junk)
+  (setq-local end-of-defun-function #'diff-end-of-file)
 
   (diff-setup-whitespace)
 
@@ -1517,10 +1515,9 @@ a diff with \\[diff-reverse-direction].
                      (delq ro-bind minor-mode-overriding-map-alist)))
              nil t))
   ;; add-log support
-  (set (make-local-variable 'add-log-current-defun-function)
-       #'diff-current-defun)
-  (set (make-local-variable 'add-log-buffer-file-name-function)
-       (lambda () (diff-find-file-name nil 'noprompt)))
+  (setq-local add-log-current-defun-function #'diff-current-defun)
+  (setq-local add-log-buffer-file-name-function
+              (lambda () (diff-find-file-name nil 'noprompt)))
   (add-function :filter-return (local 'filter-buffer-substring-function)
                 #'diff--filter-substring)
   (unless buffer-file-name
@@ -1552,7 +1549,7 @@ a diff with \\[diff-reverse-direction].
 This sets `whitespace-style' and `whitespace-trailing-regexp' so
 that Whitespace mode shows trailing whitespace problems on the
 modified lines of the diff."
-  (set (make-local-variable 'whitespace-style) '(face trailing))
+  (setq-local whitespace-style '(face trailing))
   (let ((style (save-excursion
                 (goto-char (point-min))
                  ;; FIXME: For buffers filled from async processes, this search
@@ -1560,10 +1557,10 @@ modified lines of the diff."
                 (when (re-search-forward diff-hunk-header-re nil t)
                   (goto-char (match-beginning 0))
                   (diff-hunk-style)))))
-    (set (make-local-variable 'whitespace-trailing-regexp)
-        (if (eq style 'context)
-            "^[-+!] .*?\\([\t ]+\\)$"
-          "^[-+!<>].*?\\([\t ]+\\)$"))))
+    (setq-local whitespace-trailing-regexp
+                (if (eq style 'context)
+                    "^[-+!] .*?\\([\t ]+\\)$"
+                  "^[-+!<>].*?\\([\t ]+\\)$"))))
 
 (defun diff-delete-if-empty ()
   ;; An empty diff file means there's no more diffs to integrate, so we
@@ -1936,10 +1933,10 @@ With a prefix argument, REVERSE the hunk."
         (and buffer-file-name
              (backup-file-name-p buffer-file-name)
              (not diff-apply-hunk-to-backup-file)
-             (not (set (make-local-variable 'diff-apply-hunk-to-backup-file)
-                       (yes-or-no-p (format "Really apply this hunk to %s? "
-                                            (file-name-nondirectory
-                                             buffer-file-name)))))))
+             (not (setq-local diff-apply-hunk-to-backup-file
+                              (yes-or-no-p (format "Really apply this hunk to 
%s? "
+                                                   (file-name-nondirectory
+                                                    buffer-file-name)))))))
       (error "%s"
             (substitute-command-keys
               (format "Use %s\\[diff-apply-hunk] to apply it to the other file"
diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el
index b7f17bf..e43801a 100644
--- a/lisp/vc/diff.el
+++ b/lisp/vc/diff.el
@@ -190,9 +190,9 @@ returns the buffer used."
        (erase-buffer))
       (buffer-enable-undo (current-buffer))
       (diff-mode)
-      (set (make-local-variable 'revert-buffer-function)
-           (lambda (_ignore-auto _noconfirm)
-             (diff-no-select old new switches no-async (current-buffer))))
+      (setq-local revert-buffer-function
+                  (lambda (_ignore-auto _noconfirm)
+                    (diff-no-select old new switches no-async 
(current-buffer))))
       (setq default-directory thisdir)
       (setq diff-default-directory default-directory)
       (let ((inhibit-read-only t))
diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index e28d857..73c39b6 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -275,8 +275,7 @@ to invocation.")
       (make-local-variable 'ediff-window-setup-function)
       (make-local-variable 'ediff-keep-variants)
 
-      (make-local-variable 'window-min-height)
-      (setq window-min-height 2)
+      (setq-local window-min-height 2)
 
       ;; unwrap set up parameters passed as argument
       (while setup-parameters
diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
index 1c69bdf..feafe5f 100644
--- a/lisp/vc/log-edit.el
+++ b/lisp/vc/log-edit.el
@@ -463,16 +463,16 @@ done.  Otherwise, it uses the current buffer."
     (if mode
        (funcall mode)
       (log-edit-mode))
-    (set (make-local-variable 'log-edit-callback) callback)
+    (setq-local log-edit-callback callback)
     (if (listp params)
        (dolist (crt params)
          (set (make-local-variable (car crt)) (cdr crt)))
       ;; For backward compatibility with log-edit up to version 22.2
       ;; accept non-list PARAMS to mean `log-edit-list'.
-      (set (make-local-variable 'log-edit-listfun) params))
+      (setq-local log-edit-listfun params))
 
-    (if buffer (set (make-local-variable 'log-edit-parent-buffer) parent))
-    (set (make-local-variable 'log-edit-initial-files) (log-edit-files))
+    (if buffer (setq-local log-edit-parent-buffer parent))
+    (setq-local log-edit-initial-files (log-edit-files))
     (when setup
       (erase-buffer)
       (run-hooks 'log-edit-hook))
@@ -489,8 +489,7 @@ the package from which this is used might also provide 
additional
 commands (under C-x v for VC, for example).
 
 \\{log-edit-mode-map}"
-  (set (make-local-variable 'font-lock-defaults)
-       '(log-edit-font-lock-keywords t))
+  (setq-local font-lock-defaults '(log-edit-font-lock-keywords t))
   (setq-local jit-lock-contextually t)  ;For the "first line is summary".
   (setq-local fill-paragraph-function #'log-edit-fill-entry)
   (make-local-variable 'log-edit-comment-ring-index)
diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el
index e7b6eea..87e662c 100644
--- a/lisp/vc/log-view.el
+++ b/lisp/vc/log-view.el
@@ -265,12 +265,10 @@ The match group number 1 should match the revision number 
itself.")
 (define-derived-mode log-view-mode special-mode "Log-View"
   "Major mode for browsing CVS log output."
   (setq buffer-read-only t)
-  (set (make-local-variable 'font-lock-defaults) log-view-font-lock-defaults)
-  (set (make-local-variable 'beginning-of-defun-function)
-       'log-view-beginning-of-defun)
-  (set (make-local-variable 'end-of-defun-function)
-       'log-view-end-of-defun)
-  (set (make-local-variable 'cvs-minor-wrap-function) 'log-view-minor-wrap)
+  (setq-local font-lock-defaults log-view-font-lock-defaults)
+  (setq-local beginning-of-defun-function #'log-view-beginning-of-defun)
+  (setq-local end-of-defun-function #'log-view-end-of-defun)
+  (setq-local cvs-minor-wrap-function #'log-view-minor-wrap)
   (hack-dir-local-variables-non-file-buffer))
 
 ;;;;
diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el
index 1e4343c..0fd5cee 100644
--- a/lisp/vc/pcvs.el
+++ b/lisp/vc/pcvs.el
@@ -356,10 +356,10 @@ from the current buffer."
               ((and (bufferp cvs-temp-buffer) (buffer-live-p cvs-temp-buffer))
                cvs-temp-buffer)
               (t
-               (set (make-local-variable 'cvs-temp-buffer)
-                    (cvs-get-buffer-create
-                     (eval cvs-temp-buffer-name `((dir . ,dir)))
-                      'noreuse))))))
+                (setq-local cvs-temp-buffer
+                            (cvs-get-buffer-create
+                             (eval cvs-temp-buffer-name `((dir . ,dir)))
+                             'noreuse))))))
 
     ;; Handle the potential pre-existing process.
     (let ((proc (get-buffer-process buf)))
@@ -381,7 +381,7 @@ from the current buffer."
       (unless nosetup (save-excursion (display-buffer buf)))
       ;; FIXME: this doesn't do the right thing if the user later on
       ;; does a `find-file-other-window' and `scroll-other-window'
-      (set (make-local-variable 'other-window-scroll-buffer) buf))
+      (setq-local other-window-scroll-buffer buf))
 
     (add-to-list 'cvs-temp-buffers buf)
 
@@ -393,13 +393,13 @@ from the current buffer."
         ;; a very large and unwanted undo record.
         (buffer-disable-undo)
         (erase-buffer))
-      (set (make-local-variable 'cvs-buffer) cvs-buf)
+      (setq-local cvs-buffer cvs-buf)
       ;;(cvs-minor-mode 1)
       (let ((lbd list-buffers-directory))
        (if (fboundp mode) (funcall mode) (fundamental-mode))
        (when lbd (setq list-buffers-directory lbd)))
       (cvs-minor-mode 1)
-      ;;(set (make-local-variable 'cvs-buffer) cvs-buf)
+      ;;(setq-local cvs-buffer cvs-buf)
       (if normal
           (buffer-enable-undo)
        (setq buffer-read-only t)
@@ -466,10 +466,10 @@ If non-nil, NEW means to create a new buffer no matter 
what."
                 "\n")
         (setq buffer-read-only t)
         (cvs-mode)
-        (set (make-local-variable 'list-buffers-directory) buffer-name)
-        ;;(set (make-local-variable 'cvs-temp-buffer) (cvs-temp-buffer))
+         (setq-local list-buffers-directory buffer-name)
+         ;;(setq-local cvs-temp-buffer (cvs-temp-buffer))
         (let ((cookies (ewoc-create 'cvs-fileinfo-pp "\n\n" "\n" t)))
-          (set (make-local-variable 'cvs-cookies) cookies)
+           (setq-local cvs-cookies cookies)
           (add-hook 'kill-buffer-hook
                     (lambda ()
                       (ignore-errors (kill-buffer cvs-temp-buffer)))
@@ -1103,7 +1103,7 @@ for a lock file.  If so, it inserts a message cookie in 
the *cvs* buffer."
            (let ((msg (match-string 1))
                  (lock (match-string 2)))
              (with-current-buffer cvs-buffer
-               (set (make-local-variable 'cvs-lock-file) lock)
+                (setq-local cvs-lock-file lock)
                ;; display the lock situation in the *cvs* buffer:
                (ewoc-enter-last
                 cvs-cookies
@@ -1146,8 +1146,8 @@ Full documentation is in the Texinfo file."
   (if buffer-file-name
       (error "Use M-x cvs-quickdir to get a *cvs* buffer"))
   (buffer-disable-undo)
-  ;;(set (make-local-variable 'goal-column) cvs-cursor-column)
-  (set (make-local-variable 'revert-buffer-function) 'cvs-mode-revert-buffer)
+  ;;(setq-local goal-column cvs-cursor-column)
+  (setq-local revert-buffer-function 'cvs-mode-revert-buffer)
   (setq truncate-lines t)
   (cvs-prefix-make-local 'cvs-branch-prefix)
   (cvs-prefix-make-local 'cvs-secondary-branch-prefix)
@@ -1464,7 +1464,7 @@ The POSTPROC specified there (typically `log-edit') is 
then called,
     (funcall setupfun 'cvs-do-commit setup
             '((log-edit-listfun . cvs-commit-filelist)
               (log-edit-diff-function . cvs-mode-diff)) buf)
-    (set (make-local-variable 'cvs-minor-wrap-function) 'cvs-commit-minor-wrap)
+    (setq-local cvs-minor-wrap-function 'cvs-commit-minor-wrap)
     (run-hooks 'cvs-mode-commit-hook)))
 
 (defun cvs-commit-minor-wrap (_buf f)
@@ -1525,15 +1525,14 @@ This is best called from a `log-view-mode' buffer."
     (with-current-buffer buf
       ;; Set the filename before, so log-edit can correctly setup its
       ;; log-edit-initial-files variable.
-      (set (make-local-variable 'cvs-edit-log-files) (list file)))
+      (setq-local cvs-edit-log-files (list file)))
     (funcall setupfun 'cvs-do-edit-log nil
             '((log-edit-listfun . cvs-edit-log-filelist)
               (log-edit-diff-function . cvs-mode-diff))
             buf)
     (when text (erase-buffer) (insert text))
-    (set (make-local-variable 'cvs-edit-log-revision) rev)
-    (set (make-local-variable 'cvs-minor-wrap-function)
-         'cvs-edit-log-minor-wrap)
+    (setq-local cvs-edit-log-revision rev)
+    (setq-local cvs-minor-wrap-function 'cvs-edit-log-minor-wrap)
     ;; (run-hooks 'cvs-mode-commit-hook)
     ))
 
@@ -2396,7 +2395,7 @@ The exact behavior is determined also by 
`cvs-dired-use-hook'."
                     (string-prefix-p default-directory dir))
            (let ((subdir (substring dir (length default-directory))))
              (set-buffer buffer)
-             (set (make-local-variable 'cvs-buffer) cvs-buf)
+              (setq-local cvs-buffer cvs-buf)
              ;; `cvs -q add file' produces no useful output :-(
              (when (and (equal (car flags) "add")
                         (goto-char (point-min))
diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el
index fe7724d..13f875b 100644
--- a/lisp/vc/smerge-mode.el
+++ b/lisp/vc/smerge-mode.el
@@ -827,7 +827,7 @@ An error is raised if not inside a conflict."
 
           ((re-search-backward smerge-base-re start t)
            ;; a 3-parts conflict
-           (set (make-local-variable 'smerge-conflict-style) 'diff3-A)
+            (setq-local smerge-conflict-style 'diff3-A)
            (setq base-end upper-end)
            (setq upper-end (match-beginning 0))
            (setq base-start (match-end 0)))
@@ -835,7 +835,7 @@ An error is raised if not inside a conflict."
           ((string= filename (file-name-nondirectory
                               (or buffer-file-name "")))
            ;; a 2-parts conflict
-           (set (make-local-variable 'smerge-conflict-style) 'diff3-E))
+            (setq-local smerge-conflict-style 'diff3-E))
 
           ((and (not base-start)
                 (or (eq smerge-conflict-style 'diff3-A)
@@ -1350,8 +1350,8 @@ buffer names."
 
     ;; Ediff is now set up, and we are in the control buffer.
     ;; Do a few further adjustments and take precautions for exit.
-    (set (make-local-variable 'smerge-ediff-windows) config)
-    (set (make-local-variable 'smerge-ediff-buf) buf)
+    (setq-local smerge-ediff-windows config)
+    (setq-local smerge-ediff-buf buf)
     (add-hook 'ediff-quit-hook
              (lambda ()
                (let ((buffer-A ediff-buffer-A)
@@ -1422,11 +1422,11 @@ with a \\[universal-argument] prefix, makes up a 3-way 
conflict."
          (font-lock-fontify-region (match-beginning 0) (match-end 0) nil)))))
   (if (string-match (regexp-quote smerge-parsep-re) paragraph-separate)
       (unless smerge-mode
-        (set (make-local-variable 'paragraph-separate)
-             (replace-match "" t t paragraph-separate)))
+        (setq-local paragraph-separate
+                    (replace-match "" t t paragraph-separate)))
     (when smerge-mode
-        (set (make-local-variable 'paragraph-separate)
-             (concat smerge-parsep-re paragraph-separate))))
+        (setq-local paragraph-separate
+                    (concat smerge-parsep-re paragraph-separate))))
   (unless smerge-mode
     (smerge-remove-props (point-min) (point-max))))
 
diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el
index 5198bcc..43d43e9 100644
--- a/lisp/vc/vc-annotate.el
+++ b/lisp/vc/vc-annotate.el
@@ -208,9 +208,8 @@ menu items."
   ;; it will become a list, to avoid initial annotations being invisible.
   (add-to-invisibility-spec 'foo)
   (remove-from-invisibility-spec 'foo)
-  (set (make-local-variable 'truncate-lines) t)
-  (set (make-local-variable 'font-lock-defaults)
-       '(vc-annotate-font-lock-keywords t))
+  (setq-local truncate-lines t)
+  (setq-local font-lock-defaults '(vc-annotate-font-lock-keywords t))
   (hack-dir-local-variables-non-file-buffer))
 
 (defun vc-annotate-toggle-annotation-visibility ()
@@ -449,11 +448,10 @@ should be applied to the background or to the foreground."
         (with-current-buffer temp-buffer-name
           (unless (equal major-mode 'vc-annotate-mode)
             (vc-annotate-mode))
-          (set (make-local-variable 'vc-annotate-backend) backend)
-          (set (make-local-variable 'vc-annotate-parent-file) file)
-          (set (make-local-variable 'vc-annotate-parent-rev) rev)
-          (set (make-local-variable 'vc-annotate-parent-display-mode)
-               display-mode))))
+          (setq-local vc-annotate-backend backend)
+          (setq-local vc-annotate-parent-file file)
+          (setq-local vc-annotate-parent-rev rev)
+          (setq-local vc-annotate-parent-display-mode display-mode))))
 
     (with-current-buffer temp-buffer-name
       (vc-run-delayed
@@ -702,10 +700,10 @@ or OFFSET if present."
 RATIO is the expansion that should be applied to `vc-annotate-color-map'.
 The annotations are relative to the current time, unless overridden by OFFSET."
   (when (/= ratio 1.0)
-    (set (make-local-variable 'vc-annotate-color-map)
+    (setq-local vc-annotate-color-map
         (mapcar (lambda (elem) (cons (* (car elem) ratio) (cdr elem)))
                 vc-annotate-color-map)))
-  (set (make-local-variable 'vc-annotate-offset) offset)
+  (setq-local vc-annotate-offset offset)
   (font-lock-mode 1))
 
 (defun vc-annotate-lines (limit)
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index e2d0ca6..5eee7f6 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -701,18 +701,18 @@ or a superior directory.")
 (define-derived-mode vc-bzr-log-view-mode log-view-mode "Bzr-Log-View"
   (remove-hook 'log-view-mode-hook 'vc-bzr-log-view-mode) ;Deactivate the hack.
   (require 'add-log)
-  (set (make-local-variable 'log-view-per-file-logs) nil)
-  (set (make-local-variable 'log-view-file-re) regexp-unmatchable)
-  (set (make-local-variable 'log-view-message-re)
+  (setq-local log-view-per-file-logs nil)
+  (setq-local log-view-file-re regexp-unmatchable)
+  (setq-local log-view-message-re
        (if (eq vc-log-view-type 'short)
           "^ *\\([0-9.]+\\): \\(.*?\\)[ 
\t]+\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)\\( \\[merge\\]\\)?"
         "^ *\\(?:revno: \\([0-9.]+\\)\\|merged: .+\\)"))
   ;; Allow expanding short log entries
   (when (eq vc-log-view-type 'short)
     (setq truncate-lines t)
-    (set (make-local-variable 'log-view-expanded-log-entry-function)
-        'vc-bzr-expanded-log-entry))
-  (set (make-local-variable 'log-view-font-lock-keywords)
+    (setq-local log-view-expanded-log-entry-function
+                'vc-bzr-expanded-log-entry))
+  (setq-local log-view-font-lock-keywords
        ;; log-view-font-lock-keywords is careful to use the buffer-local
        ;; value of log-view-message-re only since Emacs-23.
        (if (eq vc-log-view-type 'short)
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index cdf8ab9..f576fcf 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -1103,19 +1103,17 @@ commands act on the child files of that directory that 
are displayed in
 the *vc-dir* buffer.
 
 \\{vc-dir-mode-map}"
-  (set (make-local-variable 'vc-dir-backend) use-vc-backend)
-  (set (make-local-variable 'desktop-save-buffer)
-       'vc-dir-desktop-buffer-misc-data)
+  (setq-local vc-dir-backend use-vc-backend)
+  (setq-local desktop-save-buffer 'vc-dir-desktop-buffer-misc-data)
   (setq-local bookmark-make-record-function #'vc-dir-bookmark-make-record)
   (setq buffer-read-only t)
   (when (boundp 'tool-bar-map)
-    (set (make-local-variable 'tool-bar-map) vc-dir-tool-bar-map))
+    (setq-local tool-bar-map vc-dir-tool-bar-map))
   (let ((buffer-read-only nil))
     (erase-buffer)
-    (set (make-local-variable 'vc-dir-process-buffer) nil)
-    (set (make-local-variable 'vc-ewoc) (ewoc-create #'vc-dir-printer))
-    (set (make-local-variable 'revert-buffer-function)
-        'vc-dir-revert-buffer-function)
+    (setq-local vc-dir-process-buffer nil)
+    (setq-local vc-ewoc (ewoc-create #'vc-dir-printer))
+    (setq-local revert-buffer-function 'vc-dir-revert-buffer-function)
     (setq list-buffers-directory (expand-file-name "*vc-dir*" 
default-directory))
     (add-to-list 'vc-dir-buffers (current-buffer))
     ;; Make sure that if the directory buffer is killed, the update
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index 932b915..4cc6fdd 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -179,9 +179,9 @@ Another is that undo information is not kept."
       ;; want any of its output to appear from now on.
       (when oldproc (delete-process oldproc)))
     (kill-all-local-variables)
-    (set (make-local-variable 'vc-parent-buffer) camefrom)
-    (set (make-local-variable 'vc-parent-buffer-name)
-        (concat " from " (buffer-name camefrom)))
+    (setq-local vc-parent-buffer camefrom)
+    (setq-local vc-parent-buffer-name
+                (concat " from " (buffer-name camefrom)))
     (setq default-directory olddir)
     (let ((buffer-undo-list t)
           (inhibit-read-only t))
@@ -411,8 +411,8 @@ Display the buffer in some window, but don't select it."
                                  (symbol-value error-regexp-alist))))
     (let ((compilation-error-regexp-alist error-regexp-alist))
       (compilation-mode))
-    (set (make-local-variable 'compilation-error-regexp-alist)
-        error-regexp-alist)))
+    (setq-local compilation-error-regexp-alist
+                error-regexp-alist)))
 
 (declare-function vc-dir-refresh "vc-dir" ())
 
@@ -678,14 +678,14 @@ BACKEND, if non-nil, specifies a VC backend for the Log 
Edit buffer."
     (if (and comment (not initial-contents))
        (set-buffer (get-buffer-create logbuf))
       (pop-to-buffer (get-buffer-create logbuf)))
-    (set (make-local-variable 'vc-parent-buffer) parent)
-    (set (make-local-variable 'vc-parent-buffer-name)
-        (concat " from " (buffer-name vc-parent-buffer)))
+    (setq-local vc-parent-buffer parent)
+    (setq-local vc-parent-buffer-name
+                (concat " from " (buffer-name vc-parent-buffer)))
     (vc-log-edit files mode backend)
     (make-local-variable 'vc-log-after-operation-hook)
     (when after-hook
       (setq vc-log-after-operation-hook after-hook))
-    (set (make-local-variable 'vc-log-operation) action)
+    (setq-local vc-log-operation action)
     (when comment
       (erase-buffer)
       (when (stringp comment) (insert comment)))
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 91554bb..0da4509 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1242,18 +1242,18 @@ log entries."
 (define-derived-mode vc-git-log-view-mode log-view-mode "Git-Log-View"
   (require 'add-log) ;; We need the faces add-log.
   ;; Don't have file markers, so use impossible regexp.
-  (set (make-local-variable 'log-view-file-re) regexp-unmatchable)
-  (set (make-local-variable 'log-view-per-file-logs) nil)
-  (set (make-local-variable 'log-view-message-re)
-       (if (not (memq vc-log-view-type '(long log-search with-diff)))
-          (cadr vc-git-root-log-format)
-        "^commit +\\([0-9a-z]+\\)"))
+  (setq-local log-view-file-re regexp-unmatchable)
+  (setq-local log-view-per-file-logs nil)
+  (setq-local log-view-message-re
+              (if (not (memq vc-log-view-type '(long log-search with-diff)))
+                  (cadr vc-git-root-log-format)
+                "^commit +\\([0-9a-z]+\\)"))
   ;; Allow expanding short log entries.
   (when (memq vc-log-view-type '(short log-outgoing log-incoming mergebase))
     (setq truncate-lines t)
-    (set (make-local-variable 'log-view-expanded-log-entry-function)
-        'vc-git-expanded-log-entry))
-  (set (make-local-variable 'log-view-font-lock-keywords)
+    (setq-local log-view-expanded-log-entry-function
+                'vc-git-expanded-log-entry))
+  (setq-local log-view-font-lock-keywords
        (if (not (memq vc-log-view-type '(long log-search with-diff)))
           (list (cons (nth 1 vc-git-root-log-format)
                       (nth 2 vc-git-root-log-format)))
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 67e1290..e7f67e9 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -464,19 +464,19 @@ If LIMIT is non-nil, show no more than this many entries."
 
 (define-derived-mode vc-hg-log-view-mode log-view-mode "Hg-Log-View"
   (require 'add-log) ;; we need the add-log faces
-  (set (make-local-variable 'log-view-file-re) regexp-unmatchable)
-  (set (make-local-variable 'log-view-per-file-logs) nil)
-  (set (make-local-variable 'log-view-message-re)
-       (if (eq vc-log-view-type 'short)
-          (cadr vc-hg-root-log-format)
-         "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)"))
-  (set (make-local-variable 'tab-width) 2)
+  (setq-local log-view-file-re regexp-unmatchable)
+  (setq-local log-view-per-file-logs nil)
+  (setq-local log-view-message-re
+              (if (eq vc-log-view-type 'short)
+                  (cadr vc-hg-root-log-format)
+                "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)"))
+  (setq-local tab-width 2)
   ;; Allow expanding short log entries
   (when (eq vc-log-view-type 'short)
     (setq truncate-lines t)
-    (set (make-local-variable 'log-view-expanded-log-entry-function)
-        'vc-hg-expanded-log-entry))
-  (set (make-local-variable 'log-view-font-lock-keywords)
+    (setq-local log-view-expanded-log-entry-function
+                'vc-hg-expanded-log-entry))
+  (setq-local log-view-font-lock-keywords
        (if (eq vc-log-view-type 'short)
           (list (cons (nth 1 vc-hg-root-log-format)
                       (nth 2 vc-hg-root-log-format)))
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index f09cedd..07bec8e 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -814,7 +814,7 @@ In the latter case, VC mode is deactivated for this buffer."
        (unless vc-make-backup-files
          ;; Use this variable, not make-backup-files,
          ;; because this is for things that depend on the file name.
-          (set (make-local-variable 'backup-inhibited) t)))
+          (setq-local backup-inhibited t)))
        ((let* ((truename (and buffer-file-truename
                              (expand-file-name buffer-file-truename)))
               (link-type (and truename
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el
index 3c26ffc..7797d19 100644
--- a/lisp/vc/vc-mtn.el
+++ b/lisp/vc/vc-mtn.el
@@ -239,14 +239,14 @@ If LIMIT is non-nil, show no more than this many entries."
 
 (define-derived-mode vc-mtn-log-view-mode log-view-mode "Mtn-Log-View"
   ;; Don't match anything.
-  (set (make-local-variable 'log-view-file-re) regexp-unmatchable)
-  (set (make-local-variable 'log-view-per-file-logs) nil)
+  (setq-local log-view-file-re regexp-unmatchable)
+  (setq-local log-view-per-file-logs nil)
   ;; TODO: Use a more precise regexp than "[ |/]+" to avoid false positives
   ;; in the ChangeLog text.
-  (set (make-local-variable 'log-view-message-re)
-       "^[ |/]+Revision: \\([0-9a-f]+\\)")
+  (setq-local log-view-message-re
+              "^[ |/]+Revision: \\([0-9a-f]+\\)")
   (require 'add-log)                    ;For change-log faces.
-  (set (make-local-variable 'log-view-font-lock-keywords)
+  (setq-local log-view-font-lock-keywords
        (append log-view-font-lock-keywords
                '(("^[ |]+Author: \\(.*\\)" (1 'change-log-email))
                  ("^[ |]+Date: \\(.*\\)" (1 'change-log-date))))))
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index 06dd094..5ea2a41 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -548,7 +548,7 @@ or svn+ssh://."
 
 (define-derived-mode vc-svn-log-view-mode log-view-mode "SVN-Log-View"
   (require 'add-log)
-  (set (make-local-variable 'log-view-per-file-logs) nil))
+  (setq-local log-view-per-file-logs nil))
 
 (autoload 'vc-setup-buffer "vc-dispatcher")
 
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 1a24611..f268f91 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1411,8 +1411,7 @@ first backend that could register the file is used."
        ;; the buffers visiting files affected by this `vc-register', not
        ;; in the current-buffer.
        ;; (unless vc-make-backup-files
-       ;;   (make-local-variable 'backup-inhibited)
-       ;;   (setq backup-inhibited t))
+       ;;   (setq-local backup-inhibited t))
 
        (vc-resynch-buffer file t t))
      files)
@@ -1779,11 +1778,11 @@ Return t if the buffer had changes, nil otherwise."
     (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer async)
     (set-buffer buffer)
     (diff-mode)
-    (set (make-local-variable 'diff-vc-backend) (car vc-fileset))
-    (set (make-local-variable 'diff-vc-revisions) (list rev1 rev2))
-    (set (make-local-variable 'revert-buffer-function)
-        (lambda (_ignore-auto _noconfirm)
-           (vc-diff-internal async vc-fileset rev1 rev2 verbose)))
+    (setq-local diff-vc-backend (car vc-fileset))
+    (setq-local diff-vc-revisions (list rev1 rev2))
+    (setq-local revert-buffer-function
+                (lambda (_ignore-auto _noconfirm)
+                  (vc-diff-internal async vc-fileset rev1 rev2 verbose)))
     ;; Make the *vc-diff* buffer read only, the diff-mode key
     ;; bindings are nicer for read only buffers. pcl-cvs does the
     ;; same thing.
@@ -2118,7 +2117,7 @@ Saves the buffer to the file."
       (with-current-buffer result-buf
        ;; Set the parent buffer so that things like
        ;; C-x v g, C-x v l, ... etc work.
-       (set (make-local-variable 'vc-parent-buffer) filebuf))
+        (setq-local vc-parent-buffer filebuf))
       result-buf)))
 
 (defun vc-find-revision-no-save (file revision &optional backend buffer)
@@ -2165,7 +2164,7 @@ Unlike `vc-find-revision-save', doesn't save the buffer 
to the file."
                           (get-file-buffer filename)
                           (find-file-noselect filename))))
       (with-current-buffer result-buf
-       (set (make-local-variable 'vc-parent-buffer) filebuf))
+        (setq-local vc-parent-buffer filebuf))
       result-buf)))
 
 ;; Header-insertion code
@@ -2466,7 +2465,7 @@ earlier revisions.  Show up to LIMIT entries (non-nil 
means unlimited)."
                               rev-buff-func)
   (let (retval (buffer (get-buffer-create buffer-name)))
     (with-current-buffer buffer
-      (set (make-local-variable 'vc-log-view-type) type))
+      (setq-local vc-log-view-type type))
     (setq retval (funcall backend-func backend buffer-name type files))
     (with-current-buffer buffer
       (let ((inhibit-read-only t))
@@ -2478,10 +2477,9 @@ earlier revisions.  Show up to LIMIT entries (non-nil 
means unlimited)."
                                    backend 'region-history-mode))
                              'region-history-mode
                            'log-view-mode))
-       (set (make-local-variable 'log-view-vc-backend) backend)
-       (set (make-local-variable 'log-view-vc-fileset) files)
-       (set (make-local-variable 'revert-buffer-function)
-            rev-buff-func)))
+        (setq-local log-view-vc-backend backend)
+        (setq-local log-view-vc-fileset files)
+        (setq-local revert-buffer-function rev-buff-func)))
     ;; Display after setting up major-mode, so display-buffer-alist can know
     ;; the major-mode.
     (pop-to-buffer buffer)
@@ -2679,13 +2677,13 @@ mark."
     (vc-call region-history file buf lfrom lto)
     (with-current-buffer buf
       (vc-call-backend backend 'region-history-mode)
-      (set (make-local-variable 'log-view-vc-backend) backend)
-      (set (make-local-variable 'log-view-vc-fileset) (list file))
-      (set (make-local-variable 'revert-buffer-function)
-          (lambda (_ignore-auto _noconfirm)
-             (with-current-buffer buf
-               (let ((inhibit-read-only t)) (erase-buffer)))
-             (vc-call region-history file buf lfrom lto))))
+      (setq-local log-view-vc-backend backend)
+      (setq-local log-view-vc-fileset (list file))
+      (setq-local revert-buffer-function
+                  (lambda (_ignore-auto _noconfirm)
+                    (with-current-buffer buf
+                      (let ((inhibit-read-only t)) (erase-buffer)))
+                    (vc-call region-history file buf lfrom lto))))
     (display-buffer buf)))
 
 ;;;###autoload
diff --git a/lisp/view.el b/lisp/view.el
index 204e28c..6f576f8 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -88,7 +88,9 @@ the selected window is considered for restoring."
   :group 'view)
 
 (defcustom view-inhibit-help-message nil
-  "Non-nil inhibits the help message shown upon entering View mode."
+  "Non-nil inhibits the help message shown upon entering View mode.
+This setting takes effect only when View mode is entered via an
+interactive command; otherwise the help message is not shown."
   :type 'boolean
   :group 'view
   :version "22.1")
@@ -559,7 +561,10 @@ This function runs the normal hook `view-mode-hook'."
 
   (unless view-mode
     (view-mode 1)
-    (unless view-inhibit-help-message
+    (when (and (not view-inhibit-help-message)
+               ;; Avoid spamming the echo area if `view-mode' is entered
+               ;; non-interactively, e.g., in a temporary buffer (bug#44629).
+               this-command)
       (message "%s"
               (substitute-command-keys "\
 View mode: type \\[help-command] for help, \\[describe-mode] for commands, 
\\[View-quit] to quit.")))))
diff --git a/lisp/wid-browse.el b/lisp/wid-browse.el
index f5c3d48..bc2e3c4 100644
--- a/lisp/wid-browse.el
+++ b/lisp/wid-browse.el
@@ -28,7 +28,6 @@
 ;;; Code:
 
 (require 'easymenu)
-(require 'custom)
 (require 'wid-edit)
 
 (defgroup widget-browse nil
diff --git a/lisp/windmove.el b/lisp/windmove.el
index 6557960..5db13cf 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -485,7 +485,7 @@ When `switch-to-buffer-obey-display-actions' is non-nil,
                        (t (window-in-direction
                            dir nil nil
                            (and arg (prefix-numeric-value arg))
-                           windmove-wrap-around)))))
+                           windmove-wrap-around 'nomini)))))
          (unless window
            (setq window (split-window nil nil dir) type 'window))
          (cons window type)))
@@ -569,7 +569,7 @@ select the window at direction DIR.
 When `windmove-wrap-around' is non-nil, takes the window
 from the opposite side of the frame."
   (let ((other-window (window-in-direction dir nil nil arg
-                                           windmove-wrap-around t)))
+                                           windmove-wrap-around 'nomini)))
     (cond ((null other-window)
            (user-error "No window %s from selected window" dir))
           (t
@@ -637,7 +637,7 @@ a single modifier.  Default value of PREFIX is `C-x' and 
MODIFIERS is `shift'."
 When `windmove-wrap-around' is non-nil, takes the window
 from the opposite side of the frame."
   (let ((other-window (window-in-direction dir nil nil nil
-                                           windmove-wrap-around t)))
+                                           windmove-wrap-around 'nomini)))
     (cond ((or (null other-window) (window-minibuffer-p other-window))
            (user-error "No window %s from selected window" dir))
           (t
diff --git a/lisp/window.el b/lisp/window.el
index d564ec5..daa5c67 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -2309,7 +2309,7 @@ SIDE can be any of the symbols `left', `top', `right' or
 ;; Neither of these allow one to selectively ignore specific windows
 ;; (windows whose `no-other-window' parameter is non-nil) as targets of
 ;; the movement.
-(defun window-in-direction (direction &optional window ignore sign wrap mini)
+(defun window-in-direction (direction &optional window ignore sign wrap 
minibuf)
   "Return window in DIRECTION as seen from WINDOW.
 More precisely, return the nearest window in direction DIRECTION
 as seen from the position of `window-point' in window WINDOW.
@@ -2332,10 +2332,11 @@ frame borders.  This means to return for WINDOW at the 
top of the
 frame and DIRECTION `above' the minibuffer window if the frame
 has one, and a window at the bottom of the frame otherwise.
 
-Optional argument MINI nil means to return the minibuffer window
-if and only if it is currently active.  MINI non-nil means to
-return the minibuffer window even when it's not active.  However,
-if WRAP is non-nil, always act as if MINI were nil.
+Optional argument MINIBUF t means to return the minibuffer
+window even if it isn't active.  MINIBUF nil or omitted means
+to return the minibuffer window if and only if it is currently active.
+MINIBUF neither nil nor t means never return the minibuffer window.
+However, if WRAP is non-nil, always act as if MINIBUF were nil.
 
 Return nil if no suitable window can be found."
   (setq window (window-normalize-window window t))
@@ -2451,7 +2452,7 @@ Return nil if no suitable window can be found."
           (setq best-edge-2 w-top)
           (setq best-diff-2 best-diff-2-new)
           (setq best-2 w)))))
-     frame nil (and mini t))
+     frame nil minibuf)
     (or best best-2)))
 
 (defun get-window-with-predicate (predicate &optional minibuf all-frames 
default)
@@ -8565,13 +8566,13 @@ Return the buffer switched to."
 
       (when set-window-start-and-point
         (let* ((entry (assq buffer (window-prev-buffers)))
-              (displayed (and (eq switch-to-buffer-preserve-window-point
-                                  'already-displayed)
+               (preserve-win-point
+                (buffer-local-value 'switch-to-buffer-preserve-window-point
+                                    buffer))
+              (displayed (and (eq preserve-win-point 'already-displayed)
                               (get-buffer-window buffer 0))))
          (set-window-buffer nil buffer)
-         (when (and entry
-                    (or (eq switch-to-buffer-preserve-window-point t)
-                        displayed))
+         (when (and entry (or (eq preserve-win-point t) displayed))
            ;; Try to restore start and point of buffer in the selected
            ;; window (Bug#4041).
            (set-window-start (selected-window) (nth 1 entry) t)
diff --git a/lisp/woman.el b/lisp/woman.el
index 96ae7fe..33a6a0d 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -404,7 +404,6 @@
 (make-obsolete-variable 'woman-version nil "28.1")
 
 (require 'man)
-(require 'button)
 (define-button-type 'WoMan-xref-man-page
   :supertype 'Man-abstract-xref-man-page
   'func (lambda (arg)
diff --git a/src/alloc.c b/src/alloc.c
index 133b0e6..22f37b0 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6230,6 +6230,30 @@ For further details, see Info node `(elisp)Garbage 
Collection'.  */)
   return CALLMANY (Flist, total);
 }
 
+DEFUN ("garbage-collect-maybe", Fgarbage_collect_maybe,
+Sgarbage_collect_maybe, 1, 1, "",
+       doc: /* Call `garbage-collect' if enough allocation happened.
+FACTOR determines what "enough" means here:
+If FACTOR is a positive number N, it means to run GC if more than
+1/Nth of the allocations needed to trigger automatic allocation took
+place.
+Therefore, as N gets higher, this is more likely to perform a GC.
+Returns non-nil if GC happened, and nil otherwise.  */)
+  (Lisp_Object factor)
+{
+  CHECK_FIXNAT (factor);
+  EMACS_INT fact = XFIXNAT (factor);
+
+  EMACS_INT since_gc = gc_threshold - consing_until_gc;
+  if (fact >= 1 && since_gc > gc_threshold / fact)
+    {
+      garbage_collect ();
+      return Qt;
+    }
+  else
+    return Qnil;
+}
+
 /* Mark Lisp objects in glyph matrix MATRIX.  Currently the
    only interesting objects referenced from glyphs are strings.  */
 
@@ -7584,6 +7608,7 @@ N should be nonnegative.  */);
   defsubr (&Smake_finalizer);
   defsubr (&Spurecopy);
   defsubr (&Sgarbage_collect);
+  defsubr (&Sgarbage_collect_maybe);
   defsubr (&Smemory_info);
   defsubr (&Smemory_use_counts);
 #ifdef GNU_LINUX
diff --git a/src/buffer.c b/src/buffer.c
index 360dd34..4215acb 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -62,8 +62,9 @@ struct buffer buffer_defaults;
 
 /* This structure marks which slots in a buffer have corresponding
    default values in buffer_defaults.
-   Each such slot has a nonzero value in this structure.
-   The value has only one nonzero bit.
+   Each such slot has a value in this structure.
+   The value is a positive Lisp integer that must be smaller than
+   MAX_PER_BUFFER_VARS.
 
    When a buffer has its own local value for a slot,
    the entry for that slot (found in the same slot in this structure)
diff --git a/src/doprnt.c b/src/doprnt.c
index 9316497..7b742ad 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -77,8 +77,7 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
    where flags is [+ -0], width is [0-9]+, precision is .[0-9]+, and length
    is empty or l or the value of the pD or pI or PRIdMAX (sans "d") macros.
    A % that does not introduce a valid %-sequence causes undefined behavior.
-   ASCII bytes in FORMAT other than % are copied through as-is;
-   non-ASCII bytes should not appear in FORMAT.
+   Bytes in FORMAT other than % are copied through as-is.
 
    The + flag character inserts a + before any positive number, while a space
    inserts a space before any positive number; these flags only affect %d, %o,
@@ -175,7 +174,13 @@ doprnt_non_null_end (char *buffer, ptrdiff_t bufsize, char 
const *format,
    Returns the number of bytes stored into BUFFER, excluding
    the terminating null byte.  Output is always null-terminated.
    String arguments are passed as C strings.
-   Integers are passed as C integers.  */
+   Integers are passed as C integers.
+
+   FIXME: If FORMAT_END is not at a character boundary
+   doprnt_non_null_end will cut the string in the middle of the
+   character and the returned string will have an incomplete character
+   sequence at the end.  We may prefer to cut at a character
+   boundary.  */
 
 ptrdiff_t
 doprnt (char *buffer, ptrdiff_t bufsize, const char *format,
@@ -486,14 +491,25 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char 
*format,
        src = uLSQM, srclen = sizeof uLSQM - 1;
       else if (EQ (quoting_style, Qcurve) && fmtchar == '\'')
        src = uRSQM, srclen = sizeof uRSQM - 1;
-      else
+      else if (! LEADING_CODE_P (fmtchar))
        {
          if (EQ (quoting_style, Qstraight) && fmtchar == '`')
            fmtchar = '\'';
-         eassert (ASCII_CHAR_P (fmtchar));
+
          *bufptr++ = fmtchar;
          continue;
        }
+      else
+        {
+          int charlen = BYTES_BY_CHAR_HEAD (fmtchar);
+          src = fmt0;
+
+          /* If the format string ends in the middle of a multibyte
+             character we don't want to skip over the NUL byte.  */
+          for (srclen = 1 ; *(src + srclen) != 0 && srclen < charlen ; 
srclen++);
+
+          fmt = src + srclen;
+        }
 
       if (bufsize < srclen)
        {
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 5f97815..0f3ef59 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -1506,8 +1506,8 @@ finalize_environment_unwind (void *env)
 void
 finalize_runtime_unwind (void *raw_ert)
 {
-  struct emacs_runtime *ert = raw_ert;
-  finalize_environment (ert->private_members->env);
+  /* No further cleanup is required, as the initial environment is
+     unwound separately.  See the logic in Fmodule_load.  */
 }
 
 
diff --git a/src/emacs.c b/src/emacs.c
index 03566c8..afcdb66 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -386,7 +386,14 @@ terminate_due_to_signal (int sig, int backtrace_limit)
 
           totally_unblock_input ();
           if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT)
-            Fkill_emacs (make_fixnum (sig));
+           {
+             /* Avoid abort in shut_down_emacs if we were interrupted
+                by SIGINT in noninteractive usage, as in that case we
+                don't care about the message stack.  */
+             if (sig == SIGINT && noninteractive)
+               clear_message_stack ();
+             Fkill_emacs (make_fixnum (sig));
+           }
 
           shut_down_emacs (sig, Qnil);
           emacs_backtrace (backtrace_limit);
diff --git a/src/eval.c b/src/eval.c
index aa1775b..fb747c5 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1773,6 +1773,7 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object 
data, bool keyboard_quit)
        break;
     }
 
+  bool debugger_called = false;
   if (/* Don't run the debugger for a memory-full error.
         (There is no room in memory to do that!)  */
       !NILP (error_symbol)
@@ -1786,7 +1787,7 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object 
data, bool keyboard_quit)
             if requested".  */
          || EQ (h->tag_or_ch, Qerror)))
     {
-      bool debugger_called
+      debugger_called
        = maybe_call_debugger (conditions, error_symbol, data);
       /* We can't return values to code which signaled an error, but we
         can continue code which has signaled a quit.  */
@@ -1794,6 +1795,18 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object 
data, bool keyboard_quit)
        return Qnil;
     }
 
+  /* If we're in batch mode, print a backtrace unconditionally to help with
+     debugging.  Make sure to use `debug' unconditionally to not interfere with
+     ERT or other packages that install custom debuggers.  */
+  if (!debugger_called && !NILP (error_symbol)
+      && (NILP (clause) || EQ (h->tag_or_ch, Qerror)) && noninteractive)
+    {
+      ptrdiff_t count = SPECPDL_INDEX ();
+      specbind (Vdebugger, Qdebug);
+      call_debugger (list2 (Qerror, Fcons (error_symbol, data)));
+      unbind_to (count, Qnil);
+    }
+
   if (!NILP (clause))
     {
       Lisp_Object unwind_data
diff --git a/src/lisp.h b/src/lisp.h
index 79de5d9..a5a90cc 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3732,6 +3732,7 @@ extern Lisp_Object echo_area_buffer[2];
 extern void add_to_log (char const *, ...);
 extern void vadd_to_log (char const *, va_list);
 extern void check_message_stack (void);
+extern void clear_message_stack (void);
 extern void setup_echo_area_for_printing (bool);
 extern bool push_message (void);
 extern void pop_message_unwind (void);
@@ -3814,6 +3815,7 @@ flush_stack_call_func (void (*func) (void *arg), void 
*arg)
 
 extern void garbage_collect (void);
 extern void maybe_garbage_collect (void);
+extern bool maybe_garbage_collect_eagerly (EMACS_INT factor);
 extern const char *pending_malloc_warning;
 extern Lisp_Object zero_vector;
 extern EMACS_INT consing_until_gc;
diff --git a/src/search.c b/src/search.c
index 4eb634a..50d82fd 100644
--- a/src/search.c
+++ b/src/search.c
@@ -3033,12 +3033,12 @@ If optional arg RESEAT is non-nil, make markers on LIST 
point nowhere.  */)
 
 DEFUN ("match-data--translate", Fmatch_data__translate, Smatch_data__translate,
        1, 1, 0,
-       doc: /* Add N to all string positions in the match data.  Internal.  */)
+       doc: /* Add N to all positions in the match data.  Internal.  */)
   (Lisp_Object n)
 {
   CHECK_FIXNUM (n);
   EMACS_INT delta = XFIXNUM (n);
-  if (EQ (last_thing_searched, Qt))   /* String match data only.  */
+  if (!NILP (last_thing_searched))
     for (ptrdiff_t i = 0; i < search_regs.num_regs; i++)
       if (search_regs.start[i] >= 0)
         {
diff --git a/src/xdisp.c b/src/xdisp.c
index 76ef420..ed1d476 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -11929,8 +11929,8 @@ pop_message_unwind (void)
 
 
 /* Check that Vmessage_stack is nil.  Called from emacs.c when Emacs
-   exits.  If the stack is not empty, we have a missing pop_message
-   somewhere.  */
+   exits.  If the stack is not empty, we have a missing
+   pop_message_unwind somewhere.  */
 
 void
 check_message_stack (void)
@@ -11939,6 +11939,11 @@ check_message_stack (void)
     emacs_abort ();
 }
 
+void
+clear_message_stack (void)
+{
+  Vmessage_stack = Qnil;
+}
 
 /* Truncate to NCHARS what will be displayed in the echo area the next
    time we display it---but don't redisplay it now.  */
diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el
index 9ebf137..84f8700 100644
--- a/test/lisp/autorevert-tests.el
+++ b/test/lisp/autorevert-tests.el
@@ -132,7 +132,7 @@ This expects `auto-revert--messages' to be bound by
                 (null (string-match
                        (format-message
                         "Reverting buffer `%s'\\." (buffer-name buffer))
-                       auto-revert--messages)))
+                       (or auto-revert--messages ""))))
       (if (with-current-buffer buffer auto-revert-use-notify)
           (read-event nil nil 0.05)
         (sleep-for 0.05)))))
@@ -583,6 +583,89 @@ This expects `auto-revert--messages' to be bound by
 (auto-revert--deftest-remote auto-revert-test06-write-file
   "Test `write-file' in `auto-revert-mode' for remote buffers.")
 
+;; This is inspired by Bug#44638.
+(ert-deftest auto-revert-test07-auto-revert-several-buffers ()
+  "Check autorevert for several buffers visiting the same file."
+  ;; (with-auto-revert-test
+   (let ((auto-revert-use-notify t)
+         (tmpfile (make-temp-file "auto-revert-test"))
+         (times '(120 60 30 15))
+         (num-buffers 10)
+         require-final-newline buffers)
+
+     (unwind-protect
+         ;; Check indirect buffers.
+         (ert-with-message-capture auto-revert--messages
+           (auto-revert-tests--write-file "any text" tmpfile (pop times))
+           (push (find-file-noselect tmpfile) buffers)
+           (with-current-buffer (car buffers)
+             (should (string-equal (buffer-string) "any text"))
+             ;; `buffer-stale--default-function' checks for
+             ;; `verify-visited-file-modtime'.  We must ensure that
+             ;; it returns nil.
+             (auto-revert-mode 1)
+             (should auto-revert-mode))
+
+           (dotimes (i num-buffers)
+             (add-to-list
+              'buffers
+              (make-indirect-buffer
+               (car buffers) (format "%s-%d" (buffer-file-name (car buffers)) 
i) 'clone)
+              'append))
+           (dolist (buf buffers)
+             (with-current-buffer buf
+               (should (string-equal (buffer-string) "any text"))
+               (should auto-revert-mode)))
+
+           (auto-revert-tests--write-file "another text" tmpfile (pop times))
+           ;; Check, that the buffer has been reverted.
+           (auto-revert--wait-for-revert (car buffers))
+           (dolist (buf buffers)
+             (with-current-buffer buf
+               (should (string-equal (buffer-string) "another text")))))
+
+       ;; Exit.
+       (ignore-errors
+         (dolist (buf buffers)
+           (with-current-buffer buf (set-buffer-modified-p nil))
+           (kill-buffer buf)))
+       (setq buffers nil)
+       (ignore-errors (delete-file tmpfile)))
+
+     ;; Check direct buffers.
+     (unwind-protect
+         (ert-with-message-capture auto-revert--messages
+           (auto-revert-tests--write-file "any text" tmpfile (pop times))
+
+           (dotimes (i num-buffers)
+             (add-to-list
+              'buffers
+              (generate-new-buffer (format "%s-%d" (file-name-nondirectory 
tmpfile) i))
+              'append))
+           (dolist (buf buffers)
+             (with-current-buffer buf
+               (insert-file-contents tmpfile 'visit)
+               (should (string-equal (buffer-string) "any text"))
+               (auto-revert-mode 1)
+               (should auto-revert-mode)))
+
+           (auto-revert-tests--write-file "another text" tmpfile (pop times))
+           ;; Check, that the buffers have been reverted.
+           (dolist (buf buffers)
+             (auto-revert--wait-for-revert buf)
+             (with-current-buffer buf
+               (should (string-equal (buffer-string) "another text")))))
+
+       ;; Exit.
+       (ignore-errors
+         (dolist (buf buffers)
+           (with-current-buffer buf (set-buffer-modified-p nil))
+           (kill-buffer buf)))
+       (ignore-errors (delete-file tmpfile)))));)
+
+(auto-revert--deftest-remote auto-revert-test07-auto-revert-several-buffers
+  "Check autorevert for several buffers visiting the same remote file.")
+
 (defun auto-revert-test-all (&optional interactive)
   "Run all tests for \\[auto-revert]."
   (interactive "p")
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-add-hook.el 
b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-add-hook.el
new file mode 100644
index 0000000..5f39089
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-add-hook.el
@@ -0,0 +1,4 @@
+;;; -*- lexical-binding: t; -*-
+(let ((foo nil))
+  (add-hook 'foo #'next-line)
+  foo)
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-remove-hook.el 
b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-remove-hook.el
new file mode 100644
index 0000000..eaa625e
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-remove-hook.el
@@ -0,0 +1,4 @@
+;;; -*- lexical-binding: t; -*-
+(let ((foo nil))
+  (remove-hook 'foo #'next-line)
+  foo)
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-failure.el
 
b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-failure.el
new file mode 100644
index 0000000..7a116ad
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-failure.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t; -*-
+(let ((foo nil))
+  (run-hook-with-args-until-failure 'foo))
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-success.el
 
b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-success.el
new file mode 100644
index 0000000..96d10a3
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-success.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t; -*-
+(let ((foo nil))
+  (run-hook-with-args-until-success 'foo #'next-line))
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args.el
 
b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args.el
new file mode 100644
index 0000000..bb9101b
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t; -*-
+(let ((foo nil))
+  (run-hook-with-args 'foo))
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-symbol-value.el
 
b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-symbol-value.el
new file mode 100644
index 0000000..5f39089
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-symbol-value.el
@@ -0,0 +1,4 @@
+;;; -*- lexical-binding: t; -*-
+(let ((foo nil))
+  (add-hook 'foo #'next-line)
+  foo)
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-autoload-not-on-top-level.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-autoload-not-on-top-level.el
new file mode 100644
index 0000000..f193130
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-autoload-not-on-top-level.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defun foo ()
+  (autoload 'bar "baz" nil nil 'macro))
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-callargs.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-callargs.el
new file mode 100644
index 0000000..687add3
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-callargs.el
@@ -0,0 +1,5 @@
+;;; -*- lexical-binding: t -*-
+(defun foo (_x)
+  nil)
+(defun bar ()
+  (foo 1 2))
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-defcustom-nogroup.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-defcustom-nogroup.el
new file mode 100644
index 0000000..a67d4f0
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-defcustom-nogroup.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defcustom foo nil
+  :type 'boolean)
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-defcustom-notype.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-defcustom-notype.el
new file mode 100644
index 0000000..c15ab9b
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-defcustom-notype.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defcustom foo nil
+  :group 'emacs)
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-defvar-lacks-prefix.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-defvar-lacks-prefix.el
new file mode 100644
index 0000000..9f3cbb9
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-defvar-lacks-prefix.el
@@ -0,0 +1,2 @@
+;;; -*- lexical-binding: t -*-
+(defvar foo nil)
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-format.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-format.el
new file mode 100644
index 0000000..a1902bc
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-format.el
@@ -0,0 +1,2 @@
+;;; -*- lexical-binding: t -*-
+(message "%s" 1 2)
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-free-setq.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-free-setq.el
new file mode 100644
index 0000000..6e18712
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-free-setq.el
@@ -0,0 +1,2 @@
+;;; -*- lexical-binding: t -*-
+(setq foo 'bar)
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-free-variable-reference.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-free-variable-reference.el
new file mode 100644
index 0000000..50a9527
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-free-variable-reference.el
@@ -0,0 +1,4 @@
+;;; -*- lexical-binding: t -*-
+(defvar xxx-test)
+(defun foo ()
+  (setq xxx-test bar))
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-interactive-only.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-interactive-only.el
new file mode 100644
index 0000000..9e0c99b
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-interactive-only.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defun foo ()
+  (next-line))
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-lambda-malformed-interactive-spec.el
 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-lambda-malformed-interactive-spec.el
new file mode 100644
index 0000000..6bd9027
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-lambda-malformed-interactive-spec.el
@@ -0,0 +1,4 @@
+;;; -*- lexical-binding: t -*-
+(defun foo ()
+  (interactive "foo" "bar")
+  nil)
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-make-variable-buffer-local.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-make-variable-buffer-local.el
new file mode 100644
index 0000000..aa1e6c0
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-make-variable-buffer-local.el
@@ -0,0 +1,4 @@
+;;; -*- lexical-binding: t -*-
+(defvar foobar)
+(defun foo ()
+  (make-variable-buffer-local 'foobar))
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-defun.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-defun.el
new file mode 100644
index 0000000..2a7af61
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-defun.el
@@ -0,0 +1,8 @@
+;;; -*- lexical-binding: t -*-
+
+(defun foo-obsolete ()
+  (declare (obsolete nil "99.99"))
+  nil)
+
+(defun foo ()
+  (foo-obsolete))
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-hook.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-hook.el
new file mode 100644
index 0000000..078e6e4
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-hook.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defun foo ()
+  (add-hook 'bytecomp--tests-obsolete-var #'next-line))
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable-same-file.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable-same-file.el
new file mode 100644
index 0000000..31deb61
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable-same-file.el
@@ -0,0 +1,13 @@
+;;; -*- lexical-binding: t -*-
+
+(defvar foo-obsolete nil)
+(make-obsolete-variable 'foo-obsolete nil "99.99")
+
+;; From bytecomp.el:
+;; If foo.el declares `toto' as obsolete, it is likely that foo.el will
+;; actually use `toto' in order for this obsolete variable to still work
+;; correctly, so paradoxically, while byte-compiling foo.el, the presence
+;; of a make-obsolete-variable call for `toto' is an indication that `toto'
+;; should not trigger obsolete-warnings in foo.el.
+(defun foo ()
+  foo-obsolete)
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable.el
new file mode 100644
index 0000000..9a517cc
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable.el
@@ -0,0 +1,4 @@
+;;; -*- lexical-binding: t -*-
+
+(defun foo ()
+  bytecomp--tests-obsolete-var)
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-defun-as-macro.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-defun-as-macro.el
new file mode 100644
index 0000000..6bd239b
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-defun-as-macro.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defun foo () nil)
+(defmacro foo () t)
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-defun.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-defun.el
new file mode 100644
index 0000000..53e4c0a
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-defun.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defun foo () nil)
+(defun foo () t)
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-macro-as-defun.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-macro-as-defun.el
new file mode 100644
index 0000000..f71ae44
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-macro-as-defun.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defmacro foo () t)
+(defun foo () nil)
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-save-excursion.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-save-excursion.el
new file mode 100644
index 0000000..3818545
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-save-excursion.el
@@ -0,0 +1,5 @@
+;;; -*- lexical-binding: t -*-
+(defun foo ()
+  (save-excursion
+    (set-buffer (current-buffer))
+    nil))
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-let-bind-constant.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-let-bind-constant.el
new file mode 100644
index 0000000..cc1fb57
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-let-bind-constant.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defun foo ()
+  (let ((t 1)) t))
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-let-bind-nonvariable.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-let-bind-nonvariable.el
new file mode 100644
index 0000000..dde2dce
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-let-bind-nonvariable.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defun foo ()
+  (let (('t 1)) t))
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-constant.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-constant.el
new file mode 100644
index 0000000..2fc0680
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-constant.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defun foo ()
+  (setq t nil))
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el
new file mode 100644
index 0000000..0c76c4d
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defun foo ()
+  (set '(a) nil))
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el 
b/test/lisp/emacs-lisp/bytecomp-tests.el
index 680aa51..8fa4d27 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -26,6 +26,7 @@
 ;;; Commentary:
 
 (require 'ert)
+(require 'ert-x)
 (require 'cl-lib)
 (require 'subr-x)
 (require 'bytecomp)
@@ -489,6 +490,9 @@ Subtests signal errors if something goes wrong."
       (defun def () (m))))
   (should (equal (funcall 'def) 4)))
 
+
+;;;; Warnings.
+
 (ert-deftest bytecomp-tests--warnings ()
   (with-current-buffer (get-buffer-create "*Compile-Log*")
     (let ((inhibit-read-only t)) (erase-buffer)))
@@ -536,6 +540,108 @@ Subtests signal errors if something goes wrong."
   (bytecomp--with-warning-test "foo.*lacks a prefix"
     '(defvar foo nil)))
 
+(defmacro bytecomp--define-warning-file-test (file re-warning &optional 
reverse)
+  `(ert-deftest ,(intern (format "bytecomp/%s" file)) ()
+     :expected-result ,(if reverse :failed :passed)
+     (with-current-buffer (get-buffer-create "*Compile-Log*")
+       (let ((inhibit-read-only t)) (erase-buffer))
+       (byte-compile-file ,(ert-resource-file file))
+       (ert-info ((buffer-string) :prefix "buffer: ")
+         (should (re-search-forward ,re-warning))))))
+
+(bytecomp--define-warning-file-test "error-lexical-var-with-add-hook.el"
+                            "add-hook.*lexical var")
+
+(bytecomp--define-warning-file-test "error-lexical-var-with-remove-hook.el"
+                            "remove-hook.*lexical var")
+
+(bytecomp--define-warning-file-test 
"error-lexical-var-with-run-hook-with-args-until-failure.el"
+                            "args-until-failure.*lexical var")
+
+(bytecomp--define-warning-file-test 
"error-lexical-var-with-run-hook-with-args-until-success.el"
+                            "args-until-success.*lexical var")
+
+(bytecomp--define-warning-file-test 
"error-lexical-var-with-run-hook-with-args.el"
+                            "args.*lexical var")
+
+(bytecomp--define-warning-file-test "error-lexical-var-with-symbol-value.el"
+                            "symbol-value.*lexical var")
+
+(bytecomp--define-warning-file-test "warn-autoload-not-on-top-level.el"
+                            "compiler ignores.*autoload.*")
+
+(bytecomp--define-warning-file-test "warn-callargs.el"
+                            "with 2 arguments, but accepts only 1")
+
+(bytecomp--define-warning-file-test "warn-defcustom-nogroup.el"
+                            "fails to specify containing group")
+
+(bytecomp--define-warning-file-test "warn-defcustom-notype.el"
+                            "fails to specify type")
+
+(bytecomp--define-warning-file-test "warn-defvar-lacks-prefix.el"
+                            "var.*foo.*lacks a prefix")
+
+(bytecomp--define-warning-file-test "warn-format.el"
+                            "called with 2 args to fill 1 format field")
+
+(bytecomp--define-warning-file-test "warn-free-setq.el"
+                            "free.*foo")
+
+(bytecomp--define-warning-file-test "warn-free-variable-reference.el"
+                            "free.*bar")
+
+(bytecomp--define-warning-file-test "warn-make-variable-buffer-local.el"
+                            "make-variable-buffer-local.*not called at 
toplevel")
+
+(bytecomp--define-warning-file-test "warn-interactive-only.el"
+                            "next-line.*interactive use only.*forward-line")
+
+(bytecomp--define-warning-file-test "warn-lambda-malformed-interactive-spec.el"
+                            "malformed interactive spec")
+
+(bytecomp--define-warning-file-test "warn-obsolete-defun.el"
+                            "foo-obsolete.*obsolete function.*99.99")
+
+(defvar bytecomp--tests-obsolete-var nil)
+(make-obsolete-variable 'bytecomp--tests-obsolete-var nil "99.99")
+
+(bytecomp--define-warning-file-test "warn-obsolete-hook.el"
+                            "bytecomp--tests-obs.*obsolete.*99.99")
+
+(bytecomp--define-warning-file-test "warn-obsolete-variable-same-file.el"
+                            "foo-obs.*obsolete.*99.99" t)
+
+(bytecomp--define-warning-file-test "warn-obsolete-variable.el"
+                            "bytecomp--tests-obs.*obsolete.*99.99")
+
+(bytecomp--define-warning-file-test "warn-redefine-defun-as-macro.el"
+                            "as both function and macro")
+
+(bytecomp--define-warning-file-test "warn-redefine-macro-as-defun.el"
+                            "as both function and macro")
+
+(bytecomp--define-warning-file-test "warn-redefine-defun.el"
+                            "defined multiple")
+
+(bytecomp--define-warning-file-test "warn-save-excursion.el"
+                            "with-current.*rather than save-excursion")
+
+(bytecomp--define-warning-file-test "warn-variable-let-bind-constant.el"
+                            "let-bind constant")
+
+(bytecomp--define-warning-file-test "warn-variable-let-bind-nonvariable.el"
+                            "let-bind nonvariable")
+
+(bytecomp--define-warning-file-test "warn-variable-set-constant.el"
+                            "variable reference to constant")
+
+(bytecomp--define-warning-file-test "warn-variable-set-nonvariable.el"
+                            "variable reference to nonvariable")
+
+
+;;;; Macro expansion.
+
 (ert-deftest test-eager-load-macro-expansion ()
   (test-byte-comp-compile-and-load nil
     '(progn (defmacro abc (arg) 1) (defun def () (abc 2))))
diff --git a/test/lisp/erc/erc-track-tests.el b/test/lisp/erc/erc-track-tests.el
index 457f08c..4124094 100644
--- a/test/lisp/erc/erc-track-tests.el
+++ b/test/lisp/erc/erc-track-tests.el
@@ -24,7 +24,6 @@
 
 (require 'ert)
 (require 'erc-track)
-(require 'font-core)
 
 (ert-deftest erc-track--shorten-aggressive-nil ()
   "Test non-aggressive erc track buffer name shortening."
diff --git a/test/lisp/faces-tests.el b/test/lisp/faces-tests.el
index b19cef5..bdd18a5 100644
--- a/test/lisp/faces-tests.el
+++ b/test/lisp/faces-tests.el
@@ -24,7 +24,6 @@
 
 (require 'ert)
 (require 'ert-x)
-(require 'faces)
 
 (defgroup faces--test nil ""
   :group 'faces--test)
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index eeb838b..819a3df 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -113,7 +113,8 @@
   "Temporary directory for Tramp tests.")
 
 (defconst tramp-test-vec
-  (tramp-dissect-file-name tramp-test-temporary-file-directory)
+  (and (file-remote-p tramp-test-temporary-file-directory)
+       (tramp-dissect-file-name tramp-test-temporary-file-directory))
   "The used `tramp-file-name' structure.")
 
 (setq auth-source-save-behavior nil
@@ -2542,9 +2543,8 @@ This checks also `file-name-as-directory', 
`file-name-directory',
 
          ;; Copy file to directory.
          (unwind-protect
-             ;; FIXME: This fails on my QNAP server, see
-             ;; /share/Web/owncloud/data/owncloud.log
-             (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p))
+             ;; This doesn't work on FTP.
+             (unless (tramp--test-ange-ftp-p)
                (write-region "foo" nil source)
                (should (file-exists-p source))
                (make-directory target)
@@ -2568,9 +2568,8 @@ This checks also `file-name-as-directory', 
`file-name-directory',
 
          ;; Copy directory to existing directory.
          (unwind-protect
-             ;; FIXME: This fails on my QNAP server, see
-             ;; /share/Web/owncloud/data/owncloud.log
-             (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p))
+             ;; This doesn't work on FTP.
+             (unless (tramp--test-ange-ftp-p)
                (make-directory source)
                (should (file-directory-p source))
                (write-region "foo" nil (expand-file-name "foo" source))
@@ -2591,9 +2590,8 @@ This checks also `file-name-as-directory', 
`file-name-directory',
 
          ;; Copy directory/file to non-existing directory.
          (unwind-protect
-             ;; FIXME: This fails on my QNAP server, see
-             ;; /share/Web/owncloud/data/owncloud.log
-             (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p))
+             ;; This doesn't work on FTP.
+             (unless (tramp--test-ange-ftp-p)
                (make-directory source)
                (should (file-directory-p source))
                (write-region "foo" nil (expand-file-name "foo" source))
@@ -2686,9 +2684,8 @@ This checks also `file-name-as-directory', 
`file-name-directory',
 
          ;; Rename directory to existing directory.
          (unwind-protect
-             ;; FIXME: This fails on my QNAP server, see
-             ;; /share/Web/owncloud/data/owncloud.log
-             (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p))
+             ;; This doesn't work on FTP.
+             (unless (tramp--test-ange-ftp-p)
                (make-directory source)
                (should (file-directory-p source))
                (write-region "foo" nil (expand-file-name "foo" source))
@@ -2710,9 +2707,8 @@ This checks also `file-name-as-directory', 
`file-name-directory',
 
          ;; Rename directory/file to non-existing directory.
          (unwind-protect
-             ;; FIXME: This fails on my QNAP server, see
-             ;; /share/Web/owncloud/data/owncloud.log
-             (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p))
+             ;; This doesn't work on FTP.
+             (unless (tramp--test-ange-ftp-p)
                (make-directory source)
                (should (file-directory-p source))
                (write-region "foo" nil (expand-file-name "foo" source))
@@ -5711,8 +5707,7 @@ This does not support special file names."
 
 (defun tramp--test-sh-p ()
   "Check, whether the remote host runs a based method from tramp-sh.el."
-  (tramp-sh-file-name-handler-p
-   (tramp-dissect-file-name tramp-test-temporary-file-directory)))
+  (tramp-sh-file-name-handler-p tramp-test-vec))
 
 (defun tramp--test-share-p ()
   "Check, whether the method needs a share."
diff --git a/test/lisp/nxml/xsd-regexp-tests.el 
b/test/lisp/nxml/xsd-regexp-tests.el
new file mode 100644
index 0000000..4c0b3b1
--- /dev/null
+++ b/test/lisp/nxml/xsd-regexp-tests.el
@@ -0,0 +1,30 @@
+;;; xsd-regexp-tests.el --- Test NXML Mode -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'ert)
+(require 'xsd-regexp)
+
+(ert-deftest xsdre-matches ()
+  (should (equal (string-match (xsdre-translate "\\p{Pd}") "a-b") 1))
+  ;; this fails:
+  (should (equal (string-match (xsdre-translate "\\p{P}") "a-b") 1)))
+
+(provide 'xsd-regexp-tests)
+
+;;; xsd-regexp-tests.el ends here
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index 9573b98..9108e0f 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -551,6 +551,30 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350.";
   (should (equal (replace-regexp-in-string "\\`\\|x" "z" "--xx--")
                  "z--zz--")))
 
+(ert-deftest subr-match-substitute-replacement ()
+  (with-temp-buffer
+    (insert "Alpha Beta Gamma Delta Epsilon")
+    (goto-char (point-min))
+    (re-search-forward "B\\(..\\)a")
+    (should (equal (match-substitute-replacement "carrot")
+                   "Carrot"))
+    (should (equal (match-substitute-replacement "<\\&>")
+                   "<Beta>"))
+    (should (equal (match-substitute-replacement "m\\1a")
+                   "Meta"))
+    (should (equal (match-substitute-replacement "ernin" nil nil nil 1)
+                   "Bernina")))
+  (let ((s "Tau Beta Gamma Delta Epsilon"))
+    (string-match "B\\(..\\)a" s)
+    (should (equal (match-substitute-replacement "carrot" nil nil s)
+                   "Carrot"))
+    (should (equal (match-substitute-replacement "<\\&>" nil nil s)
+                   "<Beta>"))
+    (should (equal (match-substitute-replacement "m\\1a" nil nil s)
+                   "Meta"))
+    (should (equal (match-substitute-replacement "ernin" nil nil s 1)
+                   "Bernina"))))
+
 (ert-deftest subr-tests--change-group-33341 ()
   (with-temp-buffer
     (buffer-enable-undo)
diff --git a/test/manual/indent/perl.perl b/test/manual/indent/perl.perl
index 853aec4..6ec0430 100755
--- a/test/manual/indent/perl.perl
+++ b/test/manual/indent/perl.perl
@@ -81,3 +81,17 @@ return 'W' if               #/^Not Available on Mobile/m;    
#W=Web only
 # A "y|abc|def|" shouldn't interfere when inside a string!
 $toto = " x \" string\"";
 $toto = " y \" string\"";       # This is not the `y' operator!
+
+
+# Tricky cases from Harald Jörg <haj@posteo.de>
+$_ = "abcabc\n";
+s:abc:def:g;  # FIXME: the initial s is fontified like a label, and indented
+
+s'def'ghi'g;  # The middle ' should not end the quoting.
+s"ghi"ijk"g;  # The middle ' should not end the quoting.
+
+s#ijk#lmn#g;  # This is a regular expression sustitution.
+
+s #lmn#opq#g; # FIXME: this should be a comment starting with "#lmn"
+  /lmn/rst/g; # and this is the actual regular expression
+print;        # prints "rstrst\n"
diff --git a/test/src/emacs-module-resources/mod-test.c 
b/test/src/emacs-module-resources/mod-test.c
index 4196212..f855e9b 100644
--- a/test/src/emacs-module-resources/mod-test.c
+++ b/test/src/emacs-module-resources/mod-test.c
@@ -806,6 +806,12 @@ emacs_module_init (struct emacs_runtime *ert)
                                            strlen (interactive_spec)));
   bind_function (env, "mod-test-identity", identity_fn);
 
+  /* We allocate lots of values to trigger bugs in the frame allocator during
+     initialization.  */
+  int count = 10000;  /* larger than value_frame_size in emacs-module.c */
+  for (int i = 0; i < count; ++i)
+    env->make_integer (env, i);
+
   provide (env, "mod-test");
   return 0;
 }
diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el
index 074f5be..4125573 100644
--- a/test/src/eval-tests.el
+++ b/test/src/eval-tests.el
@@ -27,6 +27,7 @@
 
 (require 'ert)
 (eval-when-compile (require 'cl-lib))
+(require 'subr-x)
 
 (ert-deftest eval-tests--bug24673 ()
   "Check that Bug#24673 has been fixed."
@@ -176,4 +177,36 @@ in Common Lisp).  Instead, make sure substitution in 
backquote
 expressions works for identifiers starting with period."
   (should (equal (let ((.x 'identity)) (eval `(,.x 'ok))) 'ok)))
 
+(ert-deftest eval-tests/backtrace-in-batch-mode ()
+  (let ((emacs (expand-file-name invocation-name invocation-directory)))
+    (skip-unless (file-executable-p emacs))
+    (with-temp-buffer
+      (let ((status (call-process emacs nil t nil
+                                  "--quick" "--batch"
+                                  (concat "--eval="
+                                          (prin1-to-string
+                                           '(progn
+                                              (defun foo () (error "Boo"))
+                                              (foo)))))))
+        (should (natnump status))
+        (should-not (eql status 0)))
+      (goto-char (point-min))
+      (ert-info ((concat "Process output:\n" (buffer-string)))
+        (search-forward "  foo()")
+        (search-forward "  normal-top-level()")))))
+
+(ert-deftest eval-tests/backtrace-in-batch-mode/demoted-errors ()
+  (let ((emacs (expand-file-name invocation-name invocation-directory)))
+    (skip-unless (file-executable-p emacs))
+    (with-temp-buffer
+      (should (eql  0 (call-process emacs nil t nil
+                                    "--quick" "--batch"
+                                    (concat "--eval="
+                                            (prin1-to-string
+                                             '(with-demoted-errors "Error: %S"
+                                                (error "Boo")))))))
+      (goto-char (point-min))
+      (should (equal (string-trim (buffer-string))
+                     "Error: (error \"Boo\")")))))
+
 ;;; eval-tests.el ends here



reply via email to

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