]> code.delx.au - gnu-emacs/commitdiff
Merge from origin/emacs-25
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 26 May 2016 19:55:06 +0000 (12:55 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 26 May 2016 19:55:06 +0000 (12:55 -0700)
c3489d0 * lisp/w32-fns.el (set-message-beep, w32-get-locale-info) (w3...
a4d882c Correct old cell name unbinding when renaming cell.
6c12c53 Merge branch 'emacs-25' of git.sv.gnu.org:/srv/git/emacs into...
0be6725 Document problem: slow screen refresh on missing font.
853b9b9 * admin/admin.el (add-release-logs): Basic check of existing ...
5fa80cf * build-aux/gitlog-to-emacslog: Handle empty generated Change...
3c79e51 * admin/admin.el (add-release-logs): Generate ChangeLog if ne...
42275df * doc/misc/texinfo.tex: Revert previous change (Bug#23611).
3f4a9d9 * admin/authors.el (authors): First update the ChangeLog.
897fb6f ; 'Changes from the pre-25.1 API' copyedits
825ca25 Rename vc-stay-local back to vc-cvs-stay-local
4efb3e8 * doc/emacs/files.texi (Comparing Files): * doc/emacs/trouble...
b995d1e * doc/misc/eww.texi (Advanced): Fix xref.
2e589c0 Fix cross-references between manuals
f3d2ded * doc/misc/vhdl-mode.texi (Sample Init File): Rename node to ...
906c810 ; * admin/release-process: Move etc/HISTORY from here... ; * ...
bea1b65 * admin/admin.el (add-release-logs): Also update etc/HISTORY.
503e752 ; * CONTRIBUTE: Fix a typo.
fbfd478 Avoid aborting due to errors in arguments of 'set-face-attrib...
bdfbe6d ; * admin/release-process: Copyedits.
44a6aed ; * test/automated/data-tests.el: Standardize license notice.
c33ed39 ; * test/automated/viper-tests.el: Standardize license notice.
df4a14b Add automated test for viper-tests.el
c0139e3 Fix viper undo breakage from undo-boundary changes
920d76c Fix reference to obsolete fn ps-eval-switch
18a9bc1 Do not trash symlinks to init file
2671179 Don't print the "decomposition" line for control chars in wha...
869092c Bring back xterm pasting with middle mouse
5ab0830 Provide workaround for xftfont rendering problem
c9f7ec7 * lisp/desktop.el: Disable restore frameset if in non-graphic...
30989a0 Mention GTK+ problems in etc/PROBLEMS
421e3c4 * lisp/emacs-lisp/package.el (package-refresh-contents):
dadfc30 Revert "epg: Add a way to detect gpg1 executable for tests"
e41a5cb Avoid errors with Czech and Slovak input methods
d4ae6d7 epg: Add a way to detect gpg1 executable for tests
ebc3a94 * lisp/emacs-lisp/package.el: Fix free variable warnings.
6e71295 * lisp/emacs-lisp/package.el (package--with-response-buffer):
c45d9f6 Improve documentation of 'server-name'
3b5e38c Modernize ASLR advice in etc/PROBLEMS
1fe1e0a * lisp/char-fold.el: Rename from character-fold.el.

23 files changed:
1  2 
CONTRIBUTE
admin/release-process
build-aux/gitlog-to-emacslog
doc/emacs/files.texi
doc/emacs/misc.texi
doc/emacs/trouble.texi
doc/misc/eww.texi
doc/misc/url.texi
etc/NEWS
etc/PROBLEMS
lisp/emacs-lisp/package.el
lisp/emulation/viper-cmd.el
lisp/menu-bar.el
lisp/replace.el
lisp/ses.el
lisp/simple.el
lisp/term/xterm.el
lisp/vc/vc-cvs.el
lisp/w32-fns.el
src/xfaces.c
test/lisp/char-fold-tests.el
test/lisp/emacs-lisp/package-tests.el
test/src/data-tests.el

diff --combined CONTRIBUTE
index e39c665f21680ff2828b0caa57b0046035445616,a70682f29ab63a8c21868d2532808825edf52214..9d5d775a5e08ea174a7a982c24323141a4a28793
@@@ -183,7 -183,7 +183,7 @@@ intended for more-conservative changes 
  collective development is active on the master branch and possibly on
  the current release branch.  Periodically, the current release branch
  is merged into the master, using the gitmerge function described in
- admin/notes-git-workflow.
+ admin/notes/git-workflow.
  
  If you are fixing a bug that exists in the current release, be sure to
  commit it to the release branch; it will be merged to the master
@@@ -233,17 -233,6 +233,17 @@@ above, are recorded by the tracker wit
  GNU ELPA has a 'debbugs' package that allows accessing the tracker
  database from Emacs.
  
 +Bugs needs regular attention.  A large backlog of bugs is
 +disheartening to the developers, and a culture of ignoring bugs is
 +harmful to users, who expect software that works.  Bugs have to be
 +regularly looked at and acted upon.  Not all bugs are critical, but at
 +the least, each bug needs to be regularly re-reviewed to make sure it
 +is still reproducible.
 +
 +The process of going through old or new bugs and acting on them is
 +called bug triage.  This process is described in the file
 +admin/notes/bug-triage.
 +
  ** Documenting your changes
  
  Any change that matters to end-users should have an entry in etc/NEWS.
@@@ -275,9 -264,10 +275,9 @@@ If your test lasts longer than some fe
  'ert-deftest' definition with ":tags '(:expensive-test)".
  
  To run tests on the entire Emacs tree, run "make check" from the
 -top-level directory.  Most tests are in the directory
 -"test/automated".  From the "test/automated" directory, run "make
 -<filename>" to run the tests for <filename>.el(c).  See "test/README"
 -for more information.
 +top-level directory.  Most tests are in the directory "test/".  From
 +the "test/" directory, run "make <filename>" to run the tests for
 +<filename>.el(c).  See "test/README" for more information.
  
  ** Understanding Emacs internals
  
diff --combined admin/release-process
index 2668ea3b445aed3af966a5e8270012742ec30c2a,e4ef4d94647ef4bec21f6ed6d7f7a3d2a84d69e7..28f2307846d02b46e79b1320c2fc51c2489c7253
@@@ -7,7 -7,7 +7,7 @@@ Each release cycle will be split into t
  ** Phase one: development
  
  The first phase of the release schedule is the "heads-down" working
- period for new features, on the 'master' branch and several feature
+ period for new features, on the 'master' branch and any needed feature
  branches.
  
  ** Phase two: fixing and stabilizing the release branch
@@@ -29,47 -29,59 +29,60 @@@ command to do that, then commit the cha
  'master'.  For major releases, also update the value of
  'customize-changed-options-previous-release'.
  
- The 2 main manuals, the User Manual and the Emacs Lisp Manual, need to
- be proofread, preferably by at least 2 different persons, and any
- uncovered problems fixed.  This is a lot of work, so it is advisable
- to divide the job between several people (see the checklist near the
- end of this file).
+ Each chapter of the two main manuals, the User Manual and the Emacs
+ Lisp Manual, should be proofread, preferably by at least two people.
+ This job is so big that it should be considered a collective
+ responsibility, not fobbed off on just a few people.  After each
+ chapter is checked, mark off the name(s) of those who checked it in
+ the checklist near the end of this file.
  
  In parallel to this phase, 'master' can receive new features, to be
  released in the next release cycle.  From time to time, the master
  branches merges bugfix commits from the "emacs-NN" branch.
+ See admin/gitmerge.el.
  
  * RELEASE-CRITICAL BUGS
  
- Emacs uses the "blocking bug(s)" feature of Debbugs for bugs need to
be addressed in the next release.
+ Emacs uses the "blocking" feature of Debbugs for bugs that need to be
+ addressed in the next release.
  
  Currently, bug#19759 is the tracking bug for release of 25.1 and
 +bug#21966 is the tracking bug for release of 25.2.  Say bug#123 needs
+ bug#21966 is the tracking bug for the next release.  Say bug#123 needs
  to be fixed for Emacs 25.1.  Send a message to control@debbugs.gnu.org
  that says:
  
     block 19759 by 123
  
- Change "block" to "unblock" to unblock the bug.
+ Change "block" to "unblock" to remove a bug from the list.  Closed
+ bugs are not listed as blockers, so you do not need to explicitly
+ unblock one that has been closed.  You may need to force an update of
+ the tracking bug with ctrl-f5/shift-reload to see the latest version.
  
  * TO BE DONE SHORTLY BEFORE RELEASE
  
- ** Make sure the Copyright date reflects the current year in the source
- files.  See 'admin/notes/years' for information about maintaining
- copyright years for GNU Emacs.
+ See 'admin/make-tarball.txt' for the details of making a release or pretest.
+ ** Make sure the Copyright date reflects the current year in all source files.
+ (This should be done each January anyway, regardless of releases.)
+ See admin/update-copyright and admin.el's set-copyright.
+ For more details, see 'admin/notes/years'.
  
  ** Make sure the necessary sources and scripts for any generated files
  are included in the source tarball.  (They don't need to be installed,
- so e.g. admin/ is fine.)
- ** Regenerate AUTHORS by using admin/authors.el
- (The instructions are at the beginning of that file.)
+ so e.g. admin/ is fine.)  This is important for legal compliance.
  
  ** Remove temporary +++/--- lines in NEWS.
  But first make sure there are no unmarked entries, and update the
- documentation (or decide no updates are necessary) for those that
- aren't.
+ documentation (or decide no updates are necessary) for those that aren't.
+ ** Try to reorder NEWS: most important things first, related items together.
+ ** For a major release, add a "New in Emacs XX" section to faq.texi.
+ ** cusver-check from admin.el can help find new defcustoms missing
+ :version tags.
  
  ** Manuals
  Check for node names using problematic characters:
@@@ -85,8 -97,7 +98,7 @@@ For major releases, rewrite the "Antine
  previous version.  The way to do that is read NEWS, pick up the more
  significant changes and new features in the upcoming release, then
  describe the "benefits" from losing those features.  Be funny, use
- humor.  The text written for the previous major release can serve as
- good example.
+ humor.  The text written for the previous releases can serve as an example.
  
  Check cross-references between the manuals (e.g. from emacs to elisp)
  are correct.  You can use something like the following in the info
@@@ -147,10 -158,6 +159,6 @@@ size that the GNU Press are going to us
  I think this is different to what you get if you just use e.g. 'make
  emacs.pdf' (e.g., enable "smallbook").
  
- ** Try to reorder NEWS: most important things first, related items together.
- ** For a major release, add a "New in Emacs XX" section to faq.texi.
  ** Check the keybindings in the refcards are correct, and add any new ones.
  What paper size are the English versions supposed to be on?
  On Debian testing, the packages texlive-lang-czechslovak and
@@@ -172,11 -179,6 +180,6 @@@ pt-br     Rodrigo Rea
  ru    Alex Ott
  sk    Miroslav Vaško
  
- ** cusver-check from admin.el can help find new defcustoms missing
- :version tags.
- ** Add a line to etc/HISTORY for the release version number and date.
  * BUGS
  
  ** Check for modes which bind M-s that conflicts with a new global binding M-s
index 6b9cfc145bcd3a798be0869bc2a8472d7954bf9f,345c37f63dafefa40dc795fa9df806ec14e31e00..085d2c2512d82e709450053b7a44a3bfcd79b6fc
@@@ -68,7 -68,7 +68,7 @@@ if [ -f "$output" ]; the
  fi
  
  # If this is not a Git repository, just generate an empty ChangeLog.
 -test -d .git || {
 +test -e .git || {
    >"$output"
    exit
  }
@@@ -81,7 -81,7 +81,7 @@@
    --ignore-line='^; ' --format='%B' \
    "$gen_origin..$new_origin" >"ChangeLog.tmp" || exit
  
- if test -s "ChangeLog.tmp"; then
+ if test -e "ChangeLog.tmp"; then
  
    # Fix up bug references.
    # This would be better as eg a --transform option to gitlog-to-changelog,
@@@ -99,7 -99,7 +99,7 @@@
    `
    start_year=
    end_year=
-   for year in $years; do
+   for year in ${years:-`date +%Y`}; do
      : ${start_year:=$year}
      end_year=$year
    done
      year_range=$start_year-$end_year
    fi
  
-   # Update gen_origin and append a proper copyright notice.
-   sed -n '
-     1i\
+   # Update gen_origin
+   if test "$gen_origin" != "$new_origin"; then
+       sed -n '
+         1i\
+         /^This file records repository revisions/p
+         s/^commit [0-9a-f]* (exclusive)/commit '"$gen_origin"' (exclusive)/p
+         s/^commit [0-9a-f]* (inclusive)/commit '"$new_origin"' (inclusive)/p
+       ' <ChangeLog.$nmax >>"ChangeLog.tmp" || exit
+   fi
  
-     /^This file records repository revisions/p
-     s/^commit [0-9a-f]* (exclusive)/commit '"$gen_origin"' (exclusive)/p
-     s/^commit [0-9a-f]* (inclusive)/commit '"$new_origin"' (inclusive)/p
+   # Append a proper copyright notice.
+   sed -n '
      /^See ChangeLog.[0-9]* for earlier/,${
         s/ChangeLog\.[0-9]*/ChangeLog.'$nmax'/
         s/\(Copyright[ (C)]*\)[0-9]*-[0-9]*/\1'"$year_range"'/
diff --combined doc/emacs/files.texi
index af9d4d50306822ad1621e996df16290b13794b81,3bbb3cddb3839f2a5d35b0cfa9e8f914fef4e654..ec227e9c2c9725a34c753b915fe27a35fc98af81
@@@ -1281,7 -1281,7 +1281,7 @@@ The value of @code{diff-switches} shoul
  @c Note that the actual name of the info file is diffutils.info,
  @c but it adds a dir entry for diff too.
  @c On older systems, only "info diff" works, not "info diffutils".
- @xref{Top,, Diff, diff, Comparing and Merging Files}, for more
+ @xref{Top,, Diff, diffutils, Comparing and Merging Files}, for more
  information about the @command{diff} program.
  
    The output of the @code{diff} command is shown using a major mode
@@@ -1968,9 -1968,6 +1968,9 @@@ point.  Partial Completion mode offers 
  major mode, you can type @kbd{C-c C-c} (@code{image-toggle-display})
  to toggle between displaying the file as an image in the Emacs buffer,
  and displaying its underlying text (or raw byte) representation.
 +Additionally you can type @kbd{C-c C-x} (@code{image-toggle-hex-display})
 +to toggle between displaying the file as an image in the Emacs buffer,
 +and displaying it in hex representation.
  Displaying the file as an image works only if Emacs is compiled with
  support for displaying such images.  If the displayed image is wider
  or taller than the frame, the usual point motion keys (@kbd{C-f},
diff --combined doc/emacs/misc.texi
index 5786bc40709218e3b158da897c6e79ee5ef78e67,497a4abd71b4f358dcea10e186f955f67bc27ca2..b614ed221a015596fd39e8448043e0eb1a9f1ccc
@@@ -1580,44 -1580,6 +1580,44 @@@ option.  @xref{Initial Options}.  When 
  calls @code{server-start} after initialization, and returns control to
  the calling terminal instead of opening an initial frame; it then
  waits in the background, listening for edit requests.
 +
 +@cindex socket activation, systemd, Emacs
 +@item
 +An external process can invoke the Emacs server when a connection
 +event occurs upon a specified socket and pass the socket to the new
 +Emacs server process.  An instance of this is @command{systemd}'s
 +socket functionality: the @command{systemd} service creates a socket and
 +listens for connections on it; when @command{emacsclient} connects to
 +it for the first time, @command{systemd} can launch the Emacs server
 +and hand over the socket to it for servicing @command{emacsclient}
 +connections.  A setup to use this functionality could be:
 +
 +@file{~/.config/systemd/user/emacs.service}:
 +@example
 +[Unit]
 +Description=Emacs
 +
 +[Service]
 +Type=forking
 +ExecStart=/path/to/emacs --daemon
 +ExecStop=/path/to/emacsclient --eval "(kill-emacs)"
 +Restart=always
 +
 +[Install]
 +WantedBy=default.target
 +@end example
 +
 +@file{~/.config/systemd/user/emacs.socket}:
 +@example
 +[Socket]
 +ListenStream=/path/to/.emacs.socket
 +
 +[Install]
 +WantedBy=sockets.target
 +@end example
 +
 +The @code{ListenStream} path will be the path that Emacs listens for
 +connections from @command{emacsclient}; this is a file of your choice.
  @end itemize
  
  @cindex @env{TEXEDIT} environment variable
@@@ -1634,10 -1596,17 +1634,17 @@@ variable to @samp{emacsclient +%d %s}.
    You can run multiple Emacs servers on the same machine by giving
  each one a unique @dfn{server name}, using the variable
  @code{server-name}.  For example, @kbd{M-x set-variable @key{RET}
- server-name @key{RET} foo @key{RET}} sets the server name to
+ server-name @key{RET} "foo" @key{RET}} sets the server name to
  @samp{foo}.  The @code{emacsclient} program can specify a server by
  name, using the @samp{-s} option (@pxref{emacsclient Options}).
  
+   If you want to run multiple Emacs daemons (@pxref{Initial Options}),
+ you can give each daemon its own server name like this:
+ @example
+   emacs --eval "(setq server-name \"foo\")" --daemon
+ @end example
  @findex server-eval-at
    If you have defined a server by a unique server name, it is possible
  to connect to the server from another Emacs instance and evaluate Lisp
diff --combined doc/emacs/trouble.texi
index f4e3393ea9de9a6492b86ed3ce995552157ed0cf,6f6071b446a69cfba2fcbd9b9c6378ba54921712..25f296e52c3bdd274f769f36918d1b6246d894ab
@@@ -417,22 -417,19 +417,22 @@@ first @kbd{C-g} properly, then the seco
  shell.
  
    When you resume Emacs after a suspension caused by emergency escape,
 -it asks two questions before going back to what it had been doing:
 +it reports the resumption and asks a question or two before going back
 +to what it had been doing:
  
  @example
 +Emacs is resuming after an emergency escape.
  Auto-save? (y or n)
  Abort (and dump core)? (y or n)
  @end example
  
  @noindent
 -Answer each one with @kbd{y} or @kbd{n} followed by @key{RET}.
 +Answer each question with @kbd{y} or @kbd{n} followed by @key{RET}.
  
    Saying @kbd{y} to @samp{Auto-save?} causes immediate auto-saving of
  all modified buffers in which auto-saving is enabled.  Saying @kbd{n}
 -skips this.
 +skips this.  This question is omitted if Emacs is in a state where
 +auto-saving cannot be done safely.
  
    Saying @kbd{y} to @samp{Abort (and dump core)?} causes Emacs to
  crash, dumping core.  This is to enable a wizard to figure out why
@@@ -1178,7 -1175,7 +1178,7 @@@ se
  @url{http://www.gnu.org/prep/standards/html_node/Change-Log-Concepts.html},
  @end ifset
  @xref{Change Log Concepts, Change Log Concepts,
- Change Log Concepts, gnu-coding-standards, GNU Coding Standards}.
+ Change Log Concepts, standards, GNU Coding Standards}.
  
  @item
  When you write the fix, keep in mind that we can't install a change that
diff --combined doc/misc/eww.texi
index f15e2f2518ee434d977c1bf2eef6a266a161a521,7726a8d3dc4bfed7e56ffeab337094af18d038ce..81f97a9db850d0fee8470c75a163070d51dd924a
@@@ -109,12 -109,6 +109,12 @@@ only display this part.  This usually g
    The @kbd{F} command (@code{eww-toggle-fonts}) toggles whether to use
  variable-pitch fonts or not.  This sets the @code{shr-use-fonts} variable.
  
 +@findex eww-toggle-colors
 +@findex shr-use-colors
 +@kindex F
 +  The @kbd{C} command (@code{eww-toggle-colors}) toggles whether to use
 +HTML-specified colors or not.  This sets the @code{shr-use-colors} variable.
 +
  @findex eww-download
  @vindex eww-download-directory
  @kindex d
@@@ -164,16 -158,12 +164,16 @@@ You can view stored bookmarks with @kbd
  (@code{eww-list-bookmarks}).  This will open the bookmark buffer
  @file{*eww bookmarks*}.
  
 +@findex eww-switch-to-buffer
  @findex eww-list-buffers
 +@kindex s
  @kindex S
  @cindex Multiple Buffers
    To get summary of currently opened EWW buffers, press @kbd{S}
  (@code{eww-list-buffers}).  The @file{*eww buffers*} buffer allows you
 -to quickly kill, flip through and switch to specific EWW buffer.
 +to quickly kill, flip through and switch to specific EWW buffer.  To
 +switch EWW buffers through a minibuffer prompt, press @kbd{s}
 +(@code{eww-switch-to-buffer}).
  
  @findex eww-browse-with-external-browser
  @vindex shr-external-browser
@@@ -261,7 -251,7 +261,7 @@@ variables @code{shr-color-visible-dista
    In addition to maintaining the history at run-time, EWW will also
  save the partial state of its buffers (the URIs and the titles of the
  pages visited) in the desktop file if one is used.  @xref{Saving Emacs
- Sessions, , emacs, The GNU Emacs Manual}.
+ Sessions,,, emacs, The GNU Emacs Manual}.
  
  @vindex eww-desktop-remove-duplicates
    EWW history may sensibly contain multiple entries for the same page
diff --combined doc/misc/url.texi
index 097f626e71893aca4db457bb241bbd02362f58cd,91cb6b54a847a13fda25601c53e1cb2ac9ad6480..06d2e559c3859223e61283d7008265a74723806c
@@@ -289,7 -289,7 +289,7 @@@ string or a parsed URL structure.  If i
  passed through @code{url-encode-url} before using it, to ensure that
  it is properly URI-encoded (@pxref{URI Encoding}).
  
 -@defun url-retrieve-synchronously url silent no-cookies
 +@defun url-retrieve-synchronously url &optional silent no-cookies timeout
  This function synchronously retrieves the data specified by @var{url},
  and returns a buffer containing the data.  The return value is
  @code{nil} if there is no data associated with the URL (as is the case
@@@ -297,9 -297,7 +297,9 @@@ for @code{dired}, @code{info}, and @cod
  
  If the optional argument @var{silent} is non-@code{nil}, progress
  messages are suppressed.  If the optional argument @var{no-cookies} is
 -non-@code{nil}, cookies are not stored or sent.
 +non-@code{nil}, cookies are not stored or sent.  If the optional
 +argument @var{timeout} is non-@code{nil}, it should be a number that
 +says (in seconds) how long to wait for a response before giving up.
  @end defun
  
  @defun url-retrieve url callback &optional cbargs silent no-cookies
@@@ -423,12 -421,6 +423,12 @@@ cookies, if there are any.  You can rem
  @kbd{C-k} (@code{url-cookie-delete}) command.
  @end defun
  
 +@defun url-cookie-delete-cookies &optional regexp
 +This function takes a regular expression as its parameters and deletes
 +all cookies from that domain.  If @var{regexp} is @code{nil}, delete
 +all cookies.
 +@end defun
 +
  @defopt url-cookie-file
  The file in which cookies are stored, defaulting to @file{cookies} in
  the directory specified by @code{url-configuration-directory}.
@@@ -828,12 -820,12 +828,12 @@@ The file transfer protocol.  @xref{file
  
  @item ssh
  @cindex ssh
- The secure shell protocol.  @xref{Inline Methods,,, tramp, The Tramp
+ The secure shell protocol.  @xref{Inline methods,,, tramp, The Tramp
  Manual}.
  
  @item scp
  @cindex scp
- The secure file copy protocol.  @xref{External Methods,,, tramp, The
+ The secure file copy protocol.  @xref{External methods,,, tramp, The
  Tramp Manual}.
  
  @item rsync
@@@ -1343,16 -1335,10 +1343,16 @@@ Connect directly
  @end defopt
  
  @defopt url-user-agent
 -The User Agent string used for sending HTTP/HTTPS requests.  The value
 -should be a string or a function of no arguments that returns a
 -string.  The default value is @w{@samp{User-Agent: @var{package-name}
 -URL/Emacs}}, where @var{package-name} is the value of
 +The User Agent string used for sending @acronym{HTTP}/@acronym{HTTPS}
 +requests.  The value should be @code{nil}, which means that no
 +@samp{User-Agent} header is generated, @code{default}, which means
 +that a string is generated based on the setting of
 +@code{url-privacy-leve}, a string or a function of no arguments that
 +returns a string.
 +
 +The default is @code{default}, which means that the
 +@w{@samp{User-Agent: @var{package-name} URL/Emacs}} string will be
 +generated, where @var{package-name} is the value of
  @code{url-package-name} and its version, if they are non-@code{nil}.
  @end defopt
  
diff --combined etc/NEWS
index 4e8567e2fdbd428c89bce05ace4d6f0f044d2c6a,670465f2ab852060aed14c4d713f80601aa3d3f9..d1eadd56a21fa1dc0b406ccd80fdd3e5617c97ee
+++ b/etc/NEWS
@@@ -22,483 -22,6 +22,483 @@@ Temporary note
  When you add a new item, use the appropriate mark if you are sure it applies,
  otherwise leave it unmarked.
  
 +\f
 +* Installation Changes in Emacs 25.2
 +
 +** The new option 'configure --enable-gcc-warnings=warn-only' causes
 +GCC to issue warnings without stopping the build.  This behavior is
 +now the default in developer builds.  As before, use
 +'--disable-gcc-warnings' to suppress GCC's warnings, and
 +'--enable-gcc-warnings' to stop the build if GCC issues warnings.
 +
 ++++
 +** The Emacs server now has socket-launching support.  This allows
 +socket based activation, where an external process like systemd can
 +invoke the Emacs server process upon a socket connection event and
 +hand the socket over to Emacs.  Emacs uses this socket to service
 +emacsclient commands.  This new functionality can be disabled with the
 +configure option '--disable-libsystemd'.
 +
 +** New configure option '--disable-build-details' attempts to build an
 +Emacs that is more likely to be reproducible; that is, if you build
 +and install Emacs twice, the second Emacs is a copy of the first.
 +Deterministic builds omit the build date from the output of the
 +emacs-version and erc-cmd-SV functions, and the leave the following
 +variables nil: emacs-build-system, emacs-build-time,
 +erc-emacs-build-time.
 +
 +** Emacs no longer works on IRIX.  We expect that Emacs users are not
 +affected by this, as SGI stopped supporting IRIX in December 2013.
 +
 +\f
 +* Startup Changes in Emacs 25.2
 +
 +\f
 +* Changes in Emacs 25.2
 +
 +---
 +** 'find-library-name' will now fall back on looking at 'load-history'
 +to try to locate libraries that have been loaded with an explicit path
 +outside 'load-path'.
 +
 ++++
 +** Faces in 'minibuffer-prompt-properties' no longer overwrite properties
 +in the text in functions like 'read-from-minibuffer', but instead are
 +added to the end of the face list.  This allows users to say things
 +like '(read-from-minibuffer (propertize "Enter something: " 'face 'bold))'.
 +
 ++++
 +** The new variable 'extended-command-suggest-shorter' has been added
 +to control whether to suggest shorter 'M-x' commands or not.
 +
 +---
 +** icomplete now respects 'completion-ignored-extensions'.
 +
 ++++
 +** Non-breaking hyphens are now displayed with the 'nobreak-hyphen'
 +face instead of the 'escape-glyph' face.
 +
 +---
 +** 'C-x h' ('mark-whole-buffer') will now avoid marking the prompt
 +part of minibuffers.
 +
 +---
 +** 'find-library' now takes a prefix argument to pop to a different
 +window.
 +
 +** 'find-library', 'help-function-def' and 'help-variable-def' now run
 +'find-function-after-hook'.
 +
 +---
 +** 'process-attributes' on Darwin systems now returns more information.
 +
 ++++
 +** Several accessors for the value returned by 'file-attributes'
 +have been added.  They are: 'file-attribute-type',
 +'file-attribute-link-number', 'file-attribute-user-id',
 +'file-attribute-group-id', 'file-attribute-access-time',
 +'file-attribute-modification-time',
 +'file-attribute-status-change-time', 'file-attribute-size',
 +'file-attribute-modes', 'file-attribute-inode-number', and
 +'file-attribute-device-number'.
 +
 ++++
 +** The new function 'buffer-hash' computes compute a fast, non-consing
 +hash of a buffer's contents.
 +
 +---
 +** 'fill-paragraph' no longer marks the buffer as changed unless it
 +actually changed something.
 +
 +---
 +** The locale language name 'ca' is now mapped to the language
 +environment 'Catalan', which has been added.
 +
 +---
 +** 'align-regexp' has a separate history for its interactive argument.
 +'align-regexp' no longer shares its history with all other
 +history-less functions that use 'read-string'.
 +
 ++++
 +** The networking code has been reworked so that it's more
 +asynchronous than it was (when specifying :nowait t in
 +'make-network-process').  How asynchronous it is varies based on the
 +capabilities of the system, but on a typical GNU/Linux system the DNS
 +resolution, the connection, and (for TLS streams) the TLS negotiation
 +are all done without blocking the main Emacs thread.  To get
 +asynchronous TLS, the TLS boot parameters have to be passed in (see
 +the manual for details).
 +
 +Certain process oriented functions (like 'process-datagram-address')
 +will block until socket setup has been performed.  The recommended way
 +to deal with asynchronous sockets is to avoid interacting with them
 +until they have changed status to "run".  This is most easily done
 +from a process sentinel.
 +
 +** 'make-network-process' and 'open-network-stream' sometimes allowed
 +:service to be an integer string (e.g., :service "993") and sometimes
 +required an integer (e.g., :service 993).  This difference has been
 +eliminated, and integer strings work everywhere.
 +
 +** It is possible to disable attempted recovery on fatal signals.
 +
 +Two new variables support disabling attempts to recover from stack
 +overflow and to avoid automatic auto-save when Emacs is delivered a
 +fatal signal.  'attempt-stack-overflow-recovery', if set to 'nil',
 +will disable attempts to recover from C stack overflows; Emacs will
 +then crash as with any other fatal signal.
 +'attempt-orderly-shutdown-on-fatal-signal', if set to 'nil', will
 +disable attempts to auto-save the session and shut down in an orderly
 +fashion when Emacs receives a fatal signal; instead, Emacs will
 +terminate immediately.  Both variables are non-'nil' by default.
 +These variables are for users who would like to avoid the small
 +probability of data corruption due to techniques Emacs uses to recover
 +in these situations.
 +
 ++++
 +** File local and directory local variables are now initialized each
 +time the major mode is set, not just when the file is first visited.
 +These local variables will thus not vanish on setting a major mode.
 +
 ++++
 +** A second dir-local file (.dir-locals-2.el) is now accepted.
 +See the variable 'dir-locals-file-2' for more information.
 +
 +---
 +** International domain names (IDNA) are now encoded via the new
 +puny.el library, so that one can visit web sites with non-ASCII URLs.
 +
 ++++
 +** The new 'timer-list' command lists all active timers in a buffer,
 +where you can cancel them with the 'c' command.
 +
 ++++
 +** The new function 'read-multiple-choice' prompts for multiple-choice
 +questions, with a handy way to display help texts.
 +
 +\f
 +* Editing Changes in Emacs 25.2
 +
 ++++
 +** New bindings for 'query-replace-map'.
 +'undo', undo the last replacement; bound to 'u'.
 +'undo-all', undo all replacements; bound to 'U'.
 +
 +\f
 +* Changes in Specialized Modes and Packages in Emacs 25.2
 +
 +** Compilation mode
 +
 +---
 +*** Messages from CMake are now recognized.
 +
 +** Dired
 +
 ++++
 +*** In wdired, when editing files to contain slash characters,
 +the resulting directories are automatically created.  Whether to do
 +this is controlled by the 'wdired-create-parent-directories' variable.
 +
 ++++
 +*** 'W' is now bound to 'browse-url-of-dired-file', and is useful for
 +viewing HTML files and the like.
 +
 +** Ediff
 +
 +*** Ediff can be prevented from pausing 1 second after reaching a
 +breakpoint (e.g. with "f" and "o") by customizing the new option
 +'edebug-sit-on-break'.
 +
 +** eww
 +
 ++++
 +*** A new 's' command for switching to another eww buffer via the minibuffer.
 +
 +---
 +*** The 'o' command ('shr-save-contents') has moved to 'O' to avoid collision
 +with the 'o' command from 'image-map'.
 +
 ++++
 +*** A new command 'C' ('eww-toggle-colors') can be used to toggle
 +whether to use the HTML-specified colors or not.  The user can also
 +customize the 'shr-use-colors' variable.
 +
 +---
 +*** Images that are being loaded are now marked with gray
 +"placeholder" images of the size specified by the HTML.  They are then
 +replaced by the real images asynchronously, which will also now
 +respect width/height HTML specs (unless they specify widths/heights
 +bigger than the current window).
 +
 +** Images
 +
 ++++
 +*** Images are automatically scaled before displaying based on the
 +'image-scaling-factor' variable (if Emacs supports scaling the images
 +in question).
 +
 ++++
 +*** Images inserted with 'insert-image' and related functions get a
 +keymap put into the text properties (or overlays) that span the
 +image.  This keymap binds keystrokes for manipulating size and
 +rotation, as well as saving the image to a file.  These commands are
 +also available in 'image-mode'.
 +
 ++++
 +*** A new library for creating and manipulating SVG images has been
 +added.  See the "SVG Images" section in the lispref manual for
 +details.
 +
 ++++
 +*** New setf-able function to access and set image parameters is
 +provided: 'image-property'.
 +
 +---
 +** The default 'Info-default-directory-list' no longer checks some obsolete
 +directory suffixes (gnu, gnu/lib, gnu/lib/emacs, emacs, lib, lib/emacs)
 +when searching for info directories.
 +
 ++++
 +** The commands that add ChangeLog entries now prefer a VCS root directory
 +for the ChangeLog file, if none already exists.  Customize
 +'change-log-directory-files' to nil for the old behavior.
 +
 +---
 +** Support for non-string values of 'time-stamp-format' has been removed.
 +
 +** Message
 +
 +---
 +*** 'message-use-idna' now defaults to t (because Emacs comes with
 +built-in IDNA support now).
 +
 +---
 +*** The 'message-valid-fqdn-regexp' variable has been removed, since
 +there are now top-level domains added all the time.  Message will no
 +longer warn about sending emails to top-level domains it hasn't heard
 +about.
 +
 +*** 'message-beginning-of-line' (bound to C-a) understands folded headers.
 +In 'visual-line-mode' it will look for the true beginning of a header
 +while in non-'visual-line-mode' it will move the point to the indented
 +header's value.
 +
 +** Tramp
 +
 ++++
 +*** New connection method "sg", which supports editing files under a
 +different group ID.
 +
 ++++
 +*** New connection method "doas" for OpenBSD hosts.
 +
 +---
 +** 'auto-revert-use-notify' is set back to t in 'global-auto-revert-mode'.
 +
 +** CSS mode
 +
 +---
 +*** Support for completing attribute values, at-rules, bang-rules, and
 +HTML tags using the 'completion-at-point' command.
 +
 ++++
 +** Emacs now supports character name escape sequences in character and
 +string literals.  The syntax variants \N{character name} and
 +\N{U+code} are supported.
 +
 ++++
 +** Prog mode has some support for multi-mode indentation.
 +This allows better indentation support in modes that support multiple
 +programming languages in the same buffer, like literate programming
 +environments or ANTLR programs with embedded Python code.
 +
 +A major mode can provide indentation context for a sub-mode through
 +the 'prog-indentation-context' variable.  To support this, modes that
 +provide indentation should use 'prog-widen' instead of 'widen' and
 +'prog-first-column' instead of a literal zero.  See the node
 +"Mode-Specific Indent" in the ELisp manual for more details.
 +
 +** ERC
 +
 +*** New variable 'erc-default-port-tls' used to connect to TLS IRC
 +servers.
 +
 +** URL
 +
 ++++
 +*** The new function 'url-cookie-delete-cookie' can be used to
 +programmatically delete all cookies, or cookies from a specific
 +domain.
 +
 ++++
 +*** 'url-retrieve-synchronously' now takes an optional timeout parameter.
 +
 +---
 +*** The URL package now support HTTPS over proxies supporting CONNECT.
 +
 ++++
 +*** 'url-user-agent' now defaults to 'default', and the User-Agent
 +string is computed dynamically based on 'url-privacy-level'.
 +
 +** VC and related modes
 +
 +---
 +*** The VC state indicator in the mode line now defaults to more
 +colorful faces to make it more obvious to the user what the state is.
 +See the 'vc-faces' customization group.
 +
 +\f
 +* New Modes and Packages in Emacs 25.2
 +
 +\f
 +* Incompatible Lisp Changes in Emacs 25.2
 +
 ++++
 +** Resizing a frame no longer runs 'window-configuration-change-hook'.
 +Put your function on 'window-size-change-functions' instead.
 +
 +** 'C-up', 'C-down', 'C-left' and 'C-right' are now defined in term
 +mode to send the same escape sequences that xterm does.  This makes
 +things like forward-word in readline work.
 +
 +---
 +** hideshow mode got four key bindings that are analogous to outline
 +mode bindings: 'C-c @ C-a', 'C-c @ C-t', 'C-c @ C-d', and 'C-c @ C-e.'
 +
 +** The grep/rgrep/lgrep functions will now ask about saving files
 +before running.  This is controlled by the 'grep-save-buffers'
 +variable.
 +
 ++++
 +** The variable 'text-quoting-style' no longer affects the treatment
 +of curved quotes in format arguments to functions like 'message' and
 +'format-message'.  In particular, when this variable's value is
 +'grave', all quotes in formats are output as-is.
 +
 +** Functions like 'check-declare-file' and 'check-declare-directory'
 +now generate less chatter and more-compact diagnostics.  The auxiliary
 +function 'check-declare-errmsg' has been removed.
 +
 +\f
 +* Lisp Changes in Emacs 25.2
 +
 +** New var syntax-ppss-table to control the syntax-table used in syntax-ppss.
 +
 ++++
 +** 'define-derived-mode' can now specify an :after-hook form, which
 +gets evaluated after the new mode's hook has run.  This can be used to
 +incorporate configuration changes made in the mode hook into the
 +mode's setup.
 +
 +** Autoload files can be generated without timestamps,
 +by setting 'autoload-timestamps' to nil.
 +FIXME As an experiment, nil is the current default.
 +If no insurmountable problems before next release, it can stay that way.
 +
 +** 'ert-with-function-mocked' of 'ert-x package allows mocking of functions
 +in unit tests.
 +
 +---
 +** 'gnutls-boot' now takes a parameter :complete-negotiation that says
 +that negotiation should complete even on non-blocking sockets.
 +
 ++++
 +** New functions 'window-pixel-width-before-size-change' and
 +'window-pixel-height-before-size-change' support detecting which
 +window changed size when 'window-size-change-functions' are run.
 +
 ++++
 +** New function 'display-buffer-reuse-mode-window' is an action function
 +suitable for use in 'display-buffer-alist'. For example, to avoid creating
 +a new window when opening man pages when there's already one, use
 +(add-to-list 'display-buffer-alist
 +     '("\\`\\*Man .*\\*\\'" .
 +       (display-buffer-reuse-mode-window
 +        (inhibit-same-window . nil)
 +        (mode . Man-mode))))
 +
 +---
 +** There is now a new variable 'flyspell-sort-corrections-function'
 +that allows changing the way corrections are sorted.
 +
 +---
 +** The new command 'fortune-message' has been added, which displays
 +fortunes in the echo area.
 +
 ++++
 +** New function 'func-arity' returns information about the argument list
 +of an arbitrary function.  This generalizes 'subr-arity' for functions
 +that are not built-in primitives.  We recommend using this new
 +function instead of 'subr-arity'.
 +
 ++++
 +** 'parse-partial-sexp' state has a new element.  Element 10 is
 +non-nil when the last character scanned might be the first character
 +of a two character construct, i.e., a comment delimiter or escaped
 +character.  Its value is the syntax of that last character.
 +
 ++++
 +** 'parse-partial-sexp''s state, element 9, has now been confirmed as
 +permanent and documented, and may be used by Lisp programs.  Its value
 +is a list of currently open parenthesis positions, starting with the
 +outermost parenthesis.
 +
 +---
 +** 'read-color' will now display the color names using the color itself
 +as the background color.
 +
 +** The function 'redirect-debugging-output' now works on platforms
 +other than GNU/Linux.
 +
 ++++
 +** The new function 'string-version-lessp' compares strings by
 +interpreting consecutive runs of numerical characters as numbers, and
 +compares their numerical values.  According to this predicate,
 +"foo2.png" is smaller than "foo12.png".
 +
 ++++
 +** The new function 'char-from-name' converts a Unicode name string
 +to the corresponding character code.
 +
 ++++
 +** New functions 'sxhash-eq' and 'sxhash-eql' return hash codes of a
 +Lisp object suitable for use with 'eq' and 'eql' correspondingly.  If
 +two objects are 'eq' ('eql'), then the result of 'sxhash-eq'
 +('sxhash-eql') on them will be the same.
 +
 ++++
 +** Function 'sxhash' has been renamed to 'sxhash-equal' for
 +consistency with the new functions.  For compatibility, 'sxhash'
 +remains as an alias to 'sxhash-equal'.
 +
 ++++
 +** Time conversion functions that accept a time zone rule argument now
 +allow it to be OFFSET or a list (OFFSET ABBR), where the integer
 +OFFSET is a count of seconds east of Universal Time, and the string
 +ABBR is a time zone abbreviation.  The affected functions are
 +'current-time-string', 'current-time-zone', 'decode-time',
 +'format-time-string', and 'set-time-zone-rule'.
 +
 ++++
 +*** New basic face 'fixed-pitch-serif', for a fixed-width font with serifs.
 +The Info-quoted and tex-verbatim faces now default to inheriting from it.
 +
 +\f
 +* Changes in Emacs 25.2 on Non-Free Operating Systems
 +
 +** Intercepting hotkeys on Windows 7 and later now works better.
 +The new keyboard hooking code properly grabs system hotkeys such as
 +Win-* and Alt-TAB, in a way that Emacs can get at them before the
 +system.  This makes the 'w32-register-hot-key' functionality work
 +again on all versions of MS-Windows starting with Windows 7.  On
 +Windows NT and later you can now register any hotkey combination.  (On
 +Windows 9X, the previous limitations, spelled out in the Emacs manual,
 +still apply.)
 +
 +** 'convert-standard-filename' no longer mirrors slashes on MS-Windows.
 +Previously, on MS-Windows this function converted slash characters in
 +file names into backslashes.  It no longer does that.
 +
  \f
  * Installation Changes in Emacs 25.1
  
@@@ -1110,11 -633,11 +1110,11 @@@ as many other symbols like U+249C (PARE
  A).
  
  Character folding is enabled by customizing 'search-default-mode' to
- the value 'character-fold-to-regexp'.  You can also toggle character
+ the value 'char-fold-to-regexp'.  You can also toggle character
  folding in the middle of a search by typing 'M-s ''.
  
  'query-replace' honors character folding if the new variable
- 'replace-character-fold' is customized to a non-nil value.
+ 'replace-char-fold' is customized to a non-nil value.
  
  +++
  *** New user option 'search-default-mode'.
@@@ -1124,9 -647,9 +1124,9 @@@ value, nil specifies that Isearch does 
  as in previous Emacs versions).
  
  +++
