emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Andrea Corallo
Subject: feature/native-comp c6a610e 3/3: Merge remote-tracking branch 'savannah/master' into HEAD
Date: Mon, 4 May 2020 14:01:01 -0400 (EDT)

branch: feature/native-comp
commit c6a610ecdcf295d49cb70089f4ecb64768598e99
Merge: 1ec7499 2db70ed
Author: Andrea Corallo <address@hidden>
Commit: Andrea Corallo <address@hidden>

    Merge remote-tracking branch 'savannah/master' into HEAD
---
 admin/notes/git-workflow                           |  36 ++--
 build-aux/config.guess                             |   9 +-
 build-aux/config.sub                               |   4 +-
 build-aux/gitlog-to-changelog                      |   4 +-
 build-aux/update-copyright                         |   4 +-
 doc/emacs/search.texi                              |  22 +-
 doc/lispref/lists.texi                             |  18 +-
 doc/lispref/modes.texi                             |  17 +-
 doc/lispref/searching.texi                         |  10 +-
 doc/lispref/text.texi                              |   3 +
 doc/lispref/tips.texi                              |   8 +
 doc/misc/cc-mode.texi                              |   5 +
 doc/misc/texinfo.tex                               |  45 ++--
 etc/NEWS                                           |  27 ++-
 lib/attribute.h                                    |  58 ++++++
 lib/explicit_bzero.c                               |  18 +-
 lib/gnulib.mk.in                                   |  10 +
 lib/ieee754.in.h                                   |   4 +-
 lib/nstrftime.c                                    |   9 +-
 lisp/apropos.el                                    |  21 +-
 lisp/bookmark.el                                   |   6 +-
 lisp/calculator.el                                 |   2 +-
 lisp/cus-edit.el                                   |  12 +-
 lisp/desktop.el                                    |  39 ++--
 lisp/dom.el                                        |   6 +
 lisp/emacs-lisp/bytecomp.el                        |   8 +
 lisp/emacs-lisp/check-declare.el                   |   4 +-
 lisp/emacs-lisp/cl-indent.el                       |  36 ++--
 lisp/emacs-lisp/eieio-base.el                      |   3 +-
 lisp/emacs-lisp/eieio.el                           |   6 +-
 lisp/emacs-lisp/lisp-mode.el                       |  13 +-
 lisp/files.el                                      |   7 +
 lisp/info.el                                       |  26 ++-
 lisp/jsonrpc.el                                    |  50 ++++-
 lisp/ldefs-boot.el                                 |  90 ++++++--
 lisp/mail/qp.el                                    |   2 +-
 lisp/net/eww.el                                    |   2 +-
 lisp/net/nsm.el                                    |   1 +
 lisp/net/tramp-cache.el                            |  61 +++---
 lisp/net/tramp-cmds.el                             |  12 +-
 lisp/net/tramp-sh.el                               |  14 +-
 lisp/progmodes/cc-fonts.el                         |  78 +++++++
 lisp/progmodes/cc-vars.el                          |   1 +
 lisp/progmodes/elisp-mode.el                       |  27 +--
 lisp/progmodes/project.el                          |  36 ++--
 lisp/replace.el                                    |  35 ++--
 lisp/saveplace.el                                  |   4 +-
 lisp/term/bobcat.el                                |   1 +
 lisp/term/cygwin.el                                |   2 +-
 lisp/term/konsole.el                               |   2 +-
 lisp/term/linux.el                                 |   2 +-
 lisp/term/vt100.el                                 |   2 +-
 lisp/term/vt200.el                                 |   2 +
 lisp/version.el                                    |   2 +-
 lisp/w32-vars.el                                   |  14 +-
 lisp/window.el                                     |  36 +++-
 m4/explicit_bzero.m4                               |   1 +
 m4/gnulib-common.m4                                | 229 ++++++++++++++++++---
 m4/gnulib-comp.m4                                  |   2 +
 src/conf_post.h                                    | 100 +++------
 src/fns.c                                          |  56 ++---
 src/nsterm.m                                       |  51 ++---
 src/search.c                                       |  10 +-
 src/systhread.h                                    |  12 +-
 test/lisp/calendar/iso8601-tests.el                |  31 +++
 test/lisp/comint-tests.el                          |   2 +-
 test/lisp/custom-resources/custom--test-theme.el   |   2 +
 test/lisp/dabbrev-tests.el                         |   2 +-
 test/lisp/dom-tests.el                             |   7 +
 test/lisp/emacs-lisp/check-declare-tests.el        | 116 +++++++++++
 .../edebug-resources/edebug-test-code.el           |   2 +-
 .../eieio-tests/eieio-test-methodinvoke.el         |  58 +++---
 .../emacs-lisp/eieio-tests/eieio-test-persist.el   |   2 +-
 .../faceup-resources/faceup-test-mode.el           |   2 +-
 .../faceup-test-this-file-directory.el             |   2 +-
 .../emacs-lisp/faceup-tests/faceup-test-basics.el  |   2 +-
 .../emacs-lisp/faceup-tests/faceup-test-files.el   |   2 +-
 .../newer-versions/new-pkg-1.0.el                  |   2 +-
 .../newer-versions/simple-single-1.4.el            |   2 +-
 .../package-resources/simple-depend-1.0.el         |   2 +-
 .../package-resources/simple-single-1.3.el         |   2 +-
 .../package-resources/simple-two-depend-1.1.el     |   2 +-
 test/lisp/emacs-lisp/package-tests.el              |  11 +-
 test/lisp/emacs-lisp/shadow-resources/p1/foo.el    |   2 +-
 test/lisp/emacs-lisp/shadow-resources/p2/FOO.el    |   2 +-
 test/lisp/emulation/viper-tests.el                 |   2 +-
 test/lisp/erc/erc-track-tests.el                   |   2 +-
 test/lisp/gnus/gnus-tests.el                       |   2 +-
 test/lisp/imenu-tests.el                           |   2 +-
 test/lisp/info-xref-tests.el                       |   2 +-
 test/lisp/jit-lock-tests.el                        |   2 +-
 test/lisp/json-tests.el                            |   2 +-
 test/lisp/mail/qp-tests.el                         |  74 +++++++
 test/lisp/man-tests.el                             |   4 +-
 test/lisp/net/tramp-tests.el                       | 118 ++++++-----
 test/lisp/replace-tests.el                         |   2 +-
 test/lisp/shadowfile-tests.el                      |  20 +-
 test/lisp/subr-tests.el                            |   2 +-
 test/lisp/thingatpt-tests.el                       |   2 +-
 test/lisp/xml-tests.el                             |   2 +-
 100 files changed, 1338 insertions(+), 592 deletions(-)

diff --git a/admin/notes/git-workflow b/admin/notes/git-workflow
index 28b6f91..d109cda 100644
--- a/admin/notes/git-workflow
+++ b/admin/notes/git-workflow
@@ -15,14 +15,15 @@ Initial setup
 =============
 
 Then we want to clone the repository.  We normally want to have both
-the current master and the emacs-26 branch.
+the current master and (if there is one) the active release branch
+(eg emacs-27).
 
 mkdir ~/emacs
 cd ~/emacs
 git clone <membername>@git.sv.gnu.org:/srv/git/emacs.git master
 cd master
 git config push.default current
-git worktree add ../emacs-26 emacs-26
+git worktree add ../emacs-27 emacs-27
 
 You now have both branches conveniently accessible, and you can do
 "git pull" in them once in a while to keep updated.
@@ -52,11 +53,11 @@ you commit your change locally and then send a patch file 
as a bug report
 as described in ../../CONTRIBUTE.
 
 
-Backporting to emacs-26
-=======================
+Backporting to release branch
+=============================
 
 If you have applied a fix to the master, but then decide that it should
-be applied to the emacs-26 branch, too, then
+be applied to the release branch, too, then
 
 cd ~/emacs/master
 git log
@@ -66,7 +67,7 @@ which will look like
 
 commit 958b768a6534ae6e77a8547a56fc31b46b63710b
 
-cd ~/emacs/emacs-26
+cd ~/emacs/emacs-27
 git cherry-pick -xe 958b768a6534ae6e77a8547a56fc31b46b63710b
 
 and add "Backport:" to the commit string.  Then
@@ -74,17 +75,28 @@ and add "Backport:" to the commit string.  Then
 git push
 
 
-Merging emacs-26 to the master
-==============================
+Reverting on release branch
+===========================
+
+If a commit is made to the release branch, and then it is later
+decided that this change should only be on the master branch, the
+simplest way to handle this is to revert the commit on the release
+branch, and include in the associated log entry "do not merge to master".
+(Otherwise, the reversion may get merged to master, and inadvertently
+clobber the change on master if it has been manually made there.)
+
+
+Merging release branch to the master
+====================================
 
 It is recommended to use the file gitmerge.el in the admin directory
-for merging 'emacs-26' into 'master'.  It will take care of many
+for merging the release branch into 'master'.  It will take care of many
 things which would otherwise have to be done manually, like ignoring
 commits that should not land in master, fixing up ChangeLogs and
 automatically dealing with certain types of conflicts.  If you really
 want to, you can do the merge manually, but then you're on your own.
 If you still choose to do that, make absolutely sure that you *always*
-use the 'merge' command to transport commits from 'emacs-26' to
+use the 'merge' command to transport commits from the release branch to
 'master'.  *Never* use 'cherry-pick'!  If you don't know why, then you
 shouldn't manually do the merge in the first place; just use
 gitmerge.el instead.
@@ -97,11 +109,11 @@ up-to-date by doing a pull.  Then start Emacs with
   emacs -l admin/gitmerge.el -f gitmerge
 
 You'll be asked for the branch to merge, which will default to
-'origin/emacs-26', which you should accept.  Merging a local tracking
+(eg) 'origin/emacs-27', which you should accept.  Merging a local tracking
 branch is discouraged, since it might not be up-to-date, or worse,
 contain commits from you which are not yet pushed upstream.
 
-You will now see the list of commits from 'emacs-26' which are not yet
+You will now see the list of commits from the release branch that are not yet
 merged to 'master'.  You might also see commits that are already
 marked for "skipping", which means that they will be merged with a
 different merge strategy ('ours'), which will effectively ignore the
diff --git a/build-aux/config.guess b/build-aux/config.guess
index 45001cf..11fda52 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2020 Free Software Foundation, Inc.
 
-timestamp='2020-01-01'
+timestamp='2020-04-26'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -1629,6 +1629,12 @@ copies of config.guess and config.sub with the latest 
versions from:
   https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 and
   https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+EOF
+
+year=`echo $timestamp | sed 's,-.*,,'`
+# shellcheck disable=SC2003
+if test "`expr "\`date +%Y\`" - "$year"`" -lt 3 ; then
+   cat >&2 <<EOF
 
 If $0 has already been updated, send the following data and any
 information you think might be pertinent to address@hidden to
@@ -1656,6 +1662,7 @@ UNAME_RELEASE = "$UNAME_RELEASE"
 UNAME_SYSTEM  = "$UNAME_SYSTEM"
 UNAME_VERSION = "$UNAME_VERSION"
 EOF
+fi
 
 exit 1
 
diff --git a/build-aux/config.sub b/build-aux/config.sub
index f02d43a..a0d1227 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -2,7 +2,7 @@
 # Configuration validation subroutine script.
 #   Copyright 1992-2020 Free Software Foundation, Inc.
 
-timestamp='2020-01-01'
+timestamp='2020-04-24'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -1366,7 +1366,7 @@ case $os in
             | skyos* | haiku* | rdos* | toppers* | drops* | es* \
             | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
             | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
-            | nsk* | powerunix)
+            | nsk* | powerunix*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        qnx*)
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 5112767..be8082e 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -31,11 +31,11 @@
 # are valid code in both sh and perl.  When executed by sh, they re-execute
 # the script through the perl program found in $PATH.  The '-x' option
 # is essential as well; without it, perl would re-execute the script
-# through /bin/sh.  When executed by  perl, the next two lines are a no-op.
+# through /bin/sh.  When executed by perl, the next two lines are a no-op.
 eval 'exec perl -wSx "$0" "$@"'
      if 0;
 
-my $VERSION = '2018-03-07 03:47'; # UTC
+my $VERSION = '2020-04-04 15:07'; # UTC
 # The definition above must lie within the first 8 lines in order
 # for the Emacs time-stamp write hook (at end) to update it.
 # If you change this file with Emacs, please let the write hook
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
index 4f79b56..d9b7f68 100755
--- a/build-aux/update-copyright
+++ b/build-aux/update-copyright
@@ -133,11 +133,11 @@
 # are valid code in both sh and perl.  When executed by sh, they re-execute
 # the script through the perl program found in $PATH.  The '-x' option
 # is essential as well; without it, perl would re-execute the script
-# through /bin/sh.  When executed by  perl, the next two lines are a no-op.
+# through /bin/sh.  When executed by perl, the next two lines are a no-op.
 eval 'exec perl -wSx -0777 -pi "$0" "$@"'
      if 0;
 
-my $VERSION = '2018-03-07.03:47'; # UTC
+my $VERSION = '2020-04-04.15:07'; # UTC
 # The definition above must lie within the first 8 lines in order
 # for the Emacs time-stamp write hook (at end) to update it.
 # If you change this file with Emacs, please let the write hook
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 1691661..2e094f3 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -1324,10 +1324,14 @@ case-sensitive.  Thus, searching for @samp{Foo} does 
not find
 @samp{foo} or @samp{FOO}.  This applies to regular expression search
 as well as to literal string search.  The effect ceases if you delete
 the upper-case letter from the search string.  The variable
-@code{search-upper-case} controls this: if it is non-@code{nil} (the
-default), an upper-case character in the search string makes the
-search case-sensitive; setting it to @code{nil} disables this effect
-of upper-case characters.
+@code{search-upper-case} controls this: if it is non-@code{nil}, an
+upper-case character in the search string makes the search
+case-sensitive; setting it to @code{nil} disables this effect of
+upper-case characters.  The default value of this variable is
+@code{not-yanks}, which makes search case-sensitive if there are
+upper-case letters in the search string, and also causes text yanked
+into the search string (@pxref{Isearch Yank}) to be down-cased, so
+that such searches are case-insensitive by default.
 
 @vindex case-fold-search
   If you set the variable @code{case-fold-search} to @code{nil}, then
@@ -1572,9 +1576,13 @@ searching for patterns.
 @cindex case folding in replace commands
   If the first argument of a replace command is all lower case, the
 command ignores case while searching for occurrences to
-replace---provided @code{case-fold-search} is non-@code{nil}.  If
-@code{case-fold-search} is set to @code{nil}, case is always significant
-in all searches.
+replace---provided @code{case-fold-search} is non-@code{nil} and
+@code{search-upper-case} is also non-@code{nil}.  If
+@code{search-upper-case} (@pxref{Lax Search, search-upper-case}) is
+@code{nil}, whether searching ignores case is determined by
+@code{case-fold-search} alone, regardless of letter-case of the
+command's first argument.  If @code{case-fold-search} is set to
+@code{nil}, case is always significant in all searches.
 
 @vindex case-replace
   In addition, when the @var{newstring} argument is all or partly lower
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi
index ea44e01..fcaf438 100644
--- a/doc/lispref/lists.texi
+++ b/doc/lispref/lists.texi
@@ -1242,8 +1242,8 @@ compare @var{object} against the elements of the list.  
For example:
      @result{} (b c b a)
 @end group
 @group
-(memq '(2) '((1) (2)))    ; @r{@code{(2)} and @code{(2)} are not @code{eq}.}
-     @result{} nil
+(memq '(2) '((1) (2)))    ; @r{The two @code{(2)}s need not be @code{eq}.}
+     @result{} @r{Unspecified; might be @code{nil} or @code{((2))}.}
 @end group
 @end example
 @end defun
@@ -1356,12 +1356,12 @@ Compare this with @code{memq}:
 
 @example
 @group
