emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] xwidget_mvp 0c2cdcc 7/7: Merge remote-tracking branch 'ori


From: Joakim Verona
Subject: [Emacs-diffs] xwidget_mvp 0c2cdcc 7/7: Merge remote-tracking branch 'origin/master' into xwidget_mvp
Date: Tue, 15 Sep 2015 08:28:56 +0000

branch: xwidget_mvp
commit 0c2cdccc9769191a95208422507ec3ba6541766a
Merge: b72e831 a1cbf94
Author: Joakim Verona <address@hidden>
Commit: Joakim Verona <address@hidden>

    Merge remote-tracking branch 'origin/master' into xwidget_mvp
---
 CONTRIBUTE                          |    4 +-
 INSTALL.REPO                        |    2 +-
 admin/FOR-RELEASE                   |   22 +++---
 admin/README                        |    2 +-
 admin/make-tarball.txt              |    8 +-
 admin/notes/bugtracker              |   16 ++--
 admin/notes/copyright               |    2 +-
 admin/notes/elpa                    |    2 +-
 admin/notes/git-workflow            |   16 +---
 admin/notes/hydra                   |   10 +-
 admin/notes/multi-tty               |  160 +++++++++++++++++------------------
 admin/notes/newfile                 |    2 +-
 admin/notes/repo                    |    8 +-
 admin/notes/unicode                 |    6 +-
 admin/quick-install-emacs           |   14 ++--
 configure.ac                        |    3 +-
 doc/lispref/frames.texi             |    4 +-
 doc/lispref/sequences.texi          |    6 +-
 doc/misc/url.texi                   |    2 +-
 leim/README                         |    4 +-
 lib-src/rcs2log                     |    8 +-
 lisp/emacs-lisp/eieio-core.el       |    8 +-
 lisp/emacs-lisp/lisp-mode.el        |   34 ++++----
 lisp/emacs-lisp/syntax.el           |  105 ++++++++++++-----------
 lisp/eshell/esh-mode.el             |    7 +-
 lisp/faces.el                       |    6 +-
 lisp/filenotify.el                  |   53 +++++++++--
 lisp/gnus/message.el                |    2 +-
 lisp/ibuffer.el                     |    4 +-
 lisp/international/isearch-x.el     |    1 +
 lisp/jit-lock.el                    |    8 +-
 lisp/mail/mailclient.el             |   58 +++++++++---
 lisp/mouse.el                       |    4 +-
 lisp/net/tramp-adb.el               |    1 +
 lisp/net/tramp-gvfs.el              |    1 +
 lisp/net/tramp-sh.el                |   24 +++++-
 lisp/net/tramp-smb.el               |    1 +
 lisp/net/tramp.el                   |    8 ++-
 lisp/obsolete/fast-lock.el          |    2 +-
 lisp/obsolete/longlines.el          |    4 +-
 lisp/progmodes/antlr-mode.el        |    2 +-
 lisp/progmodes/cc-langs.el          |   14 ++--
 lisp/progmodes/cperl-mode.el        |    4 +-
 lisp/term/README                    |   32 ++++----
 lisp/wid-edit.el                    |    9 +--
 src/README                          |   13 ++--
 src/indent.c                        |   22 +++++-
 src/inotify.c                       |   24 +++++-
 src/nsfns.m                         |    2 +-
 src/syntax.c                        |  113 ++++++++++++------------
 src/syntax.h                        |    5 +-
 src/terminal.c                      |    6 +-
 src/w32notify.c                     |   54 ++++++++++--
 test/automated/file-notify-tests.el |  106 +++++++++++++++++-------
 54 files changed, 618 insertions(+), 420 deletions(-)

diff --git a/CONTRIBUTE b/CONTRIBUTE
index 7e697dd..5821ee5 100644
--- a/CONTRIBUTE
+++ b/CONTRIBUTE
@@ -234,7 +234,9 @@ by following links from 
http://savannah.gnu.org/mail/?group=emacs .
 
 To email a patch you can use a shell command like 'git format-patch -1'
 to create a file, and then attach the file to your email.  This nicely
-packages the patch's commit message and changes.
+packages the patch's commit message and changes.  To send just one
+such patch without additional remarks, you can use a command like
+'git send-email address@hidden 0001-DESCRIPTION.patch'.
 
 ** Document your changes.
 
diff --git a/INSTALL.REPO b/INSTALL.REPO
index 3431ee4..7c956f0 100644
--- a/INSTALL.REPO
+++ b/INSTALL.REPO
@@ -42,7 +42,7 @@ subdirectories of 'lisp/', e.g., 'mh-e/' and 'calendar/') 
will need to be
 updated to reflect new autoloaded functions.  If you see errors (rather
 than warnings) about undefined lisp functions during compilation, that
 may be the reason.  Finally, sometimes there can be build failures
-related to '*loaddefs.el' (e.g., "required feature `esh-groups' was not
+related to '*loaddefs.el' (e.g., "required feature ‘esh-groups’ was not
 provided").  In that case, follow the instructions below.
 
 To update loaddefs.el (and similar files), do:
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index bdd2694..327723f 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -72,7 +72,7 @@ pages of the manuals, and even if they do, the resulting page 
breaks
 depend on what paper and font size they use.  This also means that if
 you _are_ going to do this, it should be done with the paper and font
 size that the GNU Press are going to use when they print the manuals.
-I think this is different to what you get if you just use eg `make
+I think this is different to what you get if you just use eg 'make
 emacs.pdf' (e.g., enable "smallbook").
 
 ** Check the keybindings in the refcards are correct, and add any new ones.
@@ -112,21 +112,21 @@ sk        Miroslav Vaško
 ** Check for modes which bind M-s that conflicts with a new global binding M-s
 and change key bindings where necessary.  The current list of modes:
 
-1. Gnus binds `M-s' to `gnus-summary-search-article-forward'.
+1. Gnus binds 'M-s' to 'gnus-summary-search-article-forward'.
 
-2. Minibuffer binds `M-s' to `next-matching-history-element'
+2. Minibuffer binds 'M-s' to 'next-matching-history-element'
    (not useful any more since C-s can now search in the history).
 
-3. `center-line' in Text mode was already moved to the text formatting
-   keymap as `M-o M-s' (thus this binding is not necessary any more
-   in `nroff-mode-map' too and can be removed now from the nroff mode
-   because it can now use the global key binding `M-o M-s' `center-line').
+3. 'center-line' in Text mode was already moved to the text formatting
+   keymap as 'M-o M-s' (thus this binding is not necessary any more
+   in 'nroff-mode-map' too and can be removed now from the nroff mode
+   because it can now use the global key binding 'M-o M-s' 'center-line').
 
-4. PCL-CVS binds `M-s' to `cvs-status', and log-edit-mode binds it to
-   `log-edit-comment-search-forward'.  Perhaps search commands
-   on the global key binding `M-s' are useless in these modes.
+4. PCL-CVS binds 'M-s' to 'cvs-status', and log-edit-mode binds it to
+   'log-edit-comment-search-forward'.  Perhaps search commands
+   on the global key binding 'M-s' are useless in these modes.
 
-5. Rmail binds `\es' to `rmail-search'/`rmail-summary-search'.
+5. Rmail binds '\es' to 'rmail-search'/'rmail-summary-search'.
 
 
 * DOCUMENTATION
diff --git a/admin/README b/admin/README
index 786c502..2286e35 100644
--- a/admin/README
+++ b/admin/README
@@ -37,7 +37,7 @@ Build Emacs in various ways.
 
 ** quick-install-emacs
 
-Install emacs quickly (`incrementally').
+Install emacs quickly ("incrementally").
 
 ** alloc-colors.c
 
diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt
index d326282..0730b94 100644
--- a/admin/make-tarball.txt
+++ b/admin/make-tarball.txt
@@ -13,13 +13,13 @@ Steps to take before starting on the first pretest in any 
release sequence:
     have them available for the duration of the release process.
 
 2.  Consider increasing the value of the variable
-    `customize-changed-options-previous-release' in cus-edit.el to
+    'customize-changed-options-previous-release' in cus-edit.el to
     refer to a newer version of Emacs.  (This is probably needed only
     when preparing the first pretest for a major Emacs release.)
     Commit cus-edit.el if changed.
 
 3.  Remove any old pretests from ftp://alpha.gnu.org/gnu/emacs/pretest.
-    You can use `gnupload --delete' (see below for more gnupload details).
+    You can use 'gnupload --delete' (see below for more gnupload details).
 
 General steps (for each step, check for possible errors):
 
@@ -96,12 +96,12 @@ General steps (for each step, check for possible errors):
 
     If this is the first pretest of a major release, just comparing
     with the previous release may overlook many new files.  You can try
-    something like `find . | sort' in a clean repository, and compare the
+    something like 'find . | sort' in a clean repository, and compare the
     results against the new tar contents.
 
 7.   tar -xf emacs-NEW.tar; cd emacs-NEW
      ./configure --prefix=/tmp/emacs && make && make install
-    Use `script' or M-x compile to save the compilation log in
+    Use 'script' or M-x compile to save the compilation log in
     compile-NEW.log and compare it against an old one.  The easiest way
     to do that is to visit the old log in Emacs, change the version
     number of the old Emacs to __, do the same with the new log and do
diff --git a/admin/notes/bugtracker b/admin/notes/bugtracker
index fd7bd08..fb65bbe 100644
--- a/admin/notes/bugtracker
+++ b/admin/notes/bugtracker
@@ -334,7 +334,7 @@ 
http://debbugs.gnu.org/cgi/pkgreport.cgi?users=emacs;tag=calendar
 *** To merge bugs:
 Eg when bad replies create a bunch of new bugs for the same report.
 Bugs must all be in the same state (e.g. same package(s) and severity
--- see `reassign' and `severity' below), but need not have the same
+-- see 'reassign' and 'severity' below), but need not have the same
 tags (tags are merged). E.g.:
 
 merge 123 124 125 ...
@@ -343,8 +343,8 @@ Note that merging does not affect titles.  In particular, a 
"retitle"
 of merged bugs only affects individual bugs, not all of them.
 
 *** Forcing a merge:
-Like `merge', but bugs need not be in the same state.  The packages
-must still match though (see `reassign' below).  The first one listed
+Like 'merge', but bugs need not be in the same state.  The packages
+must still match though (see 'reassign' below).  The first one listed
 is the master.  E.g.:
 
 forcemerge 123 124 125 ...
@@ -383,7 +383,7 @@ See http://debbugs.gnu.org/Developer#severities for the 
meanings.
 *** To set the owner of a bug:
 owner 123 A Hacker <address@hidden>
 
-The shorthand `!' means your own address.
+The shorthand '!' means your own address.
 
 *** To remove the owner of a bug:
 noowner 123
@@ -408,7 +408,7 @@ reassign 1234 emacs
 Note that reassigning clears the list of found versions, even if the
 new packages includes the original one.
 
-** To remove spam from the tracker, move it to the `spam' pseudo-package:
+** To remove spam from the tracker, move it to the 'spam' pseudo-package:
 reassign 123 spam
 
 (Should not be necessary any more, now that the input is moderated.)
@@ -468,10 +468,10 @@ time, rather than by increasing bug number
 *** When you fix a bug, it can be helpful to put the bug number in the
 change log entry, for example:
 
-   * foo.el (foofunc): Fix the `foo' case.  (Bug#123)
+   * lisp/menu-bar.el (menu-set-font): Doc fix.  (Bug#21303)
 
 Then the relevant bug can be found for easy reference.  If it's an
-obvious fix (e.g. a typo), there's no need to clutter the log with the
+obvious fix (e.g., a typo), there's no need to clutter the log with the
 bug number.
 
 Similarly, when you close a bug, it can be helpful to include the
@@ -480,7 +480,7 @@ can see exactly what the fix was.
 
 *** bug-reference-mode
 
-Activate `bug-reference-mode' in ChangeLogs to get clickable links to
+Activate 'bug-reference-mode' in ChangeLogs to get clickable links to
 the bug web-pages.
 
 *** Debian stuff
diff --git a/admin/notes/copyright b/admin/notes/copyright
index 45b7c61..3ba9c55 100644
--- a/admin/notes/copyright
+++ b/admin/notes/copyright
@@ -132,7 +132,7 @@ lib-src/rcs2log           # Copyright
 Cocoa/Emacs.base/Contents/Info.plist
 Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings
 GNUstep/Emacs.base/Resources/Info-gnustep.plist
-   `set-copyright' in admin.el will do all the above.
+   'set-copyright' in admin.el will do all the above.
 
 aclocal.m4
 configure
diff --git a/admin/notes/elpa b/admin/notes/elpa
index 3922604..4c0f198 100644
--- a/admin/notes/elpa
+++ b/admin/notes/elpa
@@ -13,7 +13,7 @@ daily.  This script (which is kept in 
elpa/admin/update-archive.sh) generates
 the content visible at http://elpa.gnu.org/packages.
 
 A new package is released as soon as the "version number" of that package is
-changed.  So you can use `elpa' to work on a package without fear of releasing
+changed.  So you can use 'elpa' to work on a package without fear of releasing
 those changes prematurely.  And once the code is ready, just bump the
 version number to make a new release of the package.
 
diff --git a/admin/notes/git-workflow b/admin/notes/git-workflow
index 40dfa6b..3c2c76c 100644
--- a/admin/notes/git-workflow
+++ b/admin/notes/git-workflow
@@ -33,7 +33,7 @@ You now have both branches conveniently accessible, and you 
can do
 Fixing bugs
 ===========
 
-You edit the files in either branch, `M-x vc-dir', and check in your
+You edit the files in either branch, 'M-x vc-dir', and check in your
 changes.  Then you need to push the data to the main repository.  This
 will usually fail, since somebody else has pushed other changes in the
 meantime.  To fix this, say
@@ -50,18 +50,8 @@ Sending patches
 ===============
 
 If you lack push access or would like feedback before pushing a patch,
-you can send a patch file as a bug report.  After committing your
-change locally, do:
-
-git format-patch -1
-
-This creates a file 0001-DESCRIPTION.patch containing the patch, where
-DESCRIPTION comes from the first line of your patch's commit message.
-You can attach the patch file to email that you send to
address@hidden  You can also configure git to email patches
-directly (see <http://git-scm.com/docs/git-send-email>) and do:
-
-git send-email address@hidden 0001-DESCRIPTION.patch
+you commit your change locally and then send a patch file as a bug report
+as described in ../../CONTRIBUTE.
 
 
 Backporting to emacs-24
diff --git a/admin/notes/hydra b/admin/notes/hydra
index 80ce787..ce4a683 100644
--- a/admin/notes/hydra
+++ b/admin/notes/hydra
@@ -16,8 +16,8 @@ 
http://lists.gnu.org/archive/html/hydra-users/2013-08/msg00000.html
 
 * Mail notifications
 In addition to the web interface, Hydra can send notifications by
-email when the build status of a project changes—e.g., from
-`SUCCEEDED' to `FAILED'.  It sends notifications about build status in
+email when the build status of a project changes, e.g., from
+SUCCEEDED to FAILED.  It sends notifications about build status in
 Emacs trunk to address@hidden
 
 If you want to receive these notifications, please subscribe at