- *** New function 'character-fold-to-regexp' can be used
+ *** New function 'char-fold-to-regexp' can be used
  by searching commands to produce a regexp matching anything that
- character-folds into STRING.
+ char-folds into STRING.
  
  +++
  *** The new 'M-s M-w' key binding uses eww to search the web for the
diff --combined etc/PROBLEMS
index 49dada970bb0c7dd0f2c0b048ff27e4d07bc2ce8,84d39a490a88102b81749528501adaadb153122a..bc814169b79c5bbe1872f6335863e91362353501
@@@ -542,6 -542,26 +542,6 @@@ Other systems allow to set LD_RUN_PATH 
  Emacs is linked.  With LD_RUN_PATH set, the linker will include a
  specified run-time search path in the executable.
  
 -On some systems, Emacs can crash due to problems with dynamic
 -linking.  Specifically, on SGI Irix 6.5, crashes were reported with
 -backtraces like this:
 -
 -  (dbx) where
 -   0 strcmp(0xf49239d, 0x4031184, 0x40302b4, 0x12, 0xf0000000, 0xf4923aa, 0x0, 0x492ddb2) ["/xlv22/ficus-jan23/work/irix/lib/libc/libc_n32_M3_ns/strings/strcmp.s":35, 0xfb7e480]
 -   1 general_find_symbol(0xf49239d, 0x0, 0x0, 0x0, 0xf0000000, 0xf4923aa, 0x0, 0x492ddb2)
 - ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld.c":2140, 0xfb65a98]
 -   2 resolve_symbol(0xf49239d, 0x4031184, 0x0, 0xfbdd438, 0x0, 0xf4923aa, 0x0, 0x492ddb2)
 - ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld.c":1947, 0xfb657e4]
 -   3 lazy_text_resolve(0xd18, 0x1a3, 0x40302b4, 0x12, 0xf0000000, 0xf4923aa, 0x0, 0x492ddb2)
 - ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld.c":997, 0xfb64d44]
 -   4 _rld_text_resolve(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
 - ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld_bridge.s":175, 0xfb6032c]
 -
 -('rld' is the dynamic linker.)  We don't know why this
 -happens, but setting the environment variable LD_BIND_NOW to 1 (which
 -forces the dynamic linker to bind all shared objects early on) seems
 -to work around the problem.
 -
  Please refer to the documentation of your dynamic linker for details.
  
  *** When you run Ispell from Emacs, it reports a "misalignment" error.
@@@ -578,6 -598,17 +578,6 @@@ you have a personal configuration file 
  can cause this error.  Remove that file, execute 'ispell-kill-ispell'
  in Emacs, and then try spell-checking again.
  
 -*** Emacs eats all file descriptors when using kqueue file notifications.
 -See <http://debbugs.gnu.org/22814>.
 -
 -When you have a large number of buffers running auto-revert-mode, and
 -Emacs is configured to use the kqueue file notification library, it
 -uses an own file descriptor for every watched file.  On systems with a
 -small limit of file descriptors allowed per process, like OS X, you
 -could run out of file descriptors.  You won't be able to open new files.
 -
 -auto-revert-use-notify is set to nil in global-auto-revert-mode, therefore.
 -
  * Runtime problems related to font handling
  
  ** Characters are displayed as empty boxes or with wrong font under X.
@@@ -718,6 -749,20 +718,20 @@@ the following variables: tex-font-scrip
  lower/raise); tex-suscript-height-ratio (how much smaller than
  normal); tex-suscript-height-minimum (minimum height).
  
