emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 3d0d5b4 1/3: Merge from origin/emacs-26


From: Paul Eggert
Subject: [Emacs-diffs] master 3d0d5b4 1/3: Merge from origin/emacs-26
Date: Thu, 12 Oct 2017 16:50:55 -0400 (EDT)

branch: master
commit 3d0d5b4ebdf19876104d23402606f2b3cc636aca
Merge: 36375d3 05d0c0f
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Merge from origin/emacs-26
    
    05d0c0f802 ; * ChangeLog.3: ChangeLog fixes.
    fbabae6b24 * ChangeLog.3: Update.
    eab051991e Fix docstring style for 'functionp'
    e8a7c41b4e Format shell commands in tramp.texi
    0526aac4eb Unbreak the button in the Flymake diagnostics buffer again
    c89f001de1 Add mode map to Flymake diagnostic button
    f9cd8ee681 Tweak the Flymake diagnostics buffer again
    0e83f5f279 Simplify Flymake diagnostics buffer UX
    cf4a15b9b6 First stab at a Flymake diagnostics buffer
    e4a1556392 * etc/NEWS (Flymake): Rewrite entry.
    00adeb43e9 Improve the Flymake manual
    44c6401733 ; * etc/NEWS: Clarify the description of "---" and "+++".
    042b3cfbd2 Fix two Flymake bugs
    3dfa2ca4dc Don't log "emergencies" in the Flymake legacy backend
    1c2e188440 Add full documentation on new Flymake API
    0f7f677f82 Fix some Flymake docstrings and messages
    21e7075781 Make three new Flymake commands for debugging common problems
    c9be9a3678 ; INSTALL.REPO: Add -d to "thorough cleaning" suggestion.
    5d51403ceb ; Typo fixes, mostly repeated words
    0d004ed01a ; Spelling fixes
    0485aa76c9 ; * src/lread.c (syms_of_lread) <module-file-suffix>: Fix ...
    ba7fb37d6a * admin/authors.el (authors-renamed-files-alist): addition.
    14dca4a79a ; ChangeLog.3 fixes
    f352d0257c Fix PWD check on DOS_NT
    934f08f3de Fix unlikely overflows with wd length
    6c2b1e89ef * lisp/gnus/message.el: Improve last commit
    7ed7360855 Fix problems when editing raw undecoded message (Bug#28671)
    aca5f0072b Avoid encoding errors in message.el
    0c36663db5 Improve doc string and prompt of 'grep-read-files'
    2da83c9d36 Avoid assertion violations when line numbers are displayed
    5b81f65ad0 ; * lisp/emacs-lisp/rmc.el: Minor fix for copyright and li...
    11b37b4a9f Be lazy when starting Flymake checks
    36ed9a9ede Fix last change in frameset.el
    62e5c119af Describe how window dividers can replicate vertical border...
    e2150d994a Add line-number faces to the display-line-numbers group
    89b0023044 Increase xterm click count only within double-click-fuzz
    745aea2296 Change pause in fullscreen toggling for NS port (bug#28496)
    1cd334cd47 Handle PARENTS properly in tramp-*-handle-make-directory
    f1c73de47d ; Merge from Gnulib (comment changes only)
    7c2c117c91 Improve test for unreachable dirs
    2202952b83 * src/xsmfns.c (x_session_initialize): Fix memory leak.
    a9b72976de Merge branch 'emacs-26' of git.sv.gnu.org:/srv/git/emacs i...
    64baaff8c5 New option for handling ZWNJ in Arabic text rendering
    c194fb61c6 Make python prettify symbols into a defvar (Bug#28713)
    6dfc778d54 Fix fullscreen crash on macOS (bug#28496)
    3db0dc2168 Fix crash when closing fullscreen frame on macOS (bug#28661)
    bc80da5bd3 Support gio tool in Tramp
    349e0eb5ff Fix flymake-goto-next-error when message has %-constructs
    0fa353b504 * src/gnutls.c (syms_of_gnutls): Remove duplicated call to...
    dc6ae15a8d Move the entry about 'format' into Incompatible Lisp Changes
    75174a632d Fix glitches in displaying TTY menus
    238fbcb20e Create new Edebug spec for docstrings and use it in closures
    2d58d51329 Avoid byte-compilation warnings in message.el
    
    # Conflicts:
    #   etc/NEWS
---
 CONTRIBUTE                           |   2 +-
 ChangeLog.2                          |   2 +-
 ChangeLog.3                          | 725 ++++++++++++++++++++++++++++++-----
 INSTALL.REPO                         |   2 +-
 admin/authors.el                     |   1 +
 doc/emacs/anti.texi                  |   2 +-
 doc/emacs/frames.texi                |  21 +-
 doc/emacs/rmail.texi                 |   2 +-
 doc/emacs/text.texi                  |   2 +-
 doc/lispintro/emacs-lisp-intro.texi  |   2 +-
 doc/lispref/debugging.texi           |   2 +-
 doc/lispref/os.texi                  |   2 +-
 doc/lispref/searching.texi           |   2 +-
 doc/misc/flymake.texi                | 675 ++++++++++++++++++++++++++------
 doc/misc/htmlfontify.texi            |   2 +-
 doc/misc/ses.texi                    |   2 +-
 doc/misc/tramp.texi                  |  22 +-
 lib/getopt-cdefs.in.h                |   4 +-
 lib/getopt-pfx-core.h                |   4 +-
 lib/getopt-pfx-ext.h                 |   4 +-
 lib/getopt.in.h                      |   4 +-
 lisp/ChangeLog.16                    |   2 +-
 lisp/ChangeLog.6                     |   2 +-
 lisp/allout.el                       |   2 +-
 lisp/button.el                       |   2 +-
 lisp/cedet/ChangeLog.1               |   2 +-
 lisp/cedet/cedet-idutils.el          |   2 +-
 lisp/cedet/ede/pmake.el              |   2 +-
 lisp/cedet/semantic/db-find.el       |   2 +-
 lisp/cedet/semantic/db.el            |   2 +-
 lisp/cedet/semantic/edit.el          |   2 +-
 lisp/composite.el                    |  14 +
 lisp/dired-x.el                      |   2 +-
 lisp/display-line-numbers.el         |   1 +
 lisp/elide-head.el                   |   2 +-
 lisp/emacs-lisp/advice.el            |   2 +-
 lisp/emacs-lisp/cl-generic.el        |  13 +-
 lisp/emacs-lisp/cl-macs.el           |   6 +-
 lisp/emacs-lisp/edebug.el            |  27 +-
 lisp/emacs-lisp/generator.el         |   6 +-
 lisp/emacs-lisp/pcase.el             |   2 +-
 lisp/emacs-lisp/rmc.el               |   4 +-
 lisp/faces.el                        |   6 +-
 lisp/frame.el                        |   6 +-
 lisp/frameset.el                     |   2 +-
 lisp/gnus/ChangeLog.3                |   2 +-
 lisp/gnus/gnus-mlspl.el              |   3 +-
 lisp/gnus/message.el                 |  11 +-
 lisp/gnus/spam.el                    |   2 +-
 lisp/ido.el                          |   2 +-
 lisp/language/misc-lang.el           |  64 +++-
 lisp/mail/rmailedit.el               |  26 +-
 lisp/net/newst-ticker.el             |   2 +-
 lisp/net/tramp-adb.el                |   9 +-
 lisp/net/tramp-gvfs.el               |  42 +-
 lisp/obsolete/landmark.el            |   2 +-
 lisp/obsolete/levents.el             |   2 +-
 lisp/obsolete/otodo-mode.el          |   2 +-
 lisp/org/org-faces.el                |   2 +-
 lisp/org/org-inlinetask.el           |   2 +-
 lisp/play/gomoku.el                  |   2 +-
 lisp/progmodes/antlr-mode.el         |   2 +-
 lisp/progmodes/cc-vars.el            |   2 +-
 lisp/progmodes/cperl-mode.el         |   2 +-
 lisp/progmodes/flymake-proc.el       |   4 +-
 lisp/progmodes/flymake.el            | 353 +++++++++++++----
 lisp/progmodes/grep.el               |   5 +-
 lisp/progmodes/python.el             |   8 +-
 lisp/subr.el                         |   3 +-
 lisp/term/tvi970.el                  |   6 +-
 lisp/textmodes/less-css-mode.el      |   2 +-
 lisp/textmodes/picture.el            |   2 +-
 lisp/textmodes/rst.el                |   2 +-
 lisp/vc/pcvs-defs.el                 |   2 +-
 lisp/xt-mouse.el                     |   8 +-
 src/ChangeLog.10                     |   2 +-
 src/ChangeLog.12                     |   2 +-
 src/ChangeLog.4                      |   2 +-
 src/ChangeLog.5                      |   2 +-
 src/ChangeLog.7                      |   2 +-
 src/buffer.c                         |   2 +-
 src/dispnew.c                        |  22 +-
 src/emacs-module.c                   |   2 +-
 src/emacsgtkfixed.c                  |   2 +-
 src/eval.c                           |   2 +-
 src/fileio.c                         |   2 +-
 src/frame.h                          |   2 +-
 src/gnutls.c                         |   1 -
 src/keyboard.h                       |   2 +-
 src/lread.c                          |   2 +-
 src/nsterm.m                         |   5 +-
 src/scroll.c                         |   2 +-
 src/sysdep.c                         |  92 +++--
 src/termhooks.h                      |   2 +-
 src/w32inevt.c                       |   2 +-
 src/w32proc.c                        |   2 +-
 src/xdisp.c                          |   1 +
 src/xsmfns.c                         |   4 +-
 test/lisp/kmacro-tests.el            |   2 +-
 test/lisp/net/tramp-tests.el         |   7 +-
 test/lisp/progmodes/flymake-tests.el |  12 +-
 test/lisp/simple-tests.el            |   2 +-
 102 files changed, 1868 insertions(+), 487 deletions(-)

diff --git a/CONTRIBUTE b/CONTRIBUTE
index e1ba506..d01ac8b 100644
--- a/CONTRIBUTE
+++ b/CONTRIBUTE
@@ -105,7 +105,7 @@ tested).
 
 Emacs uses ERT, Emacs Lisp Regression Testing, for testing.  See
 https://www.gnu.org/software/emacs/manual/html_node/ert/
-or run 'info "(ert)"' for for more information on writing and running
+or run 'info "(ert)"' for more information on writing and running
 tests.
 
 If your test lasts longer than some few seconds, mark it in its
diff --git a/ChangeLog.2 b/ChangeLog.2
index e7befde..a412d3b 100644
--- a/ChangeLog.2
+++ b/ChangeLog.2
@@ -4415,7 +4415,7 @@
 
 2016-05-01  Lars Ingebrigtsen  <address@hidden>
 
-       Document mode mode line variables
+       Document mode line variables
 
        * doc/lispref/modes.texi (Mode Line Variables): Document
        `mode-line-front-space, `mode-line-misc-info',
diff --git a/ChangeLog.3 b/ChangeLog.3
index 33d04f7..a49477a 100644
--- a/ChangeLog.3
+++ b/ChangeLog.3
@@ -1,3 +1,529 @@
+2017-10-11  Michael Albinus  <address@hidden>
+
+       Format shell commands in tramp.texi
+
+       * doc/misc/tramp.texi (Obtaining Tramp, Remote shell setup):
+       Format shell commands better.
+
+2017-10-10  João Távora  <address@hidden>
+
+       Unbreak the button in the Flymake diagnostics buffer again
+
+       Adding the 'keymap' property enabled RET but broke the mouse-action.
+
+       * lisp/progmodes/flymake.el
+       (flymake--diagnostics-buffer-entries): Use 'action' instead of 'keymap'.
+
+2017-10-10  Mark Oteiza  <address@hidden>
+
+       Add mode map to Flymake diagnostic button
+
+       * lisp/progmodes/flymake.el (flymake--diagnostics-buffer-entries): Add
+       keymap propery.
+
+2017-10-10  João Távora  <address@hidden>
+
+       Tweak the Flymake diagnostics buffer again
+
+       * lisp/progmodes/flymake.el
+       (flymake-diagnostics-buffer-mode-map): Don't bind [mouse-1].
+       (flymake-show-diagnostic): Rename from
+       flymake-show-diagnostic-at-point.  Really use another window.
+       (flymake-goto-diagnostic): Rename from
+       flymake-goto-diagnostic-at-point.
+       (flymake--diagnostics-buffer-entries): Use a button just for
+       the message bit.
+
+2017-10-10  Mark Oteiza  <address@hidden>
+
+       Simplify Flymake diagnostics buffer UX
+
+       Don't create text-buttons unnecessarily, just bind RET and SPC in the
+       diagnostics buffer to a command that figures out which diagnostic it
+       was invoked on.
+
+       * lisp/progmodes/flymake.el
+       (flymake--diagnostics-buffer-mode-keymap): Renamed from
+       flymake--diagnostics-buffer-button-keymap.
+       (flymake-show-diagnostic-at-point): Don't take a button.
+       (flymake-goto-diagnostic-at-point): Don't pass button to
+       flymake-show-diagnostic-at-point.
+       (flymake--diagnostics-buffer-entries): Simplify.
+
+2017-10-10  João Távora  <address@hidden>
+
+       First stab at a Flymake diagnostics buffer
+
+       The diagnostics buffer summarizes the diagnostics of a buffer in a
+       tabulated list and is permanently updated after each Flymake check.
+
+       * lisp/progmodes/flymake.el (flymake--handle-report): Call
+       flymake-show-diagnostics-buffer under certain conditions.
+       (flymake-menu, flymake--diagnostics-buffer-source)
+       (flymake--diagnostics-buffer-button-keymap)
+       (flymake-show-diagnostic-at-point)
+       (flymake-goto-diagnostic-at-point)
+       (flymake--diagnostics-buffer-entries)
+       (flymake-diagnostics-buffer-mode)
+       (flymake--diagnostics-buffer-name)
+       (flymake-show-diagnostics-buffer): New definitions.
+
+2017-10-10  João Távora  <address@hidden>
+
+       * etc/NEWS (Flymake): Rewrite entry.
+
+2017-10-10  Eli Zaretskii  <address@hidden>
+
+       Improve the Flymake manual
+
+       * doc/misc/flymake.texi: Add a 'coding' cookie.  Add a
+       @syncodeindex directive for @vindex.  Use 2 spaces between
+       sentences.  Lower-case @cindex entries.
+       (Overview of Flymake): Fix use of @itemize and @pxref.  Fix
+       punctuation and markup.
+       (Backend exceptions): Use @emph instead of @dfn.  Add more
+       indexing.
+       (Customizable variables, Extending Flymake): Improve wording.
+       (Flymake error types): Fix usage of @itemize.  Improve wording.
+       (Backend functions): Fix punctuation.  Fix markup.  Add a
+       cross-reference to ELisp manual.
+       (Flymake utility functions): Add a cross-reference to ELisp manual.
+       (An annotated example backend): Fix punctuation and typos.
+       (Flymake mode, Running the syntax check)
+       (Navigating to error lines, Backend exceptions)
+       (Customizable variables, Flymake error types, Backend functions)
+       (Flymake utility functions, Proc customization variables)
+       (Locating a master file, Locating the buildfile)
+       (Starting the syntax check process, Parsing the output)
+       (Interaction with other modes): Fix indexing.  Add index entries
+       for functions, variables, and concepts.
+
+2017-10-10  João Távora  <address@hidden>
+
+       Fix two Flymake bugs
+
+       * lisp/progmodes/flymake.el (define-fringe-bitmap): Protect
+       against --without-x.
+       (flymake--mode-line-format): Ensure mode-line's mouse-4 and mouse-5 work
+       in their own windows.
+
+2017-10-10  João Távora  <address@hidden>
+
+       Don't log "emergencies" in the Flymake legacy backend
+
+       * lisp/progmodes/flymake-proc.el (flymake-proc--panic)
+       (flymake-proc-legacy-flymake): Don't log "emergencies"
+
+2017-10-10  João Távora  <address@hidden>
+
+       Add full documentation on new Flymake API
+
+       Also, as a minor addition to this API, set flymake-text
+       on the diagnostic overlay.  This enables a good example in
+       the section "Customization Flymake annotations".
+
+       * doc/misc/flymake.texi (Overview of Flymake)
+       (Syntax check statuses): Rework.
+       (Backend exceptions): Rename from "Troubleshooting"
+       (Customizable variables): Add flymake-start-on-flymake-mode. Rework.
+       (Extending Flymake): Write chapter.
+       (Customizing Flymake annotations, Flymake backends)
+       (Flymake utility functions, An annotated example backend):
+       New sections and subsections
+
+       * lisp/progmodes/flymake.el (flymake-diagnostic-functions)
+       (flymake-diagnostic-types-alist): Rework docstring.
+       (flymake--highlight-line): Set and use flymake-text property in overlay.
+       (flymake-goto-next-error, flymake-goto-prev-error): Fix funny quotes.
+
+2017-10-10  João Távora  <address@hidden>
+
+       Fix some Flymake docstrings and messages
+
+       * lisp/progmodes/flymake.el
+       (flymake-start-on-flymake-mode): fix typo.
+       (flymake-mode): Add docstring.
+       (flymake-mode-line-format): Fix help-echo indications. mouse-2
+       describes flymake-mode.
+
+2017-10-10  João Távora  <address@hidden>
+
+       Make three new Flymake commands for debugging common problems
+
+       * lisp/progmodes/flymake.el (flymake-running-backends)
+       (flymake-disabled-backends)
+       (flymake-reporting-backends): Make interactive.
+       (flymake--collect): Take optional arg.
+
+2017-10-09  Nicolas Petton  <address@hidden>
+
+       * admin/authors.el (authors-renamed-files-alist): addition.
+
+2017-10-09  Paul Eggert  <address@hidden>
+
+       Fix PWD check on DOS_NT
+
+       * src/sysdep.c (get_current_dir_name_or_unreachable):
+       Do not consider a file name like "a:b" to be absolute on DOS_NT.
+
+2017-10-09  Paul Eggert  <address@hidden>
+
+       Fix unlikely overflows with wd length
+
+       * src/sysdep.c (get_current_dir_name_or_unreachable):
+       Avoid integer overflow if working directory name is absurdly long.
+       When allocating memory for getcwd, do not exceed MAXPATHLEN.
+
+2017-10-09  Stefan Monnier  <address@hidden>
+
+       * lisp/gnus/message.el: Improve last commit
+
+       (message-clone-locals): Don't mistakenly match other variables whose
+       name happens to include "message-default-charset".
+
+2017-10-09  Ken Olum  <address@hidden>
+
+       Fix problems when editing raw undecoded message (Bug#28671)
+
+       * lisp/mail/rmailedit.el (rmail-cease-edit): If rmail-old-mime-state
+       is set, meaning that we are editing the raw message, do not
+       encode it again.  Delete old body after, not before, inserting
+       new, to avoid moving marker at beginning of next message.
+
+2017-10-09  Eli Zaretskii  <address@hidden>
+
+       Avoid encoding errors in message.el
+
+       * lisp/gnus/message.el (message-clone-locals): Don't clone
+       message-default-charset.  (Bug#25645)
+
+2017-10-09  Eli Zaretskii  <address@hidden>
+
+       Improve doc string and prompt of 'grep-read-files'
+
+       * lisp/progmodes/grep.el (grep-read-files): Clarify in the doc
+       string and in the prompt that shell wildcards can be used.
+       Suggested by Allen Li <address@hidden>.  (Bug#28615)
+
+2017-10-09  Eli Zaretskii  <address@hidden>
+
+       Avoid assertion violations when line numbers are displayed
+
+       * src/xdisp.c (redisplay_window): Clear the window's desired glyph
+       matrix before calling try_window with the same starting point.
+       This avoids assertion violations when switching from a buffer
+       without line numbers to a buffer with line numbers.  (Bug28710)
+
+2017-10-09  João Távora  <address@hidden>
+
+       Be lazy when starting Flymake checks
+
+       Don't start the check immediately if the buffer is not being
+       displayed.  Wait until it is, using window-configuration-change-hook.
+
+       This enables the user to batch-enable flymake-mode on many buffers and
+       not have that operation exhaust system resources for checking each
+       one.  Likewise, an editing or save operation in a currently
+       non-displayed buffer does not immediately start a check.
+
+       * lisp/progmodes/flymake.el (flymake-start-on-flymake-mode):
+       Rename from flymake-start-syntax-check-on-find-file.
+       (flymake-start-syntax-check-on-find-file): Obsolete alias for
+       flymake-start-on-flymake-mode.
+       (flymake-start): Redesign.  Affect the global post-command-hook
+       and local window-configuraiton-change-hook.
+       (flymake--schedule-timer-maybe)
+       (flymake-after-change-function, flymake-after-save-hook): Pass
+       t to flymake-start.
+
+       * test/lisp/progmodes/flymake-tests.el 
(flymake-tests--call-with-fixture)
+       (dummy-backends, recurrent-backend): Start flymake check
+       explicitly and immediately.
+
+2017-10-09  Eli Zaretskii  <address@hidden>
+
+       Fix last change in frameset.el
+
+       * lisp/frameset.el (frameset-filter-font-param): Fix a thinko in
+       filtering the 'font' parameter.  (Bug#17352)
+
+2017-10-09  Martin Rudalics  <address@hidden>
+
+       Describe how window dividers can replicate vertical borders (Bug#27830)
+
+       * doc/emacs/frames.texi (Scroll Bars): Describe how window
+       dividers can be used to replicate vertical borders when scroll
+       bars are disabled (Bug#27830).
+       * doc/emacs/frames.texi (Window Dividers): Mention their use
+       in replicating vertical borders.
+
+2017-10-09  Alexander Gramiak  <address@hidden>
+
+       Add line-number faces to the display-line-numbers group
+
+       See https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00151.html
+       and its resulting thread.
+
+       * lisp/display-line-numbers.el (display-line-numbers): Add to the
+       convenience group.
+       * lisp/faces.el (line-number):
+       (line-number-current-line): Add to the display-line-numbers group.
+
+2017-10-09  Alexander Gramiak  <address@hidden>
+
+       Increase xterm click count only within double-click-fuzz
+
+       * lisp/xt-mouse.el (xterm-mouse-event): Save the last click's position
+       and check it against the current click's position.  (Bug#28658)
+
+2017-10-08  Alan Third  <address@hidden>
+
+       Change pause in fullscreen toggling for NS port (bug#28496)
+
+       * lisp/frame.el (toggle-frame-fullscreen): Replace sit-for with
+       sleep-for, and reduce time.
+
+2017-10-08  Michael Albinus  <address@hidden>
+
+       Handle PARENTS properly in tramp-*-handle-make-directory
+
+       * lisp/net/tramp-adb.el (tramp-adb-handle-make-directory):
+       * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-make-directory):
+       Handle PARENTS properly.
+
+       * test/lisp/net/tramp-tests.el (tramp-test13-make-directory):
+       Extend test.
+
+2017-10-08  Paul Eggert  <address@hidden>
+
+       Improve test for unreachable dirs
+
+       * src/sysdep.c (get_current_dir_name_or_unreachable):
+       New function, with most of the old contents of
+       emacs_get_current_dir_name.
+       (emacs_get_current_dir_name): Use it.  Use a simpler
+       test for unreachable directory strings, and also apply
+       it to getcwd etc. (Bug#27871)
+
+2017-10-08  Paul Eggert  <address@hidden>
+
+       * src/xsmfns.c (x_session_initialize): Fix memory leak.
+
+2017-10-08  K. Handa  <address@hidden>
+
+       New option for handling ZWNJ in Arabic text rendering
+
+       Provide a new option 'arabic-shaper-ZWNJ-handling' that controls how
+       to display ZWNJ in Arabic text rendering (Bug#28339).
+       * lisp/language/misc-lang.el: Register arabic-shape-gstring in
+       composition-function-table.
+       (arabic-shaper-ZWNJ-handling): New variable.
+       (arabic-shape-log): New variable.
+       (arabic-shape-gstring): New function.
+       * lisp/composite.el (lgstring-remove-glyph): New function.
+
+2017-10-08  Noam Postavsky  <address@hidden>
+
+       Make python prettify symbols into a defvar (Bug#28713)
+
+       * lisp/progmodes/python.el (python-prettify-symbols-alist): New
+       variable.
+       (python--prettify-symbols-alist): Make into obsolete alias for
+       `python-prettify-symbols-alist'.
+
+2017-10-07  Alan Third  <address@hidden>
+
+       Fix fullscreen crash on macOS (bug#28496)
+
+       * lisp/frame.el (toggle-frame-fullscreen): Wait for animation to
+       complete on macOS.
+
+2017-10-07  Alan Third  <address@hidden>
+
+       Fix crash when closing fullscreen frame on macOS (bug#28661)
+
+       * src/nsterm.m (EmacsView::windowWillResize): Return new frame size
+       unmodified if the frame isn't live.
+
+2017-10-07  Michael Albinus  <address@hidden>
+
+       Support gio tool in Tramp
+
+       "gvfs-<command>" utilities have been deprecated in GVFS 1.31.1.  We
+       must use "gio <command>" tool instead.
+
+       * lisp/net/tramp-gvfs.el (tramp-gvfs-gio-mapping): New defconst.
+       (tramp-gvfs-handle-file-notify-add-watch): Support also "gio monitor"
+       (tramp-gvfs-gio-tool-p): New defun.
+       (tramp-gvfs-send-command): Use it.  Call gio tool if available.
+
+2017-10-07  João Távora  <address@hidden>
+
+       Fix flymake-goto-next-error when message has %-constructs
+
+       * lisp/progmodes/flymake.el (flymake-goto-next-error): Fix
+       message call.  Add missing period in docstring.
+
+2017-10-07  Piotr Trojanek  <address@hidden>
+
+       * src/gnutls.c (syms_of_gnutls): Remove duplicated call to DEFSYM.
+
+2017-10-07  Eli Zaretskii  <address@hidden>
+
+       Move the entry about 'format' into Incompatible Lisp Changes
+
+       * etc/NEWS: Move the entry about 'format' refraining from allocating
+       new strings into Incompatible Lisp Changes.  (Bug#28625)
+
+2017-10-07  Eli Zaretskii  <address@hidden>
+
+       Fix glitches in displaying TTY menus
+
+       * src/dispnew.c (update_frame_line): Accept an additional argument
+       UPDATING_MENU_P; if non-zero, home the cursor before updating a
+       frame's line.  All callers changed.
+       (update_frame_1): Accept an additional argument UPDATING_MENU_P,
+       and pass it to update_frame_line.  All callers changed.
+       (update_frame_with_menu): Call update_frame_1 with last argument
+       non-zero.  (Bug#17497)
+
+2017-10-06  Gemini Lasswell  <address@hidden>
+
+       Create new Edebug spec for docstrings and use it in closures
+
+       Since (:documentation FORM) can be used to create a docstring
+       when lexical-binding is on, allow for that possibility in Edebug
+       specs (bug#24773).
+       * lisp/emacs-lisp/edebug.el: Define an Edebug spec for docstrings
+       called lambda-doc and modify the Edebug specs for defun and
+       defmacro to use it.
+       (edebug-instrument-function): Check for generic functions first,
+       to fix bug where edebug-step-in didn't work on methods now that
+       cl-defgeneric has an Edebug spec.
+       * lisp/subr.el (lambda): Modify Edebug spec to use lambda-doc.
+       * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Add Edebug spec
+       (bug#27747).
+       (cl-defmethod): Use lambda-doc in Edebug spec.
+       * lisp/emacs-lisp/cl-macs.el: Modify Edebug spec for
+       cl-declarations-or-string to use lambda-doc, and modify Edebug
+       spec for cl-lambda-expr to use cl-declarations-or-string.
+       * lisp/emacs-lisp/pcase.el (pcase-lambda): Modify Edebug spec to
+       use lambda-doc, as well as &define and def-body which are
+       necessary for using Edebug on code wrapped by lambda.
+       * lisp/emacs-lisp/generator.el (iter-defun, iter-lambda): Add
+       Edebug specs.
+
+2017-10-06  Eli Zaretskii  <address@hidden>
+
+       Avoid byte-compilation warnings in message.el
+
+       * lisp/gnus/message.el: Require 'subr-x' when compiling, to
+       avoid compiler warnings.
+
+2017-10-06  Paul Eggert  <address@hidden>
+
+       Fix bug in recent styled_format change
+
+       Problem reported by Kaushal Modi in:
+       http://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00141.html
+       * src/editfns.c (styled_format): Fix bug where USE_SAFE_ALLOCA was
+       not always followed by SAFE_FREE.  This bug was introduced in my
+       patch 2017-09-26T23:31:address@hidden entitled "Avoid some
+       unnecessary copying in Fformat etc."
+
+2017-10-06  João Távora  <address@hidden>
+
+       Cleanup emacs-lisp-mode's use of Flymake
+
+       * lisp/progmodes/elisp-mode.el (elisp-flymake--checkdoc-1):
+       Delete.
+       (elisp-flymake-checkdoc): Incorporate old
+       elisp-flymake--checkdoc-1.
+       (elisp-flymake--byte-compile-done): Simplify.  Don't cleanup
+       here.
+       (elisp-flymake-byte-compile): Remove spurious interactive spec.
+       Simplify.  Cleanup on every possible exit.
+
+2017-10-06  João Távora  <address@hidden>
+
+       Fix @include directive in Flymake doc
+
+       * doc/misc/flymake.texi: Don't @include a relative path.
+
+2017-10-06  Mark Oteiza  <address@hidden>
+
+       Move read-multiple-choice to its own library
+
+       * lisp/emacs-lisp/rmc.el: New file.
+       * lisp/emacs-lisp/subr-x.el (read-multiple-choice): Remove.
+       * lisp/gnus/message.el:
+       * lisp/net/nsm.el: Change required library.
+
+2017-10-06  Piotr Trojanek  <address@hidden>
+
+       * src/process.c (syms_of_process): Remove duplicated call to DEFSYM.
+
+       Fixes: Bug#28721
+
+2017-10-06  Lele Gaifax  <address@hidden>
+
+       Fix typos in Flymake documentation
+
+       * doc/misc/flymake.texi (Syntax check statuses)
+       (Adding support for a new syntax check tool)
+       (Implementation overview, Locating the buildfile): Fix typos.
+
+       * lisp/progmodes/flymake-proc.el (flymake-proc--report-fn)
+       (flymake-proc--find-possible-master-files):Fix typos.
+       (flymake-proc--panic)
+       (flymake-proc-legacy-flymake): Fix function reference in doc.
+
+       * lisp/progmodes/flymake.el (flymake-error)
+       (flymake-diagnostic-functions): Fix typos.
+       (flymake-diagnostic-types-alist): Rephrase and fix typos.
+       (flymake--backend-state): Fix typos and rephrase.
+       (flymake--handle-report): Delete empty line.
+       (flymake--disable-backend)
+       (flymake--run-backend): Fix typos.
+       (flymake-goto-next-error, flymake-goto-prev-error): Rephrase.
+
+2017-10-06  Eli Zaretskii  <address@hidden>
+
+       Revert last change in 'shr-descend'
+
+       * lisp/net/shr.el (shr-descend): Revert the part of the last
+       change which introduced calls to shr-indirect-call into this
+       function.  Add a comment explaining the rationale for that.
+       (Bug#28402)
+
+2017-10-06  João Távora  <address@hidden>
+
+       Don't error when turning on Flymake with no known backends
+
+       Leave it to the mode line indicator to inform the user that there
+       is still some configuration to do.
+
+       * lisp/progmodes/flymake.el (flymake-mode): Simplify.
+
+2017-10-06  João Távora  <address@hidden>
+
+       Delete a Flymake obsolete alias that can't possibly work
+
+       The function `flymake-ler-make-ler' can't possibly work as an backward
+       compatible interface to existing extensinos (even purely hypothetical
+       ones, since none are known).  This is because every diagnostic
+       considered by Flymake has to passed to a report-fn function.
+
+       * lisp/progmodes/flymake.el (flymake-ler-make-ler): Delete.
+
+2017-10-06  Paul Eggert  <address@hidden>
+
+       Fix bug with unmounted directory on GNU/Linux
+
+       * src/sysdep.c (emacs_get_current_dir_name): Do not use
+       get_current_dir_name result unless it is absolute (Bug#27871).
+
+
 2017-10-05  Nicolas Petton  <address@hidden>
 
        Update authors.el
@@ -1379,7 +1905,7 @@
 
        Doc amendment for syntax-ppss.
 
-       * doc/elisp/syntax.texi (Position Parse): Note, twice, that syntax-ppss 
is
+       * doc/lispref/syntax.texi (Position Parse): Note, twice, that 
syntax-ppss is
        equivalent to parse-partial-sexp from the beginning of THE VISIBLE PART 
OF the
        buffer.  Final part of the fix for bug #22983.
 
@@ -1869,7 +2395,8 @@
 
 2017-09-25  Michael Albinus  <address@hidden>
 
-       * test/lisp/tramp-tests.el (tramp-test21-file-links): Special code for 
smb.
+       * test/lisp/net/tramp-tests.el (tramp-test21-file-links): Special
+       code for smb.
 
 2017-09-25  Mark Oteiza  <address@hidden>
 
@@ -2012,8 +2539,8 @@
 
        Add tests for Edebug
 
-       * tests/lisp/emacs-lisp/edeug-tests.el: New file.
-       * tests/lisp/emacs-lisp/edebug-resources/edebug-test-code.el: New file.
+       * test/lisp/emacs-lisp/edebug-tests.el: New file.
+       * test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el: New file.
 
 2017-09-21  Gemini Lasswell  <address@hidden>
 
@@ -3335,7 +3862,7 @@
        Construct Tramp syntax strings and regular expressions once instead
        of every time they are used, and store them in alists keyed by Tramp
        syntax.
-       * tramp.el (tramp-build-remote-file-name-spec-regexp)
+       * lisp/net/tramp.el (tramp-build-remote-file-name-spec-regexp)
        (tramp-build-file-name-structure): New functions.
        (tramp-prefix-format-alist, tramp-prefix-regexp-alist)
        (tramp-method-regexp-alist)
@@ -4755,7 +5282,7 @@
        The practical implication of this bug was a random jit-lock chunk 
remaining
        entirely unfontified.
 
-       * lisp/progmodes/cc-mode (c-fl-decl-end): If point starts inside a 
macro,
+       * lisp/progmodes/cc-mode.el (c-fl-decl-end): If point starts inside a 
macro,
        restrict two forward searches to the end of that macro.
 
 2017-08-22  Michael Albinus  <address@hidden>
@@ -6202,7 +6729,7 @@
        Before previous commit, we prompted users with `yes-or-no-p'
        which doesn't TAB complete the user answer.  Let's play safe and
        keep requiring full answers.
-       * emacs-master/lisp/dired.el (dired-delete-file): Use `read-string'
+       * lisp/dired.el (dired-delete-file): Use `read-string'
        instead of `completing-read' to read the user answers.
 
 2017-08-06  Tino Calancha  <address@hidden>
@@ -6700,7 +7227,8 @@
 
 2017-07-31  Tino Calancha  <address@hidden>
 
-       * lisp/dired (dired-trivial-filenames): Use \` and \' to match string 
bounds
+       * lisp/dired.el (dired-trivial-filenames): Use \` and \' to match
+       string bounds.
 
 2017-07-31  Paul Eggert  <address@hidden>
 
@@ -7045,7 +7573,7 @@
 
        Enable lexical binding.
        * lisp/ls-lisp.el (ls-lisp-unload-function): New defun.
-       * test/lisp/ls-lisp.el (ls-lisp-unload): Add test.
+       * test/lisp/ls-lisp-tests.el (ls-lisp-unload): Add test.
 
 2017-07-25  Tino Calancha  <address@hidden>
 
@@ -7485,7 +8013,7 @@
 
        Stylistic changes in tramp-cache.el
 
-       * test/lisp/net/tramp-cache.el (tramp-get-file-property)
+       * lisp/net/tramp-cache.el (tramp-get-file-property)
        (tramp-set-file-property): Use `bound-and-true-p'.  Add
        counter variables to `tramp-cache-unload-hook'.
 
@@ -7590,7 +8118,7 @@
 
 2017-07-18  Stefan Monnier  <address@hidden>
 
-       * emacs-lisp/cl-lib.el (cl--old-struct-type-of): Accept `[]'
+       * lisp/emacs-lisp/cl-lib.el (cl--old-struct-type-of): Accept `[]'
 
 2017-07-18  Eli Zaretskii  <address@hidden>
 
@@ -7898,7 +8426,7 @@
 
        Fix compilation of gnutls.c with older GnuTLS
 
-       * src/gnutrls.c (syms_of_gnutls): Condition some defsubr's
+       * src/gnutls.c (syms_of_gnutls): Condition some defsubr's
        on HAVE_GNUTLS3, to avoid compilation errors when GnuTLS
        v3.X is not available.  Reported by Colin Baxter <address@hidden>.
 
@@ -9125,7 +9653,7 @@
 
        * lisp/simple.el (line-number-at-pos): Add a second optional
          argument 'absolute'.
-       * test/list/simple-tests.el: Add tests for 'line-number-at-pos'.
+       * test/lisp/simple-tests.el: Add tests for 'line-number-at-pos'.
 
 2017-07-03  R. Bernstein  <address@hidden>
 
@@ -10591,7 +11119,7 @@
        Add current-line in simple.el
 
        * lisp/simple.el (current-line): New function.
-       * test/list/simple-tests.el: Add tests for current-line.
+       * test/lisp/simple-tests.el: Add tests for current-line.
 
 2017-06-19  Katsumi Yamaoka  <address@hidden>
 
@@ -10608,8 +11136,8 @@
 
 2017-06-18  Andreas Schwab  <address@hidden>
 
-       * url/url-util.el (url-get-url-at-point): Add missing group in
-       regex.
+       * lisp/url/url-util.el (url-get-url-at-point): Add missing group
+       in regex.
 
 2017-06-18  Paul Eggert  <address@hidden>
 
@@ -10720,8 +11248,8 @@
 
 2017-06-17  Andreas Schwab  <address@hidden>
 
-       * international/characters.el: Update list of zero and full width
-       characters according to Unicode 9.0.0.
+       * lisp/international/characters.el: Update list of zero and full
+       width characters according to Unicode 9.0.0.
 
 2017-06-17  Simen Heggestøyl  <address@hidden>
 
@@ -10820,7 +11348,7 @@
 
        Fix hang in CC Mode when ":" is typed after identifier at EOB.
 
-       * list/progmodes/cc-engine.el (c-forward-declarator): Fix coding error
+       * lisp/progmodes/cc-engine.el (c-forward-declarator): Fix coding error
        confusing ":" and EOB.
 
 2017-06-15  Alan Mackenzie  <address@hidden>
@@ -11394,7 +11922,7 @@
        Rather than checking for the main thread, check for the current
        thread.
 
-       * emacs-module.c (check_thread): New function.
+       * src/emacs-module.c (check_thread): New function.
        (MODULE_FUNCTION_BEGIN_NO_CATCH, module_get_environment)
        (module_non_local_exit_check, module_non_local_exit_clear)
        (module_non_local_exit_get, module_non_local_exit_signal)
@@ -11797,7 +12325,7 @@
 
        These can help module authors debug crashes.
 
-       * emacs-module.c (module_non_local_exit_check)
+       * src/emacs-module.c (module_non_local_exit_check)
        (module_non_local_exit_clear, module_non_local_exit_get)
        (module_non_local_exit_signal, module_non_local_exit_throw)
        (module_copy_string_contents, module_make_string)
@@ -12294,7 +12822,7 @@
 
        Mode line "%q" construct: Just use one number when both would be the 
same.
 
-       * src/xdisp (decode_mode_spec): recode the "%q" bit appropriately.
+       * src/xdisp.c (decode_mode_spec): recode the "%q" bit appropriately.
 
 2017-05-30  Alan Mackenzie  <address@hidden>
 
@@ -12528,7 +13056,7 @@
 
        Fix Tramp for Android 7
 
-       * tramp-adb.el (tramp-adb-ls-toolbox-regexp):
+       * lisp/net/tramp-adb.el (tramp-adb-ls-toolbox-regexp):
        Username part of prompt is empty on Android 7.
        (tramp-adb-ls-toolbox-regexp):
        Ignore addition links column on Android 7.
@@ -13208,8 +13736,8 @@
 
        Remove unused automatic variables
 
-       * nsterm.m (ns_read_socket):
-       * macfont.m (macfont_open): Remove unused automatic variables.
+       * src/nsterm.m (ns_read_socket):
+       * src/macfont.m (macfont_open): Remove unused automatic variables.
 
 2017-05-21  Philipp Stephani  <address@hidden>
 
@@ -13278,7 +13806,7 @@
 
        This removes compiler warnings on macOS and improves type safety.
 
-       * nsterm.m (initFrameFromEmacs:):
+       * src/nsterm.m (initFrameFromEmacs:):
        (menuDown:):
        (toolbarClicked:):
        (toggleToolbar:):
@@ -13286,12 +13814,12 @@
        (initFrame:window:):
        (condemn, reprieve, setPosition:portion:whole:):
        (repeatScroll:):
-       * nsmenu.m (initWithTitle:):
+       * src/nsmenu.m (initWithTitle:):
        (initWithTitle:frame:):
        (initForView:withIdentifier:):
        (init, initWithContentRect:styleMask:backing:defer:):
        (initFromContents:isQuestion:):
-       * nsimage.m (allocInitFromFile:):
+       * src/nsimage.m (allocInitFromFile:):
        (initFromXBM:width:height:fg:bg:):
        (setXBMColor:):
        (initForXPMWithDepth:width:height:): Use instancetype as return
@@ -14144,7 +14672,7 @@
        variable.
        * test/src/lread-tests.el (lread-tests--old-style-backquotes): Add
        unit test.
-       * emacs-lisp/bytecomp-tests.el
+       * test/lisp/emacs-lisp/bytecomp-tests.el
        (bytecomp-tests--old-style-backquotes): Add unit test.
 
 2017-05-13  Philipp Stephani  <address@hidden>
@@ -15569,13 +16097,13 @@
 
        Add support for IRCv3 message tags.
 
-       * erc-backend.el:
+       * lisp/erc/erc-backend.el:
          erc-response: Add `tags' element.
          Add (erc-parse-tags).
          (erc-parse-server-response): Use (erc-parse-tags) to parse message
          tags (if any), and store them in `erc-resopnse' struct.
 
-       * erc.el: (erc-display-message): Expose message tags with text
+       * lisp/erc/erc.el: (erc-display-message): Expose message tags with text
          properties of the corresponding message line.
 
 2017-04-24  Lars Ingebrigtsen  <address@hidden>
@@ -16094,7 +16622,7 @@
          (xml-maybe-do-ns): Properly handle default namespace by not
          interning new symbol when 'special' flag is set.
 
-       * tests/lisp/xml-tests.el (xml-parse-test--namespace-attribute-qnames)
+       * test/lisp/xml-tests.el (xml-parse-test--namespace-attribute-qnames)
          (xml-parse-namespace-attribute-qnames): Add test for Bug#26533.
 
 2017-04-17  Paul Eggert  <address@hidden>
@@ -16770,7 +17298,7 @@
        * src/fns.c (Flength, Fcopy_sequence):
        * src/font.h (FONT_SPEC_P, FONT_ENTITY_P, FONT_OBJECT_P):
        * src/lread.c (substitute_object_recurse):
-       * src/src/print.c (print_object):
+       * src/print.c (print_object):
          Use it.
 
 2017-04-10  Michael Albinus  <address@hidden>
@@ -16960,9 +17488,9 @@
 
        Fix circular read syntax for records.
 
-       * lread.c (substitute_object_recurse): Work with records.
+       * src/lread.c (substitute_object_recurse): Work with records.
 
-       * lread-tests.el (lread-record-1): New test.
+       * test/src/lread-tests.el (lread-record-1): New test.
 
 2017-04-08  Paul Eggert  <address@hidden>
 
@@ -17051,7 +17579,7 @@
 
 2017-04-07  Lars Brinkhoff  <address@hidden>
 
-       * records.texi (Record Functions): fix typo.
+       * doc/lispref/records.texi (Record Functions): fix typo.
 
 2017-04-07  Paul Eggert  <address@hidden>
 
@@ -17065,15 +17593,15 @@
 
        Output number of characters added to file (Bug#354)
 
-       * fileio.c (write_region):
-       * epa-file.el (epa-file-write-region):
-       * jka-compr.el (jka-compr-write-region):
-       * ange-ftp.el (ange-ftp-write-region):
-       * tramp-gvfs.el (tramp-gvfs-handle-write-region):
-       * tramp-sh.el (tramp-sh-handle-write-region):
-       * mm-util.el (mm-append-to-file): Functions now output
+       * src/fileio.c (write_region):
+       * lisp/epa-file.el (epa-file-write-region):
+       * lisp/jka-compr.el (jka-compr-write-region):
+       * lisp/net/ange-ftp.el (ange-ftp-write-region):
+       * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region):
+       * lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
+       * lisp/gnus/mm-util.el (mm-append-to-file): Functions now output
        characters written in addition to file name.
-       * files.texi: Added documentation to write-region and
+       * doc/lispref/files.texi: Added documentation to write-region and
        append-to-file describing their output.
 
 2017-04-07  Noam Postavsky  <address@hidden>
@@ -17197,7 +17725,8 @@
 
 2017-04-07  Hong Xu  <address@hidden>
 
-       * search.c (Fre_search_forward, Fre_search_backward): Improve doc 
(Bug#25193).
+       * src/search.c (Fre_search_forward, Fre_search_backward): Improve
+       doc (Bug#25193).
 
 2017-04-07  Noam Postavsky  <address@hidden>
 
@@ -17315,7 +17844,7 @@
        standard distribution.
        * admin/unidata/README: Mention SpecialCasing.txt.
 
-       * admin/unidata/unidata-get.el (unidata-gen-table-special-casing,
+       * admin/unidata/unidata-gen.el (unidata-gen-table-special-casing,
        unidata-gen-table-special-casing--do-load): New functions generating
        ‘special-uppercase’, ‘special-lowercase’ and ‘special-titlecase’
        character Unicode properties built from the SpecialCasing.txt Unicode
@@ -17422,14 +17951,14 @@
 
        Update documentation for type semantics of records.
 
-       * objects.texi (Record Type): improve description of what
+       * doc/lispref/objects.texi (Record Type): improve description of what
        `type-of' returns for records.
        (Type Descriptors): new section.
-       * elisp.texi: reference it.
-       * records.texi (Records): reference it.  Document behaviour when type
-       slot is a record.
+       * doc/lispref/elisp.texi: reference it.
+       * doc/lispref/records.texi (Records): reference it.  Document
+       behaviour when type slot is a record.
 
-       * alloc.c (Fmake_record, Frecord): mention type desciptors.
+       * admin/alloc-colors.c (Fmake_record, Frecord): mention type desciptors.
 
 2017-04-06  Stefan Monnier  <address@hidden>
 
@@ -18016,7 +18545,7 @@
 
        * lisp/gnus/gnus-start.el (gnus-display-time-event-handler): Use
        bound-and-true-p.
-       * lisp/gnus/gnus-util (gnus-boundp): Remove.
+       * lisp/gnus/gnus-util.el (gnus-boundp): Remove.
 
 2017-03-31  Niels Möller  <address@hidden>  (tiny change)
 
@@ -18240,8 +18769,9 @@
 
        Add check for expected backtrace in module calls.
 
-       * test.el (mod-test-non-local-exit-signal-test): Compare actual
-         backtrace to expected backtrace.
+       * test/manual/cedet/tests/test.el
+       (mod-test-non-local-exit-signal-test): Compare actual backtrace to
+       expected backtrace.
 
 2017-03-26  Eli Zaretskii  <address@hidden>
 
@@ -18397,7 +18927,7 @@
 
        Make it easier to abort a series of tests with C-g
 
-       * emacs-lisp/ert.el (ert-run-tests): Add "interactively" arg.  If
+       * lisp/emacs-lisp/ert.el (ert-run-tests): Add "interactively" arg.  If
        interactively is true and a test was aborted then ask if the remaining
        tests should be aborted too.
        (ert-run-tests-batch, ert-run-tests-interactively): Pass in
@@ -18435,8 +18965,9 @@
        `python-nav-end-of-statement'.  Protect against this by checking
        whether the search for the end of the current string makes progress.
 
-       * python.el (python-nav-end-of-statement): Protect against infloop.
-       * progmodes/python-tests.el
+       * lisp/progmodes/python.el (python-nav-end-of-statement): Protect
+       against infloop.
+       * test/lisp/progmodes/python-tests.el
        (python-tests--python-nav-end-of-statement--infloop): Add unit test.
 
 2017-03-23  Michael Albinus  <address@hidden>
@@ -19668,10 +20199,10 @@
 
 2017-03-08  Andreas Schwab  <address@hidden>
 
-       * data.c (minmax_driver): Use CHECK_NUMBER_OR_FLOAT_COERCE_MARKER.
+       * src/data.c (minmax_driver): Use CHECK_NUMBER_OR_FLOAT_COERCE_MARKER.
        (Fmax, Fmin): Restore documentation.
 
-       * data.c (cons_to_unsigned, cons_to_signed, Fstring_to_number): Reorder
+       * src/data.c (cons_to_unsigned, cons_to_signed, Fstring_to_number): 
Reorder
        comparisons that are written backward.
 
 2017-03-08  Thien-Thi Nguyen  <address@hidden>
@@ -20080,7 +20611,7 @@
 
        Enable the usage of an in-memory database. Prior to this, sql-mode w/
        sqlite could only be used with file databases.
-       * list/progmodes/sql.el (sql-get-login-ext): Don't expand an empty
+       * lisp/progmodes/sql.el (sql-get-login-ext): Don't expand an empty
        file name provided by the user, but call sub-process sqlite with that,
        in which case it uses an in-memory database.
 
@@ -20223,7 +20754,7 @@
 
 2017-03-02  Glenn Morris  <address@hidden>
 
-       * test/lisp/net/puny.el: New file.
+       * test/lisp/net/puny-tests.el: New file.
 
 2017-03-02  Glenn Morris  <address@hidden>
 
@@ -20349,7 +20880,7 @@
 
        Do not use find-file non-interactively
 
-        * lisp/international/titdic-cnv (miscdic-convert): Use
+        * lisp/international/titdic-cnv.el (miscdic-convert): Use
           insert-file-contents in place of find-file.
 
 2017-02-28  Stefan Monnier  <address@hidden>
@@ -21412,7 +21943,7 @@
 
        Avoid errors when flyspell-generic-check-word-predicate is a lambda.
 
-       * flyspell.el (flyspell-auto-correct-word, flyspell-word): Apply
+       * lisp/textmodes/flyspell.el (flyspell-auto-correct-word, 
flyspell-word): Apply
        functionp instead of fboundp on
        flyspell-generic-check-word-predicate (Bug#25765).
 
@@ -22379,7 +22910,7 @@
 
 2017-02-05  Vibhav Pant  <address@hidden>
 
-       * byte-opt.el (byte-decompile-bytecode-1): Use eq instead of =.
+       * lisp/emacs-lisp/byte-opt.el (byte-decompile-bytecode-1): Use eq 
instead of =.
 
 2017-02-05  Vibhav Pant  <address@hidden>
 
@@ -22865,9 +23396,9 @@
        nested brace lists when the opening element stands on the same line as 
both
        its introductory brace and an enclosing parameter list parenthesis.
 
-       * list/progmodes/cc-align.el (c-lineup-under-anchor): New line-up 
function.
+       * lisp/progmodes/cc-align.el (c-lineup-under-anchor): New line-up 
function.
 
-       * list/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): 
Accept the
+       * lisp/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): 
Accept the
        presence of exactly an identifier between an open parenthesis and an 
open
        brace as evidence of the brace starting a brace list.
        (c-looking-at-statement-block): New function, extracted from
@@ -23123,7 +23654,7 @@
        `:purecopy t`, use purecopy_hash_table otherwise.
        (marked_pinned_objects) New function, marks all objects in 
pinned_objects.
        (garbage_collect_1) Use it. Mark all pinned objects before sweeping.
-       * src/lisp.h Add new field `pure' to struct `Lisp_Hash_Table'.
+       * src/lisp.h: Add new field `pure' to struct `Lisp_Hash_Table'.
        * src/fns.c: Add `purecopy' parameter to hash tables.
        (Fmake_hash_table): Check for a `:purecopy PURECOPY' argument, pass it
        to make_hash_table.
@@ -23348,7 +23879,7 @@
 
        Support Bash Ctrl-Z indication of directory name in term.el
 
-       * term.el (term-emulate-terminal): Do not display ?\032 escape
+       * lisp/term/xterm.el (term-emulate-terminal): Do not display ?\032 
escape
        codes even when 'handled-ansi-message' is non-nil.  (Bug#11919)
 
 2017-01-27  Eli Zaretskii  <address@hidden>
@@ -23373,12 +23904,13 @@
 
        python-mode: Fix detection for opening blocks.
 
-               * python.el (python-info-dedenter-opening-block-positions): 
There
-               can't be any back-indented lines between an opening block and 
the
-               current line.
+       * lisp/progmodes/python.el
+       (python-info-dedenter-opening-block-positions): There can't be any
+       back-indented lines between an opening block and the current line.
 
-               * python-tests.el (python-indent-electric-colon-4): Add an 
indent
-               test case where there is one-more indented previous opening 
block.
+       * test/lisp/progmodes/python-tests.el
+       (python-indent-electric-colon-4): Add an indent test case where
+       there is one-more indented previous opening block.
 
 2017-01-27  Lars Ingebrigtsen  <address@hidden>
 
@@ -24314,7 +24846,7 @@
 
        * lisp/emacs-lisp/byte-opt.el: Optimize how tags are checked for use.
 
-       * byte-opt.el: (byte-optimize-lapcode): Return nil instantly on
+       * lisp/emacs-lisp/byte-opt.el: (byte-optimize-lapcode): Return nil 
instantly on
          finding the tag in a jump table.
 
 2017-01-15  Vibhav Pant  <address@hidden>
@@ -24368,7 +24900,7 @@
 
        Correct c-parse-state-get-strategy for moving HERE backward into a 
macro.
 
-       * list/progmodes/c-engine.el (c-parse-state-get-strategy): When HERE is 
below
+       * lisp/progmodes/cc-engine.el (c-parse-state-get-strategy): When HERE 
is below
        its previous value, we chose strategy 'forward, and the new HERE is in a
        (different) macro, ensure the returned START-POINT is not above the 
start of
        the macro.
@@ -24761,12 +25293,13 @@
 
        * lisp/textmodes/rst.el: Fix rst-forward-indented-block.
 
-               * rst.el (rst-cvs-header, rst-svn-rev, rst-svn-timestamp)
-               (rst-official-version, rst-official-cvs-rev)
-               (rst-package-emacs-version-alist): Maintain version numbers.
-               (rst-forward-indented-block): Fix. Start searching at next
-               line again. Fixes fontification of comments continuing on the
-               same line they started.
+       * lisp/textmodes/rst.el (rst-cvs-header, rst-svn-rev)
+       (rst-svn-timestamp)
+       (rst-official-version, rst-official-cvs-rev)
+       (rst-package-emacs-version-alist): Maintain version numbers.
+       (rst-forward-indented-block): Fix. Start searching at next
+       line again. Fixes fontification of comments continuing on the
+       same line they started.
 
 2017-01-08  Paul Eggert  <address@hidden>
 
@@ -25555,7 +26088,7 @@
 
 2016-12-29  Mike Kupfer  <address@hidden>
 
-       * mh-e.el (mh-fetch-x-image-url): Fix a docstring typo.
+       * lisp/mh-e/mh-e.el (mh-fetch-x-image-url): Fix a docstring typo.
 
 2016-12-29  Alan Mackenzie  <address@hidden>
 
@@ -25846,13 +26379,13 @@
 
        Fix timezone detection of parse-iso8601-time-string
 
-       * parse-time.el (parse-iso8601-time-string): Fix timezone
+       * lisp/calendar/parse-time.el (parse-iso8601-time-string): Fix timezone
        parsing.  Add a doc string.  (Bug#25086)
-       * editfns.c (Fdecode-time): Doc fix.
-       * emacs-mime.texi (time-date): Add an example for
-       parse-iso8601-time-string.
-       * parse-time-tests.el (parse-time-tests): Add tests for
+       * src/editfns.c (Fdecode-time): Doc fix.
+       * doc/misc/emacs-mime.texi (time-date): Add an example for
        parse-iso8601-time-string.
+       * test/lisp/calendar/parse-time-tests.el (parse-time-tests): Add
+       tests for parse-iso8601-time-string.
 
 2016-12-24  Paul Eggert  <address@hidden>
 
@@ -25932,7 +26465,7 @@
        Document that variable binding order is unspecified
 
        * doc/lispref/variables.texi (Local Variables):
-       * cl.texi (Modify Macros): Document that binding order in 'let' and
+       * doc/misc/cl.texi (Modify Macros): Document that binding order in 
'let' and
        'cl-letf' is unspecified.
 
 2016-12-23  Eli Zaretskii  <address@hidden>
@@ -26040,7 +26573,8 @@
 
 2016-12-21  Stefan Monnier  <address@hidden>
 
-       * tex-mode.el (tex-compile-commands): Add luatex and xetex commands
+       * lisp/textmodes/tex-mode.el (tex-compile-commands): Add luatex
+       and xetex commands.
 
 2016-12-21  Eli Zaretskii  <address@hidden>
 
@@ -26244,7 +26778,7 @@
 
        Protect change of window's buffer in vertical-motion against unwinds 
(bug#25209)
 
-       * indent.c (restore_window_buffer): New function.
+       * src/indent.c (restore_window_buffer): New function.
        (Fvertical_motion): Use it to restore window's buffer.
 
 2016-12-19  Glenn Morris  <address@hidden>
@@ -26305,7 +26839,7 @@
 
        avoid Eager macro-expansion failure: (void-function string-to-list)
 
-       * loadup.el [ns]: "ucs-normalize" uses `string-to-list' which is defined
+       * lisp/loadup.el [ns]: "ucs-normalize" uses `string-to-list' which is 
defined
          in "mule-util", so we have to load "mule-util" before "ucs-normalize",
          otherwise I get "Eager macro-expansion failure" on "make bootstrap"
 
@@ -26531,7 +27065,8 @@
 
 2016-12-15  Paul Eggert  <address@hidden>
 
-       * emacs-document.svg: Append newline.
+       * etc/images/icons/hicolor/scalable/mimetypes/emacs-document.svg:
+       Append newline.
 
 2016-12-15  Mark Oteiza  <address@hidden>
 
@@ -28033,8 +28568,8 @@
 
        fix a latent bug in process.c
 
-               * process.c (wait_reading_process_output): Check Writeok bits,
-               not write_mask.
+       * src/process.c (wait_reading_process_output): Check Writeok bits,
+       not write_mask.
 
 2012-08-15  Tom Tromey  <address@hidden>
 
@@ -50754,7 +51289,7 @@
 
 This file records repository revisions from
 commit 9d56a21e6a696ad19ac65c4b405aeca44785884a (exclusive) to
-commit 82d2a05a74c120480dc1b68243430c9417bfc523 (inclusive).
+commit e8a7c41b4e2dc9df18038d2931ed883946a2bb50 (inclusive).
 See ChangeLog.1 for earlier changes.
 
 ;; Local Variables:
diff --git a/INSTALL.REPO b/INSTALL.REPO
index ac991f7..a5b60cf 100644
--- a/INSTALL.REPO
+++ b/INSTALL.REPO
@@ -54,7 +54,7 @@ If CPU time is not an issue, 'make bootstrap' is a more 
thorough way
 to rebuild, avoiding spurious problems.
 
 Occasionally, there are changes that 'make bootstrap' won't be able to
-handle.  The most thorough cleaning can be achieved by 'git clean -fx'
+handle.  The most thorough cleaning can be achieved by 'git clean -fdx'
 which will leave you with only files from the git repository.  Here
 are some faster methods for a couple of particular error cases:
 
diff --git a/admin/authors.el b/admin/authors.el
index 5638efb..71995d5 100644
--- a/admin/authors.el
+++ b/admin/authors.el
@@ -916,6 +916,7 @@ in the repository.")
     ("vc/vc-arch.el" . "vc-arch.el")
     ("lisp/gnus/messcompat.el" . "messcompat.el")
     ("html2text.el" . "html2text.el")
+    ("lisp/net/html2text.el" . "html2text.el")
     ;; From lisp to etc/forms.
     ("forms-d2.el" . "forms-d2.el")
     ("forms-pass.el" . "forms-pass.el")
diff --git a/doc/emacs/anti.texi b/doc/emacs/anti.texi
index 547dbd1..426c18b 100644
--- a/doc/emacs/anti.texi
+++ b/doc/emacs/anti.texi
@@ -25,7 +25,7 @@ less and less available/popular as you move farther back in 
time.
 
 @item
 For similar reasons, we've reverted back to building our own version
-of of @command{movemail} that retrieves POP3 mail as clear text via
+of @command{movemail} that retrieves POP3 mail as clear text via
 insecure channels.  As you move back in time, the availability of
 secure alternatives to POP3 will diminish, and we are only keen to
 support that.  We've also removed the @option{--with-mailutils}
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index b168eff..8c08f51 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -1002,6 +1002,20 @@ when the entire buffer is visible.
   The visual appearance of the scroll bars is controlled by the
 @code{scroll-bar} face.
 
address@hidden vertical border
+  On graphical frames, vertical scroll bars implicitly serve to separate
+side-by-side windows visually.  When vertical scroll bars are disabled,
+Emacs by default separates such windows with the help of a one-pixel
+wide @dfn{vertical border}.  That border occupies the first pixel column
+of the window on the right and may thus overdraw the leftmost pixels of
+any glyph displayed there.  If these pixels convey important
+information, you can make them visible by enabling window dividers, see
address@hidden Dividers}.  To replicate the look of vertical borders, set
+the @code{right-divider-width} parameter of frames to one and have the
address@hidden face inherit from that of @code{vertical-border},
address@hidden Dividers,, Window Dividers, elisp, The Emacs Lisp Reference
+Manual}.
+
 @cindex Horizontal Scroll Bar
 @cindex Horizontal Scroll Bar mode
   On graphical displays with toolkit support, Emacs may also supply a
@@ -1060,7 +1074,12 @@ window-divider-mode}.
 customize the options @code{window-divider-default-bottom-width} and
 @code{window-divider-default-right-width}.
 
-   For more details about window dividers see @ref{Window Dividers,,
+  When vertical scroll bars are disabled, dividers can be also useful to
+make the first pixel column of a window visible which would be otherwise
+covered by the vertical border used to separate side-by-side windows
+(@pxref{Scroll Bars}).
+
+For more details about window dividers see @ref{Window Dividers,,
 Window Dividers, elisp, The Emacs Lisp Reference Manual}.
 
 @node Drag and Drop
diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi
index f2416a0..b073687 100644
--- a/doc/emacs/rmail.texi
+++ b/doc/emacs/rmail.texi
@@ -1363,7 +1363,7 @@ message itself is flagged as deleted.
   Mailing list messages that might offend or annoy some readers are sometimes
 encoded in a simple code called @dfn{rot13}---so named because it
 rotates the alphabet by 13 letters.  This code is not for secrecy, as it
-provides none; rather, it enables those who wish to to avoid
+provides none; rather, it enables those who wish to avoid
 seeing the real text of the message.  For example, a review of a film
 might use rot13 to hide important plot points.
 
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index 5aa0c77..c5967f8 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -1732,7 +1732,7 @@ C-p} (@code{tex-print}) to print a hardcopy of the output 
file.
 @vindex tex-directory
   By default, @kbd{C-c C-b} runs @TeX{} in the current directory.  The
 output of @TeX{} also goes in this directory.  To run @TeX{} in a
-different directory, change the variable @code{tex-directory} to the
+different directory, change the variable @code{tex-directory} to
 the desired directory.  If your environment variable @env{TEXINPUTS}
 contains relative names, or if your files contains
 @samp{\input} commands with relative file names, then
diff --git a/doc/lispintro/emacs-lisp-intro.texi 
b/doc/lispintro/emacs-lisp-intro.texi
index d949387..65ded50 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -831,7 +831,7 @@ An expert programmer who reviewed this text said to me:
 @i{I prefer to learn from reference manuals.  I ``dive into'' each
 paragraph, and ``come up for air'' between paragraphs.}
 
address@hidden I get to the end of a paragraph, I assume that that subject is
address@hidden I get to the end of a paragraph, I assume that subject is
 done, finished, that I know everything I need (with the
 possible exception of the case when the next paragraph starts talking
 about it in more detail).  I expect that a well written reference manual
diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi
index 2ca4a0a..fe3446a 100644
--- a/doc/lispref/debugging.texi
+++ b/doc/lispref/debugging.texi
@@ -135,7 +135,7 @@ set @code{debug-ignored-errors} to @code{nil}.
 @defopt eval-expression-debug-on-error
 If this variable has a address@hidden value (the default), running the
 command @code{eval-expression} causes @code{debug-on-error} to be
-temporarily bound to to @code{t}.  @xref{Lisp Eval,, Evaluating
+temporarily bound to @code{t}.  @xref{Lisp Eval,, Evaluating
 Emacs-Lisp Expressions, emacs, The GNU Emacs Manual}.
 
 If @code{eval-expression-debug-on-error} is @code{nil}, then the value
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index af646ce..59c269a 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -222,7 +222,7 @@ If it is @code{t}, it selects the @file{*scratch*} buffer.
 @c called from two places.  If displaying a startup screen, they are
 @c called in command-line-1 before the startup screen is shown.
 @c inhibit-startup-hooks is then set and window-setup-hook set to nil.
address@hidden If not displaying a startup screen, they are are called in
address@hidden If not displaying a startup screen, they are called in
 @c normal-top-level.
 @c FIXME?  So it seems they can be called before or after the
 @c daemon/session restore step?
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 23879aa..755fa55 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -327,7 +327,7 @@ expression.  Thus, @samp{fo*} has a repeating @samp{o}, not 
a repeating
 The matcher processes a @samp{*} construct by matching, immediately, as
 many repetitions as can be found.  Then it continues with the rest of
 the pattern.  If that fails, backtracking occurs, discarding some of the
-matches of the @samp{*}-modified construct in the hope that that will
+matches of the @samp{*}-modified construct in the hope that this will
 make it possible to match the rest of the pattern.  For example, in
 matching @samp{ca*ar} against the string @samp{caaar}, the @samp{a*}
 first tries to match all three @samp{a}s; but the rest of the pattern is
diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
index a85fe4a..d89a555 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -1,4 +1,4 @@
-\input texinfo   @c -*-texinfo-*-
+\input texinfo   @c -*-texinfo; coding: utf-8 -*-
 @comment %**start of header
 @setfilename ../../info/flymake.info
 @set VERSION 0.3
@@ -6,6 +6,8 @@
 @settitle GNU Flymake @value{VERSION}
 @include docstyle.texi
 @syncodeindex pg cp
address@hidden vr cp
address@hidden fn cp
 @comment %**end of header
 
 @copying
@@ -61,32 +63,20 @@ modify this GNU manual.''
 
 @node Overview of Flymake
 @chapter Overview
address@hidden Overview of Flymake
address@hidden overview of flymake
 
 Flymake is a universal on-the-fly buffer checker implemented as an
-Emacs minor mode. When enabled, Flymake visually annotates the buffer
+Emacs minor mode.  When enabled, Flymake visually annotates the buffer
 with diagnostic information coming from one or more different sources,
-or @emph{backends}.
-
-Historically, Flymake used to accept diagnostics from a single, albeit
-reasonably flexible, backend.
-
-This backend isn't (yet) obsolete and so is still available as a
-fallback and active by default(@pxref{The legacy Proc backend}). It works by
-selecting a syntax check tool from a preconfigured list (compiler for
-C++ files, @code{perl} for perl files, etc.), and executing it in the
-background, passing it a temporary file which is a copy of the current
-buffer, and parsing the output for known error/warning message
-patterns.
+or @dfn{backends}.
 
 Flymake annotates the buffer by highlighting problematic buffer
-regions with a special space. It also displays an overall buffer
-status in the mode line.  Status information displayed by Flymake
-contains totals for different types of diagnostics.
+regions with a special space.  It displays an overall buffer status in
+the mode line containing totals for different types of diagnostics.
 
 @code{flymake-goto-next-error} and @code{flymake-goto-prev-error} are
 commands that allow easy navigation to the next/previous erroneous
-line, respectively. If might be a good idea to map them to @kbd{M-n}
+line, respectively.  If might be a good idea to map them to @kbd{M-n}
 and @kbd{M-p} in @code{flymake-mode}, by adding to your init file:
 
 @lisp
@@ -97,48 +87,67 @@ and @kbd{M-p} in @code{flymake-mode}, by adding to your 
init file:
 Syntax check is done ``on-the-fly''.  It is started whenever
 
 @itemize @bullet
address@hidden @code{flymake-mode} is started;
address@hidden a newline character is added to the buffer;
address@hidden some changes were made to the buffer more than @code{0.5} 
seconds ago (the
-delay is configurable).
address@hidden
address@hidden is started, unless
address@hidden is nil.
+
address@hidden
+a newline character is added to the buffer, unless
address@hidden is nil.
+
address@hidden
+some changes were made to the buffer more than @code{0.5} seconds ago
+(the delay is configurable in @code{flymake-no-changes-timeout}).
 @end itemize
 
 Flymake is a universal syntax checker in the sense that it's easily
-extended to support new backends.  @xref{Customizable variables}.
+extended to support new backends (@pxref{Extending Flymake}).
+
+Historically, Flymake used to accept diagnostics from a single, albeit
+reasonably flexible, backend.
+
+This backend isn't (yet) obsolete, and so is still available as a
+fallback and active by default (@pxref{The legacy Proc backend}).  It works by
+selecting a syntax check tool from a preconfigured list (compiler for
address@hidden files, @command{perl} for Perl files, etc.), and executing it in 
the
+background, passing it a temporary file which is a copy of the current
+buffer, and parsing the output for known error/warning message
+patterns.
 
 @node Installing Flymake
 @chapter Installing
address@hidden Installing Flymake
address@hidden installing flymake
 
 Flymake is included with Emacs and its main commands, like
address@hidden, are autoloaded. This means there is usually
address@hidden, are autoloaded.  This means there is usually
 nothing to do by way of installation.
 
 @node Using Flymake
 @chapter Using Flymake
address@hidden Using Flymake
address@hidden using flymake
 
 @menu
 * Flymake mode::
 * Running the syntax check::
 * Navigating to error lines::   @c * Viewing error messages::
 * Syntax check statuses::
-* Troubleshooting::
+* Backend exceptions::
 * Customizable variables::
 @end menu
 
 @node Flymake mode
 @section Flymake mode
 @cindex flymake-mode
address@hidden activating flymake-mode
 
 Flymake is an Emacs minor mode.  To use Flymake, you
-must first activate @code{flymake-mode} by using the
address@hidden function.
+must first activate @code{flymake-mode} by using the command
address@hidden
 
 Instead of manually activating @code{flymake-mode}, you can configure
-Flymake to automatically enable @code{flymake-mode} upon opening any
+Emacs to automatically enable @code{flymake-mode} upon opening any
 file for which syntax check is possible.  To do so, place the following
-line in @code{.emacs}:
+line in your @file{~/.emacs}:
 
 @lisp
 (add-hook 'find-file-hook 'flymake-find-file-hook)
@@ -146,31 +155,33 @@ line in @code{.emacs}:
 
 @node Running the syntax check
 @section Running the syntax check
address@hidden Manually starting the syntax check
address@hidden manually starting syntax check
address@hidden syntax check, start manually
 
address@hidden flymake-start
 When @code{flymake-mode} is active, syntax check is started
-automatically on any of the three conditions mentioned above.  Syntax
-check can also be started manually by using the @code{flymake-start}
-function.
+automatically on any of the three conditions mentioned in
address@hidden of Flymake}.  Syntax check can also be started manually
+by typing the @kbd{M-x flymake-start @key{RET}} command.
 
 @node Navigating to error lines
 @section Navigating to error lines
address@hidden Navigating to error lines
address@hidden navigating to error lines
 
 After syntax check is completed, lines for which at least one error or
-warning has been reported are highlighted, and total number of errors
+warning has been reported are highlighted, and the total number of errors
 and warning is shown in the mode line.  Use the following functions to
-navigate the highlighted lines.
-
address@hidden @columnfractions 0.25 0.75
+navigate the highlighted lines:
 
address@hidden @code{flymake-goto-next-error}
address@hidden Moves point to the next erroneous line, if any.
-
address@hidden @code{flymake-goto-prev-error}
address@hidden Moves point to the previous erroneous line.
address@hidden @code
address@hidden flymake-goto-next-error
address@hidden flymake-goto-next-error
+Moves point to the next erroneous line, if any.
 
address@hidden multitable
address@hidden flymake-goto-prev-error
address@hidden flymake-goto-prev-error
+Moves point to the previous erroneous line.
address@hidden table
 
 If the user option @code{flymake-wrap-around} is active
 (@pxref{Customizable variables}), these functions treat diagnostics
@@ -181,7 +192,7 @@ to the first diagnostic when invoked in the end of the 
buffer.
 @section Syntax check statuses
 @cindex Syntax check statuses
 
-After syntax check is finished, its status is displayed in the mode line.
+While enabled, Flymake displays its status in the mode line.
 The following statuses are defined:
 
 @multitable @columnfractions 0.25 0.75
@@ -191,8 +202,9 @@ where questioned.
 
 @item @code{!}
 @tab All the configured Flymake backends have disabled themselves.
-Left-clicking the ``Flymake'' mode line indicator beings the user
address@hidden log*} buffer where these situations may be investigated
+Left-clicking Flymake's mode line indicator pops up a menu listing the
+option to visit Flymake's log buffer.  In this buffer these situations
+can be investigated.
 
 @item @code{?}
 @tab There are no configured Flymake backends in
@@ -203,34 +215,62 @@ Left-clicking the ``Flymake'' mode line indicator beings 
the user
 check process.
 @end multitable
 
address@hidden Troubleshooting
address@hidden Troubleshooting
address@hidden Logging
address@hidden Troubleshooting
-
-Flymake uses a simple logging facility for indicating important points
address@hidden Backend exceptions
address@hidden Backend exceptions
address@hidden backend exceptions
+
address@hidden disabled backends
address@hidden backends, disabled
+Some backends may take longer than others to respond or complete, and
+some may decide to @emph{disable} themselves if they are not suitable
+for the current buffer.  A disabled backend is not tried again for
+future checks of the current buffer.
+
address@hidden flymake-reporting-backends
address@hidden flymake-running-backends
address@hidden flymake-disabled-backends
+The commands @code{flymake-reporting-backends},
address@hidden and @code{flymake-disabled-backends}
+show the backends currently used and those which are disabled.
+
address@hidden reset disabled backends
+Toggling @code{flymake-mode} off and on again, or invoking
address@hidden with a prefix argument is one way to reset the
+disabled backend list, so that they will be tried again in the next check.
+
address@hidden logging
address@hidden flymake logging
+Flymake also uses a simple logging facility for indicating important points
 in the control flow.  The logging facility sends logging messages to
 the @file{*Flymake log*} buffer.  The information logged can be used for
 resolving various problems related to Flymake.
 
address@hidden warning-minimum-log-level
address@hidden warning-minimum-level
 Logging output is controlled by the Emacs @code{warning-minimum-log-level}
 and @code{warning-minimum-level} variables.
 
 @node Customizable variables
 @section Customizable variables
address@hidden Customizable variables
address@hidden customizable variables
address@hidden variables for customizing flymake
 
-This section summarizes variables used for the configuration of the
-Flymake user interface.
+This section summarizes customization variables used for the
+configuration of the Flymake user interface.
 
address@hidden @code
address@hidden @code
 @item flymake-no-changes-timeout
 If any changes are made to the buffer, syntax check is automatically
-started after @code{flymake-no-changes-timeout} seconds.
+started after this many seconds, unless the user makes another change,
+which resets the timer.
 
 @item flymake-start-syntax-check-on-newline
-A boolean flag indicating whether to start syntax check after a
-newline character is added to the buffer.
+A boolean flag indicating whether to start syntax check immediately
+after a newline character is inserted into the buffer.
+
address@hidden flymake-start-on-flymake-mode
+A boolean flag indicating whether to start syntax check immediately
+after enabling @code{flymake-mode}.
 
 @item flymake-error
 A custom face for highlighting regions for which an error has been
@@ -258,16 +298,406 @@ Which fringe (if any) should show the warning/error 
bitmaps.
 @item flymake-wrap-around
 If non-nil, moving to errors with @code{flymake-goto-next-error} and
 @code{flymake-goto-prev-error} wraps around buffer boundaries.
-
address@hidden table
address@hidden vtable
 
 @node Extending Flymake
 @chapter Extending Flymake
address@hidden Extending Flymake
address@hidden extending flymake
+
+Flymake can primarily be extended in one of two ways:
+
address@hidden
address@hidden
+By changing the look and feel of the annotations produced by the
+different backends.
+
address@hidden
+By adding a new buffer-checking backend.
address@hidden enumerate
+
+The following sections discuss each approach in detail.
+
address@hidden
+* Flymake error types::
+* Backend functions::
address@hidden menu
+
address@hidden Flymake error types
address@hidden Customizing Flymake error types
address@hidden customizing error types
address@hidden error types, customization
+
address@hidden flymake-diagnostic-types-alist
+The variable @code{flymake-diagnostic-types-alist} is looked up by
+Flymake every time an annotation for a diagnostic is created in the
+buffer.  Specifically, this variable holds a table of correspondence
+between symbols designating diagnostic types and an additional
+sub-table of properties pertaining to each diagnostic type.
+
+Both tables are laid out in association list (@pxref{Association
+Lists,,, elisp, The Emacs Lisp Reference Manual}) format, and thus can
+be conveniently accessed with the functions of the @code{assoc}
+family.
+
+You can use any symbol-value association in the properties sub-table,
+but some symbols have special meaning as to where and how Flymake
+presents the diagnostic:
+
address@hidden
+
address@hidden
address@hidden bitmap of diagnostic
address@hidden, an image displayed in the fringe according to
address@hidden  The value actually follows
+the syntax of @code{flymake-error-bitmap} (@pxref{Customizable
+variables}).  It is overridden by any @code{before-string} overlay
+property.
+
address@hidden
address@hidden severity of diagnostic
address@hidden is a non-negative integer specifying the diagnostic's
+severity.  The higher the value, the more serious is the error.  If
+the overlay property @code{priority} is not specified, @code{severity}
+is used to set it and help sort overlapping overlays.
+
address@hidden
+Every property pertaining to overlays (@pxref{Overlay Properties,,,
+elisp, The Emacs Lisp Reference Manual}), except @code{category} and
address@hidden  These properties are used to affect the appearance
+of Flymake annotations.
+
+As an example, here's how to make errors (diagnostics of the type
address@hidden:error}) stand out even more prominently in the buffer, by
+raising the characters using a @code{display} overlay property.
+
address@hidden
+(push '(display . (raise 1.2))
+      (cdr (assoc :error flymake-diagnostic-types-alist)))
address@hidden example
+
address@hidden
address@hidden flymake-category
address@hidden is a symbol whose property list is considered
+the default for missing values of any other properties.
address@hidden itemize
+
address@hidden predefined diagnostic types
address@hidden flymake-error
address@hidden flymake-warning
address@hidden flymake-note
+Three default diagnostic types, @code{:error}, @code{:warning} and
address@hidden:note} are predefined in
address@hidden  By default each lists a single
address@hidden property whose value is, respectively, the
+symbols @code{flymake-error}, @code{flymake-warning} and
address@hidden
+
+These category symbols' plists is where the values of customizable
+variables and faces such as @code{flymake-error-bitmap} are found.
+Thus, if you change their plists, Flymake may stop honoring these
+user customizations.
+
+The @code{flymake-category} special property is also especially useful
+for backends which create diagnostics objects with non-default
+types that differ from an existing type by only a few properties
+(@pxref{Flymake utility functions}).
+
+As an example, consider configuring a new diagnostic type
address@hidden:low-priority-note} that behaves much like the @code{:note}
+priority but without an overlay face.
+
address@hidden
+(add-to-list
+ 'flymake-diagnostic-types-alist
+ `(:low-priority-note . ((face . nil)
+                         (flymake-category . flymake-note))))
address@hidden example
+
address@hidden flymake-text
+As you might have guessed, Flymake's annotations are implemented as
+overlays (@pxref{Overlays,,, elisp, The Emacs Lisp Reference Manual}).
+Along with the properties that you specify for the specific type of
+diagnostic, Flymake adds the property @code{flymake-text} to these
+overlays, and sets it to the message string that the backend used to
+describe the diagnostic.
+
+Since overlays also support arbitrary keymaps, you can use this
+property @code{flymake-text} to create interactive annotations, such
+as in the following example of binding a @kbd{mouse-3} event (middle
+mouse button click) to an Internet search for the text of a
address@hidden:warning} or @code{:error}.
+
address@hidden
+(defun my-search-for-message (event)
+  (interactive "e")
+  (let ((ovs (overlays-at (posn-point (event-start event))))
+        ov)
+    ;; loop until flymake overlay we clicked on is recovered
+    (while (not (overlay-get (setq ov (pop ovs)) 'flymake-text)))
+    (when ov
+      (eww-browse-url
+       (concat "https://duckduckgo.com/?q=";
+               (replace-regexp-in-string " "
+                                         "+"
+                                         (overlay-get ov 'flymake-text)))
+       t))))
+
+(dolist (type '(:warning :error))
+  (let ((a (assoc type flymake-diagnostic-types-alist)))
+    (setf (cdr a)
+          (append `((mouse-face . highlight)
+                    (keymap . ,(let ((map (make-sparse-keymap)))
+                                 (define-key map [mouse-2]
+                                   'my-search-for-message)
+                                 map)))
+                  (cdr a)))))
address@hidden example
+
address@hidden Backend functions
address@hidden Backend functions
address@hidden backend functions
+
address@hidden flymake-diagnostic-functions
+Flymake backends are Lisp functions placed in the special hook
address@hidden
+
+A backend's responsibility is to diagnose the contents of a buffer for
+problems, registering the problem's positions, type, and summary
+description.  This information is collected in the form of diagnostic
+objects created by the function @code{flymake-make-diagnostic}
+(@pxref{Flymake utility functions}), and
+then handed over to Flymake, which proceeds to annotate the
+buffer.
+
+A request for a buffer check, and the subsequent delivery of
+diagnostics, are two key events of the interaction between Flymake
+and backend.  Each such event corresponds to a well-defined function
+calling convention: one for calls made by Flymake into the backend via
+the backend function, the other in the reverse direction via a
+callback.  To be usable, backends must adhere to both.
+
+Backend functions must accept an arbitrary number of arguments:
+
address@hidden
address@hidden
+the first argument is always @var{report-fn}, a callback function
+detailed below;
+
address@hidden
+the remaining arguments are keyword-value pairs of the
+form @address@hidden(@var{:key} @var{value} @var{:key2} @var{value2}...)}}.  
Currently,
+Flymake provides no such arguments, but backend functions must be
+prepared to accept (and possibly ignore) any number of them.
address@hidden itemize
+
+Whenever Flymake or the user decide to re-check the buffer, backend
+functions are called as detailed above, and are expected to initiate
+this check, but aren't in any way required to complete it before
+exiting: if the computation involved is expensive, as
+is often the case with large buffers, that slower task should be
+scheduled for the future using asynchronous sub-processes
+(@pxref{Asynchronous Processes,,, elisp, The Emacs Lisp reference
+manual}) or other asynchronous mechanisms.
+
+In any case, backend functions are expected to return quickly or
+signal an error, in which case the backend is disabled
+(@pxref{Backend exceptions}).
+
+If the function returns, Flymake considers the backend to be
address@hidden  If it has not done so already, the backend is expected
+to call the function @var{report-fn} passed to it, at which point
+Flymake considers the backend to be @dfn{reporting}.  Backends call
address@hidden by passing it a single argument @var{report-action}
+followed by an optional list of keyword-value pairs of the form
address@hidden@code{(@var{:report-key} @var{value} @var{:report-key2} 
@var{value2}...)}}.
+
+Currently accepted values for @var{report-action} are:
+
address@hidden
address@hidden
+A (possibly empty) list of diagnostic objects created by
address@hidden, causing Flymake to annotate the
+buffer with this information.
+
+A backend may call @var{report-fn} repeatedly in this manner, but only
+until Flymake considers that the most recently requested buffer check
+is now obsolete, because, say, buffer contents have changed in the
+meantime.  The backend is only given notice of this via a renewed call
+to the backend function.  Thus, to prevent making obsolete reports and
+wasting resources, backend functions should first cancel any ongoing
+processing from previous calls.
+
address@hidden
+The symbol @code{:panic}, signaling that the backend has encountered
+an exceptional situation and should be disabled.
address@hidden itemize
+
+Currently accepted @var{report-key} arguments are:
+
address@hidden
address@hidden
address@hidden:explanation}, whose value should give user-readable
+details of the situation encountered, if any.
+
address@hidden
address@hidden:force}, whose value should be a boolean suggesting
+that Flymake consider the report even if it was somehow
+unexpected.
address@hidden itemize
+
address@hidden
+* Flymake utility functions::
+* An annotated example backend::
address@hidden menu
+
address@hidden Flymake utility functions
address@hidden Flymake utility functions
address@hidden utility functions
+
address@hidden create diagnostic object
+Before delivering them to Flymake, backends create diagnostic objects
+by calling the function @code{flymake-make-diagnostic}.
+
address@hidden Function flymake-make-diagnostic buffer beg end type text
+Make a Flymake diagnostic for @var{buffer}'s region from @var{beg} to
address@hidden  @var{type} is a key to
address@hidden and @var{text} is a description
+of the problem detected in this region.
address@hidden deffn
+
address@hidden buffer position from line and column number
+It is often the case with external syntax tools that a diagnostic's
+position is reported in terms of a line number, and sometimes a column
+number.  To convert this information into a buffer position, backends
+can use the following function:
+
address@hidden Function flymake-diag-region buffer line &optional col
+Compute @var{buffer}'s region (@var{beg} .  @var{end}) corresponding to
address@hidden and @var{col}.  If @var{col} is nil, return a region just
+for @var{line}.  Return nil if the region is invalid.
address@hidden deffn
+
address@hidden add a log message
+For troubleshooting purposes, backends may record arbitrary
+exceptional or erroneous situations into the Flymake log
+buffer (@pxref{Backend exceptions}):
+
address@hidden Macro flymake-log level msg &optional args
+Log, at level @var{level}, the message @var{msg} formatted with
address@hidden  @var{level} is passed to @code{display-warning}
+(@pxref{Warning Basics,,, elisp, The Emacs Lisp reference Manual}), which is
+used to display the warning in Flymake's log buffer.
address@hidden deffn
+
address@hidden An annotated example backend
address@hidden An annotated example backend
address@hidden example of backend
address@hidden backend, annotated example
+
+This section presents an annotated example of a complete working
+Flymake backend.  The example illustrates the process of writing a
+backend as outlined above.
+
+The backend in question is used for checking Ruby source files.  It
+uses asynchronous sub-processes (@pxref{Asynchronous Processes,,, elisp,
+The Emacs Lisp Reference Manual}), a common technique for performing
+parallel processing in Emacs.
+
+The following code needs lexical binding (@pxref{Using Lexical
+Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active.
+
address@hidden
+;;; ruby-flymake.el --- A ruby Flymake backend  -*- lexical-binding: t; -*-
+(defvar-local ruby--flymake-proc nil)
+
+(defun ruby-flymake (report-fn &rest _args)
+  ;; Not having a ruby interpreter is a serious problem which should cause
+  ;; the backend to disable itself, so an @code{error} is signalled.
+  ;;
+  (unless (executable-find
+           "ruby") (error "Cannot find a suitable ruby"))
+  ;; If a live process launched in an earlier check was found, that
+  ;; process is killed.  When that process's sentinel eventually runs,
+  ;; it will notice its obsoletion, since it have since reset
+  ;; `ruby-flymake-proc' to a different value
+  ;;
+  (when (process-live-p ruby--flymake-proc)
+    (kill-process ruby--flymake-proc))
+
+  ;; Save the current buffer, the narrowing restriction, remove any
+  ;; narrowing restriction.
+  ;;
+  (let ((source (current-buffer)))
+    (save-restriction
+      (widen)
+      ;; Reset the `ruby--flymake-proc' process to a new process
+      ;; calling the ruby tool.
+      ;;
+      (setq
+       ruby--flymake-proc
+       (make-process
+        :name "ruby-flymake" :noquery t :connection-type 'pipe
+        ;; Make output go to a temporary buffer.
+        ;;
+        :buffer (generate-new-buffer " *ruby-flymake*")
+        :command '("ruby" "-w" "-c")
+        :sentinel
+        (lambda (proc _event)
+          ;; Check that the process has indeed exited, as it might
+          ;; be simply suspended.
+          ;;
+          (when (eq 'exit (process-status proc))
+            (unwind-protect
+                ;; Only proceed if `proc' is the same as
+                ;; `ruby--flymake-proc', which indicates that
+                ;; `proc' is not an obsolete process.
+                ;;
+                (if (eq proc ruby--flymake-proc)
+                    (with-current-buffer (process-buffer proc)
+                      (goto-char (point-min))
+                      ;; Parse the output buffer for diagnostic's
+                      ;; messages and locations, collect them in a list
+                      ;; of objects, and call `report-fn'.
+                      ;;
+                      (cl-loop
+                       while (search-forward-regexp
+                              "^\\(?:.*.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$"
+                              nil t)
+                       for msg = (match-string 2)
+                       for (beg . end) = (flymake-diag-region
+                                          source
+                                          (string-to-number (match-string 1)))
+                       for type = (if (string-match "^warning" msg)
+                                      :warning
+                                    :error)
+                       collect (flymake-make-diagnostic source
+                                                        beg
+                                                        end
+                                                        type
+                                                        msg)
+                       into diags
+                       finally (funcall report-fn diags)))
+                  (flymake-log :warning "Cancelling obsolete check %s"
+                               proc))
+              ;; Cleanup the temporary buffer used to hold the
+              ;; check's output.
+              ;;
+              (kill-buffer (process-buffer proc)))))))
+      ;; Send the buffer contents to the process's stdin, followed by
+      ;; an EOF.
+      ;;
+      (process-send-region ruby--flymake-proc (point-min) (point-max))
+      (process-send-eof ruby--flymake-proc))))
+
+(defun ruby-setup-flymake-backend ()
+  (add-hook 'flymake-diagnostic-functions 'ruby-flymake nil t))
+
+(add-hook 'ruby-mode-hook 'ruby-setup-flymake-backend)
address@hidden example
 
 @node The legacy Proc backend
 @chapter The legacy ``Proc'' backend
address@hidden The legacy Proc backend
address@hidden legacy proc backend
 
 @menu
 * Proc customization variables::
@@ -282,15 +712,16 @@ If non-nil, moving to errors with 
@code{flymake-goto-next-error} and
 * Interaction with other modes::
 @end menu
 
address@hidden flymake-proc-legacy-backend
 The backend @code{flymake-proc-legacy-backend} was originally designed
 to be extended for supporting new syntax check tools and error message
-patterns. It is also controlled by its own set of customization variables
+patterns.  It is also controlled by its own set of customization variables
 
 @node Proc customization variables
 @section Customization variables for the Proc backend
address@hidden Proc customization variables
address@hidden proc backend customization variables
 
address@hidden @code
address@hidden @code
 @item flymake-proc-allowed-file-name-masks
 A list of @code{(filename-regexp, init-function, cleanup-function
 getfname-function)} for configuring syntax check tools.  @xref{Adding
@@ -314,22 +745,22 @@ line-idx col-idx err-text-idx)}.  @xref{Parsing the 
output}.
 
 @item flymake-proc-diagnostic-type-pred
 A function to classify a diagnostic text as particular type of