-(memql 1.2 '(1.1 1.2 1.3))  ; @r{@code{1.2} and @code{1.2} must be @code{eql}.}
+(memql 1.2 '(1.1 1.2 1.3))  ; @r{@code{1.2} and @code{1.2} are @code{eql}.}
      @result{} (1.2 1.3)
 @end group
 @group
-(memq 1.2 '(1.1 1.2 1.3))  ; @r{@code{1.2} and @code{1.2} need not be 
@code{eq}.}
-     @result{} nil         ; @r{... or it might be @code{(1.2 1.3)}.}
+(memq 1.2 '(1.1 1.2 1.3))  ; @r{The two @code{1.2}s need not be @code{eq}.}
+     @result{} @r{Unspecified; might be @code{nil} or @code{(1.2 1.3)}.}
 @end group
 @end example
 @end defun
@@ -1380,12 +1380,12 @@ Compare this with @code{memq}:
 
 @example
 @group
-(member (list 2) '((1) (2)))  ; @r{@code{(list 2)} and @code{(2)} are 
@code{equal}.}
+(member '(2) '((1) (2)))  ; @r{@code{(2)} and @code{(2)} are @code{equal}.}
      @result{} ((2))
 @end group
 @group
-(memq (list 2) '((1) (2)))    ; @r{@code{(list 2)} and @code{(2)} are not 
@code{eq}.}
-     @result{} nil
+(memq '(2) '((1) (2)))    ; @r{The two @code{(2)}s need not be @code{eq}.}
+     @result{} @r{Unspecified; might be @code{nil} or @code{(2)}.}
 @end group
 @group
 ;; @r{Two strings with the same contents are @code{equal}.}
@@ -1626,7 +1626,7 @@ keys may not be symbols:
         ("compound leaves" . horsechestnut)))
 
 (assq "simple leaves" leaves)
-     @result{} @r{Unspecified; might be @code{nil} or non-@code{nil}.}
+     @result{} @r{Unspecified; might be @code{nil} or @code{("simple leaves" . 
oak)}.}
 (assoc "simple leaves" leaves)
      @result{} ("simple leaves" . oak)
 @end smallexample
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index fc68ee1..eaee56f 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -1352,19 +1352,11 @@ illustrate how these modes are written.
 @end smallexample
 
   The three modes for Lisp share much of their code.  For instance,
-each calls the following function to set various variables:
-
-@smallexample
-@group
-(defun lisp-mode-variables (&optional syntax keywords-case-insensitive elisp)
-  (when syntax
-    (set-syntax-table lisp-mode-syntax-table))
-  @dots{}
-@end group
-@end smallexample
+Lisp mode and Emacs Lisp mode inherit from Lisp Data mode and Lisp
+Interaction Mode inherits from Emacs Lisp mode.
 
 @noindent
-Amongst other things, this function sets up the @code{comment-start}
+Amongst other things, Lisp Data mode sets up the @code{comment-start}
 variable to handle Lisp comments:
 
 @smallexample
@@ -1414,7 +1406,7 @@ Finally, here is the major mode command for Lisp mode:
 
 @smallexample
 @group
-(define-derived-mode lisp-mode prog-mode "Lisp"
+(define-derived-mode lisp-mode lisp-data-mode "Lisp"
   "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp.
 Commands:
 Delete converts tabs to spaces as it moves back.
@@ -1425,7 +1417,6 @@ Note that `run-lisp' may be used either to start an 
inferior Lisp job
 or to switch back to an existing one."
 @end group
 @group
-  (lisp-mode-variables nil t)
   (setq-local find-tag-default-function 'lisp-find-tag-default)
   (setq-local comment-start-skip
               "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 83c1549..c8a12bd 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -338,16 +338,14 @@ first tries to match all three @samp{a}s; but the rest of 
the pattern is
 The next alternative is for @samp{a*} to match only two @samp{a}s.  With
 this choice, the rest of the regexp matches successfully.
 
-@strong{Warning:} Nested repetition operators can run for an
-indefinitely long time, if they lead to ambiguous matching.  For
+@strong{Warning:} Nested repetition operators can run for a very
+long time, if they lead to ambiguous matching.  For
 example, trying to match the regular expression @samp{\(x+y*\)*a}
 against the string @samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz} could
 take hours before it ultimately fails.  Emacs must try each way of
 grouping the @samp{x}s before concluding that none of them can work.
-Even worse, @samp{\(x*\)*} can match the null string in infinitely
-many ways, so it causes an infinite loop.  To avoid these problems,
-check nested repetitions carefully, to make sure that they do not
-cause combinatorial explosions in backtracking.
+In general, avoid expressions that can match the same string in
+multiple ways.
 
 @item @samp{+}
 @cindex @samp{+} in regexp
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 58424a4..9317362 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -5161,6 +5161,9 @@ The following are functions for altering the 
@acronym{DOM}.
 @item dom-set-attribute @var{node} @var{attribute} @var{value}
 Set the @var{attribute} of the node to @var{value}.
 
+@item dom-remove-attribute @var{node} @var{attribute}
+Remove @var{attribute} from @var{node}.
+
 @item dom-append-child @var{node} @var{child}
 Append @var{child} as the last child of @var{node}.
 
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index 3b8da35..5b09b2c 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -821,6 +821,14 @@ most cases, the meaning is clear with just ``if''.  
Otherwise, try to
 find an alternate phrasing that conveys the meaning.
 
 @item
+Try to avoid using abbreviations such as ``e.g.'' (for ``for
+example''), ``i.e.'' (for ``that is''), ``no.'' (for ``number''),
+``c.f.'' (for ``in contrast to'') and ``w.r.t.'' (for ``with respect
+to'') as much as possible.  It is almost always clearer and easier to
+read the expanded version.@footnote{We do use these occasionally, but
+try not to overdo it.}
+
+@item
 When a command is meaningful only in a certain mode or situation,
 do mention that in the documentation string.  For example,
 the documentation of @code{dired-find-file} is:
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi
index f99a890..f9c9f5e 100644
--- a/doc/misc/cc-mode.texi
+++ b/doc/misc/cc-mode.texi
@@ -2132,6 +2132,11 @@ For Pike autodoc markup, the standard in Pike.
 @item gtkdoc
 @cindex GtkDoc markup
 For GtkDoc markup, widely used in the Gnome community.
+
+@item doxygen
+@cindex Doxygen markup
+For Doxygen markup, which can be used with C, C++, Java and variety of
+other languages.
 @end table
 
 The above is by no means complete.  If you'd like to see support for
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex
index deca599..427494c 100644
--- a/doc/misc/texinfo.tex
+++ b/doc/misc/texinfo.tex
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2020-02-11.09}
+\def\texinfoversion{2020-05-02.00}
 %
 % Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc.
 %
@@ -349,34 +349,19 @@
   \ifodd\pageno  \advance\hoffset by \bindingoffset
   \else \advance\hoffset by -\bindingoffset\fi
   %
+  \checkchapterpage
+  %
   % Retrieve the information for the headings from the marks in the page,
   % and call Plain TeX's \makeheadline and \makefootline, which use the
   % values in \headline and \footline.
   %
-  % This is used to check if we are on the first page of a chapter.
-  \ifcase1\the\savedtopmark\fi
-  \let\prevchaptername\thischaptername
-  \ifcase0\firstmark\fi
-  \let\curchaptername\thischaptername
-  %
-  \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
-  %
-  \ifx\curchaptername\prevchaptername
-    \let\thischapterheading\thischapter
-  \else
-    % \thischapterheading is the same as \thischapter except it is blank
-    % for the first page of a chapter.  This is to prevent the chapter name
-    % being shown twice.
-    \def\thischapterheading{}%
-  \fi
-  %
   % Common context changes for both heading and footing.
   % Do this outside of the \shipout so @code etc. will be expanded in
   % the headline as they should be, not taken literally (outputting ''code).
   \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars}
   %
+  \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
   \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}%
-  %
   \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
   \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}%
   %
@@ -423,6 +408,24 @@
 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
 }
 
+% Check if we are on the first page of a chapter.
+\def\checkchapterpage{%
+  % Get the chapter that was current at the end of the last page
+  \ifcase1\the\savedtopmark\fi
+  \let\prevchaptername\thischaptername
+  %
+  \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
+  \let\curchaptername\thischaptername
+  %
+  \ifx\curchaptername\prevchaptername
+    \let\thischapterheading\thischapter
+  \else
+    % \thischapterheading is the same as \thischapter except it is blank
+    % for the first page of a chapter.  This is to prevent the chapter name
+    % being shown twice.
+    \def\thischapterheading{}%
+  \fi
+}
 
 % Argument parsing
 
@@ -3101,10 +3104,10 @@ end
 
 % Allow a ragged right output to aid breaking long URL's.  There can
 % be a break at the \allowbreak with no extra glue (if the existing stretch in
-% the line is sufficent), a break at the \penalty100 with extra glue added
+% the line is sufficient), a break at the \penalty100 with extra glue added
 % at the end of the line, or no break at all here.
 %   Changing the value of the penalty and/or the amount of stretch affects how
-% preferrable one choice is over the other.
+% preferable one choice is over the other.
 \def\urefallowbreak{%
   \allowbreak
   \hskip 0pt plus 2 em\relax
diff --git a/etc/NEWS b/etc/NEWS
index 025d5c1..0f4b624 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -101,6 +101,8 @@ horizontal movements now stop at the edge of the board.
 
 * Changes in Specialized Modes and Packages in Emacs 28.1
 
+** EIEIO: 'oset' and 'oset-default' are declared obsolete
+
 ** New minor mode 'cl-font-lock-built-in-mode' for `lisp-mode'
 The mode provides refined highlighting of built-in functions, types,
 and variables.
@@ -198,7 +200,6 @@ like cell phones, tablets or cameras.
 Previously, assigning a new template to an already defined tag had no
 effect.
 
-
 ** map.el
 
 *** Pcase 'map' pattern added keyword symbols abbreviation.
@@ -288,9 +289,30 @@ prefix on the Subject line in various languages.
 These new navigation commands are bound to 'n' and 'p' in
 'apropos-mode'.
 
+** cc-mode
+
+*** Added support for Doxygen documentation style.
+‘doxygen’ is now valid ‘c-doc-comment-style’ which recognises all
+comment styles supported by Doxygen (namely ‘///’, ‘//!’, ‘/** … */’
+and ‘/*! … */’.  ‘gtkdoc’ remains the default for C and C++ modes; to
+use ‘doxygen’ by default one might evaluate:
+
+    (setq-default c-doc-comment-style
+                  '((java-mode . javadoc)
+                    (pike-mode . autodoc)
+                    (c-mode    . doxygen)
+                    (c++-mode  . doxygen)))
+
+or use it in a custom ‘c-style’.
 
 * New Modes and Packages in Emacs 28.1
 
+*** Lisp Data mode
+The new command 'lisp-data-mode' enables a major mode for buffers
+composed of Lisp symbolic expressions that do not form a computer
+program.  The '.dir-locals.el' file is automatically set to use this
+mode, as are other data files produced by Emacs.
+
 
 * Incompatible Editing Changes in Emacs 28.1
 
@@ -358,6 +380,9 @@ optional argument specifying whether to follow symbolic 
links.
 ** 'parse-time-string' can now parse ISO 8601 format strings,
 such as "2020-01-15T16:12:21-08:00".
 
++++
+** The new function 'dom-remove-attribute' has been added.
+
 ---
 ** 'make-network-process', 'make-serial-process' :coding behavior change.
 Previously, passing ":coding nil" to either of these functions would
diff --git a/lib/attribute.h b/lib/attribute.h
new file mode 100644
index 0000000..8ef9a39
--- /dev/null
+++ b/lib/attribute.h
@@ -0,0 +1,58 @@
+/* ATTRIBUTE_* macros for using attributes in GCC and similar compilers
+
+   Copyright 2020 Free Software Foundation, Inc.
+
+   This program 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.
+
+   This program 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 this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+/* Provide public ATTRIBUTE_* names for the private _GL_ATTRIBUTE_*
+   macros used within Gnulib.  */
+
+#ifndef _GL_ATTRIBUTE_H
+#define _GL_ATTRIBUTE_H
+
+/* C2X standard attributes have macro names that do not begin with
+   'ATTRIBUTE_'.  */
+#define DEPRECATED _GL_ATTRIBUTE_DEPRECATED
+#define FALLTHROUGH _GL_ATTRIBUTE_FALLTHROUGH
+#define MAYBE_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
+#define NODISCARD _GL_ATTRIBUTE_NODISCARD
+
+/* Selected GCC attributes; see:
+   https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
+   These names begin with 'ATTRIBUTE_' to avoid name clashes.  */
+#define ATTRIBUTE_ALLOC_SIZE(args) _GL_ATTRIBUTE_ALLOC_SIZE(args)
+#define ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
+#define ATTRIBUTE_ARTIFICIAL _GL_ATTRIBUTE_ARTIFICIAL
+#define ATTRIBUTE_COLD _GL_ATTRIBUTE_COLD
+#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST
+#define ATTRIBUTE_DEPRECATED _GL_ATTRIBUTE_DEPRECATED
+#define ATTRIBUTE_ERROR(msg) _GL_ATTRIBUTE_ERROR(msg)
+#define ATTRIBUTE_EXTERNALLY_VISIBLE _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+#define ATTRIBUTE_FORMAT(spec) _GL_ATTRIBUTE_FORMAT(spec)
+#define ATTRIBUTE_LEAF _GL_ATTRIBUTE_LEAF
+#define ATTRIBUTE_MAY_ALIAS _GL_ATTRIBUTE_MAY_ALIAS
+#define ATTRIBUTE_MALLOC _GL_ATTRIBUTE_MALLOC
+#define ATTRIBUTE_NOINLINE _GL_ATTRIBUTE_NOINLINE
+#define ATTRIBUTE_NONNULL(args) _GL_ATTRIBUTE_NONNULL(args)
+#define ATTRIBUTE_NONSTRING _GL_ATTRIBUTE_NONSTRING
+#define ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_NOTHROW
+#define ATTRIBUTE_PACKED _GL_ATTRIBUTE_PACKED
+#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
+#define ATTRIBUTE_RETURNS_NONNULL _GL_ATTRIBUTE_RETURNS_NONNULL
+#define ATTRIBUTE_SENTINEL(pos) _GL_ATTRIBUTE_SENTINEL(pos)
+#define ATTRIBUTE_WARNING(msg) _GL_ATTRIBUTE_WARNING(msg)
+
+#endif /* _GL_ATTRIBUTE_H */
diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c
index c82771f..b1f5acb 100644
--- a/lib/explicit_bzero.c
+++ b/lib/explicit_bzero.c
@@ -25,8 +25,18 @@
 # include <config.h>
 #endif
 
+/* memset_s need this define */
+#if HAVE_MEMSET_S
+# define __STDC_WANT_LIB_EXT1__ 1
+#endif
+
 #include <string.h>
 
+#if defined _WIN32 && !defined __CYGWIN__
+# define  WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
 #if _LIBC
 /* glibc-internal users use __explicit_bzero_chk, and explicit_bzero
    redirects to that.  */
@@ -38,8 +48,12 @@
 void
 explicit_bzero (void *s, size_t len)
 {
-#ifdef HAVE_EXPLICIT_MEMSET
-  explicit_memset (s, 0, len);
+#if defined _WIN32 && !defined __CYGWIN__
+  (void) SecureZeroMemory (s, len);
+#elif HAVE_EXPLICIT_MEMSET
+  explicit_memset (s, '\0', len);
+#elif HAVE_MEMSET_S
+  (void) memset_s (s, len, '\0', len);
 #else
   memset (s, '\0', len);
 # if defined __GNUC__ && !defined __clang__
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 0c7c2fb..5c11dfc 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -1122,6 +1122,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -1208,6 +1209,15 @@ endif
 endif
 ## end   gnulib module at-internal
 
+## begin gnulib module attribute
+ifeq (,$(OMIT_GNULIB_MODULE_attribute))
+
+
+EXTRA_DIST += attribute.h
+
+endif
+## end   gnulib module attribute
+
 ## begin gnulib module binary-io
 ifeq (,$(OMIT_GNULIB_MODULE_binary-io))
 
diff --git a/lib/ieee754.in.h b/lib/ieee754.in.h
index 01ca648..d64bb46 100644
--- a/lib/ieee754.in.h
+++ b/lib/ieee754.in.h
@@ -67,7 +67,7 @@ union ieee754_float
 #endif                         /* Little endian.  */
       } ieee;
 
-    /* This format makes it easier to see if a NaN is a signaling NaN.  */
+    /* This format makes it easier to see if a NaN is a signalling NaN.  */
     struct
       {
 #if    __BYTE_ORDER == __BIG_ENDIAN
@@ -118,7 +118,7 @@ union ieee754_double
 #endif                         /* Little endian.  */
       } ieee;
 
-    /* This format makes it easier to see if a NaN is a signaling NaN.  */
+    /* This format makes it easier to see if a NaN is a signalling NaN.  */
     struct
       {
 #if    __BYTE_ORDER == __BIG_ENDIAN
diff --git a/lib/nstrftime.c b/lib/nstrftime.c
index fc5052a..28b539d 100644
--- a/lib/nstrftime.c
+++ b/lib/nstrftime.c
@@ -68,16 +68,9 @@ extern char *tzname[];
 #include <string.h>
 #include <stdbool.h>
 
+#include "attribute.h"
 #include <intprops.h>
 
-#ifndef FALLTHROUGH
-# if __GNUC__ < 7
-#  define FALLTHROUGH ((void) 0)
-# else
-#  define FALLTHROUGH __attribute__ ((__fallthrough__))
-# endif
-#endif
-
 #ifdef COMPILE_WIDE
 # include <endian.h>
 # define CHAR_T wchar_t
diff --git a/lisp/apropos.el b/lisp/apropos.el
index e40f94c..7cbda3c 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -373,9 +373,11 @@ kind of objects to search."
            (user-error "No word list given"))
       pattern)))
 
-(defun apropos-parse-pattern (pattern)
+(defun apropos-parse-pattern (pattern &optional multiline-p)
   "Rewrite a list of words to a regexp matching all permutations.
 If PATTERN is a string, that means it is already a regexp.
+MULTILINE-P, if non-nil, means produce a regexp that will match
+the words even if separated by newlines.
 This updates variables `apropos-pattern', `apropos-pattern-quoted',
 `apropos-regexp', `apropos-words', and `apropos-all-words-regexp'."
   (setq apropos-words nil
@@ -386,6 +388,9 @@ This updates variables `apropos-pattern', 
`apropos-pattern-quoted',
       ;; any combination of two or more words like this:
       ;; (a|b|c).*(a|b|c) which may give some false matches,
       ;; but as long as it also gives the right ones, that's ok.
+      ;; (Actually, when MULTILINE-P is non-nil, instead of '.' we
+      ;; use a trick that would find a match even if the words are
+      ;; on different lines.
       (let ((words pattern))
        (setq apropos-pattern (mapconcat 'identity pattern " ")
              apropos-pattern-quoted (regexp-quote apropos-pattern))
@@ -402,9 +407,13 @@ This updates variables `apropos-pattern', 
`apropos-pattern-quoted',
            (setq apropos-words (cons s apropos-words)
                  apropos-all-words (cons a apropos-all-words))))
        (setq apropos-all-words-regexp
-             (apropos-words-to-regexp apropos-all-words ".+"))
+             (apropos-words-to-regexp apropos-all-words
+                                       ;; The [^b-a] trick matches any
+                                       ;; character including a newline.
+                                       (if multiline-p "[^b-a]+?" ".+")))
        (setq apropos-regexp
-             (apropos-words-to-regexp apropos-words ".*?")))
+             (apropos-words-to-regexp apropos-words
+                                       (if multiline-p "[^b-a]*?" ".*?"))))
     (setq apropos-pattern-quoted (regexp-quote pattern)
          apropos-all-words-regexp pattern
          apropos-pattern pattern
@@ -787,7 +796,7 @@ Returns list of symbols and values found."
   (interactive (list (apropos-read-pattern "value")
                     current-prefix-arg))
   (setq apropos--current (list #'apropos-value pattern do-all))
-  (apropos-parse-pattern pattern)
+  (apropos-parse-pattern pattern t)
   (or do-all (setq do-all apropos-do-all))
   (setq apropos-accumulator ())
    (let (f v p)
@@ -827,7 +836,7 @@ Optional arg BUFFER (default: current buffer) is the buffer 
to check."
   (interactive (list (apropos-read-pattern "value of buffer-local variable")))
   (unless buffer (setq buffer  (current-buffer)))
   (setq apropos--current (list #'apropos-local-value pattern buffer))
-  (apropos-parse-pattern pattern)
+  (apropos-parse-pattern pattern t)
   (setq apropos-accumulator  ())
   (let ((var             nil))
     (mapatoms
@@ -869,7 +878,7 @@ Returns list of symbols and documentation found."
   (interactive (list (apropos-read-pattern "documentation")
                     current-prefix-arg))
   (setq apropos--current (list #'apropos-documentation pattern do-all))
-  (apropos-parse-pattern pattern)
+  (apropos-parse-pattern pattern t)
   (or do-all (setq do-all apropos-do-all))
   (setq apropos-accumulator () apropos-files-scanned ())
   (let ((standard-input (get-buffer-create " apropos-temp"))
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 720ad18..0fa77ed 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -734,8 +734,10 @@ CODING is the symbol of the coding-system in which the 
file is encoded."
   (if (memq (coding-system-base coding) '(undecided prefer-utf-8))
       (setq coding 'utf-8-emacs))
   (insert
-   (format ";;;; Emacs Bookmark Format Version %d ;;;; -*- coding: %S -*-\n"
-           bookmark-file-format-version (coding-system-base coding)))
+   (format
+    ";;;; Emacs Bookmark Format Version %d\
+;;;; -*- coding: %S; mode: lisp-data -*-\n"
+    bookmark-file-format-version (coding-system-base coding)))
   (insert ";;; This format is meant to be slightly human-readable;\n"
           ";;; nevertheless, you probably don't want to edit it.\n"
           ";;; "
diff --git a/lisp/calculator.el b/lisp/calculator.el
index 6996990..7e0b2fc 100644
--- a/lisp/calculator.el
+++ b/lisp/calculator.el
@@ -864,7 +864,7 @@ The result should not exceed the screen width."
                  "\\.\\([^0-9].*\\)?$" ".0\\1" str))
            (str (replace-regexp-in-string
                  "[eE][+-]?\\([^0-9].*\\)?$" "e0\\1" str)))
-      (string-to-number str))))
+      (float (string-to-number str)))))
 
 (defun calculator-push-curnum ()
   "Push the numeric value of the displayed number to the stack."
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index d3d17fd..1ec2708 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -3824,7 +3824,17 @@ Optional EVENT is the location for the menu."
 
 (defun custom-face-save (widget)
   "Save the face edited by WIDGET."
-  (custom-face-mark-to-save widget)
+  (let ((form (widget-get widget :custom-form)))
+    (if (memq form '(all lisp))
+        (custom-face-mark-to-save widget)
+      ;; The user is working on only a selected terminal type;
+      ;; make sure we save the entire spec to `custom-file'. (Bug #40866)
+      (custom-face-edit-all widget)
+      (custom-face-mark-to-save widget)
+      (if (eq form 'selected)
+          (custom-face-edit-selected widget)
+        ;; `form' is edit or mismatch; can't happen.
+        (widget-put widget :custom-form form))))
   (custom-save-all)
   (custom-face-state-set-and-redraw widget))
 
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 9d117c6..7fe5f73 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1017,13 +1017,16 @@ Frames with a non-nil `desktop-dont-save' parameter are 
not saved."
 
 ;;;###autoload
 (defun desktop-save (dirname &optional release only-if-changed version)
-  "Save the desktop in a desktop file.
-Parameter DIRNAME specifies where to save the desktop file.
-Optional parameter RELEASE says whether we're done with this
-desktop.  If ONLY-IF-CHANGED is non-nil, compare the current
-desktop information to that in the desktop file, and if the
-desktop information has not changed since it was last saved then
-do not rewrite the file.
+  "Save the state of Emacs in a desktop file in directory DIRNAME.
+Optional argument RELEASE non-nil says we're done with this
+desktop, in which case this function releases the lock of the
+desktop file in DIRNAME.
+If ONLY-IF-CHANGED is non-nil, compare the current desktop
+information to that in the desktop file, and if the desktop
+information has not changed since it was last saved, then do
+not rewrite the file.
+
+To restore the desktop, use `desktop-read'.
 
 This function can save the desktop in either format version
 208 (which only Emacs 25.1 and later can read) or version
@@ -1033,14 +1036,20 @@ it was last saved, or version 208 when writing a fresh 
desktop
 file.
 
 To upgrade a version 206 file to version 208, call this command
-explicitly with a bare prefix argument: C-u M-x desktop-save.
-You are recommended to do this once you have firmly upgraded to
-Emacs 25.1 (or later).  To downgrade a version 208 file to version
-206, use a double command prefix: C-u C-u M-x desktop-save.
-Confirmation will be requested in either case.  In a non-interactive
-call, VERSION can be given as an integer, either 206 or 208, which
-will be accepted as the format version in which to save the file
-without further confirmation."
+explicitly with a prefix argument: \\[universal-argument] \\[desktop-save].
+If you are upgrading from Emacs 24 or older, we recommed to do
+this once you decide you no longer need compatibility with versions
+of Emacs before 25.1.
+
+To downgrade a version 208 file to version 206, use a double prefix
+argument: \\[universal-argument] \\[universal-argument] \\[desktop-save].
+
+Emacs will ask for confirmation when you upgrade or downgrade your
+desktop file.
+
+In a non-interactive call, VERSION can be given as an integer, either
+206 or 208, to specify the format version in which to save the file,
+no questions asked."
   (interactive (list
                 ;; Or should we just use (car desktop-path)?
                 (let ((default (if (member "." desktop-path)
diff --git a/lisp/dom.el b/lisp/dom.el
index 34df0e9..7ff9e07 100644
--- a/lisp/dom.el
+++ b/lisp/dom.el
@@ -67,6 +67,12 @@
        (setcdr old value)
       (setcar (cdr node) (nconc (cadr node) (list (cons attribute value)))))))
 
+(defun dom-remove-attribute (node attribute)
+  "Remove ATTRIBUTE from NODE."
+  (setq node (dom-ensure-node node))
+  (when-let ((old (assoc attribute (cadr node))))
+    (setcar (cdr node) (delq old (cadr node)))))
+
 (defmacro dom-attr (node attr)
   "Return the attribute ATTR from NODE.
 A typical attribute is `href'."
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 8f85c92..c0662a6 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -4800,6 +4800,14 @@ binding slots have been popped."
 (defun byte-compile-form-make-variable-buffer-local (form)
   (byte-compile-keep-pending form 'byte-compile-normal-call))
 
+;; Make `make-local-variable' declare the variable locally
+;; dynamic - this suppresses some unnecessary warnings
+(byte-defop-compiler-1 make-local-variable
+                       byte-compile-make-local-variable)
+(defun byte-compile-make-local-variable (form)
+  (pcase form (`(,_ ',var) (byte-compile--declare-var var)))
+  (byte-compile-normal-call form))
+
 (put 'function-put 'byte-hunk-handler 'byte-compile-define-symbol-prop)
 (put 'define-symbol-prop 'byte-hunk-handler 'byte-compile-define-symbol-prop)
 (defun byte-compile-define-symbol-prop (form)
diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el
index 144385e..52cda95 100644
--- a/lisp/emacs-lisp/check-declare.el
+++ b/lisp/emacs-lisp/check-declare.el
@@ -1,4 +1,4 @@
-;;; check-declare.el --- Check declare-function statements
+;;; check-declare.el --- Check declare-function statements  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
 
@@ -248,7 +248,7 @@ TYPE is a string giving the nature of the error.
 Optional LINE is the claim's line number; otherwise, search for the claim.
 Display warning in `check-declare-warning-buffer'."
   (let ((warning-prefix-function
-         (lambda (level entry)
+         (lambda (_level entry)
           (insert (format "%s:%d:" (file-relative-name file) (or line 0)))
            entry))
         (warning-fill-prefix "    "))
diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el
index fd87159..66502da 100644
--- a/lisp/emacs-lisp/cl-indent.el
+++ b/lisp/emacs-lisp/cl-indent.el
@@ -46,14 +46,12 @@
   "Maximum depth to backtrack out from a sublist for structured indentation.
 If this variable is 0, no backtracking will occur and forms such as `flet'
 may not be correctly indented."
-  :type 'integer
-  :group 'lisp-indent)
+  :type 'integer)
 
 (defcustom lisp-tag-indentation 1
   "Indentation of tags relative to containing list.
 This variable is used by the function `lisp-indent-tagbody'."
-  :type 'integer
-  :group 'lisp-indent)
+  :type 'integer)
 
 (defcustom lisp-tag-body-indentation 3
   "Indentation of non-tagged lines relative to containing list.
@@ -64,32 +62,30 @@ the special form.  If the value is t, the body of tags will 
be indented
 as a block at the same indentation as the first s-expression following
 the tag.  In this case, any forms before the first tag are indented
 by `lisp-body-indent'."
-  :type 'integer
-  :group 'lisp-indent)
+  :type 'integer)
 
 (defcustom lisp-backquote-indentation t
   "Whether or not to indent backquoted lists as code.
 If nil, indent backquoted lists as data, i.e., like quoted lists."
-  :type 'boolean
-  :group 'lisp-indent)
+  :type 'boolean)
 
 
-(defcustom lisp-loop-keyword-indentation 3
+(defcustom lisp-loop-keyword-indentation 6
   "Indentation of loop keywords in extended loop forms."
   :type 'integer
-  :group 'lisp-indent)
+  :version "28.1")
 
 
-(defcustom lisp-loop-forms-indentation 5
+(defcustom lisp-loop-forms-indentation 6
   "Indentation of forms in extended loop forms."
   :type 'integer
-  :group 'lisp-indent)
+  :version "28.1")
 
 
-(defcustom lisp-simple-loop-indentation 3
+(defcustom lisp-simple-loop-indentation 1
   "Indentation of forms in simple loop forms."
   :type 'integer
-  :group 'lisp-indent)
+  :version "28.1")
 
 (defcustom lisp-lambda-list-keyword-alignment nil
   "Whether to vertically align lambda-list keywords together.
@@ -107,16 +103,14 @@ If non-nil, alignment is done with the first keyword
                       &key key1 key2)
   #|...|#)"
   :version "24.1"
-  :type 'boolean
-  :group 'lisp-indent)
+  :type 'boolean)
 
 (defcustom lisp-lambda-list-keyword-parameter-indentation 2
   "Indentation of lambda list keyword parameters.
 See `lisp-lambda-list-keyword-parameter-alignment'
 for more information."
   :version "24.1"
-  :type 'integer
-  :group 'lisp-indent)
+  :type 'integer)
 
 (defcustom lisp-lambda-list-keyword-parameter-alignment nil
   "Whether to vertically align lambda-list keyword parameters together.
@@ -135,8 +129,7 @@ If non-nil, alignment is done with the first parameter
                             key3 key4)
   #|...|#)"
   :version "24.1"
-  :type 'boolean
-  :group 'lisp-indent)
+  :type 'boolean)
 
 (defcustom lisp-indent-backquote-substitution-mode t
   "How to indent substitutions in backquotes.
@@ -148,8 +141,7 @@ In any case, do not backtrack beyond a backquote 
substitution.
 
 Until Emacs 25.1, the nil behavior was hard-wired."
   :version "25.1"
-  :type '(choice (const corrected) (const nil) (const t))
-  :group 'lisp-indent)
+  :type '(choice (const corrected) (const nil) (const t)))
 
 
 (defvar lisp-indent-defun-method '(4 &lambda &body)
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index 2cb1f61..010a2b6 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -473,7 +473,8 @@ instance."
     (let* ((cfn (or file (oref this file)))
            (default-directory (file-name-directory cfn)))
       (cl-letf ((standard-output (current-buffer))
-                ((oref this file)       ;FIXME: Why change it?
+                (inhibit-modification-hooks t)
+                ((oref this file) ;FIXME: Why change it?
                  (if file
                      ;; FIXME: Makes a name relative to (oref this file),
                      ;; whereas I think it should be relative to cfn.
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 9f8b639..fe2b80b 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -517,7 +517,8 @@ The CLOS function `class-direct-subclasses' is aliased to 
this function."
   "Set the value in OBJ for slot SLOT to VALUE.
 SLOT is the slot name as specified in `defclass' or the tag created
 with in the :initarg slot.  VALUE can be any Lisp object."
-  (declare (debug (form symbolp form)))
+  (declare (obsolete "use (setf (oref ..) ..) instead" "28.1")
+           (debug (form symbolp form)))
   `(eieio-oset ,obj (quote ,slot) ,value))
 
 (defmacro oset-default (class slot value)
@@ -525,7 +526,8 @@ with in the :initarg slot.  VALUE can be any Lisp object."
 The default value is usually set with the :initform tag during class
 creation.  This allows users to change the default behavior of classes
 after they are created."
-  (declare (debug (form symbolp form)))
+  (declare (obsolete "use (setf (oref-default ..) ..) instead" "28.1")
+           (debug (form symbolp form)))
   `(eieio-oset-default ,class (quote ,slot) ,value))
 
 ;;; CLOS queries into classes and slots
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 98c4416..7098a41 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -611,6 +611,8 @@ Value for `adaptive-fill-function'."
   ;; a single docstring.  Let's fix it here.
   (if (looking-at "\\s-+\"[^\n\"]+\"\\s-*$") ""))
 
+;; Maybe this should be discouraged/obsoleted and users should be
+;; encouraged to use `lisp-data-mode` instead.
 (defun lisp-mode-variables (&optional lisp-syntax keywords-case-insensitive
                                       elisp)
   "Common initialization routine for lisp modes.
@@ -658,6 +660,14 @@ font-lock keywords will not be case sensitive."
   (setq-local electric-pair-skip-whitespace 'chomp)
   (setq-local electric-pair-open-newline-between-pairs nil))
 
+;;;###autoload
+(define-derived-mode lisp-data-mode prog-mode "Lisp-Data"
+  "Major mode for buffers holding data written in Lisp syntax."
+  :group 'lisp
+  (lisp-mode-variables t t nil)
+  (setq-local electric-quote-string t)
+  (setq imenu-case-fold-search nil))
+
 (defun lisp-outline-level ()
   "Lisp mode `outline-level' function."
   (let ((len (- (match-end 0) (match-beginning 0))))
@@ -737,7 +747,7 @@ font-lock keywords will not be case sensitive."
   "Keymap for ordinary Lisp mode.
 All commands in `lisp-mode-shared-map' are inherited by this map.")
 
-(define-derived-mode lisp-mode prog-mode "Lisp"
+(define-derived-mode lisp-mode lisp-data-mode "Lisp"
   "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp.
 Commands:
 Delete converts tabs to spaces as it moves back.
@@ -746,7 +756,6 @@ Blank lines separate paragraphs.  Semicolons start comments.
 \\{lisp-mode-map}
 Note that `run-lisp' may be used either to start an inferior Lisp job
 or to switch back to an existing one."
-  (lisp-mode-variables nil t)
   (setq-local lisp-indent-function 'common-lisp-indent-function)
   (setq-local find-tag-default-function 'lisp-find-tag-default)
   (setq-local comment-start-skip
diff --git a/lisp/files.el b/lisp/files.el
index fa72e51..c34fe00 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2657,6 +2657,13 @@ since only a single case-insensitive search through the 
alist is made."
      ("\\.ltx\\'" . latex-mode)
      ("\\.dtx\\'" . doctex-mode)
      ("\\.org\\'" . org-mode)
+     ;; .dir-locals.el is not really Elisp.  Could use the
+     ;; `dir-locals-file' constant if it weren't defined below.
+     ("\\.dir-locals\\(?:-2\\)?\\.el\\'" . lisp-data-mode)
+     ("eww-bookmarks\\'" . lisp-data-mode)
+     ("tramp\\'" . lisp-data-mode)
+     ("places\\'" . lisp-data-mode)
+     ("\\.emacs-places\\'" . lisp-data-mode)
      ("\\.el\\'" . emacs-lisp-mode)
      ("Project\\.ede\\'" . emacs-lisp-mode)
      ("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode)
diff --git a/lisp/info.el b/lisp/info.el
index 3015e60..d579ecc 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -4079,22 +4079,28 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
     :help "Go to top node of file"]
    ["Final Node" Info-final-node
     :help "Go to final node in this file"]
+   "---"
    ("Menu Item" ["You should never see this" report-emacs-bug t])
    ("Reference" ["You should never see this" report-emacs-bug t])
    ["Search..." Info-search
     :help "Search for regular expression in this Info file"]
    ["Search Next" Info-search-next
     :help "Search for another occurrence of regular expression"]
-   ["Go to Node..." Info-goto-node
+   "---"
+   ("History"
+    ["Back in history" Info-history-back :active Info-history
+     :help "Go back in history to the last node you were at"]
+    ["Forward in history" Info-history-forward :active Info-history-forward
+     :help "Go forward in history"]
+    ["Show History" Info-history :active Info-history-list
+     :help "Go to menu of visited nodes"])
+   ("Go to"
+    ["Go to Node..." Info-goto-node
     :help "Go to a named node"]
-   ["Back in history" Info-history-back :active Info-history
-    :help "Go back in history to the last node you were at"]
-   ["Forward in history" Info-history-forward :active Info-history-forward
-    :help "Go forward in history"]
-   ["History" Info-history :active Info-history-list
-    :help "Go to menu of visited nodes"]
-   ["Table of Contents" Info-toc
-    :help "Go to table of contents"]
+    ["Table of Contents" Info-toc
+     :help "Go to table of contents"]
+    ["Go to Directory" Info-directory
+     :help "Go to the Info directory node."])
    ("Index"
     ["Lookup a String..." Info-index
      :help "Look for a string in the index items"]
@@ -4108,6 +4114,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
     :help "Copy the name of the current node into the kill ring"]
    ["Clone Info buffer" clone-buffer
     :help "Create a twin copy of the current Info buffer."]
+   "---"
    ["Exit" quit-window :help "Stop reading Info"]))
 
 
@@ -4358,6 +4365,7 @@ Moving within a node:
          already visible, try to go to the previous menu entry, or up
          if there is none.
 \\[beginning-of-buffer]        Go to beginning of node.
+\\[end-of-buffer]      Go to end of node.
 
 Advanced commands:
 \\[Info-search]        Search through this Info file for specified regexp,
diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
index 65c0df8..6cf4131 100644
--- a/lisp/jsonrpc.el
+++ b/lisp/jsonrpc.el
@@ -5,7 +5,7 @@
 ;; Author: João Távora <address@hidden>
 ;; Keywords: processes, languages, extensions
 ;; Package-Requires: ((emacs "25.2"))
-;; Version: 1.0.9
+;; Version: 1.0.11
 
 ;; This is an Elpa :core package.  Don't use functionality that is not
 ;; compatible with Emacs 25.2.
@@ -364,21 +364,49 @@ connection object, called when the process dies .")
 
 (cl-defmethod initialize-instance ((conn jsonrpc-process-connection) slots)
   (cl-call-next-method)
-  (let* ((proc (plist-get slots :process))
-         (proc (if (functionp proc) (funcall proc) proc))
-         (buffer (get-buffer-create (format "*%s output*" (process-name 
proc))))
-         (stderr (get-buffer-create (format "*%s stderr*" (process-name 
proc)))))
+  (cl-destructuring-bind (&key ((:process proc)) name &allow-other-keys) slots
+    ;; FIXME: notice the undocumented bad coupling in the buffer name.
+    ;; The client making the process _must_ use a buffer named exactly
+    ;; like this property when calling `make-process'.  If there were
+    ;; a `set-process-stderr' like there is `set-process-buffer' we
+    ;; wouldn't need this and could use a pipe with a process filter
+    ;; instead of `after-change-functions'.  Alternatively, we need a
+    ;; new initarg (but maybe not a slot).
+    (with-current-buffer (get-buffer-create (format "*%s stderr*" name))
+      (let ((inhibit-read-only t)
+            (hidden-name (concat " " (buffer-name))))
+        (erase-buffer)
+        (buffer-disable-undo)
+        (add-hook
+         'after-change-functions
+         (lambda (beg _end _pre-change-len)
+           (cl-loop initially (goto-char beg)
+                    do (forward-line)
+                    when (bolp)
+                    for line = (buffer-substring
+                                (line-beginning-position 0)
+                                (line-end-position 0))
+                    do (with-current-buffer (jsonrpc-events-buffer conn)
+                         (goto-char (point-max))
+                         (let ((inhibit-read-only t))
+                           (insert (format "[stderr] %s\n" line))))
+                    until (eobp)))
+         nil t)
+        ;; If we are correctly coupled to the client, it should pick up
+        ;; the current buffer immediately.
+        (setq proc (if (functionp proc) (funcall proc) proc))
+        (ignore-errors (kill-buffer hidden-name))
+        (rename-buffer hidden-name)
+        (process-put proc 'jsonrpc-stderr (current-buffer))
+        (read-only-mode t)))
     (setf (jsonrpc--process conn) proc)
-    (set-process-buffer proc buffer)
-    (process-put proc 'jsonrpc-stderr stderr)
+    (set-process-buffer proc (get-buffer-create (format " *%s output*" name)))
     (set-process-filter proc #'jsonrpc--process-filter)
     (set-process-sentinel proc #'jsonrpc--process-sentinel)
     (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) proc))
-    (with-current-buffer stderr
-      (buffer-disable-undo))
+      (let ((inhibit-read-only t)) (erase-buffer) (read-only-mode t)))
     (process-put proc 'jsonrpc-connection conn)))
 
 (cl-defmethod jsonrpc-connection-send ((connection jsonrpc-process-connection)
@@ -682,7 +710,7 @@ originated."
                               (format "-%s" subtype)))))
             (goto-char (point-max))
             (prog1
-                (let ((msg (format "%s%s%s %s:\n%s\n"
+                (let ((msg (format "[%s]%s%s %s:\n%s"
                                    type
                                    (if id (format " (id:%s)" id) "")
                                    (if error " ERROR" "")
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index e1f238c..d49c752 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -1076,7 +1076,7 @@ search for matches for any two (or more) of those words.
 With \\[universal-argument] prefix, or if `apropos-do-all' is non-nil,
 consider all symbols (if they match PATTERN).
 
-Returns list of symbols and documentation found.
+Return list of symbols and documentation found.
 
 \(fn PATTERN &optional DO-ALL)" t nil)
 
@@ -4745,6 +4745,34 @@ and runs the normal hook `command-history-hook'." t nil)
 
 ;;;***
 
+;;;### (autoloads nil "cl-font-lock" "progmodes/cl-font-lock.el"
+;;;;;;  (0 0 0 0))
+;;; Generated autoloads from progmodes/cl-font-lock.el
+
+(defvar cl-font-lock-built-in-mode nil "\
+Non-nil if Cl-Font-Lock-Built-In mode is enabled.
+See the `cl-font-lock-built-in-mode' command
+for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `cl-font-lock-built-in-mode'.")
+
+(custom-autoload 'cl-font-lock-built-in-mode "cl-font-lock" nil)
+
+(autoload 'cl-font-lock-built-in-mode "cl-font-lock" "\
+Highlight built-in functions, variables, and types in `lisp-mode'.
+
+If called interactively, enable Cl-Font-Lock-Built-In mode if ARG is
+positive, and disable it if ARG is zero or negative.  If called from
+Lisp, also enable the mode if ARG is omitted or nil, and toggle it if
+ARG is `toggle'; disable the mode otherwise.
+
+\(fn &optional ARG)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes 
"cl-font-lock" '("cl-font-lock-")))
+
+;;;***
+
 ;;;### (autoloads nil "cl-generic" "emacs-lisp/cl-generic.el" (0
 ;;;;;;  0 0 0))
 ;;; Generated autoloads from emacs-lisp/cl-generic.el
@@ -12751,6 +12779,13 @@ Interactively, prompt for LIBRARY using the one at or 
near point.
 
 \(fn LIBRARY)" t nil)
 
+(autoload 'read-library-name "find-func" "\
+Read and return a library name, defaulting to the one near point.
+
+A library name is the filename of an Emacs Lisp library located
+in a directory under `load-path' (or `find-function-source-path',
+if non-nil)." nil nil)
+
 (autoload 'find-library-other-window "find-func" "\
 Find the Emacs Lisp source of LIBRARY in another window.
 
@@ -12918,7 +12953,7 @@ Find directly the variable at point in the other 
window." t nil)
 (autoload 'find-function-setup-keys "find-func" "\
 Define some key bindings for the find-function family of functions." nil nil)
 
-(if (fboundp 'register-definition-prefixes) (register-definition-prefixes 
"find-func" '("find-" "read-library-name")))
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes 
"find-func" '("find-")))
 
 ;;;***
 
@@ -15360,9 +15395,13 @@ arguments as NAME.  DO is a function as defined in 
`gv-get'.
 
 \(fn SYMBOL NAME ARGS HANDLER &optional FIX)" nil nil)
 
-(or (assq 'gv-expander defun-declarations-alist) (let ((x `(gv-expander 
,(apply-partially #'gv--defun-declaration 'gv-expander)))) (push x 
macro-declarations-alist) (push x defun-declarations-alist)))
+(defsubst gv--expander-defun-declaration (&rest args) (apply 
#'gv--defun-declaration 'gv-expander args))
+
+(defsubst gv--setter-defun-declaration (&rest args) (apply 
#'gv--defun-declaration 'gv-setter args))
+
+(or (assq 'gv-expander defun-declarations-alist) (let ((x (list 'gv-expander 
#'gv--expander-defun-declaration))) (push x macro-declarations-alist) (push x 
defun-declarations-alist)))
 
-(or (assq 'gv-setter defun-declarations-alist) (push `(gv-setter 
,(apply-partially #'gv--defun-declaration 'gv-setter)) 
defun-declarations-alist))
+(or (assq 'gv-setter defun-declarations-alist) (push (list 'gv-setter 
#'gv--setter-defun-declaration) defun-declarations-alist))
 
 (autoload 'gv-define-setter "gv" "\
 Define a setter method for generalized variable NAME.
@@ -16100,6 +16139,9 @@ of text in those lines.
 Interactively, prompt for REGEXP using `read-regexp', then FACE.
 Use the global history list for FACE.
 
+If REGEXP contains upper case characters (excluding those preceded by `\\')
+and `search-upper-case' is non-nil, the matching is case-sensitive.
+
 Use Font lock mode, if enabled, to highlight REGEXP.  Otherwise,
 use overlays for highlighting.  If overlays are used, the
 highlighting will not update as you type.
@@ -16115,11 +16157,18 @@ Use the global history list for FACE.  Limit face 
setting to the
 corresponding SUBEXP (interactively, the prefix argument) of REGEXP.
 If SUBEXP is omitted or nil, the entire REGEXP is highlighted.
 
+LIGHTER is a human-readable string that can be used to select
+a regexp to unhighlight by its name instead of selecting a possibly
+complex regexp or closure.
+
+If REGEXP contains upper case characters (excluding those preceded by `\\')
+and `search-upper-case' is non-nil, the matching is case-sensitive.
+
 Use Font lock mode, if enabled, to highlight REGEXP.  Otherwise,
 use overlays for highlighting.  If overlays are used, the
 highlighting will not update as you type.
 
-\(fn REGEXP &optional FACE SUBEXP)" t nil)
+\(fn REGEXP &optional FACE SUBEXP LIGHTER)" t nil)
 
 (defalias 'highlight-phrase 'hi-lock-face-phrase-buffer)
 
@@ -16128,9 +16177,9 @@ Set face of each match of phrase REGEXP to FACE.
 Interactively, prompt for REGEXP using `read-regexp', then FACE.
 Use the global history list for FACE.
 
-When called interactively, replace whitespace in user-provided
-regexp with arbitrary whitespace, and make initial lower-case
-letters case-insensitive, before highlighting with `hi-lock-set-pattern'.
+If REGEXP contains upper case characters (excluding those preceded by `\\')
+and `search-upper-case' is non-nil, the matching is case-sensitive.
+Also set `search-spaces-regexp' to the value of `search-whitespace-regexp'.
 
 Use Font lock mode, if enabled, to highlight REGEXP.  Otherwise,
 use overlays for highlighting.  If overlays are used, the
@@ -16146,6 +16195,9 @@ Uses the next face from `hi-lock-face-defaults' without 
prompting,
 unless you use a prefix argument.
 Uses `find-tag-default-as-symbol-regexp' to retrieve the symbol at point.
 
+If REGEXP contains upper case characters (excluding those preceded by `\\')
+and `search-upper-case' is non-nil, the matching is case-sensitive.
+
 This uses Font lock mode if it is enabled; otherwise it uses overlays,
 in which case the highlighting will not update as you type." t nil)
 
@@ -18821,8 +18873,8 @@ Check comments and strings in the current buffer for 
spelling errors." t nil)
 Check the current buffer for spelling errors interactively." t nil)
 
 (autoload 'ispell-buffer-with-debug "ispell" "\
-`ispell-buffer' with some output sent to `ispell-debug-buffer' buffer.
-If APPEND is non-n il, append the info to previous buffer if exists.
+`ispell-buffer' with some output sent to `ispell-debug-buffer'.
+If APPEND is non-nil, don't erase previous debugging output.
 
 \(fn &optional APPEND)" t nil)
 
@@ -21853,7 +21905,7 @@ unless the display width of STR is equal to or less 
than the display
 width of ELLIPSIS.  If it is non-nil and not a string, then ELLIPSIS
 defaults to `truncate-string-ellipsis'.
 
-If ELLIPSIS-TEXT-PROPERTY in non-nil, a too-long string will not
+If ELLIPSIS-TEXT-PROPERTY is non-nil, a too-long string will not
 be truncated, but instead the elided parts will be covered by a
 `display' text property showing the ellipsis.
 
@@ -22162,6 +22214,10 @@ values:
   `ssl'      -- Equivalent to `tls'.
   `shell'    -- A shell connection.
 
+:coding is a symbol or a cons used to specify the coding systems
+used to decode and encode the data which the process reads and
+writes.  See `make-network-process' for details.
+
 :return-list specifies this function's return value.
   If omitted or nil, return a process object.  A non-nil means to
   return (PROC . PROPS), where PROC is a process object and PROPS
@@ -30984,7 +31040,8 @@ as start and end positions), and with `string<' 
otherwise.
 \(fn REVERSE NEXTRECFUN ENDRECFUN &optional STARTKEYFUN ENDKEYFUN PREDICATE)" 
nil nil)
 
 (autoload 'sort-lines "sort" "\
-Sort lines in region alphabetically; argument means descending order.
+Sort lines in region alphabetically; REVERSE non-nil means descending order.
+Interactively, REVERSE is the prefix argument, and BEG and END are the region.
 Called from a program, there are three arguments:
 REVERSE (non-nil means reverse order), BEG and END (region to sort).
 The variable `sort-fold-case' determines whether alphabetic case affects
@@ -32064,6 +32121,11 @@ The variable list SPEC is the same as in `if-let'.
 
 (function-put 'when-let 'lisp-indent-function '1)
 
+(autoload 'string-truncate-left "subr-x" "\
+Truncate STRING to LENGTH, replacing initial surplus with \"...\".
+
+\(fn STRING LENGTH)" nil nil)
+
 (if (fboundp 'register-definition-prefixes) (register-definition-prefixes 
"subr-x" '("and-let*" "hash-table-" "if-let" "internal--" 
"replace-region-contents" "string-" "thread-" "when-let*")))
 
 ;;;***
@@ -34460,7 +34522,9 @@ You can call this function to add internal values in 
the trace buffer.
 (autoload 'trace-function-foreground "trace" "\
 Trace calls to function FUNCTION.
 With a prefix argument, also prompt for the trace buffer (default
-`trace-buffer'), and a Lisp expression CONTEXT.
+`trace-buffer'), and a Lisp expression CONTEXT.  When called from
+Lisp, CONTEXT should be a function of no arguments which returns
+a value to insert into BUFFER during the trace.
 
 Tracing a function causes every call to that function to insert
 into BUFFER Lisp-style trace messages that display the function's
diff --git a/lisp/mail/qp.el b/lisp/mail/qp.el
index 388c398..35ff47f 100644
--- a/lisp/mail/qp.el
+++ b/lisp/mail/qp.el
@@ -1,4 +1,4 @@
-;;; qp.el --- Quoted-Printable functions
+;;; qp.el --- Quoted-Printable functions  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
 
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index c83884f..a454402 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1733,7 +1733,7 @@ If CHARSET is nil then use UTF-8."
 
 (defun eww-write-bookmarks ()
   (with-temp-file (expand-file-name "eww-bookmarks" eww-bookmarks-directory)
-    (insert ";; Auto-generated file; don't edit\n")
+    (insert ";; Auto-generated file; don't edit -*- mode: lisp-data -*-\n")
     (pp eww-bookmarks (current-buffer))))
 
 (defun eww-read-bookmarks ()
diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el
index 2d36c5e..cc22427 100644
--- a/lisp/net/nsm.el
+++ b/lisp/net/nsm.el
@@ -964,6 +964,7 @@ protocol."
 
 (defun nsm-write-settings ()
   (with-temp-file nsm-settings-file
+    (insert ";;;; -*- mode: lisp-data -*-\n")
     (insert "(\n")
     (dolist (setting nsm-permanent-host-settings)
       (insert " ")
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 09e30f0..02400f9 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -139,23 +139,29 @@ Return DEFAULT if not set."
        (tramp-run-real-handler #'directory-file-name (list file))
        (tramp-file-name-hop key) nil)
   (let* ((hash (tramp-get-hash-table key))
-        (value (when (hash-table-p hash) (gethash property hash))))
-    (if ;; We take the value only if there is any, and
-       ;; `remote-file-name-inhibit-cache' indicates that it is still
-       ;; valid.  Otherwise, DEFAULT is set.
-       (and (consp value)
+        (cached (and (hash-table-p hash) (gethash property hash)))
+        (cached-at (and (consp cached) (format-time-string "%T" (car cached))))
+        (value default)
+        use-cache)
+
+    (when ;; We take the value only if there is any, and
+         ;; `remote-file-name-inhibit-cache' indicates that it is
+         ;; still valid.  Otherwise, DEFAULT is set.
+       (and (consp cached)
             (or (null remote-file-name-inhibit-cache)
                 (and (integerp remote-file-name-inhibit-cache)
                      (time-less-p
                       nil
-                      (time-add (car value) remote-file-name-inhibit-cache)))
+                      (time-add (car cached) remote-file-name-inhibit-cache)))
                 (and (consp remote-file-name-inhibit-cache)
                      (time-less-p
-                      remote-file-name-inhibit-cache (car value)))))
-       (setq value (cdr value))
-      (setq value default))
+                      remote-file-name-inhibit-cache (car cached)))))
+      (setq value (cdr cached)
+           use-cache t))
 
-    (tramp-message key 8 "%s %s %s" file property value)
+    (tramp-message key 8 "%s %s %s; inhibit: %s; cache used: %s; cached at: %s"
+                   file property value
+                  remote-file-name-inhibit-cache use-cache cached-at)
     (when (>= tramp-verbose 10)
       (let* ((var (intern (concat "tramp-cache-get-count-" property)))
             (val (or (numberp (bound-and-true-p var))
@@ -310,15 +316,19 @@ the connection, return DEFAULT."
     (setf (tramp-file-name-localname key) nil
          (tramp-file-name-hop key) nil))
   (let* ((hash (tramp-get-hash-table key))
-        (value
-         ;; If the key is an auxiliary process object, check whether
-         ;; the process is still alive.
-         (if (and (processp key) (not (process-live-p key)))
-             default
-           (if (hash-table-p hash)
-               (gethash property hash default)
-             default))))
-    (tramp-message key 7 "%s %s" property value)
+        (cached (if (hash-table-p hash)
+                    (gethash property hash tramp-cache-undefined)
+                  tramp-cache-undefined))
+        (value default)
+        use-cache)
+
+    (when (and (not (eq cached tramp-cache-undefined))
+              ;; If the key is an auxiliary process object, check
+              ;; whether the process is still alive.
+              (not (and (processp key) (not (process-live-p key)))))
+      (setq value cached
+           use-cache t))
+    (tramp-message key 7 "%s %s; cache used: %s" property value use-cache)
     value))
 
 ;;;###tramp-autoload
@@ -472,15 +482,10 @@ used to cache connection properties of the local machine."
        ;; Dump it.
        (with-temp-file tramp-persistency-file-name
          (insert
-          ";; -*- emacs-lisp -*-"
-          ;; `time-stamp-string' might not exist in all Emacs flavors.
-          (condition-case nil
-              (progn
-                (format
-                 " <%s %s>\n"
-                 (time-stamp-string "%02y/%02m/%02d %02H:%02M:%02S")
-                 tramp-persistency-file-name))
-            (error "\n"))
+          ;; Starting with Emacs 28, we could use `lisp-data'.
+          (format ";; -*- emacs-lisp -*- <%s %s>\n"
+                  (time-stamp-string "%02y/%02m/%02d %02H:%02M:%02S")
+                  tramp-persistency-file-name)
           ";; Tramp connection history.  Don't change this file.\n"
           ";; Run `M-x tramp-cleanup-all-connections' instead.\n\n"
           (with-output-to-string
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 7d353e2..1742da8 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -74,11 +74,13 @@ SYNTAX can be one of the symbols `default' (default),
 Each function is called with the current vector as argument.")
 
 ;;;###tramp-autoload
-(defun tramp-cleanup-connection (vec &optional keep-debug keep-password)
+(defun tramp-cleanup-connection
+    (vec &optional keep-debug keep-password keep-processes)
   "Flush all connection related objects.
 This includes password cache, file cache, connection cache,
-buffers.  KEEP-DEBUG non-nil preserves the debug buffer.
-KEEP-PASSWORD non-nil preserves the password cache.
+buffers, processes.  KEEP-DEBUG non-nil preserves the debug
+buffer.  KEEP-PASSWORD non-nil preserves the password cache.
+KEEP-PROCESSES non-nil preserves the asynchronous processes.
 When called interactively, a Tramp connection has to be selected."
   (interactive
    ;; When interactive, select the Tramp remote identification.
@@ -116,7 +118,9 @@ When called interactively, a Tramp connection has to be 
selected."
     ;; Delete processes.
     (dolist (key (hash-table-keys tramp-cache-data))
       (when (and (processp key)
-                (tramp-file-name-equal-p (process-get key 'vector) vec))
+                (tramp-file-name-equal-p (process-get key 'vector) vec)
+                (or (not keep-processes)
+                    (eq key (tramp-get-process vec))))
        (tramp-flush-connection-properties key)
        (delete-process key)))
 
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index a39d503..592dcf6 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2912,6 +2912,11 @@ STDERR can also be a file name."
                               (setq uenv (cons elt uenv)))))))
               (command
                (when (stringp program)
+                 (setenv-internal
+                  env "INSIDE_EMACS"
+                  (concat (or (getenv "INSIDE_EMACS") emacs-version)
+                          ",tramp:" tramp-version)
+                  'keep)
                  (format "cd %s && %s exec %s %s env %s %s"
                          (tramp-shell-quote-argument localname)
                          (if uenv
@@ -3061,6 +3066,11 @@ STDERR can also be a file name."
               (if (tramp-get-env-with-u-option v)
                   (setq env (append `("-u" ,elt) env))
                 (setq uenv (cons elt uenv))))))
+      (setenv-internal
+       env "INSIDE_EMACS"
+       (concat (or (getenv "INSIDE_EMACS") emacs-version)
+              ",tramp:" tramp-version)
+       'keep)
       (when env
        (setq command
              (format
@@ -4169,7 +4179,7 @@ file exists and nonzero exit status otherwise."
               "exec env TERM='%s' INSIDE_EMACS='%s,tramp:%s' "
               "ENV=%s %s PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s"))
             tramp-terminal-type
-            emacs-version tramp-version  ; INSIDE_EMACS
+            (or (getenv "INSIDE_EMACS") emacs-version) tramp-version
             (or (getenv-internal "ENV" tramp-remote-process-environment) "")
            (if (stringp tramp-histfile-override)
                (format "HISTFILE=%s"
@@ -4915,7 +4925,7 @@ If there is just some editing, retry it after 5 seconds."
        (run-at-time 5 nil 'tramp-timeout-session vec))
     (tramp-message
      vec 3 "Timeout session %s" (tramp-make-tramp-file-name vec 'noloc))
-    (tramp-cleanup-connection vec 'keep-debug)))
+    (tramp-cleanup-connection vec 'keep-debug nil 'keep-processes)))
 
 (defun tramp-maybe-open-connection (vec)
   "Maybe open a connection VEC.
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 2cbbc66..9ea08a4 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -3016,6 +3016,84 @@ need for `pike-font-lock-extra-types'.")
        (c-font-lock-doc-comments "/[*/]!" limit
          autodoc-font-lock-doc-comments)))))
 
+;; Doxygen
+
+(defconst doxygen-font-lock-doc-comments
+  ;; TODO: Handle @code, @verbatim, @dot, @f etc. better by not highlighting
+  ;; text inside of those commands.  Something smarter than just regexes may be
+  ;; needed to do that efficiently.
+  `((,(concat
+       ;; Make sure that the special character has not been escaped.  E.g. in
+       ;; ‘\@foo’ only ‘\@’ is a command (similarly for other characters like
+       ;; ‘\\foo’, ‘\<foo’ and ‘\&foo’).  The downside now is that we don’t
+       ;; match command started just after an escaped character, e.g. in
+       ;; ‘\@\foo’ we should match ‘\@’ as well as ‘\foo’ but only the former
+       ;; is matched.
+       "\\(?:^\\|[^\\@]\\)\\("
+         ;; Doxygen commands start with backslash or an at sign.  Note that for
+         ;; brevity in the comments only ‘\’ will be mentioned.
+         "[\\@]\\(?:"
+           ;; Doxygen commands except those starting with ‘f’
+           "[a-eg-z][a-z]*"
+           ;; Doxygen command starting with ‘f’:
+           "\\|f\\(?:"
+             "[][$}]"                         ; \f$ \f} \f[ \f]
+             "\\|{\\(?:[a-zA-Z]+\\*?}{?\\)?"  ; \f{ \f{env} \f{env}{
+             "\\|[a-z]+"                      ; \foo
+           "\\)"
+           "\\|~[a-zA-Z]*"             ; \~  \~language
+           "\\|[$@&~<=>#%\".|\\\\]"    ; single-character escapes
+           "\\|::\\|---?"              ; \:: \-- \---
+         "\\)"
+         ;; HTML tags and entities:
+         "\\|</?\\sw\\(?:\\sw\\|\\s \\|[=\n\r*.:]\\|\"[^\"]*\"\\|'[^']*'\\)*>"
+         "\\|&\\(?:\\sw+\\|#[0-9]+\\|#x[0-9a-fA-F]+\\);"
+       "\\)")
+     1 ,c-doc-markup-face-name prepend nil)
+    ;; Commands inside of strings are not commands so override highlighting 
with
+    ;; string face.  This also affects HTML attribute values if they are
+    ;; surrounded with double quotes which may or may not be considered a good
+    ;; thing.
+    ("\\(?:^\\|[^\\@]\\)\\(\"[^\"[:cntrl:]]+\"\\)"
+     1 font-lock-string-face prepend nil)
+    ;; HTML comments inside of the Doxygen comments.
+    ("\\(?:^\\|[^\\@]\\)\\(<!--.*?-->\\)"
+     1 font-lock-comment-face prepend nil)
+    ;; Autolinking. Doxygen auto-links anything that is a class name but we 
have
+    ;; no hope of matching those.  We are, however, able to match functions and
+    ;; members using explicit scoped syntax.  For functions, we can also find
+    ;; them by noticing argument-list.  Note that Doxygen accepts ‘::’ as well
+    ;; as ‘#’ as scope operators.
+    (,(let* ((ref "[\\@]ref\\s-+")
+             (ref-opt (concat "\\(?:" ref "\\)?"))
+             (id "[a-zA-Z_][a-zA-Z_0-9]*")
+             (args "\\(?:()\\|([^()]*)\\)")
+             (scope "\\(?:#\\|::\\)"))
+        (concat
+         "\\(?:^\\|[^\\@/%:]\\)\\(?:"
+                 ref-opt "\\(?1:" scope "?" "\\(?:" id scope "\\)+" "~?" id 
"\\)"
+           "\\|" ref-opt "\\(?1:" scope     "~?" id "\\)"
+           "\\|" ref-opt "\\(?1:" scope "?" "~?" id "\\)" args
+           "\\|" ref     "\\(?1:" "~?" id "\\)"
+           "\\|" ref-opt "\\(?1:~[A-Z][a-zA-Z0-9_]+\\)"
+         "\\)"))
+     1 font-lock-function-name-face prepend nil)
+    ;; Match URLs and emails.  This has two purposes.  First of all, Doxygen
+    ;; autolinks URLs.  Second of all, ‘@bar’ in ‘address@hidden’ has been 
matched
+    ;; above as a command; try and overwrite it.
+    (,(let* ((host "[A-Za-z0-9]\\(?:[A-Za-z0-9-]\\{0,61\\}[A-Za-z0-9]\\)")
+             (fqdn (concat "\\(?:" host "\\.\\)+" host))
+             (comp "[!-(*--/-=?-~]+")
+             (path (concat "/\\(?:" comp "[.]+" "\\)*" comp)))
+        (concat "\\(?:mailto:\\)?[a-zA-0_.]+@" fqdn
+                "\\|https?://" fqdn "\\(?:" path "\\)?"))
+     0 font-lock-keyword-face prepend nil)))
+
+(defconst doxygen-font-lock-keywords
+  `((,(lambda (limit)
+        (c-font-lock-doc-comments "/\\(?:/[/!]\\|\\*[\\*!]\\)"
+            limit doxygen-font-lock-doc-comments)))))
+
 
 ;; 2006-07-10:  awk-font-lock-keywords has been moved back to cc-awk.el.
 (cc-provide 'cc-fonts)
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 3995b21..b885f6a 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -576,6 +576,7 @@ comment styles:
  javadoc -- Javadoc style for \"/** ... */\" comments (default in Java mode).
  autodoc -- Pike autodoc style for \"//! ...\" comments (default in Pike mode).
  gtkdoc  -- GtkDoc style for \"/** ... **/\" comments (default in C and C++ 
modes).
+ doxygen -- Doxygen style.
 
 The value may also be a list of doc comment styles, in which case all
 of them are recognized simultaneously (presumably with markup cues
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index f85fd77..b737134 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -250,7 +250,7 @@ Comments in the form will be lost."
     map))
 
 ;;;###autoload
-(define-derived-mode emacs-lisp-mode prog-mode
+(define-derived-mode emacs-lisp-mode lisp-data-mode
   `("ELisp"
     (lexical-binding (:propertize "/l"
                       help-echo "Using lexical-binding mode")
@@ -268,35 +268,26 @@ Blank lines separate paragraphs.  Semicolons start 
comments.
 \\{emacs-lisp-mode-map}"
   :group 'lisp
   (defvar project-vc-external-roots-function)
-  (lisp-mode-variables nil nil 'elisp)
+  (setcar font-lock-defaults
+          '(lisp-el-font-lock-keywords
+            lisp-el-font-lock-keywords-1
+            lisp-el-font-lock-keywords-2))
+  (setf (nth 2 font-lock-defaults) nil)
   (add-hook 'after-load-functions #'elisp--font-lock-flush-elisp-buffers)
   (if (boundp 'electric-pair-text-pairs)
       (setq-local electric-pair-text-pairs
                   (append '((?\` . ?\') (?\‘ . ?\’))
                           electric-pair-text-pairs))
     (add-hook 'electric-pair-mode-hook #'emacs-lisp-set-electric-text-pairs))
-  (setq-local electric-quote-string t)
-  (setq imenu-case-fold-search nil)
   (add-hook 'eldoc-documentation-functions
             #'elisp-eldoc-documentation-function nil t)
   (add-hook 'xref-backend-functions #'elisp--xref-backend nil t)
   (setq-local project-vc-external-roots-function #'elisp-load-path-roots)
   (add-hook 'completion-at-point-functions
             #'elisp-completion-at-point nil 'local)
-  ;; .dir-locals.el and lock files will cause the byte-compiler and
-  ;; checkdoc emit spurious warnings, because they don't follow the
-  ;; conventions of Emacs Lisp sources.  Until we have a better fix,
-  ;; like teaching elisp-mode about files that only hold data
-  ;; structures, we disable the ELisp Flymake backend for these files.
-  (unless
-      (let* ((bfname (buffer-file-name))
-             (fname (and (stringp bfname) (file-name-nondirectory bfname))))
-        (and (stringp fname)
-             (or (string-match "\\`\\.#" fname)
-                 (string-equal dir-locals-file fname))))
-    (add-hook 'flymake-diagnostic-functions #'elisp-flymake-checkdoc nil t)
-    (add-hook 'flymake-diagnostic-functions
-              #'elisp-flymake-byte-compile nil t)))
+  (add-hook 'flymake-diagnostic-functions #'elisp-flymake-checkdoc nil t)
+  (add-hook 'flymake-diagnostic-functions
+              #'elisp-flymake-byte-compile nil t))
 
 ;; Font-locking support.
 
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 1f4cbe9..f5f4092 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -185,23 +185,25 @@ to find the list of ignores for each directory."
   (require 'find-dired)
   (require 'xref)
   (defvar find-name-arg)
-  (let ((default-directory dir)
-        (command (format "%s %s %s -type f %s -print0"
-                         find-program
-                         (file-local-name dir)
-                         (xref--find-ignores-arguments
-                          ignores
-                          (expand-file-name dir))
-                         (if files
-                             (concat (shell-quote-argument "(")
-                                     " " find-name-arg " "
-                                     (mapconcat
-                                      #'shell-quote-argument
-                                      (split-string files)
-                                      (concat " -o " find-name-arg " "))
-                                     " "
-                                     (shell-quote-argument ")"))"")
-                         )))
+  (let* ((default-directory dir)
+         ;; Make sure ~/ etc. in local directory name is
+         ;; expanded and not left for the shell command
+         ;; to interpret.
+         (localdir (file-local-name (expand-file-name dir)))
+         (command (format "%s %s %s -type f %s -print0"
+                          find-program
+                          localdir
+                          (xref--find-ignores-arguments ignores localdir)
+                          (if files
+                              (concat (shell-quote-argument "(")
+                                      " " find-name-arg " "
+                                      (mapconcat
+                                       #'shell-quote-argument
+                                       (split-string files)
+                                       (concat " -o " find-name-arg " "))
+                                      " "
+                                      (shell-quote-argument ")"))"")
+                          )))
     (project--remote-file-names
      (sort (split-string (shell-command-to-string command) "\0" t)
            #'string<))))
diff --git a/lisp/replace.el b/lisp/replace.el
index 168ccf2..f3a71f8 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -340,13 +340,17 @@ that reads FROM-STRING, or invoke replacements from
 incremental search with a key sequence like `C-s C-s M-%'
 to use its current search string as the string to replace.
 
-Matching is independent of case if `case-fold-search' is non-nil and
-FROM-STRING has no uppercase letters.  Replacement transfers the case
-pattern of the old text to the new text, if `case-replace' and
-`case-fold-search' are non-nil and FROM-STRING has no uppercase
-letters.  (Transferring the case pattern means that if the old text
-matched is all caps, or capitalized, then its replacement is upcased
-or capitalized.)
+Matching is independent of case if both `case-fold-search'
+and `search-upper-case' are non-nil and FROM-STRING has no
+uppercase letters; if `search-upper-case' is nil, then
+whether matching ignores case depends on `case-fold-search'
+regardless of whether there are uppercase letters in FROM-STRING.
+Replacement transfers the case pattern of the old text to the
+new text, if both `case-fold-search' and `case-replace' are
+non-nil and FROM-STRING has no uppercase letters.
+\(Transferring the case pattern means that if the old text
+matched is all caps, or capitalized, then its replacement is
+respectively upcased or capitalized.)
 
 Ignore read-only matches if `query-replace-skip-read-only' is non-nil,
 ignore hidden matches if `search-invisible' is nil, and ignore more
@@ -402,13 +406,16 @@ that reads REGEXP, or invoke replacements from
 incremental search with a key sequence like `C-M-s C-M-s C-M-%'
 to use its current search regexp as the regexp to replace.
 
-Matching is independent of case if `case-fold-search' is non-nil and
-REGEXP has no uppercase letters.  Replacement transfers the case
-pattern of the old text to the new text, if `case-replace' and
-`case-fold-search' are non-nil and REGEXP has no uppercase letters.
-\(Transferring the case pattern means that if the old text matched is
-all caps, or capitalized, then its replacement is upcased or
-capitalized.)
+Matching is independent of case if both `case-fold-search'
+and `search-upper-case' are non-nil and REGEXP has no uppercase
+letters; if `search-upper-case' is nil, then whether matching
+ignores case depends on `case-fold-search' regardless of whether
+there are uppercase letters in REGEXP.
+Replacement transfers the case pattern of the old text to the new
+text, if both `case-fold-search' and `case-replace' are non-nil
+and REGEXP has no uppercase letters.  (Transferring the case pattern
+means that if the old text matched is all caps, or capitalized,
+then its replacement is respectively upcased or capitalized.)
 
 Ignore read-only matches if `query-replace-skip-read-only' is non-nil,
 ignore hidden matches if `search-invisible' is nil, and ignore more
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index fa0e181..46738ab 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -248,8 +248,8 @@ may have changed) back to `save-place-alist'."
       (delete-region (point-min) (point-max))
       (when save-place-forget-unreadable-files
        (save-place-forget-unreadable-files))
-      (insert (format ";;; -*- coding: %s -*-\n"
-                      (symbol-name coding-system-for-write)))
+      (insert (format ";;; -*- coding: %s; mode: lisp-data -*-\n"
+                      coding-system-for-write))
       (let ((print-length nil)
             (print-level nil))
         (pp save-place-alist (current-buffer)))
diff --git a/lisp/term/bobcat.el b/lisp/term/bobcat.el
index a32da6a..983c8cd 100644
--- a/lisp/term/bobcat.el
+++ b/lisp/term/bobcat.el
@@ -1,3 +1,4 @@
+;;; bobcat.el  -*- lexical-binding:t -*-
 
 (defun terminal-init-bobcat ()
   "Terminal initialization function for bobcat."
diff --git a/lisp/term/cygwin.el b/lisp/term/cygwin.el
index edc64b4..8f0d751 100644
--- a/lisp/term/cygwin.el
+++ b/lisp/term/cygwin.el
@@ -1,4 +1,4 @@
-;;; cygwin.el --- support for the Cygwin terminal
+;;; cygwin.el --- support for the Cygwin terminal  -*- lexical-binding:t -*-
 
 ;;; The Cygwin terminal can't really display underlines.
 
diff --git a/lisp/term/konsole.el b/lisp/term/konsole.el
index 8b2e7e1..4af818b 100644
--- a/lisp/term/konsole.el
+++ b/lisp/term/konsole.el
@@ -1,4 +1,4 @@
-;;; konsole.el --- terminal initialization for konsole
+;;; konsole.el --- terminal initialization for konsole  -*- lexical-binding:t 
-*-
 ;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
 
 (require 'term/xterm)
diff --git a/lisp/term/linux.el b/lisp/term/linux.el
index 70730dc..35bd3ac 100644
--- a/lisp/term/linux.el
+++ b/lisp/term/linux.el
@@ -1,4 +1,4 @@
-;; The Linux console handles Latin-1 by default.
+;; The Linux console handles Latin-1 by default.  -*- lexical-binding:t -*-
 
 (declare-function gpm-mouse-enable "t-mouse" ())
 
diff --git a/lisp/term/vt100.el b/lisp/term/vt100.el
index 7ddbe38..2df1414 100644
--- a/lisp/term/vt100.el
+++ b/lisp/term/vt100.el
@@ -1,4 +1,4 @@
-;;; vt100.el --- define VT100 function key sequences in function-key-map
+;;; vt100.el --- define VT100 function key sequences in function-key-map  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 1989, 1993, 2001-2020 Free Software Foundation, Inc.
 
diff --git a/lisp/term/vt200.el b/lisp/term/vt200.el
index dde2e22..569b79e 100644
--- a/lisp/term/vt200.el
+++ b/lisp/term/vt200.el
@@ -1,3 +1,5 @@
+;;; vt200.el  -*- lexical-binding:t -*-
+
 ;; For our purposes we can treat the vt200 and vt100 almost alike.
 ;; Most differences are handled by the termcap entry.
 (defun terminal-init-vt200 ()
diff --git a/lisp/version.el b/lisp/version.el
index 046b4a2..24da21c 100644
--- a/lisp/version.el
+++ b/lisp/version.el
@@ -123,7 +123,7 @@ or if we could not determine the revision.")
                  (looking-at "[[:xdigit:]]\\{40\\}"))
           (match-string 0)))))
 
-(defun emacs-repository-get-version (&optional dir external)
+(defun emacs-repository-get-version (&optional dir _external)
   "Try to return as a string the repository revision of the Emacs sources.
 The format of the returned string is dependent on the VCS in use.
 Value is nil if the sources do not seem to be under version
diff --git a/lisp/w32-vars.el b/lisp/w32-vars.el
index 307490d..642a484 100644
--- a/lisp/w32-vars.el
+++ b/lisp/w32-vars.el
@@ -1,4 +1,4 @@
-;;; w32-vars.el --- MS-Windows specific user options
+;;; w32-vars.el --- MS-Windows specific user options  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
 
@@ -44,22 +44,19 @@ after changing the value of this variable."
   :type 'boolean
   :set (lambda (symbol value)
         (set symbol value)
-        (setq mouse-appearance-menu-map nil))
-  :group 'w32)
+        (setq mouse-appearance-menu-map nil)))
 
 (unless (eq system-type 'cygwin)
   (defcustom w32-allow-system-shell nil
     "Disable startup warning when using \"system\" shells."
-    :type 'boolean
-    :group 'w32))
+    :type 'boolean))
 
 (unless (eq system-type 'cygwin)
  (defcustom w32-system-shells '("cmd" "cmd.exe" "command" "command.com"
                                 "4nt" "4nt.exe" "4dos" "4dos.exe"
                                 "tcc" "tcc.exe" "ndos" "ndos.exe")
    "List of strings recognized as Windows system shells."
-   :type '(repeat string)
-   :group 'w32))
+   :type '(repeat string)))
 
 ;; Want "menu" custom type for this.
 (defcustom w32-fixed-font-alist
@@ -149,8 +146,7 @@ menu if the variable `w32-use-w32-font-dialog' is nil."
                (const :tag "Separator" (""))
                (list :tag "Font Entry"
                      (string :tag "Menu text")
-                     (string :tag "Font")))))))
-    :group 'w32)
+                     (string :tag "Font"))))))))
 
 (make-obsolete-variable 'w32-enable-synthesized-fonts nil "24.4")
 
diff --git a/lisp/window.el b/lisp/window.el
index 8512a0e..d658cb8 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -8638,16 +8638,32 @@ in some window."
     (setq end (point-max)))
   (if (= beg end)
       0
-    (save-excursion
-      (save-restriction
-        (widen)
-        (narrow-to-region (min beg end)
-                          (if (and (not count-final-newline)
-                                   (= ?\n (char-before (max beg end))))
-                              (1- (max beg end))
-                            (max beg end)))
-        (goto-char (point-min))
-        (1+ (vertical-motion (buffer-size) window))))))
+    (let ((start (min beg end))
+          (finish (max beg end))
+          count end-invisible-p)
+      ;; When END is invisible because lines are truncated in WINDOW,
+      ;; vertical-motion returns a number that is 1 larger than it
+      ;; should.  We need to fix that.
+      (setq end-invisible-p
+            (and (or truncate-lines
+                     (and (natnump truncate-partial-width-windows)
+                          (< (window-total-width window)
+                             truncate-partial-width-windows)))
+                 (save-excursion
+                   (goto-char finish)
+                   (> (- (current-column) (window-hscroll window))
+                      (window-body-width window)))))
+      (save-excursion
+        (save-restriction
+          (widen)
+          (narrow-to-region start
+                            (if (and (not count-final-newline)
+                                     (= ?\n (char-before finish)))
+                                (1- finish)
+                              finish))
+          (goto-char start)
+          (setq count (vertical-motion (buffer-size) window))
+          (if end-invisible-p count (1+ count)))))))
 
 (defun window-buffer-height (window)
   "Return the height (in screen lines) of the buffer that WINDOW is displaying.
diff --git a/m4/explicit_bzero.m4 b/m4/explicit_bzero.m4
index 507816a..a415e7b 100644
--- a/m4/explicit_bzero.m4
+++ b/m4/explicit_bzero.m4
@@ -19,4 +19,5 @@ AC_DEFUN([gl_FUNC_EXPLICIT_BZERO],
 AC_DEFUN([gl_PREREQ_EXPLICIT_BZERO],
 [
   AC_CHECK_FUNCS([explicit_memset])
+  AC_CHECK_FUNCS_ONCE([memset_s])
 ])
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index b4795c1..b0010d0 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 48
+# gnulib-common.m4 serial 49
 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -15,6 +15,15 @@ AC_DEFUN([gl_COMMON], [
   AC_REQUIRE([gl_ZZGNULIB])
 ])
 AC_DEFUN([gl_COMMON_BODY], [
+  AH_VERBATIM([_GL_GNUC_PREREQ],
+[/* True if the compiler says it groks GNU C version MAJOR.MINOR.  */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define _GL_GNUC_PREREQ(major, minor) \
+    ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
+#else
+# define _GL_GNUC_PREREQ(major, minor) 0
+#endif
+])
   AH_VERBATIM([_Noreturn],
 [/* The _Noreturn keyword of C11.  */
 #ifndef _Noreturn
@@ -31,12 +40,12 @@ AC_DEFUN([gl_COMMON_BODY], [
 #  define _Noreturn [[noreturn]]
 # elif ((!defined __cplusplus || defined __clang__) \
         && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0)  \
-            || 4 < __GNUC__ + (7 <= __GNUC_MINOR__) \
+            || _GL_GNUC_PREREQ (4, 7) \
             || (defined __apple_build_version__ \
                 ? 6000000 <= __apple_build_version__ \
                 : 3 < __clang_major__ + (5 <= __clang_minor__))))
    /* _Noreturn works as-is.  */
-# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
+# elif _GL_GNUC_PREREQ (2, 8) || 0x5110 <= __SUNPRO_C
 #  define _Noreturn __attribute__ ((__noreturn__))
 # elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
 #  define _Noreturn __declspec (noreturn)
@@ -55,48 +64,206 @@ AC_DEFUN([gl_COMMON_BODY], [
 #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined 
__cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
 # define __GNUC_STDC_INLINE__ 1
 #endif])
-  AH_VERBATIM([unused_parameter],
-[/* Define as a marker that can be attached to declarations that might not
-    be used.  This helps to reduce warnings, such as from
-    GCC -Wunused-parameter.  */
-#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_UNUSED __attribute__ ((__unused__))
+  AH_VERBATIM([attribute],
+[/* Attributes.  */
+#ifdef __has_attribute
+# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
 #else
-# define _GL_UNUSED
+# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
+# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
+# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
+# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
+# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
+# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
+# ifdef _ICC
+#  define _GL_ATTR_may_alias 0
+# else
+#  define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
+# endif
+# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
+# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
+# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
+# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
+# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
+# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_warn_unused_result_GL_GNUC_PREREQ (3, 4)
 #endif
-/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
-   is a misnomer outside of parameter lists.  */
-#define _UNUSED_PARAMETER_ _GL_UNUSED
-
-/* gcc supports the "unused" attribute on possibly unused labels, and
-   g++ has since version 4.5.  Note to support C++ as well as C,
-   _GL_UNUSED_LABEL should be used with a trailing ;  */
-#if !defined __cplusplus || __GNUC__ > 4 \
-    || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-# define _GL_UNUSED_LABEL _GL_UNUSED
+
+]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's _Alignas instead.
+[
+#if _GL_HAS_ATTRIBUTE (alloc_size)
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
 #else
-# define _GL_UNUSED_LABEL
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
 #endif
 
-/* The __pure__ attribute was added in gcc 2.96.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#if _GL_HAS_ATTRIBUTE (always_inline)
+# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
 #else
-# define _GL_ATTRIBUTE_PURE /* empty */
+# define _GL_ATTRIBUTE_ALWAYS_INLINE
 #endif
 
-/* The __const__ attribute was added in gcc 2.95.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+#if _GL_HAS_ATTRIBUTE (artificial)
+# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
+#else
+# define _GL_ATTRIBUTE_ARTIFICIAL
+#endif
+
+/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
+   <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>. */
+#if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
+# define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
+#else
+# define _GL_ATTRIBUTE_COLD
+#endif
+
+#if _GL_HAS_ATTRIBUTE (const)
 # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
 #else
-# define _GL_ATTRIBUTE_CONST /* empty */
+# define _GL_ATTRIBUTE_CONST
 #endif
 
-/* The __malloc__ attribute was added in gcc 3.  */
-#if 3 <= __GNUC__
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
+#elif _GL_HAS_ATTRIBUTE (deprecated)
+# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
+#else
+# define _GL_ATTRIBUTE_DEPRECATED
+#endif
+
+#if _GL_HAS_ATTRIBUTE (error)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__((__error__ (msg)))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__((__warning__ (msg)))
+#else
+# define _GL_ATTRIBUTE_ERROR(msg)
+# define _GL_ATTRIBUTE_WARNING(msg)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (externally_visible)
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible))
+#else
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+#endif
+
+/* FALLTHROUGH is special, because it always expands to something.  */
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
+#elif _GL_HAS_ATTRIBUTE (fallthrough)
+# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
+#else
+# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (format)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (leaf)
+# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__))
+#else
+# define _GL_ATTRIBUTE_LEAF
+#endif
+
+#if _GL_HAS_ATTRIBUTE (may_alias)
+# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
+#else
+# define _GL_ATTRIBUTE_MAY_ALIAS
+#endif
+
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
+#elif _GL_HAS_ATTRIBUTE (unused)
+# define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__))
+#else
+# define _GL_ATTRIBUTE_MAYBE_UNUSED
+#endif
+/* Earlier spellings of this macro.  */
+#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
+#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED
+
+#if _GL_HAS_ATTRIBUTE (malloc)
 # define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
 #else
-# define _GL_ATTRIBUTE_MALLOC /* empty */
+# define _GL_ATTRIBUTE_MALLOC
+#endif
+
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
+#elif _GL_HAS_ATTRIBUTE (warn_unused_result)
+# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__))
+#else
+# define _GL_ATTRIBUTE_NODISCARD
+#endif
+
+#if _GL_HAS_ATTRIBUTE (noinline)
+# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__))
+#else
+# define _GL_ATTRIBUTE_NOINLINE
+#endif
+
+#if _GL_HAS_ATTRIBUTE (nonnull)
+# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args))
+#else
+# define _GL_ATTRIBUTE_NONNULL(args)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (nonstring)
+# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
+#else
+# define _GL_ATTRIBUTE_NONSTRING
+#endif
+
+/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead.  */
+
+#if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus
+# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
+#else
+# define _GL_ATTRIBUTE_NOTHROW
+#endif
+
+#if _GL_HAS_ATTRIBUTE (packed)
+# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
+#else
+# define _GL_ATTRIBUTE_PACKED
+#endif
+
+#if _GL_HAS_ATTRIBUTE (pure)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE
+#endif
+
+#if _GL_HAS_ATTRIBUTE (returns_nonnull)
+# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
+#else
+# define _GL_ATTRIBUTE_RETURNS_NONNULL
+#endif
+
+#if _GL_HAS_ATTRIBUTE (sentinel)
+# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
+#else
+# define _GL_ATTRIBUTE_SENTINEL(pos)
+#endif
+
+]dnl There is no _GL_ATTRIBUTE_VISIBILITY; see m4/visibility.m4 instead.
+[
+/* To support C++ as well as C, use _GL_UNUSED_LABEL with trailing ';'.  */
+#if !defined __cplusplus || _GL_GNUC_PREREQ (4, 5)
+# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_MAYBE_UNUSED
+#else
+# define _GL_UNUSED_LABEL
 #endif
 ])
   AH_VERBATIM([async_safe],
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index d5faa9a..3717024 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -47,6 +47,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module alloca-opt:
   # Code from module allocator:
   # Code from module at-internal:
+  # Code from module attribute:
   # Code from module binary-io:
   # Code from module builtin-expect:
   # Code from module byteswap:
@@ -934,6 +935,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/allocator.h
   lib/arg-nonnull.h
   lib/at-func.c
+  lib/attribute.h
   lib/binary-io.c
   lib/binary-io.h
   lib/byteswap.in.h
diff --git a/src/conf_post.h b/src/conf_post.h
index 8a6b329..953b783 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -30,13 +30,15 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #endif
 
 /* To help make dependencies clearer elsewhere, this file typically
-   does not #include other files.  The exceptions are first stdbool.h
+   does not #include other files.  The exceptions are stdbool.h
    because it is unlikely to interfere with configuration and bool is
-   such a core part of the C language, and second ms-w32.h (DOS_NT
+   such a core part of the C language, attribute.h because its
+   ATTRIBUTE_* macros are used here, and ms-w32.h (DOS_NT
    only) because it historically was included here and changing that
    would take some work.  */
 
 #include <stdbool.h>
+#include <attribute.h>
 
 #if defined WINDOWSNT && !defined DEFER_MS_W32_H
 # include <ms-w32.h>
@@ -65,31 +67,30 @@ typedef unsigned int bool_bf;
 typedef bool bool_bf;
 #endif
 
-/* Simulate __has_attribute on compilers that lack it.  It is used only
-   on arguments like alloc_size that are handled in this simulation.
-   __has_attribute should be used only in #if expressions, as Oracle
+/* A substitute for __has_attribute on compilers that lack it.
+   It is used only on arguments like cleanup that are handled here.
+   This macro should be used only in #if expressions, as Oracle
    Studio 12.5's __has_attribute does not work in plain code.  */
-#ifndef __has_attribute
-# define __has_attribute(a) __has_attribute_##a
-# define __has_attribute_alloc_size GNUC_PREREQ (4, 3, 0)
-# define __has_attribute_cleanup GNUC_PREREQ (3, 4, 0)
-# define __has_attribute_cold GNUC_PREREQ (4, 3, 0)
-# define __has_attribute_externally_visible GNUC_PREREQ (4, 1, 0)
-# define __has_attribute_no_address_safety_analysis false
-# define __has_attribute_no_sanitize_address GNUC_PREREQ (4, 8, 0)
-# define __has_attribute_no_sanitize_undefined GNUC_PREREQ (4, 9, 0)
-# define __has_attribute_returns_nonnull GNUC_PREREQ (4, 9, 0)
-# define __has_attribute_warn_unused_result GNUC_PREREQ (3, 4, 0)
+#ifdef __has_attribute
+# define HAS_ATTRIBUTE(a) __has_attribute (__##a##__)
+#else
+# define HAS_ATTRIBUTE(a) HAS_ATTR_##a
+# define HAS_ATTR_cleanup GNUC_PREREQ (3, 4, 0)
+# define HAS_ATTR_no_address_safety_analysis false
+# define HAS_ATTR_no_sanitize_address GNUC_PREREQ (4, 8, 0)
+# define HAS_ATTR_no_sanitize_undefined GNUC_PREREQ (4, 9, 0)
 #endif
 
-/* Simulate __has_feature on compilers that lack it.  It is used only
+/* A substitute for __has_feature on compilers that lack it.  It is used only
    to define ADDRESS_SANITIZER below.  */
-#ifndef __has_feature
-# define __has_feature(a) false
+#ifdef __has_feature
+# define HAS_FEATURE(a) __has_feature (a)
+#else
+# define HAS_FEATURE(a) false
 #endif
 
 /* True if addresses are being sanitized.  */
-#if defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer)
+#if defined __SANITIZE_ADDRESS__ || HAS_FEATURE (address_sanitizer)
 # define ADDRESS_SANITIZER true
 #else
 # define ADDRESS_SANITIZER false
@@ -226,37 +227,8 @@ extern void _DebPrint (const char *fmt, ...);
 extern char *emacs_getenv_TZ (void);
 extern int emacs_setenv_TZ (char const *);
 
-/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
-   <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>. */
-#if __has_attribute (cold) && !defined __MINGW32__
-# define ATTRIBUTE_COLD __attribute__ ((cold))
-#else
-# define ATTRIBUTE_COLD
-#endif
-
-#if __GNUC__ >= 3  /* On GCC 3.0 we might get a warning.  */
-#define NO_INLINE __attribute__((noinline))
-#else
-#define NO_INLINE
-#endif
-
-#if __has_attribute (externally_visible)
-#define EXTERNALLY_VISIBLE __attribute__((externally_visible))
-#else
-#define EXTERNALLY_VISIBLE
-#endif
-
-#if GNUC_PREREQ (2, 7, 0)
-# define ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
-#else
-# define ATTRIBUTE_FORMAT(spec) /* empty */
-#endif
-
-#if GNUC_PREREQ (7, 0, 0)
-# define FALLTHROUGH __attribute__ ((__fallthrough__))
-#else
-# define FALLTHROUGH ((void) 0)
-#endif
+#define NO_INLINE ATTRIBUTE_NOINLINE
+#define EXTERNALLY_VISIBLE ATTRIBUTE_EXTERNALLY_VISIBLE
 
 #if GNUC_PREREQ (4, 4, 0) && defined __GLIBC_MINOR__
 # define PRINTF_ARCHETYPE __gnu_printf__
@@ -288,16 +260,8 @@ extern int emacs_setenv_TZ (char const *);
 #define ATTRIBUTE_FORMAT_PRINTF(string_index, first_to_check) \
   ATTRIBUTE_FORMAT ((PRINTF_ARCHETYPE, string_index, first_to_check))
 
-#define ARG_NONNULL _GL_ARG_NONNULL
-#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST
-#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
-#define ATTRIBUTE_UNUSED _GL_UNUSED
-
-#if GNUC_PREREQ (3, 3, 0) && !defined __ICC
-# define ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
-#else
-# define ATTRIBUTE_MAY_ALIAS
-#endif
+#define ARG_NONNULL ATTRIBUTE_NONNULL
+#define ATTRIBUTE_UNUSED MAYBE_UNUSED
 
 /* Declare NAME to be a pointer to an object of type TYPE, initialized
    to the address ADDR, which may be of a different type.  Accesses
@@ -308,27 +272,13 @@ extern int emacs_setenv_TZ (char const *);
   type ATTRIBUTE_MAY_ALIAS *name = (type *) (addr)
 
 #if 3 <= __GNUC__
-# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
 # define ATTRIBUTE_SECTION(name) __attribute__((section (name)))
 #else
-# define ATTRIBUTE_MALLOC
 #define ATTRIBUTE_SECTION(name)
 #endif
 
-#if __has_attribute (alloc_size)
-# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
-#else
-# define ATTRIBUTE_ALLOC_SIZE(args)
-#endif
-
 #define ATTRIBUTE_MALLOC_SIZE(args) ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE 
(args)
 
-#if __has_attribute (returns_nonnull)
-# define ATTRIBUTE_RETURNS_NONNULL __attribute__ ((returns_nonnull))
-#else
-# define ATTRIBUTE_RETURNS_NONNULL
-#endif
-
 /* Work around GCC bug 59600: when a function is inlined, the inlined
    code may have its addresses sanitized even if the function has the
    no_sanitize_address attribute.  This bug is fixed in GCC 4.9.0 and
diff --git a/src/fns.c b/src/fns.c
index ec0004d..d6808aa 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1593,16 +1593,16 @@ The value is actually the tail of LIST whose car is 
ELT.  */)
 }
 
 DEFUN ("assq", Fassq, Sassq, 2, 2, 0,
-       doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST.
-The value is actually the first element of LIST whose car is KEY.
-Elements of LIST that are not conses are ignored.  */)
-  (Lisp_Object key, Lisp_Object list)
+       doc: /* Return non-nil if KEY is `eq' to the car of an element of ALIST.
+The value is actually the first element of ALIST whose car is KEY.
+Elements of ALIST that are not conses are ignored.  */)
+  (Lisp_Object key, Lisp_Object alist)
 {
-  Lisp_Object tail = list;
+  Lisp_Object tail = alist;
   FOR_EACH_TAIL (tail)
     if (CONSP (XCAR (tail)) && EQ (XCAR (XCAR (tail)), key))
       return XCAR (tail);
-  CHECK_LIST_END (tail, list);
+  CHECK_LIST_END (tail, alist);
   return Qnil;
 }
 
@@ -1610,22 +1610,22 @@ Elements of LIST that are not conses are ignored.  */)
    Use only on objects known to be non-circular lists.  */
 
 Lisp_Object
-assq_no_quit (Lisp_Object key, Lisp_Object list)
+assq_no_quit (Lisp_Object key, Lisp_Object alist)
 {
-  for (; ! NILP (list); list = XCDR (list))
-    if (CONSP (XCAR (list)) && EQ (XCAR (XCAR (list)), key))
-      return XCAR (list);
+  for (; ! NILP (alist); alist = XCDR (alist))
+    if (CONSP (XCAR (alist)) && EQ (XCAR (XCAR (alist)), key))
+      return XCAR (alist);
   return Qnil;
 }
 
 DEFUN ("assoc", Fassoc, Sassoc, 2, 3, 0,
-       doc: /* Return non-nil if KEY is equal to the car of an element of LIST.
-The value is actually the first element of LIST whose car equals KEY.
+       doc: /* Return non-nil if KEY is equal to the car of an element of 
ALIST.
+The value is actually the first element of ALIST whose car equals KEY.
 
 Equality is defined by TESTFN if non-nil or by `equal' if nil.  */)
-     (Lisp_Object key, Lisp_Object list, Lisp_Object testfn)
+     (Lisp_Object key, Lisp_Object alist, Lisp_Object testfn)
 {
-  Lisp_Object tail = list;
+  Lisp_Object tail = alist;
   FOR_EACH_TAIL (tail)
     {
       Lisp_Object car = XCAR (tail);
@@ -1636,7 +1636,7 @@ Equality is defined by TESTFN if non-nil or by `equal' if 
nil.  */)
              : !NILP (call2 (testfn, XCAR (car), key))))
        return car;
     }
-  CHECK_LIST_END (tail, list);
+  CHECK_LIST_END (tail, alist);
   return Qnil;
 }
 
@@ -1645,11 +1645,11 @@ Equality is defined by TESTFN if non-nil or by `equal' 
if nil.  */)
    that are not too deep and are not window configurations.  */
 
 Lisp_Object
-assoc_no_quit (Lisp_Object key, Lisp_Object list)
+assoc_no_quit (Lisp_Object key, Lisp_Object alist)
 {
-  for (; ! NILP (list); list = XCDR (list))
+  for (; ! NILP (alist); alist = XCDR (alist))
     {
-      Lisp_Object car = XCAR (list);
+      Lisp_Object car = XCAR (alist);
       if (CONSP (car)
          && (EQ (XCAR (car), key) || equal_no_quit (XCAR (car), key)))
        return car;
@@ -1658,24 +1658,24 @@ assoc_no_quit (Lisp_Object key, Lisp_Object list)
 }
 
 DEFUN ("rassq", Frassq, Srassq, 2, 2, 0,
-       doc: /* Return non-nil if KEY is `eq' to the cdr of an element of LIST.
-The value is actually the first element of LIST whose cdr is KEY.  */)
-  (Lisp_Object key, Lisp_Object list)
+       doc: /* Return non-nil if KEY is `eq' to the cdr of an element of ALIST.
+The value is actually the first element of ALIST whose cdr is KEY.  */)
+  (Lisp_Object key, Lisp_Object alist)
 {
-  Lisp_Object tail = list;
+  Lisp_Object tail = alist;
   FOR_EACH_TAIL (tail)
     if (CONSP (XCAR (tail)) && EQ (XCDR (XCAR (tail)), key))
       return XCAR (tail);
-  CHECK_LIST_END (tail, list);
+  CHECK_LIST_END (tail, alist);
   return Qnil;
 }
 
 DEFUN ("rassoc", Frassoc, Srassoc, 2, 2, 0,
-       doc: /* Return non-nil if KEY is `equal' to the cdr of an element of 
LIST.
-The value is actually the first element of LIST whose cdr equals KEY.  */)
-  (Lisp_Object key, Lisp_Object list)
+       doc: /* Return non-nil if KEY is `equal' to the cdr of an element of 
ALIST.
+The value is actually the first element of ALIST whose cdr equals KEY.  */)
+  (Lisp_Object key, Lisp_Object alist)
 {
-  Lisp_Object tail = list;
+  Lisp_Object tail = alist;
   FOR_EACH_TAIL (tail)
     {
       Lisp_Object car = XCAR (tail);
@@ -1683,7 +1683,7 @@ The value is actually the first element of LIST whose cdr 
equals KEY.  */)
          && (EQ (XCDR (car), key) || !NILP (Fequal (XCDR (car), key))))
        return car;
     }
-  CHECK_LIST_END (tail, list);
+  CHECK_LIST_END (tail, alist);
   return Qnil;
 }
 
diff --git a/src/nsterm.m b/src/nsterm.m
index a8f7540..1953138 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7335,48 +7335,39 @@ not_in_argv (NSString *arg)
 - (void)viewDidResize:(NSNotification *)notification
 {
   NSRect frame = [self frame];
-  int oldw, oldh, neww, newh;
+  int neww, newh;
 
   if (! FRAME_LIVE_P (emacsframe))
     return;
 
+  NSTRACE ("[EmacsView viewDidResize]");
+
+  neww = (int)NSWidth (frame);
+  newh = (int)NSHeight (frame);
+  NSTRACE_SIZE ("New size", NSMakeSize (neww, newh));
+
 #ifdef NS_DRAW_TO_BUFFER
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
   if ([self wantsUpdateLayer])
     {
-#endif
       CGFloat scale = [[self window] backingScaleFactor];
-      oldw = (CGFloat)CGBitmapContextGetWidth (drawingBuffer) / scale;
-      oldh = (CGFloat)CGBitmapContextGetHeight (drawingBuffer) / scale;
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
-    }
-  else
-    {
-#endif
-#endif /* NS_DRAW_TO_BUFFER */
-#if !defined (NS_DRAW_TO_BUFFER) || MAC_OS_X_VERSION_MIN_REQUIRED < 101400
-      oldw = FRAME_PIXEL_WIDTH (emacsframe);
-      oldh = FRAME_PIXEL_HEIGHT (emacsframe);
-#endif
-#if defined (NS_DRAW_TO_BUFFER) && MAC_OS_X_VERSION_MIN_REQUIRED < 101400
-    }
-#endif
-
-  neww = (int)NSWidth (frame);
-  newh = (int)NSHeight (frame);
+      int oldw = (CGFloat)CGBitmapContextGetWidth (drawingBuffer) / scale;
+      int oldh = (CGFloat)CGBitmapContextGetHeight (drawingBuffer) / scale;
 
-  NSTRACE ("[EmacsView viewDidResize]");
+      NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh));
 
-  /* Don't want to do anything when the view size hasn't changed. */
-  if ((oldh == newh && oldw == neww))
-    {
-      NSTRACE_MSG ("No change");
-      return;
+      /* Don't want to do anything when the view size hasn't changed. */
+      if ((oldh == newh && oldw == neww))
+        {
+          NSTRACE_MSG ("No change");
+          return;
+        }
     }
+#endif
 
-  NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh));
-  NSTRACE_SIZE ("New size", NSMakeSize (neww, newh));
-
+  /* I'm not sure if it's safe to call this every time the view
+     changes size, as Emacs may already know about the change.
+     Unfortunately there doesn't seem to be a bullet-proof method of
+     determining whether we need to call it or not.  */
   change_frame_size (emacsframe,
                      FRAME_PIXEL_TO_TEXT_WIDTH (emacsframe, neww),
                      FRAME_PIXEL_TO_TEXT_HEIGHT (emacsframe, newh),
diff --git a/src/search.c b/src/search.c
index 567270a..ec076c1 100644
--- a/src/search.c
+++ b/src/search.c
@@ -353,8 +353,8 @@ data if you want to preserve them.  */)
 }
 
 DEFUN ("posix-looking-at", Fposix_looking_at, Sposix_looking_at, 1, 1, 0,
-       doc: /* Return t if text after point matches regular expression REGEXP.
-Find the longest match, in accord with Posix regular expression rules.
+       doc: /* Return t if text after point matches REGEXP according to Posix 
rules.
+Find the longest match, in accordance with Posix regular expression rules.
 This function modifies the match data that `match-beginning',
 `match-end' and `match-data' access; save and restore the match
 data if you want to preserve them.  */)
@@ -449,7 +449,7 @@ matched by the parenthesis constructions in REGEXP. */)
 }
 
 DEFUN ("posix-string-match", Fposix_string_match, Sposix_string_match, 2, 3, 0,
-       doc: /* Return index of start of first match for REGEXP in STRING, or 
nil.
+       doc: /* Return index of start of first match for Posix REGEXP in 
STRING, or nil.
 Find the longest match, in accord with Posix regular expression rules.
 Case is ignored if `case-fold-search' is non-nil in the current buffer.
 If third arg START is non-nil, start search at that index in STRING.
@@ -2276,7 +2276,7 @@ and `replace-match'.  */)
 
 DEFUN ("posix-search-backward", Fposix_search_backward, 
Sposix_search_backward, 1, 4,
        "sPosix search backward: ",
-       doc: /* Search backward from point for match for regular expression 
REGEXP.
+       doc: /* Search backward from point for match for REGEXP according to 
Posix rules.
 Find the longest match in accord with Posix regular expression rules.
 Set point to the beginning of the occurrence found, and return point.
 An optional second argument bounds the search; it is a buffer position.
@@ -2304,7 +2304,7 @@ and `replace-match'.  */)
 
 DEFUN ("posix-search-forward", Fposix_search_forward, Sposix_search_forward, 
1, 4,
        "sPosix search: ",
-       doc: /* Search forward from point for regular expression REGEXP.
+       doc: /* Search forward from point for REGEXP according to Posix rules.
 Find the longest match in accord with Posix regular expression rules.
 Set point to the end of the occurrence found, and return point.
 An optional second argument bounds the search; it is a buffer position.
diff --git a/src/systhread.h b/src/systhread.h
index 005388f..73c764a 100644
--- a/src/systhread.h
+++ b/src/systhread.h
@@ -21,12 +21,6 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 
 #include <stdbool.h>
 
-#if __has_attribute (warn_unused_result)
-# define ATTRIBUTE_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
-#else
-# define ATTRIBUTE_WARN_UNUSED_RESULT
-#endif
-
 #ifdef THREADS_ENABLED
 
 #ifdef HAVE_PTHREAD
@@ -108,13 +102,13 @@ extern void sys_cond_broadcast (sys_cond_t *);
 extern void sys_cond_destroy (sys_cond_t *);
 
 extern sys_thread_t sys_thread_self (void)
-  ATTRIBUTE_WARN_UNUSED_RESULT;
+  NODISCARD;
 extern bool sys_thread_equal (sys_thread_t, sys_thread_t)
-  ATTRIBUTE_WARN_UNUSED_RESULT;
+  NODISCARD;
 
 extern bool sys_thread_create (sys_thread_t *, thread_creation_function *,
                                void *)
-  ATTRIBUTE_WARN_UNUSED_RESULT;
+  NODISCARD;
 
 extern void sys_thread_yield (void);
 extern void sys_thread_set_name (const char *);
diff --git a/test/lisp/calendar/iso8601-tests.el 
b/test/lisp/calendar/iso8601-tests.el
index e8b155a..c835f57 100644
--- a/test/lisp/calendar/iso8601-tests.el
+++ b/test/lisp/calendar/iso8601-tests.el
@@ -232,6 +232,37 @@
   (should (equal (iso8601-parse-time "15:27:46-05")
                  '(46 27 15 nil nil nil nil nil -18000))))
 
+
+(defun test-iso8601-format-time-string-zone-round-trip (offset-minutes 
z-format)
+  "Pass OFFSET-MINUTES to format-time-string with Z-FORMAT, a %z variation,
+and then to iso8601-parse-zone.  The result should be the original offset."
+  (let* ((offset-seconds (* 60 offset-minutes))
+         (zone-string (format-time-string z-format 0 offset-seconds))
+         (offset-rt
+          (condition-case nil
+              (iso8601-parse-zone zone-string)
+            (wrong-type-argument (format "(failed to parse %S)" zone-string))))
+         ;; compare strings that contain enough info to debug failures
+         (success (format "%s(%s) -> %S -> %s"
+                          z-format offset-minutes zone-string offset-minutes))
+         (actual (format "%s(%s) -> %S -> %s"
+                         z-format offset-minutes zone-string offset-rt)))
+    (should (equal success actual))))
+
+(ert-deftest iso8601-format-time-string-zone-round-trip ()
+  "Round trip zone offsets through format-time-string and iso8601-parse-zone.
+Passing a time zone created by format-time-string %z to
+iso8601-parse-zone should yield the original offset."
+  (dolist (offset-minutes
+           (list
+            ;; compare hours (1- and 2-digit), minutes, both, neither
+            (* 5 60) (* 11 60) 5 11 (+ (* 5 60) 30) (+ (* 11 60) 30) 0
+            ;; do negative values, too
+            (* -5 60) (* -11 60) -5 -11 (- (* -5 60) 30) (- (* -11 60) 30)))
+    (dolist (z-format '("%z" "%:z" "%:::z"))
+      (test-iso8601-format-time-string-zone-round-trip
+       offset-minutes z-format))))
+
 (ert-deftest standard-test-date-and-time-of-day ()
   (should (equal (iso8601-parse "19850412T101530")
                  '(30 15 10 12 4 1985 nil -1 nil)))
diff --git a/test/lisp/comint-tests.el b/test/lisp/comint-tests.el
index 9c27a92..132fe87 100644
--- a/test/lisp/comint-tests.el
+++ b/test/lisp/comint-tests.el
@@ -1,4 +1,4 @@
-;;; comint-testsuite.el
+;;; comint-tests.el  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/custom-resources/custom--test-theme.el 
b/test/lisp/custom-resources/custom--test-theme.el
index da9121e..4ced98a 100644
--- a/test/lisp/custom-resources/custom--test-theme.el
+++ b/test/lisp/custom-resources/custom--test-theme.el
@@ -1,3 +1,5 @@
+;;; custom--test-theme.el -- A test theme.  -*- lexical-binding:t -*-
+
 (deftheme custom--test
   "A test theme.")
 
diff --git a/test/lisp/dabbrev-tests.el b/test/lisp/dabbrev-tests.el
index 0a2f67e..06c5c06 100644
--- a/test/lisp/dabbrev-tests.el
+++ b/test/lisp/dabbrev-tests.el
@@ -1,4 +1,4 @@
-;;; dabbrev-tests.el --- Test suite for dabbrev.
+;;; dabbrev-tests.el --- Test suite for dabbrev.  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/dom-tests.el b/test/lisp/dom-tests.el
index d44851e..f743df7 100644
--- a/test/lisp/dom-tests.el
+++ b/test/lisp/dom-tests.el
@@ -84,6 +84,13 @@
     (dom-set-attribute dom attr value)
     (should (equal (dom-attr dom attr) value))))
 
+(ert-deftest dom-tests-remove-attribute ()
+  (let ((dom (copy-tree '(body ((foo . "bar") (zot . "foobar"))))))
+    (should (equal (dom-attr dom 'foo) "bar"))
+    (dom-remove-attribute dom 'foo)
+    (should (equal (dom-attr dom 'foo) nil))
+    (should (equal dom '(body ((zot . "foobar")))))))
+
 (ert-deftest dom-tests-attr ()
   (let ((dom (dom-tests--tree)))
     (should-not (dom-attr dom 'id))
diff --git a/test/lisp/emacs-lisp/check-declare-tests.el 
b/test/lisp/emacs-lisp/check-declare-tests.el
new file mode 100644
index 0000000..bb95421
--- /dev/null
+++ b/test/lisp/emacs-lisp/check-declare-tests.el
@@ -0,0 +1,116 @@
+;;; check-declare-tests.el --- Tests for check-declare.el  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2020 Free Software Foundation, Inc.
+
+;; Author: Simen Heggestøyl <address@hidden>
+;; Keywords:
+
+;; This file is part of GNU Emacs.
+
+;; 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/>.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+
+(require 'check-declare)
+(require 'ert)
+(eval-when-compile (require 'subr-x))
+
+(ert-deftest check-declare-tests-locate ()
+  (should (file-exists-p (check-declare-locate "check-declare" "")))
+  (should
+   (string-prefix-p "ext:" (check-declare-locate "ext:foo" ""))))
+
+(ert-deftest check-declare-tests-scan ()
+  (let ((file (make-temp-file "check-declare-tests-")))
+    (unwind-protect
+        (progn
+          (with-temp-file file
+            (insert
+             (string-join
+              '(";; foo comment"
+                "(declare-function ring-insert \"ring\" (ring item))"
+                "(let ((foo 'code)) foo)")
+              "\n")))
+          (let ((res (check-declare-scan file)))
+            (should (= (length res) 1))
+            (pcase-let ((`((,fnfile ,fn ,arglist ,fileonly)) res))
+              (should (string-match-p "ring" fnfile))
+              (should (equal "ring-insert" fn))
+              (should (equal '(ring item) arglist))
+              (should-not fileonly))))
+      (delete-file file))))
+
+(ert-deftest check-declare-tests-verify ()
+  (let ((file (make-temp-file "check-declare-tests-")))
+    (unwind-protect
+        (progn
+          (with-temp-file file
+            (insert
+             (string-join
+              '(";; foo comment"
+                "(defun foo-fun ())"
+                "(defun ring-insert (ring item)"
+                "\"Insert onto ring RING the item ITEM.\""
+                "nil)")
+              "\n")))
+          (should-not
+           (check-declare-verify
+            file '(("foo.el" "ring-insert" (ring item))))))
+      (delete-file file))))
+
+(ert-deftest check-declare-tests-verify-mismatch ()
+  (let ((file (make-temp-file "check-declare-tests-")))
+    (unwind-protect
+        (progn
+          (with-temp-file file
+            (insert
+             (string-join
+              '(";; foo comment"
+                "(defun foo-fun ())"
+                "(defun ring-insert (ring)"
+                "\"Insert onto ring RING the item ITEM.\""
+                "nil)")
+              "\n")))
+          (should
+           (equal
+            (check-declare-verify
+             file '(("foo.el" "ring-insert" (ring item))))
+            '(("foo.el" "ring-insert" "arglist mismatch")))))
+      (delete-file file))))
+
+(ert-deftest check-declare-tests-sort ()
+  (should-not (check-declare-sort '()))
+  (should (equal (check-declare-sort '((a (1 a)) (b (2)) (d (1 d))))
+                 '((2 (b)) (1 (a a) (d d))))))
+
+(ert-deftest check-declare-tests-warn ()
+  (with-temp-buffer
+    (let ((check-declare-warning-buffer (buffer-name)))
+      (check-declare-warn
+       "foo-file" "foo-fun" "bar-file" "it wasn't" 999)
+      (let ((res (buffer-string)))
+        ;; Don't care too much about the format of the output, but
+        ;; check that key information is present.
+        (should (string-match-p "foo-file" res))
+        (should (string-match-p "foo-fun" res))
+        (should (string-match-p "bar-file" res))
+        (should (string-match-p "it wasn't" res))
+        (should (string-match-p "999" res))))))
+
+(provide 'check-declare-tests)
+;;; check-declare-tests.el ends here
diff --git a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el 
b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
index 60e49ab..7be057d 100644
--- a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
+++ b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
@@ -1,4 +1,4 @@
-;;; edebug-test-code.el --- Sample code for the Edebug test suite
+;;; edebug-test-code.el --- Sample code for the Edebug test suite  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el 
b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
index b3e296d..73c3ea8 100644
--- a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
+++ b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
@@ -1,4 +1,4 @@
-;;; eieio-testsinvoke.el -- eieio tests for method invocation
+;;; eieio-testsinvoke.el -- eieio tests for method invocation  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2005, 2008, 2010, 2013-2020 Free Software Foundation,
 ;; Inc.
@@ -83,36 +83,36 @@
 (defclass eitest-B-base2 () ())
 (defclass eitest-B (eitest-B-base1 eitest-B-base2) ())
 
-(defmethod eitest-F :BEFORE ((p eitest-B-base1))
+(defmethod eitest-F :BEFORE ((_p eitest-B-base1))
   (eieio-test-method-store :BEFORE 'eitest-B-base1))
 
-(defmethod eitest-F :BEFORE ((p eitest-B-base2))
+(defmethod eitest-F :BEFORE ((_p eitest-B-base2))
   (eieio-test-method-store :BEFORE 'eitest-B-base2))
 
-(defmethod eitest-F :BEFORE ((p eitest-B))
+(defmethod eitest-F :BEFORE ((_p eitest-B))
   (eieio-test-method-store :BEFORE 'eitest-B))
 
-(defmethod eitest-F ((p eitest-B))
+(defmethod eitest-F ((_p eitest-B))
   (eieio-test-method-store :PRIMARY 'eitest-B)
   (call-next-method))
 
-(defmethod eitest-F ((p eitest-B-base1))
+(defmethod eitest-F ((_p eitest-B-base1))
   (eieio-test-method-store :PRIMARY 'eitest-B-base1)
   (call-next-method))
 
-(defmethod eitest-F ((p eitest-B-base2))
+(defmethod eitest-F ((_p eitest-B-base2))
   (eieio-test-method-store :PRIMARY 'eitest-B-base2)
   (when (next-method-p)
     (call-next-method))
   )
 
-(defmethod eitest-F :AFTER ((p eitest-B-base1))
+(defmethod eitest-F :AFTER ((_p eitest-B-base1))
   (eieio-test-method-store :AFTER 'eitest-B-base1))
 
-(defmethod eitest-F :AFTER ((p eitest-B-base2))
+(defmethod eitest-F :AFTER ((_p eitest-B-base2))
   (eieio-test-method-store :AFTER 'eitest-B-base2))
 
-(defmethod eitest-F :AFTER ((p eitest-B))
+(defmethod eitest-F :AFTER ((_p eitest-B))
   (eieio-test-method-store :AFTER 'eitest-B))
 
 (ert-deftest eieio-test-method-order-list-3 ()
@@ -136,7 +136,7 @@
 
 ;;; Test static invocation
 ;;
-(defmethod eitest-H :STATIC ((class eitest-A))
+(defmethod eitest-H :STATIC ((_class eitest-A))
   "No need to do work in here."
   'moose)
 
@@ -147,15 +147,15 @@
 
 ;;; Return value from :PRIMARY
 ;;
-(defmethod eitest-I :BEFORE ((a eitest-A))
+(defmethod eitest-I :BEFORE ((_a eitest-A))
   (eieio-test-method-store :BEFORE 'eitest-A)
   ":before")
 
-(defmethod eitest-I :PRIMARY ((a eitest-A))
+(defmethod eitest-I :PRIMARY ((_a eitest-A))
   (eieio-test-method-store :PRIMARY 'eitest-A)
   ":primary")
 
-(defmethod eitest-I :AFTER ((a eitest-A))
+(defmethod eitest-I :AFTER ((_a eitest-A))
   (eieio-test-method-store :AFTER 'eitest-A)
   ":after")
 
@@ -174,17 +174,17 @@
 (defclass C (C-base1 C-base2) ())
 
 ;; Just use the obsolete name once, to make sure it also works.
-(defmethod constructor :STATIC ((p C-base1) &rest args)
+(defmethod constructor :STATIC ((_p C-base1) &rest _args)
   (eieio-test-method-store :STATIC 'C-base1)
   (if (next-method-p) (call-next-method))
   )
 
-(defmethod make-instance :STATIC ((p C-base2) &rest args)
+(defmethod make-instance :STATIC ((_p C-base2) &rest _args)
   (eieio-test-method-store :STATIC 'C-base2)
   (if (next-method-p) (call-next-method))
   )
 
-(cl-defmethod make-instance ((p (subclass C)) &rest args)
+(cl-defmethod make-instance ((_p (subclass C)) &rest _args)
   (eieio-test-method-store :STATIC 'C)
   (cl-call-next-method)
   )
@@ -213,24 +213,24 @@
 (defclass D-base2 (D-base0) () :method-invocation-order :depth-first)
 (defclass D (D-base1 D-base2) () :method-invocation-order :depth-first)
 
-(defmethod eitest-F ((p D))
+(defmethod eitest-F ((_p D))
   "D"
   (eieio-test-method-store :PRIMARY 'D)
   (call-next-method))
 
-(defmethod eitest-F ((p D-base0))
+(defmethod eitest-F ((_p D-base0))
   "D-base0"
   (eieio-test-method-store :PRIMARY 'D-base0)
   ;; This should have no next
   ;; (when (next-method-p) (call-next-method))
   )
 
-(defmethod eitest-F ((p D-base1))
+(defmethod eitest-F ((_p D-base1))
   "D-base1"
   (eieio-test-method-store :PRIMARY 'D-base1)
   (call-next-method))
 
-(defmethod eitest-F ((p D-base2))
+(defmethod eitest-F ((_p D-base2))
   "D-base2"
   (eieio-test-method-store :PRIMARY 'D-base2)
   (when (next-method-p)
@@ -256,21 +256,21 @@
 (defclass E-base2 (E-base0) () :method-invocation-order :breadth-first)
 (defclass E (E-base1 E-base2) () :method-invocation-order :breadth-first)
 
-(defmethod eitest-F ((p E))
+(defmethod eitest-F ((_p E))
   (eieio-test-method-store :PRIMARY 'E)
   (call-next-method))
 
-(defmethod eitest-F ((p E-base0))
+(defmethod eitest-F ((_p E-base0))
   (eieio-test-method-store :PRIMARY 'E-base0)
   ;; This should have no next
   ;; (when (next-method-p) (call-next-method))
   )
 
-(defmethod eitest-F ((p E-base1))
+(defmethod eitest-F ((_p E-base1))
   (eieio-test-method-store :PRIMARY 'E-base1)
   (call-next-method))
 
-(defmethod eitest-F ((p E-base2))
+(defmethod eitest-F ((_p E-base2))
   (eieio-test-method-store :PRIMARY 'E-base2)
   (when (next-method-p)
     (call-next-method))
@@ -293,7 +293,7 @@
 (defclass eitest-Ja ()
   ())
 
-(defmethod initialize-instance :after ((this eitest-Ja) &rest slots)
+(defmethod initialize-instance :after ((_this eitest-Ja) &rest _slots)
   ;(message "+Ja")
   ;; FIXME: Using next-method-p in an after-method is invalid!
   (when (next-method-p)
@@ -304,7 +304,7 @@
 (defclass eitest-Jb ()
   ())
 
-(defmethod initialize-instance :after ((this eitest-Jb) &rest slots)
+(defmethod initialize-instance :after ((_this eitest-Jb) &rest _slots)
   ;(message "+Jb")
   ;; FIXME: Using next-method-p in an after-method is invalid!
   (when (next-method-p)
@@ -318,7 +318,7 @@
 (defclass eitest-Jd (eitest-Jc eitest-Ja)
   ())
 
-(defmethod initialize-instance ((this eitest-Jd) &rest slots)
+(defmethod initialize-instance ((_this eitest-Jd) &rest _slots)
   ;(message "+Jd")
   (when (next-method-p)
     (call-next-method))
@@ -357,7 +357,7 @@
     (call-next-method
      this (cons 'CNM-1-1 args))))
 
-(defmethod CNM-M ((this CNM-1-2) args)
+(defmethod CNM-M ((_this CNM-1-2) args)
   (push (cons 'CNM-1-2 (copy-sequence args))
        eieio-test-call-next-method-arguments)
   (when (next-method-p)
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el 
b/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el
index 3c5aeaf..6979da8 100644
--- a/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el
+++ b/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el
@@ -1,4 +1,4 @@
-;;; eieio-test-persist.el --- Tests for eieio-persistent class
+;;; eieio-test-persist.el --- Tests for eieio-persistent class  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el 
b/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el
index 3017b52..4bad360 100644
--- a/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el
+++ b/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el
@@ -1,4 +1,4 @@
-;;; faceup-test-mode.el --- Dummy major mode for testing `faceup'.
+;;; faceup-test-mode.el --- Dummy major mode for testing `faceup'.  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
 
diff --git 
a/test/lisp/emacs-lisp/faceup-resources/faceup-test-this-file-directory.el 
b/test/lisp/emacs-lisp/faceup-resources/faceup-test-this-file-directory.el
index ab638ef..d8ab02b 100644
--- a/test/lisp/emacs-lisp/faceup-resources/faceup-test-this-file-directory.el
+++ b/test/lisp/emacs-lisp/faceup-resources/faceup-test-this-file-directory.el
@@ -1,4 +1,4 @@
-;;; faceup-test-this-file-directory.el --- Support file for faceup tests
+;;; faceup-test-this-file-directory.el --- Support file for faceup tests  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/emacs-lisp/faceup-tests/faceup-test-basics.el 
b/test/lisp/emacs-lisp/faceup-tests/faceup-test-basics.el
index 0838981..3c9ec76 100644
--- a/test/lisp/emacs-lisp/faceup-tests/faceup-test-basics.el
+++ b/test/lisp/emacs-lisp/faceup-tests/faceup-test-basics.el
@@ -1,4 +1,4 @@
-;;; faceup-test-basics.el --- Tests for the `faceup' package.
+;;; faceup-test-basics.el --- Tests for the `faceup' package.  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/emacs-lisp/faceup-tests/faceup-test-files.el 
b/test/lisp/emacs-lisp/faceup-tests/faceup-test-files.el
index 4f5fe18..a87c16d 100644
--- a/test/lisp/emacs-lisp/faceup-tests/faceup-test-files.el
+++ b/test/lisp/emacs-lisp/faceup-tests/faceup-test-files.el
@@ -1,4 +1,4 @@
-;;; faceup-test-files.el --- Self test of `faceup' using dummy major mode.
+;;; faceup-test-files.el --- Self test of `faceup' using dummy major mode.  
-*- lexical-binding:t -*-
 
 ;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
 
diff --git 
a/test/lisp/emacs-lisp/package-resources/newer-versions/new-pkg-1.0.el 
b/test/lisp/emacs-lisp/package-resources/newer-versions/new-pkg-1.0.el
index 7251622..61c1b04 100644
--- a/test/lisp/emacs-lisp/package-resources/newer-versions/new-pkg-1.0.el
+++ b/test/lisp/emacs-lisp/package-resources/newer-versions/new-pkg-1.0.el
@@ -1,4 +1,4 @@
-;;; new-pkg.el --- A package only seen after "updating" archive-contents
+;;; new-pkg.el --- A package only seen after "updating" archive-contents  -*- 
lexical-binding:t -*-
 
 ;; Author: J. R. Hacker <address@hidden>
 ;; Version: 1.0
diff --git 
a/test/lisp/emacs-lisp/package-resources/newer-versions/simple-single-1.4.el 
b/test/lisp/emacs-lisp/package-resources/newer-versions/simple-single-1.4.el
index 7b1c00c..301993d 100644
--- a/test/lisp/emacs-lisp/package-resources/newer-versions/simple-single-1.4.el
+++ b/test/lisp/emacs-lisp/package-resources/newer-versions/simple-single-1.4.el
@@ -1,4 +1,4 @@
-;;; simple-single.el --- A single-file package with no dependencies
+;;; simple-single.el --- A single-file package with no dependencies  -*- 
lexical-binding:t -*-
 
 ;; Author: J. R. Hacker <address@hidden>
 ;; Version: 1.4
diff --git a/test/lisp/emacs-lisp/package-resources/simple-depend-1.0.el 
b/test/lisp/emacs-lisp/package-resources/simple-depend-1.0.el
index b58b658..cb00390 100644
--- a/test/lisp/emacs-lisp/package-resources/simple-depend-1.0.el
+++ b/test/lisp/emacs-lisp/package-resources/simple-depend-1.0.el
@@ -1,4 +1,4 @@
-;;; simple-depend.el --- A single-file package with a dependency.
+;;; simple-depend.el --- A single-file package with a dependency.  -*- 
lexical-binding:t -*-
 
 ;; Author: J. R. Hacker <address@hidden>
 ;; Version: 1.0
diff --git a/test/lisp/emacs-lisp/package-resources/simple-single-1.3.el 
b/test/lisp/emacs-lisp/package-resources/simple-single-1.3.el
index 6756a28..9c3f427 100644
--- a/test/lisp/emacs-lisp/package-resources/simple-single-1.3.el
+++ b/test/lisp/emacs-lisp/package-resources/simple-single-1.3.el
@@ -1,4 +1,4 @@
-;;; simple-single.el --- A single-file package with no dependencies
+;;; simple-single.el --- A single-file package with no dependencies  -*- 
lexical-binding:t -*-
 
 ;; Author: J. R. Hacker <address@hidden>
 ;; Version: 1.3
diff --git a/test/lisp/emacs-lisp/package-resources/simple-two-depend-1.1.el 
b/test/lisp/emacs-lisp/package-resources/simple-two-depend-1.1.el
index 9cfe5c0..a0a9607 100644
--- a/test/lisp/emacs-lisp/package-resources/simple-two-depend-1.1.el
+++ b/test/lisp/emacs-lisp/package-resources/simple-two-depend-1.1.el
@@ -1,4 +1,4 @@
-;;; simple-two-depend.el --- A single-file package with two dependencies.
+;;; simple-two-depend.el --- A single-file package with two dependencies.  -*- 
lexical-binding:t -*-
 
 ;; Author: J. R. Hacker <address@hidden>
 ;; Version: 1.1
diff --git a/test/lisp/emacs-lisp/package-tests.el 
b/test/lisp/emacs-lisp/package-tests.el
index 05770d6..c0ed82c 100644
--- a/test/lisp/emacs-lisp/package-tests.el
+++ b/test/lisp/emacs-lisp/package-tests.el
@@ -1,4 +1,4 @@
-;;; package-test.el --- Tests for the Emacs package system
+;;; package-test.el --- Tests for the Emacs package system  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
 
@@ -143,8 +143,8 @@
            ,(if basedir `(cd ,basedir))
            (unless (file-directory-p package-user-dir)
              (mkdir package-user-dir))
-           (cl-letf (((symbol-function 'yes-or-no-p) (lambda (&rest r) t))
-                     ((symbol-function 'y-or-n-p)    (lambda (&rest r) t)))
+           (cl-letf (((symbol-function 'yes-or-no-p) (lambda (&rest _) t))
+                     ((symbol-function 'y-or-n-p)    (lambda (&rest _) t)))
              ,@(when install
                  `((package-initialize)
                    (package-refresh-contents)
@@ -449,7 +449,7 @@ Must called from within a `tar-mode' buffer."
 (ert-deftest package-test-update-archives ()
   "Test updating package archives."
   (with-package-test ()
-    (let ((buf (package-list-packages)))
+    (let ((_buf (package-list-packages)))
       (revert-buffer)
       (search-forward-regexp "^ +simple-single")
       (package-menu-mark-install)
@@ -593,6 +593,7 @@ Must called from within a `tar-mode' buffer."
      (should (search-forward "This is a bare-bones readme file for the 
multi-file"
                              nil t)))))
 
+(defvar epg-config--program-alist) ; Silence byte-compiler.
 (ert-deftest package-test-signed ()
   "Test verifying package signature."
   (skip-unless (let ((homedir (make-temp-file "package-test" t)))
@@ -631,7 +632,7 @@ Must called from within a `tar-mode' buffer."
         (should (progn (package-install 'signed-good) 'noerror))
         (should (progn (package-install 'signed-bad) 'noerror)))
       ;; Check if the installed package status is updated.
-      (let ((buf (package-list-packages)))
+      (let ((_buf (package-list-packages)))
        (revert-buffer)
        (should (re-search-forward
                 "^\\s-+signed-good\\s-+\\(\\S-+\\)\\s-+\\(\\S-+\\)\\s-"
diff --git a/test/lisp/emacs-lisp/shadow-resources/p1/foo.el 
b/test/lisp/emacs-lisp/shadow-resources/p1/foo.el
index 465038b..ffe68f9 100644
--- a/test/lisp/emacs-lisp/shadow-resources/p1/foo.el
+++ b/test/lisp/emacs-lisp/shadow-resources/p1/foo.el
@@ -1 +1 @@
-;;; This file intentionally left blank.
+;;; This file intentionally left blank.  -*- lexical-binding:t -*-
diff --git a/test/lisp/emacs-lisp/shadow-resources/p2/FOO.el 
b/test/lisp/emacs-lisp/shadow-resources/p2/FOO.el
index 465038b..ffe68f9 100644
--- a/test/lisp/emacs-lisp/shadow-resources/p2/FOO.el
+++ b/test/lisp/emacs-lisp/shadow-resources/p2/FOO.el
@@ -1 +1 @@
-;;; This file intentionally left blank.
+;;; This file intentionally left blank.  -*- lexical-binding:t -*-
diff --git a/test/lisp/emulation/viper-tests.el 
b/test/lisp/emulation/viper-tests.el
index 33f85e5..b981938 100644
--- a/test/lisp/emulation/viper-tests.el
+++ b/test/lisp/emulation/viper-tests.el
@@ -1,4 +1,4 @@
-;;; viper-tests.el --- tests for viper.
+;;; viper-tests.el --- tests for viper.  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/erc/erc-track-tests.el b/test/lisp/erc/erc-track-tests.el
index b0ed4bb..7e924c2 100644
--- a/test/lisp/erc/erc-track-tests.el
+++ b/test/lisp/erc/erc-track-tests.el
@@ -1,4 +1,4 @@
-;;; erc-track-tests.el --- Tests for erc-track.
+;;; erc-track-tests.el --- Tests for erc-track.  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/gnus/gnus-tests.el b/test/lisp/gnus/gnus-tests.el
index d18b3fb..fb1b204 100644
--- a/test/lisp/gnus/gnus-tests.el
+++ b/test/lisp/gnus/gnus-tests.el
@@ -1,4 +1,4 @@
-;;; gnus-tests.el --- Wrapper for the Gnus tests
+;;; gnus-tests.el --- Wrapper for the Gnus tests  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/imenu-tests.el b/test/lisp/imenu-tests.el
index 684a856..5dbeb88 100644
--- a/test/lisp/imenu-tests.el
+++ b/test/lisp/imenu-tests.el
@@ -1,4 +1,4 @@
-;;; imenu-tests.el --- Test suite for imenu.
+;;; imenu-tests.el --- Test suite for imenu.  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/info-xref-tests.el b/test/lisp/info-xref-tests.el
index 128b3f2..940aa7d 100644
--- a/test/lisp/info-xref-tests.el
+++ b/test/lisp/info-xref-tests.el
@@ -1,4 +1,4 @@
-;;; info-xref.el --- tests for info-xref.el
+;;; info-xref.el --- tests for info-xref.el  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/jit-lock-tests.el b/test/lisp/jit-lock-tests.el
index 445716c..dfa74cf 100644
--- a/test/lisp/jit-lock-tests.el
+++ b/test/lisp/jit-lock-tests.el
@@ -1,4 +1,4 @@
-;;; jit-lock-tests.el --- tests for jit-lock
+;;; jit-lock-tests.el --- tests for jit-lock  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/json-tests.el b/test/lisp/json-tests.el
index 05837e8..ac9706a 100644
--- a/test/lisp/json-tests.el
+++ b/test/lisp/json-tests.el
@@ -1,4 +1,4 @@
-;;; json-tests.el --- Test suite for json.el
+;;; json-tests.el --- Test suite for json.el  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/mail/qp-tests.el b/test/lisp/mail/qp-tests.el
new file mode 100644
index 0000000..8d70449
--- /dev/null
+++ b/test/lisp/mail/qp-tests.el
@@ -0,0 +1,74 @@
+;;; qp-tests.el --- Tests for qp.el  -*- lexical-binding:t; coding:utf-8 -*-
+
+;; Copyright (C) 2020 Free Software Foundation, Inc.
+
+;; Author: Stefan Kangas <address@hidden>
+
+;; This file is part of GNU Emacs.
+
+;; 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/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'qp)
+
+;; Quote by Antoine de Saint-Exupéry, Citadelle (1948)
+;; from https://en.wikipedia.org/wiki/Quoted-printable
+(defvar qp-tests-quote-qp
+  (concat "J'interdis aux marchands de vanter trop leurs marchandises. Car ils 
se font =\n"
+          "vite p=C3=A9dagogues et t'enseignent comme but ce qui n'est par 
essence qu'=\n"
+          "un moyen, et te trompant ainsi sur la route =C3=A0 suivre les 
voil=C3=A0 bi=\n"
+          "ent=C3=B4t qui te d=C3=A9gradent, car si leur musique est vulgaire 
ils te f=\n"
+          "abriquent pour te la vendre une =C3=A2me vulgaire."))
+(defvar qp-tests-quote-utf8
+  (concat "J'interdis aux marchands de vanter trop leurs marchandises. Car ils 
se font "
+          "vite pédagogues et t'enseignent comme but ce qui n'est par essence 
qu'"
+          "un moyen, et te trompant ainsi sur la route à suivre les voilà bi"
+          "entôt qui te dégradent, car si leur musique est vulgaire ils te f"
+          "abriquent pour te la vendre une âme vulgaire."))
+
+(ert-deftest qp-test--quoted-printable-decode-region ()
+  (with-temp-buffer
+    (insert qp-tests-quote-qp)
+    (encode-coding-region (point-min) (point-max) 'utf-8)
+    (quoted-printable-decode-region (point-min) (point-max) 'utf-8)
+    (should (equal (buffer-string) qp-tests-quote-utf8))))
+
+(ert-deftest qp-test--quoted-printable-decode-string ()
+  (should (equal (quoted-printable-decode-string "foo!") "foo!"))
+    (should (equal (quoted-printable-decode-string "=0C") "\^L"))
+  (should (equal (quoted-printable-decode-string "=3D") "="))
+  (should (equal (quoted-printable-decode-string "=A1Hola, se=F1or!?")
+                 "\241Hola, se\361or!?")))
+
+(ert-deftest qp-test--quoted-printable-encode-region ()
+  (with-temp-buffer
+    (insert (make-string 26 ?=))
+    ;; (encode-coding-region (point-min) (point-max) 'utf-8)
+    (quoted-printable-encode-region (point-min) (point-max) t)
+    (should (equal (buffer-string)
+                   (concat "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"
+                           "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\n=3D")))))
+
+(ert-deftest qp-test--quoted-printable-encode-string ()
+  (should (equal (quoted-printable-encode-string "\241Hola, se\361or!?")
+                 "=A1Hola, se=F1or!?"))
+  ;; Multibyte character.
+  (should-error (quoted-printable-encode-string "å")))
+
+(provide 'qp-tests)
+;;; qp-tests.el ends here
diff --git a/test/lisp/man-tests.el b/test/lisp/man-tests.el
index fba4d74..8267d8e 100644
--- a/test/lisp/man-tests.el
+++ b/test/lisp/man-tests.el
@@ -1,4 +1,4 @@
-;;; man-tests.el --- Test suite for man.
+;;; man-tests.el --- Test suite for man.  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
 
@@ -114,7 +114,7 @@ in the cdr of the element.")
   (dolist (test man-tests-parse-man-k-tests)
     (should (man-tests-parse-man-k-test-case test))))
 
-(defun man-tests-filter-strings (buffer strings)
+(defun man-tests-filter-strings (_buffer strings)
   "Run `Man-bgproc-filter' on each of STRINGS.
 The formatted result will be inserted into BUFFER."
   (let ((proc (start-process "dummy man-tests proc" (current-buffer) "cat")))
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 75a0167..28d20e3 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -4869,65 +4869,71 @@ INPUT, if non-nil, is a string sent to the process."
          (envvar (concat "VAR_" (upcase (md5 (current-time-string)))))
          kill-buffer-query-functions)
 
-      (unwind-protect
-         ;; Set a value.
-         (let ((process-environment
-                (cons (concat envvar "=foo") process-environment)))
-           ;; Default value.
-           (should
-            (string-match
-             "foo"
-             (funcall
-              this-shell-command-to-string
-              (format "echo -n ${%s:-bla}" envvar))))))
-
-      (unwind-protect
-         ;; Set the empty value.
-         (let ((process-environment
-                (cons (concat envvar "=") process-environment)))
-           ;; Value is null.
-           (should
-            (string-match
-             "bla"
-             (funcall
-              this-shell-command-to-string
-              (format "echo -n ${%s:-bla}" envvar))))
-           ;; Variable is set.
-           (should
-            (string-match
-             (regexp-quote envvar)
-             (funcall this-shell-command-to-string "set")))))
+      ;; Check INSIDE_EMACS.
+      (should
+       (string-equal
+       (format "%s,tramp:%s" emacs-version tramp-version)
+       (funcall this-shell-command-to-string "echo -n ${INSIDE_EMACS:-bla}")))
+      (let ((process-environment
+            (cons (format "INSIDE_EMACS=%s,foo" emacs-version)
+                  process-environment)))
+       (should
+        (string-equal
+         (format "%s,foo,tramp:%s" emacs-version tramp-version)
+         (funcall
+          this-shell-command-to-string "echo -n ${INSIDE_EMACS:-bla}"))))
+
+      ;; Set a value.
+      (let ((process-environment
+            (cons (concat envvar "=foo") process-environment)))
+       ;; Default value.
+       (should
+        (string-match
+         "foo"
+         (funcall
+          this-shell-command-to-string (format "echo -n ${%s:-bla}" envvar)))))
+
+      ;; Set the empty value.
+      (let ((process-environment
+            (cons (concat envvar "=") process-environment)))
+       ;; Value is null.
+       (should
+        (string-match
+         "bla"
+         (funcall
+          this-shell-command-to-string (format "echo -n ${%s:-bla}" envvar))))
+       ;; Variable is set.
+       (should
+        (string-match
+         (regexp-quote envvar)
+         (funcall this-shell-command-to-string "set"))))
 
       ;; We force a reconnect, in order to have a clean environment.
       (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
-      (unwind-protect
-         ;; Unset the variable.
-         (let ((tramp-remote-process-environment
-                (cons (concat envvar "=foo")
-                      tramp-remote-process-environment)))
-           ;; Set the initial value, we want to unset below.
-           (should
-            (string-match
-             "foo"
-             (funcall
-              this-shell-command-to-string
-              (format "echo -n ${%s:-bla}" envvar))))
-           (let ((process-environment
-                  (cons envvar process-environment)))
-             ;; Variable is unset.
-             (should
-              (string-match
-               "bla"
-               (funcall
-                this-shell-command-to-string
-                (format "echo -n ${%s:-bla}" envvar))))
-             ;; Variable is unset.
-             (should-not
-              (string-match
-               (regexp-quote envvar)
-               ;; We must remove PS1, the output is truncated otherwise.
-               (funcall
-                this-shell-command-to-string "printenv | grep -v PS1")))))))))
+      ;; Unset the variable.
+      (let ((tramp-remote-process-environment
+            (cons (concat envvar "=foo") tramp-remote-process-environment)))
+       ;; Set the initial value, we want to unset below.
+       (should
+        (string-match
+         "foo"
+         (funcall
+          this-shell-command-to-string (format "echo -n ${%s:-bla}" envvar))))
+       (let ((process-environment (cons envvar process-environment)))
+         ;; Variable is unset.
+         (should
+          (string-match
+           "bla"
+           (funcall
+            this-shell-command-to-string
+            (format "echo -n ${%s:-bla}" envvar))))
+         ;; Variable is unset.
+         (should-not
+          (string-match
+           (regexp-quote envvar)
+           ;; We must remove PS1, the output is truncated otherwise.
+           (funcall
+            this-shell-command-to-string "printenv | grep -v PS1"))))))))
 
 ;; This test is inspired by Bug#27009.
 (ert-deftest tramp-test33-environment-variables-and-port-numbers ()
diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el
index af765fb..f5cff92 100644
--- a/test/lisp/replace-tests.el
+++ b/test/lisp/replace-tests.el
@@ -1,4 +1,4 @@
-;;; replace-tests.el --- tests for replace.el.
+;;; replace-tests.el --- tests for replace.el.  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el
index ed23e06..03c62de 100644
--- a/test/lisp/shadowfile-tests.el
+++ b/test/lisp/shadowfile-tests.el
@@ -1,4 +1,4 @@
-;;; shadowfile-tests.el --- Tests of shadowfile
+;;; shadowfile-tests.el --- Tests of shadowfile  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
 
@@ -138,9 +138,9 @@ guaranteed by the originator of a cluster definition."
        ;; We must mock `read-from-minibuffer' and `read-string', in
        ;; order to avoid interactive arguments.
        (cl-letf* (((symbol-function #'read-from-minibuffer)
-                   (lambda (&rest args) (pop mocked-input)))
+                   (lambda (&rest _args) (pop mocked-input)))
                   ((symbol-function #'read-string)
-                   (lambda (&rest args) (pop mocked-input))))
+                   (lambda (&rest _args) (pop mocked-input))))
 
           ;; Cleanup & initialize.
           (shadow--tests-cleanup)
@@ -255,9 +255,9 @@ guaranteed by the originator of a cluster definition."
        ;; We must mock `read-from-minibuffer' and `read-string', in
        ;; order to avoid interactive arguments.
        (cl-letf* (((symbol-function #'read-from-minibuffer)
-                   (lambda (&rest args) (pop mocked-input)))
+                   (lambda (&rest _args) (pop mocked-input)))
                   ((symbol-function #'read-string)
-                   (lambda (&rest args) (pop mocked-input))))
+                   (lambda (&rest _args) (pop mocked-input))))
 
           ;; Cleanup & initialize.
           (shadow--tests-cleanup)
@@ -608,9 +608,9 @@ guaranteed by the originator of a cluster definition."
        ;; We must mock `read-from-minibuffer' and `read-string', in
        ;; order to avoid interactive arguments.
        (cl-letf* (((symbol-function #'read-from-minibuffer)
-                   (lambda (&rest args) (pop mocked-input)))
+                   (lambda (&rest _args) (pop mocked-input)))
                   ((symbol-function #'read-string)
-                   (lambda (&rest args) (pop mocked-input))))
+                   (lambda (&rest _args) (pop mocked-input))))
 
           ;; Cleanup & initialize.
           (shadow--tests-cleanup)
@@ -669,9 +669,9 @@ guaranteed by the originator of a cluster definition."
        ;; We must mock `read-from-minibuffer' and `read-string', in
        ;; order to avoid interactive arguments.
        (cl-letf* (((symbol-function #'read-from-minibuffer)
-                   (lambda (&rest args) (pop mocked-input)))
+                   (lambda (&rest _args) (pop mocked-input)))
                   ((symbol-function #'read-string)
-                   (lambda (&rest args) (pop mocked-input))))
+                   (lambda (&rest _args) (pop mocked-input))))
 
           ;; Cleanup & initialize.
           (shadow--tests-cleanup)
@@ -923,7 +923,7 @@ guaranteed by the originator of a cluster definition."
          ;; action.
           (add-function
            :before (symbol-function #'write-region)
-          (lambda (&rest args)
+           (lambda (&rest _args)
              (when (and (buffer-file-name) mocked-input)
                (should (equal (buffer-file-name) (pop mocked-input)))))
            '((name . "write-region-mock")))
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index a583d57..e2761a9 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -1,4 +1,4 @@
-;;; subr-tests.el --- Tests for subr.el
+;;; subr-tests.el --- Tests for subr.el  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el
index 4edf75e..f02aeae 100644
--- a/test/lisp/thingatpt-tests.el
+++ b/test/lisp/thingatpt-tests.el
@@ -1,4 +1,4 @@
-;;; thingatpt.el --- tests for thing-at-point.
+;;; thingatpt.el --- tests for thing-at-point.  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/xml-tests.el b/test/lisp/xml-tests.el
index 895b68f..57e685c 100644
--- a/test/lisp/xml-tests.el
+++ b/test/lisp/xml-tests.el
@@ -1,4 +1,4 @@
-;;; xml-parse-tests.el --- Test suite for XML parsing.
+;;; xml-parse-tests.el --- Test suite for XML parsing.  -*- lexical-binding:t 
-*-
 
 ;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
 



reply via email to

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