+ ** Screen refresh is slow when there are special characters for which no suitable font is available
+ If the display is too slow in refreshing when you scroll to a new
+ region, or when you edit the buffer, it might be due to the fact that
+ some characters cannot be displayed in the default font, and Emacs is
+ spending too much time in looking for a suitable font to display them.
+ You can suspect this if you have several characters that are displayed
+ as small rectangles containing a hexadecimal code inside.
+ The solution is to install the appropriate fonts on your machine. For
+ instance if you are editing a text with a lot of math symbols, then
+ installing a font like 'Symbola' should solve this problem.
  * Internationalization problems
  
  ** M-{ does not work on a Spanish PC keyboard.
@@@ -909,6 -954,21 +923,21 @@@ into Meta.  This is because of the grea
  
  ** Window-manager and toolkit-related problems
  
+ *** Emacs built with GTK+ toolkit produces corrupted display on HiDPI screen
+ This can happen if you set GDK_SCALE=2 in the environment or in your
+ '.xinitrc' file.  (This setting is usually accompanied by
+ GDK_DPI_SCALE=0.5.)  Emacs can not support these settings correctly,
+ as it doesn't use GTK+ exclusively.  The result is that sometimes
+ widgets like the scroll bar are displayed incorrectly, and frames
+ could be displayed "cropped" to only part of the stuff that should be
+ displayed.
+ The workaround is to explicitly disable these settings when invoking
+ Emacs, for example (from a Posix shell prompt):
+   $ GDK_SCALE=1 GDK_DPI_SCALE=1 emacs
  *** Metacity: Resizing Emacs or ALT-Tab causes X to be unresponsive.
  
  This happens sometimes when using Metacity.  Resizing Emacs or ALT-Tab:bing
@@@ -1909,6 -1969,14 +1938,6 @@@ This seems to be a GCC optimization bu
  and -g -O2) and GCC 4.2.3 (-g -O and -g -O2).  You can fix this by
  compiling with GCC 4.2.3 or CC 5.7, with no optimizations.
  
 -** Irix
 -
 -*** Irix: Trouble using ptys, or running out of ptys.
 -
 -The program mkpts (which may be in '/usr/adm' or '/usr/sbin') needs to
 -be set-UID to root, or non-root programs like Emacs will not be able
 -to allocate ptys reliably.
 -
  * Runtime problems specific to MS-Windows
  
  ** Emacs on Windows 9X requires UNICOWS.DLL