-error. Should be a function taking an error text and returning one of
-the symbols indexing @code{flymake-diagnostic-types-alist}. If non-nil
+error.  Should be a function taking an error text and returning one of
+the symbols indexing @code{flymake-diagnostic-types-alist}.  If non-nil
 is returned but there is no such symbol in that table, a warning is
-assumed. If nil is returned, an error is assumed. Can also be a
+assumed.  If nil is returned, an error is assumed.  Can also be a
 regular expression that should match only warnings.  This variable
 replaces the old @code{flymake-warning-re} and
 @code{flymake-warning-predicate}.
 
 @item flymake-proc-compilation-prevents-syntax-check
 A flag indicating whether compilation and syntax check of the same
-file cannot be run simultaneously.
address@hidden table
+file cannot be run simultaneously.  @xref{Interaction with other modes}.
address@hidden vtable
 
 @node Adding support for a new syntax check tool
 @section Adding support for a new syntax check tool
address@hidden Adding support for a new syntax check tool
address@hidden adding support for a new syntax check tool
 
 @menu
 * Example---Configuring a tool called directly::
@@ -371,10 +802,9 @@ will be different from the real ones, as actually the tool 
works with
 the temporary copy.  In most cases, the default implementation
 provided by Flymake, @code{flymake-proc-get-real-file-name}, can be
 used as @code{getfname-function}.