@@ -25,16 +25,16 @@ http://lists.gnu.org/mailman/listinfo/emacs-buildstatus
 
 * The Emacs jobset consists of the following jobs:
 
-** The `tarball' job
+** The 'tarball' job
 which gets a checkout from the repository, and does a bootstrap followed
 by running make-dist to create a tarball.  If this job fails, all the
 others will too (because they use the tarball as input).
 
-** The `build' job
+** The 'build' job
 which starts from the tarball and does a normal build
 
 ** The 'coverage' job
-does a gcov build and then runs `make check'.  Fails if any test fails.
+does a gcov build and then runs 'make check'.  Fails if any test fails.
 
 * Nix expressions
 The recipe for GNU Emacs are available via Git:
diff --git a/admin/notes/multi-tty b/admin/notes/multi-tty
index c547e14..868d451 100644
--- a/admin/notes/multi-tty
+++ b/admin/notes/multi-tty
@@ -82,7 +82,7 @@ Known problems:
          minibuffer prompt (which is a kind of recursive editing) on
          another display.  To unfreeze your session, switch to that
          display and complete the recursive edit, for example by
-         pressing C-] (`abort-recursive-edit').
+         pressing C-] ('abort-recursive-edit').
 
          I am sorry to say that currently there is no way to break
          out of this "single-kboard mode" from a frozen display.  If
@@ -209,11 +209,11 @@ following:
 THINGS TO DO
 ------------
 
-** See if `tty-defined-color-alist' needs to be terminal-local.
+** See if 'tty-defined-color-alist' needs to be terminal-local.
    Update: Dan says it should be, so convert it.
 
 ** Mikhail Gusarov suggest to add a hook akin to
-   `after-make-frame-functions' that is called whenever Emacs connects
+   'after-make-frame-functions' that is called whenever Emacs connects
    to a new terminal.  Good idea!
 
 ** emacsclient -t on the console does not work after su.  You have to
@@ -237,16 +237,16 @@ THINGS TO DO
    proxy idea.
 
 ** lisp/vc.el depends on the terminal type during load time.
-   `vc-annotate-color-map' is one example that needs to be fixed.
+   'vc-annotate-color-map' is one example that needs to be fixed.
 
-** Understand how `quit_throw_to_read_char' works, and fix any bugs
+** Understand how 'quit_throw_to_read_char' works, and fix any bugs
    that come to light.
 
 ** See if getcjmp can be eliminated somehow.  Why does Emacs allow
    asynchronous input processing while it's reading input anyway?
 
-** `delete-frame' events are handled by `special-event-map'
-   immediately when read by `read_char'.  This is fine but it prevents
+** 'delete-frame' events are handled by 'special-event-map'
+   immediately when read by 'read_char'.  This is fine but it prevents
    higher-level keymaps from binding that event to get notified of the
    deleted frame.
 
@@ -254,26 +254,26 @@ THINGS TO DO
    deletions after they have happened, usually because they want to
    clean up after the deleted frame.  Not all frame-local states can
    be stored as a frame parameter.  For example,
-   `display-splash-screen' uses `recursive-edit' with a special keymap
+   'display-splash-screen' uses 'recursive-edit' with a special keymap
    override to create its buffer---and it leads to all kinds of
    nastiness if Emacs stays in this recursive edit mode after the
    frame containing the splash screen is deleted.  Basically, the
    splash-screen implementation wants to throw out of the recursive
    edit when the frame is deleted; however, it is not legal to throw
-   from `delete-frame-functions' because `delete-frame' must not fail.
-   (Introducing `delete-frame-after-functions' would not help either
-   because `delete-frame' may not fail at that time either.)
+   from 'delete-frame-functions' because 'delete-frame' must not fail.
+   (Introducing 'delete-frame-after-functions' would not help either
+   because 'delete-frame' may not fail at that time either.)
 
-   Currently `fancy-splash-screens' installs a
-   `delete-frame-functions' hook that sets up a timer to exit the
+   Currently 'fancy-splash-screens' installs a
+   'delete-frame-functions' hook that sets up a timer to exit the
    recursive edit.  This is an adequate solution, but it would perhaps
-   be better to have something like a `frame-deleted' event that could
+   be better to have something like a 'frame-deleted' event that could
    be bound in the normal way.
 
-** Trouble: `setenv' doesn't actually set environment variables in the
+** Trouble: 'setenv' doesn't actually set environment variables in the
    Emacs process.  This defeats the purpose of the elaborate
-   `server-with-environment' magic around the `tgetent' call in
-   `init_tty'.  D'oh.
+   'server-with-environment' magic around the 'tgetent' call in
+   'init_tty'.  D'oh.
 
 ** (Possibly) create hooks in struct device for creating frames on a
    specific terminal, and eliminate the hackish terminal-related frame
@@ -290,9 +290,9 @@ THINGS TO DO
    as static, removing it from dispextern.h.
    Move fatal to emacs.c and declare it somewhere.
 
-** Search for `suspend-emacs' references and replace them with
-   `suspend-frame', if necessary.  Ditto for `save-buffers-kill-emacs'
-   vs. `save-buffers-kill-display'.
+** Search for 'suspend-emacs' references and replace them with
+   'suspend-frame', if necessary.  Ditto for 'save-buffers-kill-emacs'
+   vs. 'save-buffers-kill-display'.
 
 ** Emacs crashes when a tty frame is resized so that there is no space
    for all its windows.  (Tom Schutzer-Weissmann)
@@ -315,7 +315,7 @@ THINGS TO DO
    impression that the various multidisplay fixes will only get
    released in GTK+ 2.10.
 
-** Audit `face-valid-attribute-values' usage in customize and
+** Audit 'face-valid-attribute-values' usage in customize and
    elsewhere.  Its return value depends on the current window system.
    Replace static initializers using it with runtime functions.  For
    example, custom's buttons are broken on non-initial device types.
@@ -325,9 +325,9 @@ THINGS TO DO
 
 ** frames-on-display-list should also accept frames.
 
-** Consider the `tty-type' frame parameter and the `display-tty-type'
+** Consider the 'tty-type' frame parameter and the 'display-tty-type'
    function.  They serve the exact same purpose.  I think it may be
-   a good idea to eliminate one of them, preferably `tty-type'.
+   a good idea to eliminate one of them, preferably 'tty-type'.
 
 ** The handling of lisp/term/*.el, and frame creation in general, is a
    big, big mess.  How come the terminal-specific file is loaded by
@@ -340,27 +340,23 @@ THINGS TO DO
    changed in CVS, and frame.el in multi-tty has not yet been adapted
    for the changes.  (It needs to look at
    default-frame-background-mode.)  (Update: maybe it is fixed now;
-   needs testing.) (Note that the byte compiler has this to say about
-   term/rxvt.el:)
+   needs testing.)
 
-       term/rxvt.el:309:17:Warning: assignment to free variable
-           `default-frame-background-mode'
-
-** I think `(set-)terminal-local-value' and the terminal parameter
+** I think '(set-)terminal-local-value' and the terminal parameter
    mechanism should be integrated into a single framework.
 
-   (Update: `(set-)terminal-local-value' is now eliminated, but the
+   (Update: '(set-)terminal-local-value' is now eliminated, but the
    terminal-local variables should still be accessible as terminal
-   parameters.  This also applies to `display-name' and similar
+   parameters.  This also applies to 'display-name' and similar
    functions.)
 
 ** Add the following hooks: after-delete-frame-hook (for server.el,
    instead of delete-frame-functions),
    after-delete-terminal-functions, after-create-terminal-functions.
 
-** BULK RENAME: The `display-' prefix of new Lisp-level functions
-   conflicts with stuff like `display-time-mode'.  Use `device-'
-   or `terminal-' instead.  I think I prefer `terminal-'.
+** BULK RENAME: The 'display-' prefix of new Lisp-level functions
+   conflicts with stuff like 'display-time-mode'.  Use 'device-'
+   or 'terminal-' instead.  I think I prefer 'terminal-'.
 
    It turns out that most of the offending Lisp functions were defined
    in the trunk.  Therefore, compatibility aliases should be defined
@@ -466,7 +462,7 @@ THINGS TO DO
 
 ** With iswitchb-default-method set to 'always-frame, only frames on
    the current display should be considered.  This might involve
-   extending `get-buffer-window'.
+   extending 'get-buffer-window'.
 
 ** Have a look at Vlocale_coding_system.  Seems like it would be a
    tedious job to localize it, although most references use it for
@@ -537,7 +533,7 @@ DIARY OF CHANGES
 
 -- Change make-terminal-frame to support specifying another tty.
 
-   (Done, new frame parameters: `tty' and `tty-type'.)
+   (Done, new frame parameters: 'tty' and 'tty-type'.)
 
 -- Implement support for reading from multiple terminals.
 
@@ -549,7 +545,7 @@ DIARY OF CHANGES
 
    (Update2: After enabling X, they don't.)
 
--- other-frame should cycle through the frames on the `current'
+-- other-frame should cycle through the frames on the 'current'
    terminal only.
 
    (Done, by trivially modifying next_frame and prev_frame.)
@@ -606,7 +602,7 @@ DIARY OF CHANGES
 
    (Update^3: Not any more.)
 
--- Make make-terminal-frame look up the `tty' and `tty-type' frame
+-- Make make-terminal-frame look up the 'tty' and 'tty-type' frame
    parameters from the currently selected terminal before the global
    default.
 
@@ -824,7 +820,7 @@ DIARY OF CHANGES
 
    (Done, breaking interactive temacs.)
 
--- The command `emacsclient -t -e '(delete-frame)'' fails to exit.
+-- The command "emacsclient -t -e '(delete-frame)'" fails to exit.
 
    (Fixed.)
 
@@ -934,7 +930,7 @@ DIARY OF CHANGES
    frame sets single_kboard).  Update: the face problems are caused by
    bugs in term.el, not in multi-tty.  The lockup is caused by
    single_kboard mode, and is not easily resolvable.  The best thing to
-   do is to simply refuse to create a tty frame of type `eterm'.
+   do is to simply refuse to create a tty frame of type 'eterm'.
 
    (Fixed, changed emacsclient to check for TERM=eterm.  The face
    complaints seem to be caused by bugs in term.el; they are not
@@ -943,14 +939,14 @@ DIARY OF CHANGES
 -- Find out the best way to support suspending Emacs with multiple
    ttys.  My guess: disable it on the controlling tty, but from other
    ttys pass it on to emacsclient somehow.  (It is (I hope) trivial to
-   extend emacsclient to handle suspend/resume.  A `kill -STOP' almost
+   extend emacsclient to handle suspend/resume.  A 'kill -STOP' almost
    works right now.)
 
    (Done.  I needed to play with signal handling and the server
    protocol a bit to make emacsclient behave as a normal UNIX program
    wrt foreground/background process groups.)
 
--- There is a flicker during the startup of `emacs -nw'; it's as if
+-- There is a flicker during the startup of 'emacs -nw'; it's as if
    the terminal is initialized, reset and then initialized again.
    Debug this.  (Hint: narrow_foreground_group is called twice during
    startup.)
@@ -973,7 +969,7 @@ DIARY OF CHANGES
 
    (It was an internal interface that may be changed when necessary.)
 
--- Change Lisp code not to (getenv "TERM"); use the `tty-type' frame
+-- Change Lisp code not to (getenv "TERM"); use the 'tty-type' frame
    parameter or the frame-tty-type function instead.  (M-x tags-search
    "TERM" helps with this.)  Update: Actually, all getenv invocations
    should be checked for multi-tty compatibility, and an interface
@@ -983,7 +979,7 @@ DIARY OF CHANGES
    calls should be mostly left as they are.)
 
 -- Add an elaborate mechanism for display-local variables.  (There are
-   already a few of these; search for `terminal-local' in the Elisp
+   already a few of these; search for 'terminal-local' in the Elisp
    manual.)
 
    (Not needed.  Display-local variables could be emulated by
@@ -1002,7 +998,7 @@ DIARY OF CHANGES
    emacsclient process for server tty frames.)
    (Update: Not really; Vlocale_coding_system is still global.)
 
--- Make `struct display' accessible to Lisp programs.  Accessor functions:
+-- Make 'struct display' accessible to Lisp programs.  Accessor functions:
 
        (displayp OBJECT):  Returns t if OBJECT is a display.
                => Implemented as display-live-p.
@@ -1020,7 +1016,7 @@ DIARY OF CHANGES
                => Already implemented, see frames-on-display-list.
 
        (display-type DISPLAY):  Returns the type of DISPLAY, as a
-               symbol.  (See `framep'.)
+               symbol.  (See 'framep'.)
                => Implemented as display-live-p.
 
        (display-device DISPLAY): Returns the name of the device that
@@ -1053,7 +1049,7 @@ DIARY OF CHANGES
    (Done.)
 
 -- Support multiple character locales.  A version of
-   `set-locale-environment' needs to be written for setting up
+   'set-locale-environment' needs to be written for setting up
    display-local settings on ttys.  I think calling
    set-display-table-and-terminal-coding-system and
    set-keyboard-coding-system would be enough.  The language
@@ -1066,7 +1062,7 @@ DIARY OF CHANGES
    them to tweak only frame-local settings, if possible.  (They tend
    to call define-key to set function key sequences a lot.)
 
-   (Done, by making `function-key-map' terminal-local (i.e., part of
+   (Done, by making 'function-key-map' terminal-local (i.e., part of
    struct kboard).  This has probably covered all the remaining problems.)
 
 -- xt-mouse.el needs to be adapted for multi-tty.  It currently
@@ -1083,8 +1079,8 @@ DIARY OF CHANGES
 
    This only seems to affect displays that are of the same terminfo
    type as the selected one. Interestingly, in screen Emacs normally
-   reports the up arrow key as `M-o A', but after the above SNAFU, it
-   complains about `M-[ a'.  UNIX ttys are a complete mystery to me,
+   reports the up arrow key as 'M-o A', but after the above SNAFU, it
+   complains about 'M-[ a'.  UNIX ttys are a complete mystery to me,
    but it seems the reset-reinitialize cycle somehow leaves the
    non-selected terminals in a different state than usual.  I have no
    idea how this could happen.
@@ -1132,15 +1128,15 @@ DIARY OF CHANGES
    clear what binding is in effect in any given time.  See if
    current_kboard (or at least the terminal-local bindings exported to
    Lisp) might be changed to be tied to the selected frame instead.
-   Currently, `function-key-map' and `key-translation-map' may be
+   Currently, 'function-key-map' and 'key-translation-map' may be
    accessed reliably only using the hackish
-   `(set-)terminal-local-value' functions.
+   '(set-)terminal-local-value' functions.
 
-   Perhaps there should be a difference between `last-command' &co.
+   Perhaps there should be a difference between 'last-command' &co.
    and these more conventional configuration variables.
-   (E.g. `symbol-value' would use current_kboard to access
-   `last-command', but SELECTED_FRAME()->display->kboard to get the
-   value of `function-key-map'.
+   (E.g. 'symbol-value' would use current_kboard to access
+   'last-command', but SELECTED_FRAME()->display->kboard to get the
+   value of 'function-key-map'.
 
    (Fixed in patch-434.)
 
@@ -1151,7 +1147,7 @@ DIARY OF CHANGES
    below" was the set-input-mode madness.)
 
    (Update: this bug was fixed for good in patch-449.  It was tracked
-   down to a bug in `read_key_sequence': it failed to reinitialize its
+   down to a bug in 'read_key_sequence': it failed to reinitialize its
    local function-key-map/key-translation-map references when it
    switched keyboards.  I don't understand why did this bug only
    appear on brand new frames, though!)
@@ -1163,35 +1159,35 @@ DIARY OF CHANGES
 -- Implement automatic forwarding of client environment variables to
    forked processes, as discussed on the multi-tty list.  Terminal
    parameters are now accessible in C code, so the biggest obstacle is
-   gone.  The `getenv_internal' and `child_setup' functions in
+   gone.  The 'getenv_internal' and 'child_setup' functions in
    callproc.c must be changed to support the following variable:
 
        terminal-local-environment-variables is a variable defined in ...
 
        Enable or disable terminal-local environment variables.
 
-       If set to t, `getenv', `setenv' and subprocess creation
+       If set to t, 'getenv', 'setenv' and subprocess creation
        functions use the environment variables of the emacsclient
        process that created the selected frame, ignoring
-       `process-environment'.
+       'process-environment'.
 
-       If set to nil, Emacs uses `process-environment' and ignores
+       If set to nil, Emacs uses 'process-environment' and ignores
        the client environment.
 
-       Otherwise, `terminal-local-environment-variables' should be a
+       Otherwise, 'terminal-local-environment-variables' should be a
        list of variable names (represented by Lisp strings) to look
        up in the client environment.  The rest will come from
-       `process-environment'.
+       'process-environment'.
 
-   (Implemented in patch-461; `terminal-getenv', `terminal-setenv' and
-   `with-terminal-environment' are now replaced by extensions to
-   `getenv' and `setenv', and the new `local-environment-variables'
+   (Implemented in patch-461; 'terminal-getenv', 'terminal-setenv' and
+   'with-terminal-environment' are now replaced by extensions to
+   'getenv' and 'setenv', and the new 'local-environment-variables'
    facility.  Yay!)
 
    (Updated in patch-465 to fix the semantics of let-binding
-   `process-environment'.  `process-environment' was changed to
+   'process-environment'.  'process-environment' was changed to
    override all local/global environment variables, and a new variable
-   `global-environment' was introduced to have `process-environment's
+   'global-environment' was introduced to have 'process-environment's
    old meaning.)
 
    (Updated in patch-466 to fix the case when two emacsclient sessions
@@ -1199,27 +1195,27 @@ DIARY OF CHANGES
    environment lists are now stored as frame parameters, so the
    C-level terminal parameters are not strictly necessary any more.)
 
--- `Fdelete_frame' is called from various critical places where it is
+-- 'Fdelete_frame' is called from various critical places where it is
    not acceptable for the frame deletion to fail, e.g. from
-   x_connection_closed after an X error.  `Fdelete_frame' now protects
-   against `delete-frame-functions' throwing an error and preventing a
+   x_connection_closed after an X error.  'Fdelete_frame' now protects
+   against 'delete-frame-functions' throwing an error and preventing a
    frame delete. (patch-475)
 
 -- Fix set-input-mode for multi-tty.  It's a truly horrible interface;
    what if we'd blow it up into several separate functions (with a
    compatibility definition)?
 
-   (Done.  See `set-input-interrupt-mode', `set-output-flow-control',
-   `set-input-meta-mode' and `set-quit-char'.) (patch-457)
+   (Done.  See 'set-input-interrupt-mode', 'set-output-flow-control',
+   'set-input-meta-mode' and 'set-quit-char'.) (patch-457)
 
--- Let-binding `overriding-terminal-local-map' on a brand new frame
-   does not seem to work correctly.  (See `fancy-splash-screens'.)
+-- Let-binding 'overriding-terminal-local-map' on a brand new frame
+   does not seem to work correctly.  (See 'fancy-splash-screens'.)
    The keymap seems to be set up right, but events go to another
-   terminal.  Or is it `unread-command-events' that gets Emacs
+   terminal.  Or is it 'unread-command-events' that gets Emacs
    confused?  Investigate.
 
    (Emacs was confused because a process filter entered
-   `recursive-edit' while Emacs was reading input.  I added support
+   'recursive-edit' while Emacs was reading input.  I added support
    for this in the input system.) (patch-489)
 
 -- I smell something funny around pop_kboard's "deleted kboard" case.
@@ -1244,7 +1240,7 @@ DIARY OF CHANGES
    synchronously (with wait_reading_process_input), or asynchronously
    by SIGIO or polling (SIGALRM).  C-g either sets the Vquit_flag,
    signals a 'quit condition (when immediate_quit), or throws to
-   `getcjmp' when Emacs was waiting for input when the C-g event
+   'getcjmp' when Emacs was waiting for input when the C-g event
    arrived.)
 
 -- Replace wrong_kboard_jmpbuf with a special return value of
@@ -1253,7 +1249,7 @@ DIARY OF CHANGES
 
    (Done in patch-500.)
 
--- `tool-bar-mode', `scroll-bar-mode', `menu-bar-mode' and
+-- 'tool-bar-mode', 'scroll-bar-mode', 'menu-bar-mode' and
    'fringe-mode' are modes global to the entire Emacs session, not
    just a single frame or a single terminal.  This means that their
    status sometimes differs from what's actually displayed on the
@@ -1266,7 +1262,7 @@ DIARY OF CHANGES
 
    (Done in patch-537.)
 
--- The `default-directory' variable should somehow be set to the
+-- The 'default-directory' variable should somehow be set to the
    cwd of the emacsclient process when the user runs emacsclient
    without file arguments.  Perhaps it is OK to just override the
    directory of the *scratch* buffer.
@@ -1278,9 +1274,9 @@ DIARY OF CHANGES
    frame parameter) is not filled with the correct background color.
 
    It seems the border contents are drawn onto by the
-   update_single_window call in `x-show-tip'.  After some debugging, I
+   update_single_window call in 'x-show-tip'.  After some debugging, I
    think the window's background color is not set up
-   correctly---calling `x_clear_area' fills the specified area with
+   correctly---calling 'x_clear_area' fills the specified area with
    black, not light yellow.
 
    (Done in patch-544.  A background_pixel field was defined both in
diff --git a/admin/notes/newfile b/admin/notes/newfile
index a682fec..072e966 100644
--- a/admin/notes/newfile
+++ b/admin/notes/newfile
@@ -6,7 +6,7 @@ CHECKLIST FOR ADDING A NEW FILE TO EMACS -*- outline -*-
 format, copyright and license notice, etc).
 
 ** Make sure the filename does not cause the DOS port any problems (8+3).
-Run the `doschk' program like this:
+Run the 'doschk' program like this:
 
     find /path/to/emacs -print | doschk
 
diff --git a/admin/notes/repo b/admin/notes/repo
index f38fd2c..b27a3f4 100644
--- a/admin/notes/repo
+++ b/admin/notes/repo
@@ -73,7 +73,7 @@ removes a file, then remove the corresponding files by hand.
 You may see conflicts in autoload md5sums in comments.  Strictly
 speaking, the right thing to do is merge everything else, resolve the
 conflict by choosing either the master or branch version, then run
-`make -C lisp autoloads' to update the md5sums to the correct master
+'make -C lisp autoloads' to update the md5sums to the correct master
 value before committing.
 
 * Re-adding a file that has been removed from the repository
@@ -96,12 +96,12 @@ which is often more appropriate.
 
 * Undoing a commit (uncommitting)
 
-If you have not pushed the commit, you may be able to use `git reset
+If you have not pushed the commit, you may be able to use 'git reset
 --hard' with a hash argument to revert the your local repo copy to the
 pre-commit state.
 
 If you have pushed  commit, resetting will be ineffective because it
-will only vanish the commit in your local copy.  Instead, use `git
+will only vanish the commit in your local copy.  Instead, use 'git
 revert', giving it the commit ID as argument. This will create a
 new commit that backs out the change. Then push that.
 
@@ -115,7 +115,7 @@ again.
 * Bisecting
 
 This is a semi-automated way to find the revision that introduced a bug.
-Browse `git help bisect' for technical instructions.
+Browse 'git help bisect' for technical instructions.
 
 * Maintaining ChangeLog history
 
diff --git a/admin/notes/unicode b/admin/notes/unicode
index 079173f..bdef4cb 100644
--- a/admin/notes/unicode
+++ b/admin/notes/unicode
@@ -97,11 +97,11 @@ regard to completeness.
 
  * iso-2022 charsets get unified on i/o.
 
-       With the change on 2003-01-06, decoding routines put `charset'
-       property to decoded text, and iso-2022 encoder pay attention
+       With the change on 2003-01-06, decoding routines put the 'charset'
+       property onto decoded text, and iso-2022 encoder pay attention
        to it.  Thus, for instance, reading and writing by
        iso-2022-7bit preserve the original designation sequences.
-       The property name `preferred-charset' may be better?
+       The property name 'preferred-charset' may be better?
 
        We may have to utilize this property to decide a font.
 
diff --git a/admin/quick-install-emacs b/admin/quick-install-emacs
index 911b39b..55510fb 100755
--- a/admin/quick-install-emacs
+++ b/admin/quick-install-emacs
@@ -40,7 +40,7 @@ VERBOSE=''
 
 me="`basename $0`"
 
-# Install commands (if the user specifies the `--verbose' option, it is
+# Install commands (if the user specifies the '--verbose' option, it is
 # passed to these commands, so that feature only works if these commands
 # implement it too)
 LINK='cp -lf'
@@ -58,7 +58,7 @@ unset LANG LC_ALL LC_MESSAGES
 
 # Some messages
 USAGE="Usage: $me [OPTION...] BUILD_TREE [PREFIX]"
-TRY="Try "\`"$me --help' for more information."
+TRY="Try '$me --help' for more information."
 
 # Parse command-line options
 while :; do
@@ -93,7 +93,7 @@ Install emacs quickly
       --help                 display this help and exit
       --version              output version information and exit
 
-$me install emacs \`incrementally,' that is, it will
+$me install emacs "incrementally", that is, it will
 install only those files that have changed since the last time it was
 invoked, and remove any obsolete files from the installation
 directories.  It also uses hard-links into the source and build trees to
@@ -104,9 +104,9 @@ and build directories reside.
 
 Optionally, $me can also remove old versions of
 automatically generated files that are version-specific (such as the
-versioned emacs executables in the \`src' directory).
-The latter action is called \`pruning,' and
-can be enabled using the \`-p' or \`--prune' options.
+versioned emacs executables in the 'src' directory).
+The latter action is called "pruning", and
+can be enabled using the '-p' or '--prune' options.
 EOF
       exit 0
       ;;
@@ -124,7 +124,7 @@ EOF
       set -- `echo $FIRST | sed 's/-\(.\)\(.*\)/-\1 -\2/'` "$@"
       ;;
     -*)
-      echo 1>&2 "$me: unrecognized option "\`"$1'"
+      echo 1>&2 "$me: unrecognized option '$1'"
       echo 1>&2 "$TRY"
       exit 1
       ;;
diff --git a/configure.ac b/configure.ac
index 738ee87..ccb591c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1585,7 +1585,6 @@ fi
 
 dnl checks for header files
 AC_CHECK_HEADERS_ONCE(
-  linux/kd.h
   sys/systeminfo.h
   sys/sysinfo.h
   coff.h pty.h
@@ -4038,6 +4037,8 @@ AC_SUBST(KRB4LIB)
 
 AC_CHECK_HEADERS(valgrind/valgrind.h)
 
+AC_CHECK_MEMBERS([struct unipair.unicode], [], [], [[#include <linux/kd.h>]])
+
 AC_CHECK_FUNCS_ONCE(tzset)
 
 ok_so_far=yes
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index 23590af..1fcc7fd 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -1666,8 +1666,8 @@ variable, Emacs uses the latter.  By default,
 @code{frame-alpha-lower-limit} is 20.
 
 The @code{alpha} frame parameter can also be a cons cell
address@hidden(@samp{active} . @samp{inactive})}, where @samp{active} is the
-opacity of the frame when it is selected, and @samp{inactive} is the
address@hidden(@var{active} . @var{inactive})}, where @var{active} is the
+opacity of the frame when it is selected, and @var{inactive} is the
 opacity when it is not selected.
 @end table
 
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index d019045..18120da 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -1276,13 +1276,13 @@ This function sets the parent of @var{char-table} to 
@var{new-parent}.
 @end defun
 
 @defun char-table-extra-slot char-table n
-This function returns the contents of extra slot @var{n} of
address@hidden  The number of extra slots in a char-table is
+This function returns the contents of extra slot @var{n} (zero based)
+of @var{char-table}.  The number of extra slots in a char-table is
 determined by its subtype.
 @end defun
 
 @defun set-char-table-extra-slot char-table n value
-This function stores @var{value} in extra slot @var{n} of
+This function stores @var{value} in extra slot @var{n} (zero based) of
 @var{char-table}.
 @end defun
 
diff --git a/doc/misc/url.texi b/doc/misc/url.texi
index d94b19f..95fe5ea 100644
--- a/doc/misc/url.texi
+++ b/doc/misc/url.texi
@@ -593,7 +593,7 @@ sending a message to @samp{foo@@bar.com}.  The ``retrieval 
method''
 for such URLs is to open a mail composition buffer in which the
 appropriate content (e.g., the recipient address) has been filled in.
 
-  As defined in RFC 2368, a @code{mailto} URL has the form
+  As defined in RFC 6068, a @code{mailto} URL can have the form
 
 @example
 @samp{mailto:@address@hidden@var{contents}[&@address@hidden
diff --git a/leim/README b/leim/README
index 6a1fb32..d37be97 100644
--- a/leim/README
+++ b/leim/README
@@ -12,13 +12,13 @@ CXTERM-DIC:
 This directory contains source dictionaries (TIT format) for Chinese
 input method distributed with cxterm (Chinese version xterm).  These
 dictionaries are automatically converted to Quail packages (Emacs Lisp
-source files) by `make'.
+source files) by 'make'.
 
 MISC-DIC:
 
 This directory contains various dictionaries for Chinese input
 methods.  These dictionaries are automatically converted to Quail
-packages (Emacs Lisp source files) by `make'.
+packages (Emacs Lisp source files) by 'make'.
 
 SKK-DIC:
 
diff --git a/lib-src/rcs2log b/lib-src/rcs2log
index 2427603..d1bd369 100755
--- a/lib-src/rcs2log
+++ b/lib-src/rcs2log
@@ -414,7 +414,7 @@ sort $SORT_K_OPTIONS </dev/null 2>/dev/null || 
SORT_K_OPTIONS='+2 -4r +4 +0'
 
 
 # Get the full name of each author the logs mention, and set 
initialize_fullname
-# to awk code that initializes the `fullname' awk associative array.
+# to awk code that initializes the 'fullname' awk associative array.
 # Warning: foreign authors (i.e. not known in the passwd file) are mishandled;
 # you have to fix the resulting output by hand.
 
@@ -546,8 +546,8 @@ esac
 
 # Function to print a single log line.
 # We don't use awk functions, to stay compatible with old awk versions.
-# `Log' is the log message.
-# `files' contains the affected files.
+# 'Log' is the log message.
+# 'files' contains the affected files.
 printlogline='{
 
        # Following the GNU coding standards, rewrite
@@ -587,7 +587,7 @@ printlogline='{
        }
 }'
 
-# Pattern to match the `revision' line of rlog output.
+# Pattern to match the 'revision' line of rlog output.
 rlog_revision_pattern='^revision [0-9]+\.[0-9]+(\.[0-9]+\.[0-9]+)*(['"$tab"' 
]+locked by: [^'"$tab"' $,.0-9:;@]*[^'"$tab"' $,:;@][^'"$tab"' 
$,.0-9:;@]*;)?['"$tab"' ]*$'
 
 case $hostname in
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el
index 29c4467..f97667c 100644
--- a/lisp/emacs-lisp/eieio-core.el
+++ b/lisp/emacs-lisp/eieio-core.el
@@ -135,10 +135,10 @@ Currently under control of this var:
       (or (cl--find-class class) class)
     class))
 
-(defun class-p (class)
-  "Return non-nil if CLASS is a valid class vector.
-CLASS is a symbol."                     ;FIXME: Is it a vector or a symbol?
-  (and (symbolp class) (eieio--class-p (cl--find-class class))))
+(defun class-p (x)
+  "Return non-nil if X is a valid class vector.
+X can also be is a symbol."
+  (eieio--class-p (if (symbolp x) (cl--find-class x) x)))
 
 (defun eieio--class-print-name (class)
   "Return a printed representation of CLASS."
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 8aa34c7..7be7cb3 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -110,7 +110,7 @@
                                 ;; CLOS and EIEIO
                                "defgeneric" "defmethod")
                               t))
-                          "\\s-+\\(\\(\\sw\\|\\s_\\)+\\)"))
+                          "\\s-+\\(\\(\\sw\\|\\s_\\|\\\\.\\)+\\)"))
         2)
    (list (purecopy "Variables")
         (purecopy (concat "^\\s-*("
@@ -122,11 +122,11 @@
                                 "defconstant"
                                "defparameter" "define-symbol-macro")
                               t))
-                          "\\s-+\\(\\(\\sw\\|\\s_\\)+\\)"))
+                          "\\s-+\\(\\(\\sw\\|\\s_\\|\\\\.\\)+\\)"))
         2)
    ;; For `defvar', we ignore (defvar FOO) constructs.
    (list (purecopy "Variables")
-        (purecopy (concat "^\\s-*(defvar\\s-+\\(\\(\\sw\\|\\s_\\)+\\)"
+        (purecopy (concat "^\\s-*(defvar\\s-+\\(\\(\\sw\\|\\s_\\|\\\\.\\)+\\)"
                           "[[:space:]\n]+[^)]"))
         1)
    (list (purecopy "Types")
@@ -143,7 +143,7 @@
                                 ;; CLOS and EIEIO
                                 "defclass")
                               t))
-                          "\\s-+'?\\(\\(\\sw\\|\\s_\\)+\\)"))
+                          "\\s-+'?\\(\\(\\sw\\|\\s_\\|\\\\.\\)+\\)"))
         2))
 
   "Imenu generic expression for Lisp mode.  See `imenu-generic-expression'.")
@@ -220,7 +220,7 @@
 (defun lisp--el-match-keyword (limit)
   ;; FIXME: Move to elisp-mode.el.
   (catch 'found
-    (while (re-search-forward "(\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>" limit t)
+    (while (re-search-forward "(\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)\\_>" limit 
t)
       (let ((sym (intern-soft (match-string 1))))
        (when (or (special-form-p sym)
                  (and (macrop sym)
@@ -349,7 +349,7 @@
                   ;; Any whitespace and defined object.
                   "[ \t']*"
                   "\\(([ \t']*\\)?" ;; An opening paren.
-                  "\\(\\(setf\\)[ 
\t]+\\(?:\\sw\\|\\s_\\)+\\|\\(?:\\sw\\|\\s_\\)+\\)?")
+                  "\\(\\(setf\\)[ 
\t]+\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\|\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)?")
           (1 font-lock-keyword-face)
           (3 (let ((type (get (intern-soft (match-string 1)) 
'lisp-define-type)))
                (cond ((eq type 'var) font-lock-variable-name-face)
@@ -373,7 +373,7 @@
                   ;; Any whitespace and defined object.
                   "[ \t']*"
                   "\\(([ \t']*\\)?" ;; An opening paren.
-                  "\\(\\(setf\\)[ 
\t]+\\(?:\\sw\\|\\s_\\)+\\|\\(?:\\sw\\|\\s_\\)+\\)?")
+                  "\\(\\(setf\\)[ 
\t]+\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\|\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)?")
           (1 font-lock-keyword-face)
           (3 (let ((type (get (intern-soft (match-string 1)) 
'lisp-define-type)))
                (cond ((eq type 'var) font-lock-variable-name-face)
@@ -395,22 +395,22 @@
          (lisp--el-match-keyword . 1)
          ;; Exit/Feature symbols as constants.
          (,(concat "(\\(catch\\|throw\\|featurep\\|provide\\|require\\)\\_>"
-                   "[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?")
+                   "[ \t']*\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)?")
            (1 font-lock-keyword-face)
            (2 font-lock-constant-face nil t))
          ;; Erroneous structures.
          (,(concat "(" el-errs-re "\\_>")
            (1 font-lock-warning-face))
          ;; Words inside \\[] tend to be for `substitute-command-keys'.
-         ("\\\\\\\\\\[\\(\\(?:\\sw\\|\\s_\\)+\\)\\]"
+         ("\\\\\\\\\\[\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)\\]"
           (1 font-lock-constant-face prepend))
          ;; Words inside ‘’ and '' and `' tend to be symbol names.
-         ("['`‘]\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)['’]"
+         
("['`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)['’]"
           (1 font-lock-constant-face prepend))
          ;; Constant values.
-         ("\\_<:\\(?:\\sw\\|\\s_\\)+\\_>" 0 font-lock-builtin-face)
+         ("\\_<:\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\_>" 0 font-lock-builtin-face)
          ;; ELisp and CLisp `&' keywords as types.
-         ("\\_<\\&\\(?:\\sw\\|\\s_\\)+\\_>" . font-lock-type-face)
+         ("\\_<\\&\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\_>" . font-lock-type-face)
          ;; ELisp regexp grouping constructs
          (,(lambda (bound)
              (catch 'found
@@ -447,19 +447,19 @@
          (,(concat "(" cl-kws-re "\\_>") . 1)
          ;; Exit/Feature symbols as constants.
          (,(concat "(\\(catch\\|throw\\|provide\\|require\\)\\_>"
-                   "[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?")
+                   "[ \t']*\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)?")
            (1 font-lock-keyword-face)
            (2 font-lock-constant-face nil t))
          ;; Erroneous structures.
          (,(concat "(" cl-errs-re "\\_>")
            (1 font-lock-warning-face))
          ;; Words inside ‘’ and '' and `' tend to be symbol names.
-         ("['`‘]\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)['’]"
+         
("['`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)['’]"
           (1 font-lock-constant-face prepend))
          ;; Constant values.
-         ("\\_<:\\(?:\\sw\\|\\s_\\)+\\_>" 0 font-lock-builtin-face)
+         ("\\_<:\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\_>" 0 font-lock-builtin-face)
          ;; ELisp and CLisp `&' keywords as types.
-         ("\\_<\\&\\(?:\\sw\\|\\s_\\)+\\_>" . font-lock-type-face)
+         ("\\_<\\&\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\_>" . font-lock-type-face)
          ;; This is too general -- rms.
          ;; A user complained that he has functions whose names start with `do'
          ;; and that they get the wrong color.
@@ -482,7 +482,7 @@
   (let* ((firstsym (and listbeg
                         (save-excursion
                           (goto-char listbeg)
-                          (and (looking-at "([ \t\n]*\\(\\(\\sw\\|\\s_\\)+\\)")
+                          (and (looking-at "([ 
\t\n]*\\(\\(\\sw\\|\\s_\\|\\\\.\\)+\\)")
                                (match-string 1)))))
          (docelt (and firstsym
                       (function-get (intern-soft firstsym)
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el
index 6c9cba3..5101925 100644
--- a/lisp/emacs-lisp/syntax.el
+++ b/lisp/emacs-lisp/syntax.el
@@ -106,10 +106,6 @@ Put first the functions more likely to cause a change and 
cheaper to compute.")
                  (point-max))))
   (cons beg end))
 
-(defvar syntax-propertize--done -1
-  "Position up to which syntax-table properties have been set.")
-(make-variable-buffer-local 'syntax-propertize--done)
-
 (defun syntax-propertize--shift-groups (re n)
   (replace-regexp-in-string
    "\\\\(\\?\\([0-9]+\\):"
@@ -290,54 +286,59 @@ The return value is a function suitable for 
`syntax-propertize-function'."
 
 (defun syntax-propertize (pos)
   "Ensure that syntax-table properties are set until POS."
-  (when (and syntax-propertize-function
-             (< syntax-propertize--done pos))
-    ;; (message "Needs to syntax-propertize from %s to %s"
-    ;;          syntax-propertize--done pos)
-    (set (make-local-variable 'parse-sexp-lookup-properties) t)
-    (save-excursion
-      (with-silent-modifications
-        (make-local-variable 'parse-sexp-propertize-done) ;Just in case!
-        (let* ((start (max syntax-propertize--done (point-min)))
-               ;; Avoid recursion!
-               (parse-sexp-propertize-done most-positive-fixnum)
-               (end (max pos
-                         (min (point-max)
-                              (+ start syntax-propertize-chunk-size))))
-               (funs syntax-propertize-extend-region-functions))
-          (while funs
-            (let ((new (funcall (pop funs) start end)))
-              (if (or (null new)
-                      (and (>= (car new) start) (<= (cdr new) end)))
-                  nil
-                (setq start (car new))
-                (setq end (cdr new))
-                ;; If there's been a change, we should go through the
-                ;; list again since this new position may
-                ;; warrant a different answer from one of the funs we've
-                ;; already seen.
-                (unless (eq funs
-                            (cdr syntax-propertize-extend-region-functions))
-                  (setq funs syntax-propertize-extend-region-functions)))))
-          ;; Move the limit before calling the function, so the function
-          ;; can use syntax-ppss.
-          (setq syntax-propertize--done end)
-          ;; (message "syntax-propertizing from %s to %s" start end)
-          (remove-text-properties start end
-                                  '(syntax-table nil syntax-multiline nil))
-          (funcall syntax-propertize-function start end))))))
-
-;;; Link syntax-propertize with the new parse-sexp-propertize.
-
-(setq-default parse-sexp-propertize-function #'syntax--jit-propertize)
-(defun syntax--jit-propertize (charpos)
-  (if (not syntax-propertize-function)
-      (setq parse-sexp-propertize-done (1+ (point-max)))
-    (syntax-propertize charpos)
-    (setq parse-sexp-propertize-done
-          (if (= (point-max) syntax-propertize--done)
-              (1+ (point-max))
-            syntax-propertize--done))))
+  (when (< syntax-propertize--done pos)
+    (if (null syntax-propertize-function)
+        (setq syntax-propertize--done (max (point-max) pos))
+      ;; (message "Needs to syntax-propertize from %s to %s"
+      ;;          syntax-propertize--done pos)
+      (set (make-local-variable 'parse-sexp-lookup-properties) t)
+      (save-excursion
+        (with-silent-modifications
+          (make-local-variable 'syntax-propertize--done) ;Just in case!
+          (let* ((start (max (min syntax-propertize--done (point-max))
+                             (point-min)))
+                 (end (max pos
+                           (min (point-max)
+                                (+ start syntax-propertize-chunk-size))))
+                 (funs syntax-propertize-extend-region-functions))
+            (while funs
+              (let ((new (funcall (pop funs) start end))
+                    ;; Avoid recursion!
+                    (syntax-propertize--done most-positive-fixnum))
+                (if (or (null new)
+                        (and (>= (car new) start) (<= (cdr new) end)))
+                    nil
+                  (setq start (car new))
+                  (setq end (cdr new))
+                  ;; If there's been a change, we should go through the
+                  ;; list again since this new position may
+                  ;; warrant a different answer from one of the funs we've
+                  ;; already seen.
+                  (unless (eq funs
+                              (cdr syntax-propertize-extend-region-functions))
+                    (setq funs syntax-propertize-extend-region-functions)))))
+            ;; Move the limit before calling the function, so the function
+            ;; can use syntax-ppss.
+            (setq syntax-propertize--done end)
+            ;; (message "syntax-propertizing from %s to %s" start end)
+            (remove-text-properties start end
+                                    '(syntax-table nil syntax-multiline nil))
+            ;; Avoid recursion!
+            (let ((syntax-propertize--done most-positive-fixnum))
+              (funcall syntax-propertize-function start end))))))))
+
+;;; Link syntax-propertize with syntax.c.
+
+(defvar syntax-propertize-chunks
+  ;; We're not sure how far we'll go.  In my tests, using chunks of 20000
+  ;; brings to overhead to something negligible.  Passing ‘charpos’ directly
+  ;; also works (basically works line-by-line) but results in an overhead which
+  ;; I thought was a bit too high (like around 50%).
+  2000)
+
+(defun internal--syntax-propertize (charpos)
+  ;; FIXME: Called directly from C.
+  (syntax-propertize (min (+ syntax-propertize-chunks charpos) (point-max))))
 
 ;;; Incrementally compute and memoize parser state.
 
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 22ccf4e..3df820d 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -627,10 +627,11 @@ newline."
   (let ((proc-running-p (and (eshell-interactive-process)
                             (not queue-p)))
        (inhibit-point-motion-hooks t)
-       after-change-functions)
+       (inhibit-modification-hooks t))
     (unless (and proc-running-p
                 (not (eq (process-status
-                          (eshell-interactive-process)) 'run)))
+                          (eshell-interactive-process))
+                          'run)))
       (if (or proc-running-p
              (>= (point) eshell-last-output-end))
          (goto-char (point-max))
@@ -697,7 +698,7 @@ This is done after all necessary filtering has been done."
   (let ((oprocbuf (if process (process-buffer process)
                    (current-buffer)))
        (inhibit-point-motion-hooks t)
-       after-change-functions)
+       (inhibit-modification-hooks t))
     (let ((functions eshell-preoutput-filter-functions))
       (while (and functions string)
        (setq string (funcall (car functions) string))
diff --git a/lisp/faces.el b/lisp/faces.el
index 5485d80..cc8c04d 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2691,10 +2691,12 @@ It is used for characters of no fonts too."
      :background "turquoise")          ; looks OK on tty (becomes cyan)
     (((class color) (background dark))
      :background "steelblue3")         ; looks OK on tty (becomes blue)
-    (((background dark))
+    (((background dark) (min-colors 4))
      :background "grey50")
+    (((background light) (min-colors 4))
+     :background "gray")
     (t
-     :background "gray"))
+     :inherit underline))
   "Face used for a matching paren."
   :group 'paren-showing-faces)
 
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 89fc373..1ec4e13 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -345,17 +345,50 @@ DESCRIPTOR should be an object returned by 
`file-notify-add-watch'."
 
       ;; Call low-level function.
       (when (null (cdr registered))
-       (if handler
-           ;; A file name handler could exist even if there is no local
-           ;; file notification support.
-           (funcall handler 'file-notify-rm-watch desc)
+        (condition-case nil
+            (if handler
+                ;; A file name handler could exist even if there is no local
+                ;; file notification support.
+                (funcall handler 'file-notify-rm-watch desc)
+
+              (funcall
+               (cond
+                ((eq file-notify--library 'gfilenotify) 'gfile-rm-watch)
+                ((eq file-notify--library 'inotify) 'inotify-rm-watch)
+                ((eq file-notify--library 'w32notify) 'w32notify-rm-watch))
+               desc))
+          (file-notify-error nil))))))
+
+;; Temporary declarations.
+(defalias 'gfile-valid-p 'identity)
+
+(defun file-notify-valid-p (descriptor)
+  "Check a watch specified by its DESCRIPTOR.
+DESCRIPTOR should be an object returned by `file-notify-add-watch'."
+  (let* ((desc (if (consp descriptor) (car descriptor) descriptor))
+        (file (if (consp descriptor) (cdr descriptor)))
+         (registered (gethash desc file-notify-descriptors))
+        (dir (car registered))
+        handler)
 
-         (funcall
-          (cond
-           ((eq file-notify--library 'gfilenotify) 'gfile-rm-watch)
-           ((eq file-notify--library 'inotify) 'inotify-rm-watch)
-           ((eq file-notify--library 'w32notify) 'w32notify-rm-watch))
-          desc))))))
+    (when (stringp dir)
+      (setq handler (find-file-name-handler dir 'file-notify-valid-p))
+
+      (and (or ;; It is a directory.
+               (not file)
+               ;; The file is registered.
+               (assoc file (cdr registered)))
+           (if handler
+               ;; A file name handler could exist even if there is no
+               ;; local file notification support.
+               (funcall handler 'file-notify-valid-p descriptor)
+             (funcall
+              (cond
+               ((eq file-notify--library 'gfilenotify) 'gfile-valid-p)
+               ((eq file-notify--library 'inotify) 'inotify-valid-p)
+               ((eq file-notify--library 'w32notify) 'w32notify-valid-p))
+              desc))
+           t))))
 
 ;; The end:
 (provide 'filenotify)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 5ede15b..13ed8c0 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -8329,7 +8329,7 @@ From headers in the original article."
                     (list message-hidden-headers)
                   message-hidden-headers))
        (inhibit-point-motion-hooks t)
-       (after-change-functions nil)
+       (inhibit-modification-hooks t)
        (end-of-headers (point-min)))
     (when regexps
       (save-excursion
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 718471b..dc34a63 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -2037,7 +2037,7 @@ the value of point at the beginning of the line for that 
buffer."
 (defun ibuffer-update-title-and-summary (format)
   (ibuffer-assert-ibuffer-mode)
   ;; Don't do funky font-lock stuff here
-  (let ((after-change-functions nil))
+  (let ((inhibit-modification-hooks t))
     (if (get-text-property (point-min) 'ibuffer-title)
        (delete-region (point-min)
                       (next-single-property-change
@@ -2244,7 +2244,7 @@ If optional arg SILENT is non-nil, do not display 
progress messages."
         (orig (count-lines (point-min) (point)))
         ;; Inhibit font-lock caching tricks, since we're modifying the
         ;; entire buffer at once
-        (after-change-functions nil)
+        (inhibit-modification-hooks t)
         (ext-loaded (featurep 'ibuf-ext))
         (bgroups (if ext-loaded
                      (ibuffer-generate-filter-groups bmarklist)
diff --git a/lisp/international/isearch-x.el b/lisp/international/isearch-x.el
index 31f841d..92e5522 100644
--- a/lisp/international/isearch-x.el
+++ b/lisp/international/isearch-x.el
@@ -71,6 +71,7 @@
 
 (defun isearch-with-keyboard-coding ()
   (interactive)
+  ;; FIXME: What does this after-change-functions binding do here?
   (let ((after-change-functions '(isearch-exit-recursive-edit)))
     (recursive-edit))
   (exit-minibuffer))
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 5f9196d..8c798d5 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -583,11 +583,13 @@ non-nil in a repeated invocation of this function."
                      'fontified nil))
                   (setq pos (next-single-property-change
                               pos 'fontified)))))))))
-    (setq jit-lock-defer-buffers nil)
     ;; Force fontification of the visible parts.
-    (let ((jit-lock-defer-timer nil))
+    (let ((buffers jit-lock-defer-buffers)
+          (jit-lock-defer-timer nil))
+      (setq jit-lock-defer-buffers nil)
       ;; (message "Jit-Defer Now")
-      (sit-for 0)
+      (unless (redisplay)                       ;FIXME: Should we `force'?
+        (setq jit-lock-defer-buffers buffers))
       ;; (message "Jit-Defer Done")
       )))
 
diff --git a/lisp/mail/mailclient.el b/lisp/mail/mailclient.el
index 31da6ee..2fb944b 100644
--- a/lisp/mail/mailclient.el
+++ b/lisp/mail/mailclient.el
@@ -62,10 +62,9 @@ supported.  Defaults to non-nil on Windows, nil otherwise."
         (mapcar
          (lambda (char)
            (cond
-            ((eq char ?\x20) "%20")   ;; space
             ((eq char ?\n) "%0D%0A")  ;; newline
-            ((string-match "[-a-zA-Z0-9_:/address@hidden" (char-to-string 
char))
-             (char-to-string char))   ;; printable
+            ((string-match "[-a-zA-Z0-9._~]" (char-to-string char))
+             (char-to-string char))   ;; unreserved as per RFC 6068
             (t                        ;; everything else
              (format "%%%02x" char)))) ;; escape
          ;; Convert string to list of chars
@@ -125,6 +124,13 @@ The mail client is taken to be the handler of mailto URLs."
                      (< (point) delimline))
            (replace-match "\n"))
          (let ((case-fold-search t)
+               (mime-charset-pattern
+                (concat
+                 "^content-type:[ \t]*text/plain;"
+                 "\\(?:[ \t\n]*\\(?:format\\|delsp\\)=\"?[-a-z0-9]+\"?;\\)*"
+                 "[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?"))
+               coding-system
+               character-coding
                ;; Use the external browser function to send the
                ;; message.
                (browse-url-mailto-function nil))
@@ -135,6 +141,15 @@ The mail client is taken to be the handler of mailto URLs."
             (concat
              (save-excursion
                (narrow-to-region (point-min) delimline)
+               (goto-char (point-min))
+               (setq coding-system
+                     (if (re-search-forward mime-charset-pattern nil t)
+                         (coding-system-from-name (match-string 1))
+                       'undecided))
+               (setq character-coding
+                     (mail-fetch-field "content-transfer-encoding"))
+               (when character-coding
+                 (setq character-coding (downcase character-coding)))
                (concat
                 "mailto:";
                 ;; some of the headers according to RFC822
@@ -160,18 +175,31 @@ The mail client is taken to be the handler of mailto 
URLs."
                               (mailclient-encode-string-as-url subj))
                     ""))))
              ;; body
-             (concat
-              (mailclient-url-delim) "body="
-              (mailclient-encode-string-as-url
-               (if mailclient-place-body-on-clipboard-flag
-                   (progn
-                     (clipboard-kill-ring-save
-                      (+ 1 delimline) (point-max))
-                     (concat
-                      "*** E-Mail body has been placed on clipboard, "
-                      "please paste it here! ***"))
-                 ;; else
-                 (buffer-substring (+ 1 delimline) (point-max))))))))))))
+             (mailclient-url-delim) "body="
+             (progn
+               (delete-region (point-min) delimline)
+               (unless (null character-coding)
+                 ;; mailto: and clipboard need UTF-8 and cannot deal with
+                 ;; Content-Transfer-Encoding or Content-Type.
+                 ;; FIXME: There is code duplication here with rmail.el.
+                 (set-buffer-multibyte nil)
+                 (cond
+                  ((string= character-coding "base64")
+                   (base64-decode-region (point-min) (point-max)))
+                  ((string= character-coding "quoted-printable")
+                   (mail-unquote-printable-region (point-min) (point-max)
+                                                  nil nil t))
+                  (t (error "unsupported Content-Transfer-Encoding: %s"
+                            character-coding)))
+                 (decode-coding-region (point-min) (point-max) coding-system))
+               (mailclient-encode-string-as-url
+                (if mailclient-place-body-on-clipboard-flag
+                    (progn
+                      (clipboard-kill-ring-save (point-min) (point-max))
+                      (concat
+                       "*** E-Mail body has been placed on clipboard, "
+                       "please paste it here! ***"))
+                  (buffer-string)))))))))))
 
 (provide 'mailclient)
 
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 6584733..d6ce31a 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1111,12 +1111,12 @@ This does not delete the region; it acts like 
\\[kill-ring-save]."
     ;; Delete, but make the undo-list entry share with the kill ring.
     ;; First, delete just one char, so in case buffer is being modified
     ;; for the first time, the undo list records that fact.
-    (let (before-change-functions after-change-functions)
+    (let ((inhibit-modification-hooks t))
       (delete-region beg
                     (+ beg (if (> end beg) 1 -1))))
     (let ((buffer-undo-list buffer-undo-list))
       ;; Undo that deletion--but don't change the undo list!
-      (let (before-change-functions after-change-functions)
+      (let ((inhibit-modification-hooks t))
        (primitive-undo 1 buffer-undo-list))
       ;; Now delete the rest of the specified region,
       ;; but don't record it.
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index f818fcd..2a7f1a5 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -132,6 +132,7 @@ It is used for TCP/IP devices."
     (file-newer-than-file-p . tramp-handle-file-newer-than-file-p)
     (file-notify-add-watch . tramp-handle-file-notify-add-watch)
     (file-notify-rm-watch . tramp-handle-file-notify-rm-watch)
+    (file-notify-valid-p . tramp-handle-file-notify-valid-p)
     (file-ownership-preserved-p . ignore)
     (file-readable-p . tramp-handle-file-exists-p)
     (file-regular-p . tramp-handle-file-regular-p)
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 4dfdcd7..cf42b59 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -443,6 +443,7 @@ Every entry is a list (NAME ADDRESS).")
     (file-newer-than-file-p . tramp-handle-file-newer-than-file-p)
     (file-notify-add-watch . tramp-gvfs-handle-file-notify-add-watch)
     (file-notify-rm-watch . tramp-handle-file-notify-rm-watch)
+    (file-notify-valid-p . tramp-handle-file-notify-valid-p)
     (file-ownership-preserved-p . ignore)
     (file-readable-p . tramp-gvfs-handle-file-readable-p)
     (file-regular-p . tramp-handle-file-regular-p)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 79b024e..8598f0e 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1008,6 +1008,7 @@ of command line.")
     (file-newer-than-file-p . tramp-sh-handle-file-newer-than-file-p)
     (file-notify-add-watch . tramp-sh-handle-file-notify-add-watch)
     (file-notify-rm-watch . tramp-handle-file-notify-rm-watch)
+    (file-notify-valid-p . tramp-handle-file-notify-valid-p)
     (file-ownership-preserved-p . tramp-sh-handle-file-ownership-preserved-p)
     (file-readable-p . tramp-sh-handle-file-readable-p)
     (file-regular-p . tramp-handle-file-regular-p)
@@ -3727,6 +3728,14 @@ Fall back to normal file name handler if no Tramp 
handler exists."
        ;; gvfs-monitor-dir.
        ((setq command (tramp-get-remote-gvfs-monitor-dir v))
        (setq filter 'tramp-sh-file-gvfs-monitor-dir-process-filter
+             events
+             (cond
+              ((and (memq 'change flags) (memq 'attribute-change flags))
+               '(created changed changes-done-hint moved deleted
+                         attribute-changed))
+              ((memq 'change flags)
+               '(created changed changes-done-hint moved deleted))
+              ((memq 'attribute-change flags) '(attribute-changed)))
              sequence `(,command ,localname)))
        ;; inotifywait.
        ((setq command (tramp-get-remote-inotifywait v))
@@ -3734,8 +3743,11 @@ Fall back to normal file name handler if no Tramp 
handler exists."
              events
              (cond
               ((and (memq 'change flags) (memq 'attribute-change flags))
-               "create,modify,move,delete,attrib")
-              ((memq 'change flags) "create,modify,move,delete")
+               (concat "create,modify,move,moved_from,moved_to,move_self,"
+                       "delete,delete_self,attrib"))
+              ((memq 'change flags)
+               (concat "create,modify,move,moved_from,moved_to,move_self,"
+                       "delete,delete_self"))
               ((memq 'attribute-change flags) "attrib"))
              sequence `(,command "-mq" "-e" ,events ,localname)))
        ;; None.
@@ -3758,12 +3770,15 @@ Fall back to normal file name handler if no Tramp 
handler exists."
           (mapconcat 'identity sequence " "))
        (tramp-message v 6 "Run `%s', %S" (mapconcat 'identity sequence " ") p)
        (tramp-set-connection-property p "vector" v)
+       ;; Needed for `tramp-sh-file-gvfs-monitor-dir-process-filter'.
+       (tramp-compat-process-put p 'events events)
        (tramp-compat-set-process-query-on-exit-flag p nil)
        (set-process-filter p filter)
        p))))
 
 (defun tramp-sh-file-gvfs-monitor-dir-process-filter (proc string)
-  "Read output from \"gvfs-monitor-dir\" and add corresponding file-notify 
events."
+  "Read output from \"gvfs-monitor-dir\" and add corresponding \
+file-notify events."
   (let ((remote-prefix
         (with-current-buffer (process-buffer proc)
           (file-remote-p default-directory)))
@@ -3798,7 +3813,8 @@ Fall back to normal file name handler if no Tramp handler 
exists."
        ;; Usually, we would add an Emacs event now.  Unfortunately,
        ;; `unread-command-events' does not accept several events at
        ;; once.  Therefore, we apply the callback directly.
-       (tramp-compat-funcall 'file-notify-callback object)))
+       (when (member (cadr object) (tramp-compat-process-get proc 'events))
+         (tramp-compat-funcall 'file-notify-callback object))))
 
     ;; Save rest of the string.
     (when (zerop (length string)) (setq string nil))
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index c4f0f1f..5910d1f 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -247,6 +247,7 @@ See `tramp-actions-before-shell' for more info.")
     (file-newer-than-file-p . tramp-handle-file-newer-than-file-p)
     (file-notify-add-watch . tramp-handle-file-notify-add-watch)
     (file-notify-rm-watch . tramp-handle-file-notify-rm-watch)
+    (file-notify-valid-p . tramp-handle-file-notify-valid-p)
     (file-ownership-preserved-p . ignore)
     (file-readable-p . tramp-handle-file-exists-p)
     (file-regular-p . tramp-handle-file-regular-p)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 0969048..8b6ad7f 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2070,7 +2070,7 @@ ARGS are the arguments OPERATION has been called with."
                  'dired-print-file 'dired-shell-call-process))
     default-directory)
    ;; PROC.
-   ((eq operation 'file-notify-rm-watch)
+   ((member operation (list 'file-notify-rm-watch 'file-notify-valid-p))
     (when (processp (nth 0 args))
       (with-current-buffer (process-buffer (nth 0 args))
        default-directory)))
@@ -3421,6 +3421,10 @@ of."
   (tramp-message proc 6 "Kill %S" proc)
   (kill-process proc))
 
+(defun tramp-handle-file-notify-valid-p (proc)
+  "Like `file-notify-valid-p' for Tramp files."
+  (and proc (processp proc) (memq (process-status proc) '(run open))))
+
 ;;; Functions for establishing connection:
 
 ;; The following functions are actions to be taken when seeing certain
@@ -3615,7 +3619,7 @@ This is needed in order to hide 
`last-coding-system-used', which is set
 for process communication also."
   (with-current-buffer (process-buffer proc)
     ;; FIXME: If there is a gateway process, we need communication
-    ;; between several processes.  Too complicated to implement, so we
+    ;; between several processes.  Too complicate to implement, so we
     ;; read output from all processes.
     (let ((p (if (tramp-get-connection-property proc "gateway" nil) nil proc))
          buffer-read-only last-coding-system-used)
diff --git a/lisp/obsolete/fast-lock.el b/lisp/obsolete/fast-lock.el
index 7e3dd66..3985d51 100644
--- a/lisp/obsolete/fast-lock.el
+++ b/lisp/obsolete/fast-lock.el
@@ -200,7 +200,7 @@
    `(let* (,@(append varlist
                      '((modified (buffer-modified-p)) (buffer-undo-list t)
                        (inhibit-read-only t) (inhibit-point-motion-hooks t)
-                       before-change-functions after-change-functions
+                       (inhibit-modification-hooks t)
                        deactivate-mark buffer-file-name buffer-file-truename)))
      ,@body
      (when (and (not modified) (buffer-modified-p))
diff --git a/lisp/obsolete/longlines.el b/lisp/obsolete/longlines.el
index 01939da..7cb13ce 100644
--- a/lisp/obsolete/longlines.el
+++ b/lisp/obsolete/longlines.el
@@ -143,7 +143,7 @@ newlines are indicated with a symbol."
                     'longlines-window-change-function nil t))
         (let ((buffer-undo-list t)
               (inhibit-read-only t)
-             (after-change-functions nil)
+             (inhibit-modification-hooks t)
               (mod (buffer-modified-p))
              buffer-file-name buffer-file-truename)
           ;; Turning off undo is OK since (spaces + newlines) is
@@ -184,7 +184,7 @@ newlines are indicated with a symbol."
     (if longlines-showing
         (longlines-unshow-hard-newlines))
     (let ((buffer-undo-list t)
-         (after-change-functions nil)
+         (inhibit-modification-hooks t)
           (inhibit-read-only t)
          buffer-file-name buffer-file-truename)
       (if longlines-decoded
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index d59948e..2d9bd48 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -171,7 +171,7 @@
             (let ((buffer-undo-list t) (inhibit-read-only t)
                   ,@(unless (featurep 'xemacs)
                       '((inhibit-point-motion-hooks t) deactivate-mark))
-                  before-change-functions after-change-functions
+                  (inhibit-modification-hooks t)
                   buffer-file-name buffer-file-truename)
               ,@body)
           (and (not ,modified) (buffer-modified-p)
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index a1e26b9..dcd5116 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -3304,10 +3304,9 @@ accomplish that conveniently."
                 (setq source-eval t)
                 (let ((init ',(append (cdr c-emacs-variable-inits)
                                       (cdr c-lang-variable-inits))))
-                  (while init
-                    (setq current-var (caar init))
-                    (set (caar init) (eval (cadar init)))
-                    (setq init (cdr init)))))
+                  (dolist (var-init init)
+                    (setq current-var (car var-init))
+                    (set (car var-init) (eval (cadr var-init))))))
 
             (error
              (if current-var
@@ -3333,10 +3332,9 @@ accomplish that conveniently."
         (c-make-emacs-variables-local)
         (condition-case err
 
-            (while init
-              (setq current-var (caar init))
-              (set (caar init) (eval (cadar init)))
-              (setq init (cdr init)))
+            (dolist (var-init init)
+              (setq current-var (car var-init))
+              (set (car var-init) (eval (cadr var-init))))
 
           (error
            (if current-var
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index b8ba170..5da6508 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -3672,7 +3672,7 @@ the sections using `cperl-pod-head-face', 
`cperl-pod-face',
         is-REx is-x-REx REx-subgr-start REx-subgr-end was-subgr i2 hairy-RE
         (case-fold-search nil) (inhibit-read-only t) (buffer-undo-list t)
         (modified (buffer-modified-p)) overshoot is-o-REx name
-        (after-change-functions nil)
+        (inhibit-modification-hooks t)
         (cperl-font-locking t)
         (use-syntax-state (and cperl-syntax-state
                                (>= min (car cperl-syntax-state))))
@@ -8882,7 +8882,7 @@ Delay of auto-help controlled by `cperl-lazy-help-time'."
 (defun cperl-font-lock-unfontify-region-function (beg end)
   (let* ((modified (buffer-modified-p)) (buffer-undo-list t)
         (inhibit-read-only t) (inhibit-point-motion-hooks t)
-        before-change-functions after-change-functions
+        (inhibit-modification-hooks t)
         deactivate-mark buffer-file-name buffer-file-truename)
     (remove-text-properties beg end '(face nil))
     (if (and (not modified) (buffer-modified-p))
diff --git a/lisp/term/README b/lisp/term/README
index 35715d9..d01f133 100644
--- a/lisp/term/README
+++ b/lisp/term/README
@@ -7,22 +7,22 @@ terminal types.
 
    When Emacs opens a new terminal, it checks the TERM environment variable
 to see what type of terminal the user is running on.  (If there is an entry
-for TERM in the `term-file-aliases' variable, Emacs uses the associated value
+for TERM in the 'term-file-aliases' variable, Emacs uses the associated value
 in place of TERM in the following.)  Emacs searches for an elisp file named
 "term/${TERM}.el", and if one exists, loads it.  If Emacs finds no
 suitable file, then it strips the last hyphen and what follows it from TERM,
 and tries again.  If that still doesn't yield a file, then the previous hyphen
 is stripped, and so on until all hyphens are gone.  For example, if the
-terminal type is `aaa-48-foo', Emacs will try first `term/aaa-48-foo.el', then
-`term/aaa-48.el' and finally `term/aaa.el'.  Emacs stops searching at the
+terminal type is 'aaa-48-foo', Emacs will try first 'term/aaa-48-foo.el', then
+'term/aaa-48.el' and finally 'term/aaa.el'.  Emacs stops searching at the
 first file found, and will not load more than one file for any terminal.  Note
 that it is not an error if Emacs is unable to find a terminal initialization
 file; in that case, it will simply proceed with the next step without loading
 any files.
 
    Once the file has been loaded (or the search failed), Emacs tries to call a
-function named `terminal-init-TERMINALNAME' (eg `terminal-init-aaa-48' for the
-`aaa-48' terminal) in order to initialize the terminal.  Once again, if the
+function named 'terminal-init-TERMINALNAME' (eg 'terminal-init-aaa-48' for the
+'aaa-48' terminal) in order to initialize the terminal.  Once again, if the
 function is not found, Emacs strips the last component of the name and tries
 again using the shorter name.  This search is independent of the previous file
 search, so that you can have terminal initialization functions for a family of
@@ -40,7 +40,7 @@ declaration.  Simply loading the file should not have any 
side effect.
 given terminal, when the first frame is created on it.  The function is not
 called for subsequent frames on the same terminal.  Therefore, terminal-init-*
 functions should only modify terminal-local variables (such as
-`local-function-key-map') and terminal parameters.  For example, it is not
+'local-function-key-map') and terminal parameters.  For example, it is not
 correct to modify frame parameters, since the modifications will only be
 applied for the first frame opened on the terminal.
 
@@ -51,7 +51,7 @@ mind.
    First, about keycap names.  Your terminal package can create any keycap
 cookies it likes, but there are good reasons to stick to the set recognized by
 the X-windows code whenever possible.  The key symbols recognized by Emacs
-are listed in src/term.c; look for the string `keys' in that file.
+are listed in src/term.c; look for the string 'keys' in that file.
 
    For one thing, it means that you'll have the same Emacs key bindings on in
 terminal mode as on an X console.  If there are differences, you can bet
@@ -61,7 +61,7 @@ they'll frustrate you after you've forgotten about them.
 about.  It tries to bind many of them to useful things at startup, before your
 .emacs is read (so you can override them).  In some ways, the X keysym standard
 is a admittedly poor one; it's incomplete, and not well matched to the set of
-`virtual keys' that UNIX terminfo(3) provides.  But, trust us, the alternatives
+'virtual keys' that UNIX terminfo(3) provides.  But, trust us, the alternatives
 were worse.
 
    This doesn't mean that if your terminal has a "Cokebottle" key you shouldn't
@@ -70,7 +70,7 @@ that set, try to pattern them on the standard terminfo 
variable names for
 clarity; also, for a fighting chance that your binding may be useful to someone
 else someday.
 
-   For example, if your terminal has a `find' key, observe that terminfo
+   For example, if your terminal has a 'find' key, observe that terminfo
 supports a key_find capability and call your cookie [find].
 
 Here is a complete list, with corresponding X keysyms.
@@ -184,14 +184,14 @@ key_f36           FQ                      function key 36
 key_f64                k1                      function key 64
 
 (1) The terminfo documentation says this may be the 'insert character' or
-    `enter insert mode' key.  Accordingly, key_ic is mapped to the `insertchar'
-    keysym if there is also a key_dc key; otherwise it's mapped to `insert'.
-    The presumption is that keyboards with `insert character' keys usually
-    have `delete character' keys paired with them.
+    'enter insert mode' key.  Accordingly, key_ic is mapped to the 'insertchar'
+    keysym if there is also a key_dc key; otherwise it's mapped to 'insert'.
+    The presumption is that keyboards with 'insert character' keys usually
+    have 'delete character' keys paired with them.
 
 (2) If there is no key_next key but there is a key_npage key, key_npage
-    will be bound to the `next' keysym.  If there is no key_previous key but
-    there is a key_ppage key, key_ppage will be bound to the `previous' keysym.
+    will be bound to the 'next' keysym.  If there is no key_previous key but
+    there is a key_ppage key, key_ppage will be bound to the 'previous' keysym.
 
 (3) Sorry, these are not exact but they're the best we can do.
 
@@ -242,7 +242,7 @@ the setup code to bind anything else.
 
    If your terminal's arrow key sequences are so funky that they conflict with
 normal Emacs key bindings, the package should set up a function called
-(enable-foo-arrow-keys), where `foo' becomes the terminal name, and leave
+(enable-foo-arrow-keys), where 'foo' becomes the terminal name, and leave
 it up to the user's .emacs file whether to call it.
 
    Before writing a terminal-support package, it's a good idea to read the
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index b64de47..0d9157a 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -2654,8 +2654,7 @@ Return an alist of (TYPE MATCH)."
   (save-excursion
     (let ((children (widget-get widget :children))
          (inhibit-read-only t)
-         before-change-functions
-         after-change-functions)
+         (inhibit-modification-hooks t))
       (cond (before
             (goto-char (widget-get before :entry-from)))
            (t
@@ -2679,8 +2678,7 @@ Return an alist of (TYPE MATCH)."
     (let ((buttons (copy-sequence (widget-get widget :buttons)))
          button
          (inhibit-read-only t)
-         before-change-functions
-         after-change-functions)
+         (inhibit-modification-hooks t))
       (while buttons
        (setq button (car buttons)
              buttons (cdr buttons))
@@ -2691,8 +2689,7 @@ Return an alist of (TYPE MATCH)."
     (let ((entry-from (widget-get child :entry-from))
          (entry-to (widget-get child :entry-to))
          (inhibit-read-only t)
-         before-change-functions
-         after-change-functions)
+         (inhibit-modification-hooks t))
       (widget-delete child)
       (delete-region entry-from entry-to)
       (set-marker entry-from nil)
diff --git a/src/README b/src/README
index ef08d14..adc782c 100644
--- a/src/README
+++ b/src/README
@@ -4,16 +4,15 @@ See the end of the file for license conditions.
 
 This directory contains the source files for the C component of GNU Emacs.
 Nothing in this directory is needed for using Emacs once it is built
-and installed, if the dumped Emacs (on Unix systems) is copied elsewhere.
+and installed, if the dumped Emacs is copied elsewhere.
 
 See the files ../README and then ../INSTALL for installation instructions.
 
-Under GNU and Unix systems, the file `Makefile.in' is used as a
-template by the script `../configure' to produce `Makefile'.  This
-is the file which actually controls the compilation of Emacs.
-All of this should work transparently to the user; you should only
-need to run `../configure', and then type `make'.
-
+The file 'Makefile.in' is used as a template by the script
+'../configure' to produce 'Makefile'.  This is the file which actually
+controls the compilation of Emacs C source files.  All of this should
+work transparently; you should only need to change to the parent
+directory, run './configure', and then run 'make'.
 
 This file is part of GNU Emacs.
 
diff --git a/src/indent.c b/src/indent.c
index 7e8f0a5..ded1843 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2195,7 +2195,27 @@ whether or not it is currently displayed in some window. 
 */)
         was originally hscrolled, the goal column is interpreted as
         an addition to the hscroll amount.  */
       if (lcols_given)
-       move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
+       {
+         move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
+         /* If we find ourselves in the middle of an overlay string
+            which includes a newline after current string position,
+            we need to move by lines until we get out of the string,
+            and then reposition point at the requested X coordinate;
+            if we don't, the cursor will be placed just after the
+            string, which might not be the requested column.  */
+         if (nlines > 0 && it.area == TEXT_AREA)
+           {
+             while (it.method == GET_FROM_STRING
+                    && !it.string_from_display_prop_p
+                    && memchr (SSDATA (it.string) + IT_STRING_BYTEPOS (it),
+                               '\n',
+                               SBYTES (it.string) - IT_STRING_BYTEPOS (it)))
+               {
+                 move_it_by_lines (&it, 1);
+                 move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
+               }
+           }
+       }
 
       SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
       bidi_unshelve_cache (itdata, 0);
diff --git a/src/inotify.c b/src/inotify.c
index eddad73..2486563 100644
--- a/src/inotify.c
+++ b/src/inotify.c
@@ -323,12 +323,12 @@ is managed internally and there is no corresponding 
inotify_init.  Use
 
   watch_descriptor = make_watch_descriptor (watchdesc);
 
-  /* Delete existing watch object. */
+  /* Delete existing watch object.  */
   watch_object = Fassoc (watch_descriptor, watch_list);
   if (!NILP (watch_object))
       watch_list = Fdelete (watch_object, watch_list);
 
-  /* Store watch object in watch list. */
+  /* Store watch object in watch list.  */
   watch_object = Fcons (watch_descriptor, callback);
   watch_list = Fcons (watch_object, watch_list);
 
@@ -351,12 +351,12 @@ See inotify_rm_watch(2) for more information.
     xsignal2 (Qfile_notify_error,
              build_string ("Could not rm watch"), watch_descriptor);
 
-  /* Remove watch descriptor from watch list. */
+  /* Remove watch descriptor from watch list.  */
   watch_object = Fassoc (watch_descriptor, watch_list);
   if (!NILP (watch_object))
     watch_list = Fdelete (watch_object, watch_list);
 
-  /* Cleanup if no more files are watched. */
+  /* Cleanup if no more files are watched.  */
   if (NILP (watch_list))
     {
       emacs_close (inotifyfd);
@@ -367,6 +367,21 @@ See inotify_rm_watch(2) for more information.
   return Qt;
 }
 
+DEFUN ("inotify-valid-p", Finotify_valid_p, Sinotify_valid_p, 1, 1, 0,
+       doc: /* "Check a watch specified by its WATCH-DESCRIPTOR.
+
+WATCH-DESCRIPTOR should be an object returned by `inotify-add-watch'.
+
+A watch can become invalid if the file or directory it watches is
+deleted, or if the watcher thread exits abnormally for any other
+reason.  Removing the watch by calling `inotify-rm-watch' also makes
+it invalid.  */)
+     (Lisp_Object watch_descriptor)
+{
+  Lisp_Object watch_object = Fassoc (watch_descriptor, watch_list);
+  return NILP (watch_object) ? Qnil : Qt;
+}
+
 void
 syms_of_inotify (void)
 {
@@ -401,6 +416,7 @@ syms_of_inotify (void)
 
   defsubr (&Sinotify_add_watch);
   defsubr (&Sinotify_rm_watch);
+  defsubr (&Sinotify_valid_p);
 
   staticpro (&watch_list);
 
diff --git a/src/nsfns.m b/src/nsfns.m
index 89b9f7c..9c805ac 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1009,7 +1009,7 @@ unwind_create_frame (Lisp_Object frame)
       x_free_frame_resources (f);
       free_glyphs (f);
 
-#ifdef GLYPH_DEBUG
+#if defined GLYPH_DEBUG && defined ENABLE_CHECKING
       /* Check that reference counts are indeed correct.  */
       eassert (dpyinfo->terminal->image_cache->refcount == 
image_cache_refcount);
 #endif
diff --git a/src/syntax.c b/src/syntax.c
index fcd6d01..de45c50 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -181,6 +181,7 @@ static void scan_sexps_forward (struct lisp_parse_state *,
                                 ptrdiff_t, ptrdiff_t, ptrdiff_t, EMACS_INT,
                                 bool, Lisp_Object, int);
 static bool in_classes (int, Lisp_Object);
+static void parse_sexp_propertize (ptrdiff_t charpos);
 
 /* This setter is used only in this file, so it can be private.  */
 static void
@@ -247,12 +248,12 @@ SETUP_SYNTAX_TABLE (ptrdiff_t from, ptrdiff_t count)
   gl_state.offset = 0;
   if (parse_sexp_lookup_properties)
     {
-      if (count > 0 || from > BEGV)
-       update_syntax_table (count > 0 ? from : from - 1, count, true, Qnil);
-      if (gl_state.e_property > parse_sexp_propertize_done)
+      if (count > 0)
+       update_syntax_table_forward (from, true, Qnil);
+      else if (from > BEGV)
        {
-         gl_state.e_property = parse_sexp_propertize_done;
-         gl_state.e_property_truncated = true;
+         update_syntax_table (from - 1, count, true, Qnil);
+         parse_sexp_propertize (from - 1);
        }
     }
 }
@@ -478,33 +479,44 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, 
bool init,
 static void
 parse_sexp_propertize (ptrdiff_t charpos)
 {
-  EMACS_INT modiffs = CHARS_MODIFF;
-  safe_call1 (Vparse_sexp_propertize_function,
-             make_number (1 + charpos));
-  if (modiffs != CHARS_MODIFF)
-    error ("parse-sexp-propertize-function modified the buffer!");
-  if (parse_sexp_propertize_done <= charpos)
-    error ("parse-sexp-propertize-function did not move"
-          " parse-sexp-propertize-done");
-  SETUP_SYNTAX_TABLE (charpos, 1);
+  EMACS_INT zv = ZV;
+  if (syntax_propertize__done <= charpos
+      && syntax_propertize__done < zv)
+    {
+      EMACS_INT modiffs = CHARS_MODIFF;
+      safe_call1 (Qinternal__syntax_propertize,
+                 make_number (min (zv, 1 + charpos)));
+      if (modiffs != CHARS_MODIFF)
+       error ("parse-sexp-propertize-function modified the buffer!");
+      if (syntax_propertize__done <= charpos
+         && syntax_propertize__done < zv)
+       error ("parse-sexp-propertize-function did not move"
+              " syntax-propertize--done");
+      SETUP_SYNTAX_TABLE (charpos, 1);
+    }
+  else if (gl_state.e_property > syntax_propertize__done)
+    {
+      gl_state.e_property = syntax_propertize__done;
+      gl_state.e_property_truncated = true;
+    }
 }
 
 void
 update_syntax_table_forward (ptrdiff_t charpos, bool init,
-                    Lisp_Object object)
+                            Lisp_Object object)
 {
-  if (!(gl_state.e_property_truncated))
-    update_syntax_table (charpos, 1, init, object);
-  if ((gl_state.e_property > parse_sexp_propertize_done
-       || gl_state.e_property_truncated)
-      && NILP (object))
+  if (gl_state.e_property_truncated)
     {
-      if (parse_sexp_propertize_done > charpos)
-       {
-         gl_state.e_property = parse_sexp_propertize_done;
-         gl_state.e_property_truncated = true;
-       }
-      else
+      eassert (NILP (object));
+      eassert (charpos >= gl_state.e_property);
+      eassert (charpos >= syntax_propertize__done);
+      parse_sexp_propertize (charpos);
+    }
+  else
+    {
+      update_syntax_table (charpos, 1, init, object);
+      if (gl_state.e_property > syntax_propertize__done
+         && NILP (object))
        parse_sexp_propertize (charpos);
     }
 }
@@ -2332,13 +2344,13 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, 
ptrdiff_t stop,
          && SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0) == style
          && (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ?
              (nesting > 0 && --nesting == 0) : nesting < 0))
-       /* we have encountered a comment end of the same style
+       /* We have encountered a comment end of the same style
           as the comment sequence which began this comment
-          section */
+          section.  */
        break;
       if (code == Scomment_fence
          && style == ST_COMMENT_STYLE)
-       /* we have encountered a comment end of the same style
+       /* We have encountered a comment end of the same style
           as the comment sequence which began this comment
           section.  */
        break;
@@ -2346,8 +2358,8 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, 
ptrdiff_t stop,
          && code == Scomment
          && SYNTAX_FLAGS_COMMENT_NESTED (syntax)
          && SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0) == style)
-       /* we have encountered a nested comment of the same style
-          as the comment sequence which began this comment section */
+       /* We have encountered a nested comment of the same style
+          as the comment sequence which began this comment section.  */
        nesting++;
       INC_BOTH (from, from_byte);
       UPDATE_SYNTAX_TABLE_FORWARD (from);
@@ -2363,9 +2375,8 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, 
ptrdiff_t stop,
              ? nesting > 0 : nesting < 0))
        {
          if (--nesting <= 0)
-           /* we have encountered a comment end of the same style
-              as the comment sequence which began this comment
-              section */
+           /* We have encountered a comment end of the same style
+              as the comment sequence which began this comment section.  */
            break;
          else
            {
@@ -2382,9 +2393,8 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, 
ptrdiff_t stop,
              && SYNTAX_FLAGS_COMSTART_SECOND (other_syntax))
          && (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ||
              SYNTAX_FLAGS_COMMENT_NESTED (other_syntax)))
-       /* we have encountered a nested comment of the same style
-          as the comment sequence which began this comment
-          section */
+       /* We have encountered a nested comment of the same style
+          as the comment sequence which began this comment section.  */
        {
          INC_BOTH (from, from_byte);
          UPDATE_SYNTAX_TABLE_FORWARD (from);
@@ -2628,9 +2638,9 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT 
depth, bool sexpflag)
   bool quoted;
   bool mathexit = 0;
   enum syntaxcode code;
-  EMACS_INT min_depth = depth;    /* Err out if depth gets less than this.  */
-  int comstyle = 0;        /* style of comment encountered */
-  bool comnested = 0;      /* whether the comment is nestable or not */
+  EMACS_INT min_depth = depth;  /* Err out if depth gets less than this.  */
+  int comstyle = 0;            /* Style of comment encountered.  */
+  bool comnested = 0;          /* Whether the comment is nestable or not.  */
   ptrdiff_t temp_pos;
   EMACS_INT last_good = from;
   bool found;
@@ -2674,11 +2684,11 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT 
depth, bool sexpflag)
                  SYNTAX_FLAGS_COMSTART_SECOND (other_syntax))
              && parse_sexp_ignore_comments)
            {
-             /* we have encountered a comment start sequence and we
+             /* We have encountered a comment start sequence and we
                 are ignoring all text inside comments.  We must record
                 the comment style this sequence begins so that later,
                 only a comment end of the same style actually ends
-                the comment section */
+                the comment section.  */
              code = Scomment;
              comstyle = SYNTAX_FLAGS_COMMENT_STYLE (other_syntax, syntax);
              comnested |= SYNTAX_FLAGS_COMMENT_NESTED (other_syntax);
@@ -2696,7 +2706,7 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT 
depth, bool sexpflag)
              if (from == stop)
                goto lose;
              INC_BOTH (from, from_byte);
-             /* treat following character as a word constituent */
+             /* Treat following character as a word constituent.  */
            case Sword:
            case Ssymbol:
              if (depth || !sexpflag) break;
@@ -3501,7 +3511,7 @@ Sixth arg COMMENTSTOP non-nil means stop at the start of 
a comment.
       target = XINT (targetdepth);
     }
   else
-    target = TYPE_MINIMUM (EMACS_INT); /* We won't reach this depth */
+    target = TYPE_MINIMUM (EMACS_INT); /* We won't reach this depth.  */
 
   validate_region (&from, &to);
   scan_sexps_forward (&state, XINT (from), CHAR_TO_BYTE (XINT (from)),
@@ -3650,19 +3660,10 @@ Otherwise, that text property is simply ignored.
 See the info node `(elisp)Syntax Properties' for a description of the
 `syntax-table' property.  */);
 
-  DEFVAR_INT ("parse-sexp-propertize-done", parse_sexp_propertize_done,
+  DEFVAR_INT ("syntax-propertize--done", syntax_propertize__done,
              doc: /* Position up to which syntax-table properties have been 
set.  */);
-  parse_sexp_propertize_done = -1;
-
-  DEFVAR_LISP ("parse-sexp-propertize-function",
-              Vparse_sexp_propertize_function,
-         doc: /* Function to set the `syntax-table' text property.
-Called with one argument, the position at which the property is needed.
-After running it, `parse-sexp-propertize-done' should be strictly greater
-than the argument passed.  */);
-  /* Note: Qnil is a temporary (and invalid) value; it will be properly set in
-     syntax.el.  */
-  Vparse_sexp_propertize_function = Qnil;
+  syntax_propertize__done = -1;
+  DEFSYM (Qinternal__syntax_propertize, "internal--syntax-propertize");
 
   words_include_escapes = 0;
   DEFVAR_BOOL ("words-include-escapes", words_include_escapes,
diff --git a/src/syntax.h b/src/syntax.h
index 9c44181..34b652b 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -174,9 +174,10 @@ SYNTAX_TABLE_BYTE_TO_CHAR (ptrdiff_t bytepos)
 
 INLINE void
 UPDATE_SYNTAX_TABLE_FORWARD (ptrdiff_t charpos)
-{
+{ /* Performs just-in-time syntax-propertization.  */
   if (parse_sexp_lookup_properties && charpos >= gl_state.e_property)
-    update_syntax_table_forward (charpos + gl_state.offset, false, 
gl_state.object);
+    update_syntax_table_forward (charpos + gl_state.offset,
+                                false, gl_state.object);
 }
 
 /* Make syntax table state (gl_state) good for CHARPOS, assuming it is
diff --git a/src/terminal.c b/src/terminal.c
index d7c16d9..80c6aa2 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -28,7 +28,7 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include "coding.h"
 #include "keyboard.h"
 
-#ifdef HAVE_LINUX_KD_H
+#if HAVE_STRUCT_UNIPAIR_UNICODE
 # include <errno.h>
 # include <linux/kd.h>
 # include <sys/ioctl.h>
@@ -532,7 +532,7 @@ selected frame's terminal).  */)
   return store_terminal_param (decode_live_terminal (terminal), parameter, 
value);
 }
 
-#if HAVE_LINUX_KD_H
+#if HAVE_STRUCT_UNIPAIR_UNICODE
 
 /* Compute the glyph code table for T.  */
 
@@ -575,7 +575,7 @@ calculate_glyph_code_table (struct terminal *t)
 Lisp_Object
 terminal_glyph_code (struct terminal *t, int ch)
 {
-#if HAVE_LINUX_KD_H
+#if HAVE_STRUCT_UNIPAIR_UNICODE
   if (t->type == output_termcap)
     {
       /* As a hack, recompute the table when CH is the maximum
diff --git a/src/w32notify.c b/src/w32notify.c
index ab6cd12..a6b5c19 100644
--- a/src/w32notify.c
+++ b/src/w32notify.c
@@ -464,6 +464,21 @@ filter_list_to_flags (Lisp_Object filter_list)
   return flags;
 }
 
+/* Like report_file_error, but reports a file-notify-error instead.  */
+static void
+report_w32notify_error (const char *string, Lisp_Object name)
+{
+  Lisp_Object data = CONSP (name) || NILP (name) ? name : list1 (name);
+  synchronize_system_messages_locale ();
+  char *str = strerror (errno);
+  Lisp_Object errstring
+    = code_convert_string_norecord (build_unibyte_string (str),
+                                   Vlocale_coding_system, 0);
+  Lisp_Object errdata = Fcons (errstring, data);
+
+  xsignal (Qfile_notify_error, Fcons (build_string (string), errdata));
+}
+
 DEFUN ("w32notify-add-watch", Fw32notify_add_watch,
        Sw32notify_add_watch, 3, 3, 0,
        doc: /* Add a watch for filesystem events pertaining to FILE.
@@ -528,8 +543,8 @@ generate notifications correctly, though.  */)
       || (w32_major_version == 5 && w32_major_version < 1))
     {
       errno = ENOSYS;
-      report_file_error ("Watching filesystem events is not supported",
-                        Qnil);
+      report_w32notify_error ("Watching filesystem events is not supported",
+                             Qnil);
     }
 
   /* filenotify.el always passes us a directory, either the parent
@@ -573,11 +588,11 @@ generate notifications correctly, though.  */)
                                              Vlocale_coding_system, 0);
          else
            lisp_errstr = build_string (errstr);
-         report_file_error ("Cannot watch file",
-                            Fcons (lisp_errstr, Fcons (file, Qnil)));
+         report_w32notify_error ("Cannot watch file",
+                                 Fcons (lisp_errstr, Fcons (file, Qnil)));
        }
       else
-       report_file_error ("Cannot watch file", Fcons (file, Qnil));
+       report_w32notify_error ("Cannot watch file", Fcons (file, Qnil));
     }
   /* Store watch object in watch list. */
   watch_descriptor = make_pointer_integer (dirwatch);
@@ -611,8 +626,8 @@ WATCH-DESCRIPTOR should be an object returned by 
`w32notify-add-watch'.  */)
     }
 
   if (status == -1)
-    report_file_error ("Invalid watch descriptor", Fcons (watch_descriptor,
-                                                         Qnil));
+    report_w32notify_error ("Invalid watch descriptor", Fcons 
(watch_descriptor,
+                                                              Qnil));
 
   return Qnil;
 }
@@ -628,6 +643,30 @@ w32_get_watch_object (void *desc)
   return NILP (watch_list) ? Qnil : assoc_no_quit (descriptor, watch_list);
 }
 
+DEFUN ("w32notify-valid-p", Fw32notify_valid_p, Sw32notify_valid_p, 1, 1, 0,
+       doc: /* "Check a watch specified by its WATCH-DESCRIPTOR for validity.
+
+WATCH-DESCRIPTOR should be an object returned by `w32notify-add-watch'.
+
+A watch can become invalid if the directory it watches is deleted, or if
+the watcher thread exits abnormally for any other reason.  Removing the
+watch by calling `w32notify-rm-watch' also makes it invalid.  */)
+     (Lisp_Object watch_descriptor)
+{
+  Lisp_Object watch_object = Fassoc (watch_descriptor, watch_list);
+
+  if (!NILP (watch_object))
+    {
+      struct notification *dirwatch =
+       (struct notification *)XINTPTR (watch_descriptor);
+      if (w32_valid_pointer_p (dirwatch, sizeof(struct notification))
+         && dirwatch->dir != NULL)
+       return Qt;
+    }
+
+  return Qnil;
+}
+
 void
 globals_of_w32notify (void)
 {
@@ -648,6 +687,7 @@ syms_of_w32notify (void)
 
   defsubr (&Sw32notify_add_watch);
   defsubr (&Sw32notify_rm_watch);
+  defsubr (&Sw32notify_valid_p);
 
   staticpro (&watch_list);
 
diff --git a/test/automated/file-notify-tests.el 
b/test/automated/file-notify-tests.el
index 99b0ebc..3e92925 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -39,9 +39,6 @@
 (require 'filenotify)
 (require 'tramp)
 
-(declare-function tramp-get-remote-gvfs-monitor-dir "tramp-sh")
-(declare-function tramp-get-remote-inotifywait "tramp-sh")
-
 ;; There is no default value on w32 systems, which could work out of the box.
 (defconst file-notify-test-remote-temporary-file-directory
   (cond
@@ -71,10 +68,14 @@
 
   (when (and file-notify--test-tmpfile
              (file-exists-p file-notify--test-tmpfile))
-    (delete-file file-notify--test-tmpfile))
+    (if (directory-name-p file-notify--test-tmpfile)
+        (delete-directory file-notify--test-tmpfile)
+      (delete-file file-notify--test-tmpfile)))
   (when (and file-notify--test-tmpfile1
              (file-exists-p file-notify--test-tmpfile1))
-    (delete-file file-notify--test-tmpfile1))
+    (if (directory-name-p file-notify--test-tmpfile1)
+        (delete-directory file-notify--test-tmpfile1)
+      (delete-file file-notify--test-tmpfile1)))
 
   (setq file-notify--test-tmpfile nil)
   (setq file-notify--test-tmpfile1 nil)
@@ -140,22 +141,12 @@ being the result.")
   "Test availability of `file-notify'."
   (skip-unless (file-notify--test-local-enabled))
   ;; Report the native library which has been used.
-  (message
-   "%s library: `%s'"
-   (if (null (file-remote-p temporary-file-directory)) "Local" "Remote")
-   (if (null (file-remote-p temporary-file-directory))
-       file-notify--library
-     ;; FIXME: This is rude, using Tramp internal functions.  Maybe
-     ;; the upcoming `file-notify-available-p' could return the used
-     ;; native library.
-     (with-parsed-tramp-file-name temporary-file-directory nil
-         (cond
-          ;; gvfs-monitor-dir.
-          ((tramp-get-remote-gvfs-monitor-dir v) 'gfilenotify)
-          ;; inotifywait.
-          ((tramp-get-remote-inotifywait v) 'inotify)
-          ;; None.
-          (t (ert-fail "No remote library available"))))))
+  (if (null (file-remote-p temporary-file-directory))
+      (message "Local library: `%s'" file-notify--library)
+    (message "Remote command: `%s'"
+             (replace-regexp-in-string
+              "<[[:digit:]]+>\\'" ""
+              (process-name (cdr file-notify--test-remote-enabled-checked)))))
   (should
    (setq file-notify--test-desc
          (file-notify-add-watch temporary-file-directory '(change) 'ignore)))
@@ -261,7 +252,7 @@ Don't wait longer than TIMEOUT seconds for the events to be 
delivered."
        (setq file-notify--test-events ,outer))))
 
 (ert-deftest file-notify-test02-events ()
-  "Check file creation/removal notifications."
+  "Check file creation/change/removal notifications."
   (skip-unless (file-notify--test-local-enabled))
   (unwind-protect
       (progn
@@ -317,11 +308,12 @@ Don't wait longer than TIMEOUT seconds for the events to 
be delivered."
         (dolist (result file-notify--test-results)
           ;;(message "%s" (ert-test-result-messages result))
           (when (ert-test-failed-p result)
-            (ert-fail (cadr (ert-test-result-with-condition-condition 
result))))))
+            (ert-fail
+             (cadr (ert-test-result-with-condition-condition result))))))
     (file-notify--test-cleanup)))
 
 (file-notify--deftest-remote file-notify-test02-events
-  "Check file creation/removal notifications for remote files.")
+  "Check file creation/change/removal notifications for remote files.")
 
 (require 'autorevert)
 (setq auto-revert-notify-exclude-dir-regexp "nothing-to-be-excluded"
@@ -329,8 +321,7 @@ Don't wait longer than TIMEOUT seconds for the events to be 
delivered."
       auto-revert-stop-on-user-input nil)
 
 (ert-deftest file-notify-test03-autorevert ()
-  "Check autorevert via file notification.
-This test is skipped in batch mode."
+  "Check autorevert via file notification."
   (skip-unless (file-notify--test-local-enabled))
   ;; `auto-revert-buffers' runs every 5".  And we must wait, until the
   ;; file has been reverted.
@@ -371,8 +362,9 @@ This test is skipped in batch mode."
            (with-current-buffer (get-buffer-create "*Messages*")
              (file-notify--wait-for-events
               timeout
-              (string-match (format "Reverting buffer `%s'." (buffer-name buf))
-                            (buffer-string))))
+              (string-match
+                (format-message "Reverting buffer `%s'." (buffer-name buf))
+                (buffer-string))))
            (should (string-match "another text" (buffer-string)))))
 
       ;; Exit.
@@ -380,8 +372,62 @@ This test is skipped in batch mode."
       (file-notify--test-cleanup))))
 
 (file-notify--deftest-remote file-notify-test03-autorevert
-  "Check autorevert via file notification for remote files.
-This test is skipped in batch mode.")
+  "Check autorevert via file notification for remote files.")
+
+(ert-deftest file-notify-test04-file-validity ()
+  "Check `file-notify-valid-p' for files."
+  (skip-unless (file-notify--test-local-enabled))
+  (unwind-protect
+      (let ((temporary-file-directory (make-temp-file
+                                       "file-notify-test-parent" t)))
+        (setq file-notify--test-tmpfile (file-notify--test-make-temp-name))
+        (setq file-notify--test-desc (file-notify-add-watch
+                                      file-notify--test-tmpfile
+                                      '(change)
+                                      #'file-notify--test-event-handler))
+        (file-notify--test-with-events
+            3 3 (lambda (events)
+                  (should (equal '(created changed deleted)
+                                 (mapcar #'cadr events))))
+          (should (file-notify-valid-p file-notify--test-desc))
+          (write-region
+           "any text" nil file-notify--test-tmpfile nil 'no-message)
+          (should (file-notify-valid-p file-notify--test-desc))
+          (delete-directory temporary-file-directory t))
+        ;; After deleting the parent, the descriptor must not be valid
+        ;; anymore.
+        (should-not (file-notify-valid-p file-notify--test-desc)))
+
+    ;; Exit.
+    (file-notify--test-cleanup)))
+
+(file-notify--deftest-remote file-notify-test04-file-validity
+  "Check `file-notify-valid-p' via file notification for remote files.")
+
+(ert-deftest file-notify-test05-dir-validity ()
+  "Check `file-notify-valid-p' for directories."
+  (skip-unless (file-notify--test-local-enabled))
+  (unwind-protect
+      (progn
+        (setq file-notify--test-tmpfile (file-name-as-directory
+                                         (file-notify--test-make-temp-name)))
+        (make-directory file-notify--test-tmpfile)
+        (setq file-notify--test-desc (file-notify-add-watch
+                                      file-notify--test-tmpfile
+                                      '(change)
+                                      #'file-notify--test-event-handler))
+        (should (file-notify-valid-p file-notify--test-desc))
+        (delete-directory file-notify--test-tmpfile t)
+        ;; After deleting the directory, the descriptor must not be
+        ;; valid anymore.
+        (read-event nil nil 0.1)
+        (should-not (file-notify-valid-p file-notify--test-desc)))
+
+    ;; Exit.
+    (file-notify--test-cleanup)))
+
+(file-notify--deftest-remote file-notify-test05-dir-validity
+  "Check `file-notify-valid-p' via file notification for remote directories.")
 
 (defun file-notify-test-all (&optional interactive)
   "Run all tests for \\[file-notify]."



reply via email to

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