@@@ -2561,51 -2629,70 +2590,70 @@@ See <URL:http://debbugs.gnu.org/327>, <
  
  ** Dumping
  
- *** Segfault during 'make bootstrap' under the Linux kernel.
+ *** Segfault during 'make'
  
- In Red Hat Linux kernels, "Exec-shield" functionality is enabled by
- default, which creates a different memory layout that can break the
- emacs dumper.  Emacs tries to handle this at build time, but if this
- fails, the following instructions may be useful.
+ If Emacs segfaults when 'make' executes one of these commands:
  
- Exec-shield is enabled on your system if
+   LC_ALL=C ./temacs -batch -l loadup bootstrap
+   LC_ALL=C ./temacs -batch -l loadup dump
  
-     cat /proc/sys/kernel/exec-shield
+ the problem may be due to inadequate workarounds for address space
+ layout randomization (ASLR), an operating system feature that
+ randomizes the virtual address space of a process.  ASLR is commonly
+ enabled in Linux and NetBSD kernels, and is intended to deter exploits
+ of pointer-related bugs in applications.  If ASLR is enabled, the
+ command:
  
- prints a value other than 0.  (Please read your system documentation
- for more details on Exec-shield and associated commands.)
+    cat /proc/sys/kernel/randomize_va_space  # GNU/Linux
+    sysctl security.pax.aslr.global          # NetBSD
  
- Additionally, Linux kernel versions since 2.6.12 randomize the virtual
- address space of a process by default.  If this feature is enabled on
- your system, then
+ outputs a nonzero value.
  
-    cat /proc/sys/kernel/randomize_va_space
+ These segfaults should not occur on most modern systems, because the
+ Emacs build procedure uses the command 'setfattr' or 'paxctl' to mark
+ the Emacs executable as requiring non-randomized address space, and
+ Emacs uses the 'personality' system call to disable address space
+ randomization when dumping.  However, older kernels may not support
+ 'setfattr', 'paxctl', or 'personality', and newer Linux kernels have a
+ secure computing mode (seccomp) that can be configured to disable the
+ 'personality' call.
  
- prints a value other than 0.
+ It may be possible to work around the 'personality' problem in a newer
+ Linux kernel by configuring seccomp to allow the 'personality' call.
+ For example, if you are building Emacs under Docker, you can run the
+ Docker container with a security profile that allows 'personality' by
+ using Docker's --security-opt option with an appropriate profile; see
+ <https://docs.docker.com/engine/security/seccomp/>.
  
- When these features are enabled, building Emacs may segfault during
- the execution of this command:
+ To work around the ASLR problem in either an older or a newer kernel,
+ you can temporarily disable the feature while building Emacs.  On
+ GNU/Linux you can do so using the following command (as root).
  
-     ./temacs --batch --load loadup [dump|bootstrap]
+     echo 0 > /proc/sys/kernel/randomize_va_space
  
- To work around this problem, you can temporarily disable these
- features while building Emacs.  You can do so using the following
- commands (as root).  Remember to re-enable them when you are done,
- by echoing the original values back to the files.
+ You can re-enable the feature when you are done, by echoing the
+ original value back to the file.  NetBSD uses a different command,
+ e.g., 'sysctl -w security.pax.aslr.global=0'.
  
-     echo 0 > /proc/sys/kernel/exec-shield
-     echo 0 > /proc/sys/kernel/randomize_va_space
+ Alternatively, you can try using the 'setarch' command when building
+ temacs like this, where -R disables address space randomization:
  
- Or, on x86, you can try using the 'setarch' command when running
- temacs, like this:
+     setarch $(uname -m) -R make
  
-     setarch i386 -R ./temacs --batch --load loadup [dump|bootstrap]
+ ASLR is not the only problem that can break Emacs dumping.  Another
+ issue is that in Red Hat Linux kernels, Exec-shield is enabled by
+ default, and this creates a different memory layout.  Emacs should
+ handle this at build time, but if this fails the following
+ instructions may be useful.  Exec-shield is enabled on your system if
  
- or
+     cat /proc/sys/kernel/exec-shield
+ prints a nonzero value.  You can temporarily disable it as follows:
  
-     setarch i386 -R make
+     echo 0 > /proc/sys/kernel/exec-shield
  
- (The -R option disables address space randomization.)
+ As with randomize_va_space, you can re-enable Exec-shield when you are
+ done, by echoing the original value back to the file.
  
  *** temacs prints "Pure Lisp storage exhausted".
  
