emacs-diffs
[Top][All Lists]
Advanced

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

feature/native-comp ab66e61 2/2: Merge remote-tracking branch 'savannah/


From: Andrea Corallo
Subject: feature/native-comp ab66e61 2/2: Merge remote-tracking branch 'savannah/master' into HEAD
Date: Wed, 29 Apr 2020 11:54:57 -0400 (EDT)

branch: feature/native-comp
commit ab66e61b58cd872379e7a9ce301bf0bd17507282
Merge: f8b254d b56401f
Author: Andrea Corallo <address@hidden>
Commit: Andrea Corallo <address@hidden>

    Merge remote-tracking branch 'savannah/master' into HEAD
---
 doc/emacs/custom.texi                              |   2 +-
 doc/emacs/frames.texi                              |  57 +++++++-
 doc/emacs/windows.texi                             |  12 +-
 doc/lispref/objects.texi                           |   3 +-
 etc/NEWS.27                                        |  16 +--
 etc/themes/adwaita-theme.el                        |   2 +-
 etc/themes/deeper-blue-theme.el                    |   2 +-
 etc/themes/dichromacy-theme.el                     |   2 +-
 etc/themes/leuven-theme.el                         |   4 +-
 etc/themes/light-blue-theme.el                     |   2 +-
 etc/themes/manoj-dark-theme.el                     |   2 +-
 etc/themes/misterioso-theme.el                     |   2 +-
 etc/themes/tango-dark-theme.el                     |   2 +-
 etc/themes/tango-theme.el                          |   2 +-
 etc/themes/tsdh-dark-theme.el                      |   2 +-
 etc/themes/tsdh-light-theme.el                     |   2 +-
 etc/themes/wheatgrass-theme.el                     |   2 +-
 etc/themes/whiteboard-theme.el                     |   2 +-
 etc/themes/wombat-theme.el                         |   2 +-
 lisp/dos-vars.el                                   |   6 +-
 lisp/emacs-lisp/bindat.el                          |   2 +-
 lisp/emacs-lisp/float-sup.el                       |   2 +-
 lisp/env.el                                        |   8 +-
 lisp/erc/erc-backend.el                            |   3 +-
 lisp/image-mode.el                                 |  20 ++-
 lisp/isearch.el                                    |   7 +-
 lisp/jit-lock.el                                   |  10 +-
 lisp/mail/rfc2368.el                               |   2 +-
 lisp/net/hmac-md5.el                               |  40 +-----
 lisp/net/puny.el                                   |   2 +-
 lisp/tab-bar.el                                    |  38 ++++--
 lisp/tab-line.el                                   |   6 +-
 lisp/version.el                                    |   2 +-
 src/character.c                                    |  45 ------
 src/character.h                                    |  89 ++++++------
 src/editfns.c                                      |  18 +--
 src/term.c                                         |   2 +-
 test/lisp/calendar/icalendar-tests.el              |  13 +-
 test/lisp/calendar/parse-time-tests.el             |   2 +-
 test/lisp/cedet/semantic-utest-fmt.el              |   4 +-
 test/lisp/cedet/semantic-utest-ia.el               |   7 +-
 test/lisp/cedet/semantic-utest.el                  |  32 ++---
 test/lisp/cedet/srecode-utest-getset.el            |   3 +-
 test/lisp/cedet/srecode-utest-template.el          |   2 +-
 test/lisp/emacs-lisp/bindat-tests.el               |  16 +++
 test/lisp/emacs-lisp/bytecomp-tests.el             |   2 +-
 test/lisp/emacs-lisp/ert-x-tests.el                |   2 +-
 .../float-sup-tests.el}                            |  25 ++--
 test/lisp/emacs-lisp/nadvice-tests.el              |   2 +-
 test/lisp/emacs-lisp/pcase-tests.el                |   2 +-
 test/lisp/emacs-lisp/seq-tests.el                  |  10 +-
 test/lisp/emacs-lisp/subr-x-tests.el               |   2 +-
 test/lisp/emacs-lisp/text-property-search-tests.el |   2 +-
 test/lisp/eshell/em-hist-tests.el                  |   2 +-
 test/lisp/eshell/em-ls-tests.el                    |   2 +-
 test/lisp/eshell/esh-opt-tests.el                  |   2 +-
 test/lisp/mail/rfc2045-tests.el                    |   1 +
 .../mail/{rfc2045-tests.el => rfc2368-tests.el}    |  25 ++--
 test/lisp/net/hmac-md5-tests.el                    |  80 +++++++++++
 test/lisp/net/puny-tests.el                        |  21 +++
 test/lisp/net/tramp-tests.el                       | 152 ++++++++++++++++++---
 test/lisp/progmodes/etags-tests.el                 |   2 +-
 test/lisp/progmodes/f90-tests.el                   |   2 +-
 test/lisp/progmodes/ps-mode-tests.el               |   2 +-
 test/lisp/progmodes/python-tests.el                |  11 +-
 test/lisp/progmodes/ruby-mode-tests.el             |   2 +-
 test/lisp/progmodes/subword-tests.el               |   2 +-
 test/lisp/progmodes/tcl-tests.el                   |   2 +-
 test/lisp/progmodes/xref-tests.el                  |   2 +-
 test/lisp/simple-tests.el                          |  11 +-
 test/lisp/vc/add-log-tests.el                      |  12 +-
 test/lisp/vc/diff-mode-tests.el                    |   2 +
 test/lisp/vc/ediff-ptch-tests.el                   |   2 +-
 test/lisp/vc/smerge-mode-tests.el                  |   2 +
 test/lisp/vc/vc-hg-tests.el                        |   2 +-
 test/lisp/vc/vc-tests.el                           |   2 +-
 .../{vc/smerge-mode-tests.el => version-tests.el}  |  23 ++--
 77 files changed, 576 insertions(+), 338 deletions(-)

diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index e7e8790..406f0c9 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -755,7 +755,7 @@ non-@code{nil} value).  If you set a variable using the 
customization
 buffer, you need not worry about giving it an invalid type: the
 customization buffer usually only allows you to enter meaningful
 values.  When in doubt, use @kbd{C-h v} (@code{describe-variable}) to
-check the variable's documentation string to see kind of value it
+check the variable's documentation string to see what kind of value it
 expects (@pxref{Examining}).
 
 @menu
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index d9373b8..8f448e1 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -1266,7 +1266,7 @@ Note that the Tab Bar is different from the Tab Line 
(@pxref{Tab Line}).
 Whereas tabs on the Tab Line at the top of each window are used to
 switch between buffers, tabs on the Tab Bar at the top of each frame
 are used to switch between window configurations containing several
-windows.
+windows with buffers.
 
 @findex tab-bar-mode
   To toggle the use of tab bars, type @kbd{M-x tab-bar-mode}.  This
@@ -1324,6 +1324,10 @@ current before calling the command that adds a new tab.
 To start a new tab with other buffers, customize the variable
 @code{tab-bar-new-tab-choice}.
 
+@vindex tab-bar-new-tab-to
+  The variable @code{tab-bar-new-tab-to} defines where to place a new tab.
+By default, a new tab is added on the right side of the current tab.
+
   The following commands can be used to delete tabs:
 
 @table @kbd
@@ -1331,7 +1335,8 @@ To start a new tab with other buffers, customize the 
variable
 @kindex C-x t 0
 @findex tab-close
 Close the selected tab (@code{tab-close}).  It has no effect if there
-is only one tab.
+is only one tab, unless the variable @code{tab-bar-close-last-tab-choice}
+is customized to a non-default value.
 
 @item C-x t 1
 @kindex C-x t 1
@@ -1339,6 +1344,14 @@ is only one tab.
 Close all tabs on the selected frame, except the selected one.
 @end table
 
+@vindex tab-bar-close-tab-select
+  The variable @code{tab-bar-close-tab-select} defines what tab to
+select after closing the current tab.  By default, it selects
+a recently used tab.
+
+@findex tab-undo
+  The command @code{tab-undo} restores the last closed tab.
+
   The following commands can be used to switch between tabs:
 
 @table @kbd
@@ -1358,22 +1371,60 @@ switches back to the previous Nth tab.
 Switch to the previous tab.  With a positive numeric argument N, it
 switches to the previous Nth tab; with a negative argument −N, it
 switches back to the next Nth tab.
+
+@item C-x t @key{RET} @var{tabname} @key{RET}
+Switch to the tab by its name, with completion on all tab names.
+Default values are tab names sorted by recency, so you can use
+@kbd{M-n} (@code{next-history-element}) to get the name of the last
+visited tab, the second last, and so on.
+
+@item @var{modifier}-@var{tabnumber}
+@findex tab-select
+Switch to the tab by its number.  After customizing the variable
+@code{tab-bar-select-tab-modifiers} to specify a @var{modifier} key, you
+can select a tab by its ordinal number using the specified modifier in
+combination with the tab number to select.  To display the tab number
+alongside the tab name, you can customize another variable
+@code{tab-bar-tab-hints}.  This will help you to decide what key to press
+to select the tab by its number.
+
+@item @var{modifier}-@kbd{0}
+@findex tab-recent
+Switch to the recent tab.  The key combination is the modifier key
+defined by @code{tab-bar-select-tab-modifiers} and the key @kbd{0}.
+With a numeric argument N, switch to the Nth recent tab.
 @end table
 
   The following commands can be used to operate on tabs:
 
 @table @kbd
 @item C-x t r @var{tabname} @key{RET}
+@findex tab-rename
 Rename the current tab to @var{tabname}.  You can control the
 programmatic name given to a tab by default by customizing the
 variable @code{tab-bar-tab-name-function}.
 
 @item C-x t m
+@findex tab-move
 Move the current tab N positions to the right with a positive numeric
-argument N.  With a negative argument −N, it moves the current tab
+argument N.  With a negative argument −N, move the current tab
 N positions to the left.
 @end table
 
+@findex tab-bar-history-mode
+  You can enable @code{tab-bar-history-mode} to remember window
+configurations used in every tab, and restore them.
+
+@table @kbd
+@item tab-bar-history-back
+Restore a previous window configuration used in the current tab.
+This navigates back in the history of window configurations.
+
+@item tab-bar-history-forward
+Cancel restoration of the previous window configuration.
+This navigates forward in the history of window configurations.
+@end table
+
 @node Dialog Boxes
 @section Using Dialog Boxes
 @cindex dialog boxes
diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi
index cb5e9bc..4c67660 100644
--- a/doc/emacs/windows.texi
+++ b/doc/emacs/windows.texi
@@ -628,8 +628,16 @@ Selecting the previous window-local tab is the same as 
typing @kbd{C-x
 same as @kbd{C-x @key{RIGHT}} (@code{next-buffer}).  Both commands
 support a numeric prefix argument as a repeat count.
 
+You can customize the variable @code{tab-line-tabs-function} to define
+the preferred contents of the tab line.  By default, it displays all
+buffers previously visited in the window, as described above.  But you
+can also set it to display a list of buffers with the same major mode
+as the current buffer, or to display buffers grouped by their major
+mode, where clicking on the mode name in the first tab displays a list
+of all major modes where you can select another group of buffers.
+
 Note that the Tab Line is different from the Tab Bar (@pxref{Tab Bars}).
 Whereas tabs on the Tab Bar at the top of each frame are used to
-switch between window configurations containing several windows,
+switch between window configurations containing several windows with buffers,
 tabs on the Tab Line at the top of each window are used to switch
-between buffers.
+between buffers in the window.
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi
index d35a9ac..cd037d6 100644
--- a/doc/lispref/objects.texi
+++ b/doc/lispref/objects.texi
@@ -2406,8 +2406,7 @@ call @code{(make-string 3 ?a)} yields a mutable string 
that can be
 changed via later calls to @code{aset}.
 
   A mutable object can become constant if it is part of an expression
-that is evaluated, because a program should not modify an object
-that is being evaluated.  The reverse does not occur: constant objects
+that is evaluated.  The reverse does not occur: constant objects
 should stay constant.
 
   Trying to modify a constant variable signals an error
diff --git a/etc/NEWS.27 b/etc/NEWS.27
index 1eb391f..42133b8 100644
--- a/etc/NEWS.27
+++ b/etc/NEWS.27
@@ -28,7 +28,7 @@ applies, and please also update docstrings as needed.
 ** Emacs now uses GMP, the GNU Multiple Precision library.
 By default, if 'configure' does not find a suitable libgmp, it
 arranges for the included mini-gmp library to be built and used.
-The new 'configure' option '--without-libgmp' uses mini-gmp even if a
+The new configure option '--without-libgmp' uses mini-gmp even if a
 suitable libgmp is available.
 
 ---
@@ -132,7 +132,7 @@ can enable it when configuring, e.g., './configure 
CFLAGS="-g3 -O2
 ** Emacs now normally uses a C pointer type instead of a C integer
 type to implement Lisp_Object, which is the fundamental machine word
 type internal to the Emacs Lisp interpreter.  This change aims to
-catch typos and supports '-fcheck-pointer-bounds'.  The 'configure'
+catch typos and supports '-fcheck-pointer-bounds'.  The configure
 option '--enable-check-lisp-object-type' is therefore no longer as
 useful and so is no longer enabled by default in developer builds,
 to reduce differences between developer and production builds.
@@ -868,7 +868,7 @@ to allow controlling how the conversion to text is done.
 
 +++
 *** The prefix key 's' was changed to 'c' for slicing commands
-to avoid conflicts with image-mode key 's'.  The new key 'c' still
+to avoid conflicts with 'image-mode' key 's'.  The new key 'c' still
 has good mnemonics of "cut", "clip", "crop".
 
 ** Ido
@@ -2090,11 +2090,11 @@ variable for remote shells.  It still defaults to 
"/bin/sh".
 
 +++
 *** New values of 'shell-command-dont-erase-buffer'.
-This option can now have the value 'erase' to force to erase the
+This user option can now have the value 'erase' to force to erase the
 output buffer before execution of the command, even if the output goes
 to the current buffer.  Additional values 'beg-last-out',
 'end-last-out', and 'save-point' control where to put point in the
-output buffer after inserting the shell-command output.
+output buffer after inserting the 'shell-command' output.
 
 ---
 *** The new functions 'shell-command-save-pos-or-erase' and
@@ -3538,9 +3538,9 @@ With a prefix argument, 'image-rotate' now rotates the 
image at point
 By default, the image will resize upon first display and whenever the
 window's dimensions change.  Two user options 'image-auto-resize' and
 'image-auto-resize-on-window-resize' control the resizing behavior
-(including the possibility to disable auto-resizing).  A new key
-prefix 's' contains the commands that can be used to fit the image to
-the window manually.
+(including the possibility to disable auto-resizing).  A new prefix
+key 's' contains the commands that can be used to fit the image to the
+window manually.
 
 ---
 *** Some 'image-mode' variables are now buffer-local.
diff --git a/etc/themes/adwaita-theme.el b/etc/themes/adwaita-theme.el
index dd886ea..67a3b11 100644
--- a/etc/themes/adwaita-theme.el
+++ b/etc/themes/adwaita-theme.el
@@ -1,4 +1,4 @@
-;;; adwaita-theme.el --- Tango-based custom theme for faces
+;;; adwaita-theme.el --- Tango-based custom theme for faces  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
 
diff --git a/etc/themes/deeper-blue-theme.el b/etc/themes/deeper-blue-theme.el
index 58c22e4..2557918 100644
--- a/etc/themes/deeper-blue-theme.el
+++ b/etc/themes/deeper-blue-theme.el
@@ -1,4 +1,4 @@
-;;; deeper-blue-theme.el --- Custom theme for faces
+;;; deeper-blue-theme.el --- Custom theme for faces  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
diff --git a/etc/themes/dichromacy-theme.el b/etc/themes/dichromacy-theme.el
index ac862bc..89b5a4e 100644
--- a/etc/themes/dichromacy-theme.el
+++ b/etc/themes/dichromacy-theme.el
@@ -1,4 +1,4 @@
-;;; dichromacy-theme.el --- color theme suitable for color-blind users
+;;; dichromacy-theme.el --- color theme suitable for color-blind users  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el
index 0d25ab9..c298b53 100644
--- a/etc/themes/leuven-theme.el
+++ b/etc/themes/leuven-theme.el
@@ -1,10 +1,10 @@
-;;; leuven-theme.el --- Awesome Emacs color theme on white background
+;;; leuven-theme.el --- Awesome Emacs color theme on white background  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
 
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; URL: https://github.com/fniessen/emacs-leuven-theme
-;; Version: 20170912.2328
+;; Version: 20200425.0837
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
diff --git a/etc/themes/light-blue-theme.el b/etc/themes/light-blue-theme.el
index b769015..c6d3c92 100644
--- a/etc/themes/light-blue-theme.el
+++ b/etc/themes/light-blue-theme.el
@@ -1,4 +1,4 @@
-;;; light-blue-theme.el --- Custom theme for faces
+;;; light-blue-theme.el --- Custom theme for faces  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
diff --git a/etc/themes/manoj-dark-theme.el b/etc/themes/manoj-dark-theme.el
index 3376066..5c76d6a 100644
--- a/etc/themes/manoj-dark-theme.el
+++ b/etc/themes/manoj-dark-theme.el
@@ -1,4 +1,4 @@
-;;; manoj-dark.el --- A dark theme from Manoj
+;;; manoj-dark.el --- A dark theme from Manoj  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
diff --git a/etc/themes/misterioso-theme.el b/etc/themes/misterioso-theme.el
index df88953..8161dbd 100644
--- a/etc/themes/misterioso-theme.el
+++ b/etc/themes/misterioso-theme.el
@@ -1,4 +1,4 @@
-;;; misterioso-theme.el --- Custom face theme for Emacs
+;;; misterioso-theme.el --- Custom face theme for Emacs  -*- lexical-binding:t 
-*-
 
 ;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
diff --git a/etc/themes/tango-dark-theme.el b/etc/themes/tango-dark-theme.el
index 86cc259..cf1a98b 100644
--- a/etc/themes/tango-dark-theme.el
+++ b/etc/themes/tango-dark-theme.el
@@ -1,4 +1,4 @@
-;;; tango-dark-theme.el --- Tango-based custom theme for faces
+;;; tango-dark-theme.el --- Tango-based custom theme for faces  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
 
diff --git a/etc/themes/tango-theme.el b/etc/themes/tango-theme.el
index ab39bbc..6166657 100644
--- a/etc/themes/tango-theme.el
+++ b/etc/themes/tango-theme.el
@@ -1,4 +1,4 @@
-;;; tango-theme.el --- Tango-based custom theme for faces
+;;; tango-theme.el --- Tango-based custom theme for faces  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
 
diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el
index 515a142..f3c9ced 100644
--- a/etc/themes/tsdh-dark-theme.el
+++ b/etc/themes/tsdh-dark-theme.el
@@ -1,4 +1,4 @@
-;;; tsdh-dark-theme.el --- Tassilo's dark custom theme
+;;; tsdh-dark-theme.el --- Tassilo's dark custom theme  -*- lexical-binding:t 
-*-
 
 ;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
diff --git a/etc/themes/tsdh-light-theme.el b/etc/themes/tsdh-light-theme.el
index eaa65ff..46443ed 100644
--- a/etc/themes/tsdh-light-theme.el
+++ b/etc/themes/tsdh-light-theme.el
@@ -1,4 +1,4 @@
-;;; tsdh-light-theme.el --- Tassilo's light custom theme
+;;; tsdh-light-theme.el --- Tassilo's light custom theme  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
diff --git a/etc/themes/wheatgrass-theme.el b/etc/themes/wheatgrass-theme.el
index c3edced..f1abdb3 100644
--- a/etc/themes/wheatgrass-theme.el
+++ b/etc/themes/wheatgrass-theme.el
@@ -1,4 +1,4 @@
-;;; wheatgrass-theme.el --- custom theme for faces
+;;; wheatgrass-theme.el --- custom theme for faces  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
 
diff --git a/etc/themes/whiteboard-theme.el b/etc/themes/whiteboard-theme.el
index be6c67e..ee42e4f 100644
--- a/etc/themes/whiteboard-theme.el
+++ b/etc/themes/whiteboard-theme.el
@@ -1,4 +1,4 @@
-;;; whiteboard-theme.el --- Custom theme for faces
+;;; whiteboard-theme.el --- Custom theme for faces  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
diff --git a/etc/themes/wombat-theme.el b/etc/themes/wombat-theme.el
index 122d302..4df5f5a 100644
--- a/etc/themes/wombat-theme.el
+++ b/etc/themes/wombat-theme.el
@@ -1,4 +1,4 @@
-;;; wombat-theme.el --- Custom face theme for Emacs
+;;; wombat-theme.el --- Custom face theme for Emacs  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
diff --git a/lisp/dos-vars.el b/lisp/dos-vars.el
index 0f58277..47d1f83 100644
--- a/lisp/dos-vars.el
+++ b/lisp/dos-vars.el
@@ -1,4 +1,4 @@
-;;; dos-vars.el --- MS-Dos specific user options
+;;; dos-vars.el --- MS-Dos specific user options  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
 
@@ -31,15 +31,13 @@
 
 (defcustom msdos-shells '("command.com" "4dos.com" "ndos.com")
   "List of shells that use `/c' instead of `-c' and a backslashed command."
-  :type '(repeat string)
-  :group 'dos-fns)
+  :type '(repeat string))
 
 (defcustom dos-codepage-setup-hook nil
   "List of functions to be called after the DOS terminal and coding
 systems are set up.  This is the place, e.g., to set specific entries
 in `standard-display-table' as appropriate for your codepage, if
 `IT-display-table-setup' doesn't do a perfect job."
-  :group 'dos-fns
   :type '(hook)
   :version "20.3.3")
 
diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el
index b5d99e3..d168c25 100644
--- a/lisp/emacs-lisp/bindat.el
+++ b/lisp/emacs-lisp/bindat.el
@@ -632,7 +632,7 @@ If optional second arg SEP is a string, use that as 
separator."
   (bindat-format-vector vect "%d" (if (stringp sep) sep ".")))
 
 (defun bindat-vector-to-hex (vect &optional sep)
-  "Format vector VECT in hex format separated by dots.
+  "Format vector VECT in hex format separated by colons.
 If optional second arg SEP is a string, use that as separator."
   (bindat-format-vector vect "%02x" (if (stringp sep) sep ":")))
 
diff --git a/lisp/emacs-lisp/float-sup.el b/lisp/emacs-lisp/float-sup.el
index 50b157b..d92ca5b 100644
--- a/lisp/emacs-lisp/float-sup.el
+++ b/lisp/emacs-lisp/float-sup.el
@@ -1,4 +1,4 @@
-;;; float-sup.el --- define some constants useful for floating point numbers.
+;;; float-sup.el --- define some constants useful for floating point numbers.  
-*- lexical-binding:t -*-
 
 ;; Copyright (C) 1985-1987, 2001-2020 Free Software Foundation, Inc.
 
diff --git a/lisp/env.el b/lisp/env.el
index ca2a977..6de9038 100644
--- a/lisp/env.el
+++ b/lisp/env.el
@@ -68,10 +68,10 @@ with a character not a letter, digit or underscore; 
otherwise, enclose
 the entire variable name in braces.  For instance, in `ab$cd-x',
 `$cd' is treated as an environment variable.
 
-If WHEN-DEFINED is nil, references to undefined environment variables
-are replaced by the empty string; if it is a function, the function is called
-with the variable name as argument and should return the text with which
-to replace it or nil to leave it unchanged.
+If WHEN-UNDEFINED is omitted or nil, references to undefined environment
+variables are replaced by the empty string; if it is a function, the
+function is called with the variable's name as argument, and should return
+the text with which to replace it, or nil to leave it unchanged.
 If it is non-nil and not a function, references to undefined variables are
 left unchanged.
 
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 57c8e73..1e2526f 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -466,7 +466,8 @@ If this is set to nil, never try to reconnect."
 The length is specified in `erc-split-line-length'.
 
 Currently this is called by `erc-send-input'."
-  (let ((charset (car (erc-coding-system-for-target nil))))
+  (let* ((coding (erc-coding-system-for-target nil))
+         (charset (if (consp coding) (car coding) coding)))
     (with-temp-buffer
       (insert longline)
       ;; The line lengths are in octets, not characters (because these
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 3ee185a..480b2e6 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -505,16 +505,22 @@ call."
        "--"
        ["Fit Frame to Image" image-mode-fit-frame :active t
         :help "Resize frame to match image"]
+       ["Fit Image to Window (Best Fit)" image-transform-fit-both
+        :help "Resize image to match the window height and width"]
        ["Fit to Window Height" image-transform-fit-to-height
         :help "Resize image to match the window height"]
        ["Fit to Window Width" image-transform-fit-to-width
         :help "Resize image to match the window width"]
-       ["Fit to Window Height and Width" image-transform-fit-both
-        :help "Resize image to match the window height and width"]
+       ["Zoom In" image-increase-size
+        :help "Enlarge the image"]
+       ["Zoom Out" image-decrease-size
+        :help "Shrink the image"]
        ["Set Scale..." image-transform-set-scale
         :help "Resize image by specified scale factor"]
-       ["Rotate Image..." image-transform-set-rotation
+       ["Rotate Clockwise" image-rotate
         :help "Rotate the image"]
+       ["Set Rotation..." image-transform-set-rotation
+        :help "Set rotation angle of the image"]
        ["Reset Transformations" image-transform-reset
         :help "Reset all image transformations"]
        "--"
@@ -524,10 +530,10 @@ call."
           (image-dired default-directory))
         :active default-directory
         :help "Show thumbnails for all images in this directory"]
-       ["Next Image" image-next-file :active buffer-file-name
-         :help "Move to next image in this directory"]
        ["Previous Image" image-previous-file :active buffer-file-name
          :help "Move to previous image in this directory"]
+       ["Next Image" image-next-file :active buffer-file-name
+         :help "Move to next image in this directory"]
        ["Copy File Name" image-mode-copy-file-name-as-kill
          :active buffer-file-name
          :help "Copy the current file name to the kill ring"]
@@ -565,10 +571,10 @@ call."
        ["Reset Animation Speed" image-reset-speed
         :active image-multi-frame
         :help "Reset the speed of this image's animation"]
-       ["Next Frame" image-next-frame :active image-multi-frame
-        :help "Show the next frame of this image"]
        ["Previous Frame" image-previous-frame :active image-multi-frame
         :help "Show the previous frame of this image"]
+       ["Next Frame" image-next-frame :active image-multi-frame
+        :help "Show the next frame of this image"]
        ["Goto Frame..." image-goto-frame :active image-multi-frame
         :help "Show a specific frame of this image"]
        ))
diff --git a/lisp/isearch.el b/lisp/isearch.el
index e13a4dd..81e83d7 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -319,7 +319,7 @@ this variable is set to the symbol `all-windows'."
   "Show match numbers in the search prompt.
 When both this option and `isearch-lazy-highlight' are non-nil,
 show the current match number and the total number of matches
-in the buffer (or its restriction)."
+in the buffer (or its restriction), including all hidden matches."
   :type 'boolean
   :group 'lazy-count
   :group 'isearch
@@ -3869,7 +3869,10 @@ Attempt to do the search exactly the way the pending 
Isearch would."
            (isearch-regexp-lax-whitespace
             isearch-lazy-highlight-regexp-lax-whitespace)
            (isearch-forward isearch-lazy-highlight-forward)
-           (search-invisible nil)      ; don't match invisible text
+           ;; Don't match invisible text unless it can be opened
+           ;; or when counting matches and user can visit hidden matches
+           (search-invisible (or (eq search-invisible 'open)
+                                 (and isearch-lazy-count search-invisible)))
            (retry t)
            (success nil))
        ;; Use a loop like in `isearch-search'.
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index c0c9cac..8b3384a 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -147,9 +147,10 @@ If 0, then fontification is only deferred while there is 
input pending."
 (defvar-local jit-lock-mode nil
   "Non-nil means Just-in-time Lock mode is active.")
 
-(defvar-local jit-lock-functions nil
-  "Functions to do the actual fontification.
-They are called with two arguments: the START and END of the region to 
fontify.")
+(defvar jit-lock-functions nil
+  "Special hook run to do the actual fontification.
+The functions are called with two arguments:
+the START and END of the region to fontify.")
 
 (defvar-local jit-lock-context-unfontify-pos nil
   "Consider text after this position as contextually unfontified.
@@ -341,7 +342,8 @@ If non-nil, CONTEXTUAL means that a contextual 
fontification would be useful."
   "Unregister FUN as a fontification function.
 Only applies to the current buffer."
   (remove-hook 'jit-lock-functions fun t)
-  (unless jit-lock-functions (jit-lock-mode nil)))
+  (when (member jit-lock-functions '(nil '(t)))
+    (jit-lock-mode nil)))
 
 (defun jit-lock-refontify (&optional beg end)
   "Force refontification of the region BEG..END (default whole buffer)."
diff --git a/lisp/mail/rfc2368.el b/lisp/mail/rfc2368.el
index 7b38288..afa3059 100644
--- a/lisp/mail/rfc2368.el
+++ b/lisp/mail/rfc2368.el
@@ -1,4 +1,4 @@
-;;; rfc2368.el --- support for rfc2368
+;;; rfc2368.el --- support for rfc2368  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 1998, 2000-2020 Free Software Foundation, Inc.
 
diff --git a/lisp/net/hmac-md5.el b/lisp/net/hmac-md5.el
index 92efb6b..974ee0d 100644
--- a/lisp/net/hmac-md5.el
+++ b/lisp/net/hmac-md5.el
@@ -1,4 +1,4 @@
-;;; hmac-md5.el --- Compute HMAC-MD5.
+;;; hmac-md5.el --- Compute HMAC-MD5.  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 1999, 2001, 2007-2020 Free Software Foundation, Inc.
 
@@ -22,42 +22,8 @@
 
 ;;; Commentary:
 
-;; Test cases from RFC 2202, "Test Cases for HMAC-MD5 and HMAC-SHA-1".
-;;
-;; (encode-hex-string (hmac-md5 "Hi There" (make-string 16 ?\x0b)))
-;;  => "9294727a3638bb1c13f48ef8158bfc9d"
-;;
-;; (encode-hex-string (hmac-md5 "what do ya want for nothing?" "Jefe"))
-;;  => "750c783e6ab0b503eaa86e310a5db738"
-;;
-;; (encode-hex-string (hmac-md5 (make-string 50 ?\xdd) (make-string 16 ?\xaa)))
-;;  => "56be34521d144c88dbb8c733f0e8b3f6"
-;;
-;; (encode-hex-string
-;;  (hmac-md5
-;;   (make-string 50 ?\xcd)
-;;   (decode-hex-string "0102030405060708090a0b0c0d0e0f10111213141516171819")))
-;;  => "697eaf0aca3a3aea3a75164746ffaa79"
-;;
-;; (encode-hex-string
-;;  (hmac-md5 "Test With Truncation" (make-string 16 ?\x0c)))
-;;  => "56461ef2342edc00f9bab995690efd4c"
-;;
-;; (encode-hex-string
-;;  (hmac-md5-96 "Test With Truncation" (make-string 16 ?\x0c)))
-;;  => "56461ef2342edc00f9bab995"
-;;
-;; (encode-hex-string
-;;  (hmac-md5
-;;   "Test Using Larger Than Block-Size Key - Hash Key First"
-;;   (make-string 80 ?\xaa)))
-;;  => "6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd"
-;;
-;; (encode-hex-string
-;;  (hmac-md5
-;;   "Test Using Larger Than Block-Size Key and Larger Than One Block-Size 
Data"
-;;   (make-string 80 ?\xaa)))
-;;  => "6f630fad67cda0ee1fb1f562db3aa53e"
+;; Test cases from RFC 2202, "Test Cases for HMAC-MD5 and HMAC-SHA-1",
+;; moved to lisp/test/net/hmac-md5-tests.el
 
 ;;; Code:
 
diff --git a/lisp/net/puny.el b/lisp/net/puny.el
index 6987d25..cc40607 100644
--- a/lisp/net/puny.el
+++ b/lisp/net/puny.el
@@ -1,4 +1,4 @@
-;;; puny.el --- translate non-ASCII domain names to ASCII
+;;; puny.el --- translate non-ASCII domain names to ASCII  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
 
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 30ed1a4..ce6d8c3 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -87,10 +87,11 @@
 
 
 (defcustom tab-bar-select-tab-modifiers '()
-  "List of key modifiers for selecting a tab by its index digit.
-Possible modifiers are `control', `meta', `shift', `hyper', `super' and
-`alt'."
-  :type '(set :tag "Tab selection key modifiers"
+  "List of modifier keys for selecting a tab by its index digit.
+Possible modifier keys are `control', `meta', `shift', `hyper', `super' and
+`alt'.  To help you to select a tab by its number, you can customize
+`tab-bar-tab-hints' that will show tab numbers alongside the tab name."
+  :type '(set :tag "Tab selection modifier keys"
               (const control)
               (const meta)
               (const shift)
@@ -310,7 +311,8 @@ If nil, don't show it at all."
 
 (defcustom tab-bar-tab-hints nil
   "Show absolute numbers on tabs in the tab bar before the tab name.
-This helps to select the tab by its number using `tab-bar-select-tab'."
+This helps to select the tab by its number using `tab-bar-select-tab'
+and `tab-bar-select-tab-modifiers'."
   :type 'boolean
   :initialize 'custom-initialize-default
   :set (lambda (sym val)
@@ -563,9 +565,10 @@ Return its existing value or a new value."
 
 (defun tab-bar-select-tab (&optional arg)
   "Switch to the tab by its absolute position ARG in the tab bar.
-When this command is bound to a numeric key (with a prefix or modifier),
-calling it without an argument will translate its bound numeric key
-to the numeric argument.  ARG counts from 1."
+When this command is bound to a numeric key (with a prefix or modifier key
+using `tab-bar-select-tab-modifiers'), calling it without an argument
+will translate its bound numeric key to the numeric argument.
+ARG counts from 1."
   (interactive "P")
   (unless (integerp arg)
     (let ((key (event-basic-type last-command-event)))
@@ -664,7 +667,10 @@ to the numeric argument.  ARG counts from 1."
       (message "No more recent tabs"))))
 
 (defun tab-bar-switch-to-tab (name)
-  "Switch to the tab by NAME."
+  "Switch to the tab by NAME.
+Default values are tab names sorted by recency, so you can use \
+\\<minibuffer-local-map>\\[next-history-element]
+to get the name of the last visited tab, the second last, and so on."
   (interactive
    (let* ((recent-tabs (mapcar (lambda (tab)
                                  (alist-get 'name tab))
@@ -789,7 +795,7 @@ After the tab is created, the hooks in
                         (pcase tab-bar-new-tab-to
                           ('leftmost 0)
                           ('rightmost (length tabs))
-                          ('left (1- (or from-index 1)))
+                          ('left (or from-index 1))
                           ('right (1+ (or from-index 0)))
                           ((pred functionp)
                            (funcall tab-bar-new-tab-to))))))
@@ -920,7 +926,7 @@ for the last tab on a frame is determined by
           ;; Select another tab before deleting the current tab
           (let ((to-index (or (if to-index (1- to-index))
                               (pcase tab-bar-close-tab-select
-                                ('left (1- current-index))
+                                ('left (1- (if (< current-index 1) 2 
current-index)))
                                 ('right (if (> (length tabs) (1+ 
current-index))
                                             (1+ current-index)
                                           (1- current-index)))
@@ -1004,7 +1010,7 @@ for the last tab on a frame is determined by
         (unless (eq frame (selected-frame))
           (select-frame-set-input-focus frame))
 
-        (let ((tabs (tab-bar-tabs)))
+        (let ((tabs (funcall tab-bar-tabs-function)))
           (setq index (max 0 (min index (length tabs))))
           (cl-pushnew tab (nthcdr index tabs))
           (when (eq index 0)
@@ -1102,6 +1108,8 @@ function `tab-bar-tab-name-function'."
     (setq tab-bar-history-omit nil)))
 
 (defun tab-bar-history-back ()
+  "Restore a previous window configuration used in the current tab.
+This navigates back in the history of window configurations."
   (interactive)
   (setq tab-bar-history-omit t)
   (let* ((history (pop (gethash (selected-frame) tab-bar-history-back)))
@@ -1119,6 +1127,8 @@ function `tab-bar-tab-name-function'."
       (message "No more tab back history"))))
 
 (defun tab-bar-history-forward ()
+  "Cancel restoration of the previous window configuration.
+This navigates forward in the history of window configurations."
   (interactive)
   (setq tab-bar-history-omit t)
   (let* ((history (pop (gethash (selected-frame) tab-bar-history-forward)))
@@ -1136,7 +1146,9 @@ function `tab-bar-tab-name-function'."
       (message "No more tab forward history"))))
 
 (define-minor-mode tab-bar-history-mode
-  "Toggle tab history mode for the tab bar."
+  "Toggle tab history mode for the tab bar.
+Tab history mode remembers window configurations used in every tab,
+and can restore them."
   :global t :group 'tab-bar
   (if tab-bar-history-mode
       (progn
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index eb279de..7a2bdc0 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -474,8 +474,12 @@ variable `tab-line-tabs-function'."
   "Template for displaying tab line for selected window."
   (let* ((tabs (funcall tab-line-tabs-function))
          (cache-key (list tabs
+                          ;; handle buffer renames
                           (buffer-name (window-buffer))
-                          (window-parameter nil 'tab-line-hscroll)))
+                          ;; handle tab-line scrolling
+                          (window-parameter nil 'tab-line-hscroll)
+                          ;; for setting face 'tab-line-tab-current'
+                          (eq (selected-window) (old-selected-window))))
          (cache (window-parameter nil 'tab-line-cache)))
     ;; Enable auto-hscroll again after it was disabled on manual scrolling.
     ;; The moment to enable it is when the window-buffer was updated.
diff --git a/lisp/version.el b/lisp/version.el
index 012cb21..046b4a2 100644
--- a/lisp/version.el
+++ b/lisp/version.el
@@ -1,4 +1,4 @@
-;;; version.el --- record version number of Emacs
+;;; version.el --- record version number of Emacs  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 1985, 1992, 1994-1995, 1999-2020 Free Software
 ;; Foundation, Inc.
diff --git a/src/character.c b/src/character.c
index edcec5f..4902e56 100644
--- a/src/character.c
+++ b/src/character.c
@@ -141,51 +141,6 @@ char_string (unsigned int c, unsigned char *p)
 }
 
 
-/* Return a character whose multibyte form is at P.  Set *LEN to the
-   byte length of the multibyte form.  */
-
-int
-string_char (const unsigned char *p, int *len)
-{
-  int c;
-  const unsigned char *saved_p = p;
-
-  if (*p < 0x80 || ! (*p & 0x20) || ! (*p & 0x10))
-    {
-      /* 1-, 2-, and 3-byte sequences can be handled by the macro.  */
-      c = string_char_advance (&p);
-    }
-  else if (! (*p & 0x08))
-    {
-      /* A 4-byte sequence of this form:
-        11110xxx 10xxxxxx 10xxxxxx 10xxxxxx  */
-      c = ((((p)[0] & 0x7) << 18)
-          | (((p)[1] & 0x3F) << 12)
-          | (((p)[2] & 0x3F) << 6)
-          | ((p)[3] & 0x3F));
-      p += 4;
-    }
-  else
-    {
-      /* A 5-byte sequence of this form:
-
-        111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
-
-        Note that the top 4 `x's are always 0, so shifting p[1] can
-        never exceed the maximum valid character codepoint. */
-      c = (/* (((p)[0] & 0x3) << 24) ... always 0, so no need to shift. */
-          (((p)[1] & 0x3F) << 18)
-          | (((p)[2] & 0x3F) << 12)
-          | (((p)[3] & 0x3F) << 6)
-          | ((p)[4] & 0x3F));
-      p += 5;
-    }
-
-  *len = p - saved_p;
-  return c;
-}
-
-
 /* Translate character C by translation table TABLE.  If no translation is
    found in TABLE, return the untranslated character.  If TABLE is a list,
    elements are char tables.  In that case, recursively translate C by all the
diff --git a/src/character.h b/src/character.h
index 4887473..af5023f 100644
--- a/src/character.h
+++ b/src/character.h
@@ -85,7 +85,6 @@ enum
 };
 
 extern int char_string (unsigned, unsigned char *);
-extern int string_char (const unsigned char *, int *);
 
 /* UTF-8 encodings.  Use \x escapes, so they are portable to pre-C11
    compilers and can be concatenated with ordinary string literals.  */
@@ -318,30 +317,30 @@ multibyte_length (unsigned char const *p, unsigned char 
const *pend,
        return 1;
       if (!check || p + 1 < pend)
        {
-         /* The 'unsigned int' avoids int overflow in the 5-byte case.  */
-         unsigned int d = p[1];
-
-         if (TRAILING_CODE_P (d))
+         unsigned char d = p[1];
+         int w = ((d & 0xC0) << 2) + c;
+         if ((allow_8bit ? 0x2C0 : 0x2C2) <= w && w <= 0x2DF)
+           return 2;
+         if (!check || p + 2 < pend)
            {
-             if (allow_8bit ? (c & 0xE0) == 0xC0 : 0xC2 <= c && c <= 0xDF)
-               return 2;
-             if ((!check || p + 2 < pend)
-                 && TRAILING_CODE_P (p[2]))
+             unsigned char e = p[2];
+             w += (e & 0xC0) << 4;
+             int w1 = w | ((d & 0x20) >> 2);
+             if (0xAE1 <= w1 && w1 <= 0xAEF)
+               return 3;
+             if (!check || p + 3 < pend)
                {
-                 if ((c & 0xF0) == 0xE0 && ((c & 0x0F) | (d & 0x20)))
-                   return 3;
-                 if ((!check || p + 3 < pend) && TRAILING_CODE_P (p[3]))
+                 unsigned char f = p[3];
+                 w += (f & 0xC0) << 6;
+                 int w2 = w | ((d & 0x30) >> 3);
+                 if (0x2AF1 <= w2 && w2 <= 0x2AF7)
+                   return 4;
+                 if (!check || p + 4 < pend)
                    {
-                     if ((c & 0xF8) == 0xF0 && ((c & 0x07) | (d & 0x30)))
-                       return 4;
-                     if (c == 0xF8 && (!check || p + 4 < pend)
-                         && TRAILING_CODE_P (p[4]))
-                       {
-                         unsigned int w = ((d << 24) + (p[2] << 16)
-                                           + (p[3] << 8) + p[4]);
-                         if (0x88808080 <= w && w <= 0x8FBFBDBF)
-                           return 5;
-                       }
+                     int_fast64_t lw = w + ((p[4] & 0xC0) << 8),
+                       w3 = (lw << 24) + (d << 16) + (e << 8) + f;
+                     if (0xAAF8888080 <= w3 && w3 <= 0xAAF88FBFBD)
+                       return 5;
                    }
                }
            }
@@ -371,33 +370,41 @@ raw_prev_char_len (unsigned char const *p)
 INLINE int
 string_char_and_length (unsigned char const *p, int *length)
 {
-  int c, len;
+  int c = p[0];
+  if (! (c & 0x80))
+    {
+      *length = 1;
+      return c;
+    }
+  eassume (0xC0 <= c);
 
-  if (! (p[0] & 0x80))
+  int d = (c << 6) + p[1] - ((0xC0 << 6) + 0x80);
+  if (! (c & 0x20))
     {
-      len = 1;
-      c = p[0];
+      *length = 2;
+      return d + (c < 0xC2 ? 0x3FFF80 : 0);
     }
-  else if (! (p[0] & 0x20))
+
+  d = (d << 6) + p[2] - ((0x20 << 12) + 0x80);
+  if (! (c & 0x10))
     {
-      len = 2;
-      c = ((((p[0] & 0x1F) << 6)
-           | (p[1] & 0x3F))
-          + (p[0] < 0xC2 ? 0x3FFF80 : 0));
+      *length = 3;
+      eassume (MAX_2_BYTE_CHAR < d && d <= MAX_3_BYTE_CHAR);
+      return d;
     }
-  else if (! (p[0] & 0x10))
+
+  d = (d << 6) + p[3] - ((0x10 << 18) + 0x80);
+  if (! (c & 0x08))
     {
-      len = 3;
-      c = (((p[0] & 0x0F) << 12)
-          | ((p[1] & 0x3F) << 6)
-          | (p[2] & 0x3F));
+      *length = 4;
+      eassume (MAX_3_BYTE_CHAR < d && d <= MAX_4_BYTE_CHAR);
+      return d;
     }
-  else
-    c = string_char (p, &len);
 
-  eassume (0 < len && len <= MAX_MULTIBYTE_LENGTH);
-  *length = len;
-  return c;
+  d = (d << 6) + p[4] - ((0x08 << 24) + 0x80);
+  *length = 5;
+  eassume (MAX_4_BYTE_CHAR < d && d <= MAX_5_BYTE_CHAR);
+  return d;
 }
 
 /* Return the character code of character whose multibyte form is at P.  */
diff --git a/src/editfns.c b/src/editfns.c
index 1a199ba..c32488e 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -162,20 +162,14 @@ DEFUN ("byte-to-string", Fbyte_to_string, 
Sbyte_to_string, 1, 1, 0,
 
 DEFUN ("string-to-char", Fstring_to_char, Sstring_to_char, 1, 1, 0,
        doc: /* Return the first character in STRING.  */)
-  (register Lisp_Object string)
+  (Lisp_Object string)
 {
-  register Lisp_Object val;
   CHECK_STRING (string);
-  if (SCHARS (string))
-    {
-      if (STRING_MULTIBYTE (string))
-       XSETFASTINT (val, STRING_CHAR (SDATA (string)));
-      else
-       XSETFASTINT (val, SREF (string, 0));
-    }
-  else
-    XSETFASTINT (val, 0);
-  return val;
+
+  /* This returns zero if STRING is empty.  */
+  return make_fixnum (STRING_MULTIBYTE (string)
+                     ? STRING_CHAR (SDATA (string))
+                     : SREF (string, 0));
 }
 
 DEFUN ("point", Fpoint, Spoint, 0, 0, 0,
diff --git a/src/term.c b/src/term.c
index a3aef31..94bf013 100644
--- a/src/term.c
+++ b/src/term.c
@@ -563,8 +563,8 @@ encode_terminal_code (struct glyph *src, int src_len,
            {
              cmp = composition_table[src->u.cmp.id];
              required = cmp->glyph_len;
-             required *= MAX_MULTIBYTE_LENGTH;
            }
+         required *= MAX_MULTIBYTE_LENGTH;
 
          if (encode_terminal_src_size - nbytes < required)
            {
diff --git a/test/lisp/calendar/icalendar-tests.el 
b/test/lisp/calendar/icalendar-tests.el
index 9862552..d496878 100644
--- a/test/lisp/calendar/icalendar-tests.el
+++ b/test/lisp/calendar/icalendar-tests.el
@@ -1,4 +1,4 @@
-;; icalendar-tests.el --- Test suite for icalendar.el
+;; icalendar-tests.el --- Test suite for icalendar.el  -*- lexical-binding:t 
-*-
 
 ;; Copyright (C) 2005, 2008-2020 Free Software Foundation, Inc.
 
@@ -419,11 +419,11 @@ END:VEVENT
 ")))
     (should (string= "SUM sum DES des LOC loc ORG org"
                     (icalendar--format-ical-event event)))
-    (setq icalendar-import-format (lambda (&rest ignore)
+    (setq icalendar-import-format (lambda (&rest _ignore)
                                     "helloworld"))
     (should (string= "helloworld"  (icalendar--format-ical-event event)))
     (setq icalendar-import-format
-          (lambda (e)
+          (lambda (event)
             (format "-%s-%s-%s-%s-%s-%s-%s-"
                     (icalendar--get-event-property event 'SUMMARY)
                     (icalendar--get-event-property event 'DESCRIPTION)
@@ -465,8 +465,7 @@ END:VEVENT
 
 (ert-deftest icalendar--decode-isodatetime ()
   "Test `icalendar--decode-isodatetime'."
-  (let ((tz (getenv "TZ"))
-       result)
+  (let ((tz (getenv "TZ")))
     (unwind-protect
        (progn
          ;; Use Eastern European Time (UTC+2, UTC+3 daylight saving)
@@ -886,7 +885,7 @@ During import test the timezone is set to Central European 
Time."
                (icalendar-tests--do-test-import input expected-american)))))
       (setenv "TZ" timezone))))
 
-(defun icalendar-tests--do-test-import (input expected-output)
+(defun icalendar-tests--do-test-import (_input expected-output)
   "Actually perform import test.
 Argument INPUT input icalendar string.
 Argument EXPECTED-OUTPUT expected diary string."
@@ -2347,7 +2346,7 @@ END:VCALENDAR
   (let ((time (icalendar--decode-isodatetime string day zone)))
     (format-time-string "%FT%T%z" (encode-time time) 0)))
 
-(defun icalendar-tests--decode-isodatetime (ical-string)
+(defun icalendar-tests--decode-isodatetime (_ical-string)
   (should (equal (icalendar-test--format "20040917T050910-0200")
                  "2004-09-17T03:09:10+0000"))
   (should (equal (icalendar-test--format "20040917T050910")
diff --git a/test/lisp/calendar/parse-time-tests.el 
b/test/lisp/calendar/parse-time-tests.el
index 4924e8b..e1801a5 100644
--- a/test/lisp/calendar/parse-time-tests.el
+++ b/test/lisp/calendar/parse-time-tests.el
@@ -1,4 +1,4 @@
-;; parse-time-tests.el --- Test suite for parse-time.el
+;; parse-time-tests.el --- Test suite for parse-time.el  -*- lexical-binding:t 
-*-
 
 ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/cedet/semantic-utest-fmt.el 
b/test/lisp/cedet/semantic-utest-fmt.el
index 2fc2b68..c2f2bb7 100644
--- a/test/lisp/cedet/semantic-utest-fmt.el
+++ b/test/lisp/cedet/semantic-utest-fmt.el
@@ -1,4 +1,4 @@
-;;; cedet/semantic-utest-fmt.el --- Parsing / Formatting tests
+;;; cedet/semantic-utest-fmt.el --- Parsing / Formatting tests -*- 
lexical-binding:t -*-
 
 ;;; Copyright (C) 2003-2004, 2007-2020 Free Software Foundation, Inc.
 
@@ -69,7 +69,6 @@ Files to visit are in `semantic-fmt-utest-file-list'."
          ;; Run the tests.
          (let ((fb (find-buffer-visiting fname))
                (b (semantic-find-file-noselect fname))
-               (num 0)
                (tags nil))
 
            (save-current-buffer
@@ -82,7 +81,6 @@ Files to visit are in `semantic-fmt-utest-file-list'."
              (semantic-clear-toplevel-cache)
              ;; Force the reparse
              (setq tags (semantic-fetch-tags))
-             (setq num (length tags))
 
              (save-excursion
                (while tags
diff --git a/test/lisp/cedet/semantic-utest-ia.el 
b/test/lisp/cedet/semantic-utest-ia.el
index 5761224..c99ef97 100644
--- a/test/lisp/cedet/semantic-utest-ia.el
+++ b/test/lisp/cedet/semantic-utest-ia.el
@@ -1,4 +1,4 @@
-;;; semantic-utest-ia.el --- Analyzer unit tests
+;;; semantic-utest-ia.el --- Analyzer unit tests  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
 
@@ -211,7 +211,7 @@
                ;; completions, then remove the below debug-on-error setting.
                (debug-on-error nil)
               (acomp
-               (condition-case err
+               (condition-case _err
                    (semantic-analyze-possible-completions ctxt)
                   ((error user-error) nil))
                 ))
@@ -438,11 +438,10 @@ tag that contains point, and return that."
   (let* ((ctxt (semantic-analyze-current-context))
         (target (car (reverse (oref ctxt prefix))))
         (tag (semantic-current-tag))
-        (start (current-time))
         (Lcount 0))
     (when (semantic-tag-p target)
       (semantic-symref-hits-in-region
-       target (lambda (start end prefix) (setq Lcount (1+ Lcount)))
+       target (lambda (_start _end _prefix) (setq Lcount (1+ Lcount)))
        (semantic-tag-start tag)
        (semantic-tag-end tag))
       Lcount)))
diff --git a/test/lisp/cedet/semantic-utest.el 
b/test/lisp/cedet/semantic-utest.el
index 7e33655..e537871 100644
--- a/test/lisp/cedet/semantic-utest.el
+++ b/test/lisp/cedet/semantic-utest.el
@@ -1,4 +1,4 @@
-;;; semantic-utest.el --- Tests for semantic's parsing system.
+;;; semantic-utest.el --- Tests for semantic's parsing system. -*- 
lexical-binding:t -*-
 
 ;;; Copyright (C) 2003-2004, 2007-2020 Free Software Foundation, Inc.
 
@@ -537,10 +537,9 @@ Pre-fill the buffer with CONTENTS."
 
 
 
-(defun semantic-utest-generic (testname filename contents name-contents 
names-removed killme insertme)
+(defun semantic-utest-generic (filename contents name-contents names-removed 
killme insertme)
   "Generic unit test according to template.
 Should work for languages without .h files, python javascript java.
-TESTNAME is the name of the test.
 FILENAME is the name of the file to create.
 CONTENTS is the contents of the file to test.
 NAME-CONTENTS is the list of names that should be in the contents.
@@ -564,10 +563,8 @@ INSERTME is the text to be inserted after the deletion."
       (sit-for 0)
 
       ;; Run the tests.
-      ;;(message "First parsing test %s." testname)
       (should (semantic-utest-verify-names name-contents))
 
-      ;;(message "Invalid tag test %s." testname)
       (semantic-utest-last-invalid name-contents names-removed killme insertme)
       (should (semantic-utest-verify-names name-contents))
 
@@ -576,16 +573,17 @@ INSERTME is the text to be inserted after the deletion."
       (kill-buffer buff)
       )))
 
+(defvar python-indent-guess-indent-offset) ; Silence byte-compiler.
 (ert-deftest semantic-utest-Python()
-  (skip-unless (featurep 'python-mode))
+  (skip-unless (fboundp 'python-mode))
   (let ((python-indent-guess-indent-offset nil))
-    (semantic-utest-generic "Python" (semantic-utest-fname "pytest.py") 
semantic-utest-Python-buffer-contents  semantic-utest-Python-name-contents   
'("fun2") "#1" "#deleted line")
+    (semantic-utest-generic (semantic-utest-fname "pytest.py") 
semantic-utest-Python-buffer-contents  semantic-utest-Python-name-contents   
'("fun2") "#1" "#deleted line")
     ))
 
 
 (ert-deftest semantic-utest-Javascript()
   (if (fboundp 'javascript-mode)
-      (semantic-utest-generic "Javascript" (semantic-utest-fname 
"javascripttest.js") semantic-utest-Javascript-buffer-contents  
semantic-utest-Javascript-name-contents   '("fun2") "//1" "//deleted line")
+      (semantic-utest-generic (semantic-utest-fname "javascripttest.js") 
semantic-utest-Javascript-buffer-contents  
semantic-utest-Javascript-name-contents   '("fun2") "//1" "//deleted line")
     (message "Skipping JavaScript test: NO major mode."))
   )
 
@@ -593,34 +591,34 @@ INSERTME is the text to be inserted after the deletion."
   ;; If JDE is installed, it might mess things up depending on the version
   ;; that was installed.
   (let ((auto-mode-alist  '(("\\.java\\'" . java-mode))))
-    (semantic-utest-generic "Java" (semantic-utest-fname "JavaTest.java") 
semantic-utest-Java-buffer-contents  semantic-utest-Java-name-contents   
'("fun2") "//1" "//deleted line")
+    (semantic-utest-generic (semantic-utest-fname "JavaTest.java") 
semantic-utest-Java-buffer-contents  semantic-utest-Java-name-contents   
'("fun2") "//1" "//deleted line")
     ))
 
 (ert-deftest semantic-utest-Makefile()
-  (semantic-utest-generic "Makefile" (semantic-utest-fname "Makefile") 
semantic-utest-Makefile-buffer-contents  semantic-utest-Makefile-name-contents  
 '("fun2") "#1" "#deleted line")
+  (semantic-utest-generic (semantic-utest-fname "Makefile") 
semantic-utest-Makefile-buffer-contents  semantic-utest-Makefile-name-contents  
 '("fun2") "#1" "#deleted line")
   )
 
 (ert-deftest semantic-utest-Scheme()
   (skip-unless nil) ;; There is a bug w/ scheme parser.  Skip this for now.
-  (semantic-utest-generic "Scheme" (semantic-utest-fname "tst.scm") 
semantic-utest-Scheme-buffer-contents  semantic-utest-Scheme-name-contents   
'("fun2") ";1" ";deleted line")
+  (semantic-utest-generic (semantic-utest-fname "tst.scm") 
semantic-utest-Scheme-buffer-contents  semantic-utest-Scheme-name-contents   
'("fun2") ";1" ";deleted line")
   )
 
-
+(defvar html-helper-build-new-buffer) ; Silence byte-compiler.
 (ert-deftest semantic-utest-Html()
   ;; Disable html-helper auto-fill-in mode.
-  (let ((html-helper-build-new-buffer nil))
-    (semantic-utest-generic "HTML" (semantic-utest-fname "tst.html") 
semantic-utest-Html-buffer-contents  semantic-utest-Html-name-contents   
'("fun2") "<!--1-->" "<!--deleted line-->")
+  (let ((html-helper-build-new-buffer nil)) ; FIXME: Why is this bound?
+    (semantic-utest-generic (semantic-utest-fname "tst.html") 
semantic-utest-Html-buffer-contents  semantic-utest-Html-name-contents   
'("fun2") "<!--1-->" "<!--deleted line-->")
     ))
 
 (ert-deftest semantic-utest-PHP()
   (skip-unless (featurep 'php-mode))
-  (semantic-utest-generic "PHP" (semantic-utest-fname "phptest.php") 
semantic-utest-PHP-buffer-contents semantic-utest-PHP-name-contents '("fun1") 
"fun2" "%^@")
+  (semantic-utest-generic (semantic-utest-fname "phptest.php") 
semantic-utest-PHP-buffer-contents semantic-utest-PHP-name-contents '("fun1") 
"fun2" "%^@")
   )
 
 ;look at http://mfgames.com/linux/csharp-mode
 (ert-deftest semantic-utest-Csharp() ;; hmm i don't even know how to edit a 
scharp file. need a csharp mode implementation i suppose
   (skip-unless (featurep 'csharp-mode))
-  (semantic-utest-generic "C#" (semantic-utest-fname "csharptest.cs") 
semantic-utest-Csharp-buffer-contents  semantic-utest-Csharp-name-contents   
'("fun2") "//1" "//deleted line")
+  (semantic-utest-generic (semantic-utest-fname "csharptest.cs") 
semantic-utest-Csharp-buffer-contents  semantic-utest-Csharp-name-contents   
'("fun2") "//1" "//deleted line")
   )
 
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -758,7 +756,7 @@ JAVE this thing would need to be recursive to handle java 
and csharp"
   (sit-for 0)
   )
 
-(defun semantic-utest-last-invalid (name-contents names-removed killme 
insertme)
+(defun semantic-utest-last-invalid (_name-contents _names-removed killme 
insertme)
   "Make the last fcn invalid."
   (semantic-utest-kill-indicator killme insertme)
 ;  (semantic-utest-verify-names name-contents names-removed); verify its gone 
;new validator doesn't handle skipnames yet
diff --git a/test/lisp/cedet/srecode-utest-getset.el 
b/test/lisp/cedet/srecode-utest-getset.el
index e49a195..3419b18 100644
--- a/test/lisp/cedet/srecode-utest-getset.el
+++ b/test/lisp/cedet/srecode-utest-getset.el
@@ -1,4 +1,4 @@
-;;; srecode/test-getset.el --- Test the getset inserter.
+;;; srecode/test-getset.el --- Test the getset inserter. -*- lexical-binding:t 
-*-
 
 ;; Copyright (C) 2008, 2009, 2011, 2019-2020 Free Software Foundation, Inc
 
@@ -52,6 +52,7 @@ private:
    temporary-file-directory)
   "File used to do testing.")
 
+(defvar srecode-insert-getset-fully-automatic-flag) ; Silence byte-compiler.
 (ert-deftest srecode-utest-getset-output ()
   "Test various template insertion options."
   (save-excursion
diff --git a/test/lisp/cedet/srecode-utest-template.el 
b/test/lisp/cedet/srecode-utest-template.el
index 4dd64e2..63c33a3 100644
--- a/test/lisp/cedet/srecode-utest-template.el
+++ b/test/lisp/cedet/srecode-utest-template.el
@@ -1,4 +1,4 @@
-;;; srecode/test.el --- SRecode Core Template tests.
+;;; srecode/test.el --- SRecode Core Template tests. -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/emacs-lisp/bindat-tests.el 
b/test/lisp/emacs-lisp/bindat-tests.el
index f8efa79..14f95a8 100644
--- a/test/lisp/emacs-lisp/bindat-tests.el
+++ b/test/lisp/emacs-lisp/bindat-tests.el
@@ -96,4 +96,20 @@
               (dest-ip .
                       [192 168 1 100]))))))
 
+(ert-deftest bindat-test-format-vector ()
+  (should (equal (bindat-format-vector [1 2 3] "%d" "x" 2) "1x2"))
+  (should (equal (bindat-format-vector [1 2 3] "%d" "x") "1x2x3")))
+
+(ert-deftest bindat-test-vector-to-dec ()
+  (should (equal (bindat-vector-to-dec [1 2 3]) "1.2.3"))
+  (should (equal (bindat-vector-to-dec [2048 1024 512] ".") "2048.1024.512")))
+
+(ert-deftest bindat-test-vector-to-hex ()
+  (should (equal (bindat-vector-to-hex [1 2 3]) "01:02:03"))
+  (should (equal (bindat-vector-to-hex [2048 1024 512] ".") "800.400.200")))
+
+(ert-deftest bindat-test-ip-to-string ()
+  (should (equal (bindat-ip-to-string [192 168 0 1]) "192.168.0.1"))
+  (should (equal (bindat-ip-to-string "\300\250\0\1") "192.168.0.1")))
+
 ;;; bindat-tests.el ends here
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el 
b/test/lisp/emacs-lisp/bytecomp-tests.el
index d4ceb47..bfe2d06 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -1,4 +1,4 @@
-;;; bytecomp-tests.el
+;;; bytecomp-tests.el  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/emacs-lisp/ert-x-tests.el 
b/test/lisp/emacs-lisp/ert-x-tests.el
index e910329..b760f8c 100644
--- a/test/lisp/emacs-lisp/ert-x-tests.el
+++ b/test/lisp/emacs-lisp/ert-x-tests.el
@@ -1,4 +1,4 @@
-;;; ert-x-tests.el --- Tests for ert-x.el
+;;; ert-x-tests.el --- Tests for ert-x.el  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2008, 2010-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/vc/smerge-mode-tests.el 
b/test/lisp/emacs-lisp/float-sup-tests.el
similarity index 56%
copy from test/lisp/vc/smerge-mode-tests.el
copy to test/lisp/emacs-lisp/float-sup-tests.el
index c76fc17..9f9a3da 100644
--- a/test/lisp/vc/smerge-mode-tests.el
+++ b/test/lisp/emacs-lisp/float-sup-tests.el
@@ -1,6 +1,6 @@
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;;; float-sup-tests.el --- Tests for float-sup.el  -*- lexical-binding:t -*-
 
-;; Maintainer: address@hidden
+;; Copyright (C) 2020 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -17,18 +17,17 @@
 ;; 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 'smerge-mode)
+(require 'ert)
 
-(ert-deftest smerge-mode-test-empty-hunk ()
-  "Regression test for bug #25555"
-  (with-temp-buffer
-    (insert "<<<<<<< one\n")
-    (save-excursion
-      (insert "=======\nLLL\n>>>>>>> end\n"))
-    (smerge-mode)
-    (smerge-keep-current)
-    (should (equal (buffer-substring (point-min) (point-max)) ""))))
+(ert-deftest float-sup-degrees-and-radians ()
+  (should (equal (degrees-to-radians 180.0) float-pi))
+  (should (equal (radians-to-degrees float-pi) 180.0))
+  (should (equal (radians-to-degrees (degrees-to-radians 360.0)) 360.0))
+  (should (equal (degrees-to-radians (radians-to-degrees float-pi)) float-pi)))
 
-(provide 'smerge-mode-tests)
+(provide 'float-sup-tests)
+;;; float-sup-tests.el ends here
diff --git a/test/lisp/emacs-lisp/nadvice-tests.el 
b/test/lisp/emacs-lisp/nadvice-tests.el
index eabe3cb..a955df0 100644
--- a/test/lisp/emacs-lisp/nadvice-tests.el
+++ b/test/lisp/emacs-lisp/nadvice-tests.el
@@ -1,4 +1,4 @@
-;;; advice-tests.el --- Test suite for the new advice thingy.
+;;; nadvice-tests.el --- Test suite for the new advice thingy.  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/emacs-lisp/pcase-tests.el 
b/test/lisp/emacs-lisp/pcase-tests.el
index 0b69bd9..ac51241 100644
--- a/test/lisp/emacs-lisp/pcase-tests.el
+++ b/test/lisp/emacs-lisp/pcase-tests.el
@@ -1,4 +1,4 @@
-;;; pcase-tests.el --- Test suite for pcase macro.
+;;; pcase-tests.el --- Test suite for pcase macro.  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/emacs-lisp/seq-tests.el 
b/test/lisp/emacs-lisp/seq-tests.el
index 77ee4f5..a6a8095 100644
--- a/test/lisp/emacs-lisp/seq-tests.el
+++ b/test/lisp/emacs-lisp/seq-tests.el
@@ -1,4 +1,4 @@
-;;; seq-tests.el --- Tests for sequences.el
+;;; seq-tests.el --- Tests for seq.el  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
 
@@ -126,7 +126,7 @@ Evaluate BODY for each created sequence.
   (with-test-sequences (seq '(6 7 8 9 10))
     (should (equal (seq-filter #'test-sequences-evenp seq) '(6 8 10)))
     (should (equal (seq-filter #'test-sequences-oddp seq) '(7 9)))
-    (should (equal (seq-filter (lambda (elt) nil) seq) '())))
+    (should (equal (seq-filter (lambda (_) nil) seq) '())))
   (with-test-sequences (seq '())
     (should (equal (seq-filter #'test-sequences-evenp seq) '()))))
 
@@ -134,7 +134,7 @@ Evaluate BODY for each created sequence.
   (with-test-sequences (seq '(6 7 8 9 10))
     (should (equal (seq-remove #'test-sequences-evenp seq) '(7 9)))
     (should (equal (seq-remove #'test-sequences-oddp seq) '(6 8 10)))
-    (should (same-contents-p (seq-remove (lambda (elt) nil) seq) seq)))
+    (should (same-contents-p (seq-remove (lambda (_) nil) seq) seq)))
   (with-test-sequences (seq '())
     (should (equal (seq-remove #'test-sequences-evenp seq) '()))))
 
@@ -142,7 +142,7 @@ Evaluate BODY for each created sequence.
   (with-test-sequences (seq '(6 7 8 9 10))
     (should (equal (seq-count #'test-sequences-evenp seq) 3))
     (should (equal (seq-count #'test-sequences-oddp seq) 2))
-    (should (equal (seq-count (lambda (elt) nil) seq) 0)))
+    (should (equal (seq-count (lambda (_) nil) seq) 0)))
   (with-test-sequences (seq '())
     (should (equal (seq-count #'test-sequences-evenp seq) 0))))
 
@@ -199,7 +199,7 @@ Evaluate BODY for each created sequence.
 
 (ert-deftest test-seq-every-p ()
   (with-test-sequences (seq '(43 54 22 1))
-    (should (seq-every-p (lambda (elt) t) seq))
+    (should (seq-every-p (lambda (_) t) seq))
     (should-not (seq-every-p #'test-sequences-oddp seq))
     (should-not (seq-every-p #'test-sequences-evenp seq)))
   (with-test-sequences (seq '(42 54 22 2))
diff --git a/test/lisp/emacs-lisp/subr-x-tests.el 
b/test/lisp/emacs-lisp/subr-x-tests.el
index 220ce0c..c702fdf 100644
--- a/test/lisp/emacs-lisp/subr-x-tests.el
+++ b/test/lisp/emacs-lisp/subr-x-tests.el
@@ -1,4 +1,4 @@
-;;; subr-x-tests.el --- Testing the extended lisp routines
+;;; subr-x-tests.el --- Testing the extended lisp routines  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/emacs-lisp/text-property-search-tests.el 
b/test/lisp/emacs-lisp/text-property-search-tests.el
index 26b89b7..549c90d 100644
--- a/test/lisp/emacs-lisp/text-property-search-tests.el
+++ b/test/lisp/emacs-lisp/text-property-search-tests.el
@@ -1,4 +1,4 @@
-;;; text-property-search-tests.el --- Testing text-property-search
+;;; text-property-search-tests.el --- Testing text-property-search  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/eshell/em-hist-tests.el 
b/test/lisp/eshell/em-hist-tests.el
index a08a7a2..5bb16f6 100644
--- a/test/lisp/eshell/em-hist-tests.el
+++ b/test/lisp/eshell/em-hist-tests.el
@@ -1,4 +1,4 @@
-;;; tests/em-hist-tests.el --- em-hist test suite
+;;; tests/em-hist-tests.el --- em-hist test suite  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/eshell/em-ls-tests.el b/test/lisp/eshell/em-ls-tests.el
index da3e224..975701e 100644
--- a/test/lisp/eshell/em-ls-tests.el
+++ b/test/lisp/eshell/em-ls-tests.el
@@ -1,4 +1,4 @@
-;;; tests/em-ls-tests.el --- em-ls test suite
+;;; tests/em-ls-tests.el --- em-ls test suite  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/eshell/esh-opt-tests.el 
b/test/lisp/eshell/esh-opt-tests.el
index af6c089..caba153 100644
--- a/test/lisp/eshell/esh-opt-tests.el
+++ b/test/lisp/eshell/esh-opt-tests.el
@@ -1,4 +1,4 @@
-;;; tests/esh-opt-tests.el --- esh-opt test suite
+;;; tests/esh-opt-tests.el --- esh-opt test suite  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/mail/rfc2045-tests.el b/test/lisp/mail/rfc2045-tests.el
index 844b16a..edd7a88 100644
--- a/test/lisp/mail/rfc2045-tests.el
+++ b/test/lisp/mail/rfc2045-tests.el
@@ -24,6 +24,7 @@
 ;;; Code:
 
 (require 'ert)
+(require 'rfc2045)
 
 (ert-deftest rfc2045-test-encode-string ()
   (should (equal (rfc2045-encode-string "foo" "bar") "foo=bar"))
diff --git a/test/lisp/mail/rfc2045-tests.el b/test/lisp/mail/rfc2368-tests.el
similarity index 50%
copy from test/lisp/mail/rfc2045-tests.el
copy to test/lisp/mail/rfc2368-tests.el
index 844b16a..c35b8e3 100644
--- a/test/lisp/mail/rfc2045-tests.el
+++ b/test/lisp/mail/rfc2368-tests.el
@@ -1,9 +1,7 @@
-;;; rfc2045-tests.el --- Tests for rfc2045.el  -*- lexical-binding:t -*-
+;;; rfc2368-tests.el --- Tests for rfc2368.el  -*- lexical-binding:t -*-
 
 ;; 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
@@ -24,13 +22,18 @@
 ;;; Code:
 
 (require 'ert)
+(require 'rfc2368)
+
+(ert-deftest rfc2368-unhexify-string ()
+  (should (equal (rfc2368-unhexify-string "hello%20there") "hello there")))
 
-(ert-deftest rfc2045-test-encode-string ()
-  (should (equal (rfc2045-encode-string "foo" "bar") "foo=bar"))
-  (should (equal (rfc2045-encode-string "foo" "bar-baz") "foo=bar-baz"))
-  (should (equal (rfc2045-encode-string "foo" "bar baz") "foo=\"bar baz\""))
-  (should (equal (rfc2045-encode-string "foo" "bar\tbaz") "foo=\"bar\tbaz\""))
-  (should (equal (rfc2045-encode-string "foo" "bar\nbaz") "foo=\"bar\nbaz\"")))
+(ert-deftest rfc2368-parse-mailto-url ()
+  (should (equal (rfc2368-parse-mailto-url 
"mailto:address@hidden?subject=Foo&bar=baz";)
+                 '(("To" . "address@hidden") ("Subject" . "Foo") ("Bar" . 
"baz"))))
+  (should (equal (rfc2368-parse-mailto-url 
"mailto:address@hidden?to=address@hidden";)
+                 '(("To" . "address@hidden, address@hidden"))))
+  (should (equal (rfc2368-parse-mailto-url 
"mailto:address@hidden?subject=bar%20baz";)
+                 '(("To" . "address@hidden") ("Subject" . "bar baz")))))
 
-(provide 'rfc2045-tests)
-;;; rfc2045-tests.el ends here
+(provide 'rfc2368-tests)
+;;; rfc2368-tests.el ends here
diff --git a/test/lisp/net/hmac-md5-tests.el b/test/lisp/net/hmac-md5-tests.el
new file mode 100644
index 0000000..30d221e
--- /dev/null
+++ b/test/lisp/net/hmac-md5-tests.el
@@ -0,0 +1,80 @@
+;;; hmac-md5-tests.el --- Tests for hmac-md5.el  -*- lexical-binding:t -*-
+
+;; Copyright (C) 2020 Free Software Foundation, Inc.
+
+;; 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 'hmac-md5)
+
+;; Test cases from RFC 2202, "Test Cases for HMAC-MD5 and HMAC-SHA-1",
+;; moved here from hmac-md5.el
+
+(ert-deftest hmac-md5-test-encode-string ()
+  ;; RFC 2202 -- test_case 1
+  (should (equal (encode-hex-string
+                  (hmac-md5 "Hi There" (make-string 16 ?\x0b)))
+                 "9294727a3638bb1c13f48ef8158bfc9d"))
+
+  ;; RFC 2202 -- test_case 2
+  (should (equal (encode-hex-string
+                  (hmac-md5 "what do ya want for nothing?" "Jefe"))
+                 "750c783e6ab0b503eaa86e310a5db738"))
+
+  ;; RFC 2202 -- test_case 3
+  (should (equal (encode-hex-string
+                  (hmac-md5 (decode-hex-string (make-string 100 ?d))
+                            (decode-hex-string (make-string 32 ?a))))
+                 "56be34521d144c88dbb8c733f0e8b3f6"))
+
+  ;; RFC 2202 -- test_case 4
+  (should (equal (encode-hex-string
+                  (hmac-md5 (decode-hex-string
+                             (mapconcat (lambda (c) (concat (list c) "d"))
+                                        (make-string 50 ?c) ""))
+                            (decode-hex-string 
"0102030405060708090a0b0c0d0e0f10111213141516171819")))
+                 "697eaf0aca3a3aea3a75164746ffaa79"))
+
+  ;; RFC 2202 -- test_case 5 (a)
+  (should (equal (encode-hex-string
+                  (hmac-md5 "Test With Truncation" (make-string 16 ?\x0c)))
+                 "56461ef2342edc00f9bab995690efd4c"))
+
+  ;; RFC 2202 -- test_case 5 (b)
+  (should (equal (encode-hex-string
+                  (hmac-md5-96 "Test With Truncation" (make-string 16 ?\x0c)))
+                 "56461ef2342edc00f9bab995"))
+
+  ;; RFC 2202 -- test_case 6
+  (should (equal (encode-hex-string
+                  (hmac-md5
+                   "Test Using Larger Than Block-Size Key - Hash Key First"
+                   (decode-hex-string (make-string 160 ?a))))
+                 "6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd"))
+
+  ;; RFC 2202 -- test_case 7
+  (should (equal (encode-hex-string
+                  (hmac-md5
+                   "Test Using Larger Than Block-Size Key and Larger Than One 
Block-Size Data"
+                   (decode-hex-string (make-string 160 ?a))))
+                 "6f630fad67cda0ee1fb1f562db3aa53e")))
+
+(provide 'hmac-md5-tests)
+;;; hmac-md5-tests.el ends here
diff --git a/test/lisp/net/puny-tests.el b/test/lisp/net/puny-tests.el
index 288bc2f..7dac397 100644
--- a/test/lisp/net/puny-tests.el
+++ b/test/lisp/net/puny-tests.el
@@ -38,4 +38,25 @@
   "Test puny decoding."
   (should (string= (puny-decode-string "xn--9dbdkw") "חנוך")))
 
+(ert-deftest puny-test-encode-domain ()
+  (should (string= (puny-encode-domain "åäö.se") "xn--4cab6c.se")))
+
+(ert-deftest puny-test-decode-domain ()
+  (should (string= (puny-decode-domain "xn--4cab6c.se") "åäö.se")))
+
+(ert-deftest puny-highly-restrictive-domain-p ()
+  (should (puny-highly-restrictive-domain-p "foo.bar.org"))
+  (should (puny-highly-restrictive-domain-p "foo.abcåäö.org"))
+  (should (puny-highly-restrictive-domain-p "foo.ர.org"))
+  ;; Disallow unicode character 2044, visually similar to "/".
+  (should-not (puny-highly-restrictive-domain-p 
"www.yourbank.com⁄login⁄checkUser.jsp?inxs.ch"))
+  ;; Disallow mixing scripts.
+  (should-not (puny-highly-restrictive-domain-p "åர.org"))
+  ;; Only allowed in moderately restrictive.
+  (should-not (puny-highly-restrictive-domain-p "Teχ.org"))
+  (should-not (puny-highly-restrictive-domain-p "HλLF-LIFE.org"))
+  (should-not (puny-highly-restrictive-domain-p "Ωmega.org"))
+  ;; Only allowed in unrestricted.
+  (should-not (puny-highly-restrictive-domain-p "I♥NY.org")))
+
 ;;; puny-tests.el ends here
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index d00c88a..75a0167 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -4642,8 +4642,7 @@ INPUT, if non-nil, is a string sent to the process."
 ;; This test is inspired by Bug#39067.
 (ert-deftest tramp-test32-shell-command-dont-erase-buffer ()
   "Check `shell-command-dont-erase-buffer'."
-  ;; The test fails due to recent changes in Emacs.  So we mark it as unstable.
-  :tags '(:expensive-test :unstable)
+  :tags '(:expensive-test)
   (skip-unless (tramp--test-enabled))
   (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
   ;; Prior Emacs 27, `shell-command-dont-erase-buffer' wasn't working properly.
@@ -4668,9 +4667,10 @@ INPUT, if non-nil, is a string sent to the process."
                (should (= (point) (point-max)))
                (shell-command "echo baz" (current-buffer))
                (should (string-equal "barbaz\n" (buffer-string)))
-               (should (= point (point)))))
+               (should (= point (point)))
+               (should-not (= (point) (point-max)))))
 
-           ;; Erase if the buffer is not current one.
+           ;; Erase if the buffer is not current one.  Point is not moved.
            (let (shell-command-dont-erase-buffer)
              (with-current-buffer buffer
                (erase-buffer)
@@ -4681,22 +4681,28 @@ INPUT, if non-nil, is a string sent to the process."
                (with-temp-buffer
                  (shell-command "echo baz" buffer))
                (should (string-equal "baz\n" (buffer-string)))
-               (should (= point (point)))))
+               (should (= point (point)))
+               (should-not (= (point) (point-max)))))
 
            ;; Erase if buffer is the current one, but
            ;; `shell-command-dont-erase-buffer' is set to `erase'.
+           ;; There is no point to check point.
            (let ((shell-command-dont-erase-buffer 'erase))
              (with-temp-buffer
                (insert "bar")
-               (setq point (point))
                (should (string-equal "bar" (buffer-string)))
                (should (= (point) (point-max)))
                (shell-command "echo baz" (current-buffer))
                (should (string-equal "baz\n" (buffer-string)))
-               (should (= (point) (point-max)))))
-
-           ;; Don't erase if `shell-command-dont-erase-buffer' is set
-           ;; to `beg-last-out'.  Check point.
+               ;; In the local case, point is not moved after the
+               ;; inserted text.
+               (should (= (point)
+                          (if (file-remote-p default-directory)
+                              (point-max) (point-min))))))
+
+           ;; Don't erase if the buffer is the current one and
+           ;; `shell-command-dont-erase-buffer' is set to
+           ;; `beg-last-out'.  Check point.
            (let ((shell-command-dont-erase-buffer 'beg-last-out))
              (with-temp-buffer
                (insert "bar")
@@ -4705,10 +4711,32 @@ INPUT, if non-nil, is a string sent to the process."
                (should (= (point) (point-max)))
                (shell-command "echo baz" (current-buffer))
                (should (string-equal "barbaz\n" (buffer-string)))
-               (should (= point (point)))))
-
-           ;; Don't erase if `shell-command-dont-erase-buffer' is set
-           ;; to `end-last-out'.  Check point.
+               ;; There is still an error in Tramp.
+               (unless (file-remote-p default-directory)
+                 (should (= point (point)))
+                 (should-not (= (point) (point-max))))))
+
+           ;; Don't erase if the buffer is not the current one and
+           ;; `shell-command-dont-erase-buffer' is set to
+           ;; `beg-last-out'.  Check point.
+           (let ((shell-command-dont-erase-buffer 'beg-last-out))
+             (with-current-buffer buffer
+               (erase-buffer)
+               (insert "bar")
+               (setq point (point))
+               (should (string-equal "bar" (buffer-string)))
+               (should (= (point) (point-max)))
+               (with-temp-buffer
+                 (shell-command "echo baz" buffer))
+               (should (string-equal "barbaz\n" (buffer-string)))
+               ;; There is still an error in Tramp.
+               (unless (file-remote-p default-directory)
+                 (should (= point (point)))
+                 (should-not (= (point) (point-max))))))
+
+           ;; Don't erase if the buffer is the current one and
+           ;; `shell-command-dont-erase-buffer' is set to
+           ;; `end-last-out'.  Check point.
            (let ((shell-command-dont-erase-buffer 'end-last-out))
              (with-temp-buffer
                (insert "bar")
@@ -4717,10 +4745,36 @@ INPUT, if non-nil, is a string sent to the process."
                (should (= (point) (point-max)))
                (shell-command "echo baz" (current-buffer))
                (should (string-equal "barbaz\n" (buffer-string)))
-               (should (= (point) (point-max)))))
+               ;; This does not work as expected in the local case.
+               ;; Therefore, we negate the test for the time being.
+               (should-not
+                (funcall (if (file-remote-p default-directory) #'identity 
#'not)
+                         (= point (point))))
+               (should
+                (funcall (if (file-remote-p default-directory) #'identity 
#'not)
+                         (= (point) (point-max))))))
 
-           ;; Don't erase if `shell-command-dont-erase-buffer' is set
-           ;; to `save-point'.  Check point.
+           ;; Don't erase if the buffer is not the current one and
+           ;; `shell-command-dont-erase-buffer' is set to
+           ;; `end-last-out'.  Check point.
+           (let ((shell-command-dont-erase-buffer 'end-last-out))
+             (with-current-buffer buffer
+               (erase-buffer)
+               (insert "bar")
+               (setq point (point))
+               (should (string-equal "bar" (buffer-string)))
+               (should (= (point) (point-max)))
+               (with-temp-buffer
+                 (shell-command "echo baz" buffer))
+               (should (string-equal "barbaz\n" (buffer-string)))
+               ;; There is still an error in Tramp.
+               (unless (file-remote-p default-directory)
+                 (should-not (= point (point)))
+                 (should (= (point) (point-max))))))
+
+           ;; Don't erase if the buffer is the current one and
+           ;; `shell-command-dont-erase-buffer' is set to
+           ;; `save-point'.  Check point.
            (let ((shell-command-dont-erase-buffer 'save-point))
              (with-temp-buffer
                (insert "bar")
@@ -4729,8 +4783,70 @@ INPUT, if non-nil, is a string sent to the process."
                (should (string-equal "bar" (buffer-string)))
                (should (= (point) (1- (point-max))))
                (shell-command "echo baz" (current-buffer))
+               (should (string-equal "babaz\nr" (buffer-string)))
+               ;; There is still an error in Tramp.
+               (unless (file-remote-p default-directory)
+                 (should (= point (point)))
+                 (should-not (= (point) (point-max))))))
+
+           ;; Don't erase if the buffer is not the current one and
+           ;; `shell-command-dont-erase-buffer' is set to
+           ;; `save-point'.  Check point.
+           (let ((shell-command-dont-erase-buffer 'save-point))
+             (with-current-buffer buffer
+               (erase-buffer)
+               (insert "bar")
+               (goto-char (1- (point-max)))
+               (setq point (point))
+               (should (string-equal "bar" (buffer-string)))
+               (should (= (point) (1- (point-max))))
+               (with-temp-buffer
+                 (shell-command "echo baz" buffer))
+               ;; This does not work as expected.  Therefore, we
+               ;; use the "wrong" string.
+               (should (string-equal "barbaz\n" (buffer-string)))
+               ;; There is still an error in Tramp.
+               (unless (file-remote-p default-directory)
+                 (should (= point (point)))
+                 (should-not (= (point) (point-max))))))
+
+           ;; Don't erase if the buffer is the current one and
+           ;; `shell-command-dont-erase-buffer' is set to a random
+           ;; value.  Check point.
+           (let ((shell-command-dont-erase-buffer 'random))
+             (with-temp-buffer
+               (insert "bar")
+               (setq point (point))
+               (should (string-equal "bar" (buffer-string)))
+               (should (= (point) (point-max)))
+               (shell-command "echo baz" (current-buffer))
+               (should (string-equal "barbaz\n" (buffer-string)))
+               ;; This does not work as expected in the local case.
+               ;; Therefore, we negate the test for the time being.
+               (should-not
+                (funcall (if (file-remote-p default-directory) #'identity 
#'not)
+                         (= point (point))))
+               (should
+                (funcall (if (file-remote-p default-directory) #'identity 
#'not)
+                         (= (point) (point-max))))))
+
+           ;; Don't erase if the buffer is not the current one and
+           ;; `shell-command-dont-erase-buffer' is set to a random
+           ;; value.  Check point.
+           (let ((shell-command-dont-erase-buffer 'random))
+             (with-current-buffer buffer
+               (erase-buffer)
+               (insert "bar")
+               (setq point (point))
+               (should (string-equal "bar" (buffer-string)))
+               (should (= (point) (point-max)))
+               (with-temp-buffer
+                 (shell-command "echo baz" buffer))
                (should (string-equal "barbaz\n" (buffer-string)))
-               (should (= point (point))))))
+               ;; There is still an error in Tramp.
+               (unless (file-remote-p default-directory)
+                 (should-not (= point (point)))
+                 (should (= (point) (point-max)))))))
 
        ;; Cleanup.
        (ignore-errors (kill-buffer buffer))))))
diff --git a/test/lisp/progmodes/etags-tests.el 
b/test/lisp/progmodes/etags-tests.el
index f7a5ac4..79368cd 100644
--- a/test/lisp/progmodes/etags-tests.el
+++ b/test/lisp/progmodes/etags-tests.el
@@ -1,4 +1,4 @@
-;;; etags-tests.el --- Test suite for etags.el.
+;;; etags-tests.el --- Test suite for etags.el.  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/progmodes/f90-tests.el b/test/lisp/progmodes/f90-tests.el
index b6fbac3..5115f8e 100644
--- a/test/lisp/progmodes/f90-tests.el
+++ b/test/lisp/progmodes/f90-tests.el
@@ -1,4 +1,4 @@
-;;; f90-tests.el --- tests for progmodes/f90.el
+;;; f90-tests.el --- tests for progmodes/f90.el  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/progmodes/ps-mode-tests.el 
b/test/lisp/progmodes/ps-mode-tests.el
index a47abeb..d565b32 100644
--- a/test/lisp/progmodes/ps-mode-tests.el
+++ b/test/lisp/progmodes/ps-mode-tests.el
@@ -1,4 +1,4 @@
-;;; ps-mode-tests.el --- Test suite for ps-mode
+;;; ps-mode-tests.el --- Test suite for ps-mode  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/progmodes/python-tests.el 
b/test/lisp/progmodes/python-tests.el
index 65a60b4..60cd6ea 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -1,4 +1,4 @@
-;;; python-tests.el --- Test suite for python.el
+;;; python-tests.el --- Test suite for python.el  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
 
@@ -118,7 +118,6 @@ Argument MIN and MAX delimit the region to be returned and
 default to `point-min' and `point-max' respectively."
   (let* ((min (or min (point-min)))
          (max (or max (point-max)))
-         (buffer (current-buffer))
          (buffer-contents (buffer-substring-no-properties min max))
          (overlays
           (sort (overlays-in min max)
@@ -154,7 +153,7 @@ The name of this directory depends on `system-type'."
 sed do eiusmod tempor incididunt ut labore et dolore magna
 aliqua."
    (let ((expected (save-excursion
-                     (dotimes (i 3)
+                     (dotimes (_ 3)
                        (re-search-forward "et" nil t))
                      (forward-char -2)
                      (point))))
@@ -163,7 +162,7 @@ aliqua."
      ;; one should be returned.
      (should (= (python-tests-look-at "et" 6 t) expected))
      ;; If already looking at STRING, it should skip it.
-     (dotimes (i 2) (re-search-forward "et"))
+     (dotimes (_ 2) (re-search-forward "et"))
      (forward-char -2)
      (should (= (python-tests-look-at "et") expected)))))
 
@@ -178,7 +177,7 @@ aliqua."
             (re-search-forward "et" nil t)
             (forward-char -2)
             (point))))
-     (dotimes (i 3)
+     (dotimes (_ 3)
        (re-search-forward "et" nil t))
      (should (= (python-tests-look-at "et" -3 t) expected))
      (should (= (python-tests-look-at "et" -6 t) expected)))))
@@ -2642,7 +2641,7 @@ if x:
 (ert-deftest python-shell-calculate-process-environment-2 ()
   "Test `python-shell-extra-pythonpaths' modification."
   (let* ((process-environment process-environment)
-         (original-pythonpath (setenv "PYTHONPATH" "/path0"))
+         (_original-pythonpath (setenv "PYTHONPATH" "/path0"))
          (python-shell-extra-pythonpaths '("/path1" "/path2"))
          (process-environment (python-shell-calculate-process-environment)))
     (should (equal (getenv "PYTHONPATH")
diff --git a/test/lisp/progmodes/ruby-mode-tests.el 
b/test/lisp/progmodes/ruby-mode-tests.el
index 6bdc765..9d677a2 100644
--- a/test/lisp/progmodes/ruby-mode-tests.el
+++ b/test/lisp/progmodes/ruby-mode-tests.el
@@ -1,4 +1,4 @@
-;;; ruby-mode-tests.el --- Test suite for ruby-mode
+;;; ruby-mode-tests.el --- Test suite for ruby-mode  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/progmodes/subword-tests.el 
b/test/lisp/progmodes/subword-tests.el
index 00168c0..86e905c 100644
--- a/test/lisp/progmodes/subword-tests.el
+++ b/test/lisp/progmodes/subword-tests.el
@@ -1,4 +1,4 @@
-;;; subword-tests.el --- Testing the subword rules
+;;; subword-tests.el --- Testing the subword rules  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/progmodes/tcl-tests.el b/test/lisp/progmodes/tcl-tests.el
index 75409a6..fb5a19d 100644
--- a/test/lisp/progmodes/tcl-tests.el
+++ b/test/lisp/progmodes/tcl-tests.el
@@ -1,4 +1,4 @@
-;;; tcl-tests.el --- Test suite for tcl-mode
+;;; tcl-tests.el --- Test suite for tcl-mode  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/progmodes/xref-tests.el 
b/test/lisp/progmodes/xref-tests.el
index 9c7a9e6..a4980b2 100644
--- a/test/lisp/progmodes/xref-tests.el
+++ b/test/lisp/progmodes/xref-tests.el
@@ -1,4 +1,4 @@
-;;; xref-tests.el --- tests for xref
+;;; xref-tests.el --- tests for xref  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index fa71e26..88be74f 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -757,7 +757,7 @@ See Bug#21722."
 ;;; Tests for shell-command-dont-erase-buffer
 
 (defmacro with-shell-command-dont-erase-buffer (str output-buffer-is-current 
&rest body)
-  (declare (debug (form &body)) (indent 2))
+  (declare (debug (sexp form body)) (indent 2))
   (let ((expected (make-symbol "expected"))
         (command (make-symbol "command"))
         (caller-buf (make-symbol "caller-buf"))
@@ -766,8 +766,9 @@ See Bug#21722."
             (,output-buf (if ,output-buffer-is-current ,caller-buf
                            (generate-new-buffer "output-buf")))
             (emacs (expand-file-name invocation-name invocation-directory))
-            (,command (format "%s -Q --batch --eval \"(princ \\\"%s\\\")\""
-                              emacs ,str))
+            (,command
+             (format "%s -Q --batch --eval %s"
+                     emacs (shell-quote-argument (format "(princ %S)" ,str))))
             (inhibit-message t))
        (unwind-protect
            ;; Feature must work the same regardless how we specify the 2nd arg 
of `shell-command', ie,
@@ -787,7 +788,7 @@ See Bug#21722."
 
 (ert-deftest simple-tests-shell-command-39067 ()
   "The output buffer is erased or not according to 
`shell-command-dont-erase-buffer'."
-  (let ((str "foo\n"))
+  (let ((str "foo\\n"))
     (dolist (output-current '(t nil))
       (with-shell-command-dont-erase-buffer str output-current
         (let ((expected (cond ((eq shell-command-dont-erase-buffer 'erase) str)
@@ -799,7 +800,7 @@ See Bug#21722."
 
 (ert-deftest simple-tests-shell-command-dont-erase-buffer ()
   "The point is set at the expected position after execution of the command."
-  (let* ((str "foo\n")
+  (let* ((str "foo\\n")
          (expected-point `((beg-last-out . ,(1+ (length str)))
                            (end-last-out . ,(1+ (* 2 (length str))))
                            (save-point . 1))))
diff --git a/test/lisp/vc/add-log-tests.el b/test/lisp/vc/add-log-tests.el
index fc928b0..f256945 100644
--- a/test/lisp/vc/add-log-tests.el
+++ b/test/lisp/vc/add-log-tests.el
@@ -1,4 +1,4 @@
-;;; add-log-tests.el --- Test suite for add-log.
+;;; add-log-tests.el --- Test suite for add-log.  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
 
@@ -25,12 +25,12 @@
 (require 'ert)
 (require 'add-log)
 
-(defmacro add-log-current-defun-deftest (name doc major-mode
+(defmacro add-log-current-defun-deftest (name doc mode
                                              content marker expected-defun)
   "Generate an ert test for mode-own `add-log-current-defun-function'.
-Run `add-log-current-defun' at the point where MARKER specifies in a
-buffer which content is CONTENT under MAJOR-MODE. Then it compares the
-result with EXPECTED-DEFUN."
+Run `add-log-current-defun' at the point where MARKER specifies
+in a buffer which content is CONTENT under major mode MODE. Then
+it compares the result with EXPECTED-DEFUN."
   (let ((xname (intern (concat "add-log-current-defun-test-"
                               (symbol-name name)
                               ))))
@@ -39,7 +39,7 @@ result with EXPECTED-DEFUN."
        (with-temp-buffer
         (insert ,content)
         (goto-char (point-min))
-        (funcall ',major-mode)
+        (funcall ',mode)
         (should (equal (when (search-forward ,marker nil t)
                          (replace-match "" nil t)
                          (add-log-current-defun))
diff --git a/test/lisp/vc/diff-mode-tests.el b/test/lisp/vc/diff-mode-tests.el
index 26e9f26..e497ed2 100644
--- a/test/lisp/vc/diff-mode-tests.el
+++ b/test/lisp/vc/diff-mode-tests.el
@@ -1,3 +1,5 @@
+;;; diff-mode-tests.el --- Tests for diff-mode.el  -*- lexical-binding:t -*-
+
 ;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
 
 ;; Author: Dima Kogan <address@hidden>
diff --git a/test/lisp/vc/ediff-ptch-tests.el b/test/lisp/vc/ediff-ptch-tests.el
index ab44e23..a3a592b 100644
--- a/test/lisp/vc/ediff-ptch-tests.el
+++ b/test/lisp/vc/ediff-ptch-tests.el
@@ -1,4 +1,4 @@
-;;; ediff-ptch-tests.el --- Tests for ediff-ptch.el
+;;; ediff-ptch-tests.el --- Tests for ediff-ptch.el  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/vc/smerge-mode-tests.el 
b/test/lisp/vc/smerge-mode-tests.el
index c76fc17..5b15a09 100644
--- a/test/lisp/vc/smerge-mode-tests.el
+++ b/test/lisp/vc/smerge-mode-tests.el
@@ -1,3 +1,5 @@
+;;; smerge-mode-tests.el --- Tests for smerge-mode.el  -*- lexical-binding:t 
-*-
+
 ;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
 
 ;; Maintainer: address@hidden
diff --git a/test/lisp/vc/vc-hg-tests.el b/test/lisp/vc/vc-hg-tests.el
index 01d1975..e4a20bb 100644
--- a/test/lisp/vc/vc-hg-tests.el
+++ b/test/lisp/vc/vc-hg-tests.el
@@ -1,4 +1,4 @@
-;;; vc-hg-tests.el --- tests for vc/vc-hg.el
+;;; vc-hg-tests.el --- tests for vc/vc-hg.el  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/vc/vc-tests.el b/test/lisp/vc/vc-tests.el
index 43d2448..ff85e2f 100644
--- a/test/lisp/vc/vc-tests.el
+++ b/test/lisp/vc/vc-tests.el
@@ -1,4 +1,4 @@
-;;; vc-tests.el --- Tests of different backends of vc.el
+;;; vc-tests.el --- Tests of different backends of vc.el  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
 
diff --git a/test/lisp/vc/smerge-mode-tests.el b/test/lisp/version-tests.el
similarity index 60%
copy from test/lisp/vc/smerge-mode-tests.el
copy to test/lisp/version-tests.el
index c76fc17..8fbd4a1 100644
--- a/test/lisp/vc/smerge-mode-tests.el
+++ b/test/lisp/version-tests.el
@@ -1,6 +1,6 @@
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;;; version-tests.el --- Tests for version.el  -*- lexical-binding: t -*-
 
-;; Maintainer: address@hidden
+;; Copyright (C) 2020 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -17,18 +17,15 @@
 ;; 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 'smerge-mode)
+(require 'ert)
 
-(ert-deftest smerge-mode-test-empty-hunk ()
-  "Regression test for bug #25555"
-  (with-temp-buffer
-    (insert "<<<<<<< one\n")
-    (save-excursion
-      (insert "=======\nLLL\n>>>>>>> end\n"))
-    (smerge-mode)
-    (smerge-keep-current)
-    (should (equal (buffer-substring (point-min) (point-max)) ""))))
+(ert-deftest test-emacs-version ()
+  (should (string-match emacs-version (emacs-version)))
+  (should (string-match system-configuration (emacs-version))))
 
-(provide 'smerge-mode-tests)
+(provide 'version-tests)
+;;; version-tests.el ends here



reply via email to

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