-
 @end table
 
-To add support for a new syntax check tool, write corresponding
+To add support for a new syntax check tool, write the corresponding
 @code{init-function} and, optionally, @code{cleanup-function} and
 @code{getfname-function}.  If the format of error messages reported by
 the new tool is not yet supported by Flymake, add a new entry to
@@ -385,10 +815,10 @@ support for various syntax check tools.
 
 @node Example---Configuring a tool called directly
 @subsection Example---Configuring a tool called directly
address@hidden Adding support for perl
address@hidden adding support for perl
 
-In this example, we will add support for @code{perl} as a syntax check
-tool.  @code{perl} supports the @code{-c} option which does syntax
+In this example, we will add support for @command{perl} as a syntax check
+tool.  @command{perl} supports the @option{-c} option which does syntax
 checking.
 
 First, we write the @code{init-function}:
@@ -434,7 +864,7 @@ Finally, we add an entry to 
@code{flymake-proc-err-line-patterns}:
 
 @node Example---Configuring a tool called via make
 @subsection Example---Configuring a tool called via make
address@hidden Adding support for C (gcc+make)
address@hidden adding support for C (gcc+make)
 
 In this example we will add support for C files syntax checked by
 @command{gcc} called via @command{make}.
@@ -464,9 +894,10 @@ command line:
             "check-syntax"))
 @end lisp
 
address@hidden is a directory containing @code{Makefile}, see @ref{Locating the 
buildfile}.
address@hidden is a directory containing the @file{Makefile}, see
address@hidden the buildfile}.
 
-Thus, @code{Makefile} must contain the @code{check-syntax} target.  In
+Thus, @file{Makefile} must contain the @code{check-syntax} target.  In
 our case this target might look like this:
 
 @verbatim
@@ -488,11 +919,11 @@ check-syntax:
 
 @node Implementation overview
 @section Implementation overview
address@hidden Syntax check models
address@hidden Master file
address@hidden syntax check models
address@hidden master file
 
 @code{flymake-proc-legacy-backend} saves a copy of the buffer in a
-temporary file in the buffer's directory (or in the system temp
+temporary file in the buffer's directory (or in the system temporary
 directory, for Java files), creates a syntax check command and
 launches a process with this command.  The output is parsed using a
 list of error message patterns, and error information (file name, line
@@ -511,15 +942,15 @@ Two syntax check modes are distinguished:
 @item
 Buffer can be syntax checked in a standalone fashion, that is, the
 file (its temporary copy, in fact) can be passed over to the compiler to
-do the syntax check.  Examples are C/C++ (.c, .cpp) and Java (.java)
-sources.
+do the syntax check.  Examples are C/address@hidden sources (@file{.c},
address@hidden) and Java (@file{.java}).
 
 @item
 Buffer can be syntax checked, but additional file, called master file,
 is required to perform this operation.  A master file is a file that
 includes the current file, so that running a syntax check tool on it
-will also check syntax in the current file.  Examples are C/C++ (.h,
-.hpp) headers.
+will also check syntax in the current file.  Examples are C/address@hidden
+headers (@file{.h}, @file{.hpp}).
 
 @end enumerate
 
@@ -534,8 +965,7 @@ tool-specific (routines for Make, Ant, etc.)@: code.
 
 @node Making a temporary copy
 @section Making a temporary copy
address@hidden Temporary copy of the buffer
address@hidden Master file
address@hidden temporary copy of the buffer
 
 After the possibility of the syntax check has been determined, a
 temporary copy of the current buffer is made so that the most recent
@@ -547,9 +977,10 @@ Things get trickier, however, when master file is 
involved, as it
 requires to
 
 @itemize @bullet
address@hidden locate a master file
address@hidden patch it to include the current file using its new (temporary)
-name.
address@hidden
+locate a master file
address@hidden
+patch it to include the current file using its new (temporary) name.
 @end itemize
 
 Locating a master file is discussed in the following section.
@@ -565,37 +996,39 @@ the syntax check tool.
 
 @node Locating a master file
 @section Locating a master file
address@hidden Master file
address@hidden locating a master file
address@hidden master file, locating
 
 Master file is located in two steps.
 
 First, a list of possible master files is built.  A simple name
-matching is used to find the files.  For a C++ header @code{file.h},
-the Proc backend searches for all @code{.cpp} files in the directories
+matching is used to find the files.  For a C++ header @file{file.h},
+the Proc backend searches for all @file{.cpp} files in the directories
 whose relative paths are stored in a customizable variable
 @code{flymake-proc-master-file-dirs}, which usually contains something
 like @code{("." "./src")}.  No more than
 @code{flymake-proc-master-file-count-limit} entries is added to the
 master file list.  The list is then sorted to move files with names
address@hidden to the top.
address@hidden to the top.
 
 Next, each master file in a list is checked to contain the appropriate
 include directives.  No more than @code{flymake-proc-check-file-limit} of each
 file are parsed.
 
-For @code{file.h}, the include directives to look for are
+For @file{file.h}, the include directives to look for are
 @code{#include "file.h"}, @code{#include "../file.h"}, etc.  Each
 include is checked against a list of include directories
 (see @ref{Getting the include directories}) to be sure it points to the
-correct @code{file.h}.
+correct @file{file.h}.
 
 First matching master file found stops the search.  The master file is then
 patched and saved to disk.  In case no master file is found, syntax check is
-aborted, and corresponding status (!) is reported in the mode line.
+aborted, and corresponding status (@samp{!}) is reported in the mode line.
address@hidden check statuses}.
 
 @node Getting the include directories
 @section Getting the include directories
address@hidden Include directories (C/C++ specific)
address@hidden include directories (C/C++ specific)
 
 Two sets of include directories are distinguished: system include directories
 and project include directories.  The former is just the contents of the
@@ -615,25 +1048,26 @@ of every syntax check attempt.
 
 @node Locating the buildfile
 @section Locating the buildfile
address@hidden Locating the buildfile
address@hidden locating the buildfile
 @cindex buildfile, locating
 @cindex Makefile, locating
 
 The Proc backend can be configured to use different tools for
 performing syntax checks.  For example, it can use direct compiler
 call to syntax check a perl script or a call to @command{make} for a
-more complicated case of a @code{C/C++} source.  The general idea is
-that simple files, like perl scripts and html pages, can be checked by
+more complicated case of a C/address@hidden source.  The general idea is
+that simple files, like Perl scripts and @acronym{HTML} pages, can be checked 
by
 directly invoking a corresponding tool.  Files that are usually more
 complex and generally used as part of larger projects, might require
 non-trivial options to be passed to the syntax check tool, like
-include directories for C++.  The latter files are syntax checked
+include directories for address@hidden  The latter files are syntax checked
 using some build tool, like Make or Ant.
 
 All Make configuration data is usually stored in a file called
address@hidden  To allow for future extensions, Flymake uses a notion of
-buildfile to reference the 'project configuration' file.
address@hidden  To allow for future extensions, Flymake uses a notion of
+buildfile to reference the @dfn{project configuration} file.
 
address@hidden flymake-proc-find-buildfile
 Special function, @code{flymake-proc-find-buildfile} is provided for locating 
buildfiles.
 Searching for a buildfile is done in a manner similar to that of searching
 for possible master files.
@@ -642,13 +1076,13 @@ A customizable variable
 @code{flymake-proc-buildfile-dirs} holds a list of relative paths to the
 buildfile.  They are checked sequentially until a buildfile is found.
 @end ignore
-In case there's no build file, syntax check is aborted.
+In case there's no build file, the syntax check is aborted.
 
 Buildfile values are also cached.
 
 @node Starting the syntax check process
 @section Starting the syntax check process
address@hidden Syntax check process
address@hidden syntax check process, legacy proc backend
 
 The command line (command name and the list of arguments) for
 launching a process is returned by the initialization function.  The
@@ -659,16 +1093,16 @@ be killed without prompting the user.
 
 @node Parsing the output
 @section Parsing the output
address@hidden Parsing the output
address@hidden parsing the output, legacy proc backend
 
 The output generated by the syntax check tool is parsed in the process
 filter/sentinel using the error message patterns stored in the
 @code{flymake-proc-err-line-patterns} variable.  This variable contains a
-list of items of the form @code{(regexp file-idx line-idx
-err-text-idx)}, used to determine whether a particular line is an
+list of items of the form @address@hidden(regexp file-idx line-idx
+err-text-idx)}}, used to determine whether a particular line is an
 error message and extract file name, line number and error text,
 respectively.  Error type (error/warning) is also guessed by matching
-error text with the '@code{^[wW]arning}' pattern.  Anything that was not
+error text with the @samp{^[wW]arning} pattern.  Anything that was not
 classified as a warning is considered an error.  Type is then used to
 sort error menu items, which shows error messages first.
 
@@ -676,7 +1110,7 @@ The Proc backend is also able to interpret error message 
patterns
 missing err-text-idx information.  This is done by merely taking the
 rest of the matched line (@code{(substring line (match-end 0))}) as
 error text.  This trick allows making use of a huge collection of
-error message line patterns from @code{compile.el}.  All these error
+error message line patterns from @file{compile.el}.  All these error
 patterns are appended to the end of
 @code{flymake-proc-err-line-patterns}.
 
@@ -687,8 +1121,8 @@ after every process launch/exit.
 
 @node Interaction with other modes
 @section Interaction with other modes
address@hidden Interaction with other modes
address@hidden Interaction with compile mode
address@hidden interaction with other modes, legacy proc backend
address@hidden interaction with compile mode, legacy proc backend
 
 The only mode the Proc backend currently knows about is
 @code{compile}.
@@ -702,8 +1136,9 @@ though, was working around a locking problem with MS 
Visual C++
 compiler.  The variable in question is
 @code{flymake-proc-compilation-prevents-syntax-check}.
 
address@hidden flymake-proc-compile
 The Proc backend also provides an alternative command for starting
-compilation, @code{flymake-proc-compile}. It just kills all the active
+compilation, @code{flymake-proc-compile}.  It just kills all the active
 syntax check processes before calling @code{compile}.
 
 @node GNU Free Documentation License
diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi
index a04fa43..f7fe539 100644
--- a/doc/misc/htmlfontify.texi
+++ b/doc/misc/htmlfontify.texi
@@ -825,7 +825,7 @@ with a class of @code{t} is considered to match any class 
you specify.
 This matches Emacs's behavior when deciding on which face attributes to
 use, to the best of my understanding ).
 
-If @var{class} is @code{nil}, then you just get get whatever
+If @var{class} is @code{nil}, then you just get whatever
 @code{face-attr-construct} returns; i.e., the current specification in
 effect for @var{face}.
 
diff --git a/doc/misc/ses.texi b/doc/misc/ses.texi
index fc79b02..5f9a0f5 100644
--- a/doc/misc/ses.texi
+++ b/doc/misc/ses.texi
@@ -584,7 +584,7 @@ This example will:
 When the cell is empty (ie.@: when @code{val} is @code{nil}), print an
 empty string @code{""}
 @item
-When the cell value is a non negative number, format the the value in
+When the cell value is a non negative number, format the value in
 fixed-point notation with one decimal after point
 @item
 Otherwise, handle the value as erroneous by printing it as an
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 6478479..4705579 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -186,7 +186,7 @@ transparency extends to editing, version control, and 
@code{dired}.
 @value{tramp} can access remote hosts using any number of access
 methods, such as @command{rsh}, @command{rlogin}, @command{telnet},
 and related programs.  If these programs can successfully pass
address@hidden characters, @value{tramp} can use them.
address@hidden characters, @value{tramp} can use them.
 @value{tramp} does not require or mandate 8-bit clean connections.
 
 @value{tramp}'s most common access method is through @command{ssh}, a
@@ -339,8 +339,8 @@ Another way is to follow the terminal session below:
 
 @example
 @group
-] @strong{cd ~/emacs}
-] @strong{git clone git://git.savannah.gnu.org/tramp.git}
+$ cd ~/emacs
+$ git clone git://git.savannah.gnu.org/tramp.git
 @end group
 @end example
 
@@ -349,8 +349,8 @@ From behind a firewall:
 
 @example
 @group
-] @strong{git config --global http.proxy 
http://user:pwd@@proxy.server.com:8080}
-] @strong{git clone https://git.savannah.gnu.org/r/tramp.git}
+$ git config --global http.proxy http://user:pwd@@proxy.server.com:8080
+$ git clone https://git.savannah.gnu.org/r/tramp.git
 @end group
 @end example
 
@@ -358,7 +358,7 @@ From behind a firewall:
 @value{tramp} developers:
 
 @example
-] @strong{git clone login@@git.sv.gnu.org:/srv/git/tramp.git}
+$ git clone login@@git.sv.gnu.org:/srv/git/tramp.git
 @end example
 
 @noindent
@@ -370,8 +370,8 @@ To fetch updates from the repository, use git pull:
 
 @example
 @group
-] @strong{cd ~/emacs/tramp}
-] @strong{git pull}
+$ cd ~/emacs/tramp
+$ git pull
 @end group
 @end example
 
@@ -381,8 +381,8 @@ Run @command{autoconf} as follows to generate an up-to-date
 
 @example
 @group
-] @strong{cd ~/emacs/tramp}
-] @strong{autoconf}
+$ cd ~/emacs/tramp
+$ autoconf
 @end group
 @end example
 
@@ -2000,7 +2000,7 @@ fi
 install and execute a listener as follows (see @code{tramp-methods}):
 
 @example
-# nc -l -p 42
+$ nc -l -p 42
 @end example
 
 The above command-line syntax has changed with @command{busybox}
diff --git a/lib/getopt-cdefs.in.h b/lib/getopt-cdefs.in.h
index 21d847b..83a18f9 100644
--- a/lib/getopt-cdefs.in.h
+++ b/lib/getopt-cdefs.in.h
@@ -4,12 +4,12 @@
    Unlike most of the getopt implementation, it is NOT shared
    with the GNU C Library.
 
-   gnulib is free software; you can redistribute it and/or modify it
+   This file is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 3 of
    the License, or (at your option) any later version.
 
-   gnulib is distributed in the hope that it will be useful, but
+   This file 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.
diff --git a/lib/getopt-pfx-core.h b/lib/getopt-pfx-core.h
index 2ede4bb..02b2b50 100644
--- a/lib/getopt-pfx-core.h
+++ b/lib/getopt-pfx-core.h
@@ -4,12 +4,12 @@
    Unlike most of the getopt implementation, it is NOT shared
    with the GNU C Library.
 
-   gnulib is free software; you can redistribute it and/or modify it
+   This file is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 3 of
    the License, or (at your option) any later version.
 
-   gnulib is distributed in the hope that it will be useful, but
+   This file 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.
diff --git a/lib/getopt-pfx-ext.h b/lib/getopt-pfx-ext.h
index 16d9634..75e6fd3 100644
--- a/lib/getopt-pfx-ext.h
+++ b/lib/getopt-pfx-ext.h
@@ -4,12 +4,12 @@
    Unlike most of the getopt implementation, it is NOT shared
    with the GNU C Library.
 
-   gnulib is free software; you can redistribute it and/or modify it
+   This file is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 3 of
    the License, or (at your option) any later version.
 
-   gnulib is distributed in the hope that it will be useful, but
+   This file 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.
diff --git a/lib/getopt.in.h b/lib/getopt.in.h
index 908f841..594ed80 100644
--- a/lib/getopt.in.h
+++ b/lib/getopt.in.h
@@ -5,12 +5,12 @@
    with the GNU C Library, which supplies a different version of
    this file.
 
-   gnulib is free software; you can redistribute it and/or modify it
+   This file is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 3 of
    the License, or (at your option) any later version.
 
-   gnulib is distributed in the hope that it will be useful, but
+   This file 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.
diff --git a/lisp/ChangeLog.16 b/lisp/ChangeLog.16
index f3d4874..33bd9a0 100644
--- a/lisp/ChangeLog.16
+++ b/lisp/ChangeLog.16
@@ -2728,7 +2728,7 @@
 
        * vc/ediff-util.el (ediff-buffer-type): New function.
        (ediff-clone-buffer-for-current-diff-comparison): Compute the buf-type
-       rather than taking it as as argument.
+       rather than taking it as an argument.
        (ediff-inferior-compare-regions): Adjust calls accordingly (bug#11319).
 
 2012-12-14  Ryan Crum  <address@hidden>
diff --git a/lisp/ChangeLog.6 b/lisp/ChangeLog.6
index 8c985fb..64a9d4d 100644
--- a/lisp/ChangeLog.6
+++ b/lisp/ChangeLog.6
@@ -1473,7 +1473,7 @@
 1996-04-18  Richard Stallman  <address@hidden>
 
        * term/win32-win.el (x-select-text): Remember selected text.
-       (x-get-selection-value): Return nil if the clipboard data is
+       (x-get-selection-value): Return nil if the clipboard data
        is the same as the remembered selected text.
 
 1996-04-18  Lars Magne Ingebrigtsen  <address@hidden>
diff --git a/lisp/allout.el b/lisp/allout.el
index d0be847..15b7b3a 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -357,7 +357,7 @@ Examples:
         grandchildren, but completely collapse the final top-level topic.
  (-1 () : 1 0)
        Close the first topic so only the immediate subtopics are shown,
-        leave the subsequent topics exposed as they are until the second
+        leave the subsequent topics exposed as they are until the
        second to last topic, which is exposed at least one level, and
         completely close the last topic.
  (-2 : -1 *)
diff --git a/lisp/button.el b/lisp/button.el
index 7e9a712..a609047 100644
--- a/lisp/button.el
+++ b/lisp/button.el
@@ -36,7 +36,7 @@
 ;; represented by the overlay itself, or text-properties, in which case
 ;; the button is represented by a marker or buffer-position pointing
 ;; somewhere in the button.  In the latter case, no markers into the
-;; buffer are retained, which is important for speed if there are are
+;; buffer are retained, which is important for speed if there are
 ;; extremely large numbers of buttons.  Note however that if there is
 ;; an existing face text-property at the site of the button, the
 ;; button face may not be visible.  Using overlays avoids this.
diff --git a/lisp/cedet/ChangeLog.1 b/lisp/cedet/ChangeLog.1
index a17e53a..35cdf80 100644
--- a/lisp/cedet/ChangeLog.1
+++ b/lisp/cedet/ChangeLog.1
@@ -457,7 +457,7 @@
        complete local variables.
 
        * semantic/scope.el (semantic-analyze-scoped-types-default): If we
-       cannot find a type in the typecache, also look into the the types
+       cannot find a type in the typecache, also look into the types
        we already found.  This is necessary since in C++, a 'using
        namespace' can be dependend on a previous one.
        (semantic-completable-tags-from-type): When creating the list of
diff --git a/lisp/cedet/cedet-idutils.el b/lisp/cedet/cedet-idutils.el
index 4b6c6b0..48e1b2d 100644
--- a/lisp/cedet/cedet-idutils.el
+++ b/lisp/cedet/cedet-idutils.el
@@ -98,7 +98,7 @@ Return the created buffer with program output."
 
 (defun cedet-idutils-lid-call (flags)
   "Call ID Utils lid with the list of FLAGS.
-Return the created buffer with with program output."
+Return the created buffer with program output."
   (let ((b (get-buffer-create "*CEDET lid*"))
        (cd default-directory)
        )
diff --git a/lisp/cedet/ede/pmake.el b/lisp/cedet/ede/pmake.el
index c199cae..b836eaf 100644
--- a/lisp/cedet/ede/pmake.el
+++ b/lisp/cedet/ede/pmake.el
@@ -277,7 +277,7 @@ Execute BODY in a location where a value can be placed."
 ;;; SOURCE VARIABLE NAME CONSTRUCTION
 
 (defsubst ede-pmake-varname (obj)
-  "Convert OBJ into a variable name name.
+  "Convert OBJ into a variable name.
 Change .  to _ in the variable name."
   (let ((name (oref obj name)))
     (while (string-match "\\." name)
diff --git a/lisp/cedet/semantic/db-find.el b/lisp/cedet/semantic/db-find.el
index c678739..1f5de71 100644
--- a/lisp/cedet/semantic/db-find.el
+++ b/lisp/cedet/semantic/db-find.el
@@ -930,7 +930,7 @@ but should be good enough for debugging assertions."
            (length result))))
 
 (defun semanticdb-find-result-with-nil-p (resultp)
-  "Non-nil of RESULTP is in the form of a semanticdb search result.
+  "Non-nil if RESULTP is in the form of a semanticdb search result.
 The value nil is valid where a TABLE usually is, but only if the TAG
 results include overlays.
 This query only really tests the first entry in the list that is RESULTP,
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el
index e7ee879..4d9daaf 100644
--- a/lisp/cedet/semantic/db.el
+++ b/lisp/cedet/semantic/db.el
@@ -595,7 +595,7 @@ This will call `semantic-fetch-tags' if that file is in 
memory."
        (kill-buffer buff))))))
 
 (cl-defmethod semanticdb-needs-refresh-p ((obj semanticdb-table))
-  "Return non-nil of OBJ's tag list is out of date.
+  "Return non-nil if OBJ's tag list is out of date.
 The file associated with OBJ does not need to be in a buffer."
   (let* ((ff (semanticdb-full-filename obj))
         (buff (semanticdb-in-buffer-p obj))
diff --git a/lisp/cedet/semantic/edit.el b/lisp/cedet/semantic/edit.el
index 78822c4..fc0a05a 100644
--- a/lisp/cedet/semantic/edit.el
+++ b/lisp/cedet/semantic/edit.el
@@ -221,7 +221,7 @@ Argument START, END, and LENGTH specify the bounds of the 
change."
   )
 
 (defun semantic-edits-change-in-one-tag-p (change hits)
-  "Return non-nil of the overlay CHANGE exists solely in one leaf tag.
+  "Return non-nil if the overlay CHANGE exists solely in one leaf tag.
 HITS is the list of tags that CHANGE is in.  It can have more than
 one tag in it if the leaf tag is within a parent tag."
   (and (< (semantic-tag-start (car hits))
diff --git a/lisp/composite.el b/lisp/composite.el
index ab39e08..72b0ffc 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -442,8 +442,10 @@ after a sequence of character events."
 (defsubst lglyph-set-adjustment (glyph &optional xoff yoff wadjust)
   (aset glyph 9 (vector (or xoff 0) (or yoff 0) (or wadjust 0))))
 
+;; Return the shallow Copy of GLYPH.
 (defsubst lglyph-copy (glyph) (copy-sequence glyph))
 
+;; Insert GLYPH at the index IDX of GSTRING.
 (defun lgstring-insert-glyph (gstring idx glyph)
   (let ((nglyphs (lgstring-glyph-len gstring))
        (i idx))
@@ -459,6 +461,18 @@ after a sequence of character events."
     (lgstring-set-glyph gstring i glyph)
     gstring))
 
+;; Remove glyph at IDX from GSTRING.
+(defun lgstring-remove-glyph (gstring idx)
+  (setq gstring (copy-sequence gstring))
+  (lgstring-set-id gstring nil)
+  (let ((len (length gstring)))
+    (setq idx (+ idx 3))
+    (while (< idx len)
+      (aset gstring (1- idx) (aref gstring idx))
+      (setq idx (1+ idx)))
+    (aset gstring (1- len) nil))
+  gstring)
+
 (defun compose-glyph-string (gstring from to)
   (let ((glyph (lgstring-glyph gstring from))
        from-pos to-pos)
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 78fa5ed..5fa28d3 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -57,7 +57,7 @@
 
 (defcustom dired-bind-vm nil
   "Non-nil means \"V\" runs `dired-vm', otherwise \"V\" runs `dired-rmail'.
-RMAIL files in the old Babyl format (used before before Emacs 23.1)
+RMAIL files in the old Babyl format (used before Emacs 23.1)
 contain \"-*- rmail -*-\" at the top, so `dired-find-file'
 will run `rmail' on these files.  New RMAIL files use the standard
 mbox format, and so cannot be distinguished in this way."
diff --git a/lisp/display-line-numbers.el b/lisp/display-line-numbers.el
index 3b6b101..15e0427 100644
--- a/lisp/display-line-numbers.el
+++ b/lisp/display-line-numbers.el
@@ -36,6 +36,7 @@
 
 (defgroup display-line-numbers nil
   "Display line numbers in the buffer."
+  :group 'convenience
   :group 'display)
 
 (defcustom display-line-numbers-type t
diff --git a/lisp/elide-head.el b/lisp/elide-head.el
index 5bede73..c6d8c90 100644
--- a/lisp/elide-head.el
+++ b/lisp/elide-head.el
@@ -57,7 +57,7 @@ If not, see <http://www\\.gnu\\.org/licenses/>\\)\\.")
      "SUCH DAMAGE\\.")                               ; BSD
     ("Permission is hereby granted, free of charge" . ; X11
      "authorization from the X Consortium\\."))
-  "Alist of regexps defining start end end of text to elide.
+  "Alist of regexps defining start and end of text to elide.
 
 The cars of elements of the list are searched for in order.  Text is
 elided with an invisible overlay from the end of the line where the
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index 32b6a47..8286766 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -502,7 +502,7 @@
 ;; important advantage is that it allows the implementation of forward advice.
 ;; Advice information for a certain function accumulates as the value of the
 ;; `advice-info' property of the function symbol.  This accumulation is
-;; completely independent of the fact that that function might not yet be
+;; completely independent of the fact that the function might not yet be
 ;; defined.  The macros `defun' and `defmacro' check whether the
 ;; function/macro they defined had advice information
 ;; associated with it.  If so and forward advice is enabled, the original
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index b2f76ab..62befd4 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -204,7 +204,16 @@ OPTIONS-AND-METHODS currently understands:
 DEFAULT-BODY, if present, is used as the body of a default method.
 
 \(fn NAME ARGS [DOC-STRING] [OPTIONS-AND-METHODS...] &rest DEFAULT-BODY)"
-  (declare (indent 2) (doc-string 3))
+  (declare (indent 2) (doc-string 3)
+           (debug
+            (&define name cl-lambda-list lambda-doc
+                     [&rest [&or
+                             ("declare" &rest sexp)
+                             (":argument-precedence-order" &rest sexp)
+                             (&define ":method" [&rest atom]
+                                      cl-generic-method-args lambda-doc
+                                      def-body)]]
+                     def-body)))
   (let* ((doc (if (stringp (car-safe options-and-methods))
                   (pop options-and-methods)))
          (declarations nil)
@@ -422,7 +431,7 @@ The set of acceptable TYPEs (also called \"specializers\") 
is defined
                                     ; Like in CLOS spec, we support
                                     ; any non-list values.
              cl-generic-method-args     ; arguments
-             [ &optional stringp ]      ; documentation string
+             lambda-doc                 ; documentation string
              def-body)))                ; part to be debugged
   (let ((qualifiers nil))
     (while (not (listp args))
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 32ba0ac..40eda1e 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -190,7 +190,7 @@ The name is made by appending a number to PREFIX, default 
\"T\"."
   (&rest ("cl-declare" &rest sexp)))
 
 (def-edebug-spec cl-declarations-or-string
-  (&or stringp cl-declarations))
+  (&or lambda-doc cl-declarations))
 
 (def-edebug-spec cl-lambda-list
   (([&rest arg]
@@ -447,8 +447,8 @@ more details.
 
 (def-edebug-spec cl-lambda-expr
   (&define ("lambda" cl-lambda-list
-           ;;cl-declarations-or-string
-           ;;[&optional ("interactive" interactive)]
+           cl-declarations-or-string
+           [&optional ("interactive" interactive)]
            def-body)))
 
 ;; Redefine function-form to also match cl-function
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index a070ff2..77523de 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -2017,15 +2017,14 @@ expressions; a `progn' form will be returned enclosing 
these forms."
 (def-edebug-spec defvar (symbolp &optional form stringp))
 
 (def-edebug-spec defun
-  (&define name lambda-list
-          [&optional stringp]
+  (&define name lambda-list lambda-doc
            [&optional ("declare" &rest sexp)]
           [&optional ("interactive" interactive)]
           def-body))
 (def-edebug-spec defmacro
   ;; FIXME: Improve `declare' so we can Edebug gv-expander and
   ;; gv-setter declarations.
-  (&define name lambda-list [&optional stringp]
+  (&define name lambda-list lambda-doc
            [&optional ("declare" &rest sexp)] def-body))
 
 (def-edebug-spec arglist lambda-list)  ;; deprecated - use lambda-list.
@@ -2036,6 +2035,10 @@ expressions; a `progn' form will be returned enclosing 
these forms."
     &optional ["&rest" arg]
     )))
 
+(def-edebug-spec lambda-doc
+  (&optional [&or stringp
+                  (&define ":documentation" def-form)]))
+
 (def-edebug-spec interactive
   (&optional &or stringp def-form))
 
@@ -3254,15 +3257,6 @@ generated symbols for methods.  If a function or method 
to
 instrument cannot be found, signal an error."
   (let ((func-marker (get func 'edebug)))
     (cond
-     ((and (markerp func-marker) (marker-buffer func-marker))
-      ;; It is uninstrumented, so instrument it.
-      (with-current-buffer (marker-buffer func-marker)
-       (goto-char func-marker)
-       (edebug-eval-top-level-form)
-        (list func)))
-     ((consp func-marker)
-      (message "%s is already instrumented." func)
-      (list func))
      ((cl-generic-p func)
       (let ((method-defs (cl--generic-method-files func))
             symbols)
@@ -3277,6 +3271,15 @@ instrument cannot be found, signal an error."
               (edebug-eval-top-level-form)
               (push (edebug-form-data-symbol) symbols))))
         symbols))
+     ((and (markerp func-marker) (marker-buffer func-marker))
+      ;; It is uninstrumented, so instrument it.
+      (with-current-buffer (marker-buffer func-marker)
+       (goto-char func-marker)
+       (edebug-eval-top-level-form)
+        (list func)))
+     ((consp func-marker)
+      (message "%s is already instrumented." func)
+      (list func))
      (t
       (let ((loc (find-function-noselect func t)))
        (unless (cdr loc)
diff --git a/lisp/emacs-lisp/generator.el b/lisp/emacs-lisp/generator.el
index 3e98859..410e4ed 100644
--- a/lisp/emacs-lisp/generator.el
+++ b/lisp/emacs-lisp/generator.el
@@ -680,7 +680,8 @@ sub-iterator function returns via `iter-end-of-sequence'."
 When called as a function, NAME returns an iterator value that
 encapsulates the state of a computation that produces a sequence
 of values.  Callers can retrieve each value using `iter-next'."
-  (declare (indent defun))
+  (declare (indent defun)
+           (debug (&define name lambda-list lambda-doc def-body)))
   (cl-assert lexical-binding)
   (let* ((parsed-body (macroexp-parse-body body))
          (declarations (car parsed-body))
@@ -692,7 +693,8 @@ of values.  Callers can retrieve each value using 
`iter-next'."
 (defmacro iter-lambda (arglist &rest body)
   "Return a lambda generator.
 `iter-lambda' is to `iter-defun' as `lambda' is to `defun'."
-  (declare (indent defun))
+  (declare (indent defun)
+           (debug (&define lambda-list lambda-doc def-body)))
   (cl-assert lexical-binding)
   `(lambda ,arglist
      ,(cps-generate-evaluator body)))
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index c703cae..36af884 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -226,7 +226,7 @@ I.e. accepts the usual &optional and &rest keywords, but 
every
 formal argument can be any pattern accepted by `pcase' (a mere
 variable name being but a special case of it)."
   (declare (doc-string 2) (indent defun)
-           (debug ((&rest pcase-PAT) body)))
+           (debug (&define (&rest pcase-PAT) lambda-doc def-body)))
   (let* ((bindings ())
          (parsed-body (macroexp-parse-body body))
          (args (mapcar (lambda (pat)
diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el
index 417301c..57bc6d9 100644
--- a/lisp/emacs-lisp/rmc.el
+++ b/lisp/emacs-lisp/rmc.el
@@ -1,6 +1,6 @@
 ;;; rmc.el --- read from a multiple choice question -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2017 Free Software Foundation, Inc.
 
 ;; Maintainer: address@hidden
 
@@ -17,7 +17,7 @@
 ;; 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:
 
diff --git a/lisp/faces.el b/lisp/faces.el
index 24ab1fa..a5f1d1d 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2483,7 +2483,8 @@ monospaced font, otherwise line numbers will not line up,
 and text lines might move horizontally as you move through
 the buffer."
   :version "26.1"
-  :group 'basic-faces)
+  :group 'basic-faces
+  :group 'display-line-numbers)
 
 (defface line-number-current-line
   '((t :inherit line-number))
@@ -2497,7 +2498,8 @@ the buffer.  Similarly, making this face's font different
 from that of the `line-number' face could produce such
 unwanted effects."
   :version "26.1"
-  :group 'basic-faces)
+  :group 'basic-faces
+  :group 'display-line-numbers)
 
 (defface escape-glyph
   '((((background dark)) :foreground "cyan")
diff --git a/lisp/frame.el b/lisp/frame.el
index e501dae..f8aa5c6 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -2434,7 +2434,11 @@ See also `toggle-frame-maximized'."
              (set-frame-parameter nil 'fullscreen fullscreen-restore)
            (set-frame-parameter nil 'fullscreen nil)))
       (modify-frame-parameters
-       nil `((fullscreen . fullboth) (fullscreen-restore . ,fullscreen))))))
+       nil `((fullscreen . fullboth) (fullscreen-restore . ,fullscreen))))
+    ;; Manipulating a frame without waiting for the fullscreen
+    ;; animation to complete can cause a crash, or other unexpected
+    ;; behaviour, on macOS (bug#28496).
+    (when (featurep 'cocoa) (sleep-for 0.5))))
 
 ;;;; Key bindings
 
diff --git a/lisp/frameset.el b/lisp/frameset.el
index 593451a..bda21a8 100644
--- a/lisp/frameset.el
+++ b/lisp/frameset.el
@@ -638,7 +638,7 @@ see `frameset-filter-alist'."
 When switching from a GUI frame to a tty frame, behave
 as `frameset-filter-shelve-param' does."
   (or saving
-      (if (frameset-switch-to-gui-p parameters)
+      (if (frameset-switch-to-tty-p parameters)
           (frameset-filter-shelve-param current filtered parameters saving
                                         prefix))))
 
diff --git a/lisp/gnus/ChangeLog.3 b/lisp/gnus/ChangeLog.3
index c2e4846..43681f6 100644
--- a/lisp/gnus/ChangeLog.3
+++ b/lisp/gnus/ChangeLog.3
@@ -955,7 +955,7 @@
        * gnus-sum.el (gnus-summary-read-group-1): Initialize the spam code if
        that's needed.
 
-       * spam.el (spam-initialize): Allow calling repeatedly, but only run the
+       * spam.el (spam-initialize): Allow calling repeatedly, but only run
        the code once (bug#9069).
 
 2014-01-18  Steinar Bang  <address@hidden>
diff --git a/lisp/gnus/gnus-mlspl.el b/lisp/gnus/gnus-mlspl.el
index cd6bbd0..d0810ca 100644
--- a/lisp/gnus/gnus-mlspl.el
+++ b/lisp/gnus/gnus-mlspl.el
@@ -72,8 +72,7 @@ match any of the group-specified splitting rules.  See
 ;;;###autoload
 (defun gnus-group-split-update (&optional catch-all)
   "Computes nnmail-split-fancy from group params and CATCH-ALL.
-It does this by calling by calling (gnus-group-split-fancy nil
-nil CATCH-ALL).
+It does this by calling (gnus-group-split-fancy nil nil CATCH-ALL).
 
 If CATCH-ALL is nil, `gnus-group-split-default-catch-all-group' is used
 instead.  This variable is set by `gnus-group-split-setup'."
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index cc91464..acb5546 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -50,6 +50,7 @@
 (require 'rfc2047)
 (require 'puny)
 (require 'rmc)                 ; read-multiple-choice
+(eval-when-compile (require 'subr-x))  ; when-let*
 
 (autoload 'mailclient-send-it "mailclient")
 
@@ -306,7 +307,7 @@ any confusion."
 (defcustom message-subject-trailing-was-query t
   "What to do with trailing \"(was: <old subject>)\" in subject lines.
 If nil, leave the subject unchanged.  If it is the symbol `ask', query
-the user what do do.  In this case, the subject is matched against
+the user what to do.  In this case, the subject is matched against
 `message-subject-trailing-was-ask-regexp'.  If
 `message-subject-trailing-was-query' is t, always strip the trailing
 old subject.  In this case, `message-subject-trailing-was-regexp' is
@@ -8059,8 +8060,12 @@ regexp VARSTR."
                  (or (null varstr)
                      (string-match varstr (symbol-name (car local)))))
         (ignore-errors
-          (set (make-local-variable (car local))
-               (cdr local)))))
+          ;; Cloning message-default-charset could cause an already
+          ;; encoded text to be encoded again, yielding raw bytes
+          ;; instead of characters in the message.
+          (unless (eq 'message-default-charset (car local))
+            (set (make-local-variable (car local))
+                 (cdr local))))))
      locals)))
 
 ;;;
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el
index 6378e3e..f14af74 100644
--- a/lisp/gnus/spam.el
+++ b/lisp/gnus/spam.el
@@ -628,7 +628,7 @@ order for SpamAssassin to recognize the new registered 
spam."
   :group 'spam-spamassassin)
 
 (defcustom spam-sa-learn-unregister-switch "--forget"
-  "The switch that sa-learn uses to unregister messages messages."
+  "The switch that sa-learn uses to unregister messages."
   :type 'string
   :group 'spam-spamassassin)
 
diff --git a/lisp/ido.el b/lisp/ido.el
index 23c039d3..47cbcb6 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -443,7 +443,7 @@ Possible values:
 `other-window'   Show new file in another window (same frame)
 `display'        Display file in another window without selecting to it
 `other-frame'    Show new file in another frame
-`maybe-frame'    If a file is visible in another frame, prompt to ask if you
+`maybe-frame'    If a file is visible in another frame, prompt to ask if
                  you want to see the file in the same window of the current
                  frame or in the other frame
 `raise-frame'     If a file is visible in another frame, raise that
diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el
index 2843c7c..a63c3a2 100644
--- a/lisp/language/misc-lang.el
+++ b/lisp/language/misc-lang.el
@@ -75,12 +75,70 @@ and Italian.")))
            (sample-text . "Persian     فارسی")
            (documentation . "Bidirectional editing is supported.")))
 
+(defcustom arabic-shaper-ZWNJ-handling nil
+  "How to handle ZWMJ in Arabic text rendering.
+This variable controls the way to handle a glyph for ZWNJ
+returned by the underling shaping engine.
+
+The default value is nil, which means that the ZWNJ glyph is
+displayed as is.
+
+If the value is `absorb', ZWNJ is absorbed into the previous
+grapheme cluster, and not displayed.
+
+If the value is `as-space', the glyph is displayed by a
+thin (i.e. 1-dot width) space.
+
+Customizing the value takes effect when you start Emacs next time."
+  :group 'mule
+  :version "26.1"
+  :type '(choice
+          (const :tag "default" nil)
+          (const :tag "as space" as-space)
+          (const :tag "absorb" absorb)))
+
+;; Record error in arabic-change-gstring.
+(defvar arabic-shape-log nil)
+
+(defun arabic-shape-gstring (gstring)
+  (setq gstring (font-shape-gstring gstring))
+  (condition-case err
+      (when arabic-shaper-ZWNJ-handling
+        (let ((font (lgstring-font gstring))
+              (i 1)
+              (len (lgstring-glyph-len gstring))
+              (modified nil))
+          (while (< i len)
+            (let ((glyph (lgstring-glyph gstring i)))
+              (when (eq (lglyph-char glyph) #x200c)
+                (cond
+                 ((eq arabic-shaper-ZWNJ-handling 'as-space)
+                  (if (> (- (lglyph-rbearing glyph) (lglyph-lbearing glyph)) 0)
+                      (let ((space-glyph (aref (font-get-glyphs font 0 1 " ") 
0)))
+                        (when space-glyph
+                          (lglyph-set-code glyph (aref space-glyph 3))
+                          (lglyph-set-width glyph (aref space-glyph 4)))))
+                  (lglyph-set-adjustment glyph 0 0 1)
+                  (setq modified t))
+                 ((eq arabic-shaper-ZWNJ-handling 'absorb)
+                  (let ((prev (lgstring-glyph gstring (1- i))))
+                    (lglyph-set-from-to prev (lglyph-from prev) (lglyph-to 
glyph))
+                    (setq gstring (lgstring-remove-glyph gstring i))
+                    (setq len (1- len)))
+                  (setq modified t)))))
+            (setq i (1+ i)))
+          (if modified
+              (lgstring-set-id gstring nil))))
+    (error (push err arabic-shape-log)))
+  gstring)
+
 (set-char-table-range
  composition-function-table
  '(#x600 . #x74F)
- (list (vector "[\u0600-\u074F\u200C\u200D]+" 0 'font-shape-gstring)
-       (vector "[\u200C\u200D][\u0600-\u074F\u200C\u200D]+"
-               1 'font-shape-gstring)))
+ (list (vector "[\u0600-\u074F\u200C\u200D]+" 0
+               'arabic-shape-gstring)
+       (vector "[\u200C\u200D][\u0600-\u074F\u200C\u200D]+" 1
+               'arabic-shape-gstring)))
 
 (provide 'misc-lang)
 
diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el
index b91a815..640febd 100644
--- a/lisp/mail/rmailedit.el
+++ b/lisp/mail/rmailedit.el
@@ -312,26 +312,34 @@ This function runs the hooks `text-mode-hook' and 
`rmail-edit-mode-hook'.
             (data-buffer (current-buffer))
             (start (copy-marker (point) nil)) ; new body will be between
             (end (copy-marker (point) t)))    ; these two markers
-        (with-current-buffer rmail-view-buffer
-          (encode-coding-region headers-end (point-max) coding-system
-                                data-buffer))
-        (delete-region end (point-max))
+        (if mime-state
+            ;; Message is already in encoded state
+            (insert-buffer-substring rmail-view-buffer headers-end
+                                     (with-current-buffer rmail-view-buffer
+                                       (point-max)))
+          (with-current-buffer rmail-view-buffer
+            (encode-coding-region headers-end (point-max) coding-system
+                                  data-buffer)))
        ;; Apply to the mbox buffer any changes in header fields
        ;; that the user made while editing in the view buffer.
-       (rmail-edit-update-headers (rmail-edit-diff-headers
+        (rmail-edit-update-headers (rmail-edit-diff-headers
                                    rmail-old-headers new-headers))
        ;; Re-apply content-transfer-encoding, if any, on the message body.
        (cond
+        (mime-state)               ; if set, already transfer-encoded
         ((string= character-coding "quoted-printable")
-         (mail-quote-printable-region start (point-max)))
+         (mail-quote-printable-region start end))
         ((and (string= character-coding "base64") is-text-message)
-         (base64-encode-region start (point-max)))
+         (base64-encode-region start end))
         ((and (eq character-coding 'uuencode) is-text-message)
          (error "uuencoded messages are not supported")))
         ;; After encoding, make sure buffer ends with a blank line so as not to
         ;; run this message together with the following one.
-        (goto-char (point-max))
-        (rmail-ensure-blank-line))
+        (goto-char end)
+        (rmail-ensure-blank-line)
+        ;; Delete previous body.  This must be after all insertions at the end,
+        ;; so the marker for the beginning of the next message isn't messed up.
+        (delete-region end (point-max)))
       (rmail-set-attribute rmail-edited-attr-index t))
 ;;;??? BROKEN perhaps.
 ;;;    (if (boundp 'rmail-summary-vector)
diff --git a/lisp/net/newst-ticker.el b/lisp/net/newst-ticker.el
index 913b89b..eb6ff19 100644
--- a/lisp/net/newst-ticker.el
+++ b/lisp/net/newst-ticker.el
@@ -118,7 +118,7 @@ been added between the last two retrievals."
 
 (defcustom newsticker-hide-obsolete-items-in-echo-area
   t
-  "Decides whether to show obsolete items items in the ticker.
+  "Decides whether to show obsolete items in the ticker.
 If t the echo area will not show obsolete items.  See also
 `newsticker-hide-old-items-in-echo-area'."
   :type 'boolean
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 5268e80..e75efcf 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -549,11 +549,12 @@ Emacs dired can't find files."
       (let ((par (expand-file-name ".." dir)))
        (unless (file-directory-p par)
          (make-directory par parents))))
-    (tramp-adb-barf-unless-okay
-     v (format "mkdir %s" (tramp-shell-quote-argument localname))
-     "Couldn't make directory %s" dir)
     (tramp-flush-file-property v (file-name-directory localname))
-    (tramp-flush-directory-property v localname)))
+    (tramp-flush-directory-property v localname)
+    (unless (or (tramp-adb-send-command-and-check
+                v (format "mkdir %s" (tramp-shell-quote-argument localname)))
+               (and parents (file-directory-p dir)))
+      (tramp-error v 'file-error "Couldn't make directory %s" dir))))
 
 (defun tramp-adb-handle-delete-directory (directory &optional recursive _trash)
   "Like `delete-directory' for Tramp files."
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 237d689..2b29a1b 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -416,6 +416,19 @@ Every entry is a list (NAME ADDRESS).")
 (defconst tramp-hal-interface-device "org.freedesktop.Hal.Device"
   "The device interface of the HAL daemon.")
 
+;; "gvfs-<command>" utilities have been deprecated in GVFS 1.31.1.  We
+;; must use "gio <command>" tool instead.
+(defconst tramp-gvfs-gio-mapping
+  '(("gvfs-copy" . "copy")
+    ("gvfs-info" . "info")
+    ("gvfs-ls" . "list")
+    ("gvfs-mkdir" . "mkdir")
+    ("gvfs-monitor-file" . "monitor")
+    ("gvfs-move" . "move")
+    ("gvfs-rm" . "remove")
+    ("gvfs-trash" . "trash"))
+  "List of cons cells, mapping \"gvfs-<command>\" to \"gio <command>\".")
+
 (defconst tramp-gvfs-file-attributes
   '("name"
     "type"
@@ -1078,9 +1091,12 @@ If FILE-SYSTEM is non-nil, return file system 
attributes."
             ((memq 'change flags)
              '(created changed changes-done-hint moved deleted))
             ((memq 'attribute-change flags) '(attribute-changed))))
-          (p (start-process
-              "gvfs-monitor-file" (generate-new-buffer " *gvfs-monitor-file*")
-              "gvfs-monitor-file" (tramp-gvfs-url-file-name file-name))))
+          (p (apply
+              'start-process
+              "gvfs-monitor" (generate-new-buffer " *gvfs-monitor*")
+              (if (tramp-gvfs-gio-tool-p v)
+                  `("gio" "monitor" ,(tramp-gvfs-url-file-name file-name)))
+              `("gvfs-monitor-file" (tramp-gvfs-url-file-name file-name)))))
       (if (not (processp p))
          (tramp-error
           v 'file-notify-error "Monitoring not supported for `%s'" file-name)
@@ -1190,8 +1206,9 @@ file-notify events."
        (when (and parents (not (file-directory-p ldir)))
          (make-directory ldir parents))
        ;; Just do it.
-       (unless (tramp-gvfs-send-command
-                v "gvfs-mkdir" (tramp-gvfs-url-file-name dir))
+       (unless (or (tramp-gvfs-send-command
+                    v "gvfs-mkdir" (tramp-gvfs-url-file-name dir))
+                   (and parents (file-directory-p dir)))
          (tramp-error v 'file-error "Couldn't make directory %s" dir))))))
 
 (defun tramp-gvfs-handle-rename-file
@@ -1785,10 +1802,16 @@ connection if a previous connection has died for some 
reason."
       (tramp-gvfs-get-remote-uid vec 'string)
       (tramp-gvfs-get-remote-gid vec 'string))))
 
+(defun tramp-gvfs-gio-tool-p (vec)
+  "Check, whether the gio tool is available."
+  (with-tramp-connection-property vec "gio-tool"
+    (zerop (tramp-call-process vec "gio" nil nil nil "version"))))
+
 (defun tramp-gvfs-send-command (vec command &rest args)
   "Send the COMMAND with its ARGS to connection VEC.
-COMMAND is usually a command from the gvfs-* utilities.
-`call-process' is applied, and it returns t if the return code is zero."
+COMMAND is a command from the gvfs-* utilities.  It is replaced
+by the corresponding gio tool call if available.  `call-process'
+is applied, and it returns t if the return code is zero."
   (let* ((locale (tramp-get-local-locale vec))
         (process-environment
          (append
@@ -1796,6 +1819,11 @@ COMMAND is usually a command from the gvfs-* utilities.
             ,(format "LANGUAGE=%s" locale)
             ,(format "LC_ALL=%s" locale))
           process-environment)))
+    (when (tramp-gvfs-gio-tool-p vec)
+      ;; Use gio tool.
+      (setq args (cons (cdr (assoc command tramp-gvfs-gio-mapping)) args)
+           command "gio"))
+
     (with-current-buffer (tramp-get-connection-buffer vec)
       (tramp-gvfs-maybe-open-connection vec)
       (erase-buffer)
diff --git a/lisp/obsolete/landmark.el b/lisp/obsolete/landmark.el
index 99fd551..7795279 100644
--- a/lisp/obsolete/landmark.el
+++ b/lisp/obsolete/landmark.el
@@ -260,7 +260,7 @@ is non-nil.  One interesting value is `turn-on-font-lock'."
   "Vector recording the actual score of the free squares.")
 
 
-;; The key point point about the algorithm is that, rather than considering
+;; The key point about the algorithm is that, rather than considering
 ;; the board as just a set of squares, we prefer to see it as a "space" of
 ;; internested 5-tuples of contiguous squares (called qtuples).
 ;;
diff --git a/lisp/obsolete/levents.el b/lisp/obsolete/levents.el
index 24de489..b9b1535 100644
--- a/lisp/obsolete/levents.el
+++ b/lisp/obsolete/levents.el
@@ -113,7 +113,7 @@ In actual Lucid Emacs, you MUST NOT use this event object 
after
 calling this function with it.  You will lose.  It is not necessary to
 call this function, as event objects are garbage- collected like all
 other objects; however, it may be more efficient to explicitly
-deallocate events when you are sure that that is safe.
+deallocate events when you are sure that this is safe.
 
 This emulation does not actually deallocate or reuse events
 except via garbage collection and `cons'."
diff --git a/lisp/obsolete/otodo-mode.el b/lisp/obsolete/otodo-mode.el
index c7a05ad..dd25e33 100644
--- a/lisp/obsolete/otodo-mode.el
+++ b/lisp/obsolete/otodo-mode.el
@@ -164,7 +164,7 @@
 ;;      might be nicer and to that effect a function has been declared
 ;;      further down in the code.  You may wish to auto-load this.
 ;;
-;;      Carsten also writes that that *changing* the prefix after the
+;;      Carsten also writes that *changing* the prefix after the
 ;;      todo list is already established is not as simple as changing
 ;;      the variable - the todo files have to be changed by hand.
 ;;
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el
index 53538e6..eab9f3e 100644
--- a/lisp/org/org-faces.el
+++ b/lisp/org/org-faces.el
@@ -291,7 +291,7 @@ determines if it is a foreground or a background color."
 (defcustom org-priority-faces nil
   "Faces for specific Priorities.
 This is a list of cons cells, with priority character in the car
-and faces in the cdr.  The face can be a symbol, a color as
+and faces in the cdr.  The face can be a symbol, a color
 as a string, or a property list of attributes, like
     (:foreground \"blue\" :weight bold :underline t).
 If it is a color string, the variable `org-faces-easy-properties'
diff --git a/lisp/org/org-inlinetask.el b/lisp/org/org-inlinetask.el
index 360b1bc..4a8e43d 100644
--- a/lisp/org/org-inlinetask.el
+++ b/lisp/org/org-inlinetask.el
@@ -114,7 +114,7 @@ When nil, the first star is not shown."
 (defcustom org-inlinetask-default-state nil
   "Non-nil means make inline tasks have a TODO keyword initially.
 This should be the state `org-inlinetask-insert-task' should use by
-default, or nil of no state should be assigned."
+default, or nil if no state should be assigned."
   :group 'org-inlinetask
   :version "24.1"
   :type '(choice
diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el
index 7c31845..2f5f36e 100644
--- a/lisp/play/gomoku.el
+++ b/lisp/play/gomoku.el
@@ -263,7 +263,7 @@ Other useful commands:\n
   "Vector recording the actual score of the free squares.")
 
 
-;; The key point point about the algorithm is that, rather than considering
+;; The key point about the algorithm is that, rather than considering
 ;; the board as just a set of squares, we prefer to see it as a "space" of
 ;; internested 5-tuples of contiguous squares (called qtuples).
 ;;
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index f84d94a..82ae181 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -619,7 +619,7 @@ COUNT starts with 1.  GEN-SEP is used to separate long 
variable values."
   '((java-mode ("%sTokenTypes.java") ("%s.java"))
     (c++-mode ("%sTokenTypes.hpp") ("%s.cpp" "%s.hpp")))
   "Language dependent formats which specify generated files.
-Each element in this list looks looks like
+Each element in this list looks like
   (MAJOR-MODE (VOCAB-FILE-FORMAT...) (CLASS-FILE-FORMAT...)).
 
 The element whose MAJOR-MODE is equal to `antlr-language' is used to
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 6818b5e..df202e9 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -167,7 +167,7 @@ use c-constant-symbol instead."
 (defmacro defcustom-c-stylevar (name val doc &rest args)
   "Define a style variable NAME with VAL and DOC.
 More precisely, convert the given `:type FOO', mined out of ARGS,
-to an aggregate `:type (radio STYLE (PREAMBLE FOO))', append some
+to an aggregate `:type (radio STYLE (PREAMBLE FOO))', append
 some boilerplate documentation to DOC, arrange for the fallback
 value of NAME to be VAL, and call `custom-declare-variable' to
 do the rest of the work.
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index e956637..1681922 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -480,7 +480,7 @@ Font for POD headers."
 (defcustom cperl-highlight-variables-indiscriminately nil
   "Non-nil means perform additional highlighting on variables.
 Currently only changes how scalar variables are highlighted.
-Note that that variable is only read at initialization time for
+Note that the variable is only read at initialization time for
 the variable `cperl-font-lock-keywords-2', so changing it after you've
 entered CPerl mode the first time will have no effect."
   :type 'boolean
diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el
index 52cb198..ab60855 100644
--- a/lisp/progmodes/flymake-proc.el
+++ b/lisp/progmodes/flymake-proc.el
@@ -626,7 +626,7 @@ Create parent directories as needed."
   "Tell Flymake UI about a fatal PROBLEM with this backend.
 May only be called in a dynamic environment where
 `flymake-proc--report-fn' is bound."
-  (flymake-log 0 "%s: %s" problem explanation)
+  (flymake-log 1 "%s: %s" problem explanation)
   (if (and (boundp 'flymake-proc--report-fn)
            flymake-proc--report-fn)
       (funcall flymake-proc--report-fn :panic
@@ -766,7 +766,7 @@ can also be executed interactively independently of
           (unwind-protect
               (cond
                ((not cmd-and-args)
-                (flymake-log 0 "init function %s for %s failed, cleaning up"
+                (flymake-log 1 "init function %s for %s failed, cleaning up"
                              init-f buffer-file-name))
                (t
                 (setq proc
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 45f0adf..e4c6a38 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -123,10 +123,14 @@ If nil, never start checking buffer automatically like 
this."
 (make-obsolete-variable 'flymake-gui-warnings-enabled
                        "it no longer has any effect." "26.1")
 
-(defcustom flymake-start-syntax-check-on-find-file t
-  "Start syntax check on find file."
+(defcustom flymake-start-on-flymake-mode t
+  "Start syntax check when `flymake-mode'is enabled.
+Specifically, start it when the buffer is actually displayed."
   :type 'boolean)
 
+(define-obsolete-variable-alias 'flymake-start-syntax-check-on-find-file
+  'flymake-start-on-flymake-mode "26.1")
+
 (defcustom flymake-log-level -1
   "Obsolete and ignored variable."
   :type 'integer)
@@ -138,24 +142,25 @@ If nil, never start checking buffer automatically like 
this."
   "If non-nil, moving to errors wraps around buffer boundaries."
   :type 'boolean)
 
-(define-fringe-bitmap 'flymake-double-exclamation-mark
-  (vector #b00000000
-          #b00000000
-          #b00000000
-          #b00000000
-          #b01100110
-          #b01100110
-          #b01100110
-          #b01100110
-          #b01100110
-          #b01100110
-          #b01100110
-          #b01100110
-          #b00000000
-          #b01100110
-          #b00000000
-          #b00000000
-          #b00000000))
+(when (fboundp 'define-fringe-bitmap)
+  (define-fringe-bitmap 'flymake-double-exclamation-mark
+    (vector #b00000000
+            #b00000000
+            #b00000000
+            #b00000000
+            #b01100110
+            #b01100110
+            #b01100110
+            #b01100110
+            #b01100110
+            #b01100110
+            #b01100110
+            #b01100110
+            #b00000000
+            #b01100110
+            #b00000000
+            #b00000000
+            #b00000000)))
 
 (defvar-local flymake-timer nil
   "Timer for starting syntax check.")
@@ -318,12 +323,12 @@ region is invalid."
 (defvar flymake-diagnostic-functions nil
   "Special hook of Flymake backends that check a buffer.
 
-The functions in this hook diagnose problems in a buffer’s
+The functions in this hook diagnose problems in a buffer's
 contents and provide information to the Flymake user interface
 about where and how to annotate problems diagnosed in a buffer.
 
-Whenever Flymake or the user decides to re-check the buffer, each
-function is called with an arbitrary number of arguments:
+Each backend function must be prepared to accept an arbitrary
+number of arguments:
 
 * the first argument is always REPORT-FN, a callback function
   detailed below;
@@ -333,11 +338,12 @@ function is called with an arbitrary number of arguments:
   no such arguments, but backend functions must be prepared to
   accept and possibly ignore any number of them.
 
-Backend functions are expected to initiate the buffer check, but
-aren't required to complete it check before exiting: if the
-computation involved is expensive, especially for large buffers,
-that task can be scheduled for the future using asynchronous
-processes or other asynchronous mechanisms.
+Whenever Flymake or the user decides to re-check the buffer,
+backend functions are called as detailed above and are expected
+to initiate this check, but aren't required to complete it before
+exiting: if the computation involved is expensive, especially for
+large buffers, that task can be scheduled for the future using
+asynchronous processes or other asynchronous mechanisms.
 
 In any case, backend functions are expected to return quickly or
 signal an error, in which case the backend is disabled.  Flymake
@@ -371,10 +377,10 @@ Currently accepted values for REPORT-ACTION are:
 
 Currently accepted REPORT-KEY arguments are:
 
-* ‘:explanation’: value should give user-readable details of
+* `:explanation' value should give user-readable details of
   the situation encountered, if any.
 
-* ‘:force’: value should be a boolean suggesting that Flymake
+* `:force': value should be a boolean suggesting that Flymake
   consider the report even if it was somehow unexpected.")
 
 (defvar flymake-diagnostic-types-alist
@@ -403,12 +409,12 @@ properties are:
 
 * `severity', a non-negative integer specifying the diagnostic's
   severity.  The higher, the more serious.  If the overlay
-  priority `priority' is not specified, `severity' is used to set
+  property `priority' is not specified, `severity' is used to set
   it and help sort overlapping overlays.
 
 * `flymake-category', a symbol whose property list is considered
-  as a default for missing values of any other properties.  This
-  is useful to backend authors when creating new diagnostic types
+  a default for missing values of any other properties.  This is
+  useful to backend authors when creating new diagnostic types
   that differ from an existing type by only a few properties.")
 
 (put 'flymake-error 'face 'flymake-error)
@@ -493,8 +499,7 @@ associated `flymake-category' return DEFAULT."
         (lambda (_window _ov pos)
           (mapconcat
            (lambda (ov)
-             (let ((diag (overlay-get ov 'flymake--diagnostic)))
-               (flymake--diag-text diag)))
+             (overlay-get ov 'flymake-text))
            (flymake--overlays :beg pos)
            "\n")))
       (default-maybe 'severity (warning-numeric-level :error))
@@ -503,6 +508,7 @@ associated `flymake-category' return DEFAULT."
     ;;
     (overlay-put ov 'evaporate t)
     (overlay-put ov 'flymake t)
+    (overlay-put ov 'flymake-text (flymake--diag-text diagnostic))
     (overlay-put ov 'flymake--diagnostic diagnostic)))
 
 ;; Nothing in Flymake uses this at all any more, so this is just for
@@ -605,7 +611,12 @@ not expected."
             (flymake-log :debug "backend %s reported %d diagnostics in %.2f 
second(s)"
                          backend
                          (length new-diags)
-                         (- (float-time) flymake-check-start-time)))))))))
+                         (- (float-time) flymake-check-start-time)))
+          (when (and (get-buffer (flymake--diagnostics-buffer-name))
+                     (get-buffer-window (flymake--diagnostics-buffer-name))
+                     (null (cl-set-difference (flymake-running-backends)
+                                              (flymake-reporting-backends))))
+            (flymake-show-diagnostics-buffer))))))))
 
 (defun flymake-make-report-fn (backend &optional token)
   "Make a suitable anonymous report function for BACKEND.
@@ -618,24 +629,42 @@ different runs of the same backend."
         (with-current-buffer buffer
           (apply #'flymake--handle-report backend token args))))))
 
-(defun flymake--collect (fn)
+(defun flymake--collect (fn &optional message-prefix)
+  "Collect Flymake backends matching FN.
+If MESSAGE-PREFIX, echo a message using that prefix"
+  (unless flymake--backend-state
+    (user-error "Flymake is not initialized"))
   (let (retval)
     (maphash (lambda (backend state)
                (when (funcall fn state) (push backend retval)))
              flymake--backend-state)
+    (when message-prefix
+      (message "%s%s"
+               message-prefix
+               (mapconcat (lambda (s) (format "%s" s))
+                          retval ", ")))
     retval))
 
 (defun flymake-running-backends ()
   "Compute running Flymake backends in current buffer."
-  (flymake--collect #'flymake--backend-state-running))
+  (interactive)
+  (flymake--collect #'flymake--backend-state-running
+                    (and (called-interactively-p 'interactive)
+                         "Running backends: ")))
 
 (defun flymake-disabled-backends ()
   "Compute disabled Flymake backends in current buffer."
-  (flymake--collect #'flymake--backend-state-disabled))
+  (interactive)
+  (flymake--collect #'flymake--backend-state-disabled
+                    (and (called-interactively-p 'interactive)
+                         "Disabled backends: ")))
 
 (defun flymake-reporting-backends ()
   "Compute reporting Flymake backends in current buffer."
-  (flymake--collect #'flymake--backend-state-reported-p))
+  (interactive)
+  (flymake--collect #'flymake--backend-state-reported-p
+                    (and (called-interactively-p 'interactive)
+                         "Reporting backends: ")))
 
 (defun flymake--disable-backend (backend &optional explanation)
   "Disable BACKEND because EXPLANATION.
@@ -670,41 +699,101 @@ If it is running also stop it."
        (flymake--disable-backend backend err)))))
 
 (defun flymake-start (&optional deferred force)
-  "Start a syntax check.
-Start it immediately, or after current command if DEFERRED is
-non-nil.  With optional FORCE run even disabled backends.
+  "Start a syntax check for the current buffer.
+DEFERRED is a list of symbols designating conditions to wait for
+before actually starting the check.  If it is nil (the list is
+empty), start it immediately, else defer the check to when those
+conditions are met.  Currently recognized conditions are
+`post-command', for waiting until the current command is over,
+`on-display', for waiting until the buffer is actually displayed
+in a window.  If DEFERRED is t, wait for all known conditions.
+
+With optional FORCE run even disabled backends.
 
 Interactively, with a prefix arg, FORCE is t."
   (interactive (list nil current-prefix-arg))
-  (cl-labels
-      ((start
-        ()
-        (remove-hook 'post-command-hook #'start 'local)
-        (setq flymake-check-start-time (float-time))
-        (run-hook-wrapped
-         'flymake-diagnostic-functions
-         (lambda (backend)
-           (cond
-            ((and (not force)
-                  (flymake--with-backend-state backend state
-                    (flymake--backend-state-disabled state)))
-             (flymake-log :debug "Backend %s is disabled, not starting"
-                          backend))
+  (let ((deferred (if (eq t deferred)
+                      '(post-command on-display)
+                    deferred))
+        (buffer (current-buffer)))
+    (cl-labels
+        ((start-post-command
+          ()
+          (remove-hook 'post-command-hook #'start-post-command
+                       nil)
+          (with-current-buffer buffer
+            (flymake-start (remove 'post-command deferred) force)))
+         (start-on-display
+          ()
+          (remove-hook 'window-configuration-change-hook #'start-on-display
+                       'local)
+          (flymake-start (remove 'on-display deferred) force)))
+      (cond ((and (memq 'post-command deferred)
+                  this-command)
+             (add-hook 'post-command-hook
+                       #'start-post-command
+                       'append nil))
+            ((and (memq 'on-display deferred)
+                  (not (get-buffer-window (current-buffer))))
+             (add-hook 'window-configuration-change-hook
+                       #'start-on-display
+                       'append 'local))
             (t
-             (flymake--run-backend backend)))
-           nil))))
-    (if (and deferred
-             this-command)
-        (add-hook 'post-command-hook #'start 'append 'local)
-      (start))))
+             (setq flymake-check-start-time (float-time))
+             (run-hook-wrapped
+              'flymake-diagnostic-functions
+              (lambda (backend)
+                (cond
+                 ((and (not force)
+                       (flymake--with-backend-state backend state
+                         (flymake--backend-state-disabled state)))
+                  (flymake-log :debug "Backend %s is disabled, not starting"
+                               backend))
+                 (t
+                  (flymake--run-backend backend)))
+                nil)))))))
 
 (defvar flymake-mode-map
   (let ((map (make-sparse-keymap))) map)
   "Keymap for `flymake-mode'")
 
 ;;;###autoload
-(define-minor-mode flymake-mode nil
-  :group 'flymake :lighter flymake--mode-line-format :keymap flymake-mode-map
+(define-minor-mode flymake-mode
+  "Toggle Flymake mode on or off.
+With a prefix argument ARG, enable Flymake mode if ARG is
+positive, and disable it otherwise.  If called from Lisp, enable
+the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'.
+
+Flymake is an Emacs minor mode for on-the-fly syntax checking.
+Flymake collects diagnostic information from multiple sources,
+called backends, and visually annotates the buffer with the
+results.
+
+Flymake performs these checks while the user is editing.  The
+customization variables `flymake-start-on-flymake-mode',
+`flymake-no-changes-timeout' and
+`flymake-start-syntax-check-on-newline' determine the exact
+circumstances whereupon Flymake decides to initiate a check of
+the buffer.
+
+The commands `flymake-goto-next-error' and
+`flymake-goto-prev-error' can be used to navigate among Flymake
+diagnostics annotated in the buffer.
+
+The visual appearance of each type of diagnostic can be changed
+in the variable `flymake-diagnostic-types-alist'.
+
+Activation or deactivation of backends used by Flymake in each
+buffer happens via the special hook
+`flymake-diagnostic-functions'.
+
+Some backends may take longer than others to respond or complete,
+and some may decide to disable themselves if they are not
+suitable for the current buffer. The commands
+`flymake-running-backends', `flymake-disabled-backends' and
+`flymake-reporting-backends' summarize the situation, as does the
+special *Flymake log* buffer."  :group 'flymake :lighter
+  flymake--mode-line-format :keymap flymake-mode-map
   (cond
    ;; Turning the mode ON.
    (flymake-mode
@@ -714,8 +803,7 @@ Interactively, with a prefix arg, FORCE is t."
 
     (setq flymake--backend-state (make-hash-table))
 
-    (when flymake-start-syntax-check-on-find-file
-      (flymake-start)))
+    (when flymake-start-on-flymake-mode (flymake-start t)))
 
    ;; Turning the mode OFF.
    (t
@@ -748,7 +836,7 @@ Do it only if `flymake-no-changes-timeout' is non-nil."
              (flymake-log
                :debug "starting syntax check after idle for %s seconds"
                flymake-no-changes-timeout)
-             (flymake-start))
+             (flymake-start t))
             (setq flymake-timer nil))))
       (current-buffer)))))
 
@@ -770,13 +858,13 @@ Do it only if `flymake-no-changes-timeout' is non-nil."
   (let((new-text (buffer-substring start stop)))
     (when (and flymake-start-syntax-check-on-newline (equal new-text "\n"))
       (flymake-log :debug "starting syntax check as new-line has been seen")
-      (flymake-start 'deferred))
+      (flymake-start t))
     (flymake--schedule-timer-maybe)))
 
 (defun flymake-after-save-hook ()
   (when flymake-mode
     (flymake-log :debug "starting syntax check as buffer was saved")
-    (flymake-start)))
+    (flymake-start t)))
 
 (defun flymake-kill-buffer-hook ()
   (when flymake-timer
@@ -792,10 +880,10 @@ Do it only if `flymake-no-changes-timeout' is non-nil."
 (defun flymake-goto-next-error (&optional n filter interactive)
   "Go to Nth next Flymake error in buffer matching FILTER.
 Interactively, always move to the next error.  With a prefix arg,
-skip any diagnostics with a severity less than ‘:warning’.
+skip any diagnostics with a severity less than `:warning'.
 
-If ‘flymake-wrap-around’ is non-nil and no more next errors,
-resumes search from top
+If `flymake-wrap-around' is non-nil and no more next errors,
+resumes search from top.
 
 FILTER is a list of diagnostic types found in
 `flymake-diagnostic-types-alist', or nil, if no filter is to be
@@ -835,6 +923,7 @@ applied."
            (goto-char (overlay-start target))
            (when interactive
              (message
+              "%s"
               (funcall (overlay-get target 'help-echo)
                        nil nil (point)))))
           (interactive
@@ -846,9 +935,9 @@ applied."
 (defun flymake-goto-prev-error (&optional n filter interactive)
   "Go to Nth previous Flymake error in buffer matching FILTER.
 Interactively, always move to the previous error.  With a prefix
-arg, skip any diagnostics with a severity less than ‘:warning’.
+arg, skip any diagnostics with a severity less than `:warning'.
 
-If ‘flymake-wrap-around’ is non-nil and no more previous errors,
+If `flymake-wrap-around' is non-nil and no more previous errors,
 resumes search from bottom.
 
 FILTER is a list of diagnostic types found in
@@ -868,6 +957,7 @@ applied."
     [ "Go to previous error"  flymake-goto-prev-error t ]
     [ "Check now"             flymake-start t ]
     [ "Go to log buffer"      flymake-switch-to-log-buffer t ]
+    [ "Show error buffer"     flymake-show-diagnostics-buffer t ]
     "--"
     [ "Turn off Flymake"      flymake-mode t ]))
 
@@ -897,11 +987,16 @@ applied."
                    ,(concat (format "%s known backends\n" (length known))
                             (format "%s running\n" (length running))
                             (format "%s disabled\n" (length disabled))
-                            "mouse-1: go to log buffer ")
+                            "mouse-1: Display minor mode menu\n"
+                            "mouse-2: Show help for minor mode")
                    keymap
                    ,(let ((map (make-sparse-keymap)))
                       (define-key map [mode-line down-mouse-1]
                         flymake-menu)
+                      (define-key map [mode-line mouse-2]
+                        (lambda ()
+                          (interactive)
+                          (describe-function 'flymake-mode)))
                       map))
       ,@(pcase-let ((`(,ind ,face ,explain)
                      (cond ((null known)
@@ -952,13 +1047,15 @@ applied."
                      ,(let ((map (make-sparse-keymap))
                             (type type))
                         (define-key map [mode-line mouse-4]
-                          (lambda (_event)
+                          (lambda (event)
                             (interactive "e")
-                            (flymake-goto-prev-error 1 (list type) t)))
+                            (with-selected-window (posn-window (event-start 
event))
+                              (flymake-goto-prev-error 1 (list type) t))))
                         (define-key map [mode-line mouse-5]
-                          (lambda (_event)
+                          (lambda (event)
                             (interactive "e")
-                            (flymake-goto-next-error 1 (list type) t)))
+                            (with-selected-window (posn-window (event-start 
event))
+                              (flymake-goto-next-error 1 (list type) t))))
                         map)
                      help-echo
                      ,(concat (format "%s diagnostics of type %s\n"
@@ -976,6 +1073,102 @@ applied."
                         '(:propertize " "))
              (:propertize "]")))))))
 
+;;; Diagnostics buffer
+
+(defvar-local flymake--diagnostics-buffer-source nil)
+
+(defvar flymake-diagnostics-buffer-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map (kbd "RET") 'flymake-goto-diagnostic)
+    (define-key map (kbd "SPC") 'flymake-show-diagnostic)
+    map))
+
+(defun flymake-show-diagnostic (pos &optional other-window)
+  "Show location of diagnostic at POS."
+  (interactive (list (point) t))
+  (let* ((id (or (tabulated-list-get-id pos)
+                 (user-error "Nothing at point")))
+         (overlay (plist-get id :overlay)))
+    (with-current-buffer (overlay-buffer overlay)
+      (with-selected-window
+          (display-buffer (current-buffer) other-window)
+        (goto-char (overlay-start overlay))
+        (pulse-momentary-highlight-region (overlay-start overlay)
+                                          (overlay-end overlay)
+                                          'highlight))
+      (current-buffer))))
+
+(defun flymake-goto-diagnostic (pos)
+  "Show location of diagnostic at POS.
+POS can be a buffer position or a button"
+  (interactive "d")
+  (pop-to-buffer
+   (flymake-show-diagnostic (if (button-type pos) (button-start pos) pos))))
+
+(defun flymake--diagnostics-buffer-entries ()
+  (with-current-buffer flymake--diagnostics-buffer-source
+    (cl-loop for ov in (flymake--overlays)
+             for diag = (overlay-get ov
+                                     'flymake--diagnostic)
+             for (line . col) =
+             (save-excursion
+               (goto-char (overlay-start ov))
+               (cons (line-number-at-pos)
+                     (- (point)
+                        (line-beginning-position))))
+             for type = (flymake--diag-type diag)
+             collect
+             (list (list :overlay ov
+                         :line line
+                         :severity (flymake--lookup-type-property
+                                    type
+                                    'severity (warning-numeric-level :error)))
+                   `[,(format "%s" line)
+                     ,(format "%s" col)
+                     ,(propertize (format "%s" type)
+                                  'face (flymake--lookup-type-property
+                                         type 'mode-line-face 'flymake-error))
+                     (,(format "%s" (flymake--diag-text diag))
+                      mouse-face highlight
+                      help-echo "mouse-2: visit this diagnostic"
+                      face nil
+                      action flymake-goto-diagnostic
+                      mouse-action flymake-goto-diagnostic)]))))
+
+(define-derived-mode flymake-diagnostics-buffer-mode tabulated-list-mode
+  "Flymake diagnostics"
+  "A mode for listing Flymake diagnostics."
+  (setq tabulated-list-format
+        `[("Line" 5 (lambda (l1 l2)
+                      (< (plist-get (car l1) :line)
+                         (plist-get (car l2) :line)))
+           :right-align t)
+          ("Col" 3 nil :right-align t)
+          ("Type" 8 (lambda (l1 l2)
+                      (< (plist-get (car l1) :severity)
+                         (plist-get (car l2) :severity))))
+          ("Message" 0 t)])
+  (setq tabulated-list-entries
+        'flymake--diagnostics-buffer-entries)
+  (tabulated-list-init-header))
+
+(defun flymake--diagnostics-buffer-name ()
+  (format "*Flymake diagnostics for %s*" (current-buffer)))
+
+(defun flymake-show-diagnostics-buffer ()
+  "Show a list of Flymake diagnostics for current buffer."
+  (interactive)
+  (let* ((name (flymake--diagnostics-buffer-name))
+         (source (current-buffer))
+         (target (or (get-buffer name)
+                     (with-current-buffer (get-buffer-create name)
+                       (flymake-diagnostics-buffer-mode)
+                       (setq flymake--diagnostics-buffer-source source)
+                       (current-buffer)))))
+    (with-current-buffer target
+      (revert-buffer)
+      (display-buffer (current-buffer)))))
+
 (provide 'flymake)
 
 (require 'flymake-proc)
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 01bdb04..d0404fd 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -903,7 +903,8 @@ substitution string.  Note dynamic scoping of variables.")
   (read-regexp "Search for" 'grep-tag-default 'grep-regexp-history))
 
 (defun grep-read-files (regexp)
-  "Read files arg for interactive grep."
+  "Read a file-name pattern arg for interactive grep.
+The pattern can include shell wildcards."
   (let* ((bn (or (buffer-file-name)
                 (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name))))
         (fn (and bn
@@ -936,7 +937,7 @@ substitution string.  Note dynamic scoping of variables.")
               (car (car grep-files-aliases))))
         (files (completing-read
                 (concat "Search for \"" regexp
-                        "\" in files"
+                        "\" in files matching wildcard"
                         (if default (concat " (default " default ")"))
                         ": ")
                 'read-file-name-internal
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 9aa5134..f79d9a4 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -640,10 +640,14 @@ The type returned can be `comment', `string' or `paren'."
    ((python-rx string-delimiter)
     (0 (ignore (python-syntax-stringify))))))
 
-(defconst python--prettify-symbols-alist
+(defvar python-prettify-symbols-alist
   '(("lambda"  . ?λ)
     ("and" . ?∧)
-    ("or" . ?∨)))
+    ("or" . ?∨))
+  "Value for `prettify-symbols-alist' in `python-mode'.")
+
+(define-obsolete-variable-alias 'python--prettify-symbols-alist
+  'python-prettify-symbols-alist "26.1")
 
 (defsubst python-syntax-count-quotes (quote-char &optional point limit)
   "Count number of quotes around point (max is 3).
diff --git a/lisp/subr.el b/lisp/subr.el
index c1eae8d..a6c998e 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -110,8 +110,7 @@ BODY should be a list of Lisp expressions.
 
 \(fn ARGS [DOCSTRING] [INTERACTIVE] BODY)"
   (declare (doc-string 2) (indent defun)
-           (debug (&define lambda-list
-                           [&optional stringp]
+           (debug (&define lambda-list lambda-doc
                            [&optional ("interactive" interactive)]
                            def-body)))
   ;; Note that this definition should not use backquotes; subr.el should not
diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el
index abcd149..1ce8220 100644
--- a/lisp/term/tvi970.el
+++ b/lisp/term/tvi970.el
@@ -36,7 +36,7 @@
                ;; ("\eOR"      [kp-f3])
                ;; ("\eOS"      [kp-f4])
 
-               ;; These might bre set by terminfo.
+               ;; These might be set by terminfo.
                ("\e[H" [home])
                ("\e[Z" [backtab])
                ("\e[i" [print])
@@ -45,13 +45,13 @@
                ("\e[M" [deleteline])
                ("\e[U" [next]) ;; actually the `page' key
 
-               ;; These won't be set up by either
+               ;; These won't be set up by either.
                ("\eOm" [kp-subtract])
                ("\eOl" [kp-separator])
                ("\eOn" [kp-decimal])
                ("\eOM" [kp-enter])
 
-               ;; These won't be set up by either either
+               ;; These won't be set up by either.
                ("\e[K" [key_eol])      ;; Not an X keysym
                ("\e[J" [key_eos])      ;; Not an X keysym
                ("\e[2J"        [key_clear])    ;; Not an X keysym
diff --git a/lisp/textmodes/less-css-mode.el b/lisp/textmodes/less-css-mode.el
index b665f91..d31414e 100644
--- a/lisp/textmodes/less-css-mode.el
+++ b/lisp/textmodes/less-css-mode.el
@@ -129,7 +129,7 @@ variable in most cases is likely to be via directory local
 variables.
 
 This can be also be set to a full path, or a relative path.  If
-the path is relative, it will be relative to the the current
+the path is relative, it will be relative to the current
 directory by default."
   :type 'file)
 ;;;###autoload
diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el
index 0fb120e..60e9bbb 100644
--- a/lisp/textmodes/picture.el
+++ b/lisp/textmodes/picture.el
@@ -66,7 +66,7 @@
 (defvar picture-desired-column 0
   "Desired current column for Picture mode.
 When a cursor is on a wide-column character (e.g. Chinese,
-Japanese, Korean), this may may be different from `current-column'.")
+Japanese, Korean), this may be different from `current-column'.")
 
 
 (defun picture-update-desired-column (adjust-to-current)
diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el
index 5eb64c8..f1a3004 100644
--- a/lisp/textmodes/rst.el
+++ b/lisp/textmodes/rst.el
@@ -3450,7 +3450,7 @@ applied to each line like this
 COUNT is 0 before the first paragraph and increments for every
 paragraph found on level IND.  IN-FIRST is non-nil if this is the
 first line of such a paragraph.  IN-SUB is non-nil if this line
-is part of a sub-block while IN-SUPER is non-nil of this line is
+is part of a sub-block while IN-SUPER is non-nil if this line is
 part of a less indented block (super-block).  IN-EMPTY is non-nil
 if this line is empty where an empty line is considered being
 part of the previous block.  RELIND is nil for an empty line, 0
diff --git a/lisp/vc/pcvs-defs.el b/lisp/vc/pcvs-defs.el
index 9575b5f..41dc940 100644
--- a/lisp/vc/pcvs-defs.el
+++ b/lisp/vc/pcvs-defs.el
@@ -269,7 +269,7 @@ This variable is buffer local and only used in the *cvs* 
buffer.")
   "Regexp matching the possible names of locks in the CVS repository.")
 
 (defconst cvs-cursor-column 22
-  "Column to position cursor in in `cvs-mode'.")
+  "Column to position cursor in, in `cvs-mode'.")
 
 ;;;;
 ;;;; Global internal variables
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index d268e1a..d704cfa 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -278,6 +278,8 @@ which is the \"1006\" extension implemented in Xterm >= 
277."
                (last-name (symbol-name last-type))
                (last-time (nth 1 last-click))
                (click-count (nth 2 last-click))
+               (last-x (nth 3 last-click))
+               (last-y (nth 4 last-click))
                (this-time (float-time))
                (name (symbol-name type)))
           (cond
@@ -292,12 +294,16 @@ which is the \"1006\" extension implemented in Xterm >= 
277."
                  double-click-time
                  (or (eq double-click-time t)
                      (> double-click-time (* 1000 (- this-time last-time))))
+                 (<= (abs (- x last-x))
+                     (/ double-click-fuzz 8))
+                 (<= (abs (- y last-y))
+                     (/ double-click-fuzz 8))
                  (equal last-name (replace-match "" t t name)))
             (setq click-count (1+ click-count))
             (xterm-mouse--set-click-count event click-count))
            (t (setq click-count 1)))
           (set-terminal-parameter nil 'xterm-mouse-last-click
-                                  (list type this-time click-count)))
+                                  (list type this-time click-count x y)))
 
         (set-terminal-parameter nil 'xterm-mouse-x x)
         (set-terminal-parameter nil 'xterm-mouse-y y)
diff --git a/src/ChangeLog.10 b/src/ChangeLog.10
index 1bd822d..f5eb88b 100644
--- a/src/ChangeLog.10
+++ b/src/ChangeLog.10
@@ -3958,7 +3958,7 @@
 
 2006-05-12  Chong Yidong  <address@hidden>
 
-       * intervals.c (set_point_both): Fix mixup before before and after
+       * intervals.c (set_point_both): Fix mixup before and after
        in variable names.
 
        * editfns.c (Fline_beginning_position): Inhibit point-motion hooks
diff --git a/src/ChangeLog.12 b/src/ChangeLog.12
index 61251bf..2291e85 100644
--- a/src/ChangeLog.12
+++ b/src/ChangeLog.12
@@ -3348,7 +3348,7 @@
        with plain -g rather than with -g3, and they need the duplicate
        definitions for .gdbinit to work; see <https://bugs.gnu.org/12814#26>.
        * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
-       Define as macros, as well as as enums or as constants.
+       Define as macros, as well as enums or constants.
 
 2012-11-06  Jan Djärv  <address@hidden>
 
diff --git a/src/ChangeLog.4 b/src/ChangeLog.4
index 2935ee5..7086553 100644
--- a/src/ChangeLog.4
+++ b/src/ChangeLog.4
@@ -3381,7 +3381,7 @@
        some external definitions.
        (Ffile_attributes) [MSDOS]: Set execute bits from file name.
        (Ffile_name_all_completions) [FILE_SYSTEM_CASE]: Convert
-       case of file name as as indicated by conditional.
+       case of file name as indicated by conditional.
 
        * emacs.c (main) [MSDOS]: Call init_environment.  Set file types to
        binary for all files.  Call init_dosfns.
diff --git a/src/ChangeLog.5 b/src/ChangeLog.5
index 489ccfa..99d2516 100644
--- a/src/ChangeLog.5
+++ b/src/ChangeLog.5
@@ -1372,7 +1372,7 @@
 1995-04-11  Richard Stallman  <address@hidden>
 
        * keyboard.c (read_char): Rearrange code so that getcjmp is set
-       only around sit_for and kbd_buffer_get_event, and
+       only around sit_for and kbd_buffer_get_event,
        and polling is stopped only around the kbd_buffer_get_event call.
        (Ftrack_mouse, tracking_off, read_char): Don't call prepare_menu_bars.
 
diff --git a/src/ChangeLog.7 b/src/ChangeLog.7
index 32472ac..a1a9fb7 100644
--- a/src/ChangeLog.7
+++ b/src/ChangeLog.7
@@ -3381,7 +3381,7 @@
 1998-02-15  Richard Stallman  <address@hidden>
 
        * minibuf.c (read_minibuf): Do use DEFALT in place of empty input
-       when when expflag is nonzero.
+       when expflag is nonzero.
        (Fread_no_blanks_input): Arg INIT renamed to INITIAL.
 
 1998-02-14  Richard Stallman  <address@hidden>
diff --git a/src/buffer.c b/src/buffer.c
index 76670b8..cc6021b 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -6054,7 +6054,7 @@ and is the visited file's modification time, as of that 
time.  If the
 modification time of the most recent save is different, this entry is
 obsolete.
 
-An entry (t . 0) means means the buffer was previously unmodified but
+An entry (t . 0) means the buffer was previously unmodified but
 its time stamp was unknown because it was not associated with a file.
 An entry (t . -1) is similar, except that it means the buffer's visited
 file did not exist.
diff --git a/src/dispnew.c b/src/dispnew.c
index ad59704..cb32f09 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -66,7 +66,7 @@ struct dim
 
 /* Function prototypes.  */
 
-static void update_frame_line (struct frame *, int);
+static void update_frame_line (struct frame *, int, bool);
 static int required_matrix_height (struct window *);
 static int required_matrix_width (struct window *);
 static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t);
@@ -88,7 +88,7 @@ static void check_matrix_pointers (struct glyph_matrix *,
 static void mirror_line_dance (struct window *, int, int, int *, char *);
 static bool update_window_tree (struct window *, bool);
 static bool update_window (struct window *, bool);
-static bool update_frame_1 (struct frame *, bool, bool, bool);
+static bool update_frame_1 (struct frame *, bool, bool, bool, bool);
 static bool scrolling (struct frame *);
 static void set_window_cursor_after_update (struct window *);
 static void adjust_frame_glyphs_for_window_redisplay (struct frame *);
@@ -3121,7 +3121,7 @@ update_frame (struct frame *f, bool force_p, bool 
inhibit_hairy_id_p)
 
       /* Update the display.  */
       update_begin (f);
-      paused_p = update_frame_1 (f, force_p, inhibit_hairy_id_p, 1);
+      paused_p = update_frame_1 (f, force_p, inhibit_hairy_id_p, 1, false);
       update_end (f);
 
       if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
@@ -3174,7 +3174,7 @@ update_frame_with_menu (struct frame *f, int row, int col)
   cursor_at_point_p = !(row >= 0 && col >= 0);
   /* Force update_frame_1 not to stop due to pending input, and not
      try scrolling.  */
-  paused_p = update_frame_1 (f, 1, 1, cursor_at_point_p);
+  paused_p = update_frame_1 (f, 1, 1, cursor_at_point_p, true);
   /* ROW and COL tell us where in the menu to position the cursor, so
      that screen readers know the active region on the screen.  */
   if (!cursor_at_point_p)
@@ -4474,7 +4474,7 @@ scrolling_window (struct window *w, bool header_line_p)
 
 static bool
 update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p,
-               bool set_cursor_p)
+               bool set_cursor_p, bool updating_menu_p)
 {
   /* Frame matrices to work on.  */
   struct glyph_matrix *current_matrix = f->current_matrix;
@@ -4513,7 +4513,7 @@ update_frame_1 (struct frame *f, bool force_p, bool 
inhibit_id_p,
 
   /* Update the individual lines as needed.  Do bottom line first.  */
   if (MATRIX_ROW_ENABLED_P (desired_matrix, desired_matrix->nrows - 1))
-    update_frame_line (f, desired_matrix->nrows - 1);
+    update_frame_line (f, desired_matrix->nrows - 1, updating_menu_p);
 
   /* Now update the rest of the lines.  */
   for (i = 0; i < desired_matrix->nrows - 1 && (force_p || !input_pending); 
i++)
@@ -4539,7 +4539,7 @@ update_frame_1 (struct frame *f, bool force_p, bool 
inhibit_id_p,
          if (!force_p && (i - 1) % preempt_count == 0)
            detect_input_pending_ignore_squeezables ();
 
-         update_frame_line (f, i);
+         update_frame_line (f, i, updating_menu_p);
        }
     }
 
@@ -4775,7 +4775,7 @@ count_match (struct glyph *str1, struct glyph *end1, 
struct glyph *str2, struct
 /* Perform a frame-based update on line VPOS in frame FRAME.  */
 
 static void
-update_frame_line (struct frame *f, int vpos)
+update_frame_line (struct frame *f, int vpos, bool updating_menu_p)
 {
   struct glyph *obody, *nbody, *op1, *op2, *np1, *nend;
   int tem;
@@ -4814,6 +4814,12 @@ update_frame_line (struct frame *f, int vpos)
   current_row->enabled_p = true;
   current_row->used[TEXT_AREA] = desired_row->used[TEXT_AREA];
 
+  /* For some reason, cursor is sometimes moved behind our back when a
+     frame with a TTY menu is redrawn.  Homing the cursor as below
+     fixes that.  */
+  if (updating_menu_p)
+    cursor_to (f, 0, 0);
+
   /* If desired line is empty, just clear the line.  */
   if (!desired_row->enabled_p)
     {
diff --git a/src/emacs-module.c b/src/emacs-module.c
index e5833a1..6bc91a7 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -983,7 +983,7 @@ value_to_lisp (emacs_value v)
   return o;
 }
 
-/* Attempt to convert O to an emacs_value.  Do not do any checking or
+/* Attempt to convert O to an emacs_value.  Do not do any checking
    or allocate any storage; the caller should prevent or detect
    any resulting bit pattern that is not a valid emacs_value.  */
 static emacs_value
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
index 1a00e0f..4243b3f 100644
--- a/src/emacsgtkfixed.c
+++ b/src/emacsgtkfixed.c
@@ -81,7 +81,7 @@ emacs_fixed_gtk_widget_size_allocate (GtkWidget *widget,
      additional case for an xwidget view.
 
      It would be nicer if the bse class method could be called first,
-     and the the xview modification only would remain here. It wasn't
+     and the xview modification only would remain here. It wasn't
      possible to solve it that way yet.  */
   EmacsFixedClass *klass;
   GtkWidgetClass *parent_class;
diff --git a/src/eval.c b/src/eval.c
index acda64e..52e4c96 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2681,7 +2681,7 @@ call8 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object 
arg2, Lisp_Object arg3,
 }
 
 DEFUN ("functionp", Ffunctionp, Sfunctionp, 1, 1, 0,
-       doc: /* Non-nil if OBJECT is a function.  */)
+       doc: /* Return t if OBJECT is a function.  */)
      (Lisp_Object object)
 {
   if (FUNCTIONP (object))
diff --git a/src/fileio.c b/src/fileio.c
index d460f12..d8ecccd 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -125,7 +125,7 @@ static mode_t auto_save_mode_bits;
 static bool auto_save_error_occurred;
 
 /* If VALID_TIMESTAMP_FILE_SYSTEM, then TIMESTAMP_FILE_SYSTEM is the device
-   number of a file system where time stamps were observed to to work.  */
+   number of a file system where time stamps were observed to work.  */
 static bool valid_timestamp_file_system;
 static dev_t timestamp_file_system;
 
diff --git a/src/frame.h b/src/frame.h
index d1c21da..e610fc7 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -447,7 +447,7 @@ struct frame
 
   /* New text height and width for pending size change.  0 if no change
      pending.  These values represent pixels or canonical character units
-     according to the value of new_pixelwise and correlate to the the
+     according to the value of new_pixelwise and correlate to the
      text width/height of the frame.  */
   int new_width, new_height;
 
diff --git a/src/gnutls.c b/src/gnutls.c
index d7a1399..b55d1b9 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -2472,7 +2472,6 @@ syms_of_gnutls (void)
   DEFSYM (QCcipher_blocksize, ":cipher-blocksize");
   DEFSYM (QCcipher_keysize, ":cipher-keysize");
   DEFSYM (QCcipher_tagsize, ":cipher-tagsize");
-  DEFSYM (QCcipher_keysize, ":cipher-keysize");
   DEFSYM (QCcipher_ivsize, ":cipher-ivsize");
 
   DEFSYM (QCmac_algorithm_id, ":mac-algorithm-id");
diff --git a/src/keyboard.h b/src/keyboard.h
index a2a5f8f..662d8e4 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -65,7 +65,7 @@ INLINE_HEADER_BEGIN
    as soon as a complete key arrives from some KBOARD or other,
    Emacs starts executing that key's binding.  It switches to the
    single-kboard state for the execution of that command,
-   so that that command can get input only from its own KBOARD.
+   so that the command can get input only from its own KBOARD.
 
    While in the single-kboard state, read_char can consider input only
    from the current KBOARD.  If events come from other KBOARDs, they
diff --git a/src/lread.c b/src/lread.c
index 6bc93b1..33da866 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4834,7 +4834,7 @@ to the specified file name if a suffix is allowed or 
required.  */);
                          build_pure_c_string (".el"));
 #endif
   DEFVAR_LISP ("module-file-suffix", Vmodule_file_suffix,
-              doc: /* Suffix of loadable module file, or nil of modules are 
not supported.  */);
+              doc: /* Suffix of loadable module file, or nil if modules are 
not supported.  */);
 #ifdef HAVE_MODULES
   Vmodule_file_suffix = build_pure_c_string (MODULES_SUFFIX);
 #else
diff --git a/src/nsterm.m b/src/nsterm.m
index f0b6a70..0b43c04 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3715,7 +3715,7 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r)
       /* Currently on NS img->mask is always 0. Since
          get_window_cursor_type specifies a hollow box cursor when on
          a non-masked image we never reach this clause. But we put it
-         in in anticipation of better support for image masks on
+         in, in anticipation of better support for image masks on
          NS. */
       tdCol = ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f);
     }
@@ -6893,6 +6893,9 @@ not_in_argv (NSString *arg)
   NSTRACE_RECT   ("[sender frame]", [sender frame]);
   NSTRACE_FSTYPE ("fs_state", fs_state);
 
+  if (!FRAME_LIVE_P (emacsframe))
+    return frameSize;
+
   if (fs_state == FULLSCREEN_MAXIMIZED
       && (maximized_width != (int)frameSize.width
           || maximized_height != (int)frameSize.height))
diff --git a/src/scroll.c b/src/scroll.c
index 7004dcd..c6e0cfd 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -457,7 +457,7 @@ calculate_direct_scrolling (struct frame *frame,
   if (baud_rate <= 0)
     extra_cost = 1;
 
-  /* Overhead of setting the scroll window, plus the extra cost
+  /* Overhead of setting the scroll window, plus the extra
      cost of scrolling by a distance of one.  The extra cost is
      added once for consistency with the cost vectors */
   scroll_overhead
diff --git a/src/sysdep.c b/src/sysdep.c
index 8291a60..dd0062b 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -221,10 +221,29 @@ init_standard_fds (void)
 }
 
 /* Return the current working directory.  The result should be freed
-   with 'free'.  Return NULL on errors.  */
-char *
-emacs_get_current_dir_name (void)
+   with 'free'.  Return NULL (setting errno) on errors.  If the
+   current directory is unreachable, return either NULL or a string
+   beginning with '('.  */
+
+static char *
+get_current_dir_name_or_unreachable (void)
 {
+  /* Use malloc, not xmalloc, since this function can be called before
+     the xmalloc exception machinery is available.  */
+
+  char *pwd;
+
+  /* The maximum size of a directory name, including the terminating null.
+     Leave room so that the caller can append a trailing slash.  */
+  ptrdiff_t dirsize_max = min (PTRDIFF_MAX, SIZE_MAX) - 1;
+
+  /* The maximum size of a buffer for a file name, including the
+     terminating null.  This is bounded by MAXPATHLEN, if available.  */
+  ptrdiff_t bufsize_max = dirsize_max;
+#ifdef MAXPATHLEN
+  bufsize_max = min (bufsize_max, MAXPATHLEN);
+#endif
+
 # if HAVE_GET_CURRENT_DIR_NAME && !BROKEN_GET_CURRENT_DIR_NAME
 #  ifdef HYBRID_MALLOC
   bool use_libc = bss_sbrk_did_unexec;
@@ -233,65 +252,80 @@ emacs_get_current_dir_name (void)
 #  endif
   if (use_libc)
     {
-      /* GNU/Linux get_current_dir_name can return a string starting
-        with "(unreachable)" (Bug#27871).  */
-      char *wd = get_current_dir_name ();
-      if (wd && ! (IS_DIRECTORY_SEP (*wd) || (*wd && IS_DEVICE_SEP (wd[1]))))
+      /* For an unreachable directory, this returns a string that starts
+        with "(unreachable)"; see Bug#27871.  */
+      pwd = get_current_dir_name ();
+      if (pwd)
        {
-         free (wd);
-         errno = ENOENT;
-         return NULL;
+         if (strlen (pwd) < dirsize_max)
+           return pwd;
+         free (pwd);
+         errno = ERANGE;
        }
-      return wd;
+      return NULL;
     }
 # endif
 
-  char *buf;
-  char *pwd = getenv ("PWD");
+  size_t pwdlen;
   struct stat dotstat, pwdstat;
+  pwd = getenv ("PWD");
+
   /* If PWD is accurate, use it instead of calling getcwd.  PWD is
      sometimes a nicer name, and using it may avoid a fatal error if a
      parent directory is searchable but not readable.  */
   if (pwd
-      && (IS_DIRECTORY_SEP (*pwd) || (*pwd && IS_DEVICE_SEP (pwd[1])))
+      && (pwdlen = strlen (pwd)) < bufsize_max
+      && IS_DIRECTORY_SEP (pwd[pwdlen && IS_DEVICE_SEP (pwd[1]) ? 2 : 0])
       && stat (pwd, &pwdstat) == 0
       && stat (".", &dotstat) == 0
       && dotstat.st_ino == pwdstat.st_ino
-      && dotstat.st_dev == pwdstat.st_dev
-#ifdef MAXPATHLEN
-      && strlen (pwd) < MAXPATHLEN
-#endif
-      )
+      && dotstat.st_dev == pwdstat.st_dev)
     {
-      buf = malloc (strlen (pwd) + 1);
+      char *buf = malloc (pwdlen + 1);
       if (!buf)
         return NULL;
-      strcpy (buf, pwd);
+      return memcpy (buf, pwd, pwdlen + 1);
     }
   else
     {
-      size_t buf_size = 1024;
-      buf = malloc (buf_size);
+      ptrdiff_t buf_size = min (bufsize_max, 1024);
+      char *buf = malloc (buf_size);
       if (!buf)
         return NULL;
       for (;;)
         {
           if (getcwd (buf, buf_size) == buf)
-            break;
-          if (errno != ERANGE)
+           return buf;
+         int getcwd_errno = errno;
+         if (getcwd_errno != ERANGE || buf_size == bufsize_max)
             {
-              int tmp_errno = errno;
               free (buf);
-              errno = tmp_errno;
+             errno = getcwd_errno;
               return NULL;
             }
-          buf_size *= 2;
+         buf_size = buf_size <= bufsize_max / 2 ? 2 * buf_size : bufsize_max;
           buf = realloc (buf, buf_size);
           if (!buf)
             return NULL;
         }
     }
-  return buf;
+}
+
+/* Return the current working directory.  The result should be freed
+   with 'free'.  Return NULL (setting errno) on errors; an unreachable
+   directory (e.g., its name starts with '(') counts as an error.  */
+
+char *
+emacs_get_current_dir_name (void)
+{
+  char *dir = get_current_dir_name_or_unreachable ();
+  if (dir && *dir == '(')
+    {
+      free (dir);
+      errno = ENOENT;
+      return NULL;
+    }
+  return dir;
 }
 
 
diff --git a/src/termhooks.h b/src/termhooks.h
index b5171bf..dd6044a 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -625,7 +625,7 @@ struct terminal
      TERMINAL indicates which terminal device to read from.  Input
      events should be read into HOLD_QUIT.
 
-     A positive return value indicates that that many input events
+     A positive return value N indicates that N input events
      were read into BUF.
      Zero means no events were immediately available.
      A value of -1 means a transient read error, while -2 indicates
diff --git a/src/w32inevt.c b/src/w32inevt.c
index 0b0f3f9..9d79bd4 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -526,7 +526,7 @@ do_mouse_event (MOUSE_EVENT_RECORD *event,
                              help_echo_window, help_echo_object,
                              help_echo_pos);
          }
-       /* We already called kbd_buffer_store_event, so indicate the
+       /* We already called kbd_buffer_store_event, so indicate to
           the caller it shouldn't.  */
        return 0;
       }
diff --git a/src/w32proc.c b/src/w32proc.c
index ca59f99..0046c9e 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -838,7 +838,7 @@ alarm (int seconds)
        updates the status of the read accordingly, and signals the 2nd
        event object, char_avail, on whose handle sys_select is
        waiting.  This tells sys_select that the file descriptor
-       allocated for the subprocess or the the stream is ready to be
+       allocated for the subprocess or the stream is ready to be
        read from.
 
    When the subprocess exits or the network/serial stream is closed,
diff --git a/src/xdisp.c b/src/xdisp.c
index 141275f..b14b7da 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -17036,6 +17036,7 @@ redisplay_window (Lisp_Object window, bool 
just_this_one_p)
               = try_window_reusing_current_matrix (w)))
        {
          IF_DEBUG (debug_method_add (w, "1"));
+         clear_glyph_matrix (w->desired_matrix);
          if (try_window (window, startp, TRY_WINDOW_CHECK_MARGINS) < 0)
            /* -1 means we need to scroll.
               0 means we need new matrices, but fonts_changed
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 2cb4f3e..fb0d01b 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -401,12 +401,14 @@ x_session_initialize (struct x_display_info *dpyinfo)
   ptrdiff_t name_len = 0;
 
   /* libSM seems to crash if pwd is missing - see bug#18851.  */
-  if (! emacs_get_current_dir_name ())
+  char *pwd = emacs_get_current_dir_name ();
+  if (!pwd)
     {
       fprintf (stderr, "Disabling session management due to pwd error: %s\n",
                emacs_strerror (errno));
       return;
     }
+  xfree (pwd);
 
   ice_fd = -1;
   doing_interact = false;
diff --git a/test/lisp/kmacro-tests.el b/test/lisp/kmacro-tests.el
index a691ec8..9f3eeaf 100644
--- a/test/lisp/kmacro-tests.el
+++ b/test/lisp/kmacro-tests.el
@@ -248,7 +248,7 @@ cause the current test to fail."
   (kmacro-tests-simulate-command '(kmacro-set-counter 1))
   (kmacro-tests-should-insert "1"
     (kmacro-tests-simulate-command '(kmacro-insert-counter nil)))
-  ;; Using universal arg to to set counter should reset to starting value.
+  ;; Using universal arg to set counter should reset to starting value.
   (kmacro-tests-simulate-command '(kmacro-set-counter (4)) '(4))
   (kmacro-tests-should-insert "5"
     (kmacro-tests-simulate-command '(kmacro-insert-counter nil))))
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index a8fe06d..7cc0779 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -140,7 +140,7 @@ This shall used dynamically bound only.")
 
 (defmacro tramp--test-instrument-test-case (verbose &rest body)
   "Run BODY with `tramp-verbose' equal VERBOSE.
-Print the the content of the Tramp debug buffer, if BODY does not
+Print the content of the Tramp debug buffer, if BODY does not
 eval properly in `should' or `should-not'.  `should-error' is not
 handled properly.  BODY shall not contain a timeout."
   (declare (indent 1) (debug (natnump body)))
@@ -2105,7 +2105,10 @@ This tests also `file-directory-p' and 
`file-accessible-directory-p'."
            (should-error (make-directory tmp-name2) :type 'file-error)
            (make-directory tmp-name2 'parents)
            (should (file-directory-p tmp-name2))
-           (should (file-accessible-directory-p tmp-name2)))
+           (should (file-accessible-directory-p tmp-name2))
+           ;; If PARENTS is non-nil, `make-directory' shall not
+           ;; signal an error when DIR exists already.
+           (make-directory tmp-name2 'parents))
 
        ;; Cleanup.
        (ignore-errors (delete-directory tmp-name1 'recursive))))))
diff --git a/test/lisp/progmodes/flymake-tests.el 
b/test/lisp/progmodes/flymake-tests.el
index 5e042f2..0b29b6a 100644
--- a/test/lisp/progmodes/flymake-tests.el
+++ b/test/lisp/progmodes/flymake-tests.el
@@ -73,7 +73,9 @@ SEVERITY-PREDICATE is used to setup
             (when sev-pred-supplied-p
               (setq-local flymake-proc-diagnostic-type-pred 
severity-predicate))
             (goto-char (point-min))
-            (unless flymake-mode (flymake-mode 1))
+            (let ((flymake-start-on-flymake-mode nil))
+              (unless flymake-mode (flymake-mode 1)))
+            (flymake-start)
             (flymake-tests--wait-for-backends)
             (funcall fn)))
       (and buffer
@@ -230,7 +232,9 @@ SEVERITY-PREDICATE is used to setup
                    'crashing-backend
                    ))
             (flymake-wrap-around nil))
-        (flymake-mode)
+        (let ((flymake-start-on-flymake-mode nil))
+          (flymake-mode))
+        (flymake-start)
 
         (flymake-tests--assert-set (flymake-running-backends)
           (error-backend warning-backend panicking-backend)
@@ -299,7 +303,9 @@ SEVERITY-PREDICATE is used to setup
         (let ((flymake-diagnostic-functions
                (list 'eager-backend))
               (flymake-wrap-around nil))
-          (flymake-mode)
+          (let ((flymake-start-on-flymake-mode nil))
+            (flymake-mode))
+          (flymake-start)
           (flymake-tests--assert-set (flymake-running-backends)
             (eager-backend) ())
           (cl-loop until tick repeat 4 do (sleep-for 0.2))
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index 90a627f..5133e68 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -188,7 +188,7 @@
 ;; From 24 Oct - 21 Nov 2015, `open-line' took a second argument
 ;; INTERACTIVE and ran `post-self-insert-hook' if the argument was
 ;; true.  This test tested that.  Currently, however, `open-line'
-;; does not run run `post-self-insert-hook' at all, so for now
+;; does not run `post-self-insert-hook' at all, so for now
 ;; this test just makes sure that it doesn't.
 (ert-deftest open-line-hook ()
   (let* ((x 0)



reply via email to

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