index 8afe18f8d9424d7a07e16939838b4bfd8f8b3354,14626e2f28f3187fbde2fbbe25c887902bc73c46..4e3dab4bb38039828f3b8815641a148ac013b1b2
  
  (require 'tabulated-list)
  (require 'macroexp)
 +(require 'url-handlers)
  
  (defgroup package nil
    "Manager for Emacs Lisp packages."
@@@ -302,10 -301,12 +302,12 @@@ contrast, `package-user-dir' contains p
    :risky t
    :version "24.1")
  
- (defvar epg-gpg-program)
+ (declare-function epg-find-configuration "epg-config"
+                   (protocol &optional force))
  
  (defcustom package-check-signature
-   (if (progn (require 'epg-config) (executable-find epg-gpg-program))
+   (if (and (require 'epg-config)
+            (epg-find-configuration 'OpenPGP))
        'allow-unsigned)
    "Non-nil means to check package signatures when installing.
  The value `allow-unsigned' means to still install a package even if
@@@ -906,15 -907,12 +908,15 @@@ untar into a directory named DIR; other
    file)
  
  (defvar generated-autoload-file)
 +(defvar autoload-timestamps)
  (defvar version-control)
  
  (defun package-generate-autoloads (name pkg-dir)
    (let* ((auto-name (format "%s-autoloads.el" name))
           ;;(ignore-name (concat name "-pkg.el"))
           (generated-autoload-file (expand-file-name auto-name pkg-dir))
 +         ;; We don't need 'em, and this makes the output reproducible.
 +         (autoload-timestamps nil)
           ;; Silence `autoload-generate-file-autoloads'.
           (noninteractive inhibit-message)
           (backup-inhibited t)
@@@ -1159,38 -1157,43 +1161,43 @@@ errors signaled by ERROR-FORM or by BOD
      (setq body (cdr (cdr body))))
    (macroexp-let2* nil ((url-1 url)
                         (noerror-1 noerror))
-     `(cl-macrolet ((unless-error (body-2 &rest before-body)
-                                  (let ((err (make-symbol "err")))
-                                    `(with-temp-buffer
-                                       (when (condition-case ,err
-                                                 (progn ,@before-body t)
-                                               ,(list 'error ',error-form
-                                                      (list 'unless ',noerror-1
-                                                            `(signal (car ,err) (cdr ,err)))))
-                                         ,@body-2)))))
-        (if (string-match-p "\\`https?:" ,url-1)
-            (let* ((url (concat ,url-1 ,file))
-                   (callback (lambda (status)
-                               (let ((b (current-buffer)))
-                                 (require 'url-handlers)
-                                 (unless-error ,body
-                                               (when-let ((er (plist-get status :error)))
-                                                 (error "Error retrieving: %s %S" url er))
-                                               (with-current-buffer b
-                                                 (goto-char (point-min))
-                                                 (unless (search-forward-regexp "^\r?\n\r?" nil 'noerror)
-                                                   (error "Error retrieving: %s %S" url "incomprehensible buffer")))
-                                               (url-insert-buffer-contents b url)
-                                               (kill-buffer b)
-                                               (goto-char (point-min)))))))
-              (if ,async
-                  (unless-error nil (url-retrieve url callback nil 'silent))
-                (unless-error ,body (url-insert-file-contents url))))
-          (unless-error ,body
-                        (let ((url (expand-file-name ,file ,url-1)))
-                          (unless (file-name-absolute-p url)
-                            (error "Location %s is not a url nor an absolute file name" url))
-                          (insert-file-contents url)))))))
+     (let ((url-sym (make-symbol "url"))
+           (b-sym (make-symbol "b-sym")))
+       `(cl-macrolet ((unless-error (body-2 &rest before-body)
+                                    (let ((err (make-symbol "err")))
+                                      `(with-temp-buffer
+                                         (when (condition-case ,err
+                                                   (progn ,@before-body t)
+                                                 ,(list 'error ',error-form
+                                                        (list 'unless ',noerror-1
+                                                              `(signal (car ,err) (cdr ,err)))))
+                                           ,@body-2)))))
+          (if (string-match-p "\\`https?:" ,url-1)
+              (let ((,url-sym (concat ,url-1 ,file)))
+                (if ,async
+                    (unless-error nil
+                                  (url-retrieve ,url-sym
+                                                (lambda (status)
+                                                  (let ((,b-sym (current-buffer)))
+                                                    (require 'url-handlers)
+                                                    (unless-error ,body
+                                                                  (when-let ((er (plist-get status :error)))
+                                                                    (error "Error retrieving: %s %S" ,url-sym er))
+                                                                  (with-current-buffer ,b-sym
+                                                                    (goto-char (point-min))
+                                                                    (unless (search-forward-regexp "^\r?\n\r?" nil 'noerror)
+                                                                      (error "Error retrieving: %s %S" ,url-sym "incomprehensible buffer")))
+                                                                  (url-insert-buffer-contents ,b-sym ,url-sym)
+                                                                  (kill-buffer ,b-sym)
+                                                                  (goto-char (point-min)))))
+                                                nil
+                                                'silent))
+                  (unless-error ,body (url-insert-file-contents ,url-sym))))
+            (unless-error ,body
+                          (let ((url (expand-file-name ,file ,url-1)))
+                            (unless (file-name-absolute-p url)
+                              (error "Location %s is not a url nor an absolute file name" url))
+                            (insert-file-contents url))))))))
  
  (define-error 'bad-signature "Failed to verify signature")
  
@@@ -1460,8 -1463,6 +1467,6 @@@ taken care of by `package-initialize'.
  (defvar package--downloads-in-progress nil
    "List of in-progress asynchronous downloads.")
  
- (declare-function epg-find-configuration "epg-config"
-                   (protocol &optional force))
  (declare-function epg-import-keys-from-file "epg" (context keys))
  
  ;;;###autoload
@@@ -1561,12 -1562,6 +1566,6 @@@ downloads in the background.
    (let ((default-keyring (expand-file-name "package-keyring.gpg"
                                             data-directory))
          (inhibit-message async))
-     (if (get 'package-check-signature 'saved-value)
-         (when package-check-signature
-           (epg-find-configuration 'OpenPGP))
-       (setq package-check-signature
-             (if (epg-find-configuration 'OpenPGP)
-                 'allow-unsigned)))
      (when (and package-check-signature (file-exists-p default-keyring))
        (condition-case-unless-debug error
            (package-import-keyring default-keyring)
@@@ -1874,6 -1869,7 +1873,7 @@@ add a call to it along with some explan
               (file-readable-p user-init-file)
               (file-writable-p user-init-file))
      (let* ((buffer (find-buffer-visiting user-init-file))
+            buffer-name
             (contains-init
              (if buffer
                  (with-current-buffer buffer
                  (re-search-forward "(package-initialize\\_>" nil 'noerror)))))
        (unless contains-init
          (with-current-buffer (or buffer
-                                  (let ((delay-mode-hooks t))
+                                  (let ((delay-mode-hooks t)
+                                        (find-file-visit-truename t))
                                     (find-file-noselect user-init-file)))
+           (when buffer
+             (setq buffer-name (buffer-file-name))
+             (set-visited-file-name (file-chase-links user-init-file)))
            (save-excursion
              (save-restriction
                (widen)
                  (insert "\n"))
                (let ((file-precious-flag t))
                  (save-buffer))
-               (unless buffer
+               (if buffer
+                   (progn
+                     (set-visited-file-name buffer-name)
+                     (set-buffer-modified-p nil))
                  (kill-buffer (current-buffer)))))))))
    (setq package--init-file-ensured t))
  
@@@ -2301,7 -2304,7 +2308,7 @@@ Otherwise no newline is inserted.
      (insert "\n")
      (unless (and pkg-dir (not archive)) ; Installed pkgs don't have archive.
        (package--print-help-section "Archive"
 -        (or archive "n/a") "\n"))
 +        (or archive "n/a")))
      (and version
           (package--print-help-section "Version"
             (package-version-join version)))
index 6951dbb708bb452cd44302dd6984ddddff3e3457,6b8fa46362d7998d575620087e3bff768f396f83..72fc89817a16f1de2a9743f7a113dd0b24b18173
@@@ -1,4 -1,4 +1,4 @@@
 -;;; viper-cmd.el --- Vi command support for Viper
 +;;; viper-cmd.el --- Vi command support for Viper  -*- lexical-binding:t -*-
  
  ;; Copyright (C) 1997-2016 Free Software Foundation, Inc.
  
  (defvar quail-mode)
  (defvar quail-current-str)
  (defvar mark-even-if-inactive)
 -(defvar init-message)
 +(defvar viper--init-message)
  (defvar viper-initial)
  (defvar undo-beg-posn)
  (defvar undo-end-posn)
  
  (eval-and-compile
 -  (unless (fboundp 'declare-function) (defmacro declare-function (&rest  r))))
 +  (unless (fboundp 'declare-function) (defmacro declare-function (&rest _))))
  ;; end pacifier
  
  
  
  ;; This also takes care of the annoying incomplete lines in files.
  ;; Also, this fixes `undo' to work vi-style for complex commands.
 -(defun viper-change-state-to-vi ()
 +(defun viper-change-state-to-vi (&rest _)
    "Change Viper state to Vi."
    (interactive)
    (if (and viper-first-time (not (viper-is-in-minibuffer)))
             (viper-over-whitespace-line))
        (indent-to-left-margin))
      (viper-add-newline-at-eob-if-necessary)
-     (viper-adjust-undo)
+     (viper-complete-complex-command-for-undo)
  
      (if (eq viper-current-state 'emacs-state)
        (viper-restore-cursor-color 'after-emacs-mode)
    )
  
  
 -(defun viper-change-state-to-emacs ()
 +(defun viper-change-state-to-emacs (&rest _)
    "Change Viper state to Emacs."
    (interactive)
    (or (viper-overlay-p viper-replace-overlay)
@@@ -1294,7 -1294,7 +1294,7 @@@ as a Meta key and any number of multipl
  ;; define functions to be executed
  
  ;; invoked by the `C' command
 -(defun viper-exec-change (m-com com)
 +(defun viper-exec-change (m-com _com)
    (or (and (markerp viper-com-point) (marker-position viper-com-point))
        (set-marker viper-com-point (point) (current-buffer)))
    ;; handle C cmd at the eol and at eob.
      (viper-change (mark t) (point))))
  
  ;; this is invoked by viper-substitute-line
 -(defun viper-exec-Change (m-com com)
 +(defun viper-exec-Change (_m-com _com)
    (save-excursion
      (set-mark viper-com-point)
      (viper-enlarge-region (mark t) (point))
      (viper-change-state-to-insert)
      ))
  
 -(defun viper-exec-delete (m-com com)
 +(defun viper-exec-delete (_m-com _com)
    (or (and (markerp viper-com-point) (marker-position viper-com-point))
        (set-marker viper-com-point (point) (current-buffer)))
    (let (chars-deleted)
      (if viper-ex-style-motion
        (if (and (eolp) (not (bolp))) (backward-char 1)))))
  
 -(defun viper-exec-Delete (m-com com)
 +(defun viper-exec-Delete (m-com _com)
    (save-excursion
      (set-mark viper-com-point)
      (viper-enlarge-region (mark t) (point))
      (back-to-indentation)))
  
  ;; save region
 -(defun viper-exec-yank (m-com com)
 +(defun viper-exec-yank (_m-com _com)
    (or (and (markerp viper-com-point) (marker-position viper-com-point))
        (set-marker viper-com-point (point) (current-buffer)))
    (let (chars-saved)
      (goto-char viper-com-point)))
  
  ;; save lines
 -(defun viper-exec-Yank (m-com com)
 +(defun viper-exec-Yank (_m-com _com)
    (save-excursion
      (set-mark viper-com-point)
      (viper-enlarge-region (mark t) (point))
    (viper-deactivate-mark)
    (goto-char viper-com-point))
  
 -(defun viper-exec-bang (m-com com)
 +(defun viper-exec-bang (_m-com com)
    (save-excursion
      (set-mark viper-com-point)
      (viper-enlarge-region (mark t) (point))
         viper-last-shell-com)
       t t)))
  
 -(defun viper-exec-equals (m-com com)
 +(defun viper-exec-equals (_m-com _com)
    (save-excursion
      (set-mark viper-com-point)
      (viper-enlarge-region (mark t) (point))
      (if (> (mark t) (point)) (exchange-point-and-mark))
      (indent-region (mark t) (point) nil)))
  
 -(defun viper-exec-shift (m-com com)
 +(defun viper-exec-shift (_m-com com)
    (save-excursion
      (set-mark viper-com-point)
      (viper-enlarge-region (mark t) (point))
  
  ;; this is needed because some commands fake com by setting it to ?r, which
  ;; denotes repeated insert command.
 -(defsubst viper-exec-dummy (m-com com)
 +(defsubst viper-exec-dummy (_m-com _com)
    nil)
  
 -(defun viper-exec-buffer-search (m-com com)
 +(defun viper-exec-buffer-search (_m-com _com)
    (setq viper-s-string
        (regexp-quote (buffer-substring (point) viper-com-point)))
    (setq viper-s-forward t)
@@@ -1570,7 -1570,7 +1570,7 @@@ If the prefix argument ARG is non-nil, 
        (if (and (eolp) (not (bolp)))
            (backward-char 1))
       ))
-   (viper-adjust-undo) ; take care of undo
+   (viper-complete-complex-command-for-undo) ; take care of undo
    ;; If the prev cmd was rotating the command ring, this means that `.' has
    ;; just executed a command from that ring.  So, push it on the ring again.
    ;; If we are just executing previous command , then don't push viper-d-com
@@@ -1648,7 -1648,7 +1648,7 @@@ invokes the command before that, etc.
  (add-hook 'after-change-functions 'viper-undo-sentinel)
  
  ;; Hook used in viper-undo
 -(defun viper-after-change-undo-hook (beg end len)
 +(defun viper-after-change-undo-hook (beg end _len)
    (if (and (boundp 'undo-in-progress) undo-in-progress)
        (setq undo-beg-posn beg
            undo-end-posn (or end beg))
    "Undo previous change."
    (interactive)
    (message "undo!")
 -  (let ((modified (buffer-modified-p))
 -        (before-undo-pt (point-marker))
 +  (let ((before-undo-pt (point-marker))
        undo-beg-posn undo-end-posn)
  
      ;; the viper-after-change-undo-hook removes itself after the 1st invocation
  
      (undo-start)
      (undo-more 2)
+     (viper-complete-complex-command-for-undo)
      ;;(setq undo-beg-posn (or undo-beg-posn (point))
      ;;    undo-end-posn (or undo-end-posn (point)))
      ;;(setq undo-beg-posn (or undo-beg-posn before-undo-pt)
  ;; The following two functions are used to set up undo properly.
  ;; In VI, unlike Emacs, if you open a line, say, and add a bunch of lines,
  ;; they are undone all at once.
- (defun viper-adjust-undo ()
-   (if viper-undo-needs-adjustment
-       (let ((inhibit-quit t)
-           tmp tmp2)
-       (setq viper-undo-needs-adjustment nil)
-       (if (listp buffer-undo-list)
-           (if (setq tmp (memq viper-buffer-undo-list-mark buffer-undo-list))
-               (progn
-                 (setq tmp2 (cdr tmp)) ; the part after mark
-                 ;; cut tail from buffer-undo-list temporarily by direct
-                 ;; manipulation with pointers in buffer-undo-list
-                 (setcdr tmp nil)
-                 (setq buffer-undo-list (delq nil buffer-undo-list))
-                 (setq buffer-undo-list
-                       (delq viper-buffer-undo-list-mark buffer-undo-list))
-                 ;; restore tail of buffer-undo-list
-                 (setq buffer-undo-list (nconc buffer-undo-list tmp2)))
-             (setq buffer-undo-list (delq nil buffer-undo-list)))))
-     ))
+ (defun viper-complete-complex-command-for-undo ()
+   (setq undo-auto-disable-boundaries nil)
+   (setq viper-undo-in-complex-command nil)
+   (undo-boundary))
  
  
  (defun viper-set-complex-command-for-undo ()
-   (if (listp buffer-undo-list)
-       (if (not viper-undo-needs-adjustment)
-         (let ((inhibit-quit t))
-           (setq buffer-undo-list
-                 (cons viper-buffer-undo-list-mark buffer-undo-list))
-           (setq viper-undo-needs-adjustment t)))))
+   (when (not viper-undo-in-complex-command)
+     (setq undo-auto-disable-boundaries t)
+     (setq viper-undo-in-complex-command t)
+     (undo-boundary)))
  
  ;;; Viper's destructive Command ring utilities
  
@@@ -1902,7 -1884,6 +1883,7 @@@ Undo previous insertion and inserts new
           "Quote string: "
           nil
           'viper-quote-region-history
 +           ;; FIXME: Use comment-region.
           (cond ((string-match "tex.*-mode" (symbol-name major-mode)) "%%")
                 ((string-match "java.*-mode" (symbol-name major-mode)) "//")
                 ((string-match "perl.*-mode" (symbol-name major-mode)) "#")
      (funcall hook)
      ))
  
 -;; This is a temp hook that uses free variables init-message and viper-initial.
 +;; This is a temp hook that uses free variables viper--init-message and viper-initial.
  ;; A dirty feature, but it is the simplest way to have it do the right thing.
 -;; The INIT-MESSAGE and VIPER-INITIAL vars come from the scope set by
 +;; The VIPER--INIT-MESSAGE and VIPER-INITIAL vars come from the scope set by
  ;; viper-read-string-with-history
  (defun viper-minibuffer-standard-hook ()
 -  (if (stringp init-message)
 -      (viper-tmp-insert-at-eob init-message))
 +  (if (stringp viper--init-message)
 +      (viper-tmp-insert-at-eob viper--init-message))
    (when (stringp viper-initial)
      ;; don't wait if we have unread events or in kbd macro
      (or unread-command-events
@@@ -2054,7 -2035,7 +2035,7 @@@ To turn this feature off, set this vari
               (viper-minibuffer-real-start) (point-max)))
        found key cmd suff)
      (goto-char (point-max))
 -    (if (and viper-smart-suffix-list (string-match "\\.$" file))
 +    (if (and viper-smart-suffix-list (string-match "\\.\\'" file))
        (progn
          (while (and (not found) (< count len))
            (setq suff (nth count viper-smart-suffix-list)
@@@ -2098,10 -2079,10 +2079,10 @@@ problems.
  \f
  ;;; Reading string with history
  
 -(defun viper-read-string-with-history (prompt &optional viper-initial
 +(defun viper-read-string-with-history (prompt &optional initial
                                              history-var default keymap
                                              init-message)
 -  ;; Read string, prompting with PROMPT and inserting the VIPER-INITIAL
 +  ;; Read string, prompting with PROMPT and inserting the INITIAL
    ;; value.  Uses HISTORY-VAR.  DEFAULT is the default value to accept if the
    ;; input is an empty string.
    ;; Default value is displayed until the user types something in the
    ;; KEYMAP is used, if given, instead of minibuffer-local-map.
    ;; INIT-MESSAGE is the message temporarily displayed after entering the
    ;; minibuffer.
 -  (let ((minibuffer-setup-hook
 +  (let ((viper-initial initial)
 +        (viper--init-message init-message)
 +        (minibuffer-setup-hook
         ;; stolen from add-hook
         (let ((old
                (if (boundp 'minibuffer-setup-hook)
                    minibuffer-setup-hook
                  nil)))
           (cons
 -          'viper-minibuffer-standard-hook
 +          #'viper-minibuffer-standard-hook
            (if (or (not (listp old)) (eq (car old) 'lambda))
                (list old) old))))
        (val "")
        temp-msg)
  
      (setq keymap (or keymap minibuffer-local-map)
 -        viper-initial (or viper-initial "")
 +        initial (or initial "")
 +        viper-initial initial
          temp-msg (if default
                       (format "(default %s) " default)
                     ""))
  
      (setq viper-incomplete-ex-cmd nil)
      (setq val (read-from-minibuffer prompt
 -                                  (concat temp-msg viper-initial val padding)
 +                                  (concat temp-msg initial val padding)
                                    keymap nil history-var))
      (setq minibuffer-setup-hook nil
          padding (viper-array-to-string (this-command-keys))
@@@ -2607,7 -2585,7 +2588,7 @@@ These keys are ESC, RET, and LineFeed.
                (delete-char 1 t)
                (insert char))
  
-     (viper-adjust-undo)
+     (viper-complete-complex-command-for-undo)
      (backward-char arg)
      ))
  
@@@ -2835,7 -2813,7 +2816,7 @@@ On reaching beginning of line, stop an
               (viper-looking-at-alphasep))))))
  
  
 -(defun viper-end-of-word (arg &optional careful)
 +(defun viper-end-of-word (arg &optional _careful)
    "Move point to end of current word."
    (interactive "P")
    (viper-leave-region-active)
@@@ -3671,14 -3649,17 +3652,14 @@@ the Emacs binding of `/'.
           (setq msg "Search style remains unchanged")))
      (princ msg t)))
  
 -(defun viper-set-searchstyle-toggling-macros (unset &optional major-mode)
 +(defun viper-set-searchstyle-toggling-macros (unset &optional mode)
    "Set the macros for toggling the search style in Viper's vi-state.
  The macro that toggles case sensitivity is bound to `//', and the one that
  toggles regexp search is bound to `///'.
  With a prefix argument, this function unsets the macros.
 -If MAJOR-MODE is set, set the macros only in that major mode."
 +If MODE is set, set the macros only in that major mode."
    (interactive "P")
 -  (let (scope)
 -    (if (and major-mode (symbolp major-mode))
 -      (setq scope major-mode)
 -      (setq scope 't))
 +  (let ((scope (if (and mode (symbolp mode)) mode t)))
      (or noninteractive
        (if (not unset)
            (progn
@@@ -4871,36 -4852,33 +4852,36 @@@ Please, specify your level now: ")
  \f
  ;;; Bug Report
  
 +(defvar reporter-prompt-for-summary-p)
 +
  (defun viper-submit-report ()
    "Submit bug report on Viper."
    (interactive)
 +  (defvar viper-device-type)
 +  (defvar viper-color-display-p)
 +  (defvar viper-frame-parameters)
 +  (defvar viper-minibuffer-emacs-face)
 +  (defvar viper-minibuffer-vi-face)
 +  (defvar viper-minibuffer-insert-face)
    (let ((reporter-prompt-for-summary-p t)
        (viper-device-type (viper-device-type))
 -      color-display-p frame-parameters
 -      minibuffer-emacs-face minibuffer-vi-face minibuffer-insert-face
 -      varlist salutation window-config)
 -
 -    ;; If mode info is needed, add variable to `let' and then set it below,
 -    ;; like we did with color-display-p.
 -    (setq color-display-p (if (viper-window-display-p)
 +      (viper-color-display-p (if (viper-window-display-p)
                              (viper-color-display-p)
 -                          'non-x)
 -        minibuffer-vi-face (if (viper-has-face-support-p)
 -                               (viper-get-face viper-minibuffer-vi-face)
 -                             'non-x)
 -        minibuffer-insert-face (if (viper-has-face-support-p)
 -                                   (viper-get-face
 -                                    viper-minibuffer-insert-face)
 -                                 'non-x)
 -        minibuffer-emacs-face (if (viper-has-face-support-p)
 -                                  (viper-get-face
 -                                   viper-minibuffer-emacs-face)
 -                                'non-x)
 -        frame-parameters (if (fboundp 'frame-parameters)
 -                             (frame-parameters (selected-frame))))
 +                              'non-x))
 +        (viper-frame-parameters (if (fboundp 'frame-parameters)
 +                                    (frame-parameters (selected-frame))))
 +      (viper-minibuffer-emacs-face (if (viper-has-face-support-p)
 +                                         (viper-get-face
 +                                          viper-minibuffer-emacs-face)
 +                                       'non-x))
 +        (viper-minibuffer-vi-face (if (viper-has-face-support-p)
 +                                      (viper-get-face viper-minibuffer-vi-face)
 +                                    'non-x))
 +        (viper-minibuffer-insert-face (if (viper-has-face-support-p)
 +                                          (viper-get-face
 +                                           viper-minibuffer-insert-face)
 +                                        'non-x))
 +      varlist salutation window-config)
  
      (setq varlist (list 'viper-vi-minibuffer-minor-mode
                        'viper-insert-minibuffer-minor-mode
                        'viper-expert-level
                        'major-mode
                        'viper-device-type
 -                      'color-display-p
 -                      'frame-parameters
 -                      'minibuffer-vi-face
 -                      'minibuffer-insert-face
 -                      'minibuffer-emacs-face
 +                      'viper-color-display-p
 +                      'viper-frame-parameters
 +                      'viper-minibuffer-vi-face
 +                      'viper-minibuffer-insert-face
 +                      'viper-minibuffer-emacs-face
                        ))
          (setq salutation "
  Congratulations! You may have unearthed a bug in Viper!
diff --combined lisp/menu-bar.el
index 933e2d22f67ce1785d51cccb8faf7bafd97c2dc5,640395e8d7d0778ac33249777a68fb74de0e5f96..a6541182e24ce073565dca0ad5e96053cd84e87a
  (defun clipboard-yank ()
    "Insert the clipboard contents, or the last stretch of killed text."
    (interactive "*")
 -  (let ((gui-select-enable-clipboard t))
 +  (let ((gui-select-enable-clipboard t)
 +        (interprogram-paste-function (or interprogram-paste-function
 +                                         #'gui-selection-value)))
      (yank)))
  
  (defun clipboard-kill-ring-save (beg end &optional region)
  If the optional argument REGION is non-nil, the function ignores
  BEG and END, and saves the current region instead."
    (interactive "r\np")
 -  (let ((gui-select-enable-clipboard t))
 +  (let ((gui-select-enable-clipboard t)
 +        (interprogram-cut-function (or interprogram-cut-function
 +                                       #'gui-select-text)))
      (kill-ring-save beg end region)))
  
  (defun clipboard-kill-region (beg end &optional region)
  If the optional argument REGION is non-nil, the function ignores
  BEG and END, and kills the current region instead."
    (interactive "r\np")
 -  (let ((gui-select-enable-clipboard t))
 +  (let ((gui-select-enable-clipboard t)
 +        (interprogram-cut-function (or interprogram-cut-function
 +                                       #'gui-select-text)))
      (kill-region beg end region)))
  
  (defun menu-bar-enable-clipboard ()
@@@ -1263,7 -1257,7 +1263,7 @@@ mail status in mode line")
  (defvar menu-bar-search-options-menu
    (let ((menu (make-sparse-keymap "Search Options")))
  
-     (dolist (x '((character-fold-to-regexp "Fold Characters" "Character folding")
+     (dolist (x '((char-fold-to-regexp "Fold Characters" "Character folding")
                   (isearch-symbol-regexp "Whole Symbols" "Whole symbol")
                   (word-search-regexp "Whole Words" "Whole word")))
        (bindings--define-key menu (vector (nth 0 x))
      (bindings--define-key menu [browse-web]
        '(menu-item "Browse the Web..." browse-web))
      (bindings--define-key menu [directory-search]
 -      '(menu-item "Directory Search" eudc-tools-menu))
 +      '(menu-item "Directory Servers" eudc-tools-menu))
      (bindings--define-key menu [compose-mail]
        '(menu-item "Compose New Mail" compose-mail
                    :visible (and mail-user-agent (not (eq mail-user-agent 'ignore)))
diff --combined lisp/replace.el
index 0b25200be575cb1a3623c2a7607ffd2caad8a2dc,fe90062cc8a02e1a8e90772657f9d7e75339dc35..9e2d521baf07520d306402455c36fef8a46be717
@@@ -33,7 -33,7 +33,7 @@@
    :type 'boolean
    :group 'matching)
  
- (defcustom replace-character-fold nil
+ (defcustom replace-char-fold nil
    "Non-nil means replacement commands should do character folding in matches.
  This means, for instance, that \\=' will match a large variety of
  unicode quotes.
@@@ -324,7 -324,7 +324,7 @@@ If `replace-lax-whitespace' is non-nil
  to be replaced will match a sequence of whitespace chars defined by the
  regexp in `search-whitespace-regexp'.
  
- If `replace-character-fold' is non-nil, matching uses character folding,
+ If `replace-char-fold' is non-nil, matching uses character folding,
  i.e. it ignores diacritics and other differences between equivalent
  character strings.
  
@@@ -383,7 -383,7 +383,7 @@@ If `replace-regexp-lax-whitespace' is n
  to be replaced will match a sequence of whitespace chars defined by the
  regexp in `search-whitespace-regexp'.
  
- This function is not affected by `replace-character-fold'.
+ This function is not affected by `replace-char-fold'.
  
  Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace
  only matches surrounded by word boundaries.  A negative prefix arg means
@@@ -474,7 -474,7 +474,7 @@@ If `replace-regexp-lax-whitespace' is n
  to be replaced will match a sequence of whitespace chars defined by the
  regexp in `search-whitespace-regexp'.
  
- This function is not affected by `replace-character-fold'.
+ This function is not affected by `replace-char-fold'.
  
  Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace
  only matches that are surrounded by word boundaries.
@@@ -568,7 -568,7 +568,7 @@@ If `replace-lax-whitespace' is non-nil
  to be replaced will match a sequence of whitespace chars defined by the
  regexp in `search-whitespace-regexp'.
  
- If `replace-character-fold' is non-nil, matching uses character folding,
+ If `replace-char-fold' is non-nil, matching uses character folding,
  i.e. it ignores diacritics and other differences between equivalent
  character strings.
  
@@@ -623,7 -623,7 +623,7 @@@ If `replace-regexp-lax-whitespace' is n
  to be replaced will match a sequence of whitespace chars defined by the
  regexp in `search-whitespace-regexp'.
  
- This function is not affected by `replace-character-fold'
+ This function is not affected by `replace-char-fold'
  
  In Transient Mark mode, if the mark is active, operate on the contents
  of the region.  Otherwise, operate from point to the end of the buffer's
@@@ -1832,8 -1832,6 +1832,8 @@@ C-w to delete match and recursive edit
  C-l to clear the screen, redisplay, and offer same replacement again,
  ! to replace all remaining matches in this buffer with no more questions,
  ^ to move point back to previous match,
 +u to undo previous replacement,
 +U to undo all replacements,
  E to edit the replacement string.
  In multi-buffer replacements type `Y' to replace all remaining
  matches in all remaining buffers with no more questions,
@@@ -1863,8 -1861,6 +1863,8 @@@ in the current buffer.
      (define-key map "\C-l" 'recenter)
      (define-key map "!" 'automatic)
      (define-key map "^" 'backup)
 +    (define-key map "u" 'undo)
 +    (define-key map "U" 'undo-all)
      (define-key map "\C-h" 'help)
      (define-key map [f1] 'help)
      (define-key map [help] 'help)
@@@ -1890,7 -1886,7 +1890,7 @@@ The valid answers include `act', `skip'
  `act-and-exit', `exit', `exit-prefix', `recenter', `scroll-up',
  `scroll-down', `scroll-other-window', `scroll-other-window-down',
  `edit', `edit-replacement', `delete-and-edit', `automatic',
 -`backup', `quit', and `help'.
 +`backup', `undo', `undo-all', `quit', and `help'.
  
  This keymap is used by `y-or-n-p' as well as `query-replace'.")
  
@@@ -2055,9 -2051,9 +2055,9 @@@ It is called with three arguments, as i
    ;; used after `recursive-edit' might override them.
    (let* ((isearch-regexp regexp-flag)
         (isearch-regexp-function (or delimited-flag
-                            (and replace-character-fold
+                            (and replace-char-fold
                                  (not regexp-flag)
-                                 #'character-fold-to-regexp)))
+                                 #'char-fold-to-regexp)))
         (isearch-lax-whitespace
          replace-lax-whitespace)
         (isearch-regexp-lax-whitespace
@@@ -2146,10 -2142,6 +2146,10 @@@ It must return a string.
           (noedit nil)
           (keep-going t)
           (stack nil)
 +         (search-string-replaced nil)    ; last string matching `from-string'
 +         (next-replacement-replaced nil) ; replacement string
 +                                         ; (substituted regexp)
 +         (last-was-undo)
           (replace-count 0)
           (skip-read-only-count 0)
           (skip-filtered-count 0)
                   (match-beginning 0) (match-end 0)
                   start end search-string
                   regexp-flag delimited-flag case-fold-search backward)
 -                ;; Bind message-log-max so we don't fill up the message log
 -                ;; with a bunch of identical messages.
 +                  ;; Obtain the matched groups: needed only when
 +                  ;; regexp-flag non nil.
 +                  (when (and last-was-undo regexp-flag)
 +                    (setq last-was-undo nil
 +                          real-match-data
 +                          (save-excursion
 +                            (goto-char (match-beginning 0))
 +                            (looking-at search-string)
 +                            (match-data t real-match-data))))
 +                  ;; Matched string and next-replacement-replaced
 +                  ;; stored in stack.
 +                  (setq search-string-replaced (buffer-substring-no-properties
 +                                                (match-beginning 0)
 +                                                (match-end 0))
 +                        next-replacement-replaced
 +                        (query-replace-descr
 +                         (save-match-data
 +                           (set-match-data real-match-data)
 +                           (match-substitute-replacement
 +                            next-replacement nocasify literal))))
 +                ;; Bind message-log-max so we don't fill up the
 +                ;; message log with a bunch of identical messages.
                  (let ((message-log-max nil)
                        (replacement-presentation
                         (if query-replace-show-replacement
                               (query-replace-descr from-string)
                               (query-replace-descr replacement-presentation)))
                  (setq key (read-event))
 -                ;; Necessary in case something happens during read-event
 -                ;; that clobbers the match data.
 +                ;; Necessary in case something happens during
 +                ;; read-event that clobbers the match data.
                  (set-match-data real-match-data)
                  (setq key (vector key))
                  (setq def (lookup-key map key))
                            (concat "Query replacing "
                                    (if delimited-flag
                                        (or (and (symbolp delimited-flag)
 -                                               (get delimited-flag 'isearch-message-prefix))
 +                                               (get delimited-flag
 +                                                      'isearch-message-prefix))
                                            "word ") "")
                                    (if regexp-flag "regexp " "")
                                    (if backward "backward " "")
                           (message "No previous match")
                           (ding 'no-terminate)
                           (sit-for 1)))
 +                      ((or (eq def 'undo) (eq def 'undo-all))
 +                       (if (null stack)
 +                             (progn
 +                               (message "Nothing to undo")
 +                               (ding 'no-terminate)
 +                               (sit-for 1))
 +                         (let ((stack-idx         0)
 +                                 (stack-len         (length stack))
 +                                 (num-replacements  0)
 +                                 search-string
 +                                 next-replacement)
 +                             (while (and (< stack-idx stack-len)
 +                                         stack
 +                                         (null replaced))
 +                               (let* ((elt (nth stack-idx stack)))
 +                                 (setq
 +                                  stack-idx (1+ stack-idx)
 +                                  replaced (nth 1 elt)
 +                                  ;; Bind swapped values
 +                                  ;; (search-string <--> replacement)
 +                                  search-string (nth (if replaced 4 3) elt)
 +                                  next-replacement (nth (if replaced 3 4) elt)
 +                                  search-string-replaced search-string
 +                                  next-replacement-replaced next-replacement)
 +
 +                                 (when (and (= stack-idx stack-len)
 +                                            (null replaced)
 +                                            (zerop num-replacements))
 +                                          (message "Nothing to undo")
 +                                          (ding 'no-terminate)
 +                                          (sit-for 1))
 +
 +                                 (when replaced
 +                                   (setq stack (nthcdr stack-idx stack))
 +                                   (goto-char (nth 0 elt))
 +                                   (set-match-data (nth 2 elt))
 +                                   (setq real-match-data
 +                                         (save-excursion
 +                                           (goto-char (match-beginning 0))
 +                                           (looking-at search-string)
 +                                           (match-data t (nth 2 elt)))
 +                                         noedit
 +                                         (replace-match-maybe-edit
 +                                          next-replacement nocasify literal
 +                                          noedit real-match-data backward)
 +                                         replace-count (1- replace-count)
 +                                         real-match-data
 +                                         (save-excursion
 +                                           (goto-char (match-beginning 0))
 +                                           (looking-at next-replacement)
 +                                           (match-data t (nth 2 elt))))
 +                                   ;; Set replaced nil to keep in loop
 +                                   (when (eq def 'undo-all)
 +                                     (setq replaced nil
 +                                           stack-len (- stack-len stack-idx)
 +                                           stack-idx 0
 +                                           num-replacements
 +                                           (1+ num-replacements))))))
 +                             (when (and (eq def 'undo-all)
 +                                        (null (zerop num-replacements)))
 +                               (message "Undid %d %s" num-replacements
 +                                        (if (= num-replacements 1)
 +                                            "replacement"
 +                                          "replacements"))
 +                               (ding 'no-terminate)
 +                               (sit-for 1)))
 +                         (setq replaced nil last-was-undo t)))
                        ((eq def 'act)
                         (or replaced
                             (setq noedit
                                 (match-beginning 0)
                                 (match-end 0)
                                 (current-buffer))
 -                            (match-data t)))
 -                    stack))))))
 -
 +                            (match-data t))
 +                              search-string-replaced
 +                              next-replacement-replaced)
 +                    stack)
 +                (setq next-replacement-replaced nil
 +                      search-string-replaced    nil))))))
        (replace-dehighlight))
      (or unread-command-events
        (message "Replaced %d occurrence%s%s"
diff --combined lisp/ses.el
index a87386e17307b5543c7fb7445c9acf3436303ad4,ab9f0715fd8a55d4cc009cc01e55cc21c5de5923..b2fd2bbe9a5df0a95135eef873918372fa77b61a
@@@ -1319,7 -1319,7 +1319,7 @@@ printer signaled one (and \"%s\" is use
                            (and locprn
                                 (ses--locprn-compiled locprn))))
                     printer)
 -               (or value "")))
 +               value))
        (if (stringp value)
            value
          (or (stringp (car-safe value))
@@@ -1539,8 -1539,7 +1539,8 @@@ Sets `ses-relocate-return' to `delete' 
        (if (setq rowcol (ses-sym-rowcol formula))
            (ses-relocate-symbol formula rowcol
                                 startrow startcol rowincr colincr)
 -        formula) ; Pass through as-is.
 +        ;; Constants pass through as-is.
 +        formula)
        (dolist (cur formula)
        (setq rowcol (ses-sym-rowcol cur))
        (cond
@@@ -3455,9 -3454,18 +3455,18 @@@ highlighted range in the spreadsheet.
      (setq cell (or cell (ses-get-cell row col))
          old-name (ses-cell-symbol cell)
          new-rowcol (ses-decode-cell-symbol (symbol-name new-name)))
+     ;; when ses-rename-cell is called interactively, then 'sym' is the
+     ;; 'cursor-intangible' property of text at cursor position, while
+     ;; 'old-name' is the symbol stored in array cell at coordinate
+     ;; 'rowcol' corresponding to 'ses-cell' property of symbol
+     ;; 'sym'. Both must be the same.
+     (unless (eq sym old-name)
+       (error "Spreadsheet is broken, both symbols %S and %S refering to cell (%d,%d)" sym old-name row col))
      (if new-rowcol
 -        ;; inferred from new name 
+         ;; the new name is of A1 type, so we test that the coordinate
++        ;; inferred from new name
        (if (equal new-rowcol rowcol)
-         (put new-name 'ses-cell rowcol)
+             (put new-name 'ses-cell rowcol)
          (error "Not a valid name for this cell location"))
        (setq ses--named-cell-hashmap
              (or ses--named-cell-hashmap (make-hash-table :test 'eq)))
        (setf (ses-cell-formula xcell)
                (ses-replace-name-in-formula
                 (ses-cell-formula xcell)
-                sym
+                old-name
                 new-name))))
      ;; Replace name by new name in reference list of cells to which renamed
      ;; cell refers to.
        (let* ((x (ses-sym-rowcol ref))
             (xcell (ses-get-cell (car x) (cdr x))))
        (setf (ses-cell-references xcell)
-               (cons new-name (delq sym
+               (cons new-name (delq old-name
                                     (ses-cell-references xcell))))))
      (set (make-local-variable new-name) (symbol-value sym))
      (setf (ses-cell--symbol cell) new-name)
-     (makunbound sym)
+     ;; Unbind old name
+     (if (eq (get old-name 'ses-cell) :ses-named)
+         (ses--unbind-cell-name old-name)
+       (kill-local-variable old-name))
      (and curcell (setq ses--curcell new-name))
      (save-excursion
        (or curcell (ses-goto-print row col))
diff --combined lisp/simple.el
index 65664c93666d8d19fa66e77769cbcba7e7f71675,c5aa2922475b7f5e4f087f53a9804bbc69ac2f63..affc403dcdc8f08159be246ce1ab05de095a4e8f
@@@ -1075,9 -1075,7 +1075,9 @@@ that uses or sets the mark.
    (interactive)
    (push-mark (point))
    (push-mark (point-max) nil t)
 -  (goto-char (point-min)))
 +  ;; This is really `point-min' in most cases, but if we're in the
 +  ;; minibuffer, this is at the end of the prompt.
 +  (goto-char (minibuffer-prompt-end)))
  \f
  
  ;; Counting lines, one way or another.
@@@ -1635,12 -1633,6 +1635,12 @@@ If the value is non-nil and not a numbe
                   (integer :tag "time" 2)
                   (other :tag "on")))
  
 +(defcustom extended-command-suggest-shorter t
 +  "If non-nil, show a shorter M-x invocation when there is one."
 +  :group 'keyboard
 +  :type 'boolean
 +  :version "25.2")
 +
  (defun execute-extended-command--shorter-1 (name length)
    (cond
     ((zerop length) (list ""))
@@@ -1723,8 -1715,7 +1723,8 @@@ invoking, give a prefix argument to `ex
                          ((numberp suggest-key-bindings) suggest-key-bindings)
                          (t 2))))))
        (when (and waited (not (consp unread-command-events)))
 -        (unless (or binding executing-kbd-macro (not (symbolp function))
 +        (unless (or (not extended-command-suggest-shorter)
 +                    binding executing-kbd-macro (not (symbolp function))
                      (<= (length (symbol-name function)) 2))
            ;; There's no binding for CMD.  Let's try and find the shortest
            ;; string to use in M-x.
@@@ -2848,6 -2839,18 +2848,18 @@@ buffers that were changed during the la
  
  If set to non-nil, this will effectively disable the timer.")
  
+ (defvar-local undo-auto-disable-boundaries nil
+   "Disable the automatic addition of boundaries.
+ If set to non-nil, `undo-boundary' will not be called
+ automatically in a buffer either at the end of a command, or as a
+ result of `undo-auto-current-boundary-timer'.
+ When this is set to non-nil, it is important to ensure that
+ `undo-boundary' is called frequently enough. Failure to do so
+ will result in user-visible warnings that the situation is
+ probably a bug.")
  (defvar undo-auto--this-command-amalgamating nil
    "Non-nil if `this-command' should be amalgamated.
  This variable is set to nil by `undo-auto--boundaries' and is set
@@@ -2887,7 -2890,8 +2899,8 @@@ REASON describes the reason that the bo
    (dolist (b undo-auto--undoably-changed-buffers)
            (when (buffer-live-p b)
              (with-current-buffer b
-               (undo-auto--ensure-boundary cause))))
+               (unless undo-auto-disable-boundaries
+                 (undo-auto--ensure-boundary cause)))))
    (setq undo-auto--undoably-changed-buffers nil))
  
  (defun undo-auto--boundary-timer ()
@@@ -2914,10 -2918,10 +2927,10 @@@ See also `undo-auto--buffer-undoably-ch
    "Add an `undo-boundary' in appropriate buffers."
    (undo-auto--boundaries
     (let ((amal undo-auto--this-command-amalgamating))
-        (setq undo-auto--this-command-amalgamating nil)
-        (if amal
-            'amalgamate
-          'command))))
+      (setq undo-auto--this-command-amalgamating nil)
+      (if amal
+          'amalgamate
+        'command))))
  
  (defun undo-auto-amalgamate ()
    "Amalgamate undo if necessary.
@@@ -3764,13 -3768,8 +3777,13 @@@ support pty association, if PROGRAM is 
  (defun process-menu-delete-process ()
    "Kill process at point in a `list-processes' buffer."
    (interactive)
 -  (delete-process (tabulated-list-get-id))
 -  (revert-buffer))
 +  (let ((pos (point)))
 +    (delete-process (tabulated-list-get-id))
 +    (revert-buffer)
 +    (goto-char (min pos (point-max)))
 +    (if (eobp)
 +        (forward-line -1)
 +      (beginning-of-line))))
  
  (defun list-processes--refresh ()
    "Recompute the list of processes for the Process List buffer.
@@@ -4061,8 -4060,7 +4074,8 @@@ Its arguments and return value are as s
  This respects the wrapper hook `filter-buffer-substring-functions',
  and the abnormal hook `buffer-substring-filters'.
  No filtering is done unless a hook says to."
 -  (with-wrapper-hook filter-buffer-substring-functions (beg end delete)
 +  (subr--with-wrapper-hook-no-warnings
 +    filter-buffer-substring-functions (beg end delete)
      (cond
       ((or delete buffer-substring-filters)
        (save-excursion
@@@ -5838,7 -5836,7 +5851,7 @@@ The value is a floating-point number.
      (/ (float (- (nth 3 edges) (nth 1 edges))) dlh)))
  
  ;; Returns non-nil if partial move was done.
 -(defun line-move-partial (arg noerror to-end)
 +(defun line-move-partial (arg noerror &optional _to-end)
    (if (< arg 0)
        ;; Move backward (up).
        ;; If already vscrolled, reduce vscroll
          ;; discrepancies between that and DLH.
          (if (and rowh rbot (>= (- (+ rowh rbot) winh) 1))
              (set-window-vscroll nil dlh t))
 -        (line-move-1 arg noerror to-end)
 +        (line-move-1 arg noerror)
          t)
         ;; If there are lines above the last line, scroll-up one line.
         ((and vpos (> vpos 0))
  ;; scrolling with cursor motion.  But so far we don't have
  ;; a cleaner solution to the problem of making C-n do something
  ;; useful given a tall image.
 -(defun line-move (arg &optional noerror to-end try-vscroll)
 +(defun line-move (arg &optional noerror _to-end try-vscroll)
    "Move forward ARG lines.
  If NOERROR, don't signal an error if we can't move ARG lines.
  TO-END is unused.
@@@ -5961,7 -5959,7 +5974,7 @@@ TRY-VSCROLL controls whether to vscrol
  `auto-window-vscroll' or TRY-VSCROLL is nil, this function will
  not vscroll."
    (if noninteractive
 -      (line-move-1 arg noerror to-end)
 +      (line-move-1 arg noerror)
      (unless (and auto-window-vscroll try-vscroll
                 ;; Only vscroll for single line moves
                 (= (abs arg) 1)
                 ;; But don't vscroll in a keyboard macro.
                 (not defining-kbd-macro)
                 (not executing-kbd-macro)
 -               (line-move-partial arg noerror to-end))
 +               (line-move-partial arg noerror))
        (set-window-vscroll nil 0 t)
        (if (and line-move-visual
               ;; Display-based column are incompatible with goal-column.
                  (set-window-vscroll
                   nil
                   (- lh dlh) t))))
 -      (line-move-1 arg noerror to-end)))))
 +      (line-move-1 arg noerror)))))
  
  ;; Display-based alternative to line-move-1.
  ;; Arg says how many lines to move.  The value is t if we can move the
diff --combined lisp/term/xterm.el
index 5a38ebe8e45715f23c4d89f7b88a8314a13e2cc2,19eb37a51d643e5211670f7b72124caf14caa3ae..01c01130e7c3448383632ce21c39de8deb626ced
@@@ -71,28 -71,29 +71,29 @@@ string bytes that can be copied is 3/4 
  (defconst xterm-paste-ending-sequence "\e[201~"
    "Characters send by the terminal to end a bracketed paste.")
  
+ (defun xterm--pasted-text ()
+   "Handle the rest of a terminal paste operation.
+ Return the pasted text as a string."
+   (let ((end-marker-length (length xterm-paste-ending-sequence)))
+     (with-temp-buffer
+       (set-buffer-multibyte nil)
+       (while (not (search-backward xterm-paste-ending-sequence
+                                    (- (point) end-marker-length) t))
+       (let ((event (read-event nil nil
+                                  ;; Use finite timeout to avoid glomming the
+                                  ;; event onto this-command-keys.
+                                  most-positive-fixnum)))
+         (when (eql event ?\r)
+           (setf event ?\n))
+         (insert event)))
+       (let ((last-coding-system-used))
+       (decode-coding-region (point-min) (point) (keyboard-coding-system)
+                               t)))))
  (defun xterm-paste ()
    "Handle the start of a terminal paste operation."
    (interactive)
-   (let* ((end-marker-length (length xterm-paste-ending-sequence))
-          (pasted-text (with-temp-buffer
-                         (set-buffer-multibyte nil)
-                         (while (not (search-backward
-                                      xterm-paste-ending-sequence
-                                      (- (point) end-marker-length) t))
-                           (let ((event (read-event
-                                         nil nil
-                                         ;; Use finite timeout to avoid
-                                         ;; glomming the event onto
-                                         ;; this-command-keys.
-                                         most-positive-fixnum)))
-                             (when (eql event ?\r)
-                               (setf event ?\n))
-                             (insert event)))
-                         (let ((last-coding-system-used))
-                           (decode-coding-region
-                            (point-min) (point)
-                            (keyboard-coding-system) t))))
+   (let* ((pasted-text (xterm--pasted-text))
           (interprogram-paste-function (lambda () pasted-text)))
      (yank)))
  
      (define-key map [f59] [M-f11])
      (define-key map [f60] [M-f12])
  
 +    (define-key map [f61] [M-S-f1])
 +    (define-key map [f62] [M-S-f2])
 +    (define-key map [f63] [M-S-f3])
 +    (define-key map [f64] [M-S-f4])
 +    (define-key map [f65] [M-S-f5])
 +    (define-key map [f66] [M-S-f6])
 +    (define-key map [f67] [M-S-f7])
 +    (define-key map [f68] [M-S-f8])
 +    (define-key map [f69] [M-S-f9])
 +    (define-key map [f70] [M-S-f10])
 +    (define-key map [f71] [M-S-f11])
 +    (define-key map [f72] [M-S-f12])
 +
      map)
    "Keymap of possible alternative meanings for some keys.")
  
diff --combined lisp/vc/vc-cvs.el
index dfe6b293e94e97bb2708308805ae145f91cb2eaf,a2499a2294b496b8d32ca71647b7496853a1bafe..50198713b414b072484332e0ff9ed57c61ba34f6
  
  (eval-when-compile (require 'vc))
  
 +(declare-function vc-branch-p "vc" (rev))
 +(declare-function vc-checkout "vc" (file &optional rev))
 +(declare-function vc-expand-dirs "vc" (file-or-dir-list backend))
 +(declare-function vc-read-revision "vc"
 +                  (prompt &optional files backend default initial-input))
 +
  ;; Clear up the cache to force vc-call to check again and discover
  ;; new functions when we reload this file.
  (put 'CVS 'vc-functions nil)
@@@ -127,7 -121,7 +127,7 @@@ This is only meaningful if you don't us
    :version "21.1"
    :group 'vc-cvs)
  
- (defcustom vc-stay-local 'only-file
+ (defcustom vc-cvs-stay-local 'only-file
    "Non-nil means use local operations when possible for remote repositories.
  This avoids slow queries over the network and instead uses heuristics
  and past information to determine the current status of a file.
@@@ -137,11 -131,11 +137,11 @@@ server, but heuristics will be used to 
  all other VC operations.
  
  The value can also be a regular expression or list of regular
- expressions to match against the host name of a repository; then VC
- only stays local for hosts that match it.  Alternatively, the value
- can be a list of regular expressions where the first element is the
- symbol `except'; then VC always stays local except for hosts matched
- by these regular expressions."
+ expressions to match against the host name of a repository; then
+ vc-cvs only stays local for hosts that match it.  Alternatively,
+ the value can be a list of regular expressions where the first
+ element is the symbol `except'; then vc-cvs always stays local
except for hosts matched by these regular expressions."
    :type '(choice (const :tag "Always stay local" t)
                 (const :tag "Only for file operations" only-file)
                 (const :tag "Don't stay local" nil)
@@@ -795,8 -789,7 +795,7 @@@ If FILE is a list of files, return non-
  individually should stay local."
    (if (listp file)
        (delq nil (mapcar (lambda (arg) (vc-cvs-stay-local-p arg)) file))
-     (let* ((sym (vc-make-backend-sym 'CVS 'stay-local))
-           (stay-local (if (boundp sym) (symbol-value sym) vc-stay-local)))
+     (let ((stay-local vc-cvs-stay-local))
        (if (symbolp stay-local) stay-local
         (let ((dirname (if (file-directory-p file)
                            (directory-file-name file)
diff --combined lisp/w32-fns.el
index 4815f4b8c217f8b0761acb7f6695105700d07e63,0f31c4a668d8a08454ce7055366a9c1e6fd0722a..91c0253042786e328a60a2ff7fbe91df6aa0f738
@@@ -31,9 -31,9 +31,9 @@@
  
  ;;;; Function keys
  
- (declare-function set-message-beep "w32fns.c")
- (declare-function w32-get-locale-info "w32proc.c")
- (declare-function w32-get-valid-locale-ids "w32proc.c")
+ (declare-function set-message-beep "w32fns.c" (sound))
+ (declare-function w32-get-locale-info "w32proc.c" (lcid &optional longform))
+ (declare-function w32-get-valid-locale-ids "w32proc.c" ())
  
  ;; Map all versions of a filename (8.3, longname, mixed case) to the
  ;; same buffer.
@@@ -121,7 -121,7 +121,7 @@@ You should set this to t when using a n
  (add-hook 'after-init-hook 'w32-check-shell-configuration)
  
  ;; Override setting chosen at startup.
 -(defun set-default-process-coding-system ()
 +(defun w32-set-default-process-coding-system ()
    ;; Most programs on Windows will accept Unix line endings on input
    ;; (and some programs ported from Unix require it) but most will
    ;; produce DOS line endings on output.
                 . ,(if (default-value 'enable-multibyte-characters)
                        '(undecided-dos . undecided-dos)
                      '(raw-text-dos . raw-text-dos)))))
 -
 -(add-hook 'before-init-hook 'set-default-process-coding-system)
 +(define-obsolete-function-alias 'set-default-process-coding-system
 +  #'w32-set-default-process-coding-system "26.1")
 +(add-hook 'before-init-hook #'w32-set-default-process-coding-system)
  
  
  ;;; Basic support functions for managing Emacs's locale setting
@@@ -201,7 -200,8 +201,7 @@@ certain patterns
  This function is called by `convert-standard-filename'.
  
  Replace invalid characters and turn Cygwin names into native
 -names, and also turn slashes into backslashes if the shell
 -requires it (see `w32-shell-dos-semantics')."
 +names."
    (save-match-data
      (let ((name
           (if (string-match "\\`/cygdrive/\\([a-zA-Z]\\)/" filename)
        (while (string-match "[?*:<>|\"\000-\037]" name start)
        (aset name (match-beginning 0) ?!)
        (setq start (match-end 0)))
 -      ;; convert directory separators to Windows format
 -      ;; (but only if the shell in use requires it)
 -      (when (w32-shell-dos-semantics)
 -      (setq start 0)
 -      (while (string-match "/" name start)
 -        (aset name (match-beginning 0) ?\\)
 -        (setq start (match-end 0))))
        name)))
  
 -(defun set-w32-system-coding-system (coding-system)
 +(defun w32-set-system-coding-system (coding-system)
    "Set the coding system used by the Windows system to CODING-SYSTEM.
  This is used for things like passing font names with non-ASCII
  characters in them to the system.  For a list of possible values of
@@@ -234,8 -241,6 +234,8 @@@ This function is provided for backward 
              default))))
    (check-coding-system coding-system)
    (setq locale-coding-system coding-system))
 +(define-obsolete-function-alias 'set-w32-system-coding-system
 +  #'w32-set-system-coding-system "26.1")
  
  ;; locale-coding-system was introduced to do the same thing as
  ;; w32-system-coding-system. Use that instead.
diff --combined src/xfaces.c
index 93d1c471407bc813273248262394e648c60e3996,88f5f3415b05f120198bcdb15dbe4bb27fd693ce..3ced1d483c34817043b33ac6c72b47fe14092d4a
@@@ -221,6 -221,7 +221,6 @@@ along with GNU Emacs.  If not, see <htt
  #include TERM_HEADER
  #include "fontset.h"
  #ifdef HAVE_NTGUI
 -#define x_display_info w32_display_info
  #define GCGraphicsExposures 0
  #endif /* HAVE_NTGUI */
  
@@@ -2677,9 -2678,10 +2677,10 @@@ FRAME 0 means change the face on all fr
      {
        if (NILP (frame))
        frame = selected_frame;
-       f = XFRAME (frame);
  
        CHECK_LIVE_FRAME (frame);
+       f = XFRAME (frame);
        lface = lface_from_face_name (f, face, false);
  
        /* If a frame-local face doesn't exist yet, create one.  */
@@@ -3693,7 -3695,7 +3694,7 @@@ Default face attributes override any lo
    if (EQ (face, Qdefault))
      {
        struct face_cache *c = FRAME_FACE_CACHE (f);
 -      struct face *newface, *oldface = FACE_FROM_ID (f, DEFAULT_FACE_ID);
 +      struct face *newface, *oldface = FACE_OPT_FROM_ID (f, DEFAULT_FACE_ID);
        Lisp_Object attrs[LFACE_VECTOR_SIZE];
  
        /* This can be NULL (e.g., in batch mode).  */
@@@ -3776,7 -3778,7 +3777,7 @@@ return the font name used for CHARACTER
      {
        struct frame *f = decode_live_frame (frame);
        int face_id = lookup_named_face (f, face, true);
 -      struct face *fface = FACE_FROM_ID (f, face_id);
 +      struct face *fface = FACE_OPT_FROM_ID (f, face_id);
  
        if (! fface)
        return Qnil;
@@@ -4428,13 -4430,15 +4429,13 @@@ lookup_named_face (struct frame *f, Lis
  {
    Lisp_Object attrs[LFACE_VECTOR_SIZE];
    Lisp_Object symbol_attrs[LFACE_VECTOR_SIZE];
 -  struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
 +  struct face *default_face = FACE_OPT_FROM_ID (f, DEFAULT_FACE_ID);
  
    if (default_face == NULL)
      {
        if (!realize_basic_faces (f))
        return -1;
        default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
 -      if (default_face == NULL)
 -      emacs_abort (); /* realize_basic_faces must have set it up  */
      }
  
    if (! get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0))
@@@ -4597,6 -4601,9 +4598,6 @@@ lookup_derived_face (struct frame *f, L
    Lisp_Object symbol_attrs[LFACE_VECTOR_SIZE];
    struct face *default_face = FACE_FROM_ID (f, face_id);
  
 -  if (!default_face)
 -    emacs_abort ();
 -
    if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0))
      return -1;
  
@@@ -4700,7 -4707,7 +4701,7 @@@ x_supports_face_attributes_p (struct fr
        merge_face_vectors (f, attrs, merged_attrs, 0);
  
        face_id = lookup_face (f, merged_attrs);
 -      face = FACE_FROM_ID (f, face_id);
 +      face = FACE_OPT_FROM_ID (f, face_id);
  
        if (! face)
        error ("Cannot make face");
@@@ -4970,12 -4977,14 +4971,12 @@@ face for italic.  */
      attrs[i] = Qunspecified;
    merge_face_ref (f, attributes, attrs, true, 0);
  
 -  def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
 +  def_face = FACE_OPT_FROM_ID (f, DEFAULT_FACE_ID);
    if (def_face == NULL)
      {
        if (! realize_basic_faces (f))
        error ("Cannot realize default face");
        def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
 -      if (def_face == NULL)
 -      emacs_abort ();  /* realize_basic_faces must have set it up  */
      }
  
    /* Dispatch to the appropriate handler.  */
@@@ -5445,7 -5454,7 +5446,7 @@@ realize_x_face (struct face_cache *cach
  
    /* Determine the font to use.  Most of the time, the font will be
       the same as the font of the default face, so try that first.  */
 -  default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
 +  default_face = FACE_OPT_FROM_ID (f, DEFAULT_FACE_ID);
    if (default_face
        && lface_same_font_attributes_p (default_face->lface, attrs))
      {
@@@ -6085,6 -6094,7 +6086,6 @@@ face_at_string_position (struct window 
      *endptr = -1;
  
    base_face = FACE_FROM_ID (f, base_face_id);
 -  eassert (base_face);
  
    /* Optimize the default case that there is no face property.  */
    if (NILP (prop)
@@@ -6131,7 -6141,7 +6132,7 @@@ merge_faces (struct frame *f, Lisp_Obje
    Lisp_Object attrs[LFACE_VECTOR_SIZE];
    struct face *base_face;
  
 -  base_face = FACE_FROM_ID (f, base_face_id);
 +  base_face = FACE_OPT_FROM_ID (f, base_face_id);
    if (!base_face)
      return base_face_id;
  
        struct face *face;
        if (face_id < 0)
        return base_face_id;
 -      face = FACE_FROM_ID (f, face_id);
 +      face = FACE_OPT_FROM_ID (f, face_id);
        if (!face)
        return base_face_id;
        merge_face_vectors (f, face->lface, attrs, 0);
@@@ -6279,7 -6289,7 +6280,7 @@@ DEFUN ("dump-face", Fdump_face, Sdump_f
      {
        struct face *face;
        CHECK_NUMBER (n);
 -      face = FACE_FROM_ID (SELECTED_FRAME (), XINT (n));
 +      face = FACE_OPT_FROM_ID (SELECTED_FRAME (), XINT (n));
        if (face == NULL)
        error ("Not a valid face");
        dump_realized_face (face);
index 0000000000000000000000000000000000000000,485254aa6cfa2bd848cc2417684f00d0b9d61128..485254aa6cfa2bd848cc2417684f00d0b9d61128
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,124 +1,124 @@@
+ ;;; char-fold-tests.el --- Tests for char-fold.el  -*- lexical-binding: t; -*-
+ ;; Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ ;; Author: Artur Malabarba <bruce.connor.am@gmail.com>
+ ;; This program is free software; you can redistribute it and/or modify
+ ;; it under the terms of the GNU General Public License as published by
+ ;; the Free Software Foundation, either version 3 of the License, or
+ ;; (at your option) any later version.
+ ;; This program is distributed in the hope that it will be useful,
+ ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ ;; GNU General Public License for more details.
+ ;; You should have received a copy of the GNU General Public License
+ ;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ ;;; Code:
+ (require 'ert)
+ (require 'char-fold)
+ (defun char-fold--random-word (n)
+   (mapconcat (lambda (_) (string (+ 9 (random 117))))
+              (make-list n nil) ""))
+ (defun char-fold--test-search-with-contents (contents string)
+   (with-temp-buffer
+     (insert contents)
+     (goto-char (point-min))
+     (should (search-forward-regexp (char-fold-to-regexp string) nil 'noerror))
+     (goto-char (point-min))
+     (should (char-fold-search-forward string nil 'noerror))
+     (should (char-fold-search-backward string nil 'noerror))))
\f
+ (ert-deftest char-fold--test-consistency ()
+   (dotimes (n 30)
+     (let ((w (char-fold--random-word n)))
+       ;; A folded string should always match the original string.
+       (char-fold--test-search-with-contents w w))))
+ (ert-deftest char-fold--test-lax-whitespace ()
+   (dotimes (n 40)
+     (let ((w1 (char-fold--random-word n))
+           (w2 (char-fold--random-word n))
+           (search-spaces-regexp "\\s-+"))
+       (char-fold--test-search-with-contents
+        (concat w1 "\s\n\s\t\f\t\n\r\t" w2)
+        (concat w1 " " w2))
+       (char-fold--test-search-with-contents
+        (concat w1 "\s\n\s\t\f\t\n\r\t" w2)
+        (concat w1 (make-string 10 ?\s) w2)))))
+ (defun char-fold--test-match-exactly (string &rest strings-to-match)
+   (let ((re (concat "\\`" (char-fold-to-regexp string) "\\'")))
+     (dolist (it strings-to-match)
+       (should (string-match re it)))
+     ;; Case folding
+     (let ((case-fold-search t))
+       (dolist (it strings-to-match)
+         (should (string-match (upcase re) (downcase it)))
+         (should (string-match (downcase re) (upcase it)))))))
+ (ert-deftest char-fold--test-some-defaults ()
+   (dolist (it '(("ffl" . "ffl") ("ffi" . "ffi")
+                 ("fi" . "fi") ("ff" . "ff")
+                 ("ä" . "ä")))
+     (char-fold--test-search-with-contents (cdr it) (car it))
+     (let ((multi (char-table-extra-slot char-fold-table 0))
+           (char-fold-table (make-char-table 'char-fold-table)))
+       (set-char-table-extra-slot char-fold-table 0 multi)
+       (char-fold--test-match-exactly (car it) (cdr it)))))
+ (ert-deftest char-fold--test-fold-to-regexp ()
+   (let ((char-fold-table (make-char-table 'char-fold-table))
+         (multi  (make-char-table 'char-fold-table)))
+     (set-char-table-extra-slot char-fold-table 0 multi)
+     (aset char-fold-table ?a "xx")
+     (aset char-fold-table ?1 "44")
+     (aset char-fold-table ?\s "-!-")
+     (char-fold--test-match-exactly "a1a1" "xx44xx44")
+     (char-fold--test-match-exactly "a1  a 1" "xx44-!--!-xx-!-44")
+     (aset multi ?a '(("1" . "99")
+                      ("2" . "88")
+                      ("12" . "77")))
+     (char-fold--test-match-exactly "a" "xx")
+     (char-fold--test-match-exactly "a1" "xx44" "99")
+     (char-fold--test-match-exactly "a12" "77" "xx442" "992")
+     (char-fold--test-match-exactly "a2" "88")
+     (aset multi ?1 '(("2" . "yy")))
+     (char-fold--test-match-exactly "a1" "xx44" "99")
+     (char-fold--test-match-exactly "a12" "77" "xx442" "992")
+     ;; Support for this case is disabled.  See function definition or:
+     ;; https://lists.gnu.org/archive/html/emacs-devel/2015-11/msg02562.html
+     ;; (char-fold--test-match-exactly "a12" "xxyy")
+     ))
+ (ert-deftest char-fold--speed-test ()
+   (dolist (string (append '("tty-set-up-initial-frame-face"
+                             "tty-set-up-initial-frame-face-frame-faceframe-faceframe-faceframe-face")
+                           (mapcar #'char-fold--random-word '(10 50 100
+                                                                      50 100))))
+     (message "Testing %s" string)
+     ;; Make sure we didn't just fallback on the trivial search.
+     (should-not (string= (regexp-quote string)
+                          (char-fold-to-regexp string)))
+     (with-temp-buffer
+       (save-excursion (insert string))
+       (let ((time (time-to-seconds (current-time))))
+         ;; Our initial implementation of case-folding in char-folding
+         ;; created a lot of redundant paths in the regexp. Because of
+         ;; that, if a really long string "almost" matches, the regexp
+         ;; engine took a long time to realize that it doesn't match.
+         (should-not (char-fold-search-forward (concat string "c") nil 'noerror))
+         ;; Ensure it took less than a second.
+         (should (< (- (time-to-seconds (current-time))
+                       time)
+                    1))))))
+ (provide 'char-fold-tests)
+ ;;; char-fold-tests.el ends here
index 70e129cc4f577384eea360c653308ced0e17d9af,c4c856f30315f19fd609bbdec43e6324da2afe04..c7a5cc7af22412a8b52188d51dc465818e090296
@@@ -97,7 -97,7 +97,7 @@@
                                 (multi-file (0 1))))
    "`package-desc' used for testing dependencies.")
  
 -(defvar package-test-data-dir (expand-file-name "data/package" package-test-file-dir)
 +(defvar package-test-data-dir (expand-file-name "package-resources" package-test-file-dir)
    "Base directory of package test files.")
  
  (defvar package-test-fake-contents-file
@@@ -190,18 -190,18 +190,18 @@@ Must called from within a `tar-mode' bu
  
  (ert-deftest package-test-desc-from-buffer ()
    "Parse an elisp buffer to get a `package-desc' object."
 -  (with-package-test (:basedir "data/package" :file "simple-single-1.3.el")
 +  (with-package-test (:basedir "package-resources" :file "simple-single-1.3.el")
      (should (equal (package-buffer-info) simple-single-desc)))
 -  (with-package-test (:basedir "data/package" :file "simple-depend-1.0.el")
 +  (with-package-test (:basedir "package-resources" :file "simple-depend-1.0.el")
      (should (equal (package-buffer-info) simple-depend-desc)))
 -  (with-package-test (:basedir "data/package"
 +  (with-package-test (:basedir "package-resources"
                                 :file "multi-file-0.2.3.tar")
      (tar-mode)
      (should (equal (package-tar-file-info) multi-file-desc))))
  
  (ert-deftest package-test-install-single ()
    "Install a single file without using an archive."
 -  (with-package-test (:basedir "data/package" :file "simple-single-1.3.el")
 +  (with-package-test (:basedir "package-resources" :file "simple-single-1.3.el")
      (should (package-install-from-buffer))
      (package-initialize)
      (should (package-installed-p 'simple-single))
  
  (ert-deftest package-test-macro-compilation ()
    "Install a package which includes a dependency."
 -  (with-package-test (:basedir "data/package")
 +  (with-package-test (:basedir "package-resources")
      (package-install-file (expand-file-name "macro-problem-package-1.0/"))
      (require 'macro-problem)
      ;; `macro-problem-func' uses a macro from `macro-aux'.
  (ert-deftest package-test-install-prioritized ()
    "Install a lower version from a higher-prioritized archive."
    (with-package-test ()
 -    (let* ((newer-version (expand-file-name "data/package/newer-versions"
 +    (let* ((newer-version (expand-file-name "package-resources/newer-versions"
                                              package-test-file-dir))
             (package-archives `(("older" . ,package-test-data-dir)
                                 ("newer" . ,newer-version)))
  
  (ert-deftest package-test-install-multifile ()
    "Check properties of the installed multi-file package."
 -  (with-package-test (:basedir "data/package" :install '(multi-file))
 +  (with-package-test (:basedir "package-resources" :install '(multi-file))
      (let ((autoload-file
             (expand-file-name "multi-file-autoloads.el"
                               (expand-file-name
        (package-menu-execute)
        (should (package-installed-p 'simple-single))
        (let ((package-test-data-dir
 -             (expand-file-name "data/package/newer-versions" package-test-file-dir)))
 +             (expand-file-name "package-resources/newer-versions" package-test-file-dir)))
          (setq package-archives `(("gnu" . ,package-test-data-dir)))
          (package-menu-refresh)
  
                     (delete-directory homedir t)))))
    (let* ((keyring (expand-file-name "key.pub" package-test-data-dir))
         (package-test-data-dir
 -         (expand-file-name "data/package/signed" package-test-file-dir)))
 +         (expand-file-name "package-resources/signed" package-test-file-dir)))
      (with-package-test ()
        (package-initialize)
        (package-import-keyring keyring)
        (package-refresh-contents)
-       (should (package-install 'signed-good))
-       (should-error (package-install 'signed-bad))
+       (let ((package-check-signature 'allow-unsigned))
+         (should (package-install 'signed-good))
+         (should-error (package-install 'signed-bad)))
+       (let ((package-check-signature t))
+         (should (package-install 'signed-good))
+         (should-error (package-install 'signed-bad)))
+       (let ((package-check-signature nil))
+         (should (package-install 'signed-good))
+         (should (package-install 'signed-bad)))
        ;; Check if the installed package status is updated.
        (let ((buf (package-list-packages)))
        (package-menu-refresh)
  
  (ert-deftest package-x-test-upload-buffer ()
    "Test creating an \"archive-contents\" file"
 -  (with-package-test (:basedir "data/package"
 +  (with-package-test (:basedir "package-resources"
                                 :file "simple-single-1.3.el"
                                 :upload-base t)
      (package-upload-buffer)
  
  (ert-deftest package-x-test-upload-new-version ()
    "Test uploading a new version of a package"
 -  (with-package-test (:basedir "data/package"
 +  (with-package-test (:basedir "package-resources"
                                 :file "simple-single-1.3.el"
                                 :upload-base t)
      (package-upload-buffer)
                 simple-depend-desc-2)))
      (should
       (equal (package--sort-by-dependence delete-list)
 +
              (list simple-depend-desc-2 simple-depend-desc-1 new-pkg-desc
                    multi-file-desc simple-depend-desc simple-single-desc)))
      (should
diff --combined test/src/data-tests.el
index 9ca5ac533339efb2ec84ced5152bd808454b1321,0a292336f35bd90cd5198a01359e83fbd1dd19e7..0a292336f35bd90cd5198a01359e83fbd1dd19e7
@@@ -4,18 -4,18 +4,18 @@@
  
  ;; This file is part of GNU Emacs.
  
- ;; This program is free software: you can redistribute it and/or
- ;; modify it under the terms of the GNU General Public License as
- ;; published by the Free Software Foundation, either version 3 of the
- ;; License, or (at your option) any later version.
- ;;
- ;; This program is distributed in the hope that it will be useful, but
- ;; WITHOUT ANY WARRANTY; without even the implied warranty of
- ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- ;; General Public License for more details.
- ;;
+ ;; 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 this program.  If not, see `http://www.gnu.org/licenses/'.
+ ;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
  
  ;;; Commentary: