emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master a84225d 2/2: Merge branch 'master' of git.sv.gnu.or


From: Noah Friedman
Subject: [Emacs-diffs] master a84225d 2/2: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Date: Mon, 17 Aug 2015 20:01:31 +0000

branch: master
commit a84225d29c40a8cf3f860d2b58517102eef33436
Merge: b892438 62f65ab
Author: Noah Friedman <address@hidden>
Commit: Noah Friedman <address@hidden>

    Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
---
 ChangeLog.2                          |  802 ++++++++++-
 admin/admin.el                       |   13 -
 admin/authors.el                     |    2 +-
 admin/notes/unicode                  |    1 -
 admin/unidata/makefile.w32-in        |   56 -
 build-aux/gitlog-to-emacslog         |    2 +-
 configure.ac                         |   45 +-
 doc/emacs/makefile.w32-in            |  153 --
 doc/emacs/misc.texi                  |    2 +-
 doc/emacs/mule.texi                  |   10 +-
 doc/lispintro/makefile.w32-in        |   85 --
 doc/lispref/help.texi                |   12 +-
 doc/lispref/makefile.w32-in          |  128 --
 doc/lispref/strings.texi             |   73 +-
 doc/lispref/windows.texi             |   12 +-
 doc/misc/makefile.w32-in             |  431 ------
 doc/misc/tramp.texi                  |    6 +-
 etc/NEWS                             |   39 +-
 leim/makefile.w32-in                 |  237 ---
 lib-src/makefile.w32-in              |  482 ------
 lib-src/ntlib.c                      |    2 +-
 lib/makefile.w32-in                  |  347 -----
 lisp/abbrev.el                       |    2 +-
 lisp/allout-widgets.el               |    4 +-
 lisp/allout.el                       |    5 +-
 lisp/avoid.el                        |    6 +-
 lisp/button.el                       |    6 +-
 lisp/calc/calc-help.el               |    2 +-
 lisp/calendar/holidays.el            |   21 +-
 lisp/calendar/icalendar.el           |    4 +-
 lisp/cedet/mode-local.el             |    9 +-
 lisp/cedet/pulse.el                  |   41 +-
 lisp/cedet/semantic/bovine/scm.el    |    2 +-
 lisp/cedet/semantic/wisent/python.el |    3 -
 lisp/cedet/srecode/srt-mode.el       |    4 +-
 lisp/character-fold.el               |   14 +-
 lisp/cus-start.el                    |    2 +-
 lisp/cus-theme.el                    |    4 +-
 lisp/custom.el                       |   12 +-
 lisp/descr-text.el                   |   11 +-
 lisp/electric.el                     |    6 +-
 lisp/emacs-lisp/byte-run.el          |    4 +-
 lisp/emacs-lisp/cl-extra.el          |   24 +-
 lisp/emacs-lisp/cl-generic.el        |   23 +-
 lisp/emacs-lisp/derived.el           |    5 +-
 lisp/emacs-lisp/eieio-opt.el         |    4 +-
 lisp/emacs-lisp/eieio.el             |    2 +-
 lisp/emacs-lisp/find-func.el         |   26 +-
 lisp/emacs-lisp/lisp-mnt.el          |   21 +-
 lisp/emacs-lisp/macroexp.el          |    4 +-
 lisp/emacs-lisp/map-ynp.el           |    6 +-
 lisp/emacs-lisp/nadvice.el           |    6 +-
 lisp/emacs-lisp/package.el           |  187 ++-
 lisp/emacs-lisp/seq.el               |    7 +-
 lisp/emacs-lisp/tabulated-list.el    |    2 +-
 lisp/emacs-lisp/timer.el             |    2 +-
 lisp/env.el                          |    4 +-
 lisp/epa-file.el                     |    7 +-
 lisp/epa.el                          |    2 +-
 lisp/erc/erc-button.el               |    5 +-
 lisp/facemenu.el                     |   10 +-
 lisp/faces.el                        |   37 +-
 lisp/ffap.el                         |   81 +-
 lisp/files.el                        |   41 +-
 lisp/font-lock.el                    |    2 +-
 lisp/format.el                       |    6 +-
 lisp/frame.el                        |    4 +-
 lisp/fringe.el                       |    2 +-
 lisp/gnus/message.el                 |    2 +-
 lisp/help-fns.el                     |  126 +-
 lisp/help-mode.el                    |    2 +
 lisp/help.el                         |   10 +-
 lisp/image.el                        |    4 +-
 lisp/info.el                         |    6 +-
 lisp/international/fontset.el        |   37 +-
 lisp/international/mule-cmds.el      |   22 +-
 lisp/international/mule-conf.el      |    8 +-
 lisp/international/mule.el           |    2 +-
 lisp/isearch.el                      |   11 +-
 lisp/loadhist.el                     |   13 +-
 lisp/mail/mail-utils.el              |    7 +-
 lisp/mail/rmail.el                   |  172 ++-
 lisp/mail/rmailout.el                |   40 +-
 lisp/mail/sendmail.el                |   67 +
 lisp/makefile.w32-in                 |  728 ---------
 lisp/mouse.el                        |    2 +-
 lisp/net/tramp-adb.el                |   86 +-
 lisp/net/tramp-sh.el                 |   52 +-
 lisp/obsolete/complete.el            |    2 +-
 lisp/obsolete/vi.el                  |    2 +-
 lisp/org/ob-core.el                  |    8 +-
 lisp/org/ob-fortran.el               |    5 +-
 lisp/org/org-src.el                  |    6 +-
 lisp/org/org.el                      |  214 ++--
 lisp/org/ox-latex.el                 |    2 +-
 lisp/org/ox-man.el                   |    2 +-
 lisp/org/ox-odt.el                   |    4 +-
 lisp/org/ox-texinfo.el               |    2 +-
 lisp/play/dunnet.el                  |    2 +-
 lisp/progmodes/cc-defs.el            |   73 +-
 lisp/progmodes/cc-engine.el          |   12 +-
 lisp/progmodes/cc-fonts.el           |   26 +-
 lisp/progmodes/cc-langs.el           |  201 ++--
 lisp/progmodes/compile.el            |    6 +-
 lisp/progmodes/elisp-mode.el         |  226 +++-
 lisp/progmodes/project.el            |   42 +-
 lisp/progmodes/prolog.el             |    4 +-
 lisp/progmodes/python.el             |   12 +
 lisp/progmodes/ruby-mode.el          |    4 +-
 lisp/progmodes/sh-script.el          |    2 +-
 lisp/progmodes/verilog-mode.el       | 2732 +++++++++++++++++-----------------
 lisp/progmodes/xref.el               |   87 +-
 lisp/replace.el                      |   23 +-
 lisp/scroll-bar.el                   |    2 +-
 lisp/simple.el                       |   35 +-
 lisp/startup.el                      |   64 +-
 lisp/subr.el                         |    8 +-
 lisp/term/common-win.el              |    6 +-
 lisp/term/x-win.el                   | 1604 ++++++++++----------
 lisp/textmodes/rst.el                |    2 +-
 lisp/textmodes/texinfmt.el           |    2 +-
 lisp/uniquify.el                     |   28 +-
 lisp/window.el                       |   14 +-
 make-dist                            |   21 +-
 nt/INSTALL.OLD                       |  752 ----------
 nt/config.nt                         | 1847 -----------------------
 nt/configure.bat                     |  954 +------------
 nt/emacs-src.tags                    |    6 -
 nt/envadd.bat                        |   43 -
 nt/gmake.defs                        |  333 -----
 nt/inc/ms-w32.h                      |   14 +
 nt/makefile.w32-in                   |  465 ------
 nt/multi-install-info.bat            |   40 -
 nt/nmake.defs                        |  294 ----
 nt/paths.h                           |   66 -
 nt/zipdist.bat                       |   43 -
 src/alloc.c                          |   16 +-
 src/bidi.c                           |    8 +-
 src/character.h                      |   24 +
 src/charset.c                        |    2 +-
 src/composite.c                      |    2 +-
 src/dispnew.c                        |    2 +-
 src/doc.c                            |   70 +-
 src/doprnt.c                         |   60 +-
 src/editfns.c                        |  202 ++--
 src/emacs.c                          |   34 +-
 src/image.c                          |  229 ++--
 src/keyboard.c                       |  247 ++--
 src/keyboard.h                       |    2 +-
 src/lisp.h                           |   22 +-
 src/lread.c                          |   11 +-
 src/makefile.w32-in                  | 1725 ---------------------
 src/nsimage.m                        |    2 +-
 src/regex.c                          |   14 +-
 src/regex.h                          |    4 +-
 src/syntax.c                         |    5 +-
 src/sysdep.c                         |    6 +-
 src/w32fns.c                         |   71 +-
 src/xdisp.c                          |   88 +-
 src/xfaces.c                         |    8 +-
 src/xselect.c                        |    6 +-
 src/xsettings.c                      |    4 +-
 test/automated/elisp-mode-tests.el   |  431 +++++-
 test/automated/ert-tests.el          |    4 +
 test/automated/seq-tests.el          |    7 +-
 test/redisplay-testsuite.el          |   40 +
 166 files changed, 5832 insertions(+), 12875 deletions(-)

diff --git a/ChangeLog.2 b/ChangeLog.2
index 4d36087..d4b7fd1 100644
--- a/ChangeLog.2
+++ b/ChangeLog.2
@@ -1,3 +1,794 @@
+2015-08-15  Paul Eggert  <address@hidden>
+
+       substitute-command-keys a few more doc strings
+       * lisp/allout.el (outlineify-sticky):
+       * lisp/files.el (hack-one-local-variable--obsolete):
+       * lisp/help-fns.el (help-fns--obsolete, describe-variable):
+       Use substitute-command-keys on some doc strings so that
+       they don't use hard-coded key bindings or quoting styles.
+
+       Fix quoting in Fformat calls
+       * src/image.c (xbm_read_bitmap_data, xbm_load_image, xbm_load)
+       (xpm_load, xpm_load_image, pbm_load, png_load_body)
+       (jpeg_load_body, tiff_load, gif_load, imagemagick_load_image)
+       (imagemagick_load, svg_load, svg_load_image, gs_load)
+       (x_kill_gs_process):
+       * src/lread.c (load_warn_old_style_backquotes):
+       * src/xfaces.c (load_pixmap):
+       * src/xselect.c (x_clipboard_manager_error_1):
+       Quote diagnostics according to user preference when calling
+       Fformat or its derivatives.
+
+2015-08-15  Glenn Morris  <address@hidden>
+
+       * admin/admin.el (set-version, set-copyright): Remove deleted files.
+
+2015-08-15  Stephen Leake  <address@hidden>
+
+       Allow describe-function helpers to access buffer-local values.
+       This will be used by cedet/mode-local.el `describe-mode-local-override'
+       on `help-fns-describe-function-functions' in upstream CEDET.
+       * lisp/help-fns.el (describe-function-orig-buffer): New, let-bound in
+       `describe-function'.
+       (describe-function): Bind it, save it on the help xref stack.
+
+       Handle pulse-background being nil
+       * lisp/cedet/pulse.el (pulse-lighten-highlight): Inherit
+       pulse-background, handle it being nil.
+
+2015-08-15  Paul Eggert  <address@hidden>
+
+       Fix "\`" confusion in Lisp strings
+       * admin/authors.el (authors-canonical-author-name):
+       Fix typo by using "\\`" not "\`" in string RE.
+       * lisp/obsolete/complete.el (PC-complete-as-file-name):
+       * lisp/obsolete/vi.el (vi-backward-blank-delimited-word):
+       * lisp/progmodes/verilog-mode.el (verilog-mode-map):
+       Use plain "`", not the equivalent-but-confusing "\`", in strings.
+       * lisp/textmodes/texinfmt.el: Fix comment likewise.
+
+2015-08-15  Dani Moncayo  <address@hidden>
+
+       Remove 'nt/zipdist.bat' (no longer used)
+       * nt/zipdist.bat: Remove - no longer used.
+
+2015-08-15  Jürgen Hötzel  <address@hidden>
+
+       * lisp/net/tramp-sh.el (tramp-remote-selinux-p): Use "selinuxenabled"
+       rather than "getenforce".
+       (tramp-sh-handle-set-file-selinux-context): Do not
+       cache SELinux context if not all context components are given.
+
+2015-08-15  Eli Zaretskii  <address@hidden>
+
+       Add doc strings to 2 help-mode.el functions
+       * lisp/help-mode.el (help-mode-setup, help-mode-finish): Add doc
+       strings.  (Bug#21263)
+
+       Remove files used by the old MS-Windows specific build procedure
+       * admin/unidata/makefile.w32-in:
+       * doc/emacs/makefile.w32-in:
+       * doc/lispintro/makefile.w32-in:
+       * doc/lispref/makefile.w32-in:
+       * doc/misc/makefile.w32-in:
+       * leim/makefile.w32-in:
+       * lib-src/makefile.w32-in:
+       * lib/makefile.w32-in:
+       * lisp/makefile.w32-in:
+       * nt/INSTALL.OLD:
+       * nt/config.nt:
+       * nt/emacs-src.tags:
+       * nt/envadd.bat:
+       * nt/gmake.defs:
+       * nt/makefile.w32-in:
+       * nt/multi-install-info.bat:
+       * nt/nmake.defs:
+       * nt/paths.h:
+       * src/makefile.w32-in: Files deleted.
+       * nt/configure.bat: Remove everything except the blurb about the
+       new build procedure.
+       * make-dist: Remove references to makefile.w32-in in various
+       directories, and to files in nt/ that were deleted.
+       * etc/NEWS: Mention the fact that the files were dropped.
+
+2015-08-15  Paul Eggert  <address@hidden>
+
+       * doc/emacs/mule.texi (Charsets): Give fuller title for ISO-IR.
+       (Bug#21248)
+
+2015-08-14  Paul Eggert  <address@hidden>
+
+       Default to inotify instead of gfile
+       * configure.ac (with_file_notification): Fix typo that
+       prevented suppression of file notification if HAVE_NS.
+       (NOTIFY_OBJ): Prefer inotify to gfile if both exist and
+       with_file_notification is 'yes' (Bug#21241).
+       * etc/NEWS: Mention this.
+
+       Fix broken URLs for ISO-IR
+       * doc/emacs/mule.texi (Charsets):
+       * lisp/international/mule-conf.el:
+       Fix broken URL (Bug#21248).
+
+       Low-level diagnostics now use ‘text-quoting-style’
+       * src/doprnt.c (doprnt):
+       Format ` and ' as per ‘text-quoting-style’.
+       * src/xdisp.c (vmessage, message): Mention that the format should
+       not contain ` or '.
+
+       Prefer ‘format’ to ‘substitute-command-keys’
+       * src/character.h (uLSQM, uRSQM): Move here ...
+       * src/doc.c (uLSQM, uRSQM): ... from here.
+       * src/doc.c (Fsubstitute_command_keys):
+       * src/syntax.c (Finternal_describe_syntax_value):
+       * lisp/cedet/mode-local.el (mode-local-print-binding)
+       (mode-local-describe-bindings-2):
+       * lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
+       * lisp/cus-theme.el (describe-theme-1):
+       * lisp/descr-text.el (describe-text-properties-1, describe-char):
+       * lisp/emacs-lisp/cl-extra.el (cl--describe-class):
+       * lisp/emacs-lisp/cl-generic.el (cl--generic-describe):
+       * lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
+       * lisp/emacs-lisp/package.el (describe-package-1):
+       * lisp/faces.el (describe-face):
+       * lisp/help-fns.el (help-fns--key-bindings)
+       (help-fns--compiler-macro, help-fns--parent-mode)
+       (help-fns--obsolete, help-fns--interactive-only)
+       (describe-function-1, describe-variable):
+       * lisp/help.el (describe-mode):
+       Prefer ‘format’ to ‘substitute-command-keys’ when either will do
+       to implement quoting style.  This generally makes the code simpler.
+
+       Extend ‘format’ to translate curved quotes
+       This is a followup to the recent doc string change, and deals with
+       diagnostics and the like.  This patch is more conservative than
+       the doc string change, in that the behavior of ‘format’ changes
+       only if its first arg contains curved quotes and the user prefers
+       straight or grave quotes.  (Come to think of it, perhaps we should
+       be similarly conservative with doc strings too, but that can wait.)
+       The upside of this conservatism is that existing usage is almost
+       surely unaffected.  The downside is that we'll eventually have to
+       change Emacs's format strings to use curved quotes in places where
+       the user might want curved quotes, but that's a simple and
+       mechanical translation that I'm willing to do later.  (Bug#21222)
+       * doc/lispref/help.texi (Keys in Documentation):
+       Move description of text-quoting-style from here ...
+       * doc/lispref/strings.texi (Formatting Strings):
+       ... to here, and describe new behavior of ‘format’.
+       * etc/NEWS: Describe new behavior.
+       * lisp/calc/calc-help.el (calc-describe-thing):
+       * lisp/emacs-lisp/derived.el (derived-mode-make-docstring):
+       * lisp/info.el (Info-find-index-name):
+       Use ‘concat’ rather than ‘format’ to avoid misinterpretation
+       of recently-added curved quotes.
+       * src/doc.c (uLSQM0, uLSQM1, uLSQM2, uRSQM0, uRSQM1, uRSQM2):
+       Move from here ...
+       * src/lisp.h: ... to here.
+       * src/doc.c (text_quoting_style): New function.
+       (Fsubstitute_command_keys): Use it.
+       * src/editfns.c (Fformat): Implement new behavior.
+       * src/lisp.h (enum text_quoting_style): New enum.
+
+2015-08-14  Stefan Monnier  <address@hidden>
+
+       * src/keyboard.c: Use false/true instead of 0/1 for booleans
+       * src/keyboard.h (struct kboard): Mark kbd_queue_has_data as boolean.
+
+2015-08-14  Michael Albinus  <address@hidden>
+
+       * lisp/net/tramp-sh.el (tramp-sh-handle-file-acl): Do not redirect
+       stderr to /dev/null, this is done in `tramp-send-command-and-check'.
+
+2015-08-14  Jürgen Hötzel  <address@hidden>
+
+       Flush file properties in Tramp
+       * lisp/net/tramp-sh.el (tramp-sh-handle-set-file-modes)
+       (tramp-sh-handle-set-file-times):
+       * lisp/net/tramp-adb.el (tramp-adb-handle-set-file-modes)
+       (tramp-adb-handle-set-file-times): Flush the file properties of
+       the directory.
+
+2015-08-14  Ronnie Schnell  <address@hidden>
+
+       * doc/emacs/misc.text (Amusements): Fixed typo.
+
+2015-08-14  Eli Zaretskii  <address@hidden>
+
+       Don't miss warnings about removing string text properties while dumping
+       * src/alloc.c (purecopy): Warn about removing a string's text
+       properties even when the same string was already pure-copied
+       earlier.
+       * lisp/progmodes/elisp-mode.el (elisp--xref-format)
+       (elisp--xref-format-extra): Fix the commentary.
+
+2015-08-13  Stefan Monnier  <address@hidden>
+
+       * lisp/progmodes/sh-script.el (sh-mode): Handle .cshrc (bug#21049)
+
+2015-08-13  Magnus Henoch  <address@hidden>
+
+       * lisp/progmodes/compile.el: Assume 8-wide TABs (bug#21038)
+       * lisp/progmodes/compile.el: Use lexical-binding.
+       (compilation-move-to-column): Assume 8-wide TABs (bug#21038).
+
+2015-08-13  Stefan Monnier  <address@hidden>
+
+       (uniquify-ask-about-buffer-names-p): Remove, unused (bug#21037)
+       * lisp/uniquify.el: Remove redundant `:group's.
+
+2015-08-13  Jürgen Hötzel  <address@hidden>
+
+       * lisp/net/tramp-adb.el
+       (tramp-adb-handle-directory-files-and-attributes): Make a copy of
+       result to prevent modification of the tramp-cache by side effects.
+       Use the correct cache key.
+
+2015-08-13  Paul Eggert  <address@hidden>
+
+       Make add_to_log varargs
+       * src/alloc.c (run_finalizer_handler):
+       * src/charset.c (load_charset_map_from_vector):
+       * src/nsimage.m (ns_load_image):
+       * src/xfaces.c (load_pixmap, load_color2):
+       Simplify, now that add_to_log has a variable number of args.
+       * src/image.c (image_error): Take a variable number of args.
+       Callers simplified.
+       * src/lisp.h (add_to_log, vadd_to_log): Adjust to new APIs.
+       * src/xdisp.c (format_nargs, vadd_to_log): New functions.
+       (add_to_log): Make varargs, and reimplement in terms of vadd_to_log.
+       * src/xfaces.c (merge_face_ref): Fix typo that omitted color name.
+
+       Optional args for holiday-greek-orthodox-easter
+       * etc/NEWS: Document this.
+       * lisp/calendar/holidays.el (holiday-greek-orthodox-easter):
+       Add optional args N and STRING, mimicking the API and code of
+       ‘holiday-easter-etc’.  From suggestion by Foivos S. Zakkak (Bug#21256).
+
+2015-08-13  Stephen Leake  <address@hidden>
+
+       xref-find-definitions: Exclude more generic function items.
+       * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Add doc 
string.
+       (cl--generic-find-defgeneric-regexp): New.
+       (find-function-regexp-alist): Add it.
+       * lisp/emacs-lisp/find-func.el (find-feature-regexp): Move here from
+       elisp-mode.el, change to search for ";;; Code:"
+       (find-alias-regexp): Move here from elisp-mode.el, cleaned up.
+       (find-function-regexp-alist): Add them.
+       * lisp/progmodes/elisp-mode.el:
+       (elisp--xref-format, elisp--xref-format-extra): Change back to defvar 
due
+       to bug#21237.
+       (elisp--xref-find-definitions): Exclude co-located default methods for
+       generic functions. Also exclude implicitly declared defgeneric.
+       (elisp--xref-find-definitions): Handle C source properly. Exclude minor
+       mode variables defined by 'define-minor-mode'.
+       * test/automated/elisp-mode-tests.el: Declare generic functions, add
+       tests for them.
+       (xref-elisp-test-run): Fix bug.
+       (emacs-test-dir): Improve initial value.
+       (find-defs-defun-defvar-el): Don't expect defvar.
+       (find-defs-feature-el): Match change to find-feature-regexp.
+
+2015-08-13  Eli Zaretskii  <address@hidden>
+
+       Improve warning about purecopy of strings with properties
+       * src/alloc.c (purecopy): Show the offending string with the
+       warning about removing its text properties.
+
+2015-08-12  Alan Mackenzie  <address@hidden>
+
+       Introduce new macros to cover Emacs's new names in cl-lib.el.
+       This also eliminates `mapcan' warnings in XEmacs.
+       progmodes/cc-defs.el (c--mapcan-status): new variable to characterise
+       [X]Emacs versions.
+       (top-level): Require either 'cl or 'cl-lib, depending on
+       c--mapcan-status.
+       Change this back to cc-external-require from an eval-when-compile
+       require.
+       (c--mapcan, c--set-difference, c--intersection, c--macroexpand-all)
+       (c--delete-duplicates): New macros which expand into either old or new
+       names.
+       (c-make-keywords-re, c-lang-defconst, c-lang-const) Use the new macros
+       rather than the old names.
+       progmodes/cc-engine.el (c-declare-lang-variables): Use c--mapcan rather
+       than mapcan.
+       progmodes/cc-fonts.el (c-compose-keywords-list): Use c--mapcan.
+       progmodes/cc-langs.el (top-level): Require either 'cl or 'cl-lib,
+       depending on c--mapcan-status.
+       (c-filter-ops, c-all-op-syntax-tokens, c-assignment-op-regexp)
+       (c-type-start-kwds, c-prefix-spec-kwds, c-specifier-key)
+       (c-not-decl-init-keywords, c-not-primitive-type-keywords)
+       (c-paren-any-kwds, c-<>-sexp-kwds, c-block-stmt-kwds, c-expr-kwds)
+       (c-decl-block-key, c-keywords, c-keywords-obarray)
+       (c-regular-keywords-regexp, c-primary-expr-regexp,
+       c-primary-expr-regexp)
+       (c-block-prefix-disallowed-chars, c-known-type-key,
+       c-nonlabel-token-key)
+       (c-make-init-lang-vars-fun): Use the new macros rather than the old
+       names.
+
+2015-08-12  Oleh Krehel  <address@hidden>
+
+       loadhist.el (read-feature): Conform to completing-read
+       * lisp/loadhist.el (read-feature): According to `completing-read'
+         documentation, if collection is a list, then it must be a list of
+         strings. And not a list of symbols like before.
+
+2015-08-12  David Kastrup  <address@hidden>
+
+       Deal gracefully with up-events (Bug#19746)
+       * keyboard.c (apply_modifiers_uncached, parse_solitary_modifier)
+       (parse_modifiers_uncached): React gracefully to "up-" modifiers:
+       those may easily be injected by user-level Lisp code.
+       (read_key_sequence): Discard unbound up-events like unbound
+       down-events: they are even more likely only relevant for special
+       purposes.
+       While Emacs will not produce up-events on its own currently (those are
+       converted to drag or click events before being converted to
+       Lisp-readable structures), the input queue can be made to contain them
+       by synthesizing events to `unread-command-events'.  Emacs should deal
+       consistently with such events.
+
+2015-08-12  Eli Zaretskii  <address@hidden>
+
+       Fix display of thin lines whose newline has line-height property of t
+       * src/xdisp.c (append_space_for_newline): Don't try to fix ascent
+       and descent values of non-empty glyph rows, since they could have
+       forced low values deliberately.  (Bug#21243)
+
+2015-08-12  Richard Stallman  <address@hidden>
+
+       Offer to combine multiple To or CC fields.
+       * sendmail.el (mail-combine-fields): New function.
+       (mail-send): Call 'mail-combine-fields'.
+
+       Don't decrypt encrypted files.
+       * mail-utils.el (mail-file-babyl-p): Bind epa-inhibit to t.
+
+       Handle encrypted mbox files.
+       * rmailout.el (rmail-output-as-mbox): Decrypt and reencrypt the mbox
+       file if necessary.
+
+       Re-enable mime processing after decryption.  Add 'decrypt' keyword.
+       * rmail.el (rmail-epa-decrypt-1): New subroutine.
+       (rmail-epa-decrypt): rmail-epa-decrypt-1 broken out.
+       In a mime message, reenable Mime and show the parts that
+       were shown before.
+       Add keyword "decrypt" if anything decrypted.
+
+       epa-inhibit inhibits auto-recognition of .gpg files
+       * lisp/epa-file.el (epa-inhibit): New variable.
+       (epa-file-handler): Check epa-inhibit.
+
+2015-08-12  Artur Malabarba  <address@hidden>
+
+       * emacs-lisp/lisp-mnt.el (lm-header): save-excursion
+
+2015-08-11  Fabián Ezequiel Gallina  <address@hidden>
+
+       Respect python.el imenu when semantic-mode is off
+       Fixes debbugs:21220
+       * lisp/cedet/semantic/wisent/python.el: Do not force
+       wisent-python-default-setup on python-mode-hook.
+
+2015-08-11  Paul Eggert  <address@hidden>
+
+       Give names to Unicode code points in C code
+       * src/character.h (NO_BREAK_SPACE, SOFT_HYPHEN)
+       (ZERO_WIDTH_NON_JOINER, ZERO_WIDTH_JOINER, HYPHEN)
+       (NON_BREAKING_HYPHEN, LEFT_SINGLE_QUOTATION_MARK)
+       (RIGHT_SINGLE_QUOTATION_MARK, PARAGRAPH_SEPARATOR)
+       (LEFT_POINTING_ANGLE_BRACKET, RIGHT_POINTING_ANGLE_BRACKET)
+       (LEFT_ANGLE_BRACKET, RIGHT_ANGLE_BRACKET)
+       (OBJECT_REPLACEMENT_CHARACTER):
+       New named constants for Unicode code points.
+       * src/bidi.c (bidi_fetch_char, CANONICAL_EQU):
+       * src/composite.c (char_composable_p):
+       * src/lread.c (readevalloop, read1):
+       * src/xdisp.c (get_next_display_element):
+       Use them.
+       * src/doc.c (LEFT_SINGLE_QUOTATION_POINT):
+       Remove; now in character.h.
+
+2015-08-11  Stephen Leake  <address@hidden>
+
+       elisp--xref-find-definitions handle cl-defstuct default constructor
+       * lisp/progmodes/elisp-mode.el (elisp-xref-find): Add FIXME.
+       (elisp--xref-format-extra): Rename from elisp--xref-format-cl-defmethod.
+       (elisp--xref-find-definitions): Handle cl-defstuct default constructor.
+       * test/automated/elisp-mode-tests.el (xref-elisp-test-run): Split out
+       from xref-elisp-test for ease of debugging.
+       (xref-elisp-deftest): Rename from xref-elisp-test.
+       (find-defs-constructor): New test.
+       (find-defs-defgeneric-el): Match batch test config.
+       (compile): Required for find-defs compilation-minor-mode test.
+       (find-defs-defvar-el): Match code change.
+       (find-defs-face-el): Match code change.
+       * lisp/progmodes/xref.el (xref-find-function, xref-find-definitions):
+       Improve doc string.
+
+2015-08-11  Stefan Monnier  <address@hidden>
+
+       * lisp/replace.el (perform-replace): Document `replacements'.
+       (perform-replace): Move the description of the format of `replacements' 
from
+       the body's comment to the docstring.
+
+2015-08-11  Jürgen Hötzel  <address@hidden>
+
+       * lisp/net/tramp-adb.el (tramp-adb-prompt): Match leading escape
+       sequence.  Recent adb version send initial escape sequences, even
+       when terminal type is set to TERM=dumb.
+
+2015-08-10  Stephen Leake  <address@hidden>
+
+       Rewrite elisp--xref-find-definitions to handle many more cases; add 
tests.
+       * lisp/progmodes/elisp-mode.el (elisp--xref-identifier-location): 
deleted
+       (elisp--xref-format-cl-defmethod): new
+       (find-feature-regexp): new
+       (find-alias-regexp): new
+       (elisp--xref-make-xref): new
+       (elisp--xref-find-definitions): Rewrite using the above, handle many 
more
+       cases. Always output all available definitions.
+       (xref-location-marker): No need for special cases.
+       * test/automated/elisp-mode-tests.el: Add more tests of
+       elisp--xref-find-definitions, improve current tests.
+
+2015-08-10  Phillip Lord  <address@hidden>
+
+       * ChangeLog.2: Formatting update.
+       Formatting for one change entry did not follow standard ChangeLog
+       conventions and has now been updated.
+
+2015-08-10  Eli Zaretskii  <address@hidden>
+
+       Fix recording of events pushed onto unread-command-events
+       * src/keyboard.c (read_char): Make sure events read from
+       unread-command-events and unread-post-input-method-events are
+       always recorded by record_char.  Reported by David Kastrup
+       <address@hidden>, see
+       http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00193.html.
+
+2015-08-10  Samer Masterson  <address@hidden>
+
+       Set file buffer as current for "--file"
+       * lisp/startup.el (command-line-1): Set file buffer as current before
+       it is displayed so it can be used with options like
+       "--eval".  (Bug#21095)
+
+2015-08-10  Eli Zaretskii  <address@hidden>
+
+       Avoid setting LC_NUMERIC on MS-Windows to anything but "C"
+       * src/emacs.c (synchronize_locale) [WINDOWSNT]: Call fixup_locale
+       after setting LC_ALL to the desired locale, to avoid affecting how
+       numbers are read and printed.  (Bug#21223)
+
+2015-08-10  Alan Mackenzie  <address@hidden>
+
+       Fix "Invalid search bound (wrong side of point)" in fontification.
+       progmodes/cc-fonts.el (c-font-lock-declarators): After skipping an
+       initialization expression, check point is not beyond the fontification
+       limit.
+
+2015-08-09  Paul Eggert  <address@hidden>
+
+       Fix DPI calculation when Xft/DPI is default
+       * src/xsettings.c (parse_settings): Don't use Xft/DPI default
+       value of -1, which evaluates to 2**32 - 1 (Bug#21152).
+       Remove unnecessary cast while we're in the neighborhood.
+
+2015-08-09  Dmitry Gutov  <address@hidden>
+
+       Add project-vc-search-path and project-vc-ignores
+       * lisp/progmodes/project.el (project-vc): New group.
+       (project-vc-search-path, project-vc-ignores): New variables.
+       (project--value-in-dir): Utility function.
+       (project-search-path, project-ignores): Use them.
+       * lisp/progmodes/xref.el (xref--rgrep-command): Only replace `./'
+       at bos.  Don't add extra `/'.  Don't prepend with `*' if replaced.
+
+2015-08-09  Paul Eggert  <address@hidden>
+
+       Fix some minor quoting issues with grave accent
+       * src/dispnew.c (add_window_display_history) [GLYPH_DEBUG]:
+       Remove redundant quotes.
+       * src/doc.c (uLSQM, uRSQM): New macros.
+       * src/doc.c (Fsubstitute_command_keys):
+       * src/syntax.c (Finternal_describe_syntax_value): Follow the user
+       preference for quotes rather than hardcoding the ‘grave’ style.
+       * src/regex.c (PUSH_FAILURE_POINT, POP_FAILURE_POINT)
+       (re_match_2_internal) [DEBUG]: In debugging output, quote C
+       strings with "...", not `...'.
+
+       ChangeLog.2 ignores remote-tracking merges
+       * build-aux/gitlog-to-emacslog: Ignore commit logs matching
+       "Merge remote-tracking branch '.*'" too.  See Eli Zaretskii in:
+       http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00384.html
+
+2015-08-09  Nicolas Richard  <address@hidden>
+
+       Use kpsewhich in ffap-latex-mode, if available
+       * lisp/ffap.el (ffap-latex-guess-rules): New variable.
+       (ffap-latex-mode): Use kpsewhich if available.
+
+       ffap: disallow braces in filenames for tex modes
+       * lisp/ffap.el (ffap-string-at-point-mode-alist): Don't allow
+       braces in tex-related modes.
+
+       Remove useless backslashes from ffap-string-at-point-mode-alist
+       * lisp/ffap.el (ffap-string-at-point-mode-alist): Remove useless and
+       misleading backslashes from default value.
+
+       Augment docstring of ffap-string-at-point-mode-alist
+       * lisp/ffap.el (ffap-string-at-point-mode-alist): Describe how BEG
+       and END are handled.
+
+2015-08-09  Paul Eggert  <address@hidden>
+
+       Remove no-op calls to substitute-command-keys
+       * lisp/org/org-src.el (org-edit-src-code)
+       (org-edit-fixed-width-region):
+       * lisp/simple.el (completion-setup-function):
+       Remove calls to substitute-command-keys that always just return
+       their argument.
+
+2015-08-09  Daiki Ueno  <address@hidden>
+
+       Utilize `quit-window' in epa.el
+       * epa.el (epa-exit-buffer-function): Set to `quit-window'.
+       (Bug#21210)
+
+2015-08-09  Ivan Kanis  <address@hidden>
+
+       fix link to source code in help window
+       * lisp/help-fns.el (find-lisp-object-file-name): remove code that
+       will never work due to Glenn Morris change a6d63d9 on Apr 20 2013
+       'No longer include timestamp in header of .elc files'. Add code
+       that will return .el source file in load-path.
+
+2015-08-09  Artur Malabarba  <address@hidden>
+
+       * isearch.el (isearch-search-fun-default): (Bug#21164)
+       Respect `isearch-lax-whitespace' when searching through
+       `isearch-word'.
+
+2015-08-08  Stefan Monnier  <address@hidden>
+
+       * test/automated/ert-tests.el (ert-test-deftest): Add FIXME.
+
+       * org.el: Fix up some lexical scoping warnings, and use dolist
+       * lisp/org/org.el (org-set-regexps-and-options-for-tags, org-goto-map)
+       (org-set-regexps-and-options, org-assign-fast-keys)
+       (org-contextualize-keys, org-contextualize-validate-key)
+       (org-notes-order-reversed-p, org-local-logging, org-map-entries)
+       (org-find-olp, org-find-exact-heading-in-directory)
+       (org-cycle-agenda-files, org-release-buffers, org-fill-template)
+       (org-agenda-prepare-buffers, org-occur-in-agenda-files)
+       (org-replace-escapes): Use dolist.
+       (org-mode): Optimize away XEmacs-only code.
+       (org-refile-get-targets): Remove unused var `f'.
+       (org-fast-todo-selection): Remove unused var `e'.
+       (org-make-tags-matcher): Use dolist.  Remove unused var `term'.
+       (org-fast-tag-selection): Use dolist.  Remove unused var `e'.
+       (org-format-latex): Use dolist.  Remove unused var `e'.
+       (org-toggle-heading): Access vars lexically rather than dynamically.
+       (org-backward-sentence, org-forward-sentence, org-meta-return)
+       (org-kill-line): Mark arg as unused.
+       (org-submit-bug-report): Silence compiler warning.
+       (org-occur-in-agenda-files): Don't use add-to-list on local vars.
+       (org-get-cursor-date): Remove unused var `tm'.
+       (org-comment-or-uncomment-region): Use standard name `_'.
+       (reftex-docstruct-symbol, reftex-cite-format): Declare to
+       silence byte-compiler.
+       (org-reftex-citation): Add `org--' prefix to dynamically scoped
+       `rds' var.
+
+2015-08-08  Nicolas Petton  <address@hidden>
+
+       Merge remote-tracking branch 
'origin/fix/subsequence-error-with-negative-sequences'
+
+2015-08-08  Paul Eggert  <address@hidden>
+
+       Electric quote if coding is undecided or no conv
+       * lisp/electric.el (electric--insertable-p): Also say that a
+       string is insertable if the buffer file coding system is undecided
+       or uses no conversion, as curved quotes will work in either case.
+
+       * configure.ac (HAVE_STACK_OVERFLOW_HANDLING): Simplify configuration.
+
+2015-08-08  Eli Zaretskii  <address@hidden>
+
+       Fix overlay string display regressions introduced in Emacs 24.5
+       * src/xdisp.c (pop_it): Reset the flag to ignore overlays at this
+       buffer position, if we move the iterator to a new position as
+       result of jumping over text covered by a "replacing" display
+       property.
+       * test/redisplay-testsuite.el (test-redisplay-4): Add 2 new tests.
+
+       Support recovery from C stack overflow on MS-Windows
+       * src/w32fns.c (w32_reset_stack_overflow_guard)
+       (stack_overflow_handler): New functions for handling C stack
+       overflow exceptions.
+       (my_exception_handler): Handle EXCEPTION_STACK_OVERFLOW exceptions
+       specially, and zero out except_addr if we do.
+       (globals_of_w32fns): Initialize dwMainThreadId in non-interactive
+       mode.
+       * src/sysdep.c [HAVE_STACK_OVERFLOW_HANDLING]: Add !WINDOWSNT to
+       the condition, as HAVE_STACK_OVERFLOW_HANDLING is now defined for
+       the MinGW build, but the code guarded by that is for Posix hosts.
+       * src/keyboard.c (command_loop) [WINDOWSNT]: Call
+       w32_reset_stack_overflow_guard.
+       * nt/inc/ms-w32.h (sigjmp_buf): New typedef.
+       (sigsetjmp): New macro.
+       (w32_reset_stack_overflow_guard): Declare the prototype.
+       * configure.ac (HAVE_STACK_OVERFLOW_HANDLING): Set to 1 for MinGW.
+
+2015-08-07  Phillip Lord  <address@hidden>
+
+       Improve error signalling for seq-subseq.
+
+       * lisp/seq.el (seq-subseq): The existing behaviour is to error
+       when indexes are too large, but to silently ignore numbers which
+       are too negative for lists.  String and vector handling errors in
+       both cases. This has been regularlised. Error signalling behaviour
+       has been explicitly added to the docstring.
+
+       * lisp/cl-extra.el (cl-subseq): Defers to (seq-subseq) and is
+       therefore also impacted by this change. The docstring has been
+       updated to reflect this.
+
+       * test/automated/seq-tests.el (test-seq-subseq): Tests have been
+       added for these exceptional cases, as well as one non exceptional
+       base case.
+
+2015-08-07  Jürgen Hötzel  <address@hidden>
+
+       Improve error checking in tramp-adb.el
+       * lisp/net/tramp-adb.el (tramp-adb-ls-output-name-less-p):
+       Improve error checking.  "ls -l" on Android in Enforcing mode can
+       print "lstat './FILENAME failed: Permission denied".
+
+2015-08-07  Stefan Monnier  <address@hidden>
+
+       * lisp/emacs-lisp/cl-generic.el (cl--generic-struct-tag): Don't burp on
+       non-struct vectors.
+
+2015-08-07  Stephen Leake  <address@hidden>
+
+       lisp/window.el: fix typo, more `display-buffer-use-some-frame'
+       * lisp/window.el: fix typo that broke build
+       (display-buffer--action-function-custom-type): add
+       `display-buffer-use-some-frame'
+       (display-buffer): add `display-buffer-use-some-frame' to doc string
+
+       Add support for 'inhibit-same-window in 'display-buffer-use-some-frame'
+       * lisp/window.el (display-buffer-use-some-frame): Add support for
+       'inhibit-same-window in alist.
+       * doc/windows.texi (display-buffer-use-some-frame): Doc support for
+       'inhibit-same-window in alist.
+
+2015-08-07  Eli Zaretskii  <address@hidden>
+
+       Avoid infinite loop in display of invisible text in strings
+       * src/xdisp.c (handle_invisible_prop): If the next change of
+       invisibility spec does not mean the beginning of a visible text,
+       update the string position from which to start the search for the
+       next invisibility change.  This avoids an infinite loop when we
+       have more than one invisibility spec that are made inactive by
+       buffer-invisibility-spec.  Simplify code.  (Bug#21200)
+       * test/redisplay-testsuite.el (test-redisplay-4): Add a test case
+       for the situation that caused bug #21200.
+
+2015-08-06  Artur Malabarba  <address@hidden>
+
+       * lisp/emacs-lisp/package.el: Simplify describe-package-1
+       (package-help-section-name-face): New face.
+       (package--print-help-section): New function.
+       (describe-package-1): Refactor section printing.
+       (package-make-button): Use face instead of font-lock-face, which
+       doesn't work on buttons.
+
+       * lisp/emacs-lisp/package.el: Define custom faces
+       (package-name-face, package-description-face)
+       (package-status-built-in-face, package-status-external-face)
+       (package-status-available-face, package-status-new-face)
+       (package-status-held-face, package-status-disabled-face)
+       (package-status-installed-face, package-status-dependency-face)
+       (package-status-unsigned-face, package-status-incompat-face)
+       (package-status-avail-obso-face): New faces.
+       (package-menu--print-info-simple): Use them.
+
+2015-08-05  Paul Eggert  <address@hidden>
+
+       Fix some confusion with ‘format’
+       * lisp/allout-widgets.el (allout-widgets-before-change-handler)
+       (allout-graphics-modification-handler):
+       Protect arbitrary string in a format context with "%s" format.
+       * lisp/avoid.el:
+       * lisp/cedet/semantic/bovine/scm.el: Fix comment.
+       * lisp/calendar/icalendar.el (icalendar--convert-sexp-to-ical):
+       * lisp/erc/erc-button.el (erc-button-beats-to-time):
+       * lisp/gnus/message.el (message-send-form-letter):
+       * lisp/org/ob-core.el (org-babel-check-evaluate)
+       (org-babel-confirm-evaluate):
+       * lisp/org/ob-fortran.el (org-babel-fortran-var-to-fortran):
+       * lisp/org/ox-latex.el (org-latex-compile):
+       * lisp/org/ox-man.el (org-man-compile):
+       * lisp/org/ox-odt.el (org-odt-template):
+       * lisp/org/ox-texinfo.el (org-texinfo-compile):
+       * lisp/progmodes/prolog.el (prolog-help-info)
+       (prolog-view-predspec):
+       * lisp/progmodes/ruby-mode.el (ruby-parse-partial):
+       * lisp/progmodes/verilog-mode.el (verilog-showscopes):
+       * lisp/textmodes/rst.el (rst-replace-lines):
+       Change (message (format ...)) to (message ...), and likewise
+       for ‘error’.  This lessens the probability of confusion when the
+       output of ‘format’ contains ‘%’.
+
+2015-08-05  Artur Malabarba  <address@hidden>
+
+       * lisp/replace.el (replace-character-fold): Default to nil
+
+       * lisp/character-fold.el: Fix lax whitespace
+       (character-fold-table): Don't make space match other whitespace chars.
+       (character-fold-to-regexp): Simplify lax behaviour.
+
+2015-08-05  Dmitry Gutov  <address@hidden>
+
+       Preserve window point in xref-find-definitions-other-window
+       Fix the problem reported by Ingo Logmar in
+       http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00152.html
+       * lisp/progmodes/xref.el (xref--goto-char): Extract from
+       xref--goto-location.
+       (xref--pop-to-location): Use it. Replace xref--goto-location with
+       a direct xref-location-marker call.
+       (xref--show-location): Likewise.
+       (xref--display-position): Use xref--goto-char.
+
+       * lisp/progmodes/project.el: Add a paragraph to the front matter.
+
+2015-08-04  David Kastrup  <address@hidden>
+
+       Do not overwrite preexisting contents of unread-command-events
+       * lisp/vc/emerge.el (emerge-show-file-name):
+       * lisp/progmodes/vhdl-mode.el (vhdl-electric-dash)
+       (vhdl-comment-insert, vhdl-hooked-abbrev):
+       * lisp/progmodes/octave.el (inferior-octave-dynamic-list-input-ring):
+       * lisp/progmodes/fortran.el (fortran-window-create-momentarily):
+       * lisp/progmodes/ebrowse.el (ebrowse-hack-electric-buffer-menu):
+       * lisp/progmodes/cperl-mode.el (cperl-putback-char):
+       * lisp/obsolete/vip.el (vip-escape-to-emacs)
+       (vip-prefix-arg-value, vip-prefix-arg-com):
+       * lisp/obsolete/terminal.el (te-escape-extended-command-unread):
+       * lisp/leim/quail/tibetan.el (quail-tibetan-update-translation)
+       (quail-tibkey-update-translation):
+       * lisp/leim/quail/lrt.el (quail-lrt-update-translation):
+       * lisp/leim/quail/lao.el (quail-lao-update-translation):
+       * lisp/leim/quail/japanese.el (quail-japanese-update-translation)
+       (quail-japanese-self-insert-and-switch-to-alpha):
+       * lisp/leim/quail/hangul.el (hangul2-input-method)
+       (hangul3-input-method, hangul390-input-method):
+       * lisp/language/hanja-util.el (hangul-to-hanja-char):
+       * lisp/international/robin.el (robin-input-method):
+       * lisp/international/quail.el (quail-start-translation)
+       (quail-start-conversion):
+       * lisp/gnus/gnus-art.el (gnus-article-describe-key)
+       (gnus-article-describe-key-briefly):
+       * lisp/eshell/em-hist.el (eshell-list-history):
+       * lisp/term.el (term-dynamic-list-input-ring)
+       (term-dynamic-list-completions):
+       * lisp/subr.el (momentary-string-display):
+       * lisp/simple.el (read-quoted-char):
+       * lisp/pcomplete.el (pcomplete-show-completions):
+       * lisp/kmacro.el (kmacro-repeat-on-last-key):
+       * lisp/info.el (Info-summary):
+       * lisp/ehelp.el (electric-help-command-loop):
+       * lisp/ebuff-menu.el (electric-buffer-list)
+       (Electric-buffer-menu-exit):
+       * lisp/double.el (double-translate-key):
+       * lisp/comint.el (comint-dynamic-list-input-ring)
+       (comint-dynamic-list-completions): Do not overwrite preexisting
+       contents of `unread-command-events' when putting new events into
+       it.
+
 2015-08-04  Daniel Colascione  <address@hidden>
 
        Improve ansi-color filtering of unrecognized escape sequences
@@ -77,7 +868,6 @@
 2015-08-02  Eli Zaretskii  <address@hidden>
 
        Whitespace fixes
-       Whitespace fixes.
 
 2015-08-02  Evgeny Fraimovitch  <address@hidden>  (tiny change)
 
@@ -238,8 +1028,6 @@
 
 2015-07-31  Eli Zaretskii  <address@hidden>
 
-       ;* src/w32fns.c (syms_of_w32fns): Fix last commit.
-
        Allow to use the old key processing code on MS-Windows
        * src/w32fns.c (syms_of_w32fns) <w32-use-fallback-wm-chars-method>:
        New variable.
@@ -1445,10 +2233,6 @@
        * doc/emacs/display.texi (Displaying Boundaries):
        * doc/emacs/search.texi (Word Search): Add cross references.
 
-2015-07-02  Eli Zaretskii  <address@hidden>
-
-       ;* src/bidi.c (bpa_stack_entry): Update commentary for Unicode 8.0.
-
 2015-07-02  Paul Eggert  <address@hidden>
 
        -batch should not affect ‘’ -> `' display
@@ -2675,8 +3459,6 @@
 
 2015-06-15  Eli Zaretskii  <address@hidden>
 
-       ;* src/fontset.c: Update obsolete commentary.
-
        Fix current-iso639-language on MS-Windows
        * lisp/international/mule-cmds.el (set-locale-environment):
        Downcase the locale name before interning it.  This is so the
@@ -8668,7 +9450,7 @@
 
 This file records repository revisions from
 commit 9d56a21e6a696ad19ac65c4b405aeca44785884a (exclusive) to
-commit a57f8f3022d9ab8b31bbfee291a3d7340bd37c21 (inclusive).
+commit f7ee23e587b01f179284b5554c67d579a2def676 (inclusive).
 See ChangeLog.1 for earlier changes.
 
 ;; Local Variables:
diff --git a/admin/admin.el b/admin/admin.el
index 267f2c4..914f187 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -88,21 +88,12 @@ Root must be the root of an Emacs source tree."
                       (rx (and "AC_INIT" (1+ (not (in ?,)))
                                 ?, (0+ space)
                                 (submatch (1+ (in "0-9."))))))
-  ;; No longer used, broken in multiple ways, updating version seems pointless.
-  (set-version-in-file root "nt/config.nt" version
-                      (rx (and bol "#" (0+ blank) "define" (1+ blank)
-                               "VERSION" (1+ blank) "\""
-                               (submatch (1+ (in "0-9."))))))
   ;; TODO: msdos could easily extract the version number from
   ;; configure.ac with sed, rather than duplicating the information.
   (set-version-in-file root "msdos/sed2v2.inp" version
                       (rx (and bol "/^#undef " (1+ not-newline)
                                "define VERSION" (1+ space) "\""
                                (submatch (1+ (in "0-9."))))))
-  ;; No longer used, broken in multiple ways, updating version seems pointless.
-  (set-version-in-file root "nt/makefile.w32-in" version
-                      (rx (and "VERSION" (0+ space) "=" (0+ space)
-                               (submatch (1+ (in "0-9."))))))
   ;; Major version only.
   (when (string-match "\\([0-9]\\{2,\\}\\)" version)
     (setq version (match-string 1 version))
@@ -134,10 +125,6 @@ Root must be the root of an Emacs source tree."
                       (rx (and bol "/^#undef " (1+ not-newline)
                                "define COPYRIGHT" (1+ space)
                                ?\" (submatch (1+ (not (in ?\")))) ?\")))
-  (set-version-in-file root "nt/config.nt" copyright
-                      (rx (and bol "#" (0+ blank) "define" (1+ blank)
-                               "COPYRIGHT" (1+ blank)
-                               ?\" (submatch (1+ (not (in ?\")))) ?\")))
   (set-version-in-file root "lib-src/rcs2log" copyright
                       (rx (and "Copyright" (0+ space) ?= (0+ space)
                                ?\' (submatch (1+ nonl)))))
diff --git a/admin/authors.el b/admin/authors.el
index c7ec3bc..547e046 100644
--- a/admin/authors.el
+++ b/admin/authors.el
@@ -1154,7 +1154,7 @@ it is found in `authors-fixed-case'."
          (setq regexps (cdr regexps))))))
   (when author
     (setq author (replace-regexp-in-string "[ \t]*[(<].*$" "" author))
-    (setq author (replace-regexp-in-string "\`[ \t]+" "" author))
+    (setq author (replace-regexp-in-string "\\`[ \t]+" "" author))
     (setq author (replace-regexp-in-string "[ \t]+$" "" author))
     (setq author (replace-regexp-in-string "[ \t]+" " " author))
     (unless (string-match "[-, \t]" author)
diff --git a/admin/notes/unicode b/admin/notes/unicode
index ebec417..079173f 100644
--- a/admin/notes/unicode
+++ b/admin/notes/unicode
@@ -226,7 +226,6 @@ nontrivial changes to the build process.
        lisp/leim/quail/japanese.el
        lisp/leim/quail/py-punct.el
        lisp/leim/quail/pypunct-b5.el
-       lisp/term/x-win.el
 
      This file contains just Chinese characters, and has same problem.
      Also, it contains characters that cannot be encoded in UTF-8.
diff --git a/admin/unidata/makefile.w32-in b/admin/unidata/makefile.w32-in
deleted file mode 100644
index 0e9b9f0..0000000
--- a/admin/unidata/makefile.w32-in
+++ /dev/null
@@ -1,56 +0,0 @@
-# makefile.w32-in -- W32 -*- Makefile -*- to generate character property 
tables.
-# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
-#   National Institute of Advanced Industrial Science and Technology (AIST)
-#   Registration Number H13PRO009
-#
-# This file is part of GNU Emacs.
-
-# GNU Emacs is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# GNU Emacs is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-
-EMACS = ../../src/$(BLD)/emacs.exe
-DSTDIR = ../../lisp/international
-lisp = $(CURDIR)/../../lisp
-# EMACSLOADPATH should include international, so Emacs finds encoded-kb.
-# It should include emacs-lisp, so Emacs finds bytecomp.  This is because
-# lisp/subdirs.el is not generated yet when the commands below run.
-EMACSLOADPATH = $(lisp);$(lisp)/international;$(lisp)/emacs-lisp
-# Quote EMACS so it could be a file name with embedded whitespace
-RUNEMACS = "$(EMACS)" -Q -batch
-
-all: $(DSTDIR)/charprop.el
-
-.el.elc:
-       $(RUNEMACS) -f batch-byte-compile $<
-
-unidata.txt: UnicodeData.txt
-       sed -e \
-         $(ARGQUOTE)s/\([^;]*\);\(.*\)/(#x\1 $(DQUOTE)\2$(DQUOTE))/$(ARGQUOTE)\
-         -e $(ARGQUOTE)s/;/$(DQUOTE) $(DQUOTE)/g$(ARGQUOTE) < UnicodeData.txt 
> $@
-
-charprop-SH: unidata-gen.elc unidata.txt
-       ELC=$(CURDIR)/unidata-gen.elc; \
-       DATADIR=$(CURDIR); \
-       DATA=unidata.txt; \
-       cd $(DSTDIR); \
-         $(RUNEMACS) --load $${ELC} -f unidata-gen-files $${DATADIR} $${DATA}
-
-charprop-CMD: unidata-gen.elc unidata.txt
-       $(RUNEMACS) --eval $(ARGQUOTE)(cd 
$(DQUOTE)$(DSTDIR)$(DQUOTE))$(ARGQUOTE) --load $(CURDIR)/unidata-gen.elc -f 
unidata-gen-files $(CURDIR) unidata.txt
-
-${DSTDIR}/charprop.el: charprop-$(SHELLTYPE)
-
-clean:
-       - $(DEL) unidata-gen.elc unidata.txt
-
diff --git a/build-aux/gitlog-to-emacslog b/build-aux/gitlog-to-emacslog
index 4fec4de..51ef2a7 100755
--- a/build-aux/gitlog-to-emacslog
+++ b/build-aux/gitlog-to-emacslog
@@ -77,7 +77,7 @@ test -d .git || {
 # Maybe we should skip all "Merge branch 'master'" messages.
 # See eg the cairo-related ones.
 ./build-aux/gitlog-to-changelog \
-    --ignore-matching="^; |^Merge branch 'master' of 
git\.(savannah|sv)\.gnu\.org:/srv/git/emacs$" \
+    --ignore-matching="^; |^Merge branch 'master' of 
git\.(savannah|sv)\.gnu\.org:/srv/git/emacs$|^Merge remote-tracking branch 
'.*'$" \
   --ignore-line='^; ' --format='%B' \
   "$gen_origin..$new_origin" >"ChangeLog.tmp" || exit
 
diff --git a/configure.ac b/configure.ac
index 45008d8..9f8089f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -365,7 +365,7 @@ 
AC_ARG_WITH([file-notification],[AS_HELP_STRING([--with-file-notification=LIB],
     * ) AC_MSG_ERROR(['--with-file-notification=$withval' is invalid;
 this option's value should be 'yes', 'no', 'gfile', 'inotify' or 'w32'.
 'yes' is a synonym for 'w32' on MS-Windows, for 'no' on Nextstep,
-otherwise for the first of 'gfile' or 'inotify' that is usable.])
+otherwise for the first of 'inotify' or 'gfile' that is usable.])
     ;;
    esac
    with_file_notification=$val
@@ -2674,7 +2674,7 @@ NOTIFY_SUMMARY=no
 
 dnl FIXME?  Don't auto-detect on NS, but do allow someone to specify
 dnl a particular library.  This doesn't make much sense?
-if test "${HAVE_ns}" = yes && test ${with_file_notification} = yes; then
+if test "${HAVE_NS}" = yes && test ${with_file_notification} = yes; then
   with_file_notification=no
 fi
 
@@ -2694,22 +2694,7 @@ case $with_file_notification,$opsys in
     fi ;;
 esac
 
-dnl g_file_monitor exists since glib 2.18.  G_FILE_MONITOR_EVENT_MOVED
-dnl has been added in glib 2.24.  It has been tested under
-dnl GNU/Linux only.  We take precedence over inotify, but this makes
-dnl only sense when glib has been compiled with inotify support.  How
-dnl to check?
-case $with_file_notification,$NOTIFY_OBJ in
-  gfile, | yes,)
-    EMACS_CHECK_MODULES([GFILENOTIFY], [gio-2.0 >= 2.24])
-    if test "$HAVE_GFILENOTIFY" = "yes"; then
-       AC_DEFINE(HAVE_GFILENOTIFY, 1, [Define to 1 if using GFile.])
-       NOTIFY_OBJ=gfilenotify.o
-       NOTIFY_SUMMARY="yes -lgio (gfile)"
-    fi ;;
-esac
-
-dnl inotify is only available on GNU/Linux.
+dnl inotify is available only on GNU/Linux.
 case $with_file_notification,$NOTIFY_OBJ in
   inotify, | yes,)
     AC_CHECK_HEADER(sys/inotify.h)
@@ -2723,6 +2708,19 @@ case $with_file_notification,$NOTIFY_OBJ in
     fi ;;
 esac
 
+dnl g_file_monitor exists since glib 2.18.  G_FILE_MONITOR_EVENT_MOVED
+dnl has been added in glib 2.24.  It has been tested under
+dnl GNU/Linux only.
+case $with_file_notification,$NOTIFY_OBJ in
+  gfile,* | yes,)
+    EMACS_CHECK_MODULES([GFILENOTIFY], [gio-2.0 >= 2.24])
+    if test "$HAVE_GFILENOTIFY" = "yes"; then
+       AC_DEFINE(HAVE_GFILENOTIFY, 1, [Define to 1 if using GFile.])
+       NOTIFY_OBJ=gfilenotify.o
+       NOTIFY_SUMMARY="yes -lgio (gfile)"
+    fi ;;
+esac
+
 case $with_file_notification,$NOTIFY_OBJ in
   yes,* | no,* | *,?*) ;;
   *) AC_MSG_ERROR([File notification '$with_file_notification' requested but 
requirements not found.]) ;;
@@ -4556,12 +4554,11 @@ if test $emacs_cv_func_sigsetjmp = yes; then
     [Define to 1 if sigsetjmp and siglongjmp work.])
 fi
 
-# We need all of these features to handle C stack overflows.
-if test "$emacs_cv_func_sigsetjmp" = "yes" &&
-   test "$emacs_cv_alternate_stack" = yes; then
-  AC_DEFINE([HAVE_STACK_OVERFLOW_HANDLING], 1,
-    [Define to 1 if C stack overflow can be handled in some cases.])
-fi
+case $emacs_cv_func_sigsetjmp,$emacs_cv_alternate_stack,$opsys in
+  yes,yes,* | *,*,mingw32)
+    AC_DEFINE([HAVE_STACK_OVERFLOW_HANDLING], 1,
+      [Define to 1 if C stack overflow can be handled in some cases.]);;
+esac
 
 case $opsys in
   sol2* | unixware )
diff --git a/doc/emacs/makefile.w32-in b/doc/emacs/makefile.w32-in
deleted file mode 100644
index 99da4ab..0000000
--- a/doc/emacs/makefile.w32-in
+++ /dev/null
@@ -1,153 +0,0 @@
-#### -*- Makefile -*- for the Emacs Manual
-
-# Copyright (C) 2003-2015 Free Software Foundation, Inc.
-
-# This file is part of GNU Emacs.
-
-# GNU Emacs is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# GNU Emacs is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-
-# Where to find the source code.  The source code for Emacs's C kernel is
-# expected to be in $(srcdir)/src, and the source code for Emacs's
-# utility programs is expected to be in $(srcdir)/lib-src.  This is
-# set by the configure script's '--srcdir' option.
-srcdir=.
-
-infodir = $(srcdir)/../../info
-
-# The makeinfo program is part of the Texinfo distribution.
-MAKEINFO = makeinfo
-MAKEINFO_OPTS = --force --enable-encoding -I$(srcdir)
-MULTI_INSTALL_INFO = $(srcdir)\..\..\nt\multi-install-info.bat
-INFO_EXT=.info
-INFO_OPTS=--no-split
-INFO_TARGETS = $(infodir)/emacs$(INFO_EXT)
-DVI_TARGETS =  emacs.dvi
-INFOSOURCES = info.texi
-
-# The following rule does not work with all versions of 'make'.
-.SUFFIXES: .texi .dvi
-.texi.dvi:
-       texi2dvi $<
-
-TEXI2DVI = texi2dvi
-ENVADD = $(srcdir)\..\..\nt\envadd.bat "TEXINPUTS=$(srcdir);$(TEXINPUTS)" \
-        "MAKEINFO=$(MAKEINFO) $(MAKEINFO_OPTS)" /C
-
-EMACS_XTRA=\
-       $(srcdir)/arevert-xtra.texi \
-       $(srcdir)/cal-xtra.texi \
-       $(srcdir)/dired-xtra.texi \
-       $(srcdir)/picture-xtra.texi \
-       $(srcdir)/emerge-xtra.texi \
-       $(srcdir)/vc-xtra.texi \
-       $(srcdir)/vc1-xtra.texi \
-       $(srcdir)/fortran-xtra.texi \
-       $(srcdir)/msdos-xtra.texi
-
-EMACSSOURCES= \
-       $(srcdir)/emacs.texi \
-       $(srcdir)/emacsver.texi \
-       $(srcdir)/doclicense.texi \
-       $(srcdir)/screen.texi \
-       $(srcdir)/commands.texi \
-       $(srcdir)/entering.texi \
-       $(srcdir)/basic.texi \
-       $(srcdir)/mini.texi \
-       $(srcdir)/m-x.texi \
-       $(srcdir)/help.texi \
-       $(srcdir)/mark.texi \
-       $(srcdir)/killing.texi \
-       $(srcdir)/regs.texi \
-       $(srcdir)/display.texi \
-       $(srcdir)/search.texi \
-       $(srcdir)/fixit.texi \
-       $(srcdir)/files.texi \
-       $(srcdir)/buffers.texi \
-       $(srcdir)/windows.texi \
-       $(srcdir)/frames.texi \
-       $(srcdir)/mule.texi \
-       $(srcdir)/modes.texi \
-       $(srcdir)/indent.texi \
-       $(srcdir)/text.texi \
-       $(srcdir)/programs.texi \
-       $(srcdir)/building.texi \
-       $(srcdir)/maintaining.texi \
-       $(srcdir)/abbrevs.texi \
-       $(srcdir)/sending.texi \
-       $(srcdir)/rmail.texi \
-       $(srcdir)/dired.texi \
-       $(srcdir)/calendar.texi \
-       $(srcdir)/misc.texi \
-       $(srcdir)/package.texi \
-       $(srcdir)/custom.texi \
-       $(srcdir)/trouble.texi \
-       $(srcdir)/cmdargs.texi \
-       $(srcdir)/xresources.texi \
-       $(srcdir)/anti.texi \
-       $(srcdir)/macos.texi \
-       $(srcdir)/msdos.texi \
-       $(srcdir)/gnu.texi \
-       $(srcdir)/glossary.texi \
-       $(srcdir)/ack.texi \
-       $(srcdir)/kmacro.texi \
-       $(EMACS_XTRA)
-
-info: $(INFO_TARGETS)
-
-dvi: $(DVI_TARGETS)
-
-# Note that all the Info targets build the Info files
-# in srcdir.  There is no provision for Info files
-# to exist in the build directory.
-# In a distribution of Emacs, the Info files should be up to date.
-
-$(infodir)/dir:
-       $(MULTI_INSTALL_INFO) --info-dir=$(infodir) $(INFO_TARGETS)
-
-$(infodir)/emacs$(INFO_EXT): $(EMACSSOURCES)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ emacs.texi
-
-emacs.dvi: $(EMACSSOURCES)
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs.texi
-
-emacs.html: $(EMACSSOURCES)
-       $(MAKEINFO) $(MAKEINFO_OPTS) --html -o $@ emacs.texi
-
-emacs-xtra.dvi: emacs-xtra.texi $(EMACS_XTRA)
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-xtra.texi
-
-mostlyclean:
-       - $(DEL) *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.*
-
-## FIXME $(infodir)/emacs* deletes too much, eg emacs-mime.
-clean: mostlyclean
-       - $(DEL) *.dvi
-       - $(DEL) $(infodir)/emacs*
-       - $(DEL_TREE) emacs.html
-
-distclean: clean
-       - $(DEL) makefile
-
-maintainer-clean: distclean
-       - $(DEL) *.aux *.cps *.fns *.kys *.pgs *.vrs *.toc
-# Don't delete these, because they are outside the current directory.
-#      for file in $(INFO_TARGETS); do rm -f $${file}*; done
-
-
-# Formerly this directory had texindex.c and getopt.c in it
-# and this makefile built them to make texindex.
-# That caused trouble because this is run entirely in the source directory.
-# Since we expect to get texi2dvi from elsewhere,
-# it is ok to expect texindex from elsewhere also.
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 20996c2..cb15a3b 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -2688,7 +2688,7 @@ character.  Keep dissociwords out of your documentation, 
if you want
 it to be well userenced and properbose.
 
 @findex dunnet
-  @kbd{M-x dunnet} runs an text-based adventure game.
+  @kbd{M-x dunnet} runs a text-based adventure game.
 
 @findex gomoku
 @cindex Go Moku
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index 5a166d1..ef274c6 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -1733,9 +1733,13 @@ internal representation within Emacs.
 @findex list-character-sets
   @kbd{M-x list-character-sets} displays a list of all supported
 charsets.  The list gives the names of charsets and additional
-information to identity each charset; see the
address@hidden://www.itscj.ipsj.or.jp/ISO-IR/, International Register of
-Coded Character Sets} for more details.  In this list,
+information to identity each charset; for more details, see the
address@hidden://www.itscj.ipsj.or.jp/itscj_english/iso-ir/ISO-IR.pdf,
+ISO International Register of Coded Character Sets to be Used with
+Escape Sequences (ISO-IR)} maintained by
+the @url{https://www.itscj.ipsj.or.jp/itscj_english/,
+Information Processing Society of Japan/Information Technology
+Standards Commission of Japan (IPSJ/ITSCJ)}.  In this list,
 charsets are divided into two categories: @dfn{normal charsets} are
 listed first, followed by @dfn{supplementary charsets}.  A
 supplementary charset is one that is used to define another charset
diff --git a/doc/lispintro/makefile.w32-in b/doc/lispintro/makefile.w32-in
deleted file mode 100644
index 12e3a43..0000000
--- a/doc/lispintro/makefile.w32-in
+++ /dev/null
@@ -1,85 +0,0 @@
-#### -*- Makefile -*- for the Emacs Lisp Introduction manual.
-
-# Copyright (C) 2003-2015 Free Software Foundation, Inc.
-
-# This file is part of GNU Emacs.
-
-# GNU Emacs is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# GNU Emacs is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-
-srcdir = .
-
-infodir = $(srcdir)/../../info
-# Directory with the (customized) texinfo.tex file.
-texinfodir = $(srcdir)/../misc
-# Directory with emacsver.texi.
-emacsdir = $(srcdir)/../emacs
-
-INFO_EXT=.info
-INFO_OPTS=--no-split -I$(emacsdir)
-INFO_SOURCES = $(srcdir)/emacs-lisp-intro.texi $(emacsdir)/emacsver.texi \
-  $(srcdir)/doclicense.texi
-# The file name eintr must fit within 5 characters, to allow for
-# -NN extensions to fit into DOS 8+3 limits without clashing
-INFO_TARGETS = $(infodir)/eintr$(INFO_EXT)
-DVI_TARGETS = emacs-lisp-intro.dvi
-
-MAKEINFO = makeinfo
-INSTALL_INFO = install-info
-TEXI2DVI = texi2dvi
-TEXI2PDF = texi2pdf
-DVIPS = dvips
-ENVADD = $(srcdir)\..\..\nt\envadd.bat \
-        "TEXINPUTS=$(srcdir);$(texinfodir);$(emacsdir);$(TEXINPUTS)" \
-        "MAKEINFO=$(MAKEINFO) -I$(srcdir) -I$(emacsdir) -I$(texinfodir)" /C
-
-.SUFFIXES: .dvi .ps .texi
-
-info: $(INFO_TARGETS)
-
-$(infodir)/dir:
-       $(INSTALL_INFO) --info-dir=$(infodir) $(INFO_TARGETS)
-
-dvi: $(DVI_TARGETS)
-
-$(infodir)/eintr$(INFO_EXT): $(INFO_SOURCES)
-       $(MAKEINFO) $(INFO_OPTS) -o $@ $(srcdir)/emacs-lisp-intro.texi
-
-emacs-lisp-intro.dvi: $(INFO_SOURCES)
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-lisp-intro.texi
-
-emacs-lisp-intro.pdf: $(INFO_SOURCES)
-       $(ENVADD) $(TEXI2PDF) $(srcdir)/emacs-lisp-intro.texi
-
-emacs-lisp-intro.html: $(INFO_SOURCES)
-       $(MAKEINFO) --html -o $@ $(srcdir)/emacs-lisp-intro.texi
-
-.dvi.ps:
-       $(DVIPS) $< -o $@
-
-mostlyclean:
-       - $(DEL) *.log *.cp *.fn *.ky *.pg *.vr *.tp
-
-clean: mostlyclean
-       - $(DEL) *.dvi $(infodir)/eintr$(INFO_EXT)*
-
-distclean: clean
-       - $(DEL) makefile
-
-maintainer-clean: distclean
-       - $(DEL) *.aux *.cps *.fns *.kys *.pgs *.vrs *.toc
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi
index ca8ae3f..ab1696e 100644
--- a/doc/lispref/help.texi
+++ b/doc/lispref/help.texi
@@ -347,19 +347,11 @@ and @samp{\=\=} puts @samp{\=} into the output.
 @strong{Please note:} Each @samp{\} must be doubled when written in a
 string in Emacs Lisp.
 
address@hidden text-quoting-style
 @cindex curved quotes
 @cindex curly quotes
-The value of this variable specifies the style
+The value of the @code{text-quoting-style} variable specifies the style
 @code{substitute-command-keys} uses when generating left and right
-quotes.  If the variable's value is @code{curve}, the style is
address@hidden this’} with curved single quotes.  If the value is
address@hidden, the style is @t{'like this'} with straight
-apostrophes.  If the value is @code{grave}, the style is @t{`like
-this'} with grave accent and apostrophe.  The default value @code{nil}
-acts like @code{curve} if curved single quotes are displayable, and
-like @code{grave} otherwise.
address@hidden defvar
+quotes.  @xref{Formatting Strings}, for more information.
 
 @defun substitute-command-keys string
 This function scans @var{string} for the above special sequences and
diff --git a/doc/lispref/makefile.w32-in b/doc/lispref/makefile.w32-in
deleted file mode 100644
index c30d6e2..0000000
--- a/doc/lispref/makefile.w32-in
+++ /dev/null
@@ -1,128 +0,0 @@
-# -*- Makefile -*- for the GNU Emacs Lisp Reference Manual.
-
-# Copyright (C) 2003-2015 Free Software Foundation, Inc.
-
-# This file is part of GNU Emacs.
-
-# GNU Emacs is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# GNU Emacs is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-
-# Standard configure variables.
-srcdir = .
-
-infodir = $(srcdir)/../../info
-
-# Directory with emacsver.texi.
-emacsdir = $(srcdir)/../emacs
-# Directory with the (customized) texinfo.tex file.
-texinfodir = $(srcdir)/../misc
-
-INFO_EXT=.info
-INFO_OPTS=--no-split
-
-# Redefine 'TEX' if 'tex' does not invoke plain TeX.  For example:
-# TEX=platex
-TEX=tex
-INSTALL_INFO = install-info
-MAKEINFO = makeinfo
-MAKEINFO_OPTS = --force --enable-encoding  -I$(srcdir) -I$(emacsdir)
-
-# The environment variable and its value to add $(srcdir) to the path
-# searched for TeX input files.
-texinputdir = $(srcdir)\..\..\nt\envadd.bat \
-               "TEXINPUTS=$(srcdir);$(texinfodir);$(emacsdir);$(TEXINPUTS)" \
-               "MAKEINFO=$(MAKEINFO) $(MAKEINFO_OPTS)" /C
-
-# List of all the texinfo files in the manual:
-
-srcs = \
-  $(emacsdir)/emacsver.texi \
-  $(srcdir)/abbrevs.texi \
-  $(srcdir)/anti.texi \
-  $(srcdir)/backups.texi \
-  $(srcdir)/buffers.texi \
-  $(srcdir)/commands.texi \
-  $(srcdir)/compile.texi \
-  $(srcdir)/control.texi \
-  $(srcdir)/customize.texi \
-  $(srcdir)/debugging.texi \
-  $(srcdir)/display.texi \
-  $(srcdir)/edebug.texi \
-  $(srcdir)/elisp.texi \
-  $(srcdir)/errors.texi \
-  $(srcdir)/eval.texi \
-  $(srcdir)/files.texi \
-  $(srcdir)/frames.texi \
-  $(srcdir)/functions.texi \
-  $(srcdir)/hash.texi \
-  $(srcdir)/help.texi \
-  $(srcdir)/hooks.texi \
-  $(srcdir)/internals.texi \
-  $(srcdir)/intro.texi \
-  $(srcdir)/keymaps.texi \
-  $(srcdir)/lists.texi \
-  $(srcdir)/loading.texi \
-  $(srcdir)/macros.texi \
-  $(srcdir)/maps.texi \
-  $(srcdir)/markers.texi \
-  $(srcdir)/minibuf.texi \
-  $(srcdir)/modes.texi \
-  $(srcdir)/nonascii.texi \
-  $(srcdir)/numbers.texi \
-  $(srcdir)/objects.texi \
-  $(srcdir)/os.texi \
-  $(srcdir)/package.texi \
-  $(srcdir)/positions.texi \
-  $(srcdir)/processes.texi \
-  $(srcdir)/searching.texi \
-  $(srcdir)/sequences.texi \
-  $(srcdir)/streams.texi \
-  $(srcdir)/strings.texi \
-  $(srcdir)/symbols.texi \
-  $(srcdir)/syntax.texi \
-  $(srcdir)/text.texi \
-  $(srcdir)/tips.texi \
-  $(srcdir)/variables.texi \
-  $(srcdir)/windows.texi \
-  $(srcdir)/index.texi \
-  $(srcdir)/gpl.texi \
-  $(srcdir)/doclicense.texi
-
-
-.PHONY: clean
-
-# The info file is named 'elisp'.
-
-info: $(infodir)/elisp$(INFO_EXT)
-
-$(infodir)/dir:
-       $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/elisp
-
-$(infodir)/elisp$(INFO_EXT): $(srcs)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $(srcdir)/elisp.texi
-
-elisp.dvi: $(srcs)
-       $(texinputdir) $(TEX) $(srcdir)/elisp.texi
-
-clean:
-       - $(DEL) *.toc *.aux *.log *.cp *.cps *.fn *.fns *.tp *.tps \
-                 *.vr *.vrs *.pg *.pgs *.ky *.kys
-       - $(DEL) make.out core
-       - $(DEL) $(infodir)/elisp*
-
-distclean: clean
-       - $(DEL) makefile
-
-maintainer-clean: distclean
-       - $(DEL) elisp$(INFO_EXT) elisp$(INFO_EXT)-? elisp$(INFO_EXT)-?? 
elisp.dvi elisp.oaux
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index c2f0607..3093338 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -805,22 +805,27 @@ formatting feature described here; they differ from 
@code{format} only
 in how they use the result of formatting.
 
 @defun format string &rest objects
-This function returns a new string that is made by copying
+This function returns a string that is equivalent to copying
 @var{string} and then replacing any format specification
 in the copy with encodings of the corresponding @var{objects}.  The
 arguments @var{objects} are the computed values to be formatted.
 
 The characters in @var{string}, other than the format specifications,
 are copied directly into the output, including their text properties,
-if any.
+if any.  If the output equals @var{string}, this function may return
address@hidden itself rather than a new copy.
 @end defun
 
 @cindex @samp{%} in format
 @cindex format specification
address@hidden curved quotes
address@hidden curly quotes
   A format specification is a sequence of characters beginning with a
address@hidden  Thus, if there is a @samp{%d} in @var{string}, the
address@hidden function replaces it with the printed representation of
-one of the values to be formatted (one of the arguments @var{objects}).
address@hidden or is a curved single quotation mark.  Except for @samp{%%}
+and quotation marks, each format specification says how to represent
+one of the arguments @var{objects}.  For example, if there
+is a @samp{%d} in @var{string}, the @code{format} function replaces it
+with the decimal representation of the integer to be formatted.
 For example:
 
 @example
@@ -830,11 +835,12 @@ For example:
 @end group
 @end example
 
-  Since @code{format} interprets @samp{%} characters as format
+  Since @code{format} interprets @samp{%}, @samp{‘} and @samp{’}
+characters as format
 specifications, you should @emph{never} pass an arbitrary string as
 the first argument.  This is particularly true when the string is
 generated by some Lisp code.  Unless the string is @emph{known} to
-never include any @samp{%} characters, pass @code{"%s"}, described
+never include any of the three special characters, pass @code{"%s"}, described
 below, as the first argument, and the string as the second, like this:
 
 @example
@@ -908,20 +914,30 @@ is shorter.
 Replace the specification with a single @samp{%}.  This format
 specification is unusual in that it does not use a value.  For example,
 @code{(format "%% %d" 30)} returns @code{"% 30"}.
+
address@hidden ‘
address@hidden ’
address@hidden curved quotes
address@hidden curly quotes
+Replace the specification with a left or right quote, respectively.
+Although typically a curved single quotation mark stands for itself,
+other quoting styles are available as per the variable
address@hidden described below.
 @end table
 
-  Any other format character results in an @samp{Invalid format
+  Any other format character after @samp{%} results in an @samp{Invalid format
 operation} error.
 
-  Here are several examples:
+  Here are several examples, which assume the typical quoting style
+where curved single quotes stand for themselves:
 
 @example
 @group
-(format "The name of this buffer is %s." (buffer-name))
-     @result{} "The name of this buffer is strings.texi."
+(format "The name of this buffer is ‘%s’." (buffer-name))
+     @result{} "The name of this buffer is ‘strings.texi’."
 
-(format "The buffer object prints as %s." (current-buffer))
-     @result{} "The buffer object prints as strings.texi."
+(format "The buffer object prints as ‘%s’." (current-buffer))
+     @result{} "The buffer object prints as ‘strings.texi’."
 
 (format "The octal value of %d is %o,
          and the hex value is %x." 18 18 18)
@@ -932,7 +948,7 @@ operation} error.
 
 @cindex field width
 @cindex padding
-  A specification can have a @dfn{width}, which is a decimal number
+  A @samp{%} specification can have a @dfn{width}, which is a decimal number
 between the @samp{%} and the specification character.  If the printed
 representation of the object contains fewer characters than this
 width, @code{format} extends it with padding.  The width specifier is
@@ -948,7 +964,7 @@ the width specifier normally consists of spaces inserted on 
the left:
 If the width is too small, @code{format} does not truncate the
 object's printed representation.  Thus, you can use a width to specify
 a minimum spacing between columns with no risk of losing information.
-In the following three examples, @samp{%7s} specifies a minimum width
+In the following two examples, @samp{%7s} specifies a minimum width
 of 7.  In the first case, the string inserted in place of @samp{%7s}
 has only 3 letters, and needs 4 blank spaces as padding.  In the
 second case, the string @code{"specification"} is 13 letters wide but
@@ -956,12 +972,12 @@ is not truncated.
 
 @example
 @group
-(format "The word '%7s' has %d letters in it."
+(format "The word ‘%7s’ has %d letters in it."
         "foo" (length "foo"))
-     @result{} "The word '    foo' has 3 letters in it."
-(format "The word '%7s' has %d letters in it."
+     @result{} "The word ‘    foo’ has 3 letters in it."
+(format "The word ‘%7s’ has %d letters in it."
         "specification" (length "specification"))
-     @result{} "The word 'specification' has 13 letters in it."
+     @result{} "The word ‘specification’ has 13 letters in it."
 @end group
 @end example
 
@@ -1003,14 +1019,14 @@ ignored.
 (format "%-6d is padded on the right" 123)
      @result{} "123    is padded on the right"
 
-(format "The word '%-7s' actually has %d letters in it."
+(format "The word ‘%-7s’ actually has %d letters in it."
         "foo" (length "foo"))
-     @result{} "The word 'foo    ' actually has 3 letters in it."
+     @result{} "The word ‘foo    ’ actually has 3 letters in it."
 @end group
 @end example
 
 @cindex precision in format specifications
-  All the specification characters allow an optional @dfn{precision}
+  The @samp{%} specification characters allow an optional @dfn{precision}
 before the character (after the width, if present).  The precision is
 a decimal-point @samp{.} followed by a digit-string.  For the
 floating-point specifications (@samp{%e}, @samp{%f}, @samp{%g}), the
@@ -1021,6 +1037,19 @@ shows only the first three characters of the 
representation for
 @var{object}.  Precision has no effect for other specification
 characters.
 
address@hidden text-quoting-style
address@hidden curved quotes
address@hidden curly quotes
+This variable specifies the style @code{format} uses when generating
+left and right quotes.  If the value is @code{curve}, the style is
address@hidden this’} with curved single quotes.  If the value is
address@hidden, the style is @t{'like this'} with straight
+apostrophes.  If the value is @code{grave}, the style is @t{`like
+this'} with grave accent and apostrophe.  The default value @code{nil}
+acts like @code{curve} if curved single quotes are displayable, and
+like @code{grave} otherwise.
address@hidden defvar
+
 @node Case Conversion
 @section Case Conversion in Lisp
 @cindex upper case
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 41f02aa..ccfe7ff 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -2306,16 +2306,18 @@ This function tries to ``display'' @var{buffer} by 
trying to find a
 frame that meets a predicate (by default any frame other than the
 current frame).
 
-If @var{alist} has a address@hidden @code{`inhibit-switch-frame} entry,
-avoid raising the frame.
+If this function chooses a window on another frame, it makes that frame
+visible and, unless @var{alist} contains an @code{inhibit-switch-frame}
+entry (@pxref{Choosing Window Options}), raises that frame if necessary.
 
 If @var{alist} has a non-nil @code{frame-predicate} entry, its value is a
 function taking one argument (a frame), returning non-nil if the
 frame is a candidate; this function replaces the default predicate.
 
-If this function chooses a window on another frame, it makes that frame
-visible and, unless @var{alist} contains an @code{inhibit-switch-frame}
-entry (@pxref{Choosing Window Options}), raises that frame if necessary.
+If @var{alist} has a address@hidden @code{inhibit-same-window} entry,
+the selected window is used; thus if the selected frame has a single
+window, it is not used.
+
 @end defun
 
 @defun display-buffer-pop-up-window buffer alist
diff --git a/doc/misc/makefile.w32-in b/doc/misc/makefile.w32-in
deleted file mode 100644
index 398b774..0000000
--- a/doc/misc/makefile.w32-in
+++ /dev/null
@@ -1,431 +0,0 @@
-#### -*- Makefile -*- for documentation other than the Emacs manual.
-
-# Copyright (C) 2003-2015 Free Software Foundation, Inc.
-
-# This file is part of GNU Emacs.
-
-# GNU Emacs is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# GNU Emacs is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-
-# Where to find the source code.  The source code for Emacs's C kernel is
-# expected to be in $(srcdir)/src, and the source code for Emacs's
-# utility programs is expected to be in $(srcdir)/lib-src.  This is
-# set by the configure script's '--srcdir' option.
-srcdir=.
-
-infodir = $(srcdir)/../../info
-
-## Directory with emacsver.texi.
-## Currently only used by efaq; could be added to MAKEINFO.
-emacsdir = $(srcdir)/../emacs
-
-INFO_EXT=.info
-INFO_OPTS=--no-split
-
-# The makeinfo program is part of the Texinfo distribution.
-MAKEINFO = makeinfo
-MAKEINFO_OPTS = --force -I$(emacsdir)
-MULTI_INSTALL_INFO = $(srcdir)\..\..\nt\multi-install-info.bat
-INFO_TARGETS = $(infodir)/ccmode$(INFO_EXT) \
-               $(infodir)/cl$(INFO_EXT) $(infodir)/dbus$(INFO_EXT) 
$(infodir)/dired-x$(INFO_EXT) \
-               $(infodir)/ediff$(INFO_EXT) $(infodir)/forms$(INFO_EXT) 
$(infodir)/gnus$(INFO_EXT) \
-               $(infodir)/message$(INFO_EXT) $(infodir)/sieve$(INFO_EXT) 
$(infodir)/pgg$(INFO_EXT) \
-               $(infodir)/emacs-mime$(INFO_EXT) $(infodir)/info$(INFO_EXT) 
$(infodir)/mh-e$(INFO_EXT) \
-               $(infodir)/reftex$(INFO_EXT) $(infodir)/sc$(INFO_EXT) 
$(infodir)/vip$(INFO_EXT) \
-               $(infodir)/viper$(INFO_EXT) $(infodir)/widget$(INFO_EXT) 
$(infodir)/efaq$(INFO_EXT) \
-               $(infodir)/ada-mode$(INFO_EXT) $(infodir)/autotype$(INFO_EXT) 
$(infodir)/calc$(INFO_EXT) \
-               $(infodir)/idlwave$(INFO_EXT) $(infodir)/eudc$(INFO_EXT) 
$(infodir)/ebrowse$(INFO_EXT) \
-               $(infodir)/pcl-cvs$(INFO_EXT) $(infodir)/woman$(INFO_EXT) 
$(infodir)/eshell$(INFO_EXT) \
-               $(infodir)/org$(INFO_EXT) $(infodir)/url$(INFO_EXT) 
$(infodir)/speedbar$(INFO_EXT) \
-               $(infodir)/tramp$(INFO_EXT) $(infodir)/ses$(INFO_EXT) 
$(infodir)/smtpmail$(INFO_EXT) \
-               $(infodir)/flymake$(INFO_EXT) $(infodir)/newsticker$(INFO_EXT) 
$(infodir)/rcirc$(INFO_EXT) \
-               $(infodir)/erc$(INFO_EXT) $(infodir)/ert$(INFO_EXT) \
-               $(infodir)/remember$(INFO_EXT) $(infodir)/nxml-mode$(INFO_EXT) \
-               $(infodir)/epa$(INFO_EXT) $(infodir)/mairix-el$(INFO_EXT) 
$(infodir)/sasl$(INFO_EXT) \
-               $(infodir)/auth$(INFO_EXT) $(infodir)/eieio$(INFO_EXT) 
$(infodir)/ede$(INFO_EXT) \
-               $(infodir)/semantic$(INFO_EXT) $(infodir)/edt$(INFO_EXT) 
$(infodir)/emacs-gnutls$(INFO_EXT) \
-               $(infodir)/srecode$(INFO_EXT) $(infodir)/bovine$(INFO_EXT) \
-               $(infodir)/wisent$(INFO_EXT) $(infodir)/htmlfontify$(INFO_EXT)
-DVI_TARGETS = calc.dvi cc-mode.dvi cl.dvi dbus.dvi dired-x.dvi \
-               ediff.dvi forms.dvi gnus.dvi message.dvi emacs-mime.dvi \
-               sieve.dvi pgg.dvi mh-e.dvi \
-               reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \
-               ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \
-               pcl-cvs.dvi woman.dvi eshell.dvi org.dvi url.dvi \
-               speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \
-               newsticker.dvi rcirc.dvi erc.dvi ert.dvi \
-               remember.dvi nxml-mode.dvi \
-               epa.dvi mairix-el.dvi sasl.dvi auth.dvi eieio.dvi ede.dvi \
-               semantic.dvi edt.dvi emacs-gnutls.dvi srecode.dvi bovine.dvi \
-               wisent.dvi htmlfontify.dvi
-INFOSOURCES = info.texi
-
-# The following rule does not work with all versions of 'make'.
-.SUFFIXES: .texi .dvi
-.texi.dvi:
-       texi2dvi $<
-
-TEXI2DVI = texi2dvi
-ENVADD = $(srcdir)\..\..\nt\envadd.bat "TEXINPUTS=$(srcdir);$(TEXINPUTS)" \
-        "MAKEINFO=$(MAKEINFO) $(MAKEINFO_OPTS)" /C
-
-
-info: $(INFO_TARGETS)
-
-dvi: $(DVI_TARGETS)
-
-# Note that all the Info targets build the Info files
-# in srcdir.  There is no provision for Info files
-# to exist in the build directory.
-# In a distribution of Emacs, the Info files should be up to date.
-
-$(infodir)/dir:
-       $(MULTI_INSTALL_INFO) --info-dir=$(infodir) $(INFO_TARGETS)
-
-# The following target uses an explicit -o switch to work around
-# the @setfilename directive in info.texi, which is required for
-# the Texinfo distribution.
-# Some Windows ports of makeinfo seem to require -o to come before the
-# texi filename, contrary to GNU standards.
-
-$(infodir)/info$(INFO_EXT): $(INFOSOURCES)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ info.texi
-
-info.dvi: $(INFOSOURCES)
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/info.texi
-
-
-$(infodir)/ccmode$(INFO_EXT): cc-mode.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ cc-mode.texi
-cc-mode.dvi: cc-mode.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/cc-mode.texi
-
-$(infodir)/ada-mode$(INFO_EXT): ada-mode.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ada-mode.texi
-ada-mode.dvi: ada-mode.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/ada-mode.texi
-
-$(infodir)/pcl-cvs$(INFO_EXT): pcl-cvs.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ pcl-cvs.texi
-pcl-cvs.dvi: pcl-cvs.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/pcl-cvs.texi
-
-$(infodir)/eshell$(INFO_EXT): eshell.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ eshell.texi
-eshell.dvi: eshell.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/eshell.texi
-
-$(infodir)/cl$(INFO_EXT): cl.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ cl.texi
-cl.dvi: cl.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/cl.texi
-
-$(infodir)/dbus$(INFO_EXT): dbus.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ dbus.texi
-dbus.dvi: dbus.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/dbus.texi
-
-$(infodir)/dired-x$(INFO_EXT): dired-x.texi $(emacsdir)/emacsver.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ dired-x.texi
-dired-x.dvi: dired-x.texi $(emacsdir)/emacsver.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/dired-x.texi
-
-$(infodir)/ediff$(INFO_EXT): ediff.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ediff.texi
-ediff.dvi: ediff.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/ediff.texi
-
-$(infodir)/flymake$(INFO_EXT): flymake.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ flymake.texi
-flymake.dvi: flymake.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/flymake.texi
-
-$(infodir)/forms$(INFO_EXT): forms.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ forms.texi
-forms.dvi: forms.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/forms.texi
-
-# gnus/message/emacs-mime/sieve/pgg are part of Gnus:
-$(infodir)/gnus$(INFO_EXT): gnus.texi gnus-overrides.texi message.texi 
emacs-mime.texi \
-                sieve.texi pgg.texi sasl.texi gnus-news.texi gnus-faq.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ gnus.texi
-gnus.dvi: gnus.texi gnus-overrides.texi message.texi emacs-mime.texi \
-         sieve.texi pgg.texi sasl.texi gnus-news.texi gnus-faq.texi
-       sed -e "/@iflatex/,/@end iflatex/d" $(srcdir)/gnus.texi > gnustmp.texi
-       $(ENVADD) $(TEXI2DVI) gnustmp.texi
-       cp gnustmp.dvi $*.dvi
-       rm gnustmp.*
-#
-$(infodir)/message$(INFO_EXT): message.texi gnus-overrides.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ message.texi
-message.dvi: message.texi gnus-overrides.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/message.texi
-#
-$(infodir)/emacs-mime$(INFO_EXT): emacs-mime.texi gnus-overrides.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ --enable-encoding 
emacs-mime.texi
-emacs-mime.dvi: emacs-mime.texi gnus-overrides.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-mime.texi
-#
-$(infodir)/sieve$(INFO_EXT): sieve.texi gnus-overrides.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ sieve.texi
-sieve.dvi: sieve.texi gnus-overrides.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/sieve.texi
-#
-$(infodir)/pgg$(INFO_EXT): pgg.texi gnus-overrides.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ pgg.texi
-pgg.dvi: pgg.texi gnus-overrides.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/pgg.texi
-
-$(infodir)/mh-e$(INFO_EXT): mh-e.texi gpl.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ mh-e.texi
-mh-e.dvi: mh-e.texi gpl.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/mh-e.texi
-
-$(infodir)/reftex$(INFO_EXT): reftex.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ reftex.texi
-reftex.dvi: reftex.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/reftex.texi
-
-$(infodir)/remember$(INFO_EXT): remember.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ remember.texi
-remember.dvi: remember.texix
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/remember.texi
-
-$(infodir)/sasl$(INFO_EXT): sasl.texi gnus-overrides.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ sasl.texi
-sasl.dvi: sasl.texi gnus-overrides.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/sasl.texi
-
-$(infodir)/sc$(INFO_EXT): sc.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ sc.texi
-sc.dvi: sc.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/sc.texi
-
-$(infodir)/vip$(INFO_EXT): vip.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ vip.texi
-vip.dvi: vip.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/vip.texi
-
-$(infodir)/viper$(INFO_EXT): viper.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ viper.texi
-viper.dvi: viper.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/viper.texi
-
-$(infodir)/widget$(INFO_EXT): widget.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ widget.texi
-widget.dvi: widget.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/widget.texi
-
-$(infodir)/efaq$(INFO_EXT): faq.texi $(emacsdir)/emacsver.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ faq.texi
-faq.dvi: faq.texi $(emacsdir)/emacsver.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/faq.texi
-
-$(infodir)/autotype$(INFO_EXT): autotype.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ autotype.texi
-autotype.dvi: autotype.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/autotype.texi
-
-$(infodir)/calc$(INFO_EXT): calc.texi $(emacsdir)/emacsver.texi gpl.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ calc.texi
-calc.dvi: calc.texi $(emacsdir)/emacsver.texi gpl.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/calc.texi
-
-# This is produced with --no-split to avoid making files whose
-# names clash on DOS 8+3 filesystems
-$(infodir)/idlwave$(INFO_EXT): idlwave.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ idlwave.texi
-idlwave.dvi: idlwave.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/idlwave.texi
-
-$(infodir)/eudc$(INFO_EXT): eudc.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ eudc.texi
-eudc.dvi: eudc.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/eudc.texi
-
-$(infodir)/ebrowse$(INFO_EXT): ebrowse.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ebrowse.texi
-ebrowse.dvi: ebrowse.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/ebrowse.texi
-
-$(infodir)/woman$(INFO_EXT): woman.texi $(emacsdir)/emacsver.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ woman.texi
-woman.dvi: woman.texi $(emacsdir)/emacsver.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/woman.texi
-
-$(infodir)/speedbar$(INFO_EXT): speedbar.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ speedbar.texi
-speedbar.dvi: speedbar.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/speedbar.texi
-
-$(infodir)/tramp$(INFO_EXT): tramp.texi trampver.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ tramp.texi
-tramp.dvi: tramp.texi trampver.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/tramp.texi
-
-$(infodir)/ses$(INFO_EXT): ses.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ses.texi
-ses.dvi: ses.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/ses.texi
-
-$(infodir)/smtpmail$(INFO_EXT): smtpmail.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ smtpmail.texi
-smtpmail.dvi: smtpmail.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/smtpmail.texi
-
-$(infodir)/org$(INFO_EXT): org.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ org.texi
-org.dvi: org.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/org.texi
-
-$(infodir)/url$(INFO_EXT): url.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ url.texi
-url.dvi: url.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/url.texi
-
-$(infodir)/newsticker$(INFO_EXT): newsticker.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ newsticker.texi
-newsticker.dvi: newsticker.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/newsticker.texi
-
-$(infodir)/nxml-mode$(INFO_EXT): nxml-mode.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ nxml-mode.texi
-nxml-mod.dvi: nxml-mode.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/nxml-mode.texi
-
-$(infodir)/rcirc$(INFO_EXT): rcirc.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ rcirc.texi
-rcirc.dvi: rcirc.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/rcirc.texi
-
-$(infodir)/erc$(INFO_EXT): erc.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ erc.texi
-erc.dvi: erc.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/erc.texi
-
-$(infodir)/ert$(INFO_EXT): ert.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ert.texi
-ert.dvi: ert.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/ert.texi
-
-$(infodir)/epa$(INFO_EXT): epa.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ epa.texi
-epa.dvi: epa.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/epa.texi
-
-$(infodir)/mairix-el$(INFO_EXT): mairix-el.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ mairix-el.texi
-mairix-el.dvi: mairix-el.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/mairix-el.texi
-
-$(infodir)/auth$(INFO_EXT): auth.texi gnus-overrides.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ auth.texi
-auth.dvi: auth.texi gnus-overrides.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/auth.texi
-
-$(infodir)/eieio$(INFO_EXT): eieio.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ eieio.texi
-eieio.dvi: eieio.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/eieio.texi
-
-$(infodir)/ede$(INFO_EXT): ede.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ede.texi
-ede.dvi: ede.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/ede.texi
-
-$(infodir)/semantic$(INFO_EXT): semantic.texi sem-user.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ semantic.texi
-semantic.dvi: semantic.texi sem-user.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/semantic.texi
-
-$(infodir)/edt$(INFO_EXT): edt.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ edt.texi
-edt.dvi: edt.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/edt.texi
-
-$(infodir)/emacs-gnutls$(INFO_EXT): emacs-gnutls.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ emacs-gnutls.texi
-emacs-gnutls.dvi: emacs-gnutls.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-gnutls.texi
-
-$(infodir)/srecode$(INFO_EXT): srecode.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ srecode.texi
-srecode.dvi: srecode.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/srecode.texi
-
-$(infodir)/bovine$(INFO_EXT): bovine.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ bovine.texi
-bovine.dvi: bovine.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/bovine.texi
-
-$(infodir)/wisent$(INFO_EXT): wisent.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ wisent.texi
-wisent.dvi: wisent.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/wisent.texi
-
-$(infodir)/htmlfontify$(INFO_EXT): htmlfontify.texi
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ htmlfontify.texi
-htmlfontify.dvi: htmlfontify.texi
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/htmlfontify.texi
-
-
-$(INFO_TARGETS): doclicense.texi
-$(DVI_TARGETS): doclicense.texi
-
-mostlyclean:
-       - $(DEL) *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.*
-
-clean: mostlyclean
-       - $(DEL) *.dvi
-       - $(DEL) $(infodir)/ccmode* $(infodir)/cl* \
-                $(infodir)/dbus* $(infodir)/dired-x* \
-                $(infodir)/ediff* $(infodir)/forms* \
-                $(infodir)/gnus* $(infodir)/info* \
-                $(infodir)/message* $(infodir)/mh-e* \
-                $(infodir)/reftex* $(infodir)/sc* \
-                $(infodir)/vip* $(infodir)/widget* \
-                $(infodir)/efaq* $(infodir)/ada-mode* \
-                $(infodir)/autotype* $(infodir)/calc* \
-                $(infodir)/idlwave* $(infodir)/eudc* \
-                $(infodir)/ebrowse* $(infodir)/pcl-cvs* \
-                $(infodir)/woman* $(infodir)/eshell* \
-                $(infodir)/speedbar* $(infodir)/tramp* \
-                $(infodir)/ses* $(infodir)/smtpmail* \
-                $(infodir)/url* $(infodir)/org* \
-                $(infodir)/flymake* $(infodir)/newsticker* \
-                $(infodir)/sieve* $(infodir)/pgg* \
-                $(infodir)/erc* $(infodir)/ert* $(infodir)/rcirc* \
-                $(infodir)/remember* $(infodir)/nxml-mode* \
-                $(infodir)/epa* $(infodir)/sasl* \
-                $(infodir)/mairix-el* $(infodir)/auth* \
-                $(infodir)/eieio* $(infodir)/ede* \
-                $(infodir)/semantic* $(infodir)edt* \
-                $(infodir)/emacs-gnutls* $(infodir)/srecode* \
-                $(infodir)/bovine* $(infodir)/wisent* \
-                $(infodir)/htmlfontify*
-
-distclean: clean
-       - $(DEL) makefile
-
-maintainer-clean: distclean
-       - $(DEL) *.aux *.cps *.fns *.kys *.pgs *.vrs *.toc
-# Don't delete these, because they are outside the current directory.
-#      for file in $(INFO_TARGETS); do rm -f $${file}*; done
-
-
-# Formerly this directory had texindex.c and getopt.c in it
-# and this makefile built them to make texindex.
-# That caused trouble because this is run entirely in the source directory.
-# Since we expect to get texi2dvi from elsewhere,
-# it is ok to expect texindex from elsewhere also.
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index c9af6dd..012c586 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -524,9 +524,9 @@ can use to connect to remote hosts and transfer files
 If you don't know which method is right for you, see @xref{Default
 Method}.
 
address@hidden:} In the following description, setting of user options
-or variables is explained.  Not all of them are autoloaded by
address@hidden  All examples expect, that you have loaded
address@hidden that the following descriptions reference the setting of
+user options or variables, not all of which are autoloaded by
address@hidden  All examples assume that you have loaded
 @value{tramp} first:
 
 @lisp
diff --git a/etc/NEWS b/etc/NEWS
index 0a33a6e..ec3d25c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -43,6 +43,10 @@ or by sticking with Emacs 24.4.
 If gnustep-config is not available, the old heuristics are used.
 
 ---
+** 'configure' now prefers inotify to gfile for file notification,
+unless gfile is explicitly requested via --with-file-notification='gfile'.
+
+---
 ** The configure option '--with-pkg-config-prog' has been removed.
 Use './configure PKG_CONFIG=/full/name/of/pkg-config' if you need to.
 
@@ -552,6 +556,9 @@ The option customizes which day headers receive the
 `calendar-weekend-header' face.
 
 ---
+*** New optional args N and STRING for ‘holiday-greek-orthodox-easter’.
+
+---
 *** Many items obsolete since at least version 23.1 have been removed.
 The majority were function/variable/face aliases, too numerous to list here.
 The remainder were:
@@ -892,16 +899,25 @@ denied" instead of "permission denied".  The old behavior 
was problematic
 in languages like German where downcasing rules depend on grammar.
 
 +++
+** ‘format’ now replaces curved single quotes.
+That is, it replaces strings' curved single quotes (also known as
+curly quotes) as per the value of the new custom variable
+‘text-quoting-style’: ‘curve’ means replace curved quotes with
+themselves ‘like this’, ‘straight’ means use straight apostrophes
+'like this', ‘grave’ means use grave accent and apostrophe `like
+this', and nil (default) means use curved quotes if displayable and
+grave accent and apostrophe otherwise.  Because it now may be used
+in many contexts where it's a no-op, ‘format’ is no longer required to
+create a string, and may return its first argument if the argument
+already has the correct value.
+
++++
 ** substitute-command-keys now replaces quotes.
 That is, it converts documentation strings' quoting style as per the
-value of the new custom variable ‘text-quoting-style’: ‘curve’ means
-use curved quotes (also known as curly quotes) ‘like this’, ‘straight’
-means use straight apostrophes 'like this', ‘grave’ means use grave
-accent and apostrophe `like this', and nil (default) means use curved
-quotes if displayable and grave accent and apostrophe otherwise.  Doc
-strings in source code can use either curved quotes or grave accent
-and apostrophe.  As before, isolated apostrophes and characters
-preceded by \= are output as-is.
+value of ‘text-quoting-style’ as described above.  Doc strings in
+source code can use either curved quotes or grave accent and
+apostrophe.  As before, isolated apostrophes and characters preceded
+by \= are output as-is.
 
 +++
 ** The character classes [:alpha:] and [:alnum:] in regular expressions
@@ -1162,6 +1178,13 @@ qualified names by hand.
 * Changes in Emacs 25.1 on Non-Free Operating Systems
 
 ---
+** MS-Windows specific Emacs build scripts are no longer in the distribution
+This includes the makefile.w32-in files in various subdirectories, and
+the support files.  The file nt/configure.bat now just tells the user
+to use the procedure described in nt/INSTALL, by running the Posix
+`configure' script in the top-level directory.
+
+---
 ** Building Emacs for MS-Windows requires at least Windows XP
 or Windows Server 2003.  The built binaries still run on all versions
 of Windows starting with Windows 9X.
diff --git a/leim/makefile.w32-in b/leim/makefile.w32-in
deleted file mode 100644
index c9bc419..0000000
--- a/leim/makefile.w32-in
+++ /dev/null
@@ -1,237 +0,0 @@
-# -*- Makefile -*- for leim subdirectory in GNU Emacs on the Microsoft Windows 
API.
-
-# Copyright (C) 2000-2015 Free Software Foundation, Inc.
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-#   2006, 2007
-#   National Institute of Advanced Industrial Science and Technology (AIST)
-#   Registration Number H14PRO021
-
-# This file is part of GNU Emacs.
-
-# GNU Emacs is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# GNU Emacs is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-
-srcdir=.
-
-# Where to install LEIM files.
-INSTALLDIR=$(INSTALL_DIR)/leim
-
-# On IBM RS6000, double-dot gets screwed up.
-dot = .
-
-# Which Emacs to use to convert TIT files to Emacs Lisp files,
-# byte-compile Emacs Lisp files, and generate the file leim-list.el.
-BUILT_EMACS = $(THISDIR)/$(dot)$(dot)/src/$(BLD)/emacs.exe
-
-buildlisppath=$(CURDIR)/$(dot)$(dot)/lisp
-
-# How to run Emacs.
-RUN_EMACS = "$(BUILT_EMACS)" -batch --no-site-file --no-site-lisp
-
-# Set EMACSLOADPATH correctly (already defined in environment).
-EMACSLOADPATH=$(buildlisppath)
-
-# Subdirectories to be made if $(srcdir) is different from the current
-# directory.
-SUBDIRS=quail
-
-# Files generated from TIT dictionaries for Chinese GB character set.
-TIT_GB=\
-       quail/CCDOSPY.elc       \
-       quail/Punct.elc         \
-       quail/QJ.elc            \
-       quail/SW.elc            \
-       quail/TONEPY.elc
-
-# Files generated from TIT dictionaries for Chinese BIG5 character set.
-TIT_BIG5=\
-       quail/4Corner.elc       \
-       quail/ARRAY30.elc       \
-       quail/ECDICT.elc        \
-       quail/ETZY.elc          \
-       quail/Punct-b5.elc      \
-       quail/PY-b5.elc         \
-       quail/QJ-b5.elc         \
-       quail/ZOZY.elc
-
-CHINESE_TIT=$(TIT_GB) $(TIT_BIG5)
-
-NON_TIT_GB=$(srcdir)/quail/py-punct.elc
-
-NON_TIT_BIG5=$(srcdir)/quail/pypunct-b5.elc
-
-CHINESE_NON_TIT=$(NON_TIT_GB) $(NON_TIT_BIG5)
-
-CHINESE_GB=$(TIT_GB) $(NON_TIT_GB)
-
-CHINESE_BIG5=$(TIT_BIG5) $(NON_TIT_BIG5)
-
-JAPANESE=$(srcdir)/quail/japanese.elc $(srcdir)/ja-dic/ja-dic.elc
-
-KOREAN=        $(srcdir)/quail/hangul.elc      \
-       $(srcdir)/quail/hanja.elc       \
-       $(srcdir)/quail/hanja3.elc      \
-       $(srcdir)/quail/hanja-jis.elc   \
-       $(srcdir)/quail/symbol-ksc.elc
-
-THAI=$(srcdir)/quail/thai.elc
-
-VIETNAMESE=$(srcdir)/quail/viqr.elc $(srcdir)/quail/vntelex.elc
-
-LAO=$(srcdir)/quail/lao.elc $(srcdir)/quail/lrt.elc
-
-INDIAN=$(srcdir)/quail/indian.elc
-
-TIBETAN=$(srcdir)/quail/tibetan.elc
-
-LATIN= $(srcdir)/quail/latin-pre.elc   \
-       $(srcdir)/quail/latin-post.elc  \
-       $(srcdir)/quail/latin-alt.elc   \
-       $(srcdir)/quail/latin-ltx.elc   \
-       $(srcdir)/quail/welsh.elc
-
-UNICODE=$(srcdir)/quail/sgml-input.elc \
-       $(srcdir)/quail/rfc1345.elc     \
-       $(srcdir)/quail/uni-input.elc
-
-SLAVIC= \
-       $(srcdir)/quail/czech.elc \
-       $(srcdir)/quail/croatian.elc \
-       $(srcdir)/quail/slovak.elc
-
-GREEK=$(srcdir)/quail/greek.elc
-
-RUSSIAN=$(srcdir)/quail/cyrillic.elc $(srcdir)/quail/cyril-jis.elc
-
-MISC= \
-       $(srcdir)/quail/arabic.elc \
-       $(srcdir)/quail/ethiopic.elc \
-       $(srcdir)/quail/ipa.elc \
-       $(srcdir)/quail/ipa-praat.elc \
-       $(srcdir)/quail/hebrew.elc \
-       $(srcdir)/quail/georgian.elc \
-       $(srcdir)/quail/persian.elc \
-       $(srcdir)/quail/sisheng.elc
-
-MISC_DIC=\
-       quail/tsang-b5.elc      \
-       quail/quick-b5.elc      \
-       quail/tsang-cns.elc     \
-       quail/quick-cns.elc     \
-       quail/PY.elc            \
-       quail/ZIRANMA.elc       \
-       quail/CTLau.elc         \
-       quail/CTLau-b5.elc
-
-CHINESE=$(CHINESE_GB) $(CHINESE_BIG5)
-EASTASIA=$(CHINESE) $(JAPANESE) $(KOREAN)
-ASIA=$(EASTASIA) $(THAI) $(VIETNAMESE) $(LAO) $(INDIAN) $(TIBETAN)
-EUROPEAN=$(LATIN) $(SLAVIC) $(GREEK) $(RUSSIAN)
-WORLD=$(ASIA) $(EUROPEAN) $(MISC) $(MISC_DIC) $(UNICODE)
-
-TIT=$(CHINESE_TIT)
-NON_TIT=$(CHINESE_NON_TIT) $(JAPANESE) $(KOREAN) $(EUROPEAN) $(MISC)
-
-.SUFFIXES: .elc .el
-
-.el.elc:
-       $(RUN_EMACS) -f batch-byte-compile $<
-
-all: $(BUILT_EMACS) $(SUBDIRS) $(WORLD) leim-list.el
-
-# To ensure that we can run Emacs.  This target is ignored (never
-# being hit) if a user changes default value of EMACS.
-$(dot)$(dot)/src/emacs:
-       cd ../src; $(MAKE) $(MFLAGS) emacs
-
-$(SUBDIRS):
-       mkdir "$@"
-       echo stamp>stamp-subdir
-
-# The rules which generate $(TIT) and ${MISC_DIC) files create them all
-# in one go.  So we need to prevent parallel execution for that target,
-# otherwise Emacs complains about files being locked.  .NOTPARALLEL is
-# for GNU Make, .NO_PARALLEL is for other Make's.
-.NOTPARALLEL: $(TIT) $(MISC_DIC)
-
-.NO_PARALLEL: $(TIT) $(MISC_DIC)
-
-# Rule to generate quail/*.el from CXTERM-DIC/*.tit.
-#
-# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
-#          this can break with GNU Make 3.81 and later if sh.exe is used.
-$(TIT):
-       $(RUN_EMACS) -l \
-           $(ARGQUOTE)$(buildlisppath)/international/titdic-cnv$(ARGQUOTE) \
-           --eval $(ARGQUOTE)(batch-titdic-convert t)$(ARGQUOTE) \
-           -dir quail $(srcdir)/CXTERM-DIC
-       $(RUN_EMACS)  -l \
-           $(ARGQUOTE)$(buildlisppath)/international/quail$(ARGQUOTE) \
-           -f batch-byte-compile $(TIT:.elc=.el)
-
-# Rule to generate quail/*.el from MISC_DIC/*.tit.
-$(MISC_DIC):
-       $(RUN_EMACS) -l \
-           $(ARGQUOTE)$(buildlisppath)/international/titdic-cnv$(ARGQUOTE) \
-           -f batch-miscdic-convert -dir quail $(srcdir)/MISC-DIC
-       $(RUN_EMACS)  -l \
-           $(ARGQUOTE)$(buildlisppath)/international/quail$(ARGQUOTE) \
-           -f batch-byte-compile $(MISC_DIC:.elc=.el)
-
-# Rule to generate ja-dic/ja-dic.el from SKK-DIC/SKK-JISYO.L.
-$(srcdir)/ja-dic/ja-dic.el: $(srcdir)/SKK-DIC/SKK-JISYO.L
-       - mkdir ja-dic
-       $(RUN_EMACS) -l \
-           $(ARGQUOTE)$(buildlisppath)/international/ja-dic-cnv$(ARGQUOTE) \
-           -f batch-skkdic-convert -dir ja-dic $(srcdir)/SKK-DIC/SKK-JISYO.L
-
-#
-# WARNING: Do NOT split the parts inside $(ARGQUOTE)s into multiple lines as
-#          this can break with GNU Make 3.81 and later if sh.exe is used.
-leim-list.el: $(SUBDIRS) $(WORLD) $(srcdir)/leim-ext.el
-       - $(DEL) leim-list.el
-       $(RUN_EMACS) -l \
-           $(ARGQUOTE)$(buildlisppath)/international/quail$(ARGQUOTE) \
-           --eval $(ARGQUOTE)(update-leim-list-file 
$(DQUOTE).$(DQUOTE))$(ARGQUOTE)
-       $(RUN_EMACS) --eval $(ARGQUOTE)(w32-append-code-lines 
$(DQUOTE)address@hidden(DQUOTE) 
$(DQUOTE)$(srcdir)/leim-ext.el$(DQUOTE))$(ARGQUOTE)
-
-install: all
-       - mkdir "$(INSTALLDIR)"
-       - $(DEL) $(DIRNAME)_same-dir.tst
-       - $(DEL) $(INSTALL_DIR)/$(DIRNAME)_same-dir.tst
-       echo SameDirTest > $(INSTALL_DIR)/$(DIRNAME)_same-dir.tst
-       $(IFNOTSAMEDIR) $(CP) leim-list.el $(INSTALLDIR) $(ENDIF)
-       $(IFNOTSAMEDIR) $(CP_DIR) quail $(INSTALLDIR) $(ENDIF)
-       $(IFNOTSAMEDIR) $(CP_DIR) ja-dic $(INSTALLDIR) $(ENDIF)
-       - $(DEL) $(INSTALL_DIR)/$(DIRNAME)_same-dir.tst
-
-clean mostlyclean:
-       - $(FOREACH) $(TIT) $(FORDO) $(DEL) $(FORVAR) $(ENDFOR)
-       - $(FOREACH) $(MISC_DIC) $(FORDO) $(DEL) $(FORVAR) $(ENDFOR)
-       - $(FOREACH) $(TIT:.elc=.el) $(FORDO) $(DEL) $(FORVAR) $(ENDFOR)
-       - $(FOREACH) $(MISC_DIC:.elc=.el) $(FORDO) $(DEL) $(FORVAR) $(ENDFOR)
-       - $(DEL) leim-list.el
-       - $(DEL) leim-list.el~
-
-distclean: clean
-       - $(DEL) stamp-subdir
-       - $(DEL) makefile
-
-maintainer-clean: distclean
-       - $(FOREACH) $(WORLD) $(FORDO) $(DEL) $(FORVAR) $(ENDFOR)
-
-# We used to delete *~ here, but that might inadvertently remove
-# precious files if it happens to match their short 8+3 aliases.
-extraclean: maintainer-clean
-       - $(FOREACH) *.el~ "#*" $(FORDO) $(DEL) $(FORVAR) $(ENDFOR)
diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in
deleted file mode 100644
index a81a011..0000000
--- a/lib-src/makefile.w32-in
+++ /dev/null
@@ -1,482 +0,0 @@
-#  -*- Makefile -*- for GNU Emacs on the Microsoft Windows API.
-# Copyright (C) 2000-2015 Free Software Foundation, Inc.
-
-# This file is part of GNU Emacs.
-
-# GNU Emacs is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# GNU Emacs is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-
-ALL = $(BLD)/test-distrib.exe $(BLD)/make-docfile.exe $(BLD)/hexl.exe\
- $(BLD)/ctags.exe $(BLD)/etags.exe $(BLD)/movemail.exe $(BLD)/ebrowse.exe\
- $(BLD)/emacsclient.exe $(BLD)/emacsclientw.exe $(BLD)/profile.exe
-
-.PHONY: make-docfile
-
-LOCAL_FLAGS    = -DNO_LDAV=1 -DNO_ARCHIVES=1 -I../lib \
-                 -I../nt/inc -I../src $(EMACS_EXTRA_C_FLAGS)
-
-LIBS           = $(BASE_LIBS) $(ADVAPI32)
-LIB_SRC                = .
-
-# The following target is used by makefile.w32-in files in other directories.
-make-docfile:  $(BLD)/make-docfile.exe
-
-$(BLD)/make-docfile.exe:       $(BLD)/make-docfile.$(O) $(BLD)/ntlib.$(O)
-               $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/make-docfile.$(O) 
$(BLD)/ntlib.$(O) $(LIBS)
-$(BLD)/hexl.exe:               $(BLD)/hexl.$(O)
-               $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/hexl.$(O) $(LIBS)
-$(BLD)/test-distrib.exe: $(BLD)/test-distrib.$(O)
-               $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/test-distrib.$(O) 
$(LIBS)
-               "$(BLD)/test-distrib.exe" "$(LIB_SRC)/testfile"
-
-MOVEMAILOBJS =  $(BLD)/movemail.$(O) \
-               $(BLD)/pop.$(O) \
-               ../lib/$(BLD)/libgnu.$(A) \
-               $(BLD)/ntlib.$(O)
-
-$(BLD)/movemail.exe:   $(MOVEMAILOBJS) ../lib/getopt.h
-# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
-               $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(MOVEMAILOBJS) $(WSOCK32) 
$(LIBS)
-
-ECLIENT_CFLAGS = -DHAVE_GETCWD -DHAVE_STRERROR
-ECLIENTOBJS =  $(BLD)/emacsclient.$(O) \
-               $(BLD)/ntlib.$(O) \
-               ../lib/$(BLD)/libgnu.$(A)
-CLIENTRES =    ../nt/$(BLD)/emacsclient.res
-
-$(CLIENTRES):  ../nt/emacsclient.rc
-       @echo Emacsclient resource file must be built from nt directory
-       @exit -1
-
-$(BLD)/emacsclient.exe:                $(ECLIENTOBJS)
-# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
-               $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) 
$(USER32) $(COMCTL32) $(LIBS)
-
-$(BLD)/emacsclientw.exe:       $(ECLIENTOBJS) $(CLIENTRES)
-# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
-               $(LINK) $(LINK_OUT)$@ $(CLIENTRES) $(MWINDOWS) $(LINK_FLAGS) 
$(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS)
-
-$(BLD)/emacsclient.$(O):       emacsclient.c
-               $(CC) $(CFLAGS) $(ECLIENT_CFLAGS) $(CC_OUT)$@ emacsclient.c
-
-ETAGSOBJ      = $(BLD)/etags.$(O) \
-               ../lib/$(BLD)/libgnu.$(A) \
-               $(BLD)/ntlib.$(O) \
-               $(BLD)/regex.$(O)
-
-$(BLD)/etags.exe:      $(ETAGSOBJ)
-               $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ETAGSOBJ) $(LIBS)
-
-
-EBROWSEOBJ    = $(BLD)/ebrowse.$(O) \
-               ../lib/$(BLD)/libgnu.$(A) \
-               $(BLD)/ntlib.$(O)
-
-$(BLD)/ebrowse.exe:     $(EBROWSEOBJ)
-               $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(EBROWSEOBJ) $(LIBS)
-
-$(BLD)/regex.$(O): ../src/regex.c ../src/regex.h ../src/config.h
-               $(CC)  $(CFLAGS) -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
-               ../src/regex.c $(CC_OUT)$@
-
-ETAGS_CFLAGS  = -DHAVE_GETCWD -DEMACS_NAME="\"GNU Emacs\""
-$(BLD)/etags.$(O): etags.c
-               $(CC) $(CFLAGS) $(ETAGS_CFLAGS) $(CC_OUT)$@ etags.c
-
-CTAGSOBJ      = $(BLD)/ctags.$(O) \
-               ../lib/$(BLD)/libgnu.$(A) \
-               $(BLD)/ntlib.$(O) \
-               $(BLD)/regex.$(O)
-
-$(BLD)/ctags.exe:  $(CTAGSOBJ)
-               $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(CTAGSOBJ) $(LIBS)
-
-ctags.c:       etags.c
-               - $(DEL) ctags.c
-               $(CP) etags.c ctags.c
-
-CTAGS_CFLAGS  = -DCTAGS $(ETAGS_CFLAGS)
-$(BLD)/ctags.$(O): ctags.c
-               $(CC) $(CFLAGS) $(CTAGS_CFLAGS) $(CC_OUT)$@ ctags.c
-
-PROFILEOBJS    = $(BLD)/profile.$(O) \
-                 ../lib/$(BLD)/libgnu.$(A) \
-                 $(BLD)/ntlib.$(O)
-$(BLD)/profile.exe:    $(PROFILEOBJS)
-               $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(PROFILEOBJS) $(LIBS)
-
-#
-# From ..\src\Makefile.in
-# It doesn't matter if the real name is *.obj for the files in this list,
-# make-docfile blindly replaces .o with .c anyway.  Keep .o in this list
-# as it is required by code in doc.c.
-#
-obj =   dosfns.o msdos.o \
-       xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
-       fontset.o menu.o dbusbind.o cygw32.o \
-       nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
-       w32.o w32console.o w32fns.o w32heap.o w32inevt.o w32notify.o \
-       w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
-       w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
-       xsettings.o xgselect.o termcap.o \
-       font.o w32font.o w32uniscribe.o w32notify.o \
-       dispnew.o frame.o scroll.o xdisp.o window.o bidi.o \
-       charset.o coding.o category.o ccl.o character.o chartab.o \
-       cm.o term.o terminal.o xfaces.o \
-       emacs.o keyboard.o macros.o keymap.o sysdep.o \
-       buffer.o filelock.o insdel.o marker.o \
-       minibuf.o fileio.o dired.o \
-       cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
-       alloc.o data.o doc.o editfns.o callint.o \
-       eval.o floatfns.o fns.o print.o lread.o \
-       syntax.o bytecode.o \
-       process.o callproc.o unexw32.o \
-       region-cache.o sound.o atimer.o \
-       doprnt.o intervals.o textprop.o composite.o \
-       gnutls.o xml.o profiler.o
-
-#
-# These are the lisp files that are loaded up in loadup.el
-#
-lispsource = ../lisp/
-
-MOUSE_SUPPORT = \
-       $(lispsource)select.elc \
-       $(lispsource)scroll-bar.elc \
-       $(lispsource)mouse.elc
-WINNT_SUPPORT = \
-       $(lispsource)ls-lisp.elc \
-       $(lispsource)disp-table.elc \
-       $(lispsource)w32-fns.elc \
-       $(lispsource)dos-w32.elc \
-       $(lispsource)w32-vars.elc \
-       $(lispsource)term/common-win.elc \
-       $(lispsource)term/w32-win.elc
-TOOLTIP_SUPPORT = $(lispsource)tooltip.elc
-WINDOW_SUPPORT = \
-       $(lispsource)fringe.elc \
-       $(lispsource)image.elc \
-       $(lispsource)international/fontset.elc \
-       $(lispsource)dnd.elc \
-       $(lispsource)tool-bar.elc \
-       $(lispsource)mwheel.elc
-
-# lisp files that are loaded up on other platforms
-OTHER_PLATFORM_SUPPORT = \
-       $(lispsource)dos-fns.elc \
-       $(lispsource)dos-vars.elc \
-       $(lispsource)term/internal.elc \
-       $(lispsource)term/pc-win.elc \
-       $(lispsource)x-dnd.elc \
-       $(lispsource)term/x-win.elc \
-       $(lispsource)term/ns-win.elc
-
-
-lisp1= \
-       $(lispsource)abbrev.elc \
-       $(lispsource)buff-menu.elc \
-       $(lispsource)button.elc \
-       $(lispsource)emacs-lisp/byte-run.elc \
-       $(lispsource)composite.elc \
-       $(lispsource)cus-face.elc \
-       $(lispsource)cus-start.elc \
-       $(lispsource)custom.elc \
-       $(lispsource)emacs-lisp/backquote.elc \
-       $(lispsource)emacs-lisp/lisp-mode.elc \
-       $(lispsource)emacs-lisp/lisp.elc \
-       $(lispsource)env.elc \
-       $(lispsource)faces.elc \
-       $(lispsource)files.elc \
-       $(lispsource)format.elc \
-       $(lispsource)facemenu.elc \
-       $(MOUSE_SUPPORT) \
-       $(lispsource)emacs-lisp/float-sup.elc \
-       $(lispsource)frame.elc \
-       $(lispsource)help.elc \
-       $(lispsource)indent.elc \
-       $(lispsource)isearch.elc \
-       $(lispsource)rfn-eshadow.elc \
-       $(lispsource)loadup.el \
-       $(lispsource)loaddefs.el \
-       $(lispsource)bindings.elc \
-       $(lispsource)emacs-lisp/map-ynp.elc \
-       $(lispsource)menu-bar.elc \
-       $(lispsource)international/mule.elc \
-       $(lispsource)international/mule-conf.elc \
-       $(lispsource)international/mule-cmds.elc \
-       $(lispsource)international/characters.elc \
-       $(lispsource)international/charprop.el \
-       $(lispsource)case-table.elc \
-       $(lispsource)emacs-lisp/macroexp.elc
-
-lisp2 = \
-       $(lispsource)language/chinese.elc \
-       $(lispsource)language/cyrillic.elc \
-       $(lispsource)language/indian.elc \
-       $(lispsource)language/sinhala.elc \
-       $(lispsource)language/english.elc \
-       $(lispsource)language/ethiopic.elc \
-       $(lispsource)language/european.elc \
-       $(lispsource)language/czech.elc \
-       $(lispsource)language/slovak.elc \
-       $(lispsource)language/romanian.elc \
-       $(lispsource)language/greek.elc \
-       $(lispsource)language/hebrew.elc \
-       $(lispsource)language/japanese.elc \
-       $(lispsource)international/cp51932.el \
-       $(lispsource)international/eucjp-ms.el \
-       $(lispsource)language/korean.elc \
-       $(lispsource)language/lao.elc \
-       $(lispsource)language/cham.elc \
-       $(lispsource)language/tai-viet.elc \
-       $(lispsource)language/thai.elc \
-       $(lispsource)language/tibetan.elc \
-       $(lispsource)language/vietnamese.elc \
-       $(lispsource)language/misc-lang.elc \
-       $(lispsource)language/utf-8-lang.elc \
-       $(lispsource)language/georgian.elc \
-       $(lispsource)language/khmer.elc \
-       $(lispsource)language/burmese.elc \
-       $(lispsource)register.elc \
-       $(lispsource)replace.elc \
-       $(lispsource)simple.elc \
-       $(lispsource)emacs-lisp/nadvice.elc \
-       $(lispsource)minibuffer.elc \
-       $(lispsource)startup.elc \
-       $(lispsource)subr.elc \
-       $(lispsource)term/tty-colors.elc \
-       $(lispsource)font-core.elc \
-       $(lispsource)emacs-lisp/syntax.elc \
-       $(lispsource)font-lock.elc \
-       $(lispsource)jit-lock.elc \
-       $(lispsource)textmodes/fill.elc \
-       $(lispsource)textmodes/page.elc \
-       $(lispsource)textmodes/paragraphs.elc \
-       $(lispsource)textmodes/text-mode.elc \
-       $(lispsource)emacs-lisp/timer.elc \
-       $(lispsource)jka-cmpr-hook.elc \
-       $(lispsource)vc/vc-hooks.elc \
-       $(lispsource)vc/ediff-hook.elc \
-       $(lispsource)epa-hook.elc \
-       $(TOOLTIP_SUPPORT) \
-       $(WINNT_SUPPORT) \
-       $(WINDOW_SUPPORT) \
-       $(lispsource)widget.elc \
-       $(lispsource)window.elc \
-       $(lispsource)version.elc
-
-# This is needed the first time we build the tree, since temacs.exe
-# does not exist yet, and the DOC rule needs it to rebuild DOC whenever
-# Emacs is rebuilt.
-../src/$(BLD)/temacs.exe:
-       - mkdir "../src/$(OBJDIR)"
-       - mkdir "../src/$(BLD)"
-       @echo temacs > temacs.exe
-       $(CP) temacs.exe ../src/$(BLD)
-       - $(DEL) temacs.exe
-
-DOC          = DOC
-$(DOC):                stamp_BLD $(BLD)/make-docfile.exe 
../src/$(BLD)/temacs.exe $(lisp1) $(lisp2) $(OTHER_PLATFORM_SUPPORT)
-               - $(DEL) $(DOC)
-               "$(THISDIR)/$(BLD)/make-docfile" -o $(DOC) -d ../src $(obj)
-               "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp1)
-               "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp2)
-               "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src 
$(OTHER_PLATFORM_SUPPORT)
-               $(CP) $(DOC) ../etc/DOC
-               - mkdir "../src/$(OBJDIR)"
-               - mkdir "../src/$(OBJDIR)/etc"
-               $(CP) $(DOC) ../src/$(OBJDIR)/etc/DOC
-
-{$(BLD)}.$(O){$(BLD)}.exe:
-               $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $*.$(O) $(LIBS)
-
-#
-# Build the executables
-#
-all:           $(ALL) $(DOC)
-
-#
-# Assuming INSTALL_DIR is defined, build and install emacs in it.
-#
-INSTALL_FILES = $(ALL)
-install:       $(INSTALL_FILES)
-               - mkdir "$(INSTALL_DIR)/bin"
-               $(CP) $(BLD)/etags.exe $(INSTALL_DIR)/bin
-               $(CP) $(BLD)/ebrowse.exe $(INSTALL_DIR)/bin
-               $(CP) $(BLD)/ctags.exe $(INSTALL_DIR)/bin
-               $(CP) $(BLD)/hexl.exe $(INSTALL_DIR)/bin
-               $(CP) $(BLD)/movemail.exe $(INSTALL_DIR)/bin
-               $(CP) $(BLD)/emacsclient.exe $(INSTALL_DIR)/bin
-               $(CP) $(BLD)/emacsclientw.exe $(INSTALL_DIR)/bin
-               $(CP) $(BLD)/profile.exe $(INSTALL_DIR)/bin
-               - mkdir "$(INSTALL_DIR)/etc"
-               $(CP) $(DOC) $(INSTALL_DIR)/etc
-
-#
-# Maintenance
-#
-# We used to delete *~ here, but that might inadvertently remove
-# precious files if it happens to match their short 8+3 aliases.
-clean:
-               - $(DEL) DOC* $(COMPILER_TEMP_FILES)
-               - $(DEL) ctags.c
-               - $(DEL_TREE) $(OBJDIR)
-               - $(DEL) stamp_BLD
-
-distclean: cleanall
-       - $(DEL) TAGS
-       - $(DEL) Makefile
-
-maintainer-clean: distclean
-
-cleanall:      clean
-               - $(DEL_TREE) obj
-               - $(DEL_TREE) obj-spd
-               - $(DEL_TREE) oo
-               - $(DEL_TREE) oo-spd
-
-#
-# Headers we would preprocess if we could.
-#
-../src/config.h:       ../nt/$(CONFIG_H)
-                       $(DEL) $@
-                       echo $(CONFIG_H) has changed.  Re-run configure.bat.
-                       exit -1
-
-### TAGS ###
-
-TAGS: $(BLD)/etags.exe *.c *.h
-       $(BLD)/etags.exe *.c *.h
-
-### DEPENDENCIES ###
-
-EMACS_ROOT     = ..
-SRC            = $(EMACS_ROOT)/src
-NT_INC         = $(EMACS_ROOT)/nt/inc
-GNU_LIB                = $(EMACS_ROOT)/lib
-
-MS_W32_H       = $(NT_INC)/ms-w32.h \
-                $(NT_INC)/sys/stat.h
-CONF_POST_H    = $(SRC)/conf_post.h \
-                $(MS_W32_H)
-CONFIG_H       = $(SRC)/config.h \
-                $(CONF_POST_H)
-INTTYPES_H     = $(NT_INC)/inttypes.h \
-                $(NT_INC)/stdint.h
-NTLIB_H        = $(LIB_SRC)/ntlib.h \
-                $(NT_INC)/pwd.h
-SYSTIME_H      = $(SRC)/systime.h \
-                $(NT_INC)/sys/time.h \
-                $(GNU_LIB)/timespec.h
-SYSWAIT_H      = $(SRC)/syswait.h \
-                $(NT_INC)/stdbool.h \
-                $(NT_INC)/sys/wait.h
-
-$(BLD)/ctags.$(O) : \
-       $(LIB_SRC)/ctags.c \
-       $(SRC)/regex.h \
-       $(NT_INC)/sys/stat.h \
-       $(NT_INC)/unistd.h \
-       $(GNU_LIB)/c-strcase.h \
-       $(GNU_LIB)/getopt.h \
-       $(CONFIG_H)
-
-$(BLD)/ebrowse.$(O) : \
-       $(LIB_SRC)/ebrowse.c \
-       $(GNU_LIB)/getopt.h \
-       $(GNU_LIB)/min-max.h \
-       $(CONFIG_H)
-
-$(BLD)/emacsclient.$(O) : \
-       $(LIB_SRC)/emacsclient.c \
-       $(NT_INC)/pwd.h \
-       $(NT_INC)/sys/stat.h \
-       $(NT_INC)/unistd.h \
-       $(GNU_LIB)/getopt.h \
-       $(CONFIG_H)
-
-$(BLD)/etags.$(O) : \
-       $(LIB_SRC)/etags.c \
-       $(SRC)/regex.h \
-       $(NT_INC)/sys/stat.h \
-       $(NT_INC)/unistd.h \
-       $(GNU_LIB)/c-strcase.h \
-       $(GNU_LIB)/getopt.h \
-       $(CONFIG_H)
-
-$(BLD)/hexl.$(O) : \
-       $(LIB_SRC)/hexl.c \
-       $(CONFIG_H)
-
-$(BLD)/make-docfile.$(O) : \
-       $(LIB_SRC)/make-docfile.c \
-       $(NT_INC)/unistd.h \
-       $(CONFIG_H)
-
-$(BLD)/movemail.$(O) : \
-       $(LIB_SRC)/movemail.c \
-       $(LIB_SRC)/pop.h \
-       $(NT_INC)/pwd.h \
-       $(NT_INC)/sys/file.h \
-       $(NT_INC)/sys/stat.h \
-       $(NT_INC)/unistd.h \
-       $(GNU_LIB)/getopt.h \
-       $(CONFIG_H) \
-       $(NTLIB_H) \
-       $(SYSWAIT_H)
-
-$(BLD)/ntlib.$(O) : \
-       $(LIB_SRC)/ntlib.c \
-       $(NT_INC)/sys/stat.h \
-       $(NTLIB_H)
-
-$(BLD)/pop.$(O) : \
-       $(LIB_SRC)/pop.c \
-       $(LIB_SRC)/pop.h \
-       $(NT_INC)/netdb.h \
-       $(NT_INC)/pwd.h \
-       $(NT_INC)/unistd.h \
-       $(GNU_LIB)/min-max.h \
-       $(CONFIG_H) \
-       $(NTLIB_H)
-
-$(BLD)/profile.$(O) : \
-       $(LIB_SRC)/profile.c \
-       $(GNU_LIB)/intprops.h \
-       $(CONFIG_H) \
-       $(INTTYPES_H) \
-       $(SYSTIME_H)
-
-$(BLD)/regex.$(O) : \
-       $(SRC)/regex.c \
-       $(SRC)/regex.h \
-       $(NT_INC)/stdbool.h \
-       $(NT_INC)/unistd.h \
-       $(CONFIG_H)
-
-$(BLD)/test-distrib.$(O) : \
-       $(LIB_SRC)/test-distrib.c \
-       $(NT_INC)/unistd.h \
-       $(CONFIG_H)
-
-# The following dependencies are for supporting parallel builds, where
-# we must make sure $(BLD) exists before any compilation starts.
-#
-$(BLD)/make-docfile.$(O) $(BLD)/hexl.$(O): stamp_BLD
-
-$(BLD)/test-distrib.$(O) $(MOVEMAILOBJS): stamp_BLD
-
-$(BLD)/emacsclient.$(O) $(BLD)/etags.$(O) $(BLD)/regex.$(O): stamp_BLD
-
-$(BLD)/ebrowse.$(O) $(BLD)/ctags.$(O) $(BLD)/profile.$(O): stamp_BLD
diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c
index 7d9dff9..37b847b 100644
--- a/lib-src/ntlib.c
+++ b/lib-src/ntlib.c
@@ -302,7 +302,7 @@ is_exec (const char * name)
         stricmp (p, ".cmd") == 0));
 }
 
-/* FIXME?  This is in config.nt now - is this still needed?  */
+/* FIXME?  This is in configure.ac now - is this still needed?  */
 #define IS_DIRECTORY_SEP(x) ((x) == '/' || (x) == '\\')
 
 /* We need this because nt/inc/sys/stat.h defines struct stat that is
diff --git a/lib/makefile.w32-in b/lib/makefile.w32-in
deleted file mode 100644
index 8424fd6..0000000
--- a/lib/makefile.w32-in
+++ /dev/null
@@ -1,347 +0,0 @@
-# -*- Makefile -*- for GNU Emacs on the Microsoft Windows API.
-# Copyright (C) 2011-2015 Free Software Foundation, Inc.
-
-# This file is part of GNU Emacs.
-
-# GNU Emacs is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# GNU Emacs is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-ALL = gnulib
-
-.PHONY: $(ALL)
-
-LOCAL_FLAGS    = -I. -I../nt/inc -I../src
-LIBS           =
-
-GNULIBOBJS = $(BLD)/acl-errno-valid.$(O) \
-            $(BLD)/c-ctype.$(O) \
-            $(BLD)/c-strcasecmp.$(O) \
-            $(BLD)/c-strncasecmp.$(O) \
-            $(BLD)/close-stream.$(O) \
-            $(BLD)/dtoastr.$(O) \
-            $(BLD)/dtotimespec.$(O)  \
-            $(BLD)/execinfo.$(O)  \
-            $(BLD)/fpending.$(O)  \
-            $(BLD)/getopt.$(O)  \
-            $(BLD)/getopt1.$(O) \
-            $(BLD)/gettime.$(O) \
-            $(BLD)/memrchr.$(O) \
-            $(BLD)/strftime.$(O) \
-            $(BLD)/time_r.$(O) \
-            $(BLD)/timespec-add.$(O) \
-            $(BLD)/timespec-sub.$(O) \
-            $(BLD)/md5.$(O) \
-            $(BLD)/sha1.$(O) \
-            $(BLD)/sha256.$(O) \
-            $(BLD)/sha512.$(O) \
-            $(BLD)/sig2str.$(O) \
-            $(BLD)/stat-time.$(O) \
-            $(BLD)/timespec.$(O) \
-            $(BLD)/u64.$(O) \
-            $(BLD)/filemode.$(O)
-
-#
-# Build the library
-#
-$(BLD)/libgnu.$(A):    $(GNULIBOBJS)
-       - $(DEL) $@
-       $(AR) $(AR_OUT)$@ $(ALL_DEPS)
-
-gnulib:                $(BLD)/libgnu.$(A)
-
-#
-# Build everything
-#
-all:           $(ALL)
-
-### TAGS ###
-
-FRC:
-
-TAGS: FRC
-        ../lib-src/$(BLD)/etags.exe *.c *.h
-
-### DEPENDENCIES ###
-
-EMACS_ROOT     = ..
-GNU_LIB                = .
-SRC            = $(EMACS_ROOT)/src
-NT_INC         = $(EMACS_ROOT)/nt/inc
-
-ACL_H         = $(GNU_LIB)/acl.h \
-                $(NT_INC)/sys/stat.h \
-                $(NT_INC)/stdbool.h
-C_CTYPE_H      = $(GNU_LIB)/c-ctype.h \
-                $(NT_INC)/stdbool.h
-MS_W32_H       = $(NT_INC)/ms-w32.h \
-                $(NT_INC)/sys/stat.h
-CONF_POST_H    = $(SRC)/conf_post.h \
-                $(MS_W32_H)
-CONFIG_H       = $(SRC)/config.h \
-                $(CONF_POST_H)
-FILEMODE_H     = $(GNU_LIB)/filemode.h \
-                $(NT_INC)/sys/stat.h
-FTOASTR_H      = $(GNU_LIB)/ftoastr.h \
-                $(GNU_LIB)/intprops.h
-FTOASTR_C      = $(GNU_LIB)/ftoastr.c \
-                $(CONFIG_H) \
-                $(FTOASTR_H)
-GETOPT_INT_H   = $(GNU_LIB)/getopt_int.h \
-                $(GNU_LIB)/getopt.h
-MD5_H          = $(GNU_LIB)/md5.h \
-                $(NT_INC)/stdint.h
-SHA1_H         = $(GNU_LIB)/sha1.h \
-                $(NT_INC)/stdint.h
-SHA256_H       = $(GNU_LIB)/sha256.h \
-                $(NT_INC)/stdint.h
-U64_H          = $(GNU_LIB)/u64.h \
-                $(NT_INC)/stdint.h
-SHA512_H       = $(GNU_LIB)/sha512.h \
-                $(U64_H)
-SIG2STR_H      = $(GNU_LIB)/sig2str.h \
-                $(GNU_LIB)/intprops.h
-STAT_TIME_H    = $(GNU_LIB)/stat-time.h \
-                $(NT_INC)/sys/stat.h
-
-$(BLD)/acl-errno-valid.$(O) : \
-       $(GNU_LIB)/acl-errno-valid.c \
-       $(ACL_H) \
-       $(CONFIG_H)
-
-$(BLD)/c-ctype.$(O) : \
-       $(GNU_LIB)/c-ctype.c \
-       $(CONFIG_H) \
-       $(C_CTYPE_H)
-
-$(BLD)/c-strcasecmp.$(O) : \
-       $(GNU_LIB)/c-strcasecmp.c \
-       $(GNU_LIB)/c-strcase.h \
-       $(CONFIG_H) \
-       $(C_CTYPE_H)
-
-$(BLD)/c-strncasecmp.$(O) : \
-       $(GNU_LIB)/c-strncasecmp.c \
-       $(GNU_LIB)/c-strcase.h \
-       $(CONFIG_H) \
-       $(C_CTYPE_H)
-
-$(BLD)/close-stream.$(O) : \
-       $(GNU_LIB)/close-stream.c \
-       $(GNU_LIB)/close-stream.h \
-       $(GNU_LIB)/fpending.h \
-       $(NT_INC)/stdbool.h \
-       $(CONFIG_H)
-
-$(BLD)/dtoastr.$(O) : \
-       $(GNU_LIB)/dtoastr.c \
-       $(FTOASTR_C)
-
-$(BLD)/dtotimespec.$(O) : \
-       $(GNU_LIB)/dtotimespec.c \
-       $(GNU_LIB)/intprops.h \
-       $(GNU_LIB)/timespec.h \
-       $(CONFIG_H)
-
-$(BLD)/execinfo.$(O) : \
-       $(GNU_LIB)/execinfo.c \
-       $(GNU_LIB)/execinfo.h \
-       $(CONFIG_H)
-
-$(BLD)/fpending.$(O) : \
-       $(GNU_LIB)/fpending.c \
-       $(GNU_LIB)/fpending.h \
-       $(CONFIG_H)
-
-$(BLD)/getopt.$(O) : \
-       $(GNU_LIB)/getopt.c \
-       $(GNU_LIB)/getopt.h \
-       $(GNU_LIB)/gettext.h \
-       $(NT_INC)/unistd.h \
-       $(CONFIG_H) \
-       $(GETOPT_INT_H)
-
-$(BLD)/getopt1.$(O) : \
-       $(GNU_LIB)/getopt1.c \
-       $(GNU_LIB)/getopt.h \
-       $(CONFIG_H) \
-       $(GETOPT_INT_H)
-
-$(BLD)/gettime.$(O) : \
-       $(GNU_LIB)/gettime.c \
-       $(GNU_LIB)/timespec.h \
-       $(NT_INC)/sys/time.h \
-       $(CONFIG_H)
-
-$(BLD)/strftime.$(O) : \
-       $(GNU_LIB)/strftime.c \
-       $(GNU_LIB)/strftime.h \
-       $(NT_INC)/stdbool.h \
-       $(CONFIG_H)
-
-$(BLD)/time_r.$(O) : \
-       $(GNU_LIB)/time_r.c \
-       $(CONFIG_H)
-
-$(BLD)/timespec-add.$(O) : \
-       $(GNU_LIB)/timespec-add.c \
-       $(GNU_LIB)/intprops.h \
-       $(GNU_LIB)/timespec.h \
-       $(CONFIG_H)
-
-$(BLD)/timespec-sub.$(O) : \
-       $(GNU_LIB)/timespec-sub.c \
-       $(GNU_LIB)/intprops.h \
-       $(GNU_LIB)/timespec.h \
-       $(CONFIG_H)
-
-$(BLD)/md5.$(O) : \
-       $(GNU_LIB)/md5.c \
-       $(NT_INC)/stdalign.h \
-       $(NT_INC)/stdint.h \
-       $(CONFIG_H) \
-       $(MD5_H)
-
-$(BLD)/memrchr.$(O) : \
-       $(GNU_LIB)/memrchr.c \
-       $(CONFIG_H)
-
-$(BLD)/sha1.$(O) : \
-       $(GNU_LIB)/sha1.c \
-       $(NT_INC)/stdalign.h \
-       $(NT_INC)/stdint.h \
-       $(CONFIG_H) \
-       $(SHA1_H)
-
-$(BLD)/sha256.$(O) : \
-       $(GNU_LIB)/sha256.c \
-       $(NT_INC)/stdalign.h \
-       $(NT_INC)/stdint.h \
-       $(CONFIG_H) \
-       $(SHA256_H)
-
-$(BLD)/sha512.$(O) : \
-       $(GNU_LIB)/sha512.c \
-       $(NT_INC)/stdalign.h \
-       $(NT_INC)/stdint.h \
-       $(CONFIG_H) \
-       $(SHA512_H)
-
-$(BLD)/stat-time.$(O) : \
-       $(GNU_LIB)/stat-time.c \
-       $(CONFIG_H) \
-       $(STAT_TIME_H)
-
-$(BLD)/timespec.$(O) : \
-       $(GNU_LIB)/timespec.c \
-       $(GNU_LIB)/timespec.h \
-       $(CONFIG_H)
-
-$(BLD)/u64.$(O) : \
-       $(GNU_LIB)/u64.c \
-       $(CONFIG_H) \
-       $(U64_H)
-
-$(BLD)/filemode.$(O) : \
-       $(GNU_LIB)/filemode.c \
-       $(CONFIG_H) \
-       $(FILEMODE_H)
-
-$(BLD)/sig2str.$(O) : \
-       $(GNU_LIB)/sig2str.c \
-       $(CONFIG_H) \
-       $(SIG2STR_H)
-
-
-# The following dependencies are for supporting parallel builds, where
-# we must make sure $(BLD) exists before any compilation starts.
-#
-$(GNULIBOBJS): stamp_BLD
-
-#
-# Headers we would preprocess if we could.
-#
-getopt.h:      getopt_.h
-       $(CP) $(ALL_DEPS) $@
-
-#
-# Maintenance
-#
-clean:
-       - $(DEL) $(COMPILER_TEMP_FILES)
-       - $(DEL) getopt.h
-       - $(DEL_TREE) $(OBJDIR)
-       - $(DEL) stamp_BLD
-
-distclean:     cleanall
-       - $(DEL) TAGS
-       - $(DEL) Makefile
-
-maintainer-clean: distclean
-       - $(DEL) getopt_.h
-
-cleanall:      clean
-       - $(DEL_TREE) obj
-       - $(DEL_TREE) obj-spd
-       - $(DEL_TREE) oo
-       - $(DEL_TREE) oo-spd
-
-# A dummy target to force other targets to be evaluated.
-doit:
-
-getopt_.h: getopt.in.h $(ARG_NONNULL_H)
-       $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
-
-getopt_.h-CMD: doit
-       @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
-       @echo Run "$(MAKETYPE) getopt_h" in the lib/ subdirectory.
-       @echo You will need GNU Sed to be installed.
-       exit -1
-
-getopt_.h-SH: doit
-       @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
-       @echo Run '"$(MAKETYPE) getopt_h"' in the lib/ subdirectory.
-       @echo You will need GNU Sed to be installed.
-       exit -1
-
-# Generating getopt_.h from getopt.in.h.
-#
-# To avoid requiring all end users to install Sed, we have below
-# a maintainer-only target that produces getopt_.h from getopt.in.h.
-# For easier maintenance, all the strings that replace the @FOO@
-# placeholder are defined as Make macros below.
-
-HAVE_GETOPT_H = HAVE_GETOPT_H
-INCLUDE_NEXT = include_next
-PRAGMA_COLUMNS =
-NEXT_GETOPT_H = <getopt.h>
-ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h
-
-getopt_h:
-       - $(DEL) getopt_.h-t getopt_.h
-       sed -e "address@hidden@!GL!g" \
-           -e "address@hidden@!$(HAVE_GETOPT_H)!g" \
-           -e "address@hidden@!$(INCLUDE_NEXT)!g" \
-           -e "address@hidden@!$(PRAGMA_SYSTEM_HEADER)!g" \
-           -e "address@hidden@!$(PRAGMA_COLUMNS)!g" \
-           -e "address@hidden@!$(NEXT_GETOPT_H)!g" \
-           -e "/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)" \
-           -e "/^\# include_next/i # ifndef __GNUC__" \
-           -e "/^\# include_next/i # include <next_getopt.h>" \
-           -e "/^\# include_next/i # else" \
-           -e "/^\# include_next/a # endif" \
-             < getopt.in.h > getopt_.h-t
-       $(CP) getopt_.h-t getopt_.h
-       - $(DEL) getopt_.h-t
-
-execinfo.h: execinfo.in.h
-       $(CP) execinfo.in.h $@
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index f9f078b..02b9fd7 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -399,7 +399,7 @@ A prefix argument means don't query; expand all abbrevs."
                   (buffer-substring-no-properties
                    (save-excursion (forward-word -1) (point))
                    pnt)))
-           (if (or noquery (y-or-n-p (format "Expand `%s'? " string)))
+           (if (or noquery (y-or-n-p (format "Expand ‘%s’? " string)))
                (expand-abbrev)))))))
 
 ;;; Abbrev properties.
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el
index 3c71a81..c6dba89 100644
--- a/lisp/allout-widgets.el
+++ b/lisp/allout-widgets.el
@@ -869,7 +869,7 @@ Optional RECURSING is for internal use, to limit recursion."
     ;; tell the allout-widgets-post-command-business to reestablish the hook:
     (setq allout-widgets-reenable-before-change-handler t)
     ;; and raise an error to prevent the edit (and disable the hook):
-    (error
+    (error "%s"
      (substitute-command-keys allout-structure-unruly-deletion-message)))))
 ;;;_    > allout-widgets-after-change-handler
 (defun allout-widgets-after-change-handler (_beg _end _prelength)
@@ -2287,7 +2287,7 @@ Deletes allowed only when `inhibit-read-only' is t."
    ((yes-or-no-p "Unruly edit of outline structure - allow? ")
     (setq allout-widgets-unset-inhibit-read-only (not inhibit-read-only)
           inhibit-read-only t))
-   (t (error
+   (t (error "%s"
        (substitute-command-keys allout-structure-unruly-deletion-message)))))
 ;;;_   > allout-item-icon-key-handler ()
 (defun allout-item-icon-key-handler ()
diff --git a/lisp/allout.el b/lisp/allout.el
index db87cb1..025cb17 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -6378,8 +6378,9 @@ for details on preparing Emacs for automatic allout 
activation."
     (if (allout-goto-prefix)
        t
       (allout-open-topic 2)
-      (insert (concat "Dummy outline topic header -- see"
-                      "`allout-mode' docstring: `^Hm'."))
+      (insert (substitute-command-keys
+               (concat "Dummy outline topic header -- see"
+                       " ‘allout-mode’ docstring: ‘\\[describe-mode]’.")))
       (allout-adjust-file-variable
        "allout-layout" (or allout-layout '(-1 : 0))))))
 ;;;_   > allout-file-vars-section-data ()
diff --git a/lisp/avoid.el b/lisp/avoid.el
index 767f6d3..36ced39 100644
--- a/lisp/avoid.el
+++ b/lisp/avoid.el
@@ -163,9 +163,9 @@ Analogous to `mouse-position'."
 
 ;(defun mouse-avoidance-point-position-test ()
 ;  (interactive)
-;  (message (format "point=%s mouse=%s"
-;                 (cdr (mouse-avoidance-point-position))
-;                 (cdr (mouse-position)))))
+;  (message "point=%s mouse=%s"
+;          (cdr (mouse-avoidance-point-position))
+;          (cdr (mouse-position))))
 
 (defun mouse-avoidance-set-mouse-position (pos)
   ;; Carefully set mouse position to given position (X . Y)
diff --git a/lisp/button.el b/lisp/button.el
index e7602dd..5fe5bf0 100644
--- a/lisp/button.el
+++ b/lisp/button.el
@@ -114,7 +114,7 @@ Mode-specific keymaps may want to use this as their parent 
keymap.")
   "Return the symbol used by button-type TYPE to store properties.
 Buttons inherit them by setting their `category' property to that symbol."
   (or (get type 'button-category-symbol)
-      (error "Unknown button type `%s'" type)))
+      (error "Unknown button type ‘%s’" type)))
 
 (defun define-button-type (name &rest properties)
   "Define a `button type' called NAME (a symbol).
@@ -208,7 +208,7 @@ changes to a supertype are not reflected in its subtypes)."
         (setq val (button-category-symbol val)))
        ((eq prop 'category)
         ;; Disallow updating the `category' property directly.
-        (error "Button `category' property may not be set directly")))
+        (error "Button ‘category’ property may not be set directly")))
   ;; Add the property.
   (cond ((overlayp button)
         (overlay-put button prop val))
@@ -333,7 +333,7 @@ Also see `insert-text-button'."
       (setq object beg beg 0 end (length object)))
     ;; Disallow setting the `category' property directly.
     (when (plist-get properties 'category)
-      (error "Button `category' property may not be set directly"))
+      (error "Button ‘category’ property may not be set directly"))
     (if (null type-entry)
        ;; The user didn't specify a `type' property, use the default.
        (setq properties (cons 'category (cons 'default-button properties)))
diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el
index b2e7df1..7a1a983 100644
--- a/lisp/calc/calc-help.el
+++ b/lisp/calc/calc-help.el
@@ -365,7 +365,7 @@ C-w  Describe how there is no warranty for Calc."
     (let (Info-history)
       (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1))))
     (let* ((string-target (or target thing))
-           (quoted (format "['`‘]%s['’]" (regexp-quote string-target)))
+           (quoted (concat "['`‘]" (regexp-quote string-target) "['’]"))
            (bracketed (format "\\[%s\\]\\|(%s)\\|\\<The[ \n]%s"
                               quoted quoted quoted)))
       (or (let ((case-fold-search nil))
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el
index 8085c1c..6d7cea6 100644
--- a/lisp/calendar/holidays.el
+++ b/lisp/calendar/holidays.el
@@ -791,8 +791,16 @@ is non-nil)."
 ;; Prior call to calendar-julian-from-absolute will autoload cal-julian.
 (declare-function calendar-julian-to-absolute "cal-julian" (date))
 
-(defun holiday-greek-orthodox-easter ()
-  "Date of Easter according to the rule of the Council of Nicaea."
+(defun holiday-greek-orthodox-easter (&optional n string)
+  "Date of Nth day after Easter (named STRING), if visible in calendar window.
+It is calculated according to the rule of the Council of Nicaea.
+Negative values of N are interpreted as days before Easter.
+STRING is used purely for display purposes.  The return value has
+the form ((MONTH DAY YEAR) STRING), where the date is that of the
+Nth day before or after Easter.
+
+For backwards compatibility, if this function is called with no
+arguments, it returns the date of Pascha (Greek Orthodox Easter)."
   (let* ((m displayed-month)
          (y displayed-year)
          (julian-year (progn
@@ -808,11 +816,10 @@ is non-nil)."
          (paschal-moon      ; day after full moon on or after March 21
           (- (calendar-julian-to-absolute (list 4 19 julian-year))
              shifted-epact))
-         (nicaean-easter           ; Sunday following the Paschal moon
-          (calendar-gregorian-from-absolute
-           (calendar-dayname-on-or-before 0 (+ paschal-moon 7)))))
-    (if (calendar-date-is-visible-p nicaean-easter)
-        (list (list nicaean-easter "Pascha (Greek Orthodox Easter)")))))
+        (abs-easter (calendar-dayname-on-or-before 0 (+ paschal-moon 7)))
+        (greg (calendar-gregorian-from-absolute (+ abs-easter (or n 0)))))
+    (if (calendar-date-is-visible-p greg)
+       (list (list greg (or string "Pascha (Greek Orthodox Easter)"))))))
 
 (provide 'holidays)
 
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index 3e2a2f8..734462d 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -1629,8 +1629,8 @@ enumeration, given as a time value, in same format as 
returned by
                                  (icalendar--convert-ordinary-to-ical
                                   nonmarker (format "%4d/%02d/%02d %s" y m d 
see))))
                              (;TODO:
-                              (error (format "Unsupported Sexp-entry: %s"
-                                             entry-main))))))
+                              (error "Unsupported Sexp-entry: %s"
+                                     entry-main)))))
                     (number-sequence
                      0 (- icalendar-export-sexp-enumeration-days 1))))))
         (t
diff --git a/lisp/cedet/mode-local.el b/lisp/cedet/mode-local.el
index 3bdc3ea..aa1dd65 100644
--- a/lisp/cedet/mode-local.el
+++ b/lisp/cedet/mode-local.el
@@ -629,10 +629,9 @@ SYMBOL is a function that can be overridden."
 (defun mode-local-print-binding (symbol)
   "Print the SYMBOL binding."
   (let ((value (symbol-value symbol)))
-    (princ (format (substitute-command-keys "\n     ‘%s’ value is\n       ")
-                   symbol))
+    (princ (format "\n     ‘%s’ value is\n       " symbol))
     (if (and value (symbolp value))
-        (princ (format (substitute-command-keys "‘%s’") value))
+        (princ (format "‘%s’" value))
       (let ((pt (point)))
         (pp value)
         (save-excursion
@@ -690,7 +689,7 @@ SYMBOL is a function that can be overridden."
       )
      ((symbolp buffer-or-mode)
       (setq mode buffer-or-mode)
-      (princ (format (substitute-command-keys "‘%s’\n") buffer-or-mode))
+      (princ (format "‘%s’\n" buffer-or-mode))
       )
      ((signal 'wrong-type-argument
               (list 'buffer-or-mode buffer-or-mode))))
@@ -700,7 +699,7 @@ SYMBOL is a function that can be overridden."
     (while mode
       (setq table (get mode 'mode-local-symbol-table))
       (when table
-        (princ (format (substitute-command-keys "\n- From ‘%s’\n") mode))
+        (princ (format "\n- From ‘%s’\n" mode))
         (mode-local-print-bindings table))
       (setq mode (get-mode-local-parent mode)))))
 
diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el
index 39ba13c..dea73a0 100644
--- a/lisp/cedet/pulse.el
+++ b/lisp/cedet/pulse.el
@@ -131,25 +131,28 @@ Return t if there is more drift to do, nil if completed."
   (if (>= (get 'pulse-highlight-face :iteration) pulse-iterations)
       nil
     (let* ((frame (color-values (face-background 'default)))
-          (start (color-values (face-background
-                                (get 'pulse-highlight-face
-                                     :startface)
-                                 nil t)))
-          (frac  (list (/ (- (nth 0 frame) (nth 0 start)) pulse-iterations)
-                       (/ (- (nth 1 frame) (nth 1 start)) pulse-iterations)
-                       (/ (- (nth 2 frame) (nth 2 start)) pulse-iterations)))
-          (it (get 'pulse-highlight-face :iteration))
-          )
-      (set-face-background 'pulse-highlight-face
-                          (pulse-color-values-to-hex
-                           (list
-                            (+ (nth 0 start) (* (nth 0 frac) it))
-                            (+ (nth 1 start) (* (nth 1 frac) it))
-                            (+ (nth 2 start) (* (nth 2 frac) it)))))
-      (put 'pulse-highlight-face :iteration (1+ it))
-      (if (>= (1+ it) pulse-iterations)
-         nil
-       t))))
+          (pulse-background (face-background
+                             (get 'pulse-highlight-face
+                                  :startface)
+                              nil t)));; can be nil
+      (when pulse-background
+       (let* ((start (color-values pulse-background))
+              (frac  (list (/ (- (nth 0 frame) (nth 0 start)) pulse-iterations)
+                           (/ (- (nth 1 frame) (nth 1 start)) pulse-iterations)
+                           (/ (- (nth 2 frame) (nth 2 start)) 
pulse-iterations)))
+              (it (get 'pulse-highlight-face :iteration))
+              )
+         (set-face-background 'pulse-highlight-face
+                              (pulse-color-values-to-hex
+                               (list
+                                (+ (nth 0 start) (* (nth 0 frac) it))
+                                (+ (nth 1 start) (* (nth 1 frac) it))
+                                (+ (nth 2 start) (* (nth 2 frac) it)))))
+         (put 'pulse-highlight-face :iteration (1+ it))
+         (if (>= (1+ it) pulse-iterations)
+             nil
+           t)))
+      )))
 
 (defun pulse-reset-face (&optional face)
   "Reset the pulse highlighting FACE."
diff --git a/lisp/cedet/semantic/bovine/scm.el 
b/lisp/cedet/semantic/bovine/scm.el
index 8b99e70..745731c 100644
--- a/lisp/cedet/semantic/bovine/scm.el
+++ b/lisp/cedet/semantic/bovine/scm.el
@@ -70,7 +70,7 @@ Attempts a simple prototype for calling or using TAG."
 (define-lex-regex-analyzer semantic-lex-scheme-symbol
   "Detect and create symbol and keyword tokens."
   "\\(\\sw\\([:]\\|\\sw\\|\\s_\\)*\\)"
-  ;; (message (format "symbol: %s" (match-string 0)))
+  ;; (message "symbol: %s" (match-string 0))
   (semantic-lex-push-token
    (semantic-lex-token
     (or (semantic-lex-keyword-p (match-string 0)) 'symbol)
diff --git a/lisp/cedet/semantic/wisent/python.el 
b/lisp/cedet/semantic/wisent/python.el
index a8348d2..6abeb4a 100644
--- a/lisp/cedet/semantic/wisent/python.el
+++ b/lisp/cedet/semantic/wisent/python.el
@@ -534,9 +534,6 @@ Shortens 'code' tags, but passes through for others."
                                      (code . "Code")))
    )
 
-;;;###autoload
-(add-hook 'python-mode-hook 'wisent-python-default-setup)
-
 ;; Make sure the newer python modes pull in the same python
 ;; mode overrides.
 (define-child-mode python-2-mode python-mode "Python 2 mode")
diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el
index 48f0555..efcfe4b 100644
--- a/lisp/cedet/srecode/srt-mode.el
+++ b/lisp/cedet/srecode/srt-mode.el
@@ -258,9 +258,9 @@ we can tell font lock about them.")
            (when (class-abstract-p C)
              (throw 'skip nil))
 
-           (princ (substitute-command-keys "‘"))
+           (princ (format "‘"))
            (princ name)
-           (princ (substitute-command-keys "’"))
+           (princ (format "’"))
            (when (slot-exists-p C 'key)
              (when key
                (princ " - Character Key: ")
diff --git a/lisp/character-fold.el b/lisp/character-fold.el
index bf5ae59..6bbb3ec 100644
--- a/lisp/character-fold.el
+++ b/lisp/character-fold.el
@@ -94,8 +94,7 @@ some).")
       ;; Add some manual entries.
       (dolist (it '((?\" """ "“" "”" "”" "„" "⹂" "〞" "‟" "‟" "❞" "❝" "❠" "“" 
"„" "〝" "〟" "🙷" "🙶" "🙸" "«" "»")
                     (?' "❟" "❛" "❜" "‘" "’" "‚" "‛" "‚" "󠀢" "❮" "❯" "‹" "›")
-                    (?` "❛" "‘" "‛" "󠀢" "❮" "‹")
-                    (?\s "\t" "\r" "\n")))
+                    (?` "❛" "‘" "‛" "󠀢" "❮" "‹")))
         (let ((idx (car it))
               (chars (cdr it)))
           (aset equiv idx (append chars (aref equiv idx)))))
@@ -121,12 +120,11 @@ If LAX is non-nil, any single whitespace character is 
allowed to
 match any number of times."
   (if character-fold-search
       (apply #'concat
-        (mapcar (lambda (c) (let ((out (or (aref character-fold-table c)
-                                      (regexp-quote (string c)))))
-                         (if (and lax (memq c '(?\s ?\t ?\r ?\n )))
-                             (concat out "+")
-                           out)))
-                string))
+             (mapcar (lambda (c) (if (and lax (memq c '(?\s ?\t ?\r ?\n)))
+                                "[ 
\t\n\r\xa0\x2002\x2d\x200a\x202f\x205f\x3000]+"
+                              (or (aref character-fold-table c)
+                                  (regexp-quote (string c)))))
+                     string))
     (regexp-quote string)))
 
 ;;; character-fold.el ends here
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 7a37198..daa95d1 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -637,7 +637,7 @@ since it could result in memory overflow and make Emacs 
crash."
     (if (not (boundp symbol))
        ;; If variables are removed from C code, give an error here!
        (and native-p
-            (message "Note, built-in variable `%S' not bound" symbol))
+            (message "Note, built-in variable ‘%S’ not bound" symbol))
       ;; Save the standard value, unless we already did.
       (or (get symbol 'standard-value)
          (put symbol 'standard-value (list standard)))
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index bc221e1..f8e5650 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -492,10 +492,10 @@ It includes all faces in list FACES."
                         '("" "c")))
        doc)
     (when fn
-      (princ (substitute-command-keys " in ‘"))
+      (princ (format " in ‘"))
       (help-insert-xref-button (file-name-nondirectory fn)
                               'help-theme-def fn)
-      (princ (substitute-command-keys "’")))
+      (princ (format "’")))
     (princ ".\n")
     (if (custom-theme-p theme)
        (progn
diff --git a/lisp/custom.el b/lisp/custom.el
index ea5ab7a..f2b5d52 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -548,13 +548,13 @@ VALUE should be a list of symbols.  For each symbol in 
that list,
 this specifies that SYMBOL should be set after the specified symbol,
 if both appear in constructs like `custom-set-variables'."
   (unless (listp value)
-    (error "Invalid custom dependency `%s'" value))
+    (error "Invalid custom dependency ‘%s’" value))
   (let* ((deps (get symbol 'custom-dependencies))
         (new-deps deps))
     (while value
       (let ((dep (car value)))
        (unless (symbolp dep)
-         (error "Invalid custom dependency `%s'" dep))
+         (error "Invalid custom dependency ‘%s’" dep))
        (unless (memq dep new-deps)
          (setq new-deps (cons dep new-deps)))
        (setq value (cdr value))))
@@ -830,7 +830,7 @@ to the front of this list.")
 (defsubst custom-check-theme (theme)
   "Check whether THEME is valid, and signal an error if it is not."
   (unless (custom-theme-p theme)
-    (error "Unknown theme `%s'" theme)))
+    (error "Unknown theme ‘%s’" theme)))
 
 (defun custom-push-theme (prop symbol theme mode &optional value)
   "Record VALUE for face or variable SYMBOL in custom theme THEME.
@@ -1043,7 +1043,7 @@ list, in which A occurs before B if B was defined with a
     (when elt
       (cond
        ((eq (car elt) 'dependant)
-       (error "Circular custom dependency on `%s'" sym))
+       (error "Circular custom dependency on ‘%s’" sym))
        ((car elt)
        (setcar elt 'dependant)
        (dolist (dep (get sym 'custom-dependencies))
@@ -1201,7 +1201,7 @@ Return t if THEME was successfully loaded, nil otherwise."
                                     (custom-available-themes))))
     nil nil))
   (unless (custom-theme-name-valid-p theme)
-    (error "Invalid theme name `%s'" theme))
+    (error "Invalid theme name ‘%s’" theme))
   ;; If THEME is already enabled, re-enable it after loading, even if
   ;; NO-ENABLE is t.
   (if no-enable
@@ -1217,7 +1217,7 @@ Return t if THEME was successfully loaded, nil otherwise."
                         '("" "c")))
        hash)
     (unless fn
-      (error "Unable to find theme file for `%s'" theme))
+      (error "Unable to find theme file for ‘%s’" theme))
     (with-temp-buffer
       (insert-file-contents fn)
       (setq hash (secure-hash 'sha256 (current-buffer)))
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 71233d4..579278c 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -161,11 +161,8 @@ otherwise."
       ;; Buttons
       (when (and button (not (widgetp wid-button)))
        (newline)
-       (insert (substitute-command-keys "Here is a ‘")
-               (format "%S" button-type)
-               (substitute-command-keys "’ button labeled ‘")
-               button-label
-               (substitute-command-keys "’.\n\n")))
+       (insert (format "Here is a ‘%S’ button labeled ‘%s’.\n\n"
+                       button-type button-label)))
       ;; Overlays
       (when overlays
        (newline)
@@ -739,9 +736,7 @@ relevant to POS."
                       (when face
                         (insert (propertize " " 'display '(space :align-to 5))
                                 "face: ")
-                        (insert (substitute-command-keys "‘")
-                                (symbol-name face)
-                                (substitute-command-keys "’\n"))))))
+                        (insert (format "‘%s’\n" face))))))
               (insert "these terminal codes:\n")
               (dotimes (i (length disp-vector))
                 (insert (car (aref disp-vector i))
diff --git a/lisp/electric.el b/lisp/electric.el
index ca05c8c..8ca0931 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -428,8 +428,10 @@ The variable `electric-layout-rules' says when and how to 
insert newlines."
   :type 'boolean :safe 'booleanp :group 'electricity)
 
 (defun electric--insertable-p (string)
-  (not (unencodable-char-position nil nil buffer-file-coding-system
-                                  nil string)))
+  (or (not buffer-file-coding-system)
+      (eq (coding-system-base buffer-file-coding-system) 'undecided)
+      (not (unencodable-char-position nil nil buffer-file-coding-system
+                                      nil string))))
 
 (defun electric-quote-post-self-insert-function ()
   "Function that ‘electric-quote-mode’ adds to ‘post-self-insert-hook’.
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 081ea31..2022e1d 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -267,7 +267,7 @@ The return value is undefined.
                                 (cdr body)
                               body)))
                     nil)
-                   (t (message "Warning: Unknown defun property `%S' in %S"
+                   (t (message "Warning: Unknown defun property ‘%S’ in %S"
                                (car x) name)))))
                    decls))
           (def (list 'defalias
@@ -317,7 +317,7 @@ The return value is undefined.
   (declare (debug defun) (doc-string 3))
   (or (memq (get name 'byte-optimizer)
            '(nil byte-compile-inline-expand))
-      (error "`%s' is a primitive" name))
+      (error "‘%s’ is a primitive" name))
   `(prog1
        (defun ,name ,arglist ,@body)
      (eval-and-compile
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index 101864d..132aaa5 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -518,7 +518,9 @@ This sets the values of: `cl-most-positive-float', 
`cl-most-negative-float',
 (defun cl-subseq (seq start &optional end)
   "Return the subsequence of SEQ from START to END.
 If END is omitted, it defaults to the length of the sequence.
-If START or END is negative, it counts from the end."
+If START or END is negative, it counts from the end.
+Signal an error if START or END are outside of the sequence (i.e
+too large if positive or too small if negative)"
   (declare (gv-setter
             (lambda (new)
               (macroexp-let2 nil new new
@@ -750,16 +752,16 @@ including `cl-block' and `cl-eval-when'."
         ;; FIXME: Add a `cl-class-of' or `cl-typeof' or somesuch.
         (metatype (cl--class-name (symbol-value (aref class 0)))))
     (insert (symbol-name type)
-            (substitute-command-keys " is a type (of kind ‘"))
+            (format " is a type (of kind ‘"))
     (help-insert-xref-button (symbol-name metatype)
                              'cl-help-type metatype)
-    (insert (substitute-command-keys "’)"))
+    (insert (format "’)"))
     (when location
-      (insert (substitute-command-keys " in ‘"))
+      (insert (format " in ‘"))
       (help-insert-xref-button
        (help-fns-short-filename location)
        'cl-type-definition type location 'define-type)
-      (insert (substitute-command-keys "’")))
+      (insert (format "’")))
     (insert ".\n")
 
     ;; Parents.
@@ -769,10 +771,10 @@ including `cl-block' and `cl-eval-when'."
         (insert " Inherits from ")
         (while (setq cur (pop pl))
           (setq cur (cl--class-name cur))
-          (insert (substitute-command-keys "‘"))
+          (insert (format "‘"))
           (help-insert-xref-button (symbol-name cur)
                                    'cl-help-type cur)
-          (insert (substitute-command-keys (if pl "’, " "’"))))
+          (insert (format (if pl "’, " "’"))))
         (insert ".\n")))
 
     ;; Children, if available.  ¡For EIEIO!
@@ -783,10 +785,10 @@ including `cl-block' and `cl-eval-when'."
       (when ch
         (insert " Children ")
         (while (setq cur (pop ch))
-          (insert (substitute-command-keys "‘"))
+          (insert (format "‘"))
           (help-insert-xref-button (symbol-name cur)
                                    'cl-help-type cur)
-          (insert (substitute-command-keys (if ch "’, " "’"))))
+          (insert (format (if ch "’, " "’"))))
         (insert ".\n")))
 
     ;; Type's documentation.
@@ -802,10 +804,10 @@ including `cl-block' and `cl-eval-when'."
       (when generics
         (insert (propertize "Specialized Methods:\n\n" 'face 'bold))
         (dolist (generic generics)
-          (insert (substitute-command-keys "‘"))
+          (insert (format "‘"))
           (help-insert-xref-button (symbol-name generic)
                                    'help-function generic)
-          (insert (substitute-command-keys "’"))
+          (insert (format "’"))
           (pcase-dolist (`(,qualifiers ,args ,doc)
                          (cl--generic-method-documentation generic type))
             (insert (format " %s%S\n" qualifiers args)
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index 619428d..cecd737 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -192,7 +192,7 @@ BODY, if present, is used as the body of a default method.
          (when doc (error "Multiple doc strings for %S" name))
          (setq doc (cadr (pop options-and-methods))))
         (`declare
-         (when declarations (error "Multiple `declare' for %S" name))
+         (when declarations (error "Multiple ‘declare’ for %S" name))
          (setq declarations (pop options-and-methods)))
         (`:method (push (cdr (pop options-and-methods)) methods))
         (_ (push (pop options-and-methods) options))))
@@ -208,7 +208,7 @@ BODY, if present, is used as the body of a default method.
                                        defun-declarations-alist))))
                      (cond
                       (f (apply (car f) name args (cdr declaration)))
-                      (t (message "Warning: Unknown defun property `%S' in %S"
+                      (t (message "Warning: Unknown defun property ‘%S’ in %S"
                                   (car declaration) name)
                          nil))))
                  (cdr declarations))
@@ -791,6 +791,8 @@ Can only be used from within the lexical body of a primary 
or around method."
 ;;; Add support for describe-function
 
 (defun cl--generic-search-method (met-name)
+  "For `find-function-regexp-alist'. Searches for a cl-defmethod.
+MET-NAME is a cons (SYMBOL . SPECIALIZERS)."
   (let ((base-re (concat "(\\(?:cl-\\)?defmethod[ \t]+"
                          (regexp-quote (format "%s" (car met-name)))
                         "\\_>")))
@@ -806,11 +808,15 @@ Can only be used from within the lexical body of a 
primary or around method."
       nil t)
      (re-search-forward base-re nil t))))
 
+;; WORKAROUND: This can't be a defconst due to bug#21237.
+(defvar cl--generic-find-defgeneric-regexp "(\\(?:cl-\\)?defgeneric[ 
\t]+%s\\>")
 
 (with-eval-after-load 'find-func
   (defvar find-function-regexp-alist)
   (add-to-list 'find-function-regexp-alist
-               `(cl-defmethod . ,#'cl--generic-search-method)))
+               `(cl-defmethod . ,#'cl--generic-search-method))
+  (add-to-list 'find-function-regexp-alist
+               `(cl-defgeneric . cl--generic-find-defgeneric-regexp)))
 
 (defun cl--generic-method-info (method)
   (let* ((specializers (cl--generic-method-specializers method))
@@ -858,11 +864,11 @@ Can only be used from within the lexical body of a 
primary or around method."
                                    (cl--generic-method-specializers method)))
                    (file (find-lisp-object-file-name met-name 'cl-defmethod)))
               (when file
-                (insert (substitute-command-keys " in ‘"))
+                (insert (format " in ‘"))
                 (help-insert-xref-button (help-fns-short-filename file)
                                          'help-function-def met-name file
                                          'cl-defmethod)
-                (insert (substitute-command-keys "’.\n"))))
+                (insert (format "’.\n"))))
             (insert "\n" (or (nth 2 info) "Undocumented") "\n\n")))))))
 
 (defun cl--generic-specializers-apply-to-type-p (specializers type)
@@ -986,8 +992,9 @@ The value returned is a list of elements of the form
   `(and (vectorp ,name)
         (> (length ,name) 0)
         (let ((tag (aref ,name 0)))
-          (if (eq (symbol-function tag) :quick-object-witness-check)
-              tag))))
+          (and (symbolp tag)
+               (eq (symbol-function tag) :quick-object-witness-check)
+               tag))))
 
 (defun cl--generic-class-parents (class)
   (let ((parents ())
@@ -1063,7 +1070,7 @@ The value returned is a list of elements of the form
    (and (assq type cl--generic-typeof-types)
         (progn
           (if (memq type '(vector array sequence))
-              (message "`%S' also matches CL structs and EIEIO classes" type))
+              (message "‘%S’ also matches CL structs and EIEIO classes" type))
           (list cl--generic-typeof-generalizer)))
    (cl-call-next-method)))
 
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index ee137f1..1f8572b 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -331,9 +331,10 @@ which more-or-less shadow%s %s's corresponding table%s."
                        "\n\nThis mode "
                      (concat
                       "\n\nIn addition to any hooks its parent mode "
-                      (if (string-match (format "[`‘]%s['’]"
+                      (if (string-match (concat "[`%‘]"
                                                  (regexp-quote
-                                                 (symbol-name parent)))
+                                                 (symbol-name parent))
+                                                 "['%’]")
                                         docstring)
                            nil
                         (format "`%s' " parent))
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index 0b00336..c4d6d35 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -141,11 +141,11 @@ are not abstract."
        (setq location
              (find-lisp-object-file-name ctr def)))
       (when location
-       (insert (substitute-command-keys " in ‘"))
+       (insert (format " in ‘"))
        (help-insert-xref-button
         (help-fns-short-filename location)
         'cl-type-definition ctr location 'define-type)
-       (insert (substitute-command-keys "’")))
+       (insert (format "’")))
       (insert ".\nCreates an object of class " (symbol-name ctr) ".")
       (goto-char (point-max))
       (if (autoloadp def)
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index db96e6e..70a7c5c 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -983,7 +983,7 @@ Optional argument GROUP is the sub-group of slots to 
display.
 
 ;;;***
 
-;;;### (autoloads nil "eieio-opt" "eieio-opt.el" 
"694d44fcd869546592d35f3321f62667")
+;;;### (autoloads nil "eieio-opt" "eieio-opt.el" 
"56c2ecebf2f035fc4440dca87cfc14c8")
 ;;; Generated autoloads from eieio-opt.el
 
 (autoload 'eieio-browse "eieio-opt" "\
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index cd23cd7..4dc0596 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -100,10 +100,34 @@ Please send improvements and fixes to the maintainer."
   :group 'find-function
   :version "22.1")
 
+(defcustom find-feature-regexp
+  (concat ";;; Code:")
+  "The regexp used by `xref-find-definitions' when searching for a feature 
definition.
+Note it must contain a `%s' at the place where `format'
+should insert the feature name."
+  ;; We search for ";;; Code" rather than (feature '%s) because the
+  ;; former is near the start of the code, and the latter is very
+  ;; uninteresting. If the regexp is not found, just goes to
+  ;; (point-min), which is acceptable in this case.
+  :type 'regexp
+  :group 'xref
+  :version "25.0")
+
+(defcustom find-alias-regexp
+  "(defalias +'%s"
+  "The regexp used by `xref-find-definitions' to search for an alias 
definition.
+Note it must contain a `%s' at the place where `format'
+should insert the feature name."
+  :type 'regexp
+  :group 'xref
+  :version "25.0")
+
 (defvar find-function-regexp-alist
   '((nil . find-function-regexp)
     (defvar . find-variable-regexp)
-    (defface . find-face-regexp))
+    (defface . find-face-regexp)
+    (feature . find-feature-regexp)
+    (defalias . find-alias-regexp))
   "Alist mapping definition types into regexp variables.
 Each regexp variable's value should actually be a format string
 to be used to substitute the desired symbol name into the regexp.
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
index 104c23c..01ba656 100644
--- a/lisp/emacs-lisp/lisp-mnt.el
+++ b/lisp/emacs-lisp/lisp-mnt.el
@@ -265,16 +265,17 @@ a section."
 
 (defun lm-header (header)
   "Return the contents of the header named HEADER."
-  (goto-char (point-min))
-  (let ((case-fold-search t))
-    (when (and (re-search-forward (lm-get-header-re header) (lm-code-mark) t)
-              ;;   RCS ident likes format "$identifier: data$"
-              (looking-at
-               (if (save-excursion
-                     (skip-chars-backward "^$" (match-beginning 0))
-                     (= (point) (match-beginning 0)))
-                   "[^\n]+" "[^$\n]+")))
-      (match-string-no-properties 0))))
+  (save-excursion
+    (goto-char (point-min))
+    (let ((case-fold-search t))
+      (when (and (re-search-forward (lm-get-header-re header) (lm-code-mark) t)
+                 ;;   RCS ident likes format "$identifier: data$"
+                 (looking-at
+                  (if (save-excursion
+                        (skip-chars-backward "^$" (match-beginning 0))
+                        (= (point) (match-beginning 0)))
+                      "[^\n]+" "[^$\n]+")))
+        (match-string-no-properties 0)))))
 
 (defun lm-header-multiline (header)
   "Return the contents of the header named HEADER, with continuation lines.
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index ffc6585..cc461c8 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -146,10 +146,10 @@ and also to avoid outputting the warning during normal 
execution."
 (defun macroexp--obsolete-warning (fun obsolescence-data type)
   (let ((instead (car obsolescence-data))
         (asof (nth 2 obsolescence-data)))
-    (format "`%s' is an obsolete %s%s%s" fun type
+    (format "‘%s’ is an obsolete %s%s%s" fun type
             (if asof (concat " (as of " asof ")") "")
             (cond ((stringp instead) (concat "; " instead))
-                  (instead (format "; use `%s' instead." instead))
+                  (instead (format "; use ‘%s’ instead." instead))
                   (t ".")))))
 
 (defun macroexpand-1 (form &optional environment)
diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el
index 08b34fb..ceae99b 100644
--- a/lisp/emacs-lisp/map-ynp.el
+++ b/lisp/emacs-lisp/map-ynp.el
@@ -198,9 +198,9 @@ Returns the number of actions taken."
                                   (objects (if help (nth 1 help) "objects"))
                                   (action (if help (nth 2 help) "act on")))
                               (concat
-                               (format "Type SPC or `y' to %s the current %s;
-DEL or `n' to skip the current %s;
-RET or `q' to give up on the %s (skip all remaining %s);
+                               (format "Type SPC or ‘y’ to %s the current %s;
+DEL or ‘n’ to skip the current %s;
+RET or ‘q’ to give up on the %s (skip all remaining %s);
 C-g to quit (cancel the whole command);
 ! to %s all remaining %s;\n"
                                        action object object action objects 
action
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el
index 5a59a98..4d5b0c7 100644
--- a/lisp/emacs-lisp/nadvice.el
+++ b/lisp/emacs-lisp/nadvice.el
@@ -95,7 +95,7 @@ Each element has the form (WHERE BYTECODE STACK) where:
                (propertize (format "%s advice: " where)
                            'face 'warning)
                (let ((fun (advice--car flist)))
-                 (if (symbolp fun) (format "`%S'" fun)
+                 (if (symbolp fun) (format "‘%S’" fun)
                    (let* ((name (cdr (assq 'name (advice--props flist))))
                           (doc (documentation fun t))
                           (usage (help-split-fundoc doc function)))
@@ -176,7 +176,7 @@ WHERE is a symbol to select an entry in 
`advice--where-alist'."
           (advice--make-1 (aref main 1) (aref main 3)
                           (advice--car main) rest (advice--props main)))
       (let ((desc (assq where advice--where-alist)))
-        (unless desc (error "Unknown add-function location `%S'" where))
+        (unless desc (error "Unknown add-function location ‘%S’" where))
         (advice--make-1 (nth 1 desc) (nth 2 desc)
                         function main props)))))
 
@@ -461,7 +461,7 @@ otherwise it is named address@hidden'.
          (advice (cond ((null name) `(lambda ,lambda-list ,@body))
                        ((or (stringp name) (symbolp name))
                         (intern (format "address@hidden" symbol name)))
-                       (t (error "Unrecognized name spec `%S'" name)))))
+                       (t (error "Unrecognized name spec ‘%S’" name)))))
     `(prog1 ,@(and (symbolp advice) `((defun ,advice ,lambda-list ,@body)))
        (advice-add ',symbol ,where #',advice ,@(and props `(',props))))))
 
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 60977a7..863a02d 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2143,6 +2143,22 @@ will be deleted."
       (with-current-buffer standard-output
         (describe-package-1 package)))))
 
+(defface package-help-section-name-face
+  '((t :inherit (bold font-lock-function-name-face)))
+  "Face used on section names in package description buffers."
+  :version "25.1")
+
+(defun package--print-help-section (name &rest strings)
+  "Print \"NAME: \", right aligned to the 13th column.
+If more STRINGS are provided, insert them followed by a newline.
+Otherwise no newline is inserted."
+  (declare (indent 1))
+  (insert (make-string (max 0 (- 11 (string-width name))) ?\s)
+          (propertize (concat name ": ") 'font-lock-face 
'package-help-section-name-face))
+  (when strings
+    (apply #'insert strings)
+    (insert "\n")))
+
 (declare-function lm-commentary "lisp-mnt" (&optional file))
 
 (defun describe-package-1 (pkg)
@@ -2178,17 +2194,17 @@ will be deleted."
     (princ status)
     (princ " package.\n\n")
 
-    (insert "     " (propertize "Status" 'font-lock-face 'bold) ": ")
+    (package--print-help-section "Status")
     (cond (built-in
            (insert (propertize (capitalize status)
-                               'font-lock-face 'font-lock-builtin-face)
+                               'font-lock-face 'package-status-builtin-face)
                    "."))
           (pkg-dir
            (insert (propertize (if (member status '("unsigned" "dependency"))
                                    "Installed"
                                  (capitalize status))
-                               'font-lock-face 'font-lock-builtin-face))
-           (insert (substitute-command-keys " in ‘"))
+                               'font-lock-face 'package-status-builtin-face))
+           (insert (format " in ‘"))
            (let ((dir (abbreviate-file-name
                        (file-name-as-directory
                         (if (file-in-directory-p pkg-dir package-user-dir)
@@ -2197,11 +2213,10 @@ will be deleted."
              (help-insert-xref-button dir 'help-package-def pkg-dir))
            (if (and (package-built-in-p name)
                     (not (package-built-in-p name version)))
-               (insert (substitute-command-keys
-                        "’,\n             shadowing a ")
+               (insert (format "’,\n             shadowing a ")
                        (propertize "built-in package"
-                                   'font-lock-face 'font-lock-builtin-face))
-             (insert (substitute-command-keys "’")))
+                                   'font-lock-face 
'package-status-builtin-face))
+             (insert (format "’")))
            (if signed
                (insert ".")
              (insert " (unsigned)."))
@@ -2229,18 +2244,18 @@ will be deleted."
           (t (insert (capitalize status) ".")))
     (insert "\n")
     (unless (and pkg-dir (not archive)) ; Installed pkgs don't have archive.
-      (insert "    " (propertize "Archive" 'font-lock-face 'bold)
-              ": " (or archive "n/a") "\n"))
+      (package--print-help-section "Archive"
+        (or archive "n/a") "\n"))
     (and version
-         (insert "    "
-                 (propertize "Version" 'font-lock-face 'bold) ": "
-                 (package-version-join version) "\n"))
-    (insert "    " (propertize "Summary" 'font-lock-face 'bold)
-            ": " (if desc (package-desc-summary desc)) "\n")
+         (package--print-help-section "Version"
+           (package-version-join version)))
+    (when desc
+      (package--print-help-section "Summary"
+        (package-desc-summary desc)))
 
     (setq reqs (if desc (package-desc-reqs desc)))
     (when reqs
-      (insert "   " (propertize "Requires" 'font-lock-face 'bold) ": ")
+      (package--print-help-section "Requires")
       (let ((first t))
         (dolist (req reqs)
           (let* ((name (car req))
@@ -2259,7 +2274,7 @@ will be deleted."
             (insert reason)))
         (insert "\n")))
     (when required-by
-      (insert (propertize "Required by" 'font-lock-face 'bold) ": ")
+      (package--print-help-section "Required by")
       (let ((first t))
         (dolist (pkg required-by)
           (let ((text (package-desc-full-name pkg)))
@@ -2272,11 +2287,11 @@ will be deleted."
                                      (package-desc-name pkg))))
         (insert "\n")))
     (when homepage
-      (insert "   " (propertize "Homepage" 'font-lock-face 'bold) ": ")
+      (package--print-help-section "Homepage")
       (help-insert-xref-button homepage 'help-url homepage)
       (insert "\n"))
     (when keywords
-      (insert "   " (propertize "Keywords" 'font-lock-face 'bold) ": ")
+      (package--print-help-section "Keywords")
       (dolist (k keywords)
         (package-make-button
          k
@@ -2290,24 +2305,23 @@ will be deleted."
                                (if bi (list (package--from-builtin bi))))))
            (other-pkgs (delete desc all-pkgs)))
       (when other-pkgs
-        (insert "    " (propertize "Other versions" 'font-lock-face 'bold) ": "
-                (mapconcat
-                 (lambda (opkg)
-                   (let* ((ov (package-desc-version opkg))
-                          (dir (package-desc-dir opkg))
-                          (from (or (package-desc-archive opkg)
-                                    (if (stringp dir) "installed" dir))))
-                     (if (not ov) (format "%s" from)
-                       (format "%s (%s)"
-                               (make-text-button (package-version-join ov) nil
-                                                 'font-lock-face 'link
-                                                 'follow-link t
-                                                 'action
-                                                 (lambda (_button)
-                                                   (describe-package opkg)))
-                               from))))
-                 other-pkgs ", ")
-                ".\n")))
+        (package--print-help-section "Other versions"
+          (mapconcat (lambda (opkg)
+                       (let* ((ov (package-desc-version opkg))
+                              (dir (package-desc-dir opkg))
+                              (from (or (package-desc-archive opkg)
+                                        (if (stringp dir) "installed" dir))))
+                         (if (not ov) (format "%s" from)
+                           (format "%s (%s)"
+                                   (make-text-button (package-version-join ov) 
nil
+                                                     'font-lock-face 'link
+                                                     'follow-link t
+                                                     'action
+                                                     (lambda (_button)
+                                                       (describe-package 
opkg)))
+                                   from))))
+                     other-pkgs ", ")
+          ".")))
 
     (insert "\n")
 
@@ -2375,7 +2389,7 @@ will be deleted."
                                 :background "light grey"
                                 :foreground "black")
                        'link)))
-    (apply 'insert-text-button button-text 'font-lock-face button-face 
'follow-link t
+    (apply 'insert-text-button button-text 'face button-face 'follow-link t
            props)))
 
 
@@ -2741,27 +2755,97 @@ Return (PKG-DESC [NAME VERSION STATUS DOC])."
 (make-obsolete 'package-menu--print-info
                'package-menu--print-info-simple "25.1")
 
+
+;;; Package menu faces
+(defface package-name-face
+  '((t :inherit link))
+  "Face used on package names in the package menu."
+  :version "25.1")
+
+(defface package-description-face
+  '((t :inherit default))
+  "Face used on package description summaries in the package menu."
+  :version "25.1")
+
+(defface package-status-built-in-face
+  '((t :inherit font-lock-builtin-face))
+  "Face used on the status and version of built-in packages."
+  :version "25.1")
+
+(defface package-status-external-face
+  '((t :inherit package-status-builtin-face))
+  "Face used on the status and version of external packages."
+  :version "25.1")
+
+(defface package-status-available-face
+  '((t :inherit default))
+  "Face used on the status and version of available packages."
+  :version "25.1")
+
+(defface package-status-new-face
+  '((t :inherit (bold package-status-available-face)))
+  "Face used on the status and version of new packages."
+  :version "25.1")
+
+(defface package-status-held-face
+  '((t :inherit font-lock-constant-face))
+  "Face used on the status and version of held packages."
+  :version "25.1")
+
+(defface package-status-disabled-face
+  '((t :inherit font-lock-warning-face))
+  "Face used on the status and version of disabled packages."
+  :version "25.1")
+
+(defface package-status-installed-face
+  '((t :inherit font-lock-comment-face))
+  "Face used on the status and version of installed packages."
+  :version "25.1")
+
+(defface package-status-dependency-face
+  '((t :inherit package-status-installed-face))
+  "Face used on the status and version of dependency packages."
+  :version "25.1")
+
+(defface package-status-unsigned-face
+  '((t :inherit font-lock-warning-face))
+  "Face used on the status and version of unsigned packages."
+  :version "25.1")
+
+(defface package-status-incompat-face
+  '((t :inherit font-lock-comment-face))
+  "Face used on the status and version of incompat packages."
+  :version "25.1")
+
+(defface package-status-avail-obso-face
+  '((t :inherit package-status-incompat-face))
+  "Face used on the status and version of avail-obso packages."
+  :version "25.1")
+
+
+;;; Package menu printing
 (defun package-menu--print-info-simple (pkg)
   "Return a package entry suitable for `tabulated-list-entries'.
 PKG is a package-desc object.
 Return (PKG-DESC [NAME VERSION STATUS DOC])."
   (let* ((status  (package-desc-status pkg))
          (face (pcase status
-                 (`"built-in"  'font-lock-builtin-face)
-                 (`"external"  'font-lock-builtin-face)
-                 (`"available" 'default)
-                 (`"avail-obso" 'font-lock-comment-face)
-                 (`"new"       'bold)
-                 (`"held"      'font-lock-constant-face)
-                 (`"disabled"  'font-lock-warning-face)
-                 (`"installed" 'font-lock-comment-face)
-                 (`"dependency" 'font-lock-comment-face)
-                 (`"unsigned"  'font-lock-warning-face)
-                 (`"incompat"  'font-lock-comment-face)
+                 (`"built-in"  'package-status-built-in-face)
+                 (`"external"  'package-status-external-face)
+                 (`"available" 'package-status-available-face)
+                 (`"avail-obso" 'package-status-avail-obso-face)
+                 (`"new"       'package-status-new-face)
+                 (`"held"      'package-status-held-face)
+                 (`"disabled"  'package-status-disabled-face)
+                 (`"installed" 'package-status-installed-face)
+                 (`"dependency" 'package-status-dependency-face)
+                 (`"unsigned"  'package-status-unsigned-face)
+                 (`"incompat"  'package-status-incompat-face)
                  (_            'font-lock-warning-face)))) ; obsolete.
     (list pkg
           `[(,(symbol-name (package-desc-name pkg))
-             face link
+             face package-name-face
+             font-lock-face package-name-face
              follow-link t
              package-desc ,pkg
              action package-menu-describe-package)
@@ -2772,7 +2856,8 @@ Return (PKG-DESC [NAME VERSION STATUS DOC])."
             ,@(if (cdr package-archives)
                   (list (propertize (or (package-desc-archive pkg) "")
                                     'font-lock-face face)))
-            ,(package-desc-summary pkg)])))
+            ,(propertize (package-desc-summary pkg)
+                         'font-lock-face 'package-description-face)])))
 
 (defvar package-menu--old-archive-contents nil
   "`package-archive-contents' before the latest refresh.")
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index 9eed36e..038b20e 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -221,12 +221,17 @@ TESTFN is used to compare elements, or `equal' if TESTFN 
is nil."
 (defun seq-subseq (seq start &optional end)
   "Return the subsequence of SEQ from START to END.
 If END is omitted, it defaults to the length of the sequence.
-If START or END is negative, it counts from the end."
+If START or END is negative, it counts from the end.
+
+Signal an error if START or END are outside of the sequence (i.e
+too large if positive or too small if negative)"
   (cond ((or (stringp seq) (vectorp seq)) (substring seq start end))
         ((listp seq)
          (let (len (errtext (format "Bad bounding indices: %s, %s" start end)))
            (and end (< end 0) (setq end (+ end (setq len (seq-length seq)))))
            (if (< start 0) (setq start (+ start (or len (setq len (seq-length 
seq))))))
+           (unless (>= start 0)
+             (error "%s" errtext))
            (when (> start 0)
              (setq seq (nthcdr (1- start) seq))
              (or seq (error "%s" errtext))
diff --git a/lisp/emacs-lisp/tabulated-list.el 
b/lisp/emacs-lisp/tabulated-list.el
index cd61eb9..404dbd1 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -129,7 +129,7 @@ no entry at POS.  POS, if omitted or nil, defaults to 
point."
 TAG should be a string, with length <= `tabulated-list-padding'.
 If ADVANCE is non-nil, move forward by one line afterwards."
   (unless (stringp tag)
-    (error "Invalid argument to `tabulated-list-put-tag'"))
+    (error "Invalid argument to ‘tabulated-list-put-tag’"))
   (unless (> tabulated-list-padding 0)
     (error "Unable to tag the current line"))
   (save-excursion
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el
index 9ae11b7..dadbe5f 100644
--- a/lisp/emacs-lisp/timer.el
+++ b/lisp/emacs-lisp/timer.el
@@ -324,7 +324,7 @@ This function is called, by name, directly by the C code."
               (apply (timer--function timer) (timer--args timer)))
           (error (message "Error running timer%s: %S"
                           (if (symbolp (timer--function timer))
-                              (format " `%s'" (timer--function timer)) "")
+                              (format " ‘%s’" (timer--function timer)) "")
                           err)))
         (when (and retrigger
                    ;; If the timer's been canceled, don't "retrigger" it
diff --git a/lisp/env.el b/lisp/env.el
index 3966ab1..f50ed12 100644
--- a/lisp/env.el
+++ b/lisp/env.el
@@ -175,7 +175,7 @@ a side-effect."
       (let ((codings (find-coding-systems-string (concat variable value))))
        (unless (or (eq 'undecided (car codings))
                    (memq (coding-system-base locale-coding-system) codings))
-         (error "Can't encode `%s=%s' with `locale-coding-system'"
+         (error "Can't encode ‘%s=%s’ with ‘locale-coding-system’"
                 variable (or value "")))))
   (and value
        substitute-env-vars
@@ -185,7 +185,7 @@ a side-effect."
   (if (and value (multibyte-string-p value))
       (setq value (encode-coding-string value locale-coding-system)))
   (if (string-match "=" variable)
-      (error "Environment variable name `%s' contains `='" variable))
+      (error "Environment variable name ‘%s’ contains ‘=’" variable))
   (if (string-equal "TZ" variable)
       (set-time-zone-rule value))
   (setq process-environment (setenv-internal process-environment
diff --git a/lisp/epa-file.el b/lisp/epa-file.el
index db8613a..88d25a5 100644
--- a/lisp/epa-file.el
+++ b/lisp/epa-file.el
@@ -82,12 +82,15 @@ encryption is used."
                passphrase))))
     (epa-passphrase-callback-function context key-id file)))
 
+(defvar epa-inhibit nil
+  "Non-nil means don't try to decrypt .gpg files when operating on them.")
+
 ;;;###autoload
 (defun epa-file-handler (operation &rest args)
   (save-match-data
     (let ((op (get operation 'epa-file)))
-      (if op
-         (apply op args)
+      (if (and op (not epa-inhibit))
+          (apply op args)
        (epa-file-run-real-handler operation args)))))
 
 (defun epa-file-run-real-handler (operation args)
diff --git a/lisp/epa.el b/lisp/epa.el
index a02f1e9..47452af 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -249,7 +249,7 @@ You should bind this variable with `let', but do not set it 
globally.")
     (define-key keymap "q" 'delete-window)
     keymap))
 
-(defvar epa-exit-buffer-function #'bury-buffer)
+(defvar epa-exit-buffer-function #'quit-window)
 
 (define-widget 'epa-key 'push-button
   "Button for representing a epg-key object."
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index 380ea7c..3530a31e 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -537,8 +537,8 @@ and `apropos' for other symbols."
                      (- (car (current-time-zone)))))
          (hours (mod (floor seconds 3600) 24))
          (minutes (mod (round seconds 60) 60)))
-    (message (format "@%s is %d:%02d local time"
-                     beats hours minutes))))
+    (message "@%s is %d:%02d local time"
+             beats hours minutes)))
 
 (provide 'erc-button)
 
@@ -546,4 +546,3 @@ and `apropos' for other symbols."
 ;; Local Variables:
 ;; indent-tabs-mode: nil
 ;; End:
-
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 3d58943..6c847f0 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -797,10 +797,10 @@ This is called whenever you create a new face, and at 
other times."
            symbol (intern name)))
     (setq menu 'facemenu-face-menu)
     (setq docstring
-         (purecopy (format "Select face `%s' for subsequent insertion.
+         (purecopy (format "Select face ‘%s’ for subsequent insertion.
 If the mark is active and there is no prefix argument,
-apply face `%s' to the region instead.
-This command was defined by `facemenu-add-new-face'."
+apply face ‘%s’ to the region instead.
+This command was defined by ‘facemenu-add-new-face’."
                  name name)))
     (cond ((facemenu-iterate ; check if equivalent face is already in the menu
            (lambda (m) (and (listp m)
@@ -846,12 +846,12 @@ Return the event type (a symbol) of the added menu entry.
 This is called whenever you use a new color."
   (let (symbol)
     (unless (color-defined-p color)
-      (error "Color `%s' undefined" color))
+      (error "Color ‘%s’ undefined" color))
     (cond ((eq menu 'facemenu-foreground-menu)
           (setq symbol (intern (concat "fg:" color))))
          ((eq menu 'facemenu-background-menu)
           (setq symbol (intern (concat "bg:" color))))
-         (t (error "MENU should be `facemenu-foreground-menu' or 
`facemenu-background-menu'")))
+         (t (error "MENU should be ‘facemenu-foreground-menu’ or 
‘facemenu-background-menu’")))
     (unless (facemenu-iterate ; Check if color is already in the menu.
             (lambda (m) (and (listp m)
                              (eq (car m) symbol)))
diff --git a/lisp/faces.el b/lisp/faces.el
index 511b354..15ed699 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -574,7 +574,7 @@ If FACE is a face-alias, get the documentation for the 
target face."
   (let ((alias (get face 'face-alias)))
     (if alias
         (let ((doc (get alias 'face-documentation)))
-         (format "%s is an alias for the face `%s'.%s" face alias
+         (format "%s is an alias for the face ‘%s’.%s" face alias
                   (if doc (format "\n%s" doc)
                     "")))
       (get face 'face-documentation))))
@@ -1005,7 +1005,7 @@ a single face name."
     (setq default (car (split-string default crm-separator t))))
 
   (let ((prompt (if default
-                    (format "%s (default `%s'): " prompt default)
+                    (format "%s (default ‘%s’): " prompt default)
                   (format "%s: " prompt)))
         aliasfaces nonaliasfaces faces)
     ;; Build up the completion tables.
@@ -1137,9 +1137,9 @@ Value is the new attribute value."
   (let* ((completion-ignore-case t)
         (value (completing-read
                 (if default
-                    (format "%s for face `%s' (default %s): "
+                    (format "%s for face ‘%s’ (default %s): "
                             name face default)
-                  (format "%s for face `%s': " name face))
+                  (format "%s for face ‘%s’: " name face))
                 completion-alist nil nil nil nil default)))
     (if (equal value "") default value)))
 
@@ -1224,7 +1224,8 @@ of a global face.  Value is the new attribute value."
   "Read the name of a font for FACE on FRAME.
 If optional argument FRAME is nil or omitted, use the selected frame."
   (let ((completion-ignore-case t))
-    (completing-read (format "Set font attributes of face `%s' from font: " 
face)
+    (completing-read (format "Set font attributes of face ‘%s’ from font: "
+                             face)
                     (append (fontset-list) (x-list-fonts "*" nil frame)))))
 
 
@@ -1435,12 +1436,10 @@ If FRAME is omitted or nil, use the selected frame."
                  (when alias
                    (setq face alias)
                    (insert
-                    (format (substitute-command-keys
-                              "\n  %s is an alias for the face ‘%s’.\n%s")
+                    (format "\n  %s is an alias for the face ‘%s’.\n%s"
                             f alias
                             (if (setq obsolete (get f 'obsolete-face))
-                                (format (substitute-command-keys
-                                          "  This face is obsolete%s; use ‘%s’ 
instead.\n")
+                                (format "  This face is obsolete%s; use ‘%s’ 
instead.\n"
                                         (if (stringp obsolete)
                                             (format " since %s" obsolete)
                                           "")
@@ -1458,13 +1457,11 @@ If FRAME is omitted or nil, use the selected frame."
                    (help-xref-button 1 'help-customize-face f)))
                (setq file-name (find-lisp-object-file-name f 'defface))
                (when file-name
-                 (princ (substitute-command-keys "Defined in ‘"))
-                 (princ (file-name-nondirectory file-name))
-                 (princ (substitute-command-keys "’"))
+                 (princ (format "Defined in ‘%s’"
+                                 (file-name-nondirectory file-name)))
                  ;; Make a hyperlink to the library.
                  (save-excursion
-                   (re-search-backward
-                     (substitute-command-keys "‘\\([^‘’]+\\)’") nil t)
+                   (re-search-backward (format "‘\\([^‘’]+\\)’") nil t)
                    (help-xref-button 1 'help-face-def f file-name))
                  (princ ".")
                  (terpri)
@@ -1551,7 +1548,7 @@ If FRAME is nil, the current FRAME is used."
                               options))
                        ((eq req 'supports)
                         (display-supports-face-attributes-p options frame))
-                       (t (error "Unknown req `%S' with options `%S'"
+                       (t (error "Unknown req ‘%S’ with options ‘%S’"
                                  req options)))))
     match))
 
@@ -1924,7 +1921,7 @@ resulting color name in the echo area."
                                (logand 65535 (nth 0 components))
                                (logand 65535 (nth 1 components))
                                (logand 65535 (nth 2 components))))))))
-    (when msg (message "Color: `%s'" color))
+    (when msg (message "Color: ‘%s’" color))
     color))
 
 (defun face-at-point (&optional thing multiple)
@@ -2777,13 +2774,13 @@ also the same size as FACE on FRAME, or fail."
                (if (string-match-p "\\*" pattern)
                    (if (null (face-font face))
                        (error "No matching fonts are the same height as the 
frame default font")
-                     (error "No matching fonts are the same height as face 
`%s'" face))
+                     (error "No matching fonts are the same height as face 
‘%s’" face))
                  (if (null (face-font face))
-                     (error "Height of font `%s' doesn't match the frame 
default font"
+                     (error "Height of font ‘%s’ doesn't match the frame 
default font"
                             pattern)
-                   (error "Height of font `%s' doesn't match face `%s'"
+                   (error "Height of font ‘%s’ doesn't match face ‘%s’"
                           pattern face)))
-             (error "No fonts match `%s'" pattern)))
+             (error "No fonts match ‘%s’" pattern)))
        (car fonts))
     (cdr (assq 'font (frame-parameters (selected-frame))))))
 
diff --git a/lisp/ffap.el b/lisp/ffap.el
index 825a449..975f726 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -90,7 +90,6 @@
 
 
 ;;; Todo list:
-;; * use kpsewhich
 ;; * let "/dir/file#key" jump to key (tag or regexp) in /dir/file
 ;; * find file of symbol if TAGS is loaded (like above)
 ;; * break long menus into multiple panes (like imenu?)
@@ -894,6 +893,24 @@ URL, or nil.  If nil, search the alist for further 
matches.")
   "Path where `ffap-tex-mode' looks for TeX files.
 If t, `ffap-tex-init' will initialize this when needed.")
 
+(defvar ffap-latex-guess-rules '(("" . ".sty")
+                               ("" . ".cls")
+                               ("" . ".ltx")
+                               ("" . ".tex")
+                               ("" . "") ;; in some rare cases the
+                                         ;; extension is already in
+                                         ;; the buffer.
+                               ("beamertheme" . ".sty")
+                               ("beamercolortheme". ".sty")
+                               ("beamerfonttheme". ".sty")
+                               ("beamerinnertheme". ".sty")
+                               ("beameroutertheme". ".sty")
+                               ("" . ".ldf"))
+  "List of rules for guessing a filename.
+Each rule is a cons (PREFIX . SUFFIX) used for guessing a
+filename from the word at point by prepending PREFIX and
+appending SUFFIX.")
+
 (defun ffap-tex-init ()
   ;; Compute ffap-tex-path if it is now t.
   (and (eq t ffap-tex-path)
@@ -917,9 +934,56 @@ If t, `ffap-tex-init' will initialize this when needed.")
   (ffap-locate-file name '(".tex" "") ffap-tex-path))
 
 (defun ffap-latex-mode (name)
-  (ffap-tex-init)
-  ;; only rare need for ""
-  (ffap-locate-file name '(".cls" ".sty" ".tex" "") ffap-tex-path))
+  "`ffap' function suitable for latex buffers.
+This uses the program kpsewhich if available. In this case, the
+variable `ffap-latex-guess-rules' is used for building a filename
+out of NAME."
+  (cond ((file-exists-p name)
+         name)
+        ((not (executable-find "kpsewhich"))
+         (ffap-tex-init)
+         (ffap-locate-file name '(".cls" ".sty" ".tex" "") ffap-tex-path))
+        (t
+         (let ((curbuf (current-buffer))
+               (guess-rules ffap-latex-guess-rules)
+               (preferred-suffix-rules '(("input" . ".tex")
+                                         ("include" . ".tex")
+                                         ("usepackage" . ".sty")
+                                         ("RequirePackageWithOptions" . ".sty")
+                                         ("RequirePackage" . ".sty")
+                                         ("documentclass" . ".cls")
+                                         ("documentstyle" . ".cls")
+                                         ("LoadClass" . ".cls")
+                                         ("LoadClassWithOptions" . ".cls")
+                                         ("bibliography" . ".bib")
+                                         ("addbibresource" . ""))))
+           ;; We now add preferred suffix in front of suffixes.
+           (when
+               ;; The condition is essentially:
+               ;; (assoc (TeX-current-macro)
+               ;;        (mapcar 'car preferred-suffix-rules))
+               ;; but (TeX-current-macro) can take time, so we just
+               ;; check if one of the `car' in preferred-suffix-rules
+               ;; is found before point on the current line.  It
+               ;; should cover most cases.
+               (save-excursion
+                 (re-search-backward (regexp-opt
+                                      (mapcar 'car preferred-suffix-rules))
+                                     (point-at-bol)
+                                     t))
+             (push (cons "" (cdr (assoc (match-string 0) ; i.e. 
"(TeX-current-macro)"
+                                        preferred-suffix-rules)))
+                   guess-rules))
+           (setq kpsewhich-args (mapcar (lambda (rule)
+                                          (concat (car rule) name (cdr rule)))
+                                        guess-rules))
+           (with-temp-buffer
+             (let ((process-environment (buffer-local-value
+                                         'process-environment curbuf))
+                   (exec-path (buffer-local-value 'exec-path curbuf)))
+               (apply #'call-process "kpsewhich"  nil  t  nil kpsewhich-args))
+             (when (< (point-min) (point-max))
+               (buffer-substring (goto-char (point-min)) (point-at-eol))))))))
 
 (defun ffap-tex (name)
   (ffap-tex-init)
@@ -1004,7 +1068,7 @@ If a given RFC isn't in these then `ffap-rfc-path' is 
offered."
     ;; Slightly controversial decisions:
     ;; * strip trailing "@" and ":"
     ;; * no commas (good for latex)
-    (file "--:\\\\$\\{\\}+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
+    (file "--:\\\\${}+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
     ;; An url, or maybe a email/news message-id:
     (url "--:=&address@hidden:alpha:]~#,%;*()!'" "^[0-9a-zA-Z]" ":;.,!?")
     ;; Find a string that does *not* contain a colon:
@@ -1013,6 +1077,9 @@ If a given RFC isn't in these then `ffap-rfc-path' is 
offered."
     (machine "-[:alnum:]." "" ".")
     ;; Mathematica paths: allow backquotes
     (math-mode ",-:$+<>@-Z_[:lower:]~`" "<" "@>;.,!?`:")
+    ;; (La)TeX: don't allow braces
+    (latex-mode "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
+    (tex-mode "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
     )
   "Alist of (MODE CHARS BEG END), where MODE is a symbol,
 possibly a major-mode name, or one of the symbols
@@ -1020,7 +1087,9 @@ possibly a major-mode name, or one of the symbols
 Function `ffap-string-at-point' uses the data fields as follows:
 1. find a maximal string of CHARS around point,
 2. strip BEG chars before point from the beginning,
-3. strip END chars after point from the end.")
+3. strip END chars after point from the end.
+The arguments CHARS, BEG and END are handled as described in
+`skip-chars-forward'.")
 
 (defvar ffap-string-at-point nil
   ;; Added at suggestion of RHOGEE (for ff-paths), 7/24/95.
diff --git a/lisp/files.el b/lisp/files.el
index a371344..1039267 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -995,10 +995,10 @@ directory if it does not exist."
               (put 'user-emacs-directory-warning 'this-session t)
               (display-warning 'initialization
                                (format "\
-Unable to %s `user-emacs-directory' (%s).
+Unable to %s ‘user-emacs-directory’ (%s).
 Any data that would normally be written there may be lost!
 If you never want to see this message again,
-customize the variable `user-emacs-directory-warning'."
+customize the variable ‘user-emacs-directory-warning’."
                                        errtype user-emacs-directory)))))
        bestname))))
 
@@ -1641,7 +1641,7 @@ killed."
     (user-error "Aborted"))
   (and (buffer-modified-p) buffer-file-name
        (not (yes-or-no-p
-             (format "Kill and replace buffer `%s' without saving it? "
+             (format "Kill and replace buffer ‘%s’ without saving it? "
                      (buffer-name))))
        (user-error "Aborted"))
   (let ((obuf (current-buffer))
@@ -2789,7 +2789,7 @@ we don't actually set it to the same mode the buffer 
already has."
        (catch 'nop
          (dolist (mode (nreverse modes))
            (if (not (functionp mode))
-               (message "Ignoring unknown mode `%s'" mode)
+               (message "Ignoring unknown mode ‘%s’" mode)
              (setq done t)
              (or (set-auto-mode-0 mode keep-mode-if-same)
                  ;; continuing would call minor modes again, toggling them off
@@ -2803,7 +2803,7 @@ we don't actually set it to the same mode the buffer 
already has."
         (setq mode (hack-local-variables t))
         (not (memq mode modes))        ; already tried and failed
         (if (not (functionp mode))
-            (message "Ignoring unknown mode `%s'" mode)
+            (message "Ignoring unknown mode ‘%s’" mode)
           (setq done t)
           (set-auto-mode-0 mode keep-mode-if-same)))
     ;; If we didn't, look for an interpreter specified in the first line.
@@ -3419,7 +3419,7 @@ local variables, but directory-local variables may still 
be applied."
                                 (setq hack-local-variables--warned-lexical t)
                                 (display-warning
                                   :warning
-                                  (format "%s: `lexical-binding' at end of 
file unreliable"
+                                  (format "%s: ‘lexical-binding’ at end of 
file unreliable"
                                           (file-name-nondirectory
                                            (or buffer-file-name ""))))))
                              (t
@@ -3554,8 +3554,9 @@ It is dangerous if either of these conditions are met:
             (since (nth 2 o)))
         (message "%s is obsolete%s; %s"
                  var (if since (format " (since %s)" since))
-                 (if (stringp instead) instead
-                   (format "use `%s' instead" instead)))))))
+                 (if (stringp instead)
+                     (substitute-command-keys instead)
+                   (format "use ‘%s’ instead" instead)))))))
 
 (defun hack-one-local-variable (var val)
   "Set local variable VAR with value VAL.
@@ -3672,7 +3673,7 @@ variables from CLASS are applied to the buffer.  The 
variables
 for a class are defined using `dir-locals-set-class-variables'."
   (setq directory (file-name-as-directory (expand-file-name directory)))
   (unless (assq class dir-locals-class-alist)
-    (error "No such class `%s'" (symbol-name class)))
+    (error "No such class ‘%s’" (symbol-name class)))
   (push (list directory class mtime) dir-locals-directory-cache))
 
 (defun dir-locals-set-class-variables (class variables)
@@ -4027,7 +4028,7 @@ Interactively, confirmation is required unless you supply 
a prefix argument."
             (not (and (eq (framep-on-display) 'ns)
                       (listp last-nonmenu-event)
                       use-dialog-box))
-            (or (y-or-n-p (format "File `%s' exists; overwrite? " filename))
+            (or (y-or-n-p (format "File ‘%s’ exists; overwrite? " filename))
                 (user-error "Canceled")))
        (set-visited-file-name filename (not confirm))))
   (set-buffer-modified-p t)
@@ -4732,7 +4733,7 @@ Before and after saving the buffer, this function runs
                         ;; Signal an error if the user specified the name of an
                         ;; existing directory.
                         (error "%s is a directory" filename)
-                      (unless (y-or-n-p (format "File `%s' exists; overwrite? "
+                      (unless (y-or-n-p (format "File ‘%s’ exists; overwrite? "
                                                 filename))
                         (error "Canceled"))))
                 (set-visited-file-name filename)))
@@ -4773,7 +4774,7 @@ Before and after saving the buffer, this function runs
                            (expand-file-name buffer-file-name))))
                  (unless (file-exists-p dir)
                    (if (y-or-n-p
-                        (format "Directory `%s' does not exist; create? " dir))
+                        (format "Directory ‘%s’ does not exist; create? " dir))
                        (make-directory dir t)
                      (error "Canceled")))
                  (setq setmodes (basic-save-buffer-1))))
@@ -5216,7 +5217,7 @@ given.  With a prefix argument, TRASH is nil."
      (list dir
           (if (directory-files dir nil directory-files-no-dot-files-regexp)
               (y-or-n-p
-               (format "Directory `%s' is not empty, really %s? "
+               (format "Directory ‘%s’ is not empty, really %s? "
                        dir (if trashing "trash" "delete")))
             nil)
           (null current-prefix-arg))))
@@ -5322,7 +5323,7 @@ directly into NEWNAME instead."
            default-directory default-directory nil nil)
           current-prefix-arg t nil)))
   (when (file-in-directory-p newname directory)
-    (error "Cannot copy `%s' into its subdirectory `%s'"
+    (error "Cannot copy ‘%s’ into its subdirectory ‘%s’"
            directory newname))
   ;; If default-directory is a remote directory, make sure we find its
   ;; copy-directory handler.
@@ -5694,7 +5695,7 @@ To choose one, move point to the proper line and then 
type C-c C-c.
 Then you'll be asked about a number of files to recover."
   (interactive)
   (if (null auto-save-list-file-prefix)
-      (error "You set `auto-save-list-file-prefix' to disable making session 
files"))
+      (error "You set ‘auto-save-list-file-prefix’ to disable making session 
files"))
   (let ((dir (file-name-directory auto-save-list-file-prefix))
         (nd (file-name-nondirectory auto-save-list-file-prefix)))
     (unless (file-directory-p dir)
@@ -5788,7 +5789,7 @@ This command is used in the special Dired buffer created 
by
                               (condition-case nil
                                   (save-excursion (recover-file file))
                                 (error
-                                 "Failed to recover `%s'" file)))
+                                 "Failed to recover ‘%s’" file)))
                             files
                             '("file" "files" "recover"))
            (message "No files can be recovered from this session now")))
@@ -6473,7 +6474,7 @@ normally equivalent short `-D' option is just passed on to
                 file result)
              ;; Unix.  Access the file to get a suitable error.
              (access-file file "Reading directory")
-             (error "Listing directory failed but `access-file' worked")))
+             (error "Listing directory failed but ‘access-file’ worked")))
 
          (when (if (stringp switches)
                    (string-match "--dired\\>" switches)
@@ -6766,7 +6767,7 @@ for the specified category of users."
        ((= char ?g) #o2070)
        ((= char ?o) #o1007)
        ((= char ?a) #o7777)
-       (t (error "%c: bad `who' character" char))))
+       (t (error "%c: bad ‘who’ character" char))))
 
 (defun file-modes-char-to-right (char &optional from)
   "Convert CHAR to a numeric value of mode bits.
@@ -6838,7 +6839,7 @@ as in \"og+rX-w\"."
                    (file-modes-rights-to-number (substring modes (match-end 1))
                                                 num-who num-modes)
                    modes (substring modes (match-end 3))))
-         (error "Parse error in modes near `%s'" (substring modes 0))))
+         (error "Parse error in modes near ‘%s’" (substring modes 0))))
       num-modes)))
 
 (defun read-file-modes (&optional prompt orig-file)
@@ -6907,7 +6908,7 @@ Otherwise, trash FILENAME using the freedesktop.org 
conventions,
                                               trash-dir)))
           ;; We can't trash a parent directory of trash-directory.
           (if (string-prefix-p fn trash-dir)
-              (error "Trash directory `%s' is a subdirectory of `%s'"
+              (error "Trash directory ‘%s’ is a subdirectory of ‘%s’"
                      trash-dir filename))
           (unless (file-directory-p trash-dir)
             (make-directory trash-dir t))
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index b145513..2fba6a8 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1051,7 +1051,7 @@ The region it returns may start or end in the middle of a 
line.")
    ;; Of course, this function doesn't do all of the above in all situations
    ;; (e.g. depending on whether jit-lock is in use) and it can't guess what
    ;; the caller wants.
-   (interactive-only "use `font-lock-ensure' or `font-lock-flush' instead."))
+   (interactive-only "use ‘font-lock-ensure’ or ‘font-lock-flush’ instead."))
   (interactive "p")
   (font-lock-set-defaults)
   (let ((font-lock-verbose (or font-lock-verbose interactively)))
diff --git a/lisp/format.el b/lisp/format.el
index 1a05e7e..afec51c 100644
--- a/lisp/format.el
+++ b/lisp/format.el
@@ -395,7 +395,7 @@ unless you supply a prefix argument."
                                  (cdr (assq 'default-directory
                                             (buffer-local-variables)))
                                  nil nil (buffer-name))))
-         (fmt (format-read (format "Write file `%s' in format: "
+         (fmt (format-read (format "Write file ‘%s’ in format: "
                                    (file-name-nondirectory file)))))
      (list file fmt (not current-prefix-arg))))
   (let ((old-formats buffer-file-format)
@@ -416,7 +416,7 @@ If FORMAT is nil then do not do any format conversion."
   (interactive
    ;; Same interactive spec as write-file, plus format question.
    (let* ((file (read-file-name "Find file: "))
-         (fmt (format-read (format "Read file `%s' in format: "
+         (fmt (format-read (format "Read file ‘%s’ in format: "
                                    (file-name-nondirectory file)))))
      (list file fmt)))
   (let ((format-alist nil))
@@ -435,7 +435,7 @@ a list (ABSOLUTE-FILE-NAME SIZE)."
   (interactive
    ;; Same interactive spec as write-file, plus format question.
    (let* ((file (read-file-name "Find file: "))
-         (fmt (format-read (format "Read file `%s' in format: "
+         (fmt (format-read (format "Read file ‘%s’ in format: "
                                    (file-name-nondirectory file)))))
      (list file fmt)))
   (let (value size old-undo)
diff --git a/lisp/frame.el b/lisp/frame.el
index 1177a00..d1e7c00 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -743,7 +743,7 @@ the name of an X display device (HOST.SERVER.SCREEN) or a 
tty device file."
       (frame-terminal f)))
    ((terminal-live-p device) device)
    (t
-    (error "Invalid argument %s in `get-device-terminal'" device))))
+    (error "Invalid argument %s in ‘get-device-terminal’" device))))
 
 (defun frames-on-display-list (&optional device)
   "Return a list of all frames on DEVICE.
@@ -894,7 +894,7 @@ If there is no frame by that name, signal an error."
         (frame (cdr (assoc name frame-names-alist))))
     (if frame
        (select-frame-set-input-focus frame)
-      (error "There is no frame named `%s'" name))))
+      (error "There is no frame named ‘%s’" name))))
 
 
 ;;;; Background mode.
diff --git a/lisp/fringe.el b/lisp/fringe.el
index 8f40c46..f982b35 100644
--- a/lisp/fringe.el
+++ b/lisp/fringe.el
@@ -122,7 +122,7 @@ See `fringe-mode' for possible values and their effect."
       (and (consp style)
           (or (null (car style)) (integerp (car style)))
           (or (null (cdr style)) (integerp (cdr style))))
-      (error "Invalid fringe style `%s'" style)))
+      (error "Invalid fringe style ‘%s’" style)))
 
 ;; For initialization of fringe-mode, take account of changes
 ;; made explicitly to default-frame-alist.
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 9e813e6..447a8d7 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -8487,7 +8487,7 @@ Header and body are separated by `mail-header-separator'."
            (progn
              (setq sent (1+ sent))
              (message-send-and-exit))
-         (message (format "Message to `%s' skipped." to))
+         (message "Message to `%s' skipped." to)
          (setq skipped (1+ skipped)))
        (when (buffer-live-p buff)
          (kill-buffer buff))))
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 1c7a68a..71bcdb6 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -43,6 +43,11 @@ The functions will receive the function name as argument.")
 
 ;; Functions
 
+(defvar describe-function-orig-buffer nil
+  "Buffer that was current when 'describe-function' was invoked.
+Functions on 'help-fns-describe-function-functions' can use this
+to get buffer-local values.")
+
 ;;;###autoload
 (defun describe-function (function)
   "Display the full documentation of FUNCTION (a symbol)."
@@ -61,18 +66,35 @@ The functions will receive the function name as argument.")
       (user-error "You didn't specify a function symbol"))
   (or (fboundp function)
       (user-error "Symbol's function definition is void: %s" function))
-  (help-setup-xref (list #'describe-function function)
-                   (called-interactively-p 'interactive))
-  (save-excursion
-    (with-help-window (help-buffer)
-      (prin1 function)
-      ;; Use " is " instead of a colon so that
-      ;; it is easier to get out the function name using forward-sexp.
-      (princ " is ")
-      (describe-function-1 function)
-      (with-current-buffer standard-output
-        ;; Return the text we displayed.
-        (buffer-string)))))
+
+  ;; We save describe-function-orig-buffer on the help xref stack, so
+  ;; it is restored by the back/forward buttons.  'help-buffer'
+  ;; expects (current-buffer) to be a help buffer when processing
+  ;; those buttons, so we can't change the current buffer before
+  ;; calling that.
+  (let ((describe-function-orig-buffer
+         (or describe-function-orig-buffer
+             (current-buffer))))
+
+    (help-setup-xref
+     (list (lambda (function buffer)
+             (let ((describe-function-orig-buffer
+                    (if (buffer-live-p buffer) buffer)))
+               (describe-function function)))
+           function describe-function-orig-buffer)
+     (called-interactively-p 'interactive))
+
+    (save-excursion
+      (with-help-window (help-buffer)
+        (prin1 function)
+        ;; Use " is " instead of a colon so that
+        ;; it is easier to get out the function name using forward-sexp.
+        (princ " is ")
+        (describe-function-1 function)
+        (with-current-buffer standard-output
+          ;; Return the text we displayed.
+          (buffer-string))))
+    ))
 
 
 ;; Could be this, if we make symbol-file do the work below.
@@ -275,19 +297,7 @@ suitable file is found, return nil."
                    lib-name)
                file-name))
             ;; The next three forms are from `find-source-lisp-file'.
-            (elc-file (locate-file
-                       (concat file-name
-                               (if (string-match "\\.el\\'" file-name)
-                                   "c"
-                                 ".elc"))
-                       load-path nil 'readable))
-            (str (when elc-file
-                   (with-temp-buffer
-                     (insert-file-contents-literally elc-file nil 0 256)
-                     (buffer-string))))
-            (src-file (and str
-                           (string-match ";;; from file \\(.*\\.el\\)" str)
-                           (match-string 1 str))))
+            (src-file (locate-library file-name t nil 'readable)))
        (and src-file (file-readable-p src-file) src-file))))))
 
 (defun help-fns--key-bindings (function)
@@ -309,9 +319,7 @@ suitable file is found, return nil."
             (when remapped
               (princ "Its keys are remapped to ")
               (princ (if (symbolp remapped)
-                        (concat (substitute-command-keys "‘")
-                                (symbol-name remapped)
-                                (substitute-command-keys "’"))
+                         (format "‘%s’" remapped)
                       "an anonymous command"))
               (princ ".\n"))
 
@@ -345,18 +353,16 @@ suitable file is found, return nil."
       (insert "\nThis function has a compiler macro")
       (if (symbolp handler)
           (progn
-            (insert (format (substitute-command-keys " ‘%s’") handler))
+            (insert (format " ‘%s’" handler))
             (save-excursion
-              (re-search-backward (substitute-command-keys "‘\\([^‘’]+\\)’")
-                                  nil t)
+              (re-search-backward (format "‘\\([^‘’]+\\)’") nil t)
               (help-xref-button 1 'help-function handler)))
         ;; FIXME: Obsolete since 24.4.
         (let ((lib (get function 'compiler-macro-file)))
           (when (stringp lib)
-            (insert (format (substitute-command-keys " in ‘%s’") lib))
+            (insert (format " in ‘%s’" lib))
             (save-excursion
-              (re-search-backward (substitute-command-keys "‘\\([^‘’]+\\)’")
-                                  nil t)
+              (re-search-backward (format "‘\\([^‘’]+\\)’") nil t)
               (help-xref-button 1 'help-function-cmacro function lib)))))
       (insert ".\n"))))
 
@@ -411,13 +417,13 @@ suitable file is found, return nil."
                           (get function
                                'derived-mode-parent))))
     (when parent-mode
-      (insert (substitute-command-keys "\nParent mode: ‘"))
+      (insert (format "\nParent mode: ‘"))
       (let ((beg (point)))
         (insert (format "%s" parent-mode))
         (make-text-button beg (point)
                           'type 'help-function
                           'help-args (list parent-mode)))
-      (insert (substitute-command-keys "’.\n")))))
+      (insert (format "’.\n")))))
 
 (defun help-fns--obsolete (function)
   ;; Ignore lambda constructs, keyboard macros, etc.
@@ -432,10 +438,9 @@ suitable file is found, return nil."
              " is obsolete")
       (when (nth 2 obsolete)
         (insert (format " since %s" (nth 2 obsolete))))
-      (insert (cond ((stringp use) (concat ";\n" use))
-                    (use (format (substitute-command-keys
-                                  ";\nuse ‘%s’ instead.")
-                                 use))
+      (insert (cond ((stringp use)
+                     (concat ";\n" (substitute-command-keys use)))
+                    (use (format ";\nuse ‘%s’ instead." use))
                     (t "."))
               "\n"))))
 
@@ -471,8 +476,7 @@ FILE is the file where FUNCTION was probably defined."
                           (format ";\nin Lisp code %s" interactive-only))
                          ((and (symbolp 'interactive-only)
                                (not (eq interactive-only t)))
-                          (format (substitute-command-keys
-                                   ";\nin Lisp code use ‘%s’ instead.")
+                          (format ";\nin Lisp code use ‘%s’ instead."
                                   interactive-only))
                          (t "."))
                    "\n")))))
@@ -541,8 +545,7 @@ FILE is the file where FUNCTION was probably defined."
                 ;; Aliases are Lisp functions, so we need to check
                 ;; aliases before functions.
                 (aliased
-                 (format (substitute-command-keys "an alias for ‘%s’")
-                          real-def))
+                 (format "an alias for ‘%s’" real-def))
                 ((autoloadp def)
                  (format "%s autoloaded %s"
                          (if (commandp def) "an interactive" "an")
@@ -576,24 +579,22 @@ FILE is the file where FUNCTION was probably defined."
       (with-current-buffer standard-output
        (save-excursion
          (save-match-data
-           (when (re-search-backward (substitute-command-keys
-                                       "alias for ‘\\([^‘’]+\\)’")
+           (when (re-search-backward (format "alias for ‘\\([^‘’]+\\)’")
                                       nil t)
              (help-xref-button 1 'help-function real-def)))))
 
       (when file-name
-       (princ (substitute-command-keys " in ‘"))
+       (princ (format " in ‘"))
        ;; We used to add .el to the file name,
        ;; but that's completely wrong when the user used load-file.
        (princ (if (eq file-name 'C-source)
                   "C source code"
                 (help-fns-short-filename file-name)))
-       (princ (substitute-command-keys "’"))
+       (princ (format "’"))
        ;; Make a hyperlink to the library.
        (with-current-buffer standard-output
          (save-excursion
-           (re-search-backward (substitute-command-keys "‘\\([^‘’]+\\)’")
-                                nil t)
+           (re-search-backward (format "‘\\([^‘’]+\\)’") nil t)
            (help-xref-button 1 'help-function-def function file-name))))
       (princ ".")
       (with-current-buffer (help-buffer)
@@ -726,17 +727,14 @@ it is displayed along with the global value."
 
              (if file-name
                  (progn
-                   (princ (substitute-command-keys
-                            " is a variable defined in ‘"))
+                   (princ (format " is a variable defined in ‘"))
                    (princ (if (eq file-name 'C-source)
                               "C source code"
                             (file-name-nondirectory file-name)))
-                   (princ (substitute-command-keys "’.\n"))
+                   (princ (format "’.\n"))
                    (with-current-buffer standard-output
                      (save-excursion
-                       (re-search-backward (substitute-command-keys
-                                             "‘\\([^‘’]+\\)’")
-                                            nil t)
+                       (re-search-backward (format "‘\\([^‘’]+\\)’") nil t)
                        (help-xref-button 1 'help-variable-def
                                          variable file-name)))
                    (if valvoid
@@ -866,8 +864,7 @@ if it is given a local binding.\n")))
              ;; Mention if it's an alias.
               (unless (eq alias variable)
                 (setq extra-line t)
-                (princ (format (substitute-command-keys
-                                "  This variable is an alias for ‘%s’.\n")
+                (princ (format "  This variable is an alias for ‘%s’.\n"
                                alias)))
 
               (when obsolete
@@ -875,9 +872,9 @@ if it is given a local binding.\n")))
                 (princ "  This variable is obsolete")
                 (if (nth 2 obsolete)
                     (princ (format " since %s" (nth 2 obsolete))))
-               (princ (cond ((stringp use) (concat ";\n  " use))
-                            (use (format (substitute-command-keys
-                                           ";\n  use ‘%s’ instead.")
+               (princ (cond ((stringp use)
+                              (concat ";\n  " (substitute-command-keys use)))
+                            (use (format ";\n  use ‘%s’ instead."
                                           (car obsolete)))
                             (t ".")))
                 (terpri))
@@ -908,7 +905,7 @@ if it is given a local binding.\n")))
                               ;; Otherwise, assume it was set directly.
                               (setq file (car file)
                                     dir-file nil)))
-                       (princ (substitute-command-keys
+                       (princ (format
                                 (if dir-file
                                     "by the file\n  ‘"
                                   "for the directory\n  ‘")))
@@ -916,7 +913,7 @@ if it is given a local binding.\n")))
                          (insert-text-button
                           file 'type 'help-dir-local-var-def
                           'help-args (list variable file)))
-                       (princ (substitute-command-keys "’.\n"))))
+                       (princ (format "’.\n"))))
                  (princ "  This variable's value is file-local.\n")))
 
              (when (memq variable ignored-local-variables)
@@ -940,8 +937,7 @@ file-local variable.\n")
                (princ "if its value\n  satisfies the predicate ")
                (princ (if (byte-code-function-p safe-var)
                           "which is a byte-compiled expression.\n"
-                        (format (substitute-command-keys "‘%s’.\n")
-                                 safe-var))))
+                        (format "‘%s’.\n" safe-var))))
 
               (if extra-line (terpri))
              (princ "Documentation:\n")
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index e1fc9fd..37847e2 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -294,11 +294,13 @@ Commands:
 
 ;;;###autoload
 (defun help-mode-setup ()
+  "Enter Help Mode in the current buffer."
   (help-mode)
   (setq buffer-read-only nil))
 
 ;;;###autoload
 (defun help-mode-finish ()
+  "Exit Help Mode in the current buffer."
   (when (derived-mode-p 'help-mode)
     (setq buffer-read-only t)
     (help-make-xrefs (current-buffer))))
diff --git a/lisp/help.el b/lisp/help.el
index 46136d9..a8991b5 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -964,14 +964,12 @@ documentation for the major and minor modes of that 
buffer."
        (let* ((mode major-mode)
               (file-name (find-lisp-object-file-name mode nil)))
          (when file-name
-           (princ (concat (substitute-command-keys " defined in ‘")
-                           (file-name-nondirectory file-name)
-                           (substitute-command-keys "’")))
+           (princ (format " defined in ‘%s’"
+                           (file-name-nondirectory file-name)))
            ;; Make a hyperlink to the library.
            (with-current-buffer standard-output
              (save-excursion
-               (re-search-backward (substitute-command-keys "‘\\([^‘’]+\\)’")
-                                    nil t)
+               (re-search-backward (format "‘\\([^‘’]+\\)’") nil t)
                (help-xref-button 1 'help-function-def mode file-name)))))
        (princ ":\n")
        (princ (documentation major-mode)))))
@@ -1042,7 +1040,7 @@ is currently activated with completion."
   (let ((minor-mode (lookup-minor-mode-from-indicator indicator)))
     (if minor-mode
        (describe-minor-mode-from-symbol minor-mode)
-      (error "Cannot find minor mode for `%s'" indicator))))
+      (error "Cannot find minor mode for ‘%s’" indicator))))
 
 (defun lookup-minor-mode-from-indicator (indicator)
   "Return a minor mode symbol from its indicator on the mode line."
diff --git a/lisp/image.el b/lisp/image.el
index b023491..1c268c4 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -343,7 +343,7 @@ of image data.  If that doesn't work, and SOURCE is a file 
name,
 use its file extension as image type.
 Optional DATA-P non-nil means SOURCE is a string containing image data."
   (when (and (not data-p) (not (stringp source)))
-    (error "Invalid image file name `%s'" source))
+    (error "Invalid image file name ‘%s’" source))
   (unless type
     (setq type (if data-p
                   (image-type-from-data source)
@@ -351,7 +351,7 @@ Optional DATA-P non-nil means SOURCE is a string containing 
image data."
                     (image-type-from-file-name source))))
     (or type (error "Cannot determine image type")))
   (or (memq type (and (boundp 'image-types) image-types))
-      (error "Invalid image type `%s'" type))
+      (error "Invalid image type ‘%s’" type))
   type)
 
 
diff --git a/lisp/info.el b/lisp/info.el
index 0a2206d..1b02c35 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -3398,10 +3398,12 @@ Give an empty topic name to go to the Index node 
itself."
            (re-search-forward (format
                                 "[a-zA-Z]+: [a-zA-Z0-9_ *&]+ %s\\( \\|$\\)"
                                 (regexp-quote name)) nil t)
-           (search-forward (format "['`‘]%s['’]" name) nil t)
+           (search-forward (concat "['`‘]" name "['’]") nil t)
            (and (string-match "\\`.*\\( (.*)\\)\\'" name)
                 (search-forward
-                 (format "['`‘]%s['’]" (substring name 0 (match-beginning 1)))
+                 (concat "['`%‘]"
+                          (substring name 0 (match-beginning 1))
+                          "['%’]")
                  nil t))
            (search-forward name nil t)
            ;; Try again without the " <1>" makeinfo can append
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index 2d57955..4667a00 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -303,6 +303,9 @@
        (lepc . lepcha)
        (limb . limbu)
        (linb . linear_b)
+        (lisu . lisu)
+        (lyci . lycian)
+        (lydi . lydian)
        (mlym . malayalam)
        (mlm2 . malayalam)
        (mand . mandaic)
@@ -312,6 +315,7 @@
        (mero . meroitic)
        (mong . mongolian)
        (musc . musical-symbol)
+       (mym2 . burmese)
        (mymr . burmese)
        (nko\  . nko)
        (ogam . ogham)
@@ -346,6 +350,7 @@
        (taml . tamil)
        (tml2 . tamil)
        (telu . telugu)
+       (tel2 . telugu)
        (thaa . thaana)
        (thai . thai)
        (tibt . tibetan)
@@ -471,19 +476,29 @@
            (nil . "TIS620*")
            (nil . "ISO8859-11"))
 
-     (devanagari ,(font-spec :registry "iso10646-1" :otf '(deva nil (rphf)))
+     (devanagari ,(font-spec :registry "iso10646-1" :otf '(dev2 nil (rphf)))
+                 ,(font-spec :registry "iso10646-1" :otf '(deva nil (rphf)))
                 (nil . "iso10646.indian-1"))
-     (bengali ,(font-spec :registry "iso10646-1" :otf '(beng nil (rphf))))
-     (gurmukhi ,(font-spec :registry "iso10646-1" :otf '(guru nil (blwf))))
-     (gujarati ,(font-spec :registry "iso10646-1" :otf '(gujr nil (rphf))))
-     (oriya ,(font-spec :registry "iso10646-1" :otf '(orya nil (rphf))))
-     (tamil ,(font-spec :registry "iso10646-1" :otf '(taml nil (akhn))))
-     (telugu ,(font-spec :registry "iso10646-1" :otf '(telu nil (blwf))))
-     (kannada ,(font-spec :registry "iso10646-1" :otf '(knda nil (rphf))))
+     (bengali ,(font-spec :registry "iso10646-1" :otf '(bng2 nil (rphf)))
+              ,(font-spec :registry "iso10646-1" :otf '(beng nil (rphf))))
+     (gurmukhi ,(font-spec :registry "iso10646-1" :otf '(gur2 nil (blwf)))
+               ,(font-spec :registry "iso10646-1" :otf '(guru nil (blwf))))
+     (gujarati ,(font-spec :registry "iso10646-1" :otf '(gjr2 nil (rphf)))
+               ,(font-spec :registry "iso10646-1" :otf '(gujr nil (rphf))))
+     (oriya ,(font-spec :registry "iso10646-1" :otf '(ory2 nil (rphf)))
+            ,(font-spec :registry "iso10646-1" :otf '(orya nil (rphf))))
+     (tamil ,(font-spec :registry "iso10646-1" :otf '(tml2 nil (akhn)))
+            ,(font-spec :registry "iso10646-1" :otf '(taml nil (akhn))))
+     (telugu ,(font-spec :registry "iso10646-1" :otf '(tel2 nil (blwf)))
+             ,(font-spec :registry "iso10646-1" :otf '(telu nil (blwf))))
+     (kannada ,(font-spec :registry "iso10646-1" :otf '(knd2 nil (rphf)))
+              ,(font-spec :registry "iso10646-1" :otf '(knda nil (rphf))))
      (sinhala ,(font-spec :registry "iso10646-1" :otf '(sinh nil (akhn))))
-     (malayalam ,(font-spec :registry "iso10646-1" :otf '(mlym nil (akhn))))
+     (malayalam ,(font-spec :registry "iso10646-1" :otf '(mlm2 nil (akhn)))
+                ,(font-spec :registry "iso10646-1" :otf '(mlym nil (akhn))))
 
-     (burmese ,(font-spec :registry "iso10646-1" :otf '(mymr nil nil))
+     (burmese ,(font-spec :registry "iso10646-1" :otf '(mym2 nil nil))
+              ,(font-spec :registry "iso10646-1" :otf '(mymr nil nil))
              ,(font-spec :registry "iso10646-1" :script 'burmese))
 
      (lao ,(font-spec :registry "iso10646-1" :otf '(lao\  nil nil (mark)))
@@ -1055,7 +1070,7 @@ Value is name of that font."
        (condition-case nil
            (setq ascii-font (x-resolve-font-name pattern))
          (error
-          (message "Warning: no fonts matching `%s' available" pattern)
+          (message "Warning: no fonts matching ‘%s’ available" pattern)
           (aset xlfd-fields index "*")
           (setq index (1+ index))))))
     (unless ascii-font
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 59fc37d..2142f0b 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -400,9 +400,9 @@ To prefer, for instance, utf-8, say the following:
   \(prefer-coding-system 'utf-8)"
   (interactive "zPrefer coding system: ")
   (if (not (and coding-system (coding-system-p coding-system)))
-      (error "Invalid coding system `%s'" coding-system))
+      (error "Invalid coding system ‘%s’" coding-system))
   (if (memq (coding-system-type coding-system) '(raw-text undecided))
-      (error "Can't prefer the coding system `%s'" coding-system))
+      (error "Can't prefer the coding system ‘%s’" coding-system))
   (let ((base (coding-system-base coding-system))
        (eol-type (coding-system-eol-type coding-system)))
     (set-coding-system-priority base)
@@ -417,7 +417,7 @@ To prefer, for instance, utf-8, say the following:
     (set-default-coding-systems base)
     (if (called-interactively-p 'interactive)
        (or (eq base default-file-name-coding-system)
-           (message "The default value of `file-name-coding-system' was not 
changed because the specified coding system is not suitable for file 
names.")))))
+           (message "The default value of ‘file-name-coding-system’ was not 
changed because the specified coding system is not suitable for file 
names.")))))
 
 (defvar sort-coding-systems-predicate nil
   "If non-nil, a predicate function to sort coding systems.
@@ -719,14 +719,14 @@ DEFAULT is the coding system to use by default in the 
query."
              (insert "No default coding systems to try for "
                      (if (stringp from)
                          (format "string \"%s\"." from)
-                       (format "buffer `%s'." bufname)))
+                       (format "buffer ‘%s’." bufname)))
            (insert
             "These default coding systems were tried to encode"
             (if (stringp from)
                 (concat " \"" (if (> (length from) 10)
                                   (concat (substring from 0 10) "...\"")
                                 (concat from "\"")))
-              (format " text\nin the buffer `%s'" bufname))
+              (format " text\nin the buffer ‘%s’" bufname))
             ":\n")
            (let ((pos (point))
                  (fill-prefix "  "))
@@ -876,12 +876,12 @@ and TO is ignored."
                (display-warning
                 'mule
                 (format "\
-Invalid coding system `%s' is specified
+Invalid coding system ‘%s’ is specified
 for the current buffer/file by the %s.
 It is highly recommended to fix it before writing to a file."
                         (car auto-cs)
                         (if (eq (cdr auto-cs) :coding) ":coding tag"
-                          (format "variable `%s'" (cdr auto-cs))))
+                          (format "variable ‘%s’" (cdr auto-cs))))
                 :warning)
                (or (yes-or-no-p "Really proceed with writing? ")
                    (error "Save aborted"))
@@ -1451,7 +1451,7 @@ If INPUT-METHOD is nil, deactivate any current input 
method."
   (unless (or current-input-method (null input-method))
     (let ((slot (assoc input-method input-method-alist)))
       (if (null slot)
-         (error "Can't activate input method `%s'" input-method))
+         (error "Can't activate input method ‘%s’" input-method))
       (setq current-input-method-title nil)
       (let ((func (nth 2 slot)))
        (if (functionp func)
@@ -1460,7 +1460,7 @@ If INPUT-METHOD is nil, deactivate any current input 
method."
              (progn
                (require (cdr func))
                (apply (car func) input-method (nthcdr 5 slot)))
-           (error "Can't activate input method `%s'" input-method))))
+           (error "Can't activate input method ‘%s’" input-method))))
       (setq current-input-method input-method)
       (or (stringp current-input-method-title)
          (setq current-input-method-title (nth 3 slot)))
@@ -1538,7 +1538,7 @@ which marks the variable `default-input-method' as set 
for Custom buffers."
 
   (interactive "P\np")
   (if toggle-input-method-active
-      (error "Recursive use of `toggle-input-method'"))
+      (error "Recursive use of ‘toggle-input-method’"))
   (if (and current-input-method (not arg))
       (deactivate-input-method)
     (let ((toggle-input-method-active t)
@@ -1598,7 +1598,7 @@ This is a subroutine for `describe-input-method'."
       (if (and (symbolp describe-current-input-method-function)
               (fboundp describe-current-input-method-function))
          (funcall describe-current-input-method-function)
-       (message "No way to describe the current input method `%s'"
+       (message "No way to describe the current input method ‘%s’"
                 current-input-method)
        (ding))
     (error "No input method is activated now")))
diff --git a/lisp/international/mule-conf.el b/lisp/international/mule-conf.el
index 3308dbd..c3d58aa 100644
--- a/lisp/international/mule-conf.el
+++ b/lisp/international/mule-conf.el
@@ -35,7 +35,9 @@
 
 ;;; Remarks
 
-;; The ISO-IR registry is at http://www.itscj.ipsj.or.jp/ISO-IR/.
+;; The ISO-IR registry is maintained by the Information Processing
+;; Society of Japan/Information Technology Standards Commission of
+;; Japan (IPSJ/ITSCJ) at https://www.itscj.ipsj.or.jp/itscj_english/.
 ;; Standards docs equivalent to iso-2022 and iso-8859 are at
 ;; http://www.ecma.ch/.
 
@@ -902,7 +904,7 @@
   (dolist (script '(devanagari sanskrit bengali tamil telugu assamese
                               oriya kannada malayalam gujarati punjabi))
     (define-charset (intern (format "%s-cdac" script))
-      (format "Glyphs of %s script for CDAC font.  Subset of `indian-glyph'."
+      (format "Glyphs of %s script for CDAC font.  Subset of ‘indian-glyph’."
              (capitalize (symbol-name script)))
       :short-name (format "CDAC %s glyphs" (capitalize (symbol-name script)))
       :supplementary-p t
@@ -913,7 +915,7 @@
   (dolist (script '(devanagari bengali punjabi gujarati
                               oriya tamil telugu kannada malayalam))
     (define-charset (intern (format "%s-akruti" script))
-      (format "Glyphs of %s script for AKRUTI font.  Subset of `indian-glyph'."
+      (format "Glyphs of %s script for AKRUTI font.  Subset of ‘indian-glyph’."
              (capitalize (symbol-name script)))
       :short-name (format "AKRUTI %s glyphs" (capitalize (symbol-name script)))
       :supplementary-p t
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 181474c..946f793 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -2002,7 +2002,7 @@ use \"coding: 'raw-text\" instead."
                (goto-char pos)
                (when (and set-auto-coding-for-load
                           (re-search-forward re-unibyte tail-end t))
-                  (display-warning 'mule "`unibyte: t' is obsolete; \
+                  (display-warning 'mule "\"unibyte: t\" is obsolete; \
 use \"coding: 'raw-text\" instead." :warning)
                  (setq coding-system 'raw-text))
                (when (and (not coding-system)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 8d4bf24..2d2f0ee 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2607,11 +2607,12 @@ Can be changed via `isearch-search-fun-function' for 
special needs."
       ;; Use lax versions to not fail at the end of the word while
       ;; the user adds and removes characters in the search string
       ;; (or when using nonincremental word isearch)
-      (let ((lax (not (or isearch-nonincremental
-                         (null (car isearch-cmds))
-                         (eq (length isearch-string)
-                             (length (isearch--state-string
-                                       (car isearch-cmds))))))))
+      (let ((lax (or isearch-lax-whitespace
+                     (not (or isearch-nonincremental
+                              (null (car isearch-cmds))
+                              (eq (length isearch-string)
+                                  (length (isearch--state-string
+                                           (car isearch-cmds)))))))))
        (funcall
         (if isearch-forward #'re-search-forward #'re-search-backward)
         (if (functionp isearch-word)
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 056a4ef..52fd047 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -101,10 +101,15 @@ A library name is equivalent to the file name that 
`load-library' would load."
   "Read feature name from the minibuffer, prompting with string PROMPT.
 If optional second arg LOADED-P is non-nil, the feature must be loaded
 from a file."
-  (intern (completing-read prompt
-                          features
-                          (and loaded-p #'feature-file)
-                          loaded-p)))
+  (intern (completing-read
+           prompt
+           (mapcar #'symbol-name
+                   (if loaded-p
+                       (delq nil
+                             (mapcar
+                              (lambda (x) (and (feature-file x) x))
+                              features))
+                     features)))))
 
 (defvaralias 'loadhist-hook-functions 'unload-feature-special-hooks)
 (defvar unload-feature-special-hooks
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el
index 736e3f5..3d5d7c9 100644
--- a/lisp/mail/mail-utils.el
+++ b/lisp/mail/mail-utils.el
@@ -50,9 +50,10 @@ also the To field, unless this would leave an empty To 
field."
 ;;;###autoload
 (defun mail-file-babyl-p (file)
   "Return non-nil if FILE is a Babyl file."
-  (with-temp-buffer
-    (insert-file-contents file nil 0 100)
-    (looking-at "BABYL OPTIONS:")))
+  (let ((epa-inhibit t))
+    (with-temp-buffer
+      (insert-file-contents file nil 0 100)
+      (looking-at "BABYL OPTIONS:"))))
 
 (defun mail-string-delete (string start end)
   "Returns a string containing all of STRING except the part
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 26c91bb..90a140b 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -4508,9 +4508,78 @@ encoded string (and the same mask) will decode the 
string."
      (setq i (1+ i)))
    (concat string-vector)))
 
+(defun rmail-epa-decrypt-1 (mime)
+  "Decrypt a single GnuPG encrypted text in a message.
+The starting string of the encrypted text should have just been regexp-matched.
+Argument MIME is non-nil if this is a mime message."
+  (let* ((armor-start (match-beginning 0))
+         (armor-prefix (buffer-substring
+                        (line-beginning-position)
+                        armor-start))
+         (armor-end-regexp)
+         armor-end after-end
+         unquote)
+    (if (string-match "<pre>\\'" armor-prefix)
+        (setq armor-prefix ""))
+
+    (setq armor-end-regexp
+          (concat "^"
+                  armor-prefix
+                  "-----END PGP MESSAGE-----$"))
+    (setq armor-end (re-search-forward armor-end-regexp
+                                       nil t))
+
+    (unless armor-end
+      (error "Encryption armor beginning has no matching end"))
+    (goto-char armor-start)
+
+    ;; Because epa--find-coding-system-for-mime-charset not autoloaded.
+    (require 'epa)
+
+    ;; Advance over this armor.
+    (goto-char armor-end)
+    (setq after-end (- (point-max) armor-end))
+
+    (when mime
+      (save-excursion
+        (goto-char armor-start)
+        (re-search-backward "^--" nil t)
+        (save-restriction
+          (narrow-to-region (point) armor-start)
+
+          ;; Use the charset specified in the armor.
+          (unless coding-system-for-read
+            (if (re-search-forward "^[ \t]*Charset[ \t\n]*:[ \t\n]*\\(.*\\)" 
nil t)
+                (setq coding-system-for-read
+                      (epa--find-coding-system-for-mime-charset
+                       (intern (downcase (match-string 1)))))))
+
+          (goto-char (point-min))
+          (if (re-search-forward "^[ \t]*Content-transfer-encoding[ \t\n]*:[ 
\t\n]*quoted-printable[ \t]*$" nil t)
+              (setq unquote t)))))
+
+    (when unquote
+      (let ((inhibit-read-only t))
+        (mail-unquote-printable-region armor-start
+                                       (- (point-max) after-end))))
+
+    ;; Decrypt it, maybe in place, maybe making new buffer.
+    (epa-decrypt-region
+     armor-start (- (point-max) after-end)
+     ;; Call back this function to prepare the output.
+     (lambda ()
+       (let ((inhibit-read-only t))
+         (delete-region armor-start (- (point-max) after-end))
+         (goto-char armor-start)
+         (current-buffer))))
+
+    (list armor-start (- (point-max) after-end) mime
+          armor-end-regexp)))
+
 ;; Should this have a key-binding, or be in a menu?
 ;; There doesn't really seem to be an appropriate menu.
 ;; Eg the edit command is not in a menu either.
+
 (defun rmail-epa-decrypt ()
   "Decrypt GnuPG or OpenPGP armors in current message."
   (interactive)
@@ -4519,12 +4588,14 @@ encoded string (and the same mask) will decode the 
string."
   ;; change it in one of the calls to `epa-decrypt-region'.
 
   (save-excursion
-    (let (decrypts (mime (rmail-mime-message-p)))
+    (let (decrypts (mime (rmail-mime-message-p))
+                   mime-disabled)
       (goto-char (point-min))
 
       ;; Turn off mime processing.
       (when (and mime
                 (not (get-text-property (point-min) 'rmail-mime-hidden)))
+        (setq mime-disabled t)
        (rmail-mime))
 
       ;; Now find all armored messages in the buffer
@@ -4532,74 +4603,12 @@ encoded string (and the same mask) will decode the 
string."
       (goto-char (point-min))
       (while (re-search-forward "-----BEGIN PGP MESSAGE-----$" nil t)
        (let ((coding-system-for-read coding-system-for-read)
-             (case-fold-search t)
-             unquote
-             armor-start armor-prefix armor-end-regexp armor-end after-end)
-
-         (setq armor-start (match-beginning 0)
-               armor-prefix (buffer-substring
-                             (line-beginning-position)
-                             armor-start))
-         (if (string-match "<pre>\\'" armor-prefix)
-             (setq armor-prefix ""))
-
-         (setq armor-end-regexp
-               (concat "^"
-                       armor-prefix
-                       "-----END PGP MESSAGE-----$"))
-         (setq armor-end (re-search-forward armor-end-regexp
-                                            nil t))
-
-         (unless armor-end
-           (error "Encryption armor beginning has no matching end"))
-         (goto-char armor-start)
-
-         ;; Because epa--find-coding-system-for-mime-charset not autoloaded.
-         (require 'epa)
-
-         ;; Advance over this armor.
-         (goto-char armor-end)
-         (setq after-end (- (point-max) armor-end))
-
-         (when mime
-           (save-excursion
-             (goto-char armor-start)
-             (re-search-backward "^--" nil t)
-             (save-restriction
-               (narrow-to-region (point) armor-start)
-
-               ;; Use the charset specified in the armor.
-               (unless coding-system-for-read
-                 (if (re-search-forward "^[ \t]*Charset[ \t\n]*:[ 
\t\n]*\\(.*\\)" nil t)
-                     (setq coding-system-for-read
-                           (epa--find-coding-system-for-mime-charset
-                            (intern (downcase (match-string 1)))))))
-
-               (goto-char (point-min))
-               (if (re-search-forward "^[ \t]*Content-transfer-encoding[ 
\t\n]*:[ \t\n]*quoted-printable[ \t]*$" nil t)
-                   (setq unquote t)))))
-
-         (when unquote
-           (let ((inhibit-read-only t))
-             (mail-unquote-printable-region armor-start
-                                            (- (point-max) after-end))))
-
-         ;; Decrypt it, maybe in place, maybe making new buffer.
-         (epa-decrypt-region
-          armor-start (- (point-max) after-end)
-          ;; Call back this function to prepare the output.
-          (lambda ()
-            (let ((inhibit-read-only t))
-              (delete-region armor-start (- (point-max) after-end))
-              (goto-char armor-start)
-              (current-buffer))))
-
-         (push (list armor-start (- (point-max) after-end) mime
-                     armor-end-regexp)
-               decrypts)))
+             (case-fold-search t))
 
-      (unless decrypts
-       (error "Nothing to decrypt"))
+          (push (rmail-epa-decrypt-1 mime) decrypts)))
+
+      (when (and decrypts (eq major-mode 'rmail-mode))
+        (rmail-add-label "decrypt"))
 
       (when (and decrypts (rmail-buffers-swapped-p))
        (when (y-or-n-p "Replace the original message? ")
@@ -4639,8 +4648,31 @@ encoded string (and the same mask) will decode the 
string."
                                (let ((value (match-string 0)))
                                  (unless (member value '("text/plain" 
"text/html"))
                                    (replace-match "text/plain"))))))))
-                     ))))))))))
- 
+                     )))))))
+
+      (when (and (null decrypts)
+                 mime mime-disabled)
+        ;; Re-enable mime processing.
+       (rmail-mime)
+        ;; Find each Show button and show that part.
+       (while (search-forward " Show " nil t)
+         (forward-char -2)
+         (let ((rmail-mime-render-html-function nil)
+               (entity (get-text-property (point) 'rmail-mime-entity)))
+            (unless (and (not (stringp entity))
+                         (rmail-mime-entity-truncated entity))
+              (push-button))))
+        (goto-char (point-min))
+        (while (re-search-forward "-----BEGIN PGP MESSAGE-----$" nil t)
+          (let ((coding-system-for-read coding-system-for-read)
+                (case-fold-search t))
+            (push (rmail-epa-decrypt-1 mime) decrypts)))
+
+        )
+
+      (unless decrypts
+       (error "Nothing to decrypt")))))
+
 
 ;;;;  Desktop support
 
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index a00c66c..6b753b3 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -345,6 +345,7 @@ the text directly to FILE-NAME, and displays a \"Wrote 
file\" message
 unless NOMSG is a symbol (neither nil nor t).
 AS-SEEN is non-nil if we are copying the message \"as seen\"."
   (let ((case-fold-search t)
+        encrypted-file-name
        from date)
     (goto-char (point-min))
     ;; Preserve the Mail-From and MIME-Version fields
@@ -364,10 +365,45 @@ AS-SEEN is non-nil if we are copying the message \"as 
seen\"."
     (goto-char (point-min))
     (let ((buf (find-buffer-visiting file-name))
          (tembuf (current-buffer)))
+      (when (string-match "[.]gpg\\'" file-name)
+        (setq encrypted-file-name file-name
+              file-name (substring file-name 0 (match-beginning 0))))
       (if (null buf)
-         (let ((coding-system-for-write 'raw-text-unix))
+         (let ((coding-system-for-write 'raw-text-unix)
+                (coding-system-for-read 'raw-text-unix))
+            ;; If the specified file is encrypted, decrypt it.
+            (when encrypted-file-name
+              (with-temp-buffer
+                (insert-file-contents encrypted-file-name)
+                (write-region 1 (point-max) file-name nil 'nomsg)))
            ;; FIXME should ensure existing file ends with a blank line.
-           (write-region (point-min) (point-max) file-name t nomsg))
+           (write-region (point-min) (point-max) file-name t
+                          (if (or nomsg encrypted-file-name)
+                              'nomsg))
+            ;; If the specified file was encrypted, re-encrypt it.
+            (when encrypted-file-name
+              ;; Save the old encrypted file as a backup.
+              (rename-file encrypted-file-name
+                           (make-backup-file-name encrypted-file-name)
+                           t)
+              (if (= 0
+                     (call-process "gpg" nil nil
+                                   "--use-agent" "--batch" "--no-tty"
+                                   "--encrypt" "-r"
+                                   user-mail-address
+                                   file-name))
+                  ;; Delete the unencrypted file if encryption succeeded.
+                  (delete-file file-name)
+                ;; If encrypting failed, put back the original
+                ;; encrypted file and signal an error.
+                (rename-file (make-backup-file-name encrypted-file-name)
+                             encrypted-file-name
+                             t)
+                (error "Encryption failed; %s unchanged"
+                       encrypted-file-name))
+              (unless nomsg
+                (message "Added to %s" encrypted-file-name)))
+            )
        (if (eq buf (current-buffer))
            (error "Can't output message to same file it's already in"))
        ;; File has been visited, in buffer BUF.
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 2b9d8fa..5b5ee4e 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -907,6 +907,8 @@ the user from the mailer."
                 (concat "\\(?:[[:space:];,]\\|\\`\\)"
                         (regexp-opt mail-mailing-lists t)
                         "\\(?:[[:space:];,]\\|\\'\\)"))))
+        (mail-combine-fields "To")
+        (mail-combine-fields "CC")
        ;; If there are mailing lists defined
        (when ml
          (save-excursion
@@ -1075,6 +1077,71 @@ This function does not perform RFC2047 encoding."
                 (goto-char fullname-start))))
           (insert ")\n")))))
 
+(defun mail-combine-fields (field)
+  "Offer to combine all FIELD fields in buffer into one FIELD field.
+If this finds multiple FIELD fields, it asks the user whether
+to combine them into one, and does so if the user says y."
+  (let ((search-pattern (format "^%s[ \t]*:" field))
+        first-to-end
+        query-asked
+        query-answer
+        (old-point (point))
+        (old-max (point-max)))
+    (save-excursion
+      (save-restriction
+        (goto-char (point-min))
+        (narrow-to-region (point-min) (mail-header-end))
+        ;; Find the first FIELD field and record where it ends.
+        (when (re-search-forward search-pattern nil t)
+          (forward-line 1)
+          (re-search-forward "^[^ \t]" nil t)
+          (beginning-of-line)
+          (setq first-to-end (point-marker))
+          (set-marker-insertion-type first-to-end t)
+          ;; Find each following FIELD field
+          ;; and combine it with the first FIELD field.
+          (while (re-search-forward search-pattern nil t)
+            ;; For the second FIELD field, ask user to
+            ;; approve combining them.
+            ;; But if the user refuse to combine them, signal error.
+            (unless query-asked
+              (save-restriction
+                ;; This is just so the screen doesn't change.
+                (narrow-to-region (point-min) old-max)
+                (goto-char old-point)
+                (setq query-asked t)
+                (if (y-or-n-p (format "Message contains multiple %s fields.  
Combine? " field))
+                    (setq query-answer t))))
+            (when query-answer
+              (let ((this-to-start (line-beginning-position))
+                    this-to-end
+                    this-to)
+                (forward-line 1)
+                (re-search-forward "^[^ \t]" nil t)
+                (beginning-of-line)
+                (setq this-to-end (point))
+                ;; Get the text of this FIELD field.
+                (setq this-to (buffer-substring this-to-start this-to-end))
+                ;; Delete it.
+                (delete-region this-to-start this-to-end)
+                (save-excursion
+                  ;; Put a comma after the first FIELD field.
+                  (goto-char first-to-end)
+                  (forward-char -1)
+                  (insert ",")
+                  ;; Copy this one after it.
+                  (goto-char first-to-end)
+                  (save-excursion
+                    (insert this-to))
+                  ;; Replace the FIELD: with spaces.
+                  (looking-at search-pattern)
+                  ;; Try to preserve alignment of contents of the field
+                  (let ((prefix-length (length (match-string 0))))
+                    (replace-match " ")
+                    (dotimes (i (1- prefix-length))
+                      (insert " ")))))))
+          (set-marker first-to-end nil))))))
+
 (defun mail-encode-header (beg end)
   "Encode the mail header between BEG and END according to RFC2047.
 Return non-nil if and only if some part of the header is encoded."
diff --git a/lisp/makefile.w32-in b/lisp/makefile.w32-in
deleted file mode 100644
index 8f41041..0000000
--- a/lisp/makefile.w32-in
+++ /dev/null
@@ -1,728 +0,0 @@
-# -*- Makefile -*- for GNU Emacs on the Microsoft Windows API.
-# Copyright (C) 2000-2015 Free Software Foundation, Inc.
-
-# This file is part of GNU Emacs.
-
-# GNU Emacs is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# GNU Emacs is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-ALL =
-
-all: $(ALL)
-
-SQUOTE='
-# '
-
-lisp = $(CURDIR)
-srcdir = $(CURDIR)/..
-
-# You can specify a different executable on the make command line,
-# e.g. "make EMACS=../bin/emacs ...".
-
-EMACS = ../src/$(BLD)/emacs.exe
-
-# Command line flags for Emacs.
-
-EMACSOPT = -batch --no-site-file --no-site-lisp
-
-# Extra flags to pass to the byte compiler
-BYTE_COMPILE_EXTRA_FLAGS =
-# For example to not display the undefined function warnings you can use this:
-# BYTE_COMPILE_EXTRA_FLAGS = --eval '(setq byte-compile-warnings (quote (not 
unresolved)))'
-# The example above is just for developers, it should not be used by default.
-
-# Set EMACSLOADPATH correctly (already defined in environment).
-EMACSLOADPATH=$(lisp)
-
-# Use C locale
-LC_ALL = C
-
-lisptagsfiles1 = $(lisp)/*.el
-lisptagsfiles2 = $(lisp)/*/*.el
-lisptagsfiles3 = $(lisp)/*/*/*.el
-lisptagsfiles4 = $(lisp)/*/*/*/*.el
-ETAGS = "../lib-src/$(BLD)/etags.exe"
-## $(DEST) is overridden by ../src/makefile.w32-in.
-DEST=$(lisp)
-
-# Automatically generated autoload files, apart from lisp/loaddefs.el.
-LOADDEFS = $(lisp)/calendar/cal-loaddefs.el \
-       $(lisp)/calendar/diary-loaddefs.el $(lisp)/calendar/hol-loaddefs.el \
-       $(lisp)/mh-e/mh-loaddefs.el $(lisp)/net/tramp-loaddefs.el
-
-AUTOGENEL = $(lisp)/loaddefs.el $(LOADDEFS) $(lisp)/cus-load.el \
-       $(lisp)/finder-inf.el $(lisp)/subdirs.el $(lisp)/eshell/esh-groups.el \
-       $(lisp)/calc/calc-loaddefs.el $(lisp)/nxml/subdirs.el \
-       $(lisp)/cedet/semantic/loaddefs.el $(lisp)/cedet/ede/loaddefs.el \
-       $(lisp)/cedet/srecode/loaddefs.el
-
-# Value of max-lisp-eval-depth when compiling initially.
-# During bootstrapping the byte-compiler is run interpreted when compiling
-# itself, and uses more stack than usual.
-#
-BIG_STACK_DEPTH = 2200
-BIG_STACK_OPTS = --eval "(setq max-lisp-eval-depth $(BIG_STACK_DEPTH))"
-
-BYTE_COMPILE_FLAGS = $(BIG_STACK_OPTS) $(BYTE_COMPILE_EXTRA_FLAGS)
-
-# Files to compile before others during a bootstrap.  This is done to
-# speed up the bootstrap process.
-
-COMPILE_FIRST = \
-       $(lisp)/emacs-lisp/macroexp.el \
-       $(lisp)/emacs-lisp/cconv.el \
-       $(lisp)/emacs-lisp/byte-opt.el \
-       $(lisp)/emacs-lisp/bytecomp.el \
-       $(lisp)/emacs-lisp/autoload.el
-
-# The actual Emacs command run in the targets below.
-# The quotes around $(EMACS) are here because the user could type
-# it with forward slashes and without quotes, which will fail if
-# the shell is cmd.exe.
-
-emacs = "$(EMACS)" $(EMACSOPT)
-
-# Have to define the list of subdirs manually when not using sh.
-WINS_CEDET=\
-       cedet \
-       cedet/ede \
-       cedet/semantic \
-       cedet/srecode \
-       cedet/semantic/analyze \
-       cedet/semantic/bovine \
-       cedet/semantic/decorate \
-       cedet/semantic/symref \
-       cedet/semantic/wisent
-
-# The list of subdirectories is subdivided into 4 more or less equal
-# parts so that we could have 4-way parallelism while compiling Lisp
-# files, which helps to slash bootstrap times.  See the 'compile'
-# target below.
-WINS_BASIC1=\
-       calc \
-       calendar \
-       emacs-lisp \
-       erc \
-       net \
-       url
-
-WINS_BASIC2=\
-       gnus \
-       international \
-       language \
-       mail
-
-WINS_BASIC3=\
-       emulation \
-       mh-e \
-       nxml \
-       org \
-       play \
-       textmodes \
-       vc
-
-WINS_BASIC4=\
-       eshell \
-       progmodes
-
-WINS_BASIC= $(WINS_BASIC1) $(WINS_BASIC2) $(WINS_BASIC3) $(WINS_BASIC4)
-
-# Directories with lisp files to compile, and to extract data from
-# (customs, autoloads, etc.)
-WINS_UPDATES=$(WINS_BASIC) \
-       $(WINS_CEDET)
-
-# Directories to add to subdirs.el
-WINS_SUBDIR=$(WINS_BASIC) \
-       obsolete
-
-# All directories
-WINS= $(WINS_UPDATES) \
-       term \
-       obsolete
-
-doit:
-
-cus-load.el-SH:
-       echo ";;; cus-load.el --- automatically extracted custom dependencies" 
> $@
-       echo ";;" >> $@; echo ";;; Code:" >> $@
-       echo "" >> $@
-       echo ";; Local Variables:" >> $@
-       echo ";; version-control: never" >> $@
-       echo ";; no-byte-compile: t" >> $@
-       echo ";; no-update-autoloads: t" >> $@
-       echo ";; End:" >> $@
-
-cus-load.el-CMD:
-       echo ;;; cus-load.el --- automatically extracted custom dependencies> $@
-       echo ;;>> $@
-       echo ;;; Code:>> $@
-       echo.>> $@
-       echo ;; Local Variables:>> $@
-       echo ;; version-control: never>> $@
-       echo ;; no-byte-compile: t>> $@
-       echo ;; no-update-autoloads: t>> $@
-       echo ;; End:>> $@
-
-$(lisp)/cus-load.el:
-       $(MAKE) $(MFLAGS) cus-load.el-$(SHELLTYPE)
-       mv cus-load.el-$(SHELLTYPE) $@
-
-# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
-#          this can break with GNU Make 3.81 and later if sh.exe is used.
-custom-deps: $(lisp)/cus-load.el $(lisp)/loaddefs.el $(lisp)/subdirs.el doit
-       @echo Directories: $(WINS_UPDATES)
-       -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook 
nil)$(ARGQUOTE) \
-                 -f custom-make-dependencies $(lisp) $(WINS_UPDATES)
-
-finder-data: $(lisp)/loaddefs.el $(lisp)/subdirs.el doit
-       @echo Directories: $(WINS_UPDATES)
-       $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) 
$(WINS_UPDATES)
-
-$(lisp)/loaddefs.el:
-       $(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE)
-       cp loaddefs.el-$(SHELLTYPE) $@
-       rm loaddefs.el-$(SHELLTYPE)
-
-loaddefs.el-SH:
-       echo ";;; loaddefs.el --- automatically extracted autoloads" > $@
-       echo ";;" >> $@; echo ";;; Code:" >> $@
-       echo "" >> $@
-       echo ";; Local Variables:" >> $@
-       echo ";; version-control: never" >> $@
-       echo ";; no-byte-compile: t" >> $@
-       echo ";; no-update-autoloads: t" >> $@
-       echo ";; coding: utf-8" >> $@
-       echo ";; End:" >> $@
-       echo ";;; loaddefs.el ends here" >> $@
-
-loaddefs.el-CMD:
-       echo ;;; loaddefs.el --- automatically extracted autoloads> $@
-       echo ;;>> $@
-       echo ;;; Code:>> $@
-       echo.>> $@
-       echo ;; Local Variables:>> $@
-       echo ;; version-control: never>> $@
-       echo ;; no-byte-compile: t>> $@
-       echo ;; no-update-autoloads: t>> $@
-       echo ;; coding: utf-8>> $@
-       echo ;; End:>> $@
-       echo ;;; loaddefs.el ends here>> $@
-
-# Use . instead of $(lisp) because $(lisp) is an absolute file name,
-# including a drive letter and any leading directories, so the generated
-# loaddefs.el will mention file names that on other machine reference
-# possibly non-existent directories.
-#
-# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
-#          this can break with GNU Make 3.81 and later if sh.exe is used.
-autoloads: $(lisp)/loaddefs.el $(LOADDEFS) doit
-       @echo Directories: . $(WINS_UPDATES)
-       $(emacs) -l autoload \
-               --eval $(ARGQUOTE)(setq find-file-hook nil 
find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
-               -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" $(MAKE) . 
$(WINS_UPDATES)
-
-$(lisp)/subdirs.el:
-       $(MAKE) $(MFLAGS) update-subdirs
-
-# Need separate version for sh and native cmd.exe
-update-subdirs: update-subdirs-$(SHELLTYPE)
-
-update-subdirs-CMD: doit
-       echo ;; In load-path, after this directory should come> 
$(lisp)/subdirs.el
-       echo ;; certain of its subdirectories.  Here we specify them.>> 
$(lisp)/subdirs.el
-       echo (normal-top-level-add-to-load-path $(SQUOTE)(>> $(lisp)/subdirs.el
-       @for %%d in ($(WINS_SUBDIR) cedet) do echo "%%d">> $(lisp)/subdirs.el
-       echo ))>> $(lisp)/subdirs.el
-       echo ;; Local Variables:>> $(lisp)/subdirs.el
-       echo ;; version-control: never>> $(lisp)/subdirs.el
-       echo ;; no-byte-compile: t>> $(lisp)/subdirs.el
-       echo ;; End:>> $(lisp)/subdirs.el
-
-update-subdirs-SH: doit
-       $(srcdir)/build-aux/update-subdirs $(lisp); \
-       for file in $(WINS_SUBDIR); do \
-          $(srcdir)/build-aux/update-subdirs $$file; \
-       done;
-
-updates: $(lisp)/subdirs.el autoloads mh-autoloads finder-data custom-deps
-
-# This is useful after a repository fetch.
-repo-update: recompile autoloads finder-data custom-deps
-
-# For backwards compatibility:
-cvs-update: repo-update
-
-# Update the AUTHORS file.
-
-update-authors:
-       $(emacs) -l authors -f batch-update-authors $(srcdir)/etc/AUTHORS 
$(srcdir)
-
-TAGS: TAGS-$(MAKETYPE)
-
-TAGS-LISP: TAGS-LISP-$(MAKETYPE)
-
-TAGS-nmake:
-       echo This target is not supported with NMake
-       exit -1
-
-TAGS-LISP-nmake:
-       echo This target is not supported with NMake
-       exit -1
-
-TAGS-gmake: TAGS-$(SHELLTYPE)
-
-TAGS-LISP-gmake: TAGS-LISP-$(SHELLTYPE)
-
-TAGS-SH: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) 
$(lisptagsfiles4)
-       - $(DEL) TAGS
-       for dir in . $(WINS_UPDATES); do \
-         $(ETAGS) -a $(lisp)/$$dir/*.el; \
-       done
-
-TAGS-LISP-SH: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) 
$(lisptagsfiles4)
-       - $(DEL) $(DEST)/TAGS-LISP
-       for dir in . $(WINS_UPDATES); do \
-         $(ETAGS) -a -o $(DEST)/TAGS-LISP $(lisp)/$$dir/*.el; \
-       done
-
-TAGS-CMD: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) 
$(lisptagsfiles4)
-       - $(DEL) TAGS
-       for %%d in (. $(WINS_UPDATES)) do $(ETAGS) -a $(lisp)/%%d/*.el
-
-TAGS-LISP-CMD: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) 
$(lisptagsfiles4)
-       - $(DEL) $(DEST)/TAGS-LISP
-       for %%d in (. $(WINS_UPDATES)) do \
-         $(ETAGS) -a -o $(DEST)/TAGS-LISP $(lisp)/%%d/*.el
-
-.SUFFIXES: .elc .el
-
-.el.elc:
-       -$(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $<
-
-# Compile all Lisp files, but don't recompile those that are up to
-# date.  Some files don't actually get compiled because they set the
-# local variable no-byte-compile.
-
-# All .elc files are made writable before compilation in case we
-# checked out read-only (CVS option -r).  Files MUST be compiled one by
-# one.  If we compile several files in a row we can't make sure that
-# the compilation environment is clean.  We also set the load-path of
-# the Emacs used for compilation to the current directory and its
-# subdirectories, to make sure require's and load's in the files being
-# compiled find the right files.
-
-# Need separate version for sh and native cmd.exe
-compile: $(lisp)/subdirs.el compile0-$(SHELLTYPE) compile1-$(SHELLTYPE) 
compile2-$(SHELLTYPE) compile3-$(SHELLTYPE) compile4-$(SHELLTYPE) doit
-
-compile0-CMD: autoloads
-#      -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r 
%%g
-       for %%f in ($(COMPILE_FIRST)) do \
-         $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f 
batch-byte-compile-if-not-done %%f
-
-compile1-CMD: autoloads compile0-CMD
-       for %%f in (. $(WINS_BASIC1)) do for %%g in (%%f/*.el) do \
-         $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f 
batch-byte-compile-if-not-done %%f/%%g
-
-compile2-CMD: autoloads compile0-CMD
-       for %%f in ($(WINS_BASIC2)) do for %%g in (%%f/*.el) do \
-         $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f 
batch-byte-compile-if-not-done %%f/%%g
-
-compile3-CMD: autoloads compile0-CMD
-       for %%f in ($(WINS_BASIC3)) do for %%g in (%%f/*.el) do \
-         $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f 
batch-byte-compile-if-not-done %%f/%%g
-
-compile4-CMD: autoloads compile0-CMD
-       for %%f in ($(WINS_BASIC4) $(WINS_CEDET) term obsolete) do for %%g in 
(%%f/*.el) do \
-         $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f 
batch-byte-compile-if-not-done %%f/%%g
-
-compile0-SH: autoloads
-#      for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
-       for el in $(COMPILE_FIRST); do \
-         echo Compiling $$el; \
-         $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f 
batch-byte-compile-if-not-done $$el; \
-       done
-
-compile1-SH: autoloads compile0-SH
-       for dir in $(lisp) $(WINS_BASIC1); do \
-         for el in $$dir/*.el; do \
-           if test -f $$el; \
-           then \
-             echo Compiling $$el; \
-             $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f 
batch-byte-compile-if-not-done $$el; \
-           fi \
-         done; \
-       done
-
-compile2-SH: autoloads compile0-SH
-       for dir in $(WINS_BASIC2); do \
-         for el in $$dir/*.el; do \
-           if test -f $$el; \
-           then \
-             echo Compiling $$el; \
-             $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f 
batch-byte-compile-if-not-done $$el; \
-           fi \
-         done; \
-       done
-
-compile3-SH: autoloads compile0-SH
-       for dir in $(WINS_BASIC3); do \
-         for el in $$dir/*.el; do \
-           if test -f $$el; \
-           then \
-             echo Compiling $$el; \
-             $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f 
batch-byte-compile-if-not-done $$el; \
-           fi \
-         done; \
-       done
-
-compile4-SH: autoloads compile0-SH
-       for dir in $(WINS_BASIC4) $(WINS_CEDET) term obsolete; do \
-         for el in $$dir/*.el; do \
-           if test -f $$el; \
-           then \
-             echo Compiling $$el; \
-             $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f 
batch-byte-compile-if-not-done $$el; \
-           fi \
-         done; \
-       done
-
-# Compile all Lisp files.  This is like `compile' but compiles files
-# unconditionally.  Some files don't actually get compiled because they
-# set the local variable no-byte-compile.
-
-compile-always: $(lisp)/subdirs.el compile-always-$(SHELLTYPE) doit
-
-compile-always-CMD:
-#      -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r 
%%g
-       for %%f in ($(COMPILE_FIRST)) do $(emacs) $(BYTE_COMPILE_FLAGS) -f 
batch-byte-compile %%f
-       for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) 
$(BYTE_COMPILE_FLAGS) -f batch-byte-compile %%f/%%g
-
-compile-always-SH:
-#      for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
-       for el in $(COMPILE_FIRST); do \
-         echo Compiling $$el; \
-         $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 1; \
-       done
-       for dir in $(lisp) $(WINS); do \
-         for el in $$dir/*.el; do \
-           echo Compiling $$el; \
-           $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 
1; \
-         done; \
-       done
-
-compile-calc: compile-calc-$(SHELLTYPE)
-
-compile-calc-CMD:
-       for %%f in ($(lisp)/calc/*.el) do $(emacs) $(BYTE_COMPILE_FLAGS) -f 
batch-byte-compile %%f
-
-compile-calc-SH:
-       for el in $(lisp)/calc/*.el; do \
-         echo Compiling $$el; \
-         $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 1; \
-       done
-
-# Backup compiled Lisp files in elc.tar.gz.  If that file already
-# exists, make a backup of it.
-
-backup-compiled-files:
-       -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
-       -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
-
-# Compile Lisp files, but save old compiled files first.
-
-compile-after-backup: backup-compiled-files compile-always
-
-compile-first:         $(lisp)/emacs-lisp/bytecomp.elc 
$(lisp)/emacs-lisp/byte-opt.elc \
-       $(lisp)/emacs-lisp/autoload.elc $(lisp)/subdirs.el
-
-# Recompile all Lisp files which are newer than their .elc files.
-# Note that this doesn't create .elc files.  It only recompiles if an
-# .elc is present.
-# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
-#          this can break with GNU Make 3.81 and later if sh.exe is used.
-recompile: compile-first autoloads doit $(lisp)/progmodes/cc-mode.elc
-       $(emacs) --eval $(ARGQUOTE)(batch-byte-recompile-directory 
0)$(ARGQUOTE) $(lisp)
-
-$(lisp)/calendar/cal-loaddefs.el: $(lisp)/subdirs.el
-       "$(EMACS)" $(EMACSOPT) -l autoload \
-          --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
-          --eval "(setq find-file-suppress-same-file-warnings t)" \
-          --eval "(setq make-backup-files nil)" \
-          -f w32-batch-update-autoloads "$(lisp)/calendar/cal-loaddefs.el" \
-             $(MAKE) ./calendar
-
-$(lisp)/calendar/diary-loaddefs.el: $(lisp)/subdirs.el
-       "$(EMACS)" $(EMACSOPT) -l autoload \
-          --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \
-          --eval "(setq find-file-suppress-same-file-warnings t)" \
-          --eval "(setq make-backup-files nil)" \
-          -f w32-batch-update-autoloads $(lisp)/calendar/diary-loaddefs.el \
-             $(MAKE) ./calendar
-
-$(lisp)/calendar/hol-loaddefs.el: $(lisp)/subdirs.el
-       "$(EMACS)" $(EMACSOPT) -l autoload \
-          --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \
-          --eval "(setq find-file-suppress-same-file-warnings t)" \
-          --eval "(setq make-backup-files nil)" \
-          -f w32-batch-update-autoloads $(lisp)/calendar/hol-loaddefs.el \
-             $(MAKE) ./calendar
-
-# Update MH-E internal autoloads. These are not to be confused with
-# the autoloads for the MH-E entry points, which are already in
-# loaddefs.el.
-MH_E_SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el   \
-       $(lisp)/mh-e/mh-buffers.el $(lisp)/mh-e/mh-compat.el    \
-       $(lisp)/mh-e/mh-comp.el $(lisp)/mh-e/mh-e.el            \
-       $(lisp)/mh-e/mh-folder.el $(lisp)/mh-e/mh-funcs.el      \
-       $(lisp)/mh-e/mh-gnus.el $(lisp)/mh-e/mh-identity.el     \
-       $(lisp)/mh-e/mh-inc.el $(lisp)/mh-e/mh-junk.el          \
-       $(lisp)/mh-e/mh-letter.el $(lisp)/mh-e/mh-limit.el      \
-       $(lisp)/mh-e/mh-mime.el $(lisp)/mh-e/mh-print.el        \
-       $(lisp)/mh-e/mh-scan.el $(lisp)/mh-e/mh-search.el       \
-       $(lisp)/mh-e/mh-seq.el $(lisp)/mh-e/mh-show.el          \
-       $(lisp)/mh-e/mh-speed.el $(lisp)/mh-e/mh-thread.el      \
-       $(lisp)/mh-e/mh-tool-bar.el $(lisp)/mh-e/mh-utils.el    \
-       $(lisp)/mh-e/mh-xface.el
-
-# See the commentary for autoloads above for why we use ./mh-e below
-# instead of $(lisp)/mh-e.
-mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el
-$(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC) $(lisp)/subdirs.el
-       "$(EMACS)" $(EMACSOPT) \
-          -l autoload \
-          --eval $(ARGQUOTE)(setq generate-autoload-cookie 
$(DQUOTE);;;###mh-autoload$(DQUOTE))$(ARGQUOTE) \
-          --eval $(ARGQUOTE)(setq find-file-suppress-same-file-warnings 
t)$(ARGQUOTE) \
-          --eval $(ARGQUOTE)(setq make-backup-files nil)$(ARGQUOTE) \
-          -f w32-batch-update-autoloads \
-          $(ARGQUOTE)$(lisp)/mh-e/mh-loaddefs.el$(ARGQUOTE) $(MAKE) ./mh-e
-
-# Update TRAMP internal autoloads. Maybe we could move tramp*.el into
-# an own subdirectory. OTOH, it does not hurt to keep them in
-# lisp/net.
-TRAMP_DIR = $(lisp)/net
-TRAMP_SRC = $(TRAMP_DIR)/tramp.el    $(TRAMP_DIR)/tramp-adb.el \
-       $(TRAMP_DIR)/tramp-cache.el  $(TRAMP_DIR)/tramp-cmds.el \
-       $(TRAMP_DIR)/tramp-compat.el $(TRAMP_DIR)/tramp-ftp.el  \
-       $(TRAMP_DIR)/tramp-gvfs.el   $(TRAMP_DIR)/tramp-gw.el   \
-       $(TRAMP_DIR)/tramp-sh.el     $(TRAMP_DIR)/tramp-smb.el  \
-       $(TRAMP_DIR)/tramp-uu.el     $(TRAMP_DIR)/trampver.el
-
-$(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC) $(lisp)/subdirs.el
-       "$(EMACS)" $(EMACSOPT) \
-          -l autoload \
-          --eval $(ARGQUOTE)(setq generate-autoload-cookie 
$(DQUOTE);;;###tramp-autoload$(DQUOTE))$(ARGQUOTE) \
-          --eval $(ARGQUOTE)(setq find-file-suppress-same-file-warnings 
t)$(ARGQUOTE) \
-          --eval $(ARGQUOTE)(setq make-backup-files nil)$(ARGQUOTE) \
-          -f w32-batch-update-autoloads \
-          $(ARGQUOTE)$(TRAMP_DIR)/tramp-loaddefs.el$(ARGQUOTE) $(MAKE) ./net
-
-# Prepare a bootstrap in the lisp subdirectory.
-#
-# Build loaddefs.el to make sure it's up-to-date.  If it's not, that
-# might lead to errors during the bootstrap because something fails to
-# autoload as expected.  If there is no emacs binary, then we can't
-# build autoloads yet.  In that case we have to use ldefs-boot.el;
-# bootstrap should always work with ldefs-boot.el.  (Because
-# loaddefs.el is an automatically generated file, we don't want to
-# store it in the source repository).
-#
-# Remove compiled Lisp files so that bootstrap-emacs will be built from
-# sources only.
-
-# Need separate version for sh and native cmd.exe
-bootstrap-clean:
-       - $(DEL) $(lisp)/loaddefs.el
-       - $(DEL) $(lisp)/subdirs.el
-       $(MAKE) $(MFLAGS) bootstrap-clean-$(SHELLTYPE)
-
-bootstrap-clean-CMD:
-#      if exist "$(EMACS)" $(MAKE) $(MFLAGS) autoloads
-       -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g
-
-bootstrap-clean-SH:
-#      if test -f "$(EMACS)"; then $(MAKE) $(MFLAGS) autoloads; fi
-#      -rm -f $(lisp)/*.elc $(lisp)/*/*.elc
-       -for dir in . $(WINS); do rm -f $$dir/*.elc $$dir/*/*.elc 
$$dir/*/*/*.elc; done
-
-# Generate/update files for the bootstrap process.
-# When done, remove bootstrap-emacs from ../bin, so that
-# it will not be mistaken for an installed binary.
-
-bootstrap: $(lisp)/subdirs.el compile finder-data custom-deps
-       - $(DEL) "$(EMACS)"
-
-#
-# Assuming INSTALL_DIR is defined, copy the elisp files to it
-# Windows 95 makes this harder than it should be.
-#
-install:
-               - mkdir "$(INSTALL_DIR)/lisp"
-               - $(DEL) ../$(DIRNAME)_same-dir.tst
-               - $(DEL) "$(INSTALL_DIR)/$(DIRNAME)_same-dir.tst"
-               echo SameDirTest > "$(INSTALL_DIR)/$(DIRNAME)_same-dir.tst"
-#ifdef COPY_LISP_SOURCE
-               $(IFNOTSAMEDIR) $(MAKE) $(MFLAGS) install-lisp-$(SHELLTYPE) 
$(ENDIF)
-#else
-#              $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF)
-#              $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF)
-#              $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF)
-#              $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF)
-#              $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF)
-#              $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF)
-#              $(IFNOTSAMEDIR) $(CP) mail/blessmail.el 
"$(INSTALL_DIR)/lisp/mail" $(ENDIF)
-#              $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" 
$(ENDIF)
-#              $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" 
$(ENDIF)
-#              $(IFNOTSAMEDIR) $(CP) international/latin-*.el 
"$(INSTALL_DIR)/lisp/international" $(ENDIF)
-#              $(IFNOTSAMEDIR) $(CP) international/mule-conf.el 
"$(INSTALL_DIR)/lisp/international" $(ENDIF)
-#endif
-               - $(DEL) ../$(DIRNAME)_same-dir.tst
-               - $(DEL) "$(INSTALL_DIR)/$(DIRNAME)_same-dir.tst"
-
-# Need to copy *.el files first, to avoid "source file is newer" annoyance
-# since cp does not preserve time stamps
-install-lisp-SH:
-       cp -f *.el "$(INSTALL_DIR)/lisp"
-       for dir in $(WINS); do [ -d "$(INSTALL_DIR)/lisp/$$dir" ] || mkdir 
"$(INSTALL_DIR)/lisp/$$dir"; done
-       for dir in $(WINS); do cp -f $$dir/*.el "$(INSTALL_DIR)/lisp/$$dir"; 
done
-       for dir in . $(WINS); do cp $$dir/*.elc "$(INSTALL_DIR)/lisp/$$dir"; 
done
-
-install-lisp-CMD:
-       cp -f *.el "$(INSTALL_DIR)/lisp"
-       for %%f in ($(WINS)) do if not exist "$(INSTALL_DIR)/lisp/%%f" mkdir 
"$(INSTALL_DIR)/lisp/%%f"
-       for %%f in ($(WINS)) do cp -f %%f/*.el "$(INSTALL_DIR)/lisp/%%f"
-       for %%f in (. $(WINS)) do cp -f %%f/*.elc "$(INSTALL_DIR)/lisp/%%f"
-
-# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
-#          this can break with GNU Make 3.81 and later if sh.exe is used.
-check-declare:
-       $(emacs) -l $(lisp)/emacs-lisp/check-declare --eval 
$(ARGQUOTE)(check-declare-directory $(DQUOTE)$(lisp)$(DQUOTE))$(ARGQUOTE)
-
-#
-# Maintenance
-#
-# We used to delete *~ here, but that might inadvertently remove
-# precious files if it happens to match their short 8+3 aliases.
-clean:
-       - $(DEL) *.el~
-       - $(DEL) calc/calc-loaddefs.el~
-       - $(DEL) eshell/esh-groups.el~
-
-distclean: clean
-       - $(DEL) $(lisp)/Makefile
-
-maintainer-clean: bootstrap-clean distclean
-       - $(DEL) $(AUTOGENEL)
-
-# Dependencies
-
-# CC Mode uses a compile time macro system which causes a compile time
-# dependency in cc-*.elc files on the macros in other cc-*.el and the
-# version string in cc-defs.el.
-$(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-awk.elc\
- $(lisp)/progmodes/cc-cmds.elc $(lisp)/progmodes/cc-compat.elc\
- $(lisp)/progmodes/cc-engine.elc $(lisp)/progmodes/cc-fonts.elc\
- $(lisp)/progmodes/cc-langs.elc $(lisp)/progmodes/cc-menus.elc\
- $(lisp)/progmodes/cc-mode.elc $(lisp)/progmodes/cc-styles.elc\
- $(lisp)/progmodes/cc-vars.elc: \
-   $(lisp)/progmodes/cc-bytecomp.elc $(lisp)/progmodes/cc-defs.elc
-
-$(lisp)/progmodes/cc-align.elc: \
-   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
-
-$(lisp)/progmodes/cc-cmds.elc: \
-   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
-
-$(lisp)/progmodes/cc-compat.elc: \
-   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-styles.elc \
-   $(lisp)/progmodes/cc-engine.elc
-
-$(lisp)/progmodes/cc-defs.elc: $(lisp)/progmodes/cc-bytecomp.elc \
-   $(lisp)/emacs-lisp/cl.elc $(lisp)/emacs-lisp/regexp-opt.elc
-
-$(lisp)/progmodes/cc-engine.elc: $(lisp)/progmodes/cc-langs.elc \
-   $(lisp)/progmodes/cc-vars.elc
-
-$(lisp)/progmodes/cc-fonts.elc: $(lisp)/progmodes/cc-langs.elc \
-   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \
-   $(lisp)/font-lock.elc
-
-$(lisp)/progmodes/cc-langs.elc: $(lisp)/progmodes/cc-vars.elc \
-   $(lisp)/emacs-lisp/cl.elc
-
-$(lisp)/progmodes/cc-mode.elc: $(lisp)/progmodes/cc-langs.elc \
-   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \
-   $(lisp)/progmodes/cc-styles.elc $(lisp)/progmodes/cc-cmds.elc \
-   $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-menus.elc \
-   $(lisp)/subdirs.el
-
-$(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \
-   $(lisp)/progmodes/cc-align.elc
-
-$(lisp)/progmodes/cc-vars.elc: $(lisp)/custom.elc $(lisp)/widget.elc
-
-# MH-E dependencies, mainly to prevent failures with parallel
-# compilation, due to race conditions between writing a given FOO.elc
-# file and another file being compiled that says "(require FOO)",
-# which causes Emacs to try to read FOO.elc.
-MH_E_DIR = ./mh-e
-$(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-comp.elc $(MH_E_DIR)/mh-folder.elc\
- $(MH_E_DIR)/mh-funcs.elc $(MH_E_DIR)/mh-identity.elc $(MH_E_DIR)/mh-inc.elc\
- $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-limit.elc\
- $(MH_E_DIR)/mh-mime.elc $(MH_E_DIR)/mh-print.elc $(MH_E_DIR)/mh-scan.elc\
- $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc\
- $(MH_E_DIR)/mh-speed.elc $(MH_E_DIR)/mh-thread.elc 
$(MH_E_DIR)/mh-tool-bar.elc\
- $(MH_E_DIR)/mh-utils.elc $(MH_E_DIR)/mh-xface.elc:\
-   $(MH_E_DIR)/mh-e.elc
-
-$(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-e.elc $(MH_E_DIR)/mh-folder.elc\
- $(MH_E_DIR)/mh-inc.elc $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-limit.elc\
- $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-speed.elc\
- $(MH_E_DIR)/mh-utils.elc $(MH_E_DIR)/mh-xface.elc:\
-   $(lisp)/emacs-lisp/cl.elc
-
-$(MH_E_DIR)/mh-comp.elc $(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-funcs.elc\
- $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-limit.elc $(MH_E_DIR)/mh-print.elc\
- $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc $(MH_E_DIR)/mh-thread.elc:\
-   $(MH_E_DIR)/mh-scan.elc
-
-$(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-mime.elc\
- $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-show.elc $(MH_E_DIR)/mh-speed.elc:\
-   $(lisp)/gnus/gnus-util.elc
-
-$(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-search.elc:\
-   $(lisp)/progmodes/which-func.elc
-
-$(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc\
- $(MH_E_DIR)/mh-utils.elc:\
-   $(lisp)/font-lock.elc
-
-$(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-show.elc: $(lisp)/net/goto-addr.elc
-
-$(MH_E_DIR)/mh-comp.elc: $(lisp)/mail/sendmail.elc
-
-$(MH_E_DIR)/mh-e.elc: $(MH_E_DIR)/mh-buffers.elc $(lisp)/gnus/gnus.elc \
-   $(lisp)/cus-face.elc
-
-$(MH_E_DIR)/mh-letter.elc: $(lisp)/gnus/mailcap.elc $(lisp)/gnus/mm-decode.elc 
\
-   $(lisp)/gnus/mm-view.elc  $(lisp)/gnus/mml.elc $(lisp)/gnus/message.elc
-
-$(MH_E_DIR)/mh-print.elc:  $(lisp)/ps-print.elc
-
-$(MH_E_DIR)/mh-search.elc: $(lisp)/imenu.elc
-
-$(MH_E_DIR)/mh-show.elc: $(lisp)/gnus/gnus-cite.elc
-
-$(MH_E_DIR)/mh-speed.elc: $(lisp)/speedbar.elc $(lisp)/emacs-lisp/timer.elc
-
-$(MH_E_DIR)/mh-tool-bar.elc: $(lisp)/tool-bar.elc
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 221d30b..5048271 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -146,7 +146,7 @@ items `Turn Off' and `Help'."
          (describe-minor-mode-completion-table-for-indicator))))
   (let* ((minor-mode (lookup-minor-mode-from-indicator indicator))
          (mm-fun (or (get minor-mode :minor-mode-function) minor-mode)))
-    (unless minor-mode (error "Cannot find minor mode for `%s'" indicator))
+    (unless minor-mode (error "Cannot find minor mode for ‘%s’" indicator))
     (let* ((map (cdr-safe (assq minor-mode minor-mode-map-alist)))
            (menu (and (keymapp map) (lookup-key map [menu-bar]))))
       (setq menu
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 6305921..a8f5294 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -59,7 +59,7 @@ It is used for TCP/IP devices."
 
 ;;;###tramp-autoload
 (defcustom tramp-adb-prompt
-  
"^\\(?:[[:digit:]]*|?\\)?\\(?:[[:alnum:address@hidden:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]"
+  
"^\\(?:[[:digit:]]*|?\\)?\\(?:[[:alnum:]\e;address@hidden:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]"
   "Regexp used as prompt in almquist shell."
   :type 'string
   :version "24.4"
@@ -394,41 +394,42 @@ pass to the OPERATION."
   "Like `directory-files-and-attributes' for Tramp files."
   (when (file-directory-p directory)
     (with-parsed-tramp-file-name (expand-file-name directory) nil
-      (with-tramp-file-property
-         v localname (format "directory-files-attributes-%s-%s-%s-%s"
-                             full match id-format nosort)
-       (with-current-buffer (tramp-get-buffer v)
-         (when (tramp-adb-send-command-and-check
-                v (format "%s -a -l %s"
-                          (tramp-adb-get-ls-command v)
-                          (tramp-shell-quote-argument localname)))
-           ;; We insert also filename/. and filename/.., because "ls" doesn't.
-           (narrow-to-region (point) (point))
-           (tramp-adb-send-command
-            v (format "%s -d -a -l %s %s"
-                      (tramp-adb-get-ls-command v)
-                      (tramp-shell-quote-argument
-                       (concat (file-name-as-directory localname) "."))
-                      (tramp-shell-quote-argument
-                       (concat (file-name-as-directory localname) ".."))))
-           (widen))
-         (tramp-adb-sh-fix-ls-output)
-         (let ((result (tramp-do-parse-file-attributes-with-ls
-                        v (or id-format 'integer))))
-           (when full
-             (setq result
-                   (mapcar
-                    (lambda (x)
-                      (cons (expand-file-name (car x) directory) (cdr x)))
-                    result)))
-           (unless nosort
-             (setq result
-                   (sort result (lambda (x y) (string< (car x) (car y))))))
-           (delq nil
-                 (mapcar (lambda (x)
-                           (if (or (not match) (string-match match (car x)))
-                               x))
-                         result))))))))
+      (copy-tree
+       (with-tramp-file-property
+          v localname (format "directory-files-and-attributes-%s-%s-%s-%s"
+                              full match id-format nosort)
+        (with-current-buffer (tramp-get-buffer v)
+          (when (tramp-adb-send-command-and-check
+                 v (format "%s -a -l %s"
+                           (tramp-adb-get-ls-command v)
+                           (tramp-shell-quote-argument localname)))
+            ;; We insert also filename/. and filename/.., because "ls" doesn't.
+            (narrow-to-region (point) (point))
+            (tramp-adb-send-command
+             v (format "%s -d -a -l %s %s"
+                       (tramp-adb-get-ls-command v)
+                       (tramp-shell-quote-argument
+                        (concat (file-name-as-directory localname) "."))
+                       (tramp-shell-quote-argument
+                        (concat (file-name-as-directory localname) ".."))))
+            (widen))
+          (tramp-adb-sh-fix-ls-output)
+          (let ((result (tramp-do-parse-file-attributes-with-ls
+                         v (or id-format 'integer))))
+            (when full
+              (setq result
+                    (mapcar
+                     (lambda (x)
+                       (cons (expand-file-name (car x) directory) (cdr x)))
+                     result)))
+            (unless nosort
+              (setq result
+                    (sort result (lambda (x y) (string< (car x) (car y))))))
+            (delq nil
+                  (mapcar (lambda (x)
+                            (if (or (not match) (string-match match (car x)))
+                                x))
+                          result)))))))))
 
 (defun tramp-adb-get-ls-command (vec)
   (with-tramp-connection-property vec "ls"
@@ -497,12 +498,11 @@ Emacs dired can't find files."
 
 (defun tramp-adb-ls-output-name-less-p (a b)
   "Sort \"ls\" output by name, ascending."
-  (let (posa posb)
-    (string-match directory-listing-before-filename-regexp a)
-    (setq posa (match-end 0))
-    (string-match directory-listing-before-filename-regexp b)
-    (setq posb (match-end 0))
-    (string-lessp (substring a posa) (substring b posb))))
+  (if (string-match directory-listing-before-filename-regexp a)
+      (let ((posa (match-end 0)))
+       (if (string-match directory-listing-before-filename-regexp b)
+           (let ((posb (match-end 0)))
+             (string-lessp (substring a posa) (substring b posb)))))))
 
 (defun tramp-adb-handle-make-directory (dir &optional parents)
   "Like `make-directory' for Tramp files."
@@ -652,6 +652,7 @@ But handle the case, if the \"test\" command is not 
available."
 (defun tramp-adb-handle-set-file-modes (filename mode)
   "Like `set-file-modes' for Tramp files."
   (with-parsed-tramp-file-name filename nil
+    (tramp-flush-file-property v (file-name-directory localname))
     (tramp-flush-file-property v localname)
     (tramp-adb-send-command-and-check
      v (format "chmod %s %s" (tramp-compat-decimal-to-octal mode) localname))))
@@ -659,6 +660,7 @@ But handle the case, if the \"test\" command is not 
available."
 (defun tramp-adb-handle-set-file-times (filename &optional time)
   "Like `set-file-times' for Tramp files."
   (with-parsed-tramp-file-name filename nil
+    (tramp-flush-file-property v (file-name-directory localname))
     (tramp-flush-file-property v localname)
     (let ((time (if (or (null time) (equal time '(0 0)))
                    (current-time)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index bb939bf..49d4c4a 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1407,6 +1407,7 @@ of."
 (defun tramp-sh-handle-set-file-modes (filename mode)
   "Like `set-file-modes' for Tramp files."
   (with-parsed-tramp-file-name filename nil
+    (tramp-flush-file-property v (file-name-directory localname))
     (tramp-flush-file-property v localname)
     ;; FIXME: extract the proper text from chmod's stderr.
     (tramp-barf-unless-okay
@@ -1421,6 +1422,7 @@ of."
   (if (tramp-tramp-file-p filename)
       (with-parsed-tramp-file-name filename nil
        (when (tramp-get-remote-touch v)
+         (tramp-flush-file-property v (file-name-directory localname))
          (tramp-flush-file-property v localname)
          (let ((time (if (or (null time) (equal time '(0 0)))
                          (current-time)
@@ -1490,15 +1492,8 @@ be non-negative integers."
 
 (defun tramp-remote-selinux-p (vec)
   "Check, whether SELINUX is enabled on the remote host."
-  (with-tramp-connection-property
-      (tramp-get-connection-process vec) "selinux-p"
-    (let ((result (tramp-find-executable
-                  vec "getenforce" (tramp-get-remote-path vec) t t)))
-      (and result
-          (string-equal
-           (tramp-send-command-and-read
-            vec (format "echo \\\"`%S`\\\"" result))
-           "Enforcing")))))
+  (with-tramp-connection-property (tramp-get-connection-process vec) 
"selinux-p"
+    (tramp-send-command-and-check vec "selinuxenabled")))
 
 (defun tramp-sh-handle-file-selinux-context (filename)
   "Like `file-selinux-context' for Tramp files."
@@ -1524,24 +1519,25 @@ be non-negative integers."
 (defun tramp-sh-handle-set-file-selinux-context (filename context)
   "Like `set-file-selinux-context' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    (if (and (consp context)
-            (tramp-remote-selinux-p v)
-            (tramp-send-command-and-check
-             v (format "chcon %s %s %s %s %s"
-                       (if (stringp (nth 0 context))
-                           (format "--user=%s" (nth 0 context)) "")
-                       (if (stringp (nth 1 context))
-                           (format "--role=%s" (nth 1 context)) "")
-                       (if (stringp (nth 2 context))
-                           (format "--type=%s" (nth 2 context)) "")
-                       (if (stringp (nth 3 context))
-                           (format "--range=%s" (nth 3 context)) "")
-                       (tramp-shell-quote-argument localname))))
-       (progn
-         (tramp-set-file-property v localname "file-selinux-context" context)
-         t)
-      (tramp-set-file-property v localname "file-selinux-context" 'undef)
-      nil)))
+    (when (and (consp context)
+              (tramp-remote-selinux-p v))
+      (let ((user (and (stringp (nth 0 context)) (nth 0 context)))
+           (role (and (stringp (nth 1 context)) (nth 1 context)))
+           (type (and (stringp (nth 2 context)) (nth 2 context)))
+           (range (and (stringp (nth 3 context)) (nth 3 context))))
+       (when (tramp-send-command-and-check
+              v (format "chcon %s %s %s %s %s"
+                        (if user (format "--user=%s" user) "")
+                        (if role (format "--role=%s" role) "")
+                        (if type (format "--type=%s" type) "")
+                        (if range (format "--range=%s" range) "")
+                      (tramp-shell-quote-argument localname)))
+         (if (and user role type range)
+             (tramp-set-file-property
+              v localname "file-selinux-context" context)
+           (tramp-set-file-property
+            v localname "file-selinux-context" 'undef))
+         t)))))
 
 (defun tramp-remote-acl-p (vec)
   "Check, whether ACL is enabled on the remote host."
@@ -1555,7 +1551,7 @@ be non-negative integers."
       (when (and (tramp-remote-acl-p v)
                 (tramp-send-command-and-check
                  v (format
-                    "getfacl -ac %s 2>/dev/null"
+                    "getfacl -ac %s"
                     (tramp-shell-quote-argument localname))))
        (with-current-buffer (tramp-get-connection-buffer v)
          (goto-char (point-max))
diff --git a/lisp/obsolete/complete.el b/lisp/obsolete/complete.el
index 7c7582f..87dedac 100644
--- a/lisp/obsolete/complete.el
+++ b/lisp/obsolete/complete.el
@@ -963,7 +963,7 @@ or properties are considered."
  Environment vars are converted to their values."
    (interactive)
    (let* ((end (point))
-          (beg (if (re-search-backward "[^\\][ \t\n\"\`\'][^ \t\n\"\`\']"
+          (beg (if (re-search-backward "[^\\][ \t\n\"`'][^ \t\n\"`']"
                                       (point-min) t)
                    (+ (point) 2)
                    (point-min)))
diff --git a/lisp/obsolete/vi.el b/lisp/obsolete/vi.el
index fbdf7a1..c5dc0ef 100644
--- a/lisp/obsolete/vi.el
+++ b/lisp/obsolete/vi.el
@@ -1213,7 +1213,7 @@ SPECIAL FEATURE: char argument can be used to specify 
shift amount(1-9)."
 (defun vi-backward-blank-delimited-word (count)
   "Backward COUNT blank-delimited words."
   (interactive "p")
-  (if (re-search-backward "[ \t\n\`][^ \t\n\`]+" nil t count)
+  (if (re-search-backward "[ \t\n`][^ \t\n`]+" nil t count)
       (if (not (bobp)) (forward-char 1))))
 
 (defun vi-forward-blank-delimited-word (count)
diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el
index f767a4e..bb46267 100644
--- a/lisp/org/ob-core.el
+++ b/lisp/org/ob-core.el
@@ -316,8 +316,8 @@ name of the code block."
 Do not query the user."
   (org-babel-check-confirm-evaluate info
     (not (when noeval
-          (message (format "Evaluation of this%scode-block%sis disabled."
-                           code-block block-name))))))
+          (message "Evaluation of this%scode-block%sis disabled."
+                    code-block block-name)))))
 
  ;; dynamically scoped for asynchronous export
 (defvar org-babel-confirm-evaluate-answer-no)
@@ -343,8 +343,8 @@ of potentially harmful code."
                    (yes-or-no-p
                     (format "Evaluate this%scode block%son your system? "
                             code-block block-name)))
-            (message (format "Evaluation of this%scode-block%sis aborted."
-                             code-block block-name)))))))
+            (message "Evaluation of this%scode-block%sis aborted."
+                      code-block block-name))))))
 
 ;;;###autoload
 (defun org-babel-execute-safely-maybe ()
diff --git a/lisp/org/ob-fortran.el b/lisp/org/ob-fortran.el
index 7fbfaf2..30b5350 100644
--- a/lisp/org/ob-fortran.el
+++ b/lisp/org/ob-fortran.el
@@ -147,15 +147,14 @@ of the same value."
      ;; val is a matrix
      ((and (listp val) (org-every #'listp val))
       (format "real, parameter :: %S(%d,%d) = transpose( reshape( %s , (/ %d, 
%d /) ) )\n"
-             var (length val) (length (car val)) 
+             var (length val) (length (car val))
              (org-babel-fortran-transform-list val)
              (length (car val)) (length val)))
      ((listp val)
       (format "real, parameter :: %S(%d) = %s\n"
              var (length val) (org-babel-fortran-transform-list val)))
      (t
-      (error (format "the type of parameter %s is not supported by ob-fortran"
-                    var))))))
+      (error "the type of parameter %s is not supported by ob-fortran" var)))))
 
 (defun org-babel-fortran-transform-list (val)
   "Return a fortran representation of enclose syntactic lists."
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index 5c2ceaf..12d7fa1 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -270,8 +270,7 @@ the display of windows containing the Org buffer and the 
code buffer."
       (setq beg (move-marker beg (nth 0 info))
            end (move-marker end (nth 1 info))
            msg (if allow-write-back-p
-                   (substitute-command-keys
-                    "Edit, then exit with C-c ' (C-c and single quote) -- C-c 
C-k to abort")
+                    "Edit, then exit with C-c ' (C-c and single quote) -- C-c 
C-k to abort"
                  "Exit with C-c ' (C-c and single quote) -- C-c C-k to abort")
            code (or code (buffer-substring-no-properties beg end))
            lang (or (cdr (assoc (nth 2 info) org-src-lang-modes))
@@ -468,8 +467,7 @@ the fragment in the Org-mode buffer."
   (let ((line (org-current-line))
        (col (current-column))
        (case-fold-search t)
-       (msg (substitute-command-keys
-             "Edit, then exit with C-c ' (C-c and single quote) -- C-c C-k to 
abort"))
+       (msg "Edit, then exit with C-c ' (C-c and single quote) -- C-c C-k to 
abort")
        (org-mode-p (derived-mode-p 'org-mode))
        (beg (make-marker))
        (end (make-marker))
diff --git a/lisp/org/org.el b/lisp/org/org.el
index b545f9e..0cc185c 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -4860,8 +4860,8 @@ Support for group tags is controlled by the option
                                             (if (characterp (cdr tg))
                                                 (format "(%s)" (char-to-string 
(cdr tg))) "")))))
               org-tag-alist)))
-      (let (e tgs g)
-       (while (setq e (pop tags))
+      (let (tgs g)
+       (dolist (e tags)
          (cond
           ((equal e "{")
            (progn (push '(:startgroup) tgs)
@@ -4875,7 +4875,8 @@ Support for group tags is controlled by the option
           ((equal e "\\n") (push '(:newline) tgs))
           ((string-match (org-re "^\\([[:alnum:address@hidden)(\\(.\\))$") e)
            (push (cons (match-string 1 e)
-                       (string-to-char (match-string 2 e))) tgs)
+                       (string-to-char (match-string 2 e)))
+                  tgs)
            (if (and g (> g 0))
                (setcar org-tag-groups-alist
                        (append (car org-tag-groups-alist)
@@ -4887,7 +4888,7 @@ Support for group tags is controlled by the option
                          (append (car org-tag-groups-alist) (list e))))
              (if g (setq g (1+ g))))))
        (org-set-local 'org-tag-alist nil)
-       (while (setq e (pop tgs))
+       (dolist (e tgs)
          (or (and (stringp (car e))
                   (assoc (car e) org-tag-alist))
              (push e org-tag-alist)))
@@ -4957,7 +4958,8 @@ Support for group tags is controlled by the option
             ((string-match "\\`\\([a-zA-Z][0-9a-zA-Z_]*\\)_TODO\\'" key)
              ;; general TODO-like setup
              (push (cons (intern (downcase (match-string 1 key)))
-                         (org-split-string value splitre)) kwds))
+                         (org-split-string value splitre))
+                    kwds))
             ((equal key "COLUMNS")
              (org-set-local 'org-columns-default-format value))
             ((equal key "LINK")
@@ -4978,8 +4980,8 @@ Support for group tags is controlled by the option
              (org-table-set-constants))
             ((equal key "STARTUP")
              (let ((opts (org-split-string value splitre))
-                   l var val)
-               (while (setq l (pop opts))
+                   var val)
+               (dolist (l opts)
                  (when (setq l (assoc l org-startup-options))
                    (setq var (nth 1 l) val (nth 2 l))
                    (if (not (nth 3 l))
@@ -5041,8 +5043,8 @@ Support for group tags is controlled by the option
                                   (default-value 'org-todo-keywords)))))
        (setq kwds (reverse kwds)))
       (setq kwds (nreverse kwds))
-      (let (inter kws kw)
-       (while (setq kws (pop kwds))
+      (let (inter kw)
+       (dolist (kws kwds)
          (let ((kws (or
                      (run-hook-with-args-until-success
                       'org-todo-setup-filter-hook kws)
@@ -5210,8 +5212,8 @@ This will extract info from a string like \"WAIT(w@/!)\"."
 (defun org-assign-fast-keys (alist)
   "Assign fast keys to a keyword-key alist.
 Respect keys that are already there."
-  (let (new e (alt ?0))
-    (while (setq e (pop alist))
+  (let (new (alt ?0))
+    (dolist (e alist)
       (if (or (memq (car e) '(:newline :grouptags :endgroup :startgroup))
              (cdr e)) ;; Key already assigned.
          (push e new)
@@ -5330,8 +5332,9 @@ The following commands are available:
     (define-key org-mode-map [menu-bar show] 'undefined))
 
   (org-load-modules-maybe)
-  (easy-menu-add org-org-menu)
-  (easy-menu-add org-tbl-menu)
+  (when (featurep 'xemacs)
+    (easy-menu-add org-org-menu)
+    (easy-menu-add org-tbl-menu))
   (org-install-agenda-files-menu)
   (if org-descriptive-links (add-to-invisibility-spec '(org-link)))
   (add-to-invisibility-spec '(org-cwidth))
@@ -7265,9 +7268,8 @@ Optional arguments START and END can be used to limit the 
range."
   (setq org-goto-map
        (let ((map (make-sparse-keymap)))
          (let ((cmds '(isearch-forward isearch-backward kill-ring-save 
set-mark-command
-                                       mouse-drag-region universal-argument 
org-occur))
-               cmd)
-           (while (setq cmd (pop cmds))
+                                       mouse-drag-region universal-argument 
org-occur)))
+           (dolist (cmd cmds)
              (substitute-key-definition cmd cmd map global-map)))
          (suppress-keymap map)
          (org-defkey map "\C-m"     'org-goto-ret)
@@ -8564,7 +8566,8 @@ and still retain the repeater to cover future instances 
of the task."
              (goto-char (point-min))
              (while (re-search-forward drawer-re nil t)
                (mapc (lambda (d)
-                       (org-remove-empty-drawer-at d (point))) org-drawers)))
+                       (org-remove-empty-drawer-at d (point)))
+                      org-drawers)))
            (goto-char (point-min))
            (when doshift
              (while (re-search-forward org-ts-regexp-both nil t)
@@ -8598,7 +8601,8 @@ Optional argument WITH-CASE means sort case-sensitively."
   (while (string-match org-bracket-link-regexp s)
     (setq s (replace-match (if (match-end 2)
                               (match-string 3 s)
-                            (match-string 1 s)) t t s)))
+                            (match-string 1 s))
+                           t t s)))
   (let ((st (format " %s " s)))
     (while (string-match org-emph-re st)
       (setq st (replace-match (format " %s " (match-string 4 st)) t t st)))
@@ -9148,10 +9152,11 @@ definitions."
                            (list (car c) (car c) (cadr c)))
                           ((string= "" (cadr c))
                            (list (car c) (car c) (caddr c)))
-                          (t c))) contexts))
-       (a alist) c r s)
+                          (t c)))
+          contexts))
+       (a alist) r s)
     ;; loop over all commands or templates
-    (while (setq c (pop a))
+    (dolist (c a)
       (let (vrules repl)
        (cond
         ((not (assoc (car c) contexts))
@@ -9161,7 +9166,8 @@ definitions."
                             (car c) contexts)))
          (mapc (lambda (vr)
                  (when (not (equal (car vr) (cadr vr)))
-                   (setq repl vr))) vrules)
+                   (setq repl vr)))
+                vrules)
          (if (not repl) (push c r)
            (push (cadr repl) s)
            (push
@@ -9178,14 +9184,16 @@ definitions."
                (let ((tpl (car x)))
                  (when (not (delq
                              nil
-                             (mapcar (lambda(y)
-                                       (equal y tpl)) s))) x)))
+                             (mapcar (lambda (y)
+                                       (equal y tpl))
+                                      s)))
+                    x)))
              (reverse r))))))
 
 (defun org-contextualize-validate-key (key contexts)
   "Check CONTEXTS for agenda or capture KEY."
-  (let (r rr res)
-    (while (setq r (pop contexts))
+  (let (rr res)
+    (dolist (r contexts)
       (mapc
        (lambda (rr)
         (when
@@ -9484,7 +9492,8 @@ active region."
                  (funcall (caar sfuns)))
              (setq link (plist-get org-store-link-plist :link)
                    desc (or (plist-get org-store-link-plist
-                                       :description) link))))
+                                       :description)
+                             link))))
 
        ;; Store a link from a source code buffer
        ((org-src-edit-buffer-p)
@@ -9664,7 +9673,8 @@ active region."
 
        ;; Return the link
        (if (not (and (or (org-called-interactively-p 'any)
-                        executing-kbd-macro) link))
+                        executing-kbd-macro)
+                     link))
           (or agenda-link (and link (org-make-link-string link desc)))
         (push (list link desc) org-stored-links)
         (message "Stored: %s" (or desc link))
@@ -10897,7 +10907,7 @@ visibility around point, thus ignoring
 enclose the position of `org-open-link-marker'."
   (let ((m org-open-link-marker))
     (catch 'exit
-      (while (apply 're-search-forward args)
+      (while (apply #'re-search-forward args)
        (unless (get-text-property (match-end group) 'intangible) ; Emacs 21
          (goto-char (match-end group))
          (if (and (or (not (eq (marker-buffer m) (current-buffer)))
@@ -11248,12 +11258,9 @@ on the system \"/address@hidden:\"."
    ((eq t org-reverse-note-order) t)
    ((not (listp org-reverse-note-order)) nil)
    (t (catch 'exit
-       (let  ((all org-reverse-note-order)
-              entry)
-         (while (setq entry (pop all))
-           (if (string-match (car entry) buffer-file-name)
-               (throw 'exit (cdr entry))))
-         nil)))))
+        (dolist (entry org-reverse-note-order)
+          (if (string-match (car entry) buffer-file-name)
+              (throw 'exit (cdr entry))))))))
 
 (defvar org-refile-target-table nil
   "The list of refile targets, created by `org-refile'.")
@@ -11318,10 +11325,10 @@ on the system \"/address@hidden:\"."
   (let ((case-fold-search nil)
        ;; otherwise org confuses "TODO" as a kw and "Todo" as a word
        (entries (or org-refile-targets '((nil . (:level . 1)))))
-       targets tgs txt re files f desc descre fast-path-p level pos0)
+       targets tgs txt re files desc descre fast-path-p level pos0)
     (message "Getting targets...")
     (with-current-buffer (or default-buffer (current-buffer))
-      (while (setq entry (pop entries))
+      (dolist (entry entries)
        (setq files (car entry) desc (cdr entry))
        (setq fast-path-p nil)
        (cond
@@ -11354,7 +11361,7 @@ on the system \"/address@hidden:\"."
                                              (cdr desc)))
                               "\\}[ \t]")))
         (t (error "Bad refiling target description %s" desc)))
-       (while (setq f (pop files))
+       (dolist (f files)
          (with-current-buffer
              (if (bufferp f) f (org-get-agenda-file-buffer f))
            (or
@@ -12736,20 +12743,19 @@ This hook runs even if there is no statistics cookie 
present, in which case
 
 (defun org-local-logging (value)
   "Get logging settings from a property VALUE."
-  (let* (words w a)
-    ;; directly set the variables, they are already local.
-    (setq org-log-done nil
-         org-log-repeat nil
-         org-todo-log-states nil)
-    (setq words (org-split-string value))
-    (while (setq w (pop words))
+  ;; Directly set the variables, they are already local.
+  (setq org-log-done nil
+        org-log-repeat nil
+        org-todo-log-states nil)
+  (dolist (w (org-split-string value))
+    (let* (a)
       (cond
        ((setq a (assoc w org-startup-options))
-       (and (member (nth 1 a) '(org-log-done org-log-repeat))
-            (set (nth 1 a) (nth 2 a))))
+        (and (member (nth 1 a) '(org-log-done org-log-repeat))
+             (set (nth 1 a) (nth 2 a))))
        ((setq a (org-extract-log-state-settings w))
-       (and (member (car a) org-todo-keywords-1)
-            (push a org-todo-log-states)))))))
+        (and (member (car a) org-todo-keywords-1)
+             (push a org-todo-log-states)))))))
 
 (defun org-get-todo-sequence-head (kwd)
   "Return the head of the TODO sequence to which KWD belongs.
@@ -12779,7 +12785,7 @@ Returns the new TODO keyword, or nil if no state change 
should occur."
         (expert nil)
         (fwidth (+ maxlen 3 1 3))
         (ncol (/ (- (window-width) 4) fwidth))
-        tg cnt e c tbl
+        tg cnt c tbl
         groups ingroup)
     (save-excursion
       (save-window-excursion
@@ -12789,7 +12795,7 @@ Returns the new TODO keyword, or nil if no state change 
should occur."
        (erase-buffer)
        (org-set-local 'org-done-keywords done-keywords)
        (setq tbl fulltable cnt 0)
-       (while (setq e (pop tbl))
+       (dolist (e tbl)
          (cond
           ((equal e '(:startgroup))
            (push '() groups) (setq ingroup t)
@@ -14123,7 +14129,7 @@ See also `org-scan-tags'.
        (re (org-re 
"^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL\\([<=>]\\{1,2\\}\\)\\([0-9]+\\)\\|\\(\\(?:[[:alnum:]_]+\\(?:\\\\-\\)*\\)+\\)\\([<>=]\\{1,2\\}\\)\\({[^}]+}\\|\"[^\"]*\"\\|-?[.0-9]+\\(?:[eE][-+]?[0-9]+\\)?\\)\\|[[:alnum:address@hidden)"))
        minus tag mm
        tagsmatch todomatch tagsmatcher todomatcher kwd matcher
-       orterms term orlist re-p str-p level-p level-op time-p
+       orterms orlist re-p str-p level-p level-op time-p
        prop-p pn pv po gv rest (start 0) (ss 0))
     ;; Expand group tags
     (setq match (org-tags-expand match))
@@ -14152,7 +14158,7 @@ See also `org-scan-tags'.
     (if (or (not tagsmatch) (not (string-match "\\S-" tagsmatch)))
        (setq tagsmatcher t)
       (setq orterms (org-split-string tagsmatch "|") orlist nil)
-      (while (setq term (pop orterms))
+      (dolist (term orterms)
        (while (and (equal (substring term -1) "\\") orterms)
          (setq term (concat term "|" (pop orterms)))) ; repair bad split
        (while (string-match re term)
@@ -14213,7 +14219,7 @@ See also `org-scan-tags'.
     (if (or (not todomatch) (not (string-match "\\S-" todomatch)))
        (setq todomatcher t)
       (setq orterms (org-split-string todomatch "|") orlist nil)
-      (while (setq term (pop orterms))
+      (dolist (term orterms)
        (while (string-match re term)
          (setq minus (and (match-end 1)
                           (equal (match-string 1 term) "-"))
@@ -14282,7 +14288,8 @@ When DOWNCASE is non-nil, expand downcased TAGS."
                    (with-syntax-table stable
                      (string-match
                       (concat "\\(?1:[+-]?\\)\\(?2:\\<"
-                              (regexp-opt tml) "\\>\\)") rtnmatch)))
+                              (regexp-opt tml) "\\>\\)")
+                       rtnmatch)))
          (let* ((dir (match-string 1 rtnmatch))
                 (tag (match-string 2 rtnmatch))
                 (tag (if downcased (downcase tag) tag)))
@@ -14418,7 +14425,8 @@ ignore inherited ones."
          (reverse (delete-dups
                    (reverse (append
                              (org-remove-uninherited-tags
-                              org-file-tags) tags)))))))))
+                              org-file-tags)
+                              tags)))))))))
 
 (defun org-add-prop-inherited (s)
   (add-text-properties 0 (length s) '(inherited t) s)
@@ -14750,7 +14758,7 @@ Returns the new tags string, or nil to not change the 
current settings."
         (ncol (/ (- (window-width) 4) fwidth))
         (i-face 'org-done)
         (c-face 'org-todo)
-        tg cnt e c char c1 c2 ntable tbl rtn
+        tg cnt c char c1 c2 ntable tbl rtn
         ov-start ov-end ov-prefix
         (exit-after-next org-fast-tag-selection-single-key)
         (done-keywords org-done-keywords)
@@ -14785,7 +14793,7 @@ Returns the new tags string, or nil to not change the 
current settings."
       (org-fast-tag-show-exit exit-after-next)
       (org-set-current-tags-overlay current ov-prefix)
       (setq tbl fulltable char ?a cnt 0)
-      (while (setq e (pop tbl))
+      (dolist (e tbl)
        (cond
         ((equal (car e) :startgroup)
          (push '() groups) (setq ingroup t)
@@ -15077,7 +15085,7 @@ a *different* entry, you cannot use these techniques."
             ((eq scope 'file-with-archives)
              (setq scope (org-add-archive-files (list (buffer-file-name))))))
            (org-agenda-prepare-buffers scope)
-           (while (setq file (pop scope))
+           (dolist (file scope)
              (with-current-buffer (org-find-base-buffer-visiting file)
                (save-excursion
                  (save-restriction
@@ -16034,7 +16042,7 @@ only headings."
          (widen)
          (setq limit (point-max))
          (goto-char (point-min))
-         (while (setq heading (pop path))
+         (dolist (heading path)
            (setq re (format org-complex-heading-regexp-format
                             (regexp-quote heading)))
            (setq cnt 0 pos (point))
@@ -16079,7 +16087,7 @@ When the target headline is found, return a marker to 
this location."
                                nil "\\`[^.#].*\\.org\\'"))
         file visiting m buffer)
     (catch 'found
-      (while (setq file (pop files))
+      (dolist (file files)
         (message "trying %s" file)
         (setq visiting (org-find-base-buffer-visiting file))
         (setq buffer (or visiting (find-file-noselect file)))
@@ -18037,7 +18045,7 @@ If the current buffer does not, find the first agenda 
file."
         file)
     (unless files (user-error "No agenda files"))
     (catch 'exit
-      (while (setq file (pop files))
+      (dolist (file files)
        (if (equal (file-truename file) tcf)
            (when (car files)
              (find-file (car files))
@@ -18123,8 +18131,8 @@ it to the list of buffers which might be released 
later."
   "Release all buffers in list, asking the user for confirmation when needed.
 When a buffer is unmodified, it is just killed.  When modified, it is saved
 \(if the user agrees) and then killed."
-  (let (buf file)
-    (while (setq buf (pop blist))
+  (let (file)
+    (dolist (buf blist)
       (setq file (buffer-file-name buf))
       (when (and (buffer-modified-p buf)
                 file
@@ -18146,7 +18154,7 @@ When a buffer is unmodified, it is just killed.  When 
modified, it is saved
          org-tag-groups-alist-for-agenda nil)
     (save-excursion
       (save-restriction
-       (while (setq file (pop files))
+       (dolist (file files)
          (catch 'nextfile
            (if (bufferp file)
                (set-buffer file)
@@ -18426,11 +18434,11 @@ Some of the options can be changed using the variable
         (optnew org-format-latex-options)
         (matchers (plist-get opt :matchers))
         (re-list org-latex-regexps)
-        (cnt 0) txt hash link beg end re e checkdir
+        (cnt 0) txt hash link beg end re checkdir
         string
         m n block-type block linkfile movefile ov)
     ;; Check the different regular expressions
-    (while (setq e (pop re-list))
+    (dolist (e re-list)
       (setq m (car e) re (nth 1 e) n (nth 2 e) block-type (nth 3 e)
            block (if block-type "\n\n" ""))
       (when (member m matchers)
@@ -19054,7 +19062,7 @@ BEG and END default to the buffer boundaries."
 (org-defkey org-mode-map "\C-i"       'org-cycle)
 (org-defkey org-mode-map [(tab)]      'org-cycle)
 (org-defkey org-mode-map [(control tab)] 'org-force-cycle-archived)
-(org-defkey org-mode-map "\M-\t" 'pcomplete)
+(org-defkey org-mode-map "\M-\t" #'pcomplete)
 ;; The following line is necessary under Suse GNU/Linux
 (unless (featurep 'xemacs)
   (org-defkey org-mode-map [S-iso-lefttab]  'org-shifttab))
@@ -19121,7 +19129,7 @@ BEG and END default to the buffer boundaries."
   (org-defkey org-mode-map [?\C-c (right)] 'org-shiftright)
   (org-defkey org-mode-map [?\C-c ?\C-x (right)] 'org-shiftcontrolright)
   (org-defkey org-mode-map [?\C-c ?\C-x (left)] 'org-shiftcontrolleft)
-  (org-defkey org-mode-map [?\e (tab)] 'pcomplete)
+  (org-defkey org-mode-map [?\e (tab)] #'pcomplete)
   (org-defkey org-mode-map [?\e (shift return)] 'org-insert-todo-heading)
   (org-defkey org-mode-map [?\e (shift left)]   'org-shiftmetaleft)
   (org-defkey org-mode-map [?\e (shift right)]  'org-shiftmetaright)
@@ -20784,8 +20792,8 @@ number of stars to add."
                   (insert
                    (org-list-to-subtree
                     (org-list-parse-list t)
-                    '(:istart (concat stars add-stars (funcall get-stars 
depth))
-                              :icount (concat stars add-stars (funcall 
get-stars depth)))))))
+                    `(:istart (concat ',stars ',add-stars (funcall get-stars 
depth))
+                       :icount (concat ',stars ',add-stars (funcall get-stars 
depth)))))))
               (setq toggled t))
             (forward-line))))
        ;; Case 3. Started at normal text: make every line an heading,
@@ -20807,11 +20815,11 @@ number of stars to add."
               (forward-line)))))))
     (unless toggled (message "Cannot toggle heading from here"))))
 
-(defun org-meta-return (&optional arg)
+(defun org-meta-return (&optional _arg)
   "Insert a new heading or wrap a region in a table.
 Calls `org-insert-heading' or `org-table-wrap-region', depending
 on context.  See the individual commands for more information."
-  (interactive "P")
+  (interactive)
   (org-check-before-invisible-edit 'insert)
   (or (run-hook-with-args-until-success 'org-metareturn-hook)
       (let* ((element (org-element-at-point))
@@ -21109,6 +21117,7 @@ output buffer into your mail program, as it gives us 
important
 information about your Org-mode version and configuration."
   (interactive)
   (require 'reporter)
+  (defvar reporter-prompt-for-summary-p)
   (org-load-modules-maybe)
   (org-require-autoloaded-modules)
   (let ((reporter-prompt-for-summary-p "Bug report subject: "))
@@ -21368,11 +21377,13 @@ upon the next fontification round."
                                        'invisible 'org-link s))
        (setq s (concat (substring s 0 b)
                        (substring s (or (next-single-property-change
-                                         b 'invisible s) (length s)))))))
+                                         b 'invisible s)
+                                         (length s)))))))
     (while (setq b (text-property-any 0 (length s) 'org-cwidth t s))
       (setq s (concat (substring s 0 b)
                      (substring s (or (next-single-property-change
-                                       b 'org-cwidth s) (length s))))))
+                                       b 'org-cwidth s)
+                                       (length s))))))
     (setq l (string-width s) b -1)
     (while (setq b (text-property-any (1+ b) (length s) 'org-dwidth t s))
       (setq l (- l (get-text-property b 'org-dwidth-n s))))
@@ -21469,11 +21480,9 @@ N may optionally be the number of spaces to remove."
 
 (defun org-fill-template (template alist)
   "Find each %key of ALIST in TEMPLATE and replace it."
-  (let ((case-fold-search nil)
-       entry key value)
-    (setq alist (sort (copy-sequence alist)
-                     (lambda (a b) (< (length (car a)) (length (car b))))))
-    (while (setq entry (pop alist))
+  (let ((case-fold-search nil))
+    (dolist (entry (sort (copy-sequence alist)
+                         (lambda (a b) (< (length (car a)) (length (car b))))))
       (setq template
            (replace-regexp-in-string
             (concat "%" (regexp-quote (car entry)))
@@ -21795,23 +21804,24 @@ block from point."
        "^[ \t]*:end:.*$"
        lim-up lim-down))))
 
-(defun org-occur-in-agenda-files (regexp &optional nlines)
+(defun org-occur-in-agenda-files (regexp &optional _nlines)
   "Call `multi-occur' with buffers for all agenda files."
-  (interactive "sOrg-files matching: \np")
+  (interactive "sOrg-files matching: ")
   (let* ((files (org-agenda-files))
-        (tnames (mapcar 'file-truename files))
-        (extra org-agenda-text-search-extra-files)
-        f)
+        (tnames (mapcar #'file-truename files))
+        (extra org-agenda-text-search-extra-files))
     (when (eq (car extra) 'agenda-archives)
       (setq extra (cdr extra))
       (setq files (org-add-archive-files files)))
-    (while (setq f (pop extra))
+    (dolist (f extra)
       (unless (member (file-truename f) tnames)
-       (add-to-list 'files f 'append)
-       (add-to-list 'tnames (file-truename f) 'append)))
+        (unless (member f files) (setq files (append files (list f))))
+        (setq tnames (append tnames (list (file-truename f))))))
     (multi-occur
      (mapcar (lambda (x)
               (with-current-buffer
+                   ;; FIXME: Why not just (find-file-noselect x)?
+                   ;; Is it to avoid the "revert buffer" prompt?
                   (or (get-file-buffer x) (find-file-noselect x))
                 (widen)
                 (current-buffer)))
@@ -21996,7 +22006,7 @@ so values can contain further %-escapes if they are 
define later in TABLE."
        (case-fold-search nil)
         (pchg 0)
         e re rpl)
-    (while (setq e (pop tbl))
+    (dolist (e tbl)
       (setq re (concat "%-?[0-9.]*" (substring (car e) 1)))
       (when (and (cdr e) (string-match re (cdr e)))
         (let ((sref (substring (cdr e) (match-beginning 0) (match-end 0)))
@@ -22059,7 +22069,7 @@ This works in the calendar and in the agenda, anywhere 
else it just
 returns the current time.
 If WITH-TIME is non-nil, returns the time of the event at point (in
 the agenda) or the current time of the day."
-  (let (date day defd tp tm hod mod)
+  (let (date day defd tp hod mod)
     (when with-time
       (setq tp (get-text-property (point) 'time))
       (when (and tp (string-match "\\([0-9][0-9]\\):\\([0-9][0-9]\\)" tp))
@@ -22590,7 +22600,7 @@ If the line is empty, insert comment at its beginning."
   (insert "# "))
 
 (defvar comment-empty-lines)           ; From newcomment.el.
-(defun org-comment-or-uncomment-region (beg end &rest ignore)
+(defun org-comment-or-uncomment-region (beg end &rest _)
   "Comment or uncomment each non-blank line in the region.
 Uncomment each non-blank line between BEG and END if it only
 contains commented lines.  Otherwise, comment them."
@@ -22782,6 +22792,10 @@ this line is also exported in fixed-width font."
          (goto-char (match-end 0))
          (insert org-quote-string " ")))))))
 
+(defvar reftex-docstruct-symbol)
+(defvar reftex-cite-format)
+(defvar org--rds)
+
 (defun org-reftex-citation ()
   "Use reftex-citation to insert a citation into the buffer.
 This looks for a line like
@@ -22796,9 +22810,9 @@ into the buffer.
 Export of such citations to both LaTeX and HTML is handled by the contributed
 package ox-bibtex by Taru Karttunen."
   (interactive)
-  (let ((reftex-docstruct-symbol 'rds)
+  (let ((reftex-docstruct-symbol 'org--rds)
        (reftex-cite-format "\\cite{%l}")
-       rds bib)
+       org--rds bib)
     (save-excursion
       (save-restriction
        (widen)
@@ -22809,7 +22823,7 @@ package ox-bibtex by Taru Karttunen."
                         (re-search-backward re nil t))))
              (error "No bibliography defined in file")
            (setq bib (concat (match-string 1) ".bib")
-                 rds (list (list 'bib bib)))))))
+                 org--rds (list (list 'bib bib)))))))
     (call-interactively 'reftex-citation)))
 
 ;;;; Functions extending outline functionality
@@ -22926,20 +22940,20 @@ the cursor is already beyond the end of the headline."
 (define-key org-mode-map "\C-a" 'org-beginning-of-line)
 (define-key org-mode-map "\C-e" 'org-end-of-line)
 
-(defun org-backward-sentence (&optional arg)
+(defun org-backward-sentence (&optional _arg)
   "Go to beginning of sentence, or beginning of table field.
 This will call `backward-sentence' or `org-table-beginning-of-field',
 depending on context."
-  (interactive "P")
+  (interactive)
   (cond
    ((org-at-table-p) (call-interactively 'org-table-beginning-of-field))
    (t (call-interactively 'backward-sentence))))
 
-(defun org-forward-sentence (&optional arg)
+(defun org-forward-sentence (&optional _arg)
   "Go to end of sentence, or end of table field.
 This will call `forward-sentence' or `org-table-end-of-field',
 depending on context."
-  (interactive "P")
+  (interactive)
   (cond
    ((org-at-table-p) (call-interactively 'org-table-end-of-field))
    (t (call-interactively 'forward-sentence))))
@@ -22947,9 +22961,9 @@ depending on context."
 (define-key org-mode-map "\M-a" 'org-backward-sentence)
 (define-key org-mode-map "\M-e" 'org-forward-sentence)
 
-(defun org-kill-line (&optional arg)
+(defun org-kill-line (&optional _arg)
   "Kill line, to tags or end of line."
-  (interactive "P")
+  (interactive)
   (cond
    ((or (not org-special-ctrl-k)
        (bolp)
diff --git a/lisp/org/ox-latex.el b/lisp/org/ox-latex.el
index 98023a4..bfc860a 100644
--- a/lisp/org/ox-latex.el
+++ b/lisp/org/ox-latex.el
@@ -2846,7 +2846,7 @@ Return PDF file name or an error if it couldn't be 
produced."
                                (file-name-directory full-name)
                              default-directory))
         errors)
-    (unless snippet (message (format "Processing LaTeX file %s..." texfile)))
+    (unless snippet (message "Processing LaTeX file %s..." texfile))
     (save-window-excursion
       (cond
        ;; A function is provided: Apply it.
diff --git a/lisp/org/ox-man.el b/lisp/org/ox-man.el
index 2b8348f..8b4ddc7 100644
--- a/lisp/org/ox-man.el
+++ b/lisp/org/ox-man.el
@@ -1190,7 +1190,7 @@ Return PDF file name or an error if it couldn't be 
produced."
                                (file-name-directory full-name)
                              default-directory))
          errors)
-    (message (format "Processing Groff file %s..." file))
+    (message "Processing Groff file %s..." file)
     (save-window-excursion
       (cond
        ;; A function is provided: Apply it.
diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el
index f1ef90e..a028142 100644
--- a/lisp/org/ox-odt.el
+++ b/lisp/org/ox-odt.el
@@ -1389,8 +1389,8 @@ original parsed data.  INFO is a plist holding export 
options."
         ((member styles-file-type '("odt" "ott"))
          (org-odt--zip-extract styles-file "styles.xml" org-odt-zip-dir)))))
      (t
-      (error (format "Invalid specification of styles.xml file: %S"
-                    org-odt-styles-file))))
+      (error "Invalid specification of styles.xml file: %S"
+             org-odt-styles-file)))
 
     ;; create a manifest entry for styles.xml
     (org-odt-create-manifest-file-entry "text/xml" "styles.xml")
diff --git a/lisp/org/ox-texinfo.el b/lisp/org/ox-texinfo.el
index 26f58ad..c77a239 100644
--- a/lisp/org/ox-texinfo.el
+++ b/lisp/org/ox-texinfo.el
@@ -1513,7 +1513,7 @@ Return INFO file name or an error if it couldn't be 
produced."
                                (file-name-directory full-name)
                              default-directory))
         errors)
-    (message (format "Processing Texinfo file %s..." file))
+    (message "Processing Texinfo file %s..." file)
     (save-window-excursion
       ;; Replace %b, %f and %o with appropriate values in each command
       ;; before applying it.  Output is redirected to "*Org INFO
diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el
index 877e5db..205189e 100644
--- a/lisp/play/dunnet.el
+++ b/lisp/play/dunnet.el
@@ -4,7 +4,7 @@
 
 ;; Author: Ron Schnell <address@hidden>
 ;; Created: 25 Jul 1992
-;; Version: 2.01
+;; Version: 2.02
 ;; Keywords: games
 
 ;; This file is part of GNU Emacs.
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index fd4bfb3..9e750a4 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -43,7 +43,23 @@
           load-path)))
     (load "cc-bytecomp" nil t)))
 
-(eval-when-compile (require 'cl)) ; was (cc-external-require 'cl).  ACM 
2005/11/29.
+(eval-and-compile
+  (defvar c--mapcan-status
+    (cond ((and (fboundp 'mapcan)
+               (subrp (symbol-function 'mapcan)))
+          ;; XEmacs
+          'mapcan)
+         ((locate-file "cl-lib.elc" load-path)
+          ;; Emacs >= 24.3
+          'cl-mapcan)
+         (t
+          ;; Emacs <= 24.2
+          nil))))
+
+(cc-external-require (if (eq c--mapcan-status 'cl-mapcan) 'cl-lib 'cl))
+; was (cc-external-require 'cl).  ACM 2005/11/29.
+; Changed from (eval-when-compile (require 'cl)) back to
+; cc-external-require, 2015-08-12.
 (cc-external-require 'regexp-opt)
 
 ;; Silence the compiler.
@@ -173,12 +189,47 @@ This variant works around bugs in `eval-when-compile' in 
various
 
   (put 'cc-eval-when-compile 'lisp-indent-hook 0))
 
-(eval-and-compile
-  (defalias 'c--macroexpand-all
-    (if (fboundp 'macroexpand-all)
-        'macroexpand-all 'cl-macroexpand-all)))
 
 ;;; Macros.
+(defmacro c--mapcan (fun liszt)
+  ;; CC Mode equivalent of `mapcan' which bridges the difference
+  ;; between the host [X]Emacsen."
+  ;; The motivation for this macro is to avoid the irritating message
+  ;; "function `mapcan' from cl package called at runtime" produced by Emacs.
+  (cond
+   ((eq c--mapcan-status 'mapcan)
+    `(mapcan ,fun ,liszt))
+   ((eq c--mapcan-status 'cl-mapcan)
+    `(cl-mapcan ,fun ,liszt))
+   (t
+    ;; Emacs <= 24.2.  It would be nice to be able to distinguish between
+    ;; compile-time and run-time use here.
+    `(apply 'nconc (mapcar ,fun ,liszt)))))
+
+(defmacro c--set-difference (liszt1 liszt2 &rest other-args)
+  ;; Macro to smooth out the renaming of `set-difference' in Emacs 24.3.
+  (if (eq c--mapcan-status 'cl-mapcan)
+      `(cl-set-difference ,liszt1 ,liszt2 ,@other-args)
+    `(set-difference ,liszt1 ,liszt2 ,@other-args)))
+
+(defmacro c--intersection (liszt1 liszt2 &rest other-args)
+  ;; Macro to smooth out the renaming of `intersection' in Emacs 24.3.
+  (if (eq c--mapcan-status 'cl-mapcan)
+      `(cl-intersection ,liszt1 ,liszt2 ,@other-args)
+    `(intersection ,liszt1 ,liszt2 ,@other-args)))
+
+(eval-and-compile
+  (defmacro c--macroexpand-all (form &optional environment)
+    ;; Macro to smooth out the renaming of `cl-macroexpand-all' in Emacs 24.3.
+    (if (eq c--mapcan-status 'cl-mapcan)
+       `(macroexpand-all ,form ,environment)
+      `(cl-macroexpand-all ,form ,environment)))
+
+  (defmacro c--delete-duplicates (cl-seq &rest cl-keys)
+    ;; Macro to smooth out the renaming of `delete-duplicates' in Emacs 24.3.
+    (if (eq c--mapcan-status 'cl-mapcan)
+       `(cl-delete-duplicates ,cl-seq ,@cl-keys)
+      `(delete-duplicates ,cl-seq ,@cl-keys))))
 
 (defmacro c-point (position &optional point)
   "Return the value of certain commonly referenced POSITIONs relative to POINT.
@@ -2228,12 +2279,12 @@ quoted."
                ;; are no file dependencies needed.
                (nreverse
                 ;; Reverse to get the right load order.
-                (apply 'nconc
-                       (mapcar (lambda (elem)
-                                 (if (eq file (car elem))
-                                     nil ; Exclude our own file.
-                                   (list (car elem))))
-                               (get sym 'source))))))
+               (c--mapcan (lambda (elem)
+                            (if (eq file (car elem))
+                                nil    ; Exclude our own file.
+                              (list (car elem))))
+                          (get sym 'source)))))
+
             ;; Make some effort to do a compact call to
             ;; `c-get-lang-constant' since it will be compiled in.
             (args (and mode `(',mode))))
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 06b03a2..f5285a6 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -154,12 +154,12 @@
 
 (defmacro c-declare-lang-variables ()
   `(progn
-     ,@(mapcan (lambda (init)
-                `(,(if (elt init 2)
-                       `(defvar ,(car init) nil ,(elt init 2))
-                     `(defvar ,(car init) nil))
-                  (make-variable-buffer-local ',(car init))))
-              (cdr c-lang-variable-inits))))
+     ,@(c--mapcan (lambda (init)
+                   `(,(if (elt init 2)
+                          `(defvar ,(car init) nil ,(elt init 2))
+                        `(defvar ,(car init) nil))
+                     (make-variable-buffer-local ',(car init))))
+                (cdr c-lang-variable-inits))))
 (c-declare-lang-variables)
 
 
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index ad564f7..02599e8 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -1140,6 +1140,7 @@ casts and declarations are fontified.  Used on level 2 
and higher."
                             (looking-at "{"))
                        (c-safe (c-forward-sexp) t) ; over { .... }
                      t)
+                   (< (point) limit)
                    ;; FIXME: Should look for c-decl-end markers here;
                    ;; we might go far into the following declarations
                    ;; in e.g. ObjC mode (see e.g. methods-4.m).
@@ -1957,19 +1958,18 @@ higher."
              (cdr-safe (or (assq c-buffer-is-cc-mode c-doc-comment-style)
                            (assq 'other c-doc-comment-style)))
            c-doc-comment-style))
-        (list (nconc (apply 'nconc
-                            (mapcar
-                             (lambda (doc-style)
-                               (let ((sym (intern
-                                           (concat (symbol-name doc-style)
-                                                   "-font-lock-keywords"))))
-                                 (cond ((fboundp sym)
-                                        (funcall sym))
-                                       ((boundp sym)
-                                        (append (eval sym) nil)))))
-                             (if (listp doc-keywords)
-                                 doc-keywords
-                               (list doc-keywords))))
+        (list (nconc (c--mapcan
+                      (lambda (doc-style)
+                        (let ((sym (intern
+                                    (concat (symbol-name doc-style)
+                                            "-font-lock-keywords"))))
+                          (cond ((fboundp sym)
+                                 (funcall sym))
+                                ((boundp sym)
+                                 (append (eval sym) nil)))))
+                      (if (listp doc-keywords)
+                          doc-keywords
+                        (list doc-keywords)))
                      base-list)))
 
     ;; Kludge: If `c-font-lock-complex-decl-prepare' is on the list we
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 07f5ef4..f971956 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -130,7 +130,7 @@
 
 
 ;; This file is not always loaded.  See note above.
-(cc-external-require 'cl)
+(cc-external-require (if (eq c--mapcan-status 'cl-mapcan) 'cl-lib 'cl))
 
 
 ;;; Setup for the `c-lang-defvar' system.
@@ -251,19 +251,19 @@ the evaluated constant value at compile time."
     (unless xlate
       (setq xlate 'identity))
     (c-with-syntax-table (c-lang-const c-mode-syntax-table)
-      (delete-duplicates
-       (mapcan (lambda (opgroup)
-                (when (if (symbolp (car opgroup))
-                          (when (funcall opgroup-filter (car opgroup))
-                            (setq opgroup (cdr opgroup))
-                            t)
-                        t)
-                  (mapcan (lambda (op)
-                            (when (funcall op-filter op)
-                              (let ((res (funcall xlate op)))
-                                (if (listp res) res (list res)))))
-                          opgroup)))
-              ops)
+      (c--delete-duplicates
+       (c--mapcan (lambda (opgroup)
+                   (when (if (symbolp (car opgroup))
+                             (when (funcall opgroup-filter (car opgroup))
+                               (setq opgroup (cdr opgroup))
+                               t)
+                           t)
+                     (c--mapcan (lambda (op)
+                                  (when (funcall op-filter op)
+                                    (let ((res (funcall xlate op)))
+                                      (if (listp res) res (list res)))))
+                                opgroup)))
+                 ops)
        :test 'equal))))
 
 
@@ -1165,9 +1165,9 @@ operators."
 (c-lang-defconst c-all-op-syntax-tokens
   ;; List of all tokens in the punctuation and parenthesis syntax
   ;; classes.
-  t (delete-duplicates (append (c-lang-const c-other-op-syntax-tokens)
-                              (c-lang-const c-operator-list))
-                      :test 'string-equal))
+  t (c--delete-duplicates (append (c-lang-const c-other-op-syntax-tokens)
+                                 (c-lang-const c-operator-list))
+                         :test 'string-equal))
 
 (c-lang-defconst c-nonsymbol-token-char-list
   ;; List containing all chars not in the word, symbol or
@@ -1204,9 +1204,9 @@ operators."
         "=\\([^=]\\|$\\)"
         "\\|"
         (c-make-keywords-re nil
-          (set-difference (c-lang-const c-assignment-operators)
-                          '("=")
-                          :test 'string-equal)))
+          (c--set-difference (c-lang-const c-assignment-operators)
+                             '("=")
+                             :test 'string-equal)))
       "\\<\\>"))
 (c-lang-defvar c-assignment-op-regexp
   (c-lang-const c-assignment-op-regexp))
@@ -1256,7 +1256,7 @@ operators."
   ;; multicharacter tokens that begin with ">" except for those beginning with
   ;; ">>".
   t (c-make-keywords-re nil
-      (set-difference
+      (c--set-difference
        (c-lang-const c->-op-cont-tokens)
        (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
                     t
@@ -1765,10 +1765,10 @@ not the type face."
 (c-lang-defconst c-type-start-kwds
   ;; All keywords that can start a type (i.e. are either a type prefix
   ;; or a complete type).
-  t (delete-duplicates (append (c-lang-const c-primitive-type-kwds)
-                              (c-lang-const c-type-prefix-kwds)
-                              (c-lang-const c-type-modifier-kwds))
-                      :test 'string-equal))
+  t (c--delete-duplicates (append (c-lang-const c-primitive-type-kwds)
+                                 (c-lang-const c-type-prefix-kwds)
+                                 (c-lang-const c-type-modifier-kwds))
+                         :test 'string-equal))
 
 (c-lang-defconst c-class-decl-kwds
   "Keywords introducing declarations where the following block (if any)
@@ -2030,16 +2030,16 @@ one of `c-type-list-kwds', `c-ref-list-kwds',
   ;; something is a type or just some sort of macro in front of the
   ;; declaration.  They might be ambiguous with types or type
   ;; prefixes.
-  t (delete-duplicates (append (c-lang-const c-class-decl-kwds)
-                              (c-lang-const c-brace-list-decl-kwds)
-                              (c-lang-const c-other-block-decl-kwds)
-                              (c-lang-const c-typedef-decl-kwds)
-                              (c-lang-const c-typeless-decl-kwds)
-                              (c-lang-const c-modifier-kwds)
-                              (c-lang-const c-other-decl-kwds)
-                              (c-lang-const c-decl-start-kwds)
-                              (c-lang-const c-decl-hangon-kwds))
-                      :test 'string-equal))
+  t (c--delete-duplicates (append (c-lang-const c-class-decl-kwds)
+                                 (c-lang-const c-brace-list-decl-kwds)
+                                 (c-lang-const c-other-block-decl-kwds)
+                                 (c-lang-const c-typedef-decl-kwds)
+                                 (c-lang-const c-typeless-decl-kwds)
+                                 (c-lang-const c-modifier-kwds)
+                                 (c-lang-const c-other-decl-kwds)
+                                 (c-lang-const c-decl-start-kwds)
+                                 (c-lang-const c-decl-hangon-kwds))
+                         :test 'string-equal))
 
 (c-lang-defconst c-prefix-spec-kwds-re
   ;; Adorned regexp of `c-prefix-spec-kwds'.
@@ -2052,10 +2052,10 @@ one of `c-type-list-kwds', `c-ref-list-kwds',
   ;; ambiguous with types or type prefixes.  These are the keywords (like
   ;; extern, namespace, but NOT template) that can modify a declaration.
   t (c-make-keywords-re t
-      (set-difference (c-lang-const c-prefix-spec-kwds)
-                     (append (c-lang-const c-type-start-kwds)
-                             (c-lang-const c-<>-arglist-kwds))
-                     :test 'string-equal)))
+      (c--set-difference (c-lang-const c-prefix-spec-kwds)
+                        (append (c-lang-const c-type-start-kwds)
+                                (c-lang-const c-<>-arglist-kwds))
+                        :test 'string-equal)))
 (c-lang-defvar c-specifier-key (c-lang-const c-specifier-key))
 
 (c-lang-defconst c-postfix-spec-kwds
@@ -2068,19 +2068,19 @@ one of `c-type-list-kwds', `c-ref-list-kwds',
   ;; Adorned regexp matching all keywords that can't appear at the
   ;; start of a declaration.
   t (c-make-keywords-re t
-      (set-difference (c-lang-const c-keywords)
-                     (append (c-lang-const c-type-start-kwds)
-                             (c-lang-const c-prefix-spec-kwds)
-                             (c-lang-const c-typeof-kwds))
-                     :test 'string-equal)))
+      (c--set-difference (c-lang-const c-keywords)
+                        (append (c-lang-const c-type-start-kwds)
+                                (c-lang-const c-prefix-spec-kwds)
+                                (c-lang-const c-typeof-kwds))
+                        :test 'string-equal)))
 (c-lang-defvar c-not-decl-init-keywords
   (c-lang-const c-not-decl-init-keywords))
 
 (c-lang-defconst c-not-primitive-type-keywords
   "List of all keywords apart from primitive types (like \"int\")."
-  t (set-difference (c-lang-const c-keywords)
-                   (c-lang-const c-primitive-type-kwds)
-                   :test 'string-equal)
+  t (c--set-difference (c-lang-const c-keywords)
+                      (c-lang-const c-primitive-type-kwds)
+                      :test 'string-equal)
   ;; The "more" for C++ is the QT keyword (as in "more slots:").
   ;; This variable is intended for use in c-beginning-of-statement-1.
   c++ (append (c-lang-const c-not-primitive-type-keywords) '("more")))
@@ -2224,9 +2224,9 @@ type identifiers separated by arbitrary tokens."
   pike '("array" "function" "int" "mapping" "multiset" "object" "program"))
 
 (c-lang-defconst c-paren-any-kwds
-  t (delete-duplicates (append (c-lang-const c-paren-nontype-kwds)
-                              (c-lang-const c-paren-type-kwds))
-                      :test 'string-equal))
+  t (c--delete-duplicates (append (c-lang-const c-paren-nontype-kwds)
+                                 (c-lang-const c-paren-type-kwds))
+                         :test 'string-equal))
 
 (c-lang-defconst c-<>-type-kwds
   "Keywords that may be followed by an angle bracket expression
@@ -2250,9 +2250,9 @@ assumed to be set if this isn't nil."
 
 (c-lang-defconst c-<>-sexp-kwds
   ;; All keywords that can be followed by an angle bracket sexp.
-  t (delete-duplicates (append (c-lang-const c-<>-type-kwds)
-                              (c-lang-const c-<>-arglist-kwds))
-                      :test 'string-equal))
+  t (c--delete-duplicates (append (c-lang-const c-<>-type-kwds)
+                                 (c-lang-const c-<>-arglist-kwds))
+                         :test 'string-equal))
 
 (c-lang-defconst c-opt-<>-sexp-key
   ;; Adorned regexp matching keywords that can be followed by an angle
@@ -2310,9 +2310,9 @@ Keywords here should also be in `c-block-stmt-1-kwds'."
 
 (c-lang-defconst c-block-stmt-kwds
   ;; Union of `c-block-stmt-1-kwds' and `c-block-stmt-2-kwds'.
-  t (delete-duplicates (append (c-lang-const c-block-stmt-1-kwds)
-                              (c-lang-const c-block-stmt-2-kwds))
-                      :test 'string-equal))
+  t (c--delete-duplicates (append (c-lang-const c-block-stmt-1-kwds)
+                                 (c-lang-const c-block-stmt-2-kwds))
+                         :test 'string-equal))
 
 (c-lang-defconst c-opt-block-stmt-key
   ;; Regexp matching the start of any statement that has a
@@ -2417,7 +2417,7 @@ This construct is \"<keyword> <expression> :\"."
 (c-lang-defconst c-expr-kwds
   ;; Keywords that can occur anywhere in expressions.  Built from
   ;; `c-primary-expr-kwds' and all keyword operators in `c-operators'.
-  t (delete-duplicates
+  t (c--delete-duplicates
      (append (c-lang-const c-primary-expr-kwds)
             (c-filter-ops (c-lang-const c-operator-list)
                           t
@@ -2468,12 +2468,12 @@ Note that Java specific rules are currently applied to 
tell this from
   t (let* ((decl-kwds (append (c-lang-const c-class-decl-kwds)
                              (c-lang-const c-other-block-decl-kwds)
                              (c-lang-const c-inexpr-class-kwds)))
-          (unambiguous (set-difference decl-kwds
-                                       (c-lang-const c-type-start-kwds)
-                                       :test 'string-equal))
-          (ambiguous (intersection decl-kwds
-                                   (c-lang-const c-type-start-kwds)
-                                   :test 'string-equal)))
+          (unambiguous (c--set-difference decl-kwds
+                                          (c-lang-const c-type-start-kwds)
+                                          :test 'string-equal))
+          (ambiguous (c--intersection decl-kwds
+                                      (c-lang-const c-type-start-kwds)
+                                      :test 'string-equal)))
       (if ambiguous
          (concat (c-make-keywords-re t unambiguous)
                  "\\|"
@@ -2521,7 +2521,7 @@ Note that Java specific rules are currently applied to 
tell this from
 
 (c-lang-defconst c-keywords
   ;; All keywords as a list.
-  t (delete-duplicates
+  t (c--delete-duplicates
      (c-lang-defconst-eval-immediately
       `(append ,@(mapcar (lambda (kwds-lang-const)
                           `(c-lang-const ,kwds-lang-const))
@@ -2585,6 +2585,7 @@ Note that Java specific rules are currently applied to 
tell this from
       (setplist (intern kwd obarray)
                ;; Emacs has an odd bug that causes `mapcan' to fail
                ;; with unintelligible errors.  (XEmacs works.)
+               ;; (2015-06-24): This bug has not yet been fixed.
                ;;(mapcan (lambda (lang-const)
                ;;            (list lang-const t))
                ;;          lang-const-list)
@@ -2597,10 +2598,10 @@ Note that Java specific rules are currently applied to 
tell this from
   ;; Adorned regexp matching all keywords that should be fontified
   ;; with the keywords face.  I.e. that aren't types or constants.
   t (c-make-keywords-re t
-      (set-difference (c-lang-const c-keywords)
-                     (append (c-lang-const c-primitive-type-kwds)
-                             (c-lang-const c-constant-kwds))
-                     :test 'string-equal)))
+      (c--set-difference (c-lang-const c-keywords)
+                        (append (c-lang-const c-primitive-type-kwds)
+                                (c-lang-const c-constant-kwds))
+                        :test 'string-equal)))
 (c-lang-defvar c-regular-keywords-regexp
   (c-lang-const c-regular-keywords-regexp))
 
@@ -2635,12 +2636,12 @@ Note that Java specific rules are currently applied to 
tell this from
                            right-assoc-sequence)
                          t))
 
-          (unambiguous-prefix-ops (set-difference nonkeyword-prefix-ops
-                                                  in-or-postfix-ops
-                                                  :test 'string-equal))
-          (ambiguous-prefix-ops (intersection nonkeyword-prefix-ops
-                                              in-or-postfix-ops
-                                              :test 'string-equal)))
+          (unambiguous-prefix-ops (c--set-difference nonkeyword-prefix-ops
+                                                     in-or-postfix-ops
+                                                     :test 'string-equal))
+          (ambiguous-prefix-ops (c--intersection nonkeyword-prefix-ops
+                                                 in-or-postfix-ops
+                                                 :test 'string-equal)))
 
       (concat
        "\\("
@@ -2648,14 +2649,14 @@ Note that Java specific rules are currently applied to 
tell this from
        ;; first submatch from them together with `c-primary-expr-kwds'.
        (c-make-keywords-re t
         (append (c-lang-const c-primary-expr-kwds)
-                (set-difference prefix-ops nonkeyword-prefix-ops
-                                :test 'string-equal)))
+                (c--set-difference prefix-ops nonkeyword-prefix-ops
+                                   :test 'string-equal)))
 
        "\\|"
        ;; Match all ambiguous operators.
        (c-make-keywords-re nil
-        (intersection nonkeyword-prefix-ops in-or-postfix-ops
-                      :test 'string-equal))
+        (c--intersection nonkeyword-prefix-ops in-or-postfix-ops
+                         :test 'string-equal))
        "\\)"
 
        "\\|"
@@ -2670,8 +2671,8 @@ Note that Java specific rules are currently applied to 
tell this from
        "\\|"
        ;; The unambiguous operators from `prefix-ops'.
        (c-make-keywords-re nil
-        (set-difference nonkeyword-prefix-ops in-or-postfix-ops
-                        :test 'string-equal))
+        (c--set-difference nonkeyword-prefix-ops in-or-postfix-ops
+                           :test 'string-equal))
 
        "\\|"
        ;; Match string and character literals.
@@ -2816,7 +2817,7 @@ possible for good performance."
 
   ;; Default to all chars that only occurs in nonsymbol tokens outside
   ;; identifiers.
-  t (set-difference
+  t (c--set-difference
      (c-lang-const c-nonsymbol-token-char-list)
      (c-filter-ops (append (c-lang-const c-identifier-ops)
                           (list (cons nil
@@ -2833,26 +2834,26 @@ possible for good performance."
 
   ;; Allow cpp operations (where applicable).
   t (if (c-lang-const c-opt-cpp-prefix)
-       (set-difference (c-lang-const c-block-prefix-disallowed-chars)
-                       '(?#))
+       (c--set-difference (c-lang-const c-block-prefix-disallowed-chars)
+                          '(?#))
       (c-lang-const c-block-prefix-disallowed-chars))
 
   ;; Allow ':' for inherit list starters.
-  (c++ objc idl) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
-                                '(?:))
+  (c++ objc idl) (c--set-difference (c-lang-const 
c-block-prefix-disallowed-chars)
+                                   '(?:))
 
   ;; Allow ',' for multiple inherits.
-  (c++ java) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
-                            '(?,))
+  (c++ java) (c--set-difference (c-lang-const c-block-prefix-disallowed-chars)
+                               '(?,))
 
   ;; Allow parentheses for anonymous inner classes in Java and class
   ;; initializer lists in Pike.
-  (java pike) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
-                             '(?\( ?\)))
+  (java pike) (c--set-difference (c-lang-const c-block-prefix-disallowed-chars)
+                                '(?\( ?\)))
 
   ;; Allow '"' for extern clauses (e.g. extern "C" {...}).
-  (c c++ objc) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
-                              '(?\" ?')))
+  (c c++ objc) (c--set-difference (c-lang-const 
c-block-prefix-disallowed-chars)
+                                 '(?\" ?')))
 
 (c-lang-defconst c-block-prefix-charset
   ;; `c-block-prefix-disallowed-chars' as an inverted charset suitable
@@ -3157,10 +3158,10 @@ i.e. before \":\".  Only used if 
`c-recognize-colon-labels' is set."
   t (concat
      ;; All keywords except `c-label-kwds' and `c-protection-kwds'.
      (c-make-keywords-re t
-       (set-difference (c-lang-const c-keywords)
-                      (append (c-lang-const c-label-kwds)
-                              (c-lang-const c-protection-kwds))
-                      :test 'string-equal)))
+       (c--set-difference (c-lang-const c-keywords)
+                         (append (c-lang-const c-label-kwds)
+                                 (c-lang-const c-protection-kwds))
+                         :test 'string-equal)))
   ;; Don't allow string literals, except in AWK.  Character constants are OK.
   (c objc java pike idl) (concat "\"\\|"
                                 (c-lang-const c-nonlabel-token-key))
@@ -3280,16 +3281,16 @@ accomplish that conveniently."
                             ;; `c-lang-const' will expand to the evaluated
                             ;; constant immediately in `c--macroexpand-all'
                             ;; below.
-                             (mapcan
+                             (c--mapcan
                               (lambda (init)
                                 `(current-var ',(car init)
-                                  ,(car init) ,(c--macroexpand-all
-                                                (elt init 1))))
+                                              ,(car init) ,(c--macroexpand-all
+                                                            (elt init 1))))
                               ;; Note: The following `append' copies the
                               ;; first argument.  That list is small, so
                               ;; this doesn't matter too much.
-                             (append (cdr c-emacs-variable-inits)
-                                     (cdr c-lang-variable-inits)))))
+                              (append (cdr c-emacs-variable-inits)
+                                      (cdr c-lang-variable-inits)))))
 
                 ;; This diagnostic message isn't useful for end
                 ;; users, so it's disabled.
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 9a44335..9d1d148 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1,4 +1,4 @@
-;;; compile.el --- run compiler as inferior of Emacs, parse error messages
+;;; compile.el --- run compiler as inferior of Emacs, parse error messages  
-*- lexical-binding:t -*-
 
 ;; Copyright (C) 1985-1987, 1993-1999, 2001-2015 Free Software
 ;; Foundation, Inc.
@@ -1109,7 +1109,9 @@ If SCREEN is non-nil, columns are screen columns, 
otherwise, they are
 just char-counts."
   (setq col (- col compilation-first-column))
   (if screen
-      (move-to-column (max col 0))
+      ;; Presumably, the compilation tool doesn't know about our current
+      ;; `tab-width' setting, so it probably assumed 8-wide TABs (bug#21038).
+      (let ((tab-width 8)) (move-to-column (max col 0)))
     (goto-char (min (+ (line-beginning-position) col) (line-end-position)))))
 
 (defun compilation-internal-error-properties (file line end-line col end-col 
type fmts)
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index b7ae3c7..6ad803d 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -28,6 +28,7 @@
 
 ;;; Code:
 
+(require 'cl-generic)
 (require 'lisp-mode)
 (eval-when-compile (require 'cl-lib))
 
@@ -441,6 +442,7 @@ It can be quoted, or be inside a quoted form."
          (string-match ".*$" doc)
          (match-string 0 doc))))
 
+;; can't (require 'find-func) in a preloaded file
 (declare-function find-library-name "find-func" (library))
 (declare-function find-function-library "find-func" (function &optional l-o v))
 
@@ -588,6 +590,10 @@ It can be quoted, or be inside a quoted form."
 
 (defun elisp-xref-find (action id)
   (require 'find-func)
+  ;; FIXME: use information in source near point to filter results:
+  ;; (dvc-log-edit ...) - exclude 'feature
+  ;; (require 'dvc-log-edit) - only 'feature
+  ;; Semantic may provide additional information
   (pcase action
     (`definitions
       (let ((sym (intern-soft id)))
@@ -598,60 +604,178 @@ It can be quoted, or be inside a quoted form."
     (`apropos
      (elisp--xref-find-apropos id))))
 
-(defun elisp--xref-identifier-location (type sym)
-  (let ((file
-         (pcase type
-           (`defun (when (fboundp sym)
-                     (let ((fun-lib
-                            (find-function-library sym)))
-                       (setq sym (car fun-lib))
-                       (cdr fun-lib))))
-           (`defvar (and (boundp sym)
-                         (let ((el-file (symbol-file sym 'defvar)))
-                           (if el-file
-                               (and
-                                ;; Don't show minor modes twice.
-                                ;; TODO: If TYPE ever becomes dependent on the
-                                ;; context, move this check outside.
-                                (not (and (fboundp sym)
-                                          (memq sym minor-mode-list)))
-                                el-file)
-                             (help-C-file-name sym 'var)))))
-           (`feature (and (featurep sym)
-                          ;; Skip when a function with the same name
-                          ;; is defined, because it's probably in the
-                          ;; same file.
-                          (not (fboundp sym))
-                          (ignore-errors
-                            (find-library-name (symbol-name sym)))))
-           (`defface (when (facep sym)
-                       (symbol-file sym 'defface))))))
-    (when file
-      (when (string-match-p "\\.elc\\'" file)
-        (setq file (substring file 0 -1)))
-      (xref-make-elisp-location sym type file))))
-
+;; WORKAROUND: This is nominally a constant, but the text properties
+;; are not preserved thru dump if use defconst.  See bug#21237.
 (defvar elisp--xref-format
   (let ((str "(%s %s)"))
     (put-text-property 1 3 'face 'font-lock-keyword-face str)
     (put-text-property 4 6 'face 'font-lock-function-name-face str)
     str))
 
+;; WORKAROUND: This is nominally a constant, but the text properties
+;; are not preserved thru dump if use defconst.  See bug#21237.
+(defvar elisp--xref-format-extra
+  (let ((str "(%s %s %s)"))
+    (put-text-property 1 3 'face 'font-lock-keyword-face str)
+    (put-text-property 4 6 'face 'font-lock-function-name-face str)
+    str))
+
+(defvar find-feature-regexp)
+
+(defun elisp--xref-make-xref (type symbol file &optional summary)
+  "Return an xref for TYPE SYMBOL in FILE.
+TYPE must be a type in 'find-function-regexp-alist' (use nil for
+'defun).  If SUMMARY is non-nil, use it for the summary;
+otherwise build the summary from TYPE and SYMBOL."
+  (xref-make (or summary
+                (format elisp--xref-format (or type 'defun) symbol))
+            (xref-make-elisp-location symbol type file)))
+
 (defun elisp--xref-find-definitions (symbol)
-  (save-excursion
-    (let (lst)
-      (dolist (type '(feature defface defvar defun))
-        (let ((loc
-               (condition-case err
-                   (elisp--xref-identifier-location type symbol)
-                 (error
-                  (xref-make-bogus-location (error-message-string err))))))
-          (when loc
-            (push
-             (xref-make (format elisp--xref-format type symbol)
-                        loc)
-             lst))))
-      lst)))
+  ;; The file name is not known when `symbol' is defined via interactive eval.
+  (let (xrefs)
+    ;; alphabetical by result type symbol
+
+    ;; FIXME: advised function; list of advice functions
+
+    ;; FIXME: aliased variable
+
+    (when (and (symbolp symbol)
+               (symbol-function symbol)
+              (symbolp (symbol-function symbol)))
+      ;; aliased function
+      (let* ((alias-symbol symbol)
+            (alias-file (symbol-file alias-symbol))
+            (real-symbol  (symbol-function symbol))
+            (real-file (find-lisp-object-file-name real-symbol 'defun)))
+
+       (when real-file
+         (push (elisp--xref-make-xref nil real-symbol real-file) xrefs))
+
+       (when alias-file
+         (push (elisp--xref-make-xref 'defalias alias-symbol alias-file) 
xrefs))))
+
+    (when (facep symbol)
+      (let ((file (find-lisp-object-file-name symbol 'defface)))
+       (when file
+         (push (elisp--xref-make-xref 'defface symbol file) xrefs))))
+
+    (when (fboundp symbol)
+      (let ((file (find-lisp-object-file-name symbol (symbol-function symbol)))
+           generic doc)
+       (when file
+         (cond
+          ((eq file 'C-source)
+            ;; First call to find-lisp-object-file-name for an object
+            ;; defined in C; the doc strings from the C source have
+            ;; not been loaded yet.  Second call will return "src/*.c"
+            ;; in file; handled by 't' case below.
+           (push (elisp--xref-make-xref nil symbol (help-C-file-name 
(symbol-function symbol) 'subr)) xrefs))
+
+           ((and (setq doc (documentation symbol t))
+                 ;; This doc string is defined in cl-macs.el cl-defstruct
+                 (string-match "Constructor for objects of type `\\(.*\\)'" 
doc))
+            ;; `symbol' is a name for the default constructor created by
+            ;; cl-defstruct, so return the location of the cl-defstruct.
+            (let* ((type-name (match-string 1 doc))
+                   (type-symbol (intern type-name))
+                   (file (find-lisp-object-file-name type-symbol 'define-type))
+                   (summary (format elisp--xref-format-extra
+                                    'cl-defstruct
+                                    (concat "(" type-name)
+                                    (concat "(:constructor " (symbol-name 
symbol) "))"))))
+              (push (elisp--xref-make-xref 'define-type type-symbol file 
summary) xrefs)
+              ))
+
+          ((setq generic (cl--generic symbol))
+            ;; A generic function. If there is a default method, it
+            ;; will appear in the method table, with no
+            ;; specializers.
+            ;;
+            ;; If the default method is declared by the cl-defgeneric
+            ;; declaration, it will have the same location as the
+            ;; cl-defgeneric, so we want to exclude it from the
+            ;; result. In this case, it will have a null doc
+            ;; string. User declarations of default methods may also
+            ;; have null doc strings, but we hope that is
+            ;; rare. Perhaps this heuristic will discourage that.
+           (dolist (method (cl--generic-method-table generic))
+             (let* ((info (cl--generic-method-info method));; qual-string 
combined-args doconly
+                     (specializers (cl--generic-method-specializers method))
+                    (met-name (cons symbol specializers))
+                    (file (find-lisp-object-file-name met-name 'cl-defmethod)))
+               (when (and file
+                           (or specializers   ;; default method has null 
specializers
+                               (nth 2 info))) ;; assuming only co-located 
default has null doc string
+                  (if specializers
+                      (let ((summary (format elisp--xref-format-extra 
'cl-defmethod symbol (nth 1 info))))
+                        (push (elisp--xref-make-xref 'cl-defmethod met-name 
file summary) xrefs))
+
+                    (let ((summary (format elisp--xref-format-extra 
'cl-defmethod symbol "()")))
+                      (push (elisp--xref-make-xref 'cl-defmethod met-name file 
summary) xrefs))))
+               ))
+
+            (if (and (setq doc (documentation symbol t))
+                     ;; This doc string is created somewhere in
+                     ;; cl--generic-make-function for an implicit
+                     ;; defgeneric.
+                     (string-match "\n\n(fn ARG &rest ARGS)" doc))
+                ;; This symbol is an implicitly defined defgeneric, so
+                ;; don't return it.
+                nil
+              (push (elisp--xref-make-xref 'cl-defgeneric symbol file) xrefs))
+           )
+
+          (t
+           (push (elisp--xref-make-xref nil symbol file) xrefs))
+          ))))
+
+    (when (boundp symbol)
+      ;; A variable
+      (let ((file (find-lisp-object-file-name symbol 'defvar)))
+       (when file
+          (cond
+           ((eq file 'C-source)
+            ;; The doc strings from the C source have not been loaded
+            ;; yet; help-C-file-name does that.  Second call will
+            ;; return "src/*.c" in file; handled below.
+            (push (elisp--xref-make-xref 'defvar symbol (help-C-file-name 
symbol 'var)) xrefs))
+
+           ((string= "src/" (substring file 0 4))
+            ;; The variable is defined in a C source file; don't check
+            ;; for define-minor-mode.
+            (push (elisp--xref-make-xref 'defvar symbol file) xrefs))
+
+           ((memq symbol minor-mode-list)
+            ;; The symbol is a minor mode. These should be defined by
+            ;; "define-minor-mode", which means the variable and the
+            ;; function are declared in the same place. So we return only
+            ;; the function, arbitrarily.
+            ;;
+            ;; There is an exception, when the variable is defined in C
+            ;; code, as for abbrev-mode.
+            ;;
+            ;; IMPROVEME: If the user is searching for the identifier at
+            ;; point, we can determine whether it is a variable or
+            ;; function by looking at the source code near point.
+            ;;
+            ;; IMPROVEME: The user may actually be asking "do any
+            ;; variables by this name exist"; we need a way to specify
+            ;; that.
+            nil)
+
+           (t
+            (push (elisp--xref-make-xref 'defvar symbol file) xrefs))
+
+           ))))
+
+    (when (featurep symbol)
+      (let ((file (ignore-errors
+                   (find-library-name (symbol-name symbol)))))
+       (when file
+         (push (elisp--xref-make-xref 'feature symbol file) xrefs))))
+
+    xrefs))
 
 (declare-function project-search-path "project")
 (declare-function project-current "project")
@@ -689,13 +813,7 @@ It can be quoted, or be inside a quoted form."
 
 (cl-defmethod xref-location-marker ((l xref-elisp-location))
   (pcase-let (((cl-struct xref-elisp-location symbol type file) l))
-    (let ((buffer-point
-           (pcase type
-             (`defun (find-function-search-for-symbol symbol nil file))
-             ((or `defvar `defface)
-              (find-function-search-for-symbol symbol type file))
-             (`feature
-              (cons (find-file-noselect file) 1)))))
+    (let ((buffer-point (find-function-search-for-symbol symbol type file)))
       (with-current-buffer (car buffer-point)
         (goto-char (or (cdr buffer-point) (point-min)))
         (point-marker)))))
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index d849f93..186840a 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -22,6 +22,10 @@
 ;; This file contains generic infrastructure for dealing with
 ;; projects, and a number of public functions: finding the current
 ;; root, related project directories, search path, etc.
+;;
+;; The goal is to make it easy for Lisp programs to operate on the
+;; current project, without having to know which package handles
+;; detection of that project type, parsing its config files, etc.
 
 ;;; Code:
 
@@ -93,6 +97,21 @@ an element of `project-search-path'."
     vc-directory-exclusion-list)
    grep-find-ignored-files))
 
+(defgroup project-vc nil
+  "Project implementation using the VC package."
+  :group 'tools)
+
+(defcustom project-vc-search-path nil
+  "List ot directories to include in `project-search-path'.
+The file names can be absolute, or relative to the project root."
+  :type '(repeat file)
+  :safe 'listp)
+
+(defcustom project-vc-ignores nil
+  "List ot patterns to include in `project-ignores'."
+  :type '(repeat string)
+  :safe 'listp)
+
 (defun project-try-vc (dir)
   (let* ((backend (ignore-errors (vc-responsible-backend dir)))
          (root (and backend (ignore-errors
@@ -102,10 +121,18 @@ an element of `project-search-path'."
 (cl-defmethod project-roots ((project (head vc)))
   (list (cdr project)))
 
+(cl-defmethod project-search-path ((project (head vc)))
+  (append
+   (let ((root (cdr project)))
+     (mapcar
+      (lambda (dir) (expand-file-name dir root))
+      (project--value-in-dir 'project-vc-search-path root)))
+   (cl-call-next-method)))
+
 (cl-defmethod project-ignores ((project (head vc)) dir)
-  (nconc
-   (let* ((root (cdr project))
+  (let* ((root (cdr project))
           backend)
+    (append
      (when (file-equal-p dir root)
        (setq backend (vc-responsible-backend root))
        (mapcar
@@ -113,8 +140,9 @@ an element of `project-search-path'."
           (if (string-match "\\`/" entry)
               (replace-match "./" t t entry)
             entry))
-        (vc-call-backend backend 'ignore-completion-table root))))
-   (cl-call-next-method)))
+        (vc-call-backend backend 'ignore-completion-table root)))
+     (project--value-in-dir 'project-vc-ignores root)
+     (cl-call-next-method))))
 
 (defun project-ask-user (dir)
   (cons 'user (read-directory-name "Project root: " dir nil t)))
@@ -138,5 +166,11 @@ an element of `project-search-path'."
         (setq ref (cdr ref))))
     (cl-delete-if-not #'file-exists-p dirs)))
 
+(defun project--value-in-dir (var dir)
+  (with-temp-buffer
+    (setq default-directory dir)
+    (hack-dir-local-variables-non-file-buffer)
+    (symbol-value var)))
+
 (provide 'project)
 ;;; project.el ends here
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 2d95345..b95c3f9 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -2305,7 +2305,7 @@ In effect it sets the `fill-prefix' when inside comments 
and then calls
     (pop-to-buffer nil)
     (Info-goto-node prolog-info-predicate-index)
     (if (not (re-search-forward str nil t))
-        (error (format "Help on predicate `%s' not found." predicate)))
+        (error "Help on predicate `%s' not found." predicate))
 
     (setq oldp (point))
     (if (re-search-forward str nil t)
@@ -2975,7 +2975,7 @@ Return the final point or nil if no such a beginning was 
found."
   (let* ((pinfo (prolog-clause-info))
          (predname (nth 0 pinfo))
          (arity (nth 1 pinfo)))
-    (message (format "%s/%d" predname arity))))
+    (message "%s/%d" predname arity)))
 
 (defun prolog-insert-predicate-template ()
   "Insert the template for the current clause."
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 95814fa..0b7b9b7 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -282,6 +282,18 @@
   :version "24.3"
   :link '(emacs-commentary-link "python"))
 
+
+;;; 24.x Compat
+
+
+(unless (fboundp 'prog-widen)
+  (defun prog-widen ()
+    (widen)))
+
+(unless (fboundp 'prog-first-column)
+  (defun prog-first-column ()
+    0))
+
 
 ;;; Bindings
 
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 21ad102..5d59a56 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1178,9 +1178,7 @@ delimiter."
           (setq in-string (match-end 0))
           (goto-char ruby-indent-point)))
        (t
-        (error (format "Bad string %s"
-                       (buffer-substring (point) pnt)
-                       ))))))
+        (error "Bad string %s" (buffer-substring (point) pnt))))))
   (list in-string nest depth pcol))
 
 (defun ruby-parse-region (start end)
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 6709e75..735c8f9 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1675,7 +1675,7 @@ with your script for an edit-interpret-debug cycle."
          ((string-match "[.]sh\\>"     buffer-file-name) "sh")
          ((string-match "[.]bash\\>"   buffer-file-name) "bash")
          ((string-match "[.]ksh\\>"    buffer-file-name) "ksh")
-         ((string-match "[.]csh\\>"    buffer-file-name) "csh")
+         ((string-match "[.]t?csh\\(rc\\)?\\>" buffer-file-name) "csh")
         ((equal (file-name-nondirectory buffer-file-name) ".profile") "sh")
          (t sh-shell-file))
    nil nil)
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index 11b7561..3ce185f 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -77,8 +77,8 @@
 ;; the following in code (please un comment it first!) in your
 ;; .emacs, or in your site's site-load.el
 
-; (autoload 'verilog-mode "verilog-mode" "Verilog mode" t )
-; (add-to-list 'auto-mode-alist '("\\.[ds]?vh?\\'" . verilog-mode))
+;;   (autoload 'verilog-mode "verilog-mode" "Verilog mode" t )
+;;   (add-to-list 'auto-mode-alist '("\\.[ds]?vh?\\'" . verilog-mode))
 
 ;; Be sure to examine at the help for verilog-auto, and the other
 ;; verilog-auto-* functions for some major coding time savers.
@@ -92,38 +92,38 @@
 ;; in Local Variables in every file.  Otherwise, different people's
 ;; AUTO expansion may result different whitespace changes.
 ;;
-; ;; Enable syntax highlighting of **all** languages
-; (global-font-lock-mode t)
-;
-; ;; User customization for Verilog mode
-; (setq verilog-indent-level             3
-;       verilog-indent-level-module      3
-;       verilog-indent-level-declaration 3
-;       verilog-indent-level-behavioral  3
-;       verilog-indent-level-directive   1
-;       verilog-case-indent              2
-;       verilog-auto-newline             t
-;       verilog-auto-indent-on-newline   t
-;       verilog-tab-always-indent        t
-;       verilog-auto-endcomments         t
-;       verilog-minimum-comment-distance 40
-;       verilog-indent-begin-after-if    t
-;       verilog-auto-lineup              'declarations
-;       verilog-highlight-p1800-keywords nil
-;       verilog-linter                  "my_lint_shell_command"
-;       )
-
-;; 
+;;   ;; Enable syntax highlighting of **all** languages
+;;   (global-font-lock-mode t)
+;;
+;;   ;; User customization for Verilog mode
+;;   (setq verilog-indent-level             3
+;;         verilog-indent-level-module      3
+;;         verilog-indent-level-declaration 3
+;;         verilog-indent-level-behavioral  3
+;;         verilog-indent-level-directive   1
+;;         verilog-case-indent              2
+;;         verilog-auto-newline             t
+;;         verilog-auto-indent-on-newline   t
+;;         verilog-tab-always-indent        t
+;;         verilog-auto-endcomments         t
+;;         verilog-minimum-comment-distance 40
+;;         verilog-indent-begin-after-if    t
+;;         verilog-auto-lineup              'declarations
+;;         verilog-highlight-p1800-keywords nil
+;;         verilog-linter                   "my_lint_shell_command"
+;;         )
 
+
 ;;; History:
 ;;
 ;; See commit history at http://www.veripool.org/verilog-mode.html
 ;; (This section is required to appease checkdoc.)
 
 ;;; Code:
+;;
 
 ;; This variable will always hold the version number of the mode
-(defconst verilog-mode-version "2015-05-14-6232468-vpo-GNU"
+(defconst verilog-mode-version "2015-08-16-ce03c7a-vpo-GNU"
   "Version of this Verilog mode.")
 (defconst verilog-mode-release-emacs t
   "If non-nil, this version of Verilog mode was released with Emacs itself.")
@@ -150,36 +150,36 @@
       (error nil))
     (condition-case nil
         (if (fboundp 'when)
-            nil ;; fab
+            nil  ; fab
           (defmacro when (cond &rest body)
             (list 'if cond (cons 'progn body))))
       (error nil))
     (condition-case nil
         (if (fboundp 'unless)
-            nil ;; fab
+            nil  ; fab
           (defmacro unless (cond &rest body)
             (cons 'if (cons cond (cons nil body)))))
       (error nil))
     (condition-case nil
         (if (fboundp 'store-match-data)
-            nil ;; fab
+            nil  ; fab
           (defmacro store-match-data (&rest _args) nil))
       (error nil))
     (condition-case nil
         (if (fboundp 'char-before)
-            nil ;; great
+            nil  ; great
           (defmacro char-before (&rest _body)
             (char-after (1- (point)))))
       (error nil))
     (condition-case nil
         (if (fboundp 'when)
-            nil ;; fab
+            nil  ; fab
           (defsubst point-at-bol (&optional N)
             (save-excursion (beginning-of-line N) (point))))
       (error nil))
     (condition-case nil
         (if (fboundp 'when)
-            nil ;; fab
+            nil  ; fab
           (defsubst point-at-eol (&optional N)
             (save-excursion (end-of-line N) (point))))
       (error nil))
@@ -188,7 +188,7 @@
       (error nil))
     (condition-case nil
         (if (fboundp 'match-string-no-properties)
-            nil ;; great
+            nil  ; great
           (defsubst match-string-no-properties (num &optional string)
             "Return string of text matched by last search, without text 
properties.
 NUM specifies which parenthesized expression in the last regexp.
@@ -208,7 +208,7 @@ STRING should be given if the last search was by 
`string-match' on STRING."
          )
       (error nil))
     (if (and (featurep 'custom) (fboundp 'custom-declare-variable))
-        nil ;; We've got what we needed
+        nil  ; We've got what we needed
       ;; We have the old custom-library, hack around it!
       (defmacro defgroup (&rest _args)  nil)
       (defmacro customize (&rest _args)
@@ -224,7 +224,7 @@ STRING should be given if the last search was by 
`string-match' on STRING."
       )
 
     (if (and (featurep 'custom) (fboundp 'customize-group))
-        nil ;; We've got what we needed
+        nil  ; We've got what we needed
       ;; We have an intermediate custom-library, hack around it!
       (defmacro customize-group (var &rest _args)
         `(customize ,var))
@@ -254,16 +254,16 @@ STRING should be given if the last search was by 
`string-match' on STRING."
           (if (fboundp 'function-max-args)
               (let ((args (function-max-args `regexp-opt)))
                 (cond
-                 ((eq args 3) ;; It takes 3
+                 ((eq args 3)  ; It takes 3
                   (condition-case nil  ; Hide this defun from emacses
-                                       ;with just a two input regexp
+                                        ; with just a two input regexp
                       (defun verilog-regexp-opt (a b)
                         "Deal with differing number of required arguments for  
`regexp-opt'.
          Call `regexp-opt' on A and B."
                         (regexp-opt a b t))
                     (error nil))
                   )
-                 ((eq args 2) ;; It takes 2
+                 ((eq args 2)  ; It takes 2
                   (defun verilog-regexp-opt (a b)
                     "Call `regexp-opt' on A and B."
                     (regexp-opt a b))
@@ -307,35 +307,35 @@ LIMIT.
 
 As a general recommendation, try to avoid using `looking-back'
 wherever possible, since it is slow."
-   (let ((start (point))
-         (pos
-          (save-excursion
-            (and (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)
-                 (point)))))
-     (if (and greedy pos)
-         (save-restriction
-           (narrow-to-region (point-min) start)
-           (while (and (> pos (point-min))
-                       (save-excursion
-                         (goto-char pos)
-                         (backward-char 1)
-                         (looking-at (concat "\\(?:"  regexp "\\)\\'"))))
-             (setq pos (1- pos)))
-           (save-excursion
-             (goto-char pos)
-             (looking-at (concat "\\(?:"  regexp "\\)\\'")))))
-     (not (null pos)))))))
+      (let ((start (point))
+            (pos
+             (save-excursion
+               (and (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit 
t)
+                    (point)))))
+        (if (and greedy pos)
+            (save-restriction
+              (narrow-to-region (point-min) start)
+              (while (and (> pos (point-min))
+                          (save-excursion
+                            (goto-char pos)
+                            (backward-char 1)
+                            (looking-at (concat "\\(?:"  regexp "\\)\\'"))))
+                (setq pos (1- pos)))
+              (save-excursion
+                (goto-char pos)
+                (looking-at (concat "\\(?:"  regexp "\\)\\'")))))
+        (not (null pos)))))))
 
 (eval-and-compile
   ;; Both xemacs and emacs
   (condition-case nil
-      (require 'diff) ;; diff-command and diff-switches
+      (require 'diff)  ; diff-command and diff-switches
     (error nil))
   (condition-case nil
-      (require 'compile) ;; compilation-error-regexp-alist-alist
+      (require 'compile)  ; compilation-error-regexp-alist-alist
     (error nil))
   (condition-case nil
-      (unless (fboundp 'buffer-chars-modified-tick)  ;; Emacs 22 added
+      (unless (fboundp 'buffer-chars-modified-tick)  ; Emacs 22 added
        (defmacro buffer-chars-modified-tick () (buffer-modified-tick)))
     (error nil))
   ;; Added in Emacs 24.1
@@ -356,7 +356,7 @@ wherever possible, since it is slow."
 (defun verilog-easy-menu-filter (menu)
   "Filter `easy-menu-define' MENU to support new features."
   (cond ((not (featurep 'xemacs))
-        menu) ;; GNU Emacs - passthru
+         menu)  ; GNU Emacs - passthru
        ;; XEmacs doesn't support :help.  Strip it.
        ;; Recursively filter the a submenu
        ((listp menu)
@@ -370,7 +370,7 @@ wherever possible, since it is slow."
               (setq out (vconcat out (vector (aref menu i)))
                     i (1+ i))))
           out))
-       (t menu))) ;; Default - ok
+        (t menu)))  ; Default - ok
 ;;(verilog-easy-menu-filter
 ;;  `("Verilog" ("MA" ["SAA" nil :help "Help SAA"] ["SAB" nil :help "Help 
SAA"])
 ;;     "----" ["MB" nil :help "Help MB"]))
@@ -439,10 +439,10 @@ Set `verilog-in-hooks' during this time, to assist AUTO 
caches."
   :version "22.2"
   :group 'languages)
 
-; (defgroup verilog-mode-fonts nil
-;   "Facilitates easy customization fonts used in Verilog source text"
-;   :link '(customize-apropos "font-lock-*" 'faces)
-;  :group 'verilog-mode)
+;; (defgroup verilog-mode-fonts nil
+;;   "Facilitates easy customization fonts used in Verilog source text"
+;;   :link '(customize-apropos "font-lock-*" 'faces)
+;;   :group 'verilog-mode)
 
 (defgroup verilog-mode-indent nil
   "Customize indentation and highlighting of Verilog source text."
@@ -736,7 +736,7 @@ file referenced.  If false, this is not supported."
 Set this to \"wire\" if the Verilog code uses \"\\=`default_nettype
 none\".  Note using \\=`default_nettype none isn't recommended practice; this
 mode is experimental."
-  :version "24.1"  ;; rev670
+  :version "24.1"  ; rev670
   :group 'verilog-mode-actions
   :type 'boolean)
 (put 'verilog-auto-declare-nettype 'safe-local-variable `stringp)
@@ -744,7 +744,7 @@ mode is experimental."
 (defcustom verilog-auto-wire-type nil
   "Non-nil specifies the data type to use with `verilog-auto-wire' etc.
 Set this to \"logic\" for SystemVerilog code, or use `verilog-auto-logic'."
-  :version "24.1"  ;; rev673
+  :version "24.1"  ; rev673
   :group 'verilog-mode-actions
   :type 'boolean)
 (put 'verilog-auto-wire-type 'safe-local-variable `stringp)
@@ -758,7 +758,7 @@ The name of the function or case will be set between the 
braces."
 
 (defcustom verilog-auto-delete-trailing-whitespace nil
   "Non-nil means to `delete-trailing-whitespace' in `verilog-auto'."
-  :version "24.1"  ;; rev703
+  :version "24.1"  ; rev703
   :group 'verilog-mode-actions
   :type 'boolean)
 (put 'verilog-auto-delete-trailing-whitespace 'safe-local-variable 
'verilog-booleanp)
@@ -827,8 +827,11 @@ Function takes three arguments, the original buffer, the
 difference buffer, and the point in original buffer with the
 first difference.")
 
-;;; Compile support
+;;; Compile support:
+;;
+
 (require 'compile)
+
 (defvar verilog-error-regexp-added nil)
 
 (defvar verilog-error-regexp-emacs-alist
@@ -1037,7 +1040,7 @@ If nil, all blocking assigned signals are ignored when any
 non-blocking assignment is in the AUTORESET block.  This allows
 blocking assignments to be used for temporary values and not have
 those temporaries reset.  See example in `verilog-auto-reset'."
-  :version "24.1"  ;; rev718
+  :version "24.1"  ; rev718
   :type 'boolean
   :group 'verilog-mode-auto)
 (put 'verilog-auto-reset-blocking-in-non 'safe-local-variable 
'verilog-booleanp)
@@ -1146,7 +1149,7 @@ declared together to remain together.  Sorted order 
reduces
 changes when declarations are moved around in a file.
 
 See also `verilog-auto-arg-sort'."
-  :version "24.1"  ;; rev688
+  :version "24.1"  ; rev688
   :group 'verilog-mode-auto
   :type 'boolean)
 (put 'verilog-auto-inst-sort 'safe-local-variable 'verilog-booleanp)
@@ -1186,7 +1189,7 @@ won't merge conflict."
 
 (defcustom verilog-auto-inst-interfaced-ports nil
   "Non-nil means include interfaced ports in AUTOINST expansions."
-  :version "24.3"  ;; rev773, default change rev815
+  :version "24.3"  ; rev773, default change rev815
   :group 'verilog-mode-auto
   :type 'boolean)
 (put 'verilog-auto-inst-interfaced-ports 'safe-local-variable 
'verilog-booleanp)
@@ -1215,7 +1218,7 @@ See the \\[verilog-faq] for examples on using this."
 (defcustom verilog-auto-template-warn-unused nil
   "Non-nil means report warning if an AUTO_TEMPLATE line is not used.
 This feature is not supported before Emacs 21.1 or XEmacs 21.4."
-  :version "24.3"  ;;rev787
+  :version "24.3"  ; rev787
   :group 'verilog-mode-auto
   :type 'boolean)
 (put 'verilog-auto-template-warn-unused 'safe-local-variable 'verilog-booleanp)
@@ -1224,7 +1227,7 @@ This feature is not supported before Emacs 21.1 or XEmacs 
21.4."
   "Data type used for the declaration for AUTOTIEOFF.
 If \"wire\" then create a wire, if \"assign\" create an
 assignment, else the data type for variable creation."
-  :version "24.1"  ;; rev713
+  :version "24.1"  ; rev713
   :group 'verilog-mode-auto
   :type 'string)
 (put 'verilog-auto-tieoff-declaration 'safe-local-variable 'stringp)
@@ -1296,13 +1299,13 @@ See also `verilog-case-fold'."
 
 (defcustom verilog-before-save-font-hook nil
   "Hook run before `verilog-save-font-mods' removes highlighting."
-  :version "24.3"  ;;rev735
+  :version "24.3"  ; rev735
   :group 'verilog-mode-auto
   :type 'hook)
 
 (defcustom verilog-after-save-font-hook nil
   "Hook run after `verilog-save-font-mods' restores highlighting."
-  :version "24.3"  ;;rev735
+  :version "24.3"  ; rev735
   :group 'verilog-mode-auto
   :type 'hook)
 
@@ -1330,13 +1333,16 @@ If set will become buffer local.")
 If set will become buffer local.")
 (make-variable-buffer-local 'verilog-project)
 
+;;; Keymap and Menu:
+;;
+
 (defvar verilog-mode-map
   (let ((map (make-sparse-keymap)))
     (define-key map ";"        'electric-verilog-semi)
     (define-key map [(control 59)]    'electric-verilog-semi-with-comment)
     (define-key map ":"        'electric-verilog-colon)
     ;;(define-key map "="        'electric-verilog-equal)
-    (define-key map "\`"       'electric-verilog-tick)
+    (define-key map "`"        'electric-verilog-tick)
     (define-key map "\t"       'electric-verilog-tab)
     (define-key map "\r"       'electric-verilog-terminate-line)
     ;; backspace/delete key bindings
@@ -1350,9 +1356,9 @@ If set will become buffer local.")
     (define-key map "\M-\t"    'verilog-complete-word)
     (define-key map "\M-?"     'verilog-show-completions)
     ;; Note \C-c and letter are reserved for users
-    (define-key map "\C-c\`"   'verilog-lint-off)
-    (define-key map "\C-c\*"   'verilog-delete-auto-star-implicit)
-    (define-key map "\C-c\?"   'verilog-diff-auto)
+    (define-key map "\C-c`"    'verilog-lint-off)
+    (define-key map "\C-c*"    'verilog-delete-auto-star-implicit)
+    (define-key map "\C-c?"    'verilog-diff-auto)
     (define-key map "\C-c\C-r" 'verilog-label-be)
     (define-key map "\C-c\C-i" 'verilog-pretty-declarations)
     (define-key map "\C-c="    'verilog-pretty-expr)
@@ -1697,7 +1703,7 @@ will break, as the o's continuously replace.  xa -> x 
works ok though."
 (defsubst verilog-re-search-forward (REGEXP BOUND NOERROR)
   ;; checkdoc-params: (REGEXP BOUND NOERROR)
   "Like `re-search-forward', but skips over match in comments or strings."
-  (let ((mdata '(nil nil)))  ;; So match-end will return nil if no matches 
found
+  (let ((mdata '(nil nil)))  ; So match-end will return nil if no matches found
     (while (and
            (re-search-forward REGEXP BOUND NOERROR)
            (setq mdata (match-data))
@@ -1713,7 +1719,7 @@ will break, as the o's continuously replace.  xa -> x 
works ok though."
 (defsubst verilog-re-search-backward (REGEXP BOUND NOERROR)
   ;; checkdoc-params: (REGEXP BOUND NOERROR)
   "Like `re-search-backward', but skips over match in comments or strings."
-  (let ((mdata '(nil nil)))  ;; So match-end will return nil if no matches 
found
+  (let ((mdata '(nil nil)))  ; So match-end will return nil if no matches found
     (while (and
            (re-search-backward REGEXP BOUND NOERROR)
            (setq mdata (match-data))
@@ -1735,7 +1741,7 @@ so there may be a large up front penalty for the first 
search."
     (while (and (not pt)
                (re-search-forward regexp bound noerror))
       (if (verilog-inside-comment-or-string-p)
-         (re-search-forward "[/\"\n]" nil t) ;; Only way a comment or quote 
can end
+          (re-search-forward "[/\"\n]" nil t)  ; Only way a comment or quote 
can end
        (setq pt (match-end 0))))
     pt))
 
@@ -1749,7 +1755,7 @@ so there may be a large up front penalty for the first 
search."
     (while (and (not pt)
                (re-search-backward regexp bound noerror))
       (if (verilog-inside-comment-or-string-p)
-         (re-search-backward "[/\"]" nil t) ;; Only way a comment or quote can 
begin
+          (re-search-backward "[/\"]" nil t)  ; Only way a comment or quote 
can begin
        (setq pt (match-beginning 0))))
     pt))
 
@@ -1771,7 +1777,7 @@ This speeds up complicated regexp matches."
        (setq done nil)))
     (when done (goto-char done))
     done))
-;;(verilog-re-search-forward-substr "-end" "get-end-of" nil t) ;;-end (test 
bait)
+;;(verilog-re-search-forward-substr "-end" "get-end-of" nil t)  ; -end (test 
bait)
 
 (defsubst verilog-re-search-backward-substr (substr regexp bound noerror)
   "Like `re-search-backward', but first search for SUBSTR constant.
@@ -1791,7 +1797,7 @@ This speeds up complicated regexp matches."
        (setq done nil)))
     (when done (goto-char done))
     done))
-;;(verilog-re-search-backward-substr "-end" "get-end-of" nil t) ;;-end (test 
bait)
+;;(verilog-re-search-backward-substr "-end" "get-end-of" nil t)  ; -end (test 
bait)
 
 (defun verilog-delete-trailing-whitespace ()
   "Delete trailing spaces or tabs, but not newlines nor linefeeds.
@@ -1803,13 +1809,13 @@ To call on \\[verilog-auto], set 
`verilog-auto-delete-trailing-whitespace'."
   ;; Similar to `delete-trailing-whitespace' but that's not present in XEmacs
   (save-excursion
     (goto-char (point-min))
-    (while (re-search-forward "[ \t]+$" nil t)  ;; Not syntactic WS as no 
formfeed
+    (while (re-search-forward "[ \t]+$" nil t)  ; Not syntactic WS as no 
formfeed
       (replace-match "" nil nil))
     (goto-char (point-max))
     (unless (bolp) (insert "\n"))))
 
 (defvar compile-command)
-(defvar create-lockfiles)  ;; Emacs 24
+(defvar create-lockfiles)  ; Emacs 24
 
 ;; compilation program
 (defun verilog-set-compile-command ()
@@ -1867,7 +1873,7 @@ be substituted."
                 t t command))
   (setq command        (verilog-string-replace-matches
                 "\\b__FILE__\\b" (file-name-nondirectory
-                                  (or (buffer-file-name) ""))
+                                 (or (buffer-file-name) ""))
                 t t command))
   command)
 
@@ -1908,35 +1914,34 @@ find the errors."
 
 ;; Following code only gets called from compilation-mode-hook on Emacs to add 
error handling.
 (defun verilog-error-regexp-add-emacs ()
-   "Tell Emacs compile that we are Verilog.
+  "Tell Emacs compile that we are Verilog.
 Called by `compilation-mode-hook'.  This allows \\[next-error] to
 find the errors."
-   (interactive)
-   (if (boundp 'compilation-error-regexp-alist-alist)
-       (progn
-         (if (not (assoc 'verilog-xl-1 compilation-error-regexp-alist-alist))
-             (mapcar
-              (lambda (item)
-                (push (car item) compilation-error-regexp-alist)
-                (push item compilation-error-regexp-alist-alist)
-                )
-              verilog-error-regexp-emacs-alist)))))
+  (interactive)
+  (when (boundp 'compilation-error-regexp-alist-alist)
+    (when (not (assoc 'verilog-xl-1 compilation-error-regexp-alist-alist))
+      (mapcar
+       (lambda (item)
+         (push (car item) compilation-error-regexp-alist)
+         (push item compilation-error-regexp-alist-alist))
+       verilog-error-regexp-emacs-alist))))
 
 (if (featurep 'xemacs) (add-hook 'compilation-mode-hook 
'verilog-error-regexp-add-xemacs))
 (if (featurep 'emacs) (add-hook 'compilation-mode-hook 
'verilog-error-regexp-add-emacs))
 
 (defconst verilog-compiler-directives
   (eval-when-compile
-    '( ;; compiler directives, from IEEE 1800-2012 section 22.1
-    "`__FILE__" "`__LINE" "`begin_keywords" "`celldefine" "`default_nettype"
-    "`define" "`else" "`elsif" "`end_keywords" "`endcelldefine" "`endif"
-    "`ifdef" "`ifndef" "`include" "`line" "`nounconnected_drive" "`pragma"
-    "`resetall" "`timescale" "`unconnected_drive" "`undef" "`undefineall"
-     ;; compiler directives not covered by IEEE 1800
-     "`case" "`default" "`endfor" "`endprotect" "`endswitch" "`endwhile" "`for"
-     "`format" "`if" "`let" "`protect" "`switch" "`timescale" "`time_scale"
-     "`while"
-     ))
+    '(
+      ;; compiler directives, from IEEE 1800-2012 section 22.1
+      "`__FILE__" "`__LINE" "`begin_keywords" "`celldefine" "`default_nettype"
+      "`define" "`else" "`elsif" "`end_keywords" "`endcelldefine" "`endif"
+      "`ifdef" "`ifndef" "`include" "`line" "`nounconnected_drive" "`pragma"
+      "`resetall" "`timescale" "`unconnected_drive" "`undef" "`undefineall"
+      ;; compiler directives not covered by IEEE 1800
+      "`case" "`default" "`endfor" "`endprotect" "`endswitch" "`endwhile" 
"`for"
+      "`format" "`if" "`let" "`protect" "`switch" "`timescale" "`time_scale"
+      "`while"
+      ))
   "List of Verilog compiler directives.")
 
 (defconst verilog-directive-re
@@ -2028,10 +2033,10 @@ find the errors."
   (eval-when-compile
     (verilog-regexp-opt
      '(
-;;       "`vmm_xactor_member_enum_array"
        
"`vmm_\\(data\\|env\\|scenario\\|subenv\\|xactor\\)_member_\\(scalar\\|string\\|enum\\|vmm_data\\|channel\\|xactor\\|subenv\\|user_defined\\)\\(_array\\)?"
-;;       "`vmm_xactor_member_scalar_array"
-;;       "`vmm_xactor_member_scalar"
+       ;; "`vmm_xactor_member_enum_array"
+       ;; "`vmm_xactor_member_scalar_array"
+       ;; "`vmm_xactor_member_scalar"
        ) nil )))
 
 (defconst verilog-ovm-statement-re
@@ -2158,9 +2163,9 @@ find the errors."
        "`uvm_component_utils"
        "`uvm_create"
        "`uvm_create_on"
-       "`uvm_create_seq"               ;; Undocumented in 1.1
+       "`uvm_create_seq"                ; Undocumented in 1.1
        "`uvm_declare_p_sequencer"
-       "`uvm_declare_sequence_lib"     ;; Deprecated in 1.1
+       "`uvm_declare_sequence_lib"      ; Deprecated in 1.1
        "`uvm_do"
        "`uvm_do_callbacks"
        "`uvm_do_callbacks_exit_on"
@@ -2172,8 +2177,8 @@ find the errors."
        "`uvm_do_on_with"
        "`uvm_do_pri"
        "`uvm_do_pri_with"
-       "`uvm_do_seq"                   ;; Undocumented in 1.1
-       "`uvm_do_seq_with"              ;; Undocumented in 1.1
+       "`uvm_do_seq"                    ; Undocumented in 1.1
+       "`uvm_do_seq_with"               ; Undocumented in 1.1
        "`uvm_do_with"
        "`uvm_error"
        "`uvm_error_context"
@@ -2215,14 +2220,14 @@ find the errors."
        "`uvm_field_sarray_string"
        "`uvm_field_string"
        "`uvm_field_utils"
-       "`uvm_file"             ;; Undocumented in 1.1, use `__FILE__
+       "`uvm_file"              ; Undocumented in 1.1, use `__FILE__
        "`uvm_get_imp_decl"
        "`uvm_get_peek_imp_decl"
        "`uvm_info"
        "`uvm_info_context"
-       "`uvm_line"             ;; Undocumented in 1.1, use `__LINE__
+       "`uvm_line"              ; Undocumented in 1.1, use `__LINE__
        "`uvm_master_imp_decl"
-       "`uvm_non_blocking_transport_imp_decl"  ;; Deprecated in 1.1
+       "`uvm_non_blocking_transport_imp_decl"   ; Deprecated in 1.1
        "`uvm_nonblocking_get_imp_decl"
        "`uvm_nonblocking_get_peek_imp_decl"
        "`uvm_nonblocking_master_imp_decl"
@@ -2232,7 +2237,7 @@ find the errors."
        "`uvm_nonblocking_transport_imp_decl"
        "`uvm_object_param_utils"
        "`uvm_object_registry"
-       "`uvm_object_registry_param"    ;; Undocumented in 1.1
+       "`uvm_object_registry_param"     ; Undocumented in 1.1
        "`uvm_object_utils"
        "`uvm_pack_array"
        "`uvm_pack_arrayN"
@@ -2257,7 +2262,7 @@ find the errors."
        "`uvm_register_cb"
        "`uvm_send"
        "`uvm_send_pri"
-       "`uvm_sequence_utils"           ;; Deprecated in 1.1
+       "`uvm_sequence_utils"            ; Deprecated in 1.1
        "`uvm_set_super_type"
        "`uvm_slave_imp_decl"
        "`uvm_transport_imp_decl"
@@ -2273,8 +2278,8 @@ find the errors."
        "`uvm_unpack_sarray"
        "`uvm_unpack_sarrayN"
        "`uvm_unpack_string"
-       "`uvm_update_sequence_lib"              ;; Deprecated in 1.1
-       "`uvm_update_sequence_lib_and_item"     ;; Deprecated in 1.1
+       "`uvm_update_sequence_lib"               ; Deprecated in 1.1
+       "`uvm_update_sequence_lib_and_item"      ; Deprecated in 1.1
        "`uvm_warning"
        "`uvm_warning_context") nil )))
 
@@ -2291,40 +2296,40 @@ find the errors."
 ;;   b :
 (defconst verilog-assignment-operator-re
   (eval-when-compile
-     (verilog-regexp-opt
-      `(
-       ;; blocking assignment_operator
-       "=" "+=" "-=" "*=" "/=" "%=" "&=" "|=" "^=" "<<=" ">>=" "<<<=" ">>>="
-       ;; non blocking assignment operator
-       "<="
-       ;; comparison
-       "==" "!=" "===" "!===" "<=" ">=" "==\?" "!=\?"
-       ;; event_trigger
-       "->" "->>"
-       ;; property_expr
-       "|->" "|=>"
-       ;; Is this a legal verilog operator?
-       ":="
-       ) 't
-      )))
+    (verilog-regexp-opt
+     `(
+       ;; blocking assignment_operator
+       "=" "+=" "-=" "*=" "/=" "%=" "&=" "|=" "^=" "<<=" ">>=" "<<<=" ">>>="
+       ;; non blocking assignment operator
+       "<="
+       ;; comparison
+       "==" "!=" "===" "!==" "<=" ">=" "==\?" "!=\?" "<->"
+       ;; event_trigger
+       "->" "->>"
+       ;; property_expr
+       "|->" "|=>" "#-#" "#=#"
+       ;; distribution weighting
+       ":=" ":/"
+       ) 't
+         )))
 (defconst verilog-assignment-operation-re
   (concat
-;     "\\(^\\s-*[A-Za-z0-9_]+\\(\\[\\([A-Za-z0-9_]+\\)\\]\\)*\\s-*\\)"
-;     "\\(^\\s-*[^=<>+-*/%&|^:\\s-]+[^=<>+-*/%&|^\n]*?\\)"
-     "\\(^.*?\\)" "\\B" verilog-assignment-operator-re "\\B" ))
+   ;; "\\(^\\s-*[A-Za-z0-9_]+\\(\\[\\([A-Za-z0-9_]+\\)\\]\\)*\\s-*\\)"
+   ;; "\\(^\\s-*[^=<>+-*/%&|^:\\s-]+[^=<>+-*/%&|^\n]*?\\)"
+   "\\(^.*?\\)" "\\B" verilog-assignment-operator-re "\\B" ))
 
 (defconst verilog-label-re (concat verilog-symbol-re "\\s-*:\\s-*"))
 (defconst verilog-property-re
   (concat "\\(" verilog-label-re "\\)?"
+          ;; "\\(assert\\|assume\\|cover\\)\\s-+property\\>"
          
"\\(\\(assert\\|assume\\|cover\\)\\>\\s-+\\<property\\>\\)\\|\\(assert\\)"))
-         ;;  "\\(assert\\|assume\\|cover\\)\\s-+property\\>"
 
 (defconst verilog-no-indent-begin-re
   (eval-when-compile
     (verilog-regexp-words
-     '("always" "always_comb" "always_ff" "always_latch" "initial" "final" ;; 
procedural blocks
-       "if" "else"                                                         ;; 
conditional statements
-       "while" "for" "foreach" "repeat" "do" "forever" ))))                ;; 
loop statements
+     '("always" "always_comb" "always_ff" "always_latch" "initial" "final"  ; 
procedural blocks
+       "if" "else"                                                          ; 
conditional statements
+       "while" "for" "foreach" "repeat" "do" "forever" ))))                 ; 
loop statements
 
 (defconst verilog-ends-re
   ;; Parenthesis indicate type of keyword found
@@ -2396,8 +2401,8 @@ find the errors."
                "package")))
          "\\)"))
 
-;;; NOTE: verilog-leap-to-head expects that verilog-end-block-re and
-;;; verilog-end-block-ordered-re matches exactly the same strings.
+;; NOTE: verilog-leap-to-head expects that verilog-end-block-re and
+;; verilog-end-block-ordered-re matches exactly the same strings.
 (defconst verilog-end-block-ordered-re
   ;; Parenthesis indicate type of keyword found
   (concat "\\(\\<endcase\\>\\)\\|" ; 1
@@ -2421,9 +2426,9 @@ find the errors."
   (eval-when-compile
     (verilog-regexp-words
 
-     `("end"  ;; closes begin
-       "endcase" ;; closes any of case, casex casez or randcase
-       "join" "join_any" "join_none" ;; closes fork
+     `("end"      ; closes begin
+       "endcase"  ; closes any of case, casex casez or randcase
+       "join" "join_any" "join_none"  ; closes fork
        "endclass"
        "endtable"
        "endspecify"
@@ -2666,7 +2671,7 @@ find the errors."
   (eval-when-compile (verilog-regexp-words `("initial" "final" "always" 
"always_comb" "always_latch" "always_ff"
                                             "function" "task"))))
 (defconst verilog-coverpoint-re 
"\\w+\\s*:\\s*\\(coverpoint\\|cross\\constraint\\)"  )
-(defconst verilog-in-constraint-re ;; keywords legal in constraint blocks 
starting a statement/block
+(defconst verilog-in-constraint-re  ; keywords legal in constraint blocks 
starting a statement/block
   (eval-when-compile (verilog-regexp-words `("if" "else" "solve" "foreach"))))
 
 (defconst verilog-indent-re
@@ -2676,7 +2681,7 @@ find the errors."
        "{"
        "always" "always_latch" "always_ff" "always_comb"
        "begin" "end"
-;       "unique" "priority"
+       ;; "unique" "priority"
        "case" "casex" "casez" "randcase" "endcase"
        "class" "endclass"
        "clocking" "endclocking"
@@ -2734,7 +2739,7 @@ find the errors."
        "`uvm_sequence_utils_begin"
        "`uvm_sequencer_utils_begin"
        ;; UVM End tokens
-       "`uvm_component_utils_end"      ;; Typo in spec, it's not 
uvm_component_end
+       "`uvm_component_utils_end"       ; Typo in spec, it's not 
uvm_component_end
        "`uvm_field_utils_end"
        "`uvm_object_utils_end"
        "`uvm_sequence_utils_end"
@@ -2780,12 +2785,18 @@ find the errors."
      `(
        "endmodule" "endprimitive" "endinterface" "endpackage" "endprogram" 
"endclass"
        ))))
+
+(defconst verilog-dpi-import-export-re
+  (eval-when-compile
+    
"\\(\\<\\(import\\|export\\)\\>\\s-+\"DPI\\(-C\\)?\"\\s-+\\(\\<\\(context\\|pure\\)\\>\\s-+\\)?\\([A-Za-z_][A-Za-z0-9_]*\\s-*=\\s-*\\)?\\<\\(function\\|task\\)\\>\\)"
+    ))
+
 (defconst verilog-disable-fork-re "\\(disable\\|wait\\)\\s-+fork\\>")
 (defconst verilog-extended-case-re 
"\\(\\(unique0?\\s-+\\|priority\\s-+\\)?case[xz]?\\)")
 (defconst verilog-extended-complete-re
   (concat 
"\\(\\(\\<extern\\s-+\\|\\<\\(\\<\\(pure\\|context\\)\\>\\s-+\\)?virtual\\s-+\\|\\<protected\\s-+\\)*\\(\\<function\\>\\|\\<task\\>\\)\\)"
          
"\\|\\(\\(\\<typedef\\>\\s-+\\)*\\(\\<struct\\>\\|\\<union\\>\\|\\<class\\>\\)\\)"
-         
"\\|\\(\\(\\<import\\>\\s-+\\)?\\(\"DPI-C\"\\s-+\\)?\\(\\<\\(pure\\|context\\)\\>\\s-+\\)?\\([A-Za-z_][A-Za-z0-9_]*\\s-+=\\s-+\\)?\\(function\\>\\|task\\>\\)\\)"
+         
"\\|\\(\\(\\<\\(import\\|export\\)\\>\\s-+\\)?\\(\"DPI\\(-C\\)?\"\\s-+\\)?\\(\\<\\(pure\\|context\\)\\>\\s-+\\)?\\([A-Za-z_][A-Za-z0-9_]*\\s-*=\\s-*\\)?\\(function\\>\\|task\\>\\)\\)"
          "\\|" verilog-extended-case-re ))
 (defconst verilog-basic-complete-re
   (eval-when-compile
@@ -2848,10 +2859,10 @@ find the errors."
      "\\)\\|\\(?:"
      ;; `define and `if can span multiple lines if line ends in '\'. NOTE: `if 
is not IEEE 1800-2012
      ;; from http://www.emacswiki.org/emacs/MultilineRegexp
-     (concat "\\<\\(`define\\|`if\\)\\>" ;; directive
-            "\\s-+" ;; separator
-             "\\(?:.*?\\(?:\n.*\\)*?\\)" ;; definition: to end of line, then 
maybe more lines (excludes any trailing \n)
-            "\\(?:\n\\s-*\n\\|\\'\\)") ;; blank line or EOF
+     (concat "\\<\\(`define\\|`if\\)\\>"  ; directive
+             "\\s-+"  ; separator
+             "\\(?:.*?\\(?:\n.*\\)*?\\)"  ; definition: to end of line, then 
maybe more lines (excludes any trailing \n)
+             "\\(?:\n\\s-*\n\\|\\'\\)")  ; blank line or EOF
      "\\)\\|\\(?:"
      ;; `<macro>() : i.e. `uvm_info(a,b,c) or any other pre-defined macro
      ;; Since parameters inside the macro can have parentheses, and
@@ -2859,56 +2870,56 @@ find the errors."
      ;; parentheses and then continue to the end of the first
      ;; non-escaped EOL
      (concat "\\<`\\w+\\>\\s-*("
-      "\\(?:.*?\\(?:\n.*\\)*?\\)" ;; definition: to end of line, then maybe 
more lines (excludes any trailing \n)
-            "\\(?:\n\\s-*\n\\|\\'\\)") ;; blank line or EOF
+             "\\(?:.*?\\(?:\n.*\\)*?\\)"  ; definition: to end of line, then 
maybe more lines (excludes any trailing \n)
+             "\\(?:\n\\s-*\n\\|\\'\\)")   ; blank line or EOF
      "\\)"
      )))
 
 (defconst verilog-keywords
   (append verilog-compiler-directives
-   '(
-     "after" "alias" "always" "always_comb" "always_ff" "always_latch" "and"
-     "assert" "assign" "assume" "automatic" "before" "begin" "bind"
-     "bins" "binsof" "bit" "break" "buf" "bufif0" "bufif1" "byte"
-     "case" "casex" "casez" "cell" "chandle" "class" "clocking" "cmos"
-     "config" "const" "constraint" "context" "continue" "cover"
-     "covergroup" "coverpoint" "cross" "deassign" "default" "defparam"
-     "design" "disable" "dist" "do" "edge" "else" "end" "endcase"
-     "endclass" "endclocking" "endconfig" "endfunction" "endgenerate"
-     "endgroup" "endinterface" "endmodule" "endpackage" "endprimitive"
-     "endprogram" "endproperty" "endspecify" "endsequence" "endtable"
-     "endtask" "enum" "event" "expect" "export" "extends" "extern"
-     "final" "first_match" "for" "force" "foreach" "forever" "fork"
-     "forkjoin" "function" "generate" "genvar" "highz0" "highz1" "if"
-     "iff" "ifnone" "ignore_bins" "illegal_bins" "import" "incdir"
-     "include" "initial" "inout" "input" "inside" "instance" "int"
-     "integer" "interface" "intersect" "join" "join_any" "join_none"
-     "large" "liblist" "library" "local" "localparam" "logic"
-     "longint" "macromodule" "mailbox" "matches" "medium" "modport" "module"
-     "nand" "negedge" "new" "nmos" "nor" "noshowcancelled" "not"
-     "notif0" "notif1" "null" "or" "output" "package" "packed"
-     "parameter" "pmos" "posedge" "primitive" "priority" "program"
-     "property" "protected" "pull0" "pull1" "pulldown" "pullup"
-     "pulsestyle_onevent" "pulsestyle_ondetect" "pure" "rand" "randc"
-     "randcase" "randsequence" "rcmos" "real" "realtime" "ref" "reg"
-     "release" "repeat" "return" "rnmos" "rpmos" "rtran" "rtranif0"
-     "rtranif1" "scalared" "semaphore" "sequence" "shortint" "shortreal"
-     "showcancelled" "signed" "small" "solve" "specify" "specparam"
-     "static" "string" "strong0" "strong1" "struct" "super" "supply0"
-     "supply1" "table" "tagged" "task" "this" "throughout" "time"
-     "timeprecision" "timeunit" "tran" "tranif0" "tranif1" "tri"
-     "tri0" "tri1" "triand" "trior" "trireg" "type" "typedef" "union"
-     "unique" "unsigned" "use" "uwire" "var" "vectored" "virtual" "void"
-     "wait" "wait_order" "wand" "weak0" "weak1" "while" "wildcard"
-     "wire" "with" "within" "wor" "xnor" "xor"
-     ;; 1800-2009
-     "accept_on" "checker" "endchecker" "eventually" "global" "implies"
-     "let" "nexttime" "reject_on" "restrict" "s_always" "s_eventually"
-     "s_nexttime" "s_until" "s_until_with" "strong" "sync_accept_on"
-     "sync_reject_on" "unique0" "until" "until_with" "untyped" "weak"
-     ;; 1800-2012
-     "implements" "interconnect" "nettype" "soft"
-     ))
+          '(
+            "after" "alias" "always" "always_comb" "always_ff" "always_latch" 
"and"
+            "assert" "assign" "assume" "automatic" "before" "begin" "bind"
+            "bins" "binsof" "bit" "break" "buf" "bufif0" "bufif1" "byte"
+            "case" "casex" "casez" "cell" "chandle" "class" "clocking" "cmos"
+            "config" "const" "constraint" "context" "continue" "cover"
+            "covergroup" "coverpoint" "cross" "deassign" "default" "defparam"
+            "design" "disable" "dist" "do" "edge" "else" "end" "endcase"
+            "endclass" "endclocking" "endconfig" "endfunction" "endgenerate"
+            "endgroup" "endinterface" "endmodule" "endpackage" "endprimitive"
+            "endprogram" "endproperty" "endspecify" "endsequence" "endtable"
+            "endtask" "enum" "event" "expect" "export" "extends" "extern"
+            "final" "first_match" "for" "force" "foreach" "forever" "fork"
+            "forkjoin" "function" "generate" "genvar" "highz0" "highz1" "if"
+            "iff" "ifnone" "ignore_bins" "illegal_bins" "import" "incdir"
+            "include" "initial" "inout" "input" "inside" "instance" "int"
+            "integer" "interface" "intersect" "join" "join_any" "join_none"
+            "large" "liblist" "library" "local" "localparam" "logic"
+            "longint" "macromodule" "mailbox" "matches" "medium" "modport" 
"module"
+            "nand" "negedge" "new" "nmos" "nor" "noshowcancelled" "not"
+            "notif0" "notif1" "null" "or" "output" "package" "packed"
+            "parameter" "pmos" "posedge" "primitive" "priority" "program"
+            "property" "protected" "pull0" "pull1" "pulldown" "pullup"
+            "pulsestyle_onevent" "pulsestyle_ondetect" "pure" "rand" "randc"
+            "randcase" "randsequence" "rcmos" "real" "realtime" "ref" "reg"
+            "release" "repeat" "return" "rnmos" "rpmos" "rtran" "rtranif0"
+            "rtranif1" "scalared" "semaphore" "sequence" "shortint" "shortreal"
+            "showcancelled" "signed" "small" "solve" "specify" "specparam"
+            "static" "string" "strong0" "strong1" "struct" "super" "supply0"
+            "supply1" "table" "tagged" "task" "this" "throughout" "time"
+            "timeprecision" "timeunit" "tran" "tranif0" "tranif1" "tri"
+            "tri0" "tri1" "triand" "trior" "trireg" "type" "typedef" "union"
+            "unique" "unsigned" "use" "uwire" "var" "vectored" "virtual" "void"
+            "wait" "wait_order" "wand" "weak0" "weak1" "while" "wildcard"
+            "wire" "with" "within" "wor" "xnor" "xor"
+            ;; 1800-2009
+            "accept_on" "checker" "endchecker" "eventually" "global" "implies"
+            "let" "nexttime" "reject_on" "restrict" "s_always" "s_eventually"
+            "s_nexttime" "s_until" "s_until_with" "strong" "sync_accept_on"
+            "sync_reject_on" "unique0" "until" "until_with" "untyped" "weak"
+            ;; 1800-2012
+            "implements" "interconnect" "nettype" "soft"
+            ))
   "List of Verilog keywords.")
 
 (defconst verilog-comment-start-regexp "//\\|/\\*"
@@ -2928,7 +2939,7 @@ find the errors."
     (modify-syntax-entry ?| "." table)
     ;; FIXME: This goes against Emacs conventions.  Use "_" syntax instead and
     ;; then use regexps with things like "\\_<...\\_>".
-    (modify-syntax-entry ?` "w" table) ;; ` is part of definition symbols in 
Verilog
+    (modify-syntax-entry ?` "w" table)  ; ` is part of definition symbols in 
Verilog
     (modify-syntax-entry ?_ "w" table)
     (modify-syntax-entry ?\' "." table)
 
@@ -3119,9 +3130,9 @@ See also `verilog-font-lock-extra-types'.")
        (list
         ;; Fontify all builtin keywords
         (concat "\\<\\(" verilog-font-keywords "\\|"
-                      ;; And user/system tasks and functions
-              "\\$[a-zA-Z][a-zA-Z0-9_\\$]*"
-              "\\)\\>")
+                 ;; And user/system tasks and functions
+                 "\\$[a-zA-Z][a-zA-Z0-9_\\$]*"
+                 "\\)\\>")
         ;; Fontify all types
         (if verilog-highlight-grouping-keywords
             (cons (concat "\\<\\(" verilog-font-grouping-keywords "\\)\\>")
@@ -3129,7 +3140,7 @@ See also `verilog-font-lock-extra-types'.")
           (cons (concat "\\<\\(" verilog-font-grouping-keywords "\\)\\>")
                 'font-lock-type-face))
         (cons (concat "\\<\\(" verilog-type-font-keywords "\\)\\>")
-          'font-lock-type-face)
+               'font-lock-type-face)
         ;; Fontify IEEE-1800-2005 keywords appropriately
         (if verilog-highlight-p1800-keywords
             (cons (concat "\\<\\(" verilog-1800-2005-keywords "\\)\\>")
@@ -3163,8 +3174,8 @@ See also `verilog-font-lock-extra-types'.")
                 ;; Fontify function definitions
                 (list
                  (concat 
"\\<function\\>\\s-+\\(integer\\|real\\(time\\)?\\|time\\)\\s-+\\(\\sw+\\)" )
-                      '(1 font-lock-keyword-face)
-                      '(3 font-lock-constant-face prepend))
+                  '(1 font-lock-keyword-face)
+                  '(3 font-lock-constant-face prepend))
                 '("\\<function\\>\\s-+\\(\\[[^]]+\\]\\)\\s-+\\(\\sw+\\)"
                   (1 font-lock-keyword-face)
                   (2 font-lock-constant-face append))
@@ -3180,11 +3191,14 @@ See also `verilog-font-lock-extra-types'.")
                 '("\\(\\\\\\S-*\\s-\\)"  0 font-lock-function-name-face)
                 ;; Fontify macro definitions/ uses
                 '("`\\s-*[A-Za-z][A-Za-z0-9_]*" 0 (if (boundp 
'font-lock-preprocessor-face)
-                                                      
'font-lock-preprocessor-face
-                                                    'font-lock-type-face))
+                                                      
'font-lock-preprocessor-face
+                                                    'font-lock-type-face))
                 ;; Fontify delays/numbers
-                
'("\\(@\\)\\|\\(#\\s-*\\(\\(\[0-9_.\]+\\('s?[hdxbo][0-9a-fA-F_xz]*\\)?\\)\\|\\(([^()]+)\\|\\sw+\\)\\)\\)"
+                '("\\(@\\)\\|\\([ 
\t\n\f\r]#\\s-*\\(\\(\[0-9_.\]+\\('s?[hdxbo][0-9a-fA-F_xz]*\\)?\\)\\|\\(([^()]+)\\|\\sw+\\)\\)\\)"
                   0 font-lock-type-face append)
+     ;; Fontify property/sequence cycle delays - these start with '##'
+     '("\\(##\\(\\sw+\\|\\[[^\]]+\\]\\)\\)"
+       0 font-lock-type-face append)
                 ;; Fontify instantiation names
                 '("\\([A-Za-z][A-Za-z0-9_]*\\)\\s-*(" 1 
font-lock-function-name-face)
                 )))
@@ -3257,10 +3271,10 @@ to full text form for parsing.  Additional actions may 
be specified with
                        (font-lock-mode 0)
                        t)))
      (unwind-protect
-          (progn ,@body)
-        ;; Unwind forms
-        (when fontlocked (font-lock-mode t))
-        (when hooked (verilog-run-hooks 'verilog-after-save-font-hook)))))
+         (progn ,@body)
+       ;; Unwind forms
+       (when fontlocked (font-lock-mode t))
+       (when hooked (verilog-run-hooks 'verilog-after-save-font-hook)))))
 
 ;;
 ;; Comment detection and caching
@@ -3292,7 +3306,7 @@ This requires that insertions must use `verilog-insert'."
   ;; Note this must work properly if there's multiple layers of calls
   ;; to verilog-save-scan-cache even with differing ticks.
   `(progn
-     (unless (verilog-scan-cache-ok-p)  ;; Must be before let
+     (unless (verilog-scan-cache-ok-p)   ; Must be before let
        (setq verilog-scan-cache-tick nil))
      (let* ((verilog-scan-cache-preserving (current-buffer)))
        (progn ,@body))))
@@ -3330,7 +3344,7 @@ This creates v-cmts properties where comments are in 
force."
                  (put-text-property (1+ pt) (point) 'v-cmts t))
                 ((looking-at "\"")
                  (setq pt (point))
-                 (or (re-search-forward "[^\\]\"" end t)       ;; don't 
forward-char first, since we look for a non backslash first
+                  (or (re-search-forward "[^\\]\"" end t)  ; don't 
forward-char first, since we look for a non backslash first
                      ;; No error - let later code indicate it so we can
                      (goto-char end))
                  (put-text-property (1+ pt) (point) 'v-cmts t))
@@ -3348,14 +3362,14 @@ either is ok to parse as a non-comment, or 
`verilog-insert' was used."
   (unless (verilog-scan-cache-ok-p)
     (save-excursion
       (verilog-save-buffer-state
-       (when verilog-debug
-         (message "Scanning %s cache=%s cachetick=%S tick=%S" (current-buffer)
-                  verilog-scan-cache-preserving verilog-scan-cache-tick
-                  (buffer-chars-modified-tick)))
-       (remove-text-properties (point-min) (point-max) '(v-cmts nil))
-       (verilog-scan-region (point-min) (point-max))
-       (setq verilog-scan-cache-tick (buffer-chars-modified-tick))
-       (when verilog-debug (message "Scanning... done"))))))
+       (when verilog-debug
+         (message "Scanning %s cache=%s cachetick=%S tick=%S" (current-buffer)
+                  verilog-scan-cache-preserving verilog-scan-cache-tick
+                  (buffer-chars-modified-tick)))
+       (remove-text-properties (point-min) (point-max) '(v-cmts nil))
+       (verilog-scan-region (point-min) (point-max))
+       (setq verilog-scan-cache-tick (buffer-chars-modified-tick))
+       (when verilog-debug (message "Scanning... done"))))))
 
 (defun verilog-scan-debug ()
   "For debugging, show with display face results of `verilog-scan'."
@@ -3427,13 +3441,13 @@ Use filename, if current buffer being edited shorten to 
just buffer name."
   ;; before that see if we are in a comment
   (verilog-forward-sexp))
 
-;;;used by hs-minor-mode
 (defun verilog-forward-sexp-function (arg)
+  "Move forward a sexp."
+  ;; Used by hs-minor-mode
   (if (< arg 0)
       (verilog-backward-sexp)
     (verilog-forward-sexp)))
 
-
 (defun verilog-backward-sexp ()
   (let ((reg)
        (elsec 1)
@@ -3504,7 +3518,7 @@ Use filename, if current buffer being edited shorten to 
just buffer name."
        ((match-end 2)
        ;; Search forward for matching endcase
        (setq reg 
"\\(\\<randcase\\>\\|\\(\\<unique0?\\>\\s-+\\|\\<priority\\>\\s-+\\)?\\<case[xz]?\\>[^:]\\)\\|\\(\\<endcase\\>\\)"
 )
-       (setq md 3) ;; ender is third item in regexp
+        (setq md 3)  ; ender is third item in regexp
        )
        ((match-end 4)
        ;; might be "disable fork" or "wait fork"
@@ -3514,15 +3528,15 @@ Use filename, if current buffer being edited shorten to 
just buffer name."
               (looking-at verilog-disable-fork-re)
               (and (looking-at "fork")
                    (progn
-                     (setq here (point)) ;; sometimes a fork is just a fork
+                      (setq here (point))  ; sometimes a fork is just a fork
                      (forward-word -1)
                      (looking-at verilog-disable-fork-re))))
-             (progn ;; it is a disable fork; ignore it
+              (progn  ; it is a disable fork; ignore it
                (goto-char (match-end 0))
                (forward-word 1)
                (setq reg nil))
-           (progn ;; it is a nice simple fork
-             (goto-char here)   ;; return from looking for "disable fork"
+            (progn  ; it is a nice simple fork
+              (goto-char here)   ; return from looking for "disable fork"
              ;; Search forward for matching join
              (setq reg 
"\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|_none\\)?\\>\\)" )))))
        ((match-end 6)
@@ -3533,41 +3547,41 @@ Use filename, if current buffer being edited shorten to 
just buffer name."
        ;; Search forward for matching endtable
        (setq reg "\\<endtable\\>" )
        (setq nest 'no))
-      ((match-end 8)
-       ;; Search forward for matching endspecify
-       (setq reg "\\(\\<specify\\>\\)\\|\\(\\<endspecify\\>\\)" ))
-      ((match-end 9)
-       ;; Search forward for matching endfunction
-       (setq reg "\\<endfunction\\>" )
-       (setq nest 'no))
-      ((match-end 10)
-       ;; Search forward for matching endfunction
-       (setq reg "\\<endfunction\\>" )
-       (setq nest 'no))
-      ((match-end 14)
-       ;; Search forward for matching endtask
-       (setq reg "\\<endtask\\>" )
-       (setq nest 'no))
-      ((match-end 15)
-       ;; Search forward for matching endtask
-       (setq reg "\\<endtask\\>" )
-       (setq nest 'no))
-      ((match-end 19)
-       ;; Search forward for matching endgenerate
-       (setq reg "\\(\\<generate\\>\\)\\|\\(\\<endgenerate\\>\\)" ))
-      ((match-end 20)
-       ;; Search forward for matching endgroup
-       (setq reg "\\(\\<covergroup\\>\\)\\|\\(\\<endgroup\\>\\)" ))
-      ((match-end 21)
-       ;; Search forward for matching endproperty
-       (setq reg "\\(\\<property\\>\\)\\|\\(\\<endproperty\\>\\)" ))
-      ((match-end 25)
-       ;; Search forward for matching endsequence
-       (setq reg "\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<endsequence\\>\\)" )
-       (setq md 3)) ; 3 to get to endsequence in the reg above
-      ((match-end 27)
-       ;; Search forward for matching endclocking
-       (setq reg "\\(\\<clocking\\>\\)\\|\\(\\<endclocking\\>\\)" )))
+       ((match-end 8)
+        ;; Search forward for matching endspecify
+        (setq reg "\\(\\<specify\\>\\)\\|\\(\\<endspecify\\>\\)" ))
+       ((match-end 9)
+        ;; Search forward for matching endfunction
+        (setq reg "\\<endfunction\\>" )
+        (setq nest 'no))
+       ((match-end 10)
+        ;; Search forward for matching endfunction
+        (setq reg "\\<endfunction\\>" )
+        (setq nest 'no))
+       ((match-end 14)
+        ;; Search forward for matching endtask
+        (setq reg "\\<endtask\\>" )
+        (setq nest 'no))
+       ((match-end 15)
+        ;; Search forward for matching endtask
+        (setq reg "\\<endtask\\>" )
+        (setq nest 'no))
+       ((match-end 19)
+        ;; Search forward for matching endgenerate
+        (setq reg "\\(\\<generate\\>\\)\\|\\(\\<endgenerate\\>\\)" ))
+       ((match-end 20)
+        ;; Search forward for matching endgroup
+        (setq reg "\\(\\<covergroup\\>\\)\\|\\(\\<endgroup\\>\\)" ))
+       ((match-end 21)
+        ;; Search forward for matching endproperty
+        (setq reg "\\(\\<property\\>\\)\\|\\(\\<endproperty\\>\\)" ))
+       ((match-end 25)
+        ;; Search forward for matching endsequence
+        (setq reg "\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<endsequence\\>\\)" )
+        (setq md 3)) ; 3 to get to endsequence in the reg above
+       ((match-end 27)
+        ;; Search forward for matching endclocking
+        (setq reg "\\(\\<clocking\\>\\)\\|\\(\\<endclocking\\>\\)" )))
       (if (and reg
               (forward-word 1))
          (catch 'skip
@@ -3590,9 +3604,9 @@ Use filename, if current buffer being edited shorten to 
just buffer name."
                                  (progn
                                    (forward-word -1)
                                    (looking-at verilog-disable-fork-re))))
-                           (progn ;; it is a disable fork; another false alarm
+                            (progn  ; it is a disable fork; another false alarm
                              (goto-char (match-end 0)))
-                         (progn ;; it is a simple fork (or has nothing to do 
with fork)
+                          (progn  ; it is a simple fork (or has nothing to do 
with fork)
                            (goto-char here)
                            (setq depth (1+ depth))))))))))
              (if (verilog-re-search-forward reg nil 'move)
@@ -3787,7 +3801,7 @@ Key bindings specific to `verilog-mode-map' are:
   (setq verilog-which-tool 1)
   (setq verilog-tool 'verilog-linter)
   (verilog-set-compile-command)
-  (when (boundp 'hack-local-variables-hook)  ;; Also modify any 
file-local-variables
+  (when (boundp 'hack-local-variables-hook)  ; Also modify any 
file-local-variables
     (add-hook 'hack-local-variables-hook 'verilog-modify-compile-command t))
 
   ;; Setting up menus
@@ -3813,7 +3827,7 @@ Key bindings specific to `verilog-mode-map' are:
   ;;------------------------------------------------------------
   ;; now hook in 'verilog-highlight-include-files (eldo-mode.el&spice-mode.el)
   ;; all buffer local:
-  (unless noninteractive  ;; Else can't see the result, and change hooks are 
slow
+  (unless noninteractive  ; Else can't see the result, and change hooks are 
slow
     (when (featurep 'xemacs)
       (make-local-hook 'font-lock-mode-hook)
       (make-local-hook 'font-lock-after-fontify-buffer-hook); doesn't exist in 
Emacs
@@ -3841,10 +3855,9 @@ Key bindings specific to `verilog-mode-map' are:
   ;; verilog-mode-hook call added by define-derived-mode
   )
 
-
-;;
-;;  Electric functions
+;;; Electric functions:
 ;;
+
 (defun electric-verilog-terminate-line (&optional arg)
   "Terminate line and indent next line.
 With optional ARG, remove existing end of line comments."
@@ -3866,36 +3879,36 @@ With optional ARG, remove existing end of line 
comments."
       (newline)
       (verilog-more-comment))
      ((eolp)
-       ;; First, check if current line should be indented
-       (if (save-excursion
-             (delete-horizontal-space)
-            (beginning-of-line)
-            (skip-chars-forward " \t")
-            (if (looking-at verilog-auto-end-comment-lines-re)
-                (let ((indent-str (verilog-indent-line)))
-                  ;; Maybe we should set some endcomments
-                  (if verilog-auto-endcomments
-                      (verilog-set-auto-endcomments indent-str arg))
-                  (end-of-line)
-                  (delete-horizontal-space)
-                  (if arg
-                      ()
-                    (newline))
-                  nil)
-              (progn
-                (end-of-line)
-                (delete-horizontal-space)
-                't)))
-          ;; see if we should line up assignments
-          (progn
-            (if (or (eq 'all verilog-auto-lineup)
-                    (eq 'assignments verilog-auto-lineup))
-                (verilog-pretty-expr t "\\(<\\|:\\)?=" ))
-            (newline))
-        (forward-line 1))
-       ;; Indent next line
-       (if verilog-auto-indent-on-newline
-          (verilog-indent-line)))
+      ;; First, check if current line should be indented
+      (if (save-excursion
+            (delete-horizontal-space)
+            (beginning-of-line)
+            (skip-chars-forward " \t")
+            (if (looking-at verilog-auto-end-comment-lines-re)
+                (let ((indent-str (verilog-indent-line)))
+                  ;; Maybe we should set some endcomments
+                  (if verilog-auto-endcomments
+                      (verilog-set-auto-endcomments indent-str arg))
+                  (end-of-line)
+                  (delete-horizontal-space)
+                  (if arg
+                      ()
+                    (newline))
+                  nil)
+              (progn
+                (end-of-line)
+                (delete-horizontal-space)
+                't)))
+          ;; see if we should line up assignments
+          (progn
+            (if (or (eq 'all verilog-auto-lineup)
+                    (eq 'assignments verilog-auto-lineup))
+                (verilog-pretty-expr t "\\(<\\|:\\)?=" ))
+            (newline))
+        (forward-line 1))
+      ;; Indent next line
+      (if verilog-auto-indent-on-newline
+          (verilog-indent-line)))
      (t
       (newline)))))
 
@@ -3944,8 +3957,8 @@ With optional ARG, remove existing end of line comments."
        (goto-char p)
        (verilog-backward-case-item lim)
        (verilog-indent-line)))
-;;    (let ((verilog-tab-always-indent nil))
-;;      (verilog-indent-line))
+    ;; (let ((verilog-tab-always-indent nil))
+    ;;   (verilog-indent-line))
     ))
 
 ;;(defun electric-verilog-equal ()
@@ -3995,7 +4008,7 @@ With optional ARG, remove existing end of line comments."
              (t
               (indent-for-comment)
               (when (and (eolp) (= oldpnt (point)))
-                                       ; kill existing comment
+                 ;; kill existing comment
                 (beginning-of-line)
                 (re-search-forward comment-start-skip oldpnt 'move)
                 (goto-char (match-beginning 0))
@@ -4004,9 +4017,7 @@ With optional ARG, remove existing end of line comments."
    (t (progn (insert "\t")))))
 
 
-
-;;
-;; Interactive functions
+;;; Interactive functions:
 ;;
 
 (defun verilog-indent-buffer ()
@@ -4213,6 +4224,7 @@ Uses `verilog-scan' cache."
   "Label matching begin ... end, fork ... join and case ... endcase 
statements."
   (interactive)
   (let ((cnt 0)
+       (case-fold-search nil)
        (oldpos (point))
        (b (progn
             (verilog-beg-of-defun)
@@ -4222,7 +4234,7 @@ Uses `verilog-scan' cache."
             (point-marker))))
     (goto-char (marker-position b))
     (if (> (- e b) 200)
-       (message  "Relabeling module..."))
+       (message "Relabeling module..."))
     (while (and
            (> (marker-position e) (point))
            (verilog-re-search-forward
@@ -4240,7 +4252,7 @@ Uses `verilog-scan' cache."
     (if (or
         (> (- e b) 200)
         (> cnt 20))
-       (message  "%d lines auto commented" cnt))))
+       (message "%d lines auto commented" cnt))))
 
 (defun verilog-beg-of-statement ()
   "Move backward to beginning of statement."
@@ -4319,16 +4331,16 @@ Uses `verilog-scan' cache."
               (goto-char pt)
               (throw 'done t)))))
     (verilog-forward-syntactic-ws)))
-;
-;    (while (and
-;            (not (looking-at verilog-complete-reg))
-;            (not (bolp))
-;            (not (= (preceding-char) ?\;)))
-;      (verilog-backward-token)
-;      (verilog-backward-syntactic-ws)
-;      (setq pt (point)))
-;    (goto-char pt)
-; ;(verilog-forward-syntactic-ws)
+;;
+;;      (while (and
+;;              (not (looking-at verilog-complete-reg))
+;;              (not (bolp))
+;;              (not (= (preceding-char) ?\;)))
+;;        (verilog-backward-token)
+;;        (verilog-backward-syntactic-ws)
+;;        (setq pt (point)))
+;;      (goto-char pt)
+;;   ;(verilog-forward-syntactic-ws)
 
 (defun verilog-end-of-statement ()
   "Move forward to end of current statement."
@@ -4347,30 +4359,30 @@ Uses `verilog-scan' cache."
 
      ;; Skip to end of statement
      ((condition-case nil
-       (setq pos
-             (catch 'found
-               (while t
-                 (forward-sexp 1)
-                 (verilog-skip-forward-comment-or-string)
-                 (if (eolp)
-                     (forward-line 1))
-                 (cond ((looking-at "[ \t]*;")
-                        (skip-chars-forward "^;")
-                        (forward-char 1)
-                        (throw 'found (point)))
-                       ((save-excursion
-                          (forward-sexp -1)
-                          (looking-at verilog-beg-block-re))
-                        (goto-char (match-beginning 0))
-                        (throw 'found nil))
-                       ((looking-at "[ \t]*)")
-                        (throw 'found (point)))
-                       ((eobp)
-                        (throw 'found (point)))
-                       )))
-
-             )
-       (error nil))
+          (setq pos
+                (catch 'found
+                  (while t
+                    (forward-sexp 1)
+                    (verilog-skip-forward-comment-or-string)
+                    (if (eolp)
+                        (forward-line 1))
+                    (cond ((looking-at "[ \t]*;")
+                           (skip-chars-forward "^;")
+                           (forward-char 1)
+                           (throw 'found (point)))
+                          ((save-excursion
+                             (forward-sexp -1)
+                             (looking-at verilog-beg-block-re))
+                           (goto-char (match-beginning 0))
+                           (throw 'found nil))
+                          ((looking-at "[ \t]*)")
+                           (throw 'found (point)))
+                          ((eobp)
+                           (throw 'found (point)))
+                          )))
+
+                )
+        (error nil))
       (if (not pos)
           ;; Skip a whole block
           (catch 'found
@@ -4464,6 +4476,13 @@ More specifically, after a generate and before an 
endgenerate."
                (setq nest (1+ nest)))))))
     (= nest 0) )) ; return nest
 
+(defun verilog-in-deferred-immediate-final-p ()
+  "Return true if inside an 'assert/assume/cover final' statement."
+  (interactive)
+  (and (looking-at "final")
+       (verilog-looking-back "\\<\\(?:assert\\|assume\\|cover\\)\\>\\s-+" nil))
+  )
+
 (defun verilog-backward-case-item (lim)
   "Skip backward to nearest enclosing case item.
 Limit search to point LIM."
@@ -4485,14 +4504,14 @@ Limit search to point LIM."
               (verilog-re-search-backward "\\(\\[\\)\\|\\(\\]\\)\\|\\(:\\)"
                                           lim1 'move))
            (cond
-            ((match-end 1) ;; [
+             ((match-end 1)  ; [
              (setq colon (1+ colon))
              (if (>= colon 0)
                  (error "%s: unbalanced [" (verilog-point-text))))
-            ((match-end 2) ;; ]
+             ((match-end 2)  ; ]
              (setq colon (1- colon)))
 
-            ((match-end 3) ;; :
+             ((match-end 3)  ; :
              (setq colon (1+ colon)))))
          ;; Skip back to beginning of case item
          (skip-chars-backward "\t ")
@@ -4527,9 +4546,7 @@ Limit search to point LIM."
          str)
       'nil)))
 
-
-;;
-;; Other functions
+;;; Other functions:
 ;;
 
 (defun verilog-kill-existing-comment ()
@@ -4625,312 +4642,312 @@ primitive or interface named NAME."
                      (search-backward "//" (point-at-bol) t)))))
       (let ((type (car indent-str)))
        (unless (eq type 'declaration)
-         (unless (looking-at (concat "\\(" verilog-end-block-ordered-re "\\)[ 
\t]*:")) ;; ignore named ends
+          (unless (looking-at (concat "\\(" verilog-end-block-ordered-re "\\)[ 
\t]*:"))  ; ignore named ends
            (if (looking-at verilog-end-block-ordered-re)
-             (cond
-              (;- This is a case block; search back for the start of this case
-               (match-end 1) ;; of verilog-end-block-ordered-re
-
-               (let ((err 't)
-                     (str "UNMATCHED!!"))
-                 (save-excursion
-                   (verilog-leap-to-head)
-                   (cond
-                    ((looking-at "\\<randcase\\>")
-                     (setq str "randcase")
-                     (setq err nil))
-                    ((looking-at 
"\\(\\(unique0?\\s-+\\|priority\\s-+\\)?case[xz]?\\)")
-                     (goto-char (match-end 0))
-                     (setq str (concat (match-string 0) " " 
(verilog-get-expr)))
-                     (setq err nil))
-                    ))
-                 (end-of-line)
-                 (if kill-existing-comment
-                     (verilog-kill-existing-comment))
-                 (delete-horizontal-space)
-                 (insert (concat " // " str ))
-                 (if err (ding 't))))
-
-              (;- This is a begin..end block
-               (match-end 2) ;; of verilog-end-block-ordered-re
-               (let ((str " // UNMATCHED !!")
-                     (err 't)
-                     (here (point))
-                     there
-                     cntx)
-                 (save-excursion
-                   (verilog-leap-to-head)
-                   (setq there (point))
-                   (if (not (match-end 0))
-                       (progn
-                         (goto-char here)
-                         (end-of-line)
-                         (if kill-existing-comment
-                             (verilog-kill-existing-comment))
-                         (delete-horizontal-space)
-                         (insert str)
-                         (ding 't))
-                     (let ((lim
-                            (save-excursion (verilog-beg-of-defun) (point)))
-                           (here (point)))
-                       (cond
-                        (;-- handle named block differently
-                         (looking-at verilog-named-block-re)
-                         (search-forward ":")
-                         (setq there (point))
-                         (setq str (verilog-get-expr))
-                         (setq err nil)
-                         (setq str (concat " // block: " str )))
-
-                        ((verilog-in-case-region-p) ;-- handle case item 
differently
-                         (goto-char here)
-                         (setq str (verilog-backward-case-item lim))
-                         (setq there (point))
-                         (setq err nil)
-                         (setq str (concat " // case: " str )))
-
-                        (;- try to find "reason" for this begin
-                         (cond
-                          (;
-                           (eq here (progn
-                                   ;;   (verilog-backward-token)
-                                      (verilog-beg-of-statement)
-                                      (point)))
-                           (setq err nil)
-                           (setq str ""))
-                          ((looking-at verilog-endcomment-reason-re)
-                           (setq there (match-end 0))
-                           (setq cntx (concat (match-string 0) " "))
-                           (cond
-                            (;- begin
-                             (match-end 1)
-                             (setq err nil)
-                             (save-excursion
-                               (if (and (verilog-continued-line)
-                                        (looking-at 
"\\<repeat\\>\\|\\<wait\\>\\|\\<always\\>"))
-                                   (progn
-                                     (goto-char (match-end 0))
-                                     (setq there (point))
-                                     (setq str
-                                           (concat " // " (match-string 0) " " 
(verilog-get-expr))))
-                                 (setq str ""))))
-
-                            (;- else
-                             (match-end 2)
-                             (let ((nest 0)
-                                   ( reg 
"\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)\\|\\(assert\\)"))
-                               (catch 'skip
-                                 (while (verilog-re-search-backward reg nil 
'move)
-                                   (cond
-                                    ((match-end 1) ; begin
-                                     (setq nest (1- nest)))
-                                    ((match-end 2)                       ; end
-                                     (setq nest (1+ nest)))
-                                    ((match-end 3)
-                                     (if (= 0 nest)
-                                         (progn
-                                           (goto-char (match-end 0))
-                                           (setq there (point))
-                                           (setq err nil)
-                                           (setq str (verilog-get-expr))
-                                           (setq str (concat " // else: !if" 
str ))
-                                           (throw 'skip 1))))
-                                    ((match-end 4)
-                                     (if (= 0 nest)
-                                         (progn
-                                           (goto-char (match-end 0))
-                                           (setq there (point))
-                                           (setq err nil)
-                                           (setq str (verilog-get-expr))
-                                           (setq str (concat " // else: 
!assert " str ))
-                                           (throw 'skip 1)))))))))
-                            (;- end else
-                             (match-end 3)
-                             (goto-char there)
-                             (let ((nest 0)
-                                   (reg 
"\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)\\|\\(assert\\)"))
-                               (catch 'skip
-                                 (while (verilog-re-search-backward reg nil 
'move)
-                                   (cond
-                                    ((match-end 1) ; begin
-                                     (setq nest (1- nest)))
-                                    ((match-end 2)                       ; end
-                                     (setq nest (1+ nest)))
-                                    ((match-end 3)
-                                     (if (= 0 nest)
-                                         (progn
-                                           (goto-char (match-end 0))
-                                           (setq there (point))
-                                           (setq err nil)
-                                           (setq str (verilog-get-expr))
-                                           (setq str (concat " // else: !if" 
str ))
-                                           (throw 'skip 1))))
-                                    ((match-end 4)
-                                     (if (= 0 nest)
-                                         (progn
-                                           (goto-char (match-end 0))
-                                           (setq there (point))
-                                           (setq err nil)
-                                           (setq str (verilog-get-expr))
-                                           (setq str (concat " // else: 
!assert " str ))
-                                           (throw 'skip 1)))))))))
-
-                            (; always, always_comb, always_latch w/o @...
-                             (match-end 5)
-                             (goto-char (match-end 0))
-                             (setq there (point))
-                             (setq err nil)
-                             (setq str (concat " // " cntx )))
-
-                            (;- task/function/initial et cetera
-                             t
-                             (match-end 0)
-                             (goto-char (match-end 0))
-                             (setq there (point))
-                             (setq err nil)
-                             (setq str (concat " // " cntx 
(verilog-get-expr))))
-
-                            (;-- otherwise...
-                             (setq str " // auto-endcomment confused "))))
-
-                          ((and
-                            (verilog-in-case-region-p) ;-- handle case item 
differently
-                            (progn
-                              (setq there (point))
-                              (goto-char here)
-                              (setq str (verilog-backward-case-item lim))))
-                           (setq err nil)
-                           (setq str (concat " // case: " str )))
-
-                          ((verilog-in-fork-region-p)
-                           (setq err nil)
-                           (setq str " // fork branch" ))
-
-                          ((looking-at "\\<end\\>")
-                           ;; HERE
-                           (forward-word 1)
-                           (verilog-forward-syntactic-ws)
-                           (setq err nil)
-                           (setq str (verilog-get-expr))
-                           (setq str (concat " // " cntx str )))
-
-                          ))))
-                     (goto-char here)
-                     (end-of-line)
-                     (if kill-existing-comment
-                         (verilog-kill-existing-comment))
-                     (delete-horizontal-space)
-                     (if (or err
-                             (> (count-lines here there) 
verilog-minimum-comment-distance))
-                         (insert str))
-                     (if err (ding 't))
-                     ))))
-              (;- this is endclass, which can be nested
-               (match-end 11) ;; of verilog-end-block-ordered-re
-               ;;(goto-char there)
-               (let ((nest 0)
-                     (reg 
"\\<\\(class\\)\\|\\(endclass\\)\\|\\(package\\|primitive\\|\\(macro\\)?module\\)\\>")
-                     string)
-                 (save-excursion
-                   (catch 'skip
-                     (while (verilog-re-search-backward reg nil 'move)
-                       (cond
-                        ((match-end 3) ; endclass
-                         (ding 't)
-                         (setq string "unmatched endclass")
-                         (throw 'skip 1))
-
-                        ((match-end 2) ; endclass
-                         (setq nest (1+ nest)))
-
-                        ((match-end 1) ; class
-                         (setq nest (1- nest))
-                         (if (< nest 0)
-                             (progn
-                               (goto-char (match-end 0))
-                               (let (b e)
-                                 (setq b (progn
-                                           (skip-chars-forward "^ \t")
-                                           (verilog-forward-ws&directives)
-                                           (point))
-                                       e (progn
-                                           (skip-chars-forward "a-zA-Z0-9_")
-                                           (point)))
-                                 (setq string (buffer-substring b e)))
-                               (throw 'skip 1))))
-                        ))))
-                 (end-of-line)
-      (if kill-existing-comment
-          (verilog-kill-existing-comment))
-      (delete-horizontal-space)
-                 (insert (concat " // " string ))))
-
-              (;- this is 
end{function,generate,task,module,primitive,table,generate}
-               ;- which can not be nested.
-               t
-               (let (string reg (name-re nil))
-                 (end-of-line)
-                 (if kill-existing-comment
-                     (save-match-data
-                      (verilog-kill-existing-comment)))
-                 (delete-horizontal-space)
-                 (backward-sexp)
-                 (cond
-                  ((match-end 5) ;; of verilog-end-block-ordered-re
-                   (setq reg 
"\\(\\<function\\>\\)\\|\\(\\<\\(endfunction\\|task\\|\\(macro\\)?module\\|primitive\\)\\>\\)")
-                   (setq name-re "\\w+\\(?:\n\\|\\s-\\)*[(;]"))
-                  ((match-end 6) ;; of verilog-end-block-ordered-re
-                   (setq reg 
"\\(\\<task\\>\\)\\|\\(\\<\\(endtask\\|function\\|\\(macro\\)?module\\|primitive\\)\\>\\)")
-                   (setq name-re "\\w+\\(?:\n\\|\\s-\\)*[(;]"))
-                  ((match-end 7) ;; of verilog-end-block-ordered-re
-                   (setq reg 
"\\(\\<\\(macro\\)?module\\>\\)\\|\\<endmodule\\>"))
-                  ((match-end 8) ;; of verilog-end-block-ordered-re
-                   (setq reg 
"\\(\\<primitive\\>\\)\\|\\(\\<\\(endprimitive\\|package\\|interface\\|\\(macro\\)?module\\)\\>\\)"))
-                  ((match-end 9) ;; of verilog-end-block-ordered-re
-                   (setq reg 
"\\(\\<interface\\>\\)\\|\\(\\<\\(endinterface\\|package\\|primitive\\|\\(macro\\)?module\\)\\>\\)"))
-                  ((match-end 10) ;; of verilog-end-block-ordered-re
-                   (setq reg 
"\\(\\<package\\>\\)\\|\\(\\<\\(endpackage\\|primitive\\|interface\\|\\(macro\\)?module\\)\\>\\)"))
-                  ((match-end 11) ;; of verilog-end-block-ordered-re
-                   (setq reg 
"\\(\\<class\\>\\)\\|\\(\\<\\(endclass\\|primitive\\|interface\\|\\(macro\\)?module\\)\\>\\)"))
-                  ((match-end 12) ;; of verilog-end-block-ordered-re
-                   (setq reg 
"\\(\\<covergroup\\>\\)\\|\\(\\<\\(endcovergroup\\|primitive\\|interface\\|\\(macro\\)?module\\)\\>\\)"))
-                  ((match-end 13) ;; of verilog-end-block-ordered-re
-                   (setq reg 
"\\(\\<program\\>\\)\\|\\(\\<\\(endprogram\\|primitive\\|interface\\|\\(macro\\)?module\\)\\>\\)"))
-                  ((match-end 14) ;; of verilog-end-block-ordered-re
-                   (setq reg 
"\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<\\(endsequence\\|primitive\\|interface\\|\\(macro\\)?module\\)\\>\\)"))
-                  ((match-end 15) ;; of verilog-end-block-ordered-re
-                   (setq reg "\\(\\<clocking\\>\\)\\|\\<endclocking\\>"))
-                  ((match-end 16) ;; of verilog-end-block-ordered-re
-                   (setq reg "\\(\\<property\\>\\)\\|\\<endproperty\\>"))
-
-                  (t (error "Problem in verilog-set-auto-endcomments")))
-                 (let (b e)
-                   (save-excursion
-                     (verilog-re-search-backward reg nil 'move)
-                     (cond
-                      ((match-end 1)
-                       (setq b (progn
-                                 (skip-chars-forward "^ \t")
-                                 (verilog-forward-ws&directives)
-                                 (if (looking-at "static\\|automatic")
-                                     (progn
-                                       (goto-char (match-end 0))
-                                       (verilog-forward-ws&directives)))
-                                 (if (and name-re (verilog-re-search-forward 
name-re nil 'move))
-                                     (progn
-                                       (goto-char (match-beginning 0))
-                                       (verilog-forward-ws&directives)))
-                                 (point))
-                             e (progn
-                                 (skip-chars-forward "a-zA-Z0-9_")
-                                 (point)))
-                       (setq string (buffer-substring b e)))
-                      (t
-                       (ding 't)
-                       (setq string "unmatched 
end(function|task|module|primitive|interface|package|class|clocking)")))))
-                 (end-of-line)
-                 (insert (concat " // " string )))
-               ))))))))))
+                (cond
+                 (;- This is a case block; search back for the start of this 
case
+                  (match-end 1)  ; of verilog-end-block-ordered-re
+
+                  (let ((err 't)
+                        (str "UNMATCHED!!"))
+                    (save-excursion
+                      (verilog-leap-to-head)
+                      (cond
+                       ((looking-at "\\<randcase\\>")
+                        (setq str "randcase")
+                        (setq err nil))
+                       ((looking-at 
"\\(\\(unique0?\\s-+\\|priority\\s-+\\)?case[xz]?\\)")
+                        (goto-char (match-end 0))
+                        (setq str (concat (match-string 0) " " 
(verilog-get-expr)))
+                        (setq err nil))
+                       ))
+                    (end-of-line)
+                    (if kill-existing-comment
+                        (verilog-kill-existing-comment))
+                    (delete-horizontal-space)
+                    (insert (concat " // " str ))
+                    (if err (ding 't))))
+
+                 (;- This is a begin..end block
+                  (match-end 2)  ; of verilog-end-block-ordered-re
+                  (let ((str " // UNMATCHED !!")
+                        (err 't)
+                        (here (point))
+                        there
+                        cntx)
+                    (save-excursion
+                      (verilog-leap-to-head)
+                      (setq there (point))
+                      (if (not (match-end 0))
+                          (progn
+                            (goto-char here)
+                            (end-of-line)
+                            (if kill-existing-comment
+                                (verilog-kill-existing-comment))
+                            (delete-horizontal-space)
+                            (insert str)
+                            (ding 't))
+                        (let ((lim
+                               (save-excursion (verilog-beg-of-defun) (point)))
+                              (here (point)))
+                          (cond
+                           (;-- handle named block differently
+                            (looking-at verilog-named-block-re)
+                            (search-forward ":")
+                            (setq there (point))
+                            (setq str (verilog-get-expr))
+                            (setq err nil)
+                            (setq str (concat " // block: " str )))
+
+                           ((verilog-in-case-region-p) ;-- handle case item 
differently
+                            (goto-char here)
+                            (setq str (verilog-backward-case-item lim))
+                            (setq there (point))
+                            (setq err nil)
+                            (setq str (concat " // case: " str )))
+
+                           (;- try to find "reason" for this begin
+                            (cond
+                             (;
+                              (eq here (progn
+                                         ;;   (verilog-backward-token)
+                                         (verilog-beg-of-statement)
+                                         (point)))
+                              (setq err nil)
+                              (setq str ""))
+                             ((looking-at verilog-endcomment-reason-re)
+                              (setq there (match-end 0))
+                              (setq cntx (concat (match-string 0) " "))
+                              (cond
+                               (;- begin
+                                (match-end 1)
+                                (setq err nil)
+                                (save-excursion
+                                  (if (and (verilog-continued-line)
+                                           (looking-at 
"\\<repeat\\>\\|\\<wait\\>\\|\\<always\\>"))
+                                      (progn
+                                        (goto-char (match-end 0))
+                                        (setq there (point))
+                                        (setq str
+                                              (concat " // " (match-string 0) 
" " (verilog-get-expr))))
+                                    (setq str ""))))
+
+                               (;- else
+                                (match-end 2)
+                                (let ((nest 0)
+                                      ( reg 
"\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)\\|\\(assert\\)"))
+                                  (catch 'skip
+                                    (while (verilog-re-search-backward reg nil 
'move)
+                                      (cond
+                                       ((match-end 1) ; begin
+                                        (setq nest (1- nest)))
+                                       ((match-end 2)                       ; 
end
+                                        (setq nest (1+ nest)))
+                                       ((match-end 3)
+                                        (if (= 0 nest)
+                                            (progn
+                                              (goto-char (match-end 0))
+                                              (setq there (point))
+                                              (setq err nil)
+                                              (setq str (verilog-get-expr))
+                                              (setq str (concat " // else: 
!if" str ))
+                                              (throw 'skip 1))))
+                                       ((match-end 4)
+                                        (if (= 0 nest)
+                                            (progn
+                                              (goto-char (match-end 0))
+                                              (setq there (point))
+                                              (setq err nil)
+                                              (setq str (verilog-get-expr))
+                                              (setq str (concat " // else: 
!assert " str ))
+                                              (throw 'skip 1)))))))))
+                               (;- end else
+                                (match-end 3)
+                                (goto-char there)
+                                (let ((nest 0)
+                                      (reg 
"\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)\\|\\(assert\\)"))
+                                  (catch 'skip
+                                    (while (verilog-re-search-backward reg nil 
'move)
+                                      (cond
+                                       ((match-end 1) ; begin
+                                        (setq nest (1- nest)))
+                                       ((match-end 2)                       ; 
end
+                                        (setq nest (1+ nest)))
+                                       ((match-end 3)
+                                        (if (= 0 nest)
+                                            (progn
+                                              (goto-char (match-end 0))
+                                              (setq there (point))
+                                              (setq err nil)
+                                              (setq str (verilog-get-expr))
+                                              (setq str (concat " // else: 
!if" str ))
+                                              (throw 'skip 1))))
+                                       ((match-end 4)
+                                        (if (= 0 nest)
+                                            (progn
+                                              (goto-char (match-end 0))
+                                              (setq there (point))
+                                              (setq err nil)
+                                              (setq str (verilog-get-expr))
+                                              (setq str (concat " // else: 
!assert " str ))
+                                              (throw 'skip 1)))))))))
+
+                               (; always, always_comb, always_latch w/o @...
+                                (match-end 5)
+                                (goto-char (match-end 0))
+                                (setq there (point))
+                                (setq err nil)
+                                (setq str (concat " // " cntx )))
+
+                               (;- task/function/initial et cetera
+                                t
+                                (match-end 0)
+                                (goto-char (match-end 0))
+                                (setq there (point))
+                                (setq err nil)
+                                (setq str (concat " // " cntx 
(verilog-get-expr))))
+
+                               (;-- otherwise...
+                                (setq str " // auto-endcomment confused "))))
+
+                             ((and
+                               (verilog-in-case-region-p) ;-- handle case item 
differently
+                               (progn
+                                 (setq there (point))
+                                 (goto-char here)
+                                 (setq str (verilog-backward-case-item lim))))
+                              (setq err nil)
+                              (setq str (concat " // case: " str )))
+
+                             ((verilog-in-fork-region-p)
+                              (setq err nil)
+                              (setq str " // fork branch" ))
+
+                             ((looking-at "\\<end\\>")
+                              ;; HERE
+                              (forward-word 1)
+                              (verilog-forward-syntactic-ws)
+                              (setq err nil)
+                              (setq str (verilog-get-expr))
+                              (setq str (concat " // " cntx str )))
+
+                             ))))
+                        (goto-char here)
+                        (end-of-line)
+                        (if kill-existing-comment
+                            (verilog-kill-existing-comment))
+                        (delete-horizontal-space)
+                        (if (or err
+                                (> (count-lines here there) 
verilog-minimum-comment-distance))
+                            (insert str))
+                        (if err (ding 't))
+                        ))))
+                 (;- this is endclass, which can be nested
+                  (match-end 11)  ; of verilog-end-block-ordered-re
+                  ;;(goto-char there)
+                  (let ((nest 0)
+                        (reg 
"\\<\\(class\\)\\|\\(endclass\\)\\|\\(package\\|primitive\\|\\(macro\\)?module\\)\\>")
+                        string)
+                    (save-excursion
+                      (catch 'skip
+                        (while (verilog-re-search-backward reg nil 'move)
+                          (cond
+                           ((match-end 3)      ; endclass
+                            (ding 't)
+                            (setq string "unmatched endclass")
+                            (throw 'skip 1))
+
+                           ((match-end 2)      ; endclass
+                            (setq nest (1+ nest)))
+
+                           ((match-end 1) ; class
+                            (setq nest (1- nest))
+                            (if (< nest 0)
+                                (progn
+                                  (goto-char (match-end 0))
+                                  (let (b e)
+                                    (setq b (progn
+                                              (skip-chars-forward "^ \t")
+                                              (verilog-forward-ws&directives)
+                                              (point))
+                                          e (progn
+                                              (skip-chars-forward "a-zA-Z0-9_")
+                                              (point)))
+                                    (setq string (buffer-substring b e)))
+                                  (throw 'skip 1))))
+                           ))))
+                    (end-of-line)
+                    (if kill-existing-comment
+                        (verilog-kill-existing-comment))
+                    (delete-horizontal-space)
+                    (insert (concat " // " string ))))
+
+                 (;  - this is 
end{function,generate,task,module,primitive,table,generate}
+                  ;; - which can not be nested.
+                  t
+                  (let (string reg (name-re nil))
+                    (end-of-line)
+                    (if kill-existing-comment
+                        (save-match-data
+                          (verilog-kill-existing-comment)))
+                    (delete-horizontal-space)
+                    (backward-sexp)
+                    (cond
+                     ((match-end 5)  ; of verilog-end-block-ordered-re
+                      (setq reg 
"\\(\\<function\\>\\)\\|\\(\\<\\(endfunction\\|task\\|\\(macro\\)?module\\|primitive\\)\\>\\)")
+                      (setq name-re "\\w+\\(?:\n\\|\\s-\\)*[(;]"))
+                     ((match-end 6)  ; of verilog-end-block-ordered-re
+                      (setq reg 
"\\(\\<task\\>\\)\\|\\(\\<\\(endtask\\|function\\|\\(macro\\)?module\\|primitive\\)\\>\\)")
+                      (setq name-re "\\w+\\(?:\n\\|\\s-\\)*[(;]"))
+                     ((match-end 7)  ; of verilog-end-block-ordered-re
+                      (setq reg 
"\\(\\<\\(macro\\)?module\\>\\)\\|\\<endmodule\\>"))
+                     ((match-end 8)  ; of verilog-end-block-ordered-re
+                      (setq reg 
"\\(\\<primitive\\>\\)\\|\\(\\<\\(endprimitive\\|package\\|interface\\|\\(macro\\)?module\\)\\>\\)"))
+                     ((match-end 9)  ; of verilog-end-block-ordered-re
+                      (setq reg 
"\\(\\<interface\\>\\)\\|\\(\\<\\(endinterface\\|package\\|primitive\\|\\(macro\\)?module\\)\\>\\)"))
+                     ((match-end 10)  ; of verilog-end-block-ordered-re
+                      (setq reg 
"\\(\\<package\\>\\)\\|\\(\\<\\(endpackage\\|primitive\\|interface\\|\\(macro\\)?module\\)\\>\\)"))
+                     ((match-end 11)  ; of verilog-end-block-ordered-re
+                      (setq reg 
"\\(\\<class\\>\\)\\|\\(\\<\\(endclass\\|primitive\\|interface\\|\\(macro\\)?module\\)\\>\\)"))
+                     ((match-end 12)  ; of verilog-end-block-ordered-re
+                      (setq reg 
"\\(\\<covergroup\\>\\)\\|\\(\\<\\(endcovergroup\\|primitive\\|interface\\|\\(macro\\)?module\\)\\>\\)"))
+                     ((match-end 13)  ; of verilog-end-block-ordered-re
+                      (setq reg 
"\\(\\<program\\>\\)\\|\\(\\<\\(endprogram\\|primitive\\|interface\\|\\(macro\\)?module\\)\\>\\)"))
+                     ((match-end 14)  ; of verilog-end-block-ordered-re
+                      (setq reg 
"\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<\\(endsequence\\|primitive\\|interface\\|\\(macro\\)?module\\)\\>\\)"))
+                     ((match-end 15)  ; of verilog-end-block-ordered-re
+                      (setq reg "\\(\\<clocking\\>\\)\\|\\<endclocking\\>"))
+                     ((match-end 16)  ; of verilog-end-block-ordered-re
+                      (setq reg "\\(\\<property\\>\\)\\|\\<endproperty\\>"))
+
+                     (t (error "Problem in verilog-set-auto-endcomments")))
+                    (let (b e)
+                      (save-excursion
+                        (verilog-re-search-backward reg nil 'move)
+                        (cond
+                         ((match-end 1)
+                          (setq b (progn
+                                    (skip-chars-forward "^ \t")
+                                    (verilog-forward-ws&directives)
+                                    (if (looking-at "static\\|automatic")
+                                        (progn
+                                          (goto-char (match-end 0))
+                                          (verilog-forward-ws&directives)))
+                                    (if (and name-re 
(verilog-re-search-forward name-re nil 'move))
+                                        (progn
+                                          (goto-char (match-beginning 0))
+                                          (verilog-forward-ws&directives)))
+                                    (point))
+                                e (progn
+                                    (skip-chars-forward "a-zA-Z0-9_")
+                                    (point)))
+                          (setq string (buffer-substring b e)))
+                         (t
+                          (ding 't)
+                          (setq string "unmatched 
end(function|task|module|primitive|interface|package|class|clocking)")))))
+                    (end-of-line)
+                    (insert (concat " // " string )))
+                  ))))))))))
 
 (defun verilog-get-expr()
   "Grab expression at point, e.g., case ( a | b & (c ^d))."
@@ -5059,7 +5076,7 @@ Useful for creating tri's and other expanded fields."
        (let ((bpt (- (point) 2)))
          (end-of-line)
          (delete-region bpt (point))))))
-    ;;
+  ;;
   (goto-char (point-min))
   (while (re-search-forward "/\\*" nil t)
     (if (verilog-within-string)
@@ -5073,7 +5090,7 @@ Useful for creating tri's and other expanded fields."
   (interactive)
   (goto-char (point-min))
   (while (re-search-forward "\\([^;]\\)[ \t]*\n[ \t]*" nil t)
-       (replace-match "\\1 " nil nil)))
+    (replace-match "\\1 " nil nil)))
 
 (defun verilog-linter-name ()
   "Return name of linter, either surelint or verilint."
@@ -5085,7 +5102,7 @@ Useful for creating tri's and other expanded fields."
          ((equal compile-word1 "verilint") `verilint)
          ((equal lint-word1 "surelint")    `surelint)
          ((equal lint-word1 "verilint")    `verilint)
-         (t `surelint))))  ;; back compatibility
+          (t `surelint))))  ; back compatibility
 
 (defun verilog-lint-off ()
   "Convert a Verilog linter warning line into a disable statement.
@@ -5227,9 +5244,7 @@ FILENAME to find directory to run in, or defaults to 
`buffer-file-name'."
           ;; So avoid bytecomp's interactive-only by going through intern.
           (when fontlocked (funcall (intern "font-lock-fontify-buffer"))))))))
 
-
-;;
-;; Batch
+;;; Batch:
 ;;
 
 (defun verilog-warn (string &rest args)
@@ -5251,7 +5266,7 @@ This lets programs calling batch mode to easily extract 
error messages."
         (progn ,@body)
        (error
        (error "%%Error: %s%s" (error-message-string err)
-              (if (featurep 'xemacs) "\n" ""))))))  ;; XEmacs forgets to add a 
newline
+               (if (featurep 'xemacs) "\n" ""))))))  ; XEmacs forgets to add a 
newline
 
 (defun verilog-batch-execute-func (funref &optional no-save)
   "Internal processing of a batch command.
@@ -5291,7 +5306,7 @@ Save the result unless optional NO-SAVE is t."
                   (set-buffer buf)
                   (funcall funref)
                   (when (and (not no-save)
-                             (buffer-modified-p)) ;; Avoid "no changes to be 
saved"
+                              (buffer-modified-p))  ; Avoid "no changes to be 
saved"
                     (save-buffer)))))
             orig-buffer-list))))
 
@@ -5302,7 +5317,7 @@ with \\[verilog-auto] on all command-line files, and 
saves the buffers.
 For proper results, multiple filenames need to be passed on the command
 line in bottom-up order."
   (unless noninteractive
-    (error "Use verilog-batch-auto only with --batch"))  ;; Otherwise we'd 
mess up buffer modes
+    (error "Use verilog-batch-auto only with --batch"))  ; Otherwise we'd mess 
up buffer modes
   (verilog-batch-execute-func `verilog-auto))
 
 (defun verilog-batch-delete-auto ()
@@ -5310,7 +5325,7 @@ line in bottom-up order."
 This sets up the appropriate Verilog mode environment, deletes automatics
 with \\[verilog-delete-auto] on all command-line files, and saves the buffers."
   (unless noninteractive
-    (error "Use verilog-batch-delete-auto only with --batch"))  ;; Otherwise 
we'd mess up buffer modes
+    (error "Use verilog-batch-delete-auto only with --batch"))  ; Otherwise 
we'd mess up buffer modes
   (verilog-batch-execute-func `verilog-delete-auto))
 
 (defun verilog-batch-delete-trailing-whitespace ()
@@ -5319,7 +5334,7 @@ This sets up the appropriate Verilog mode environment, 
removes
 whitespace with \\[verilog-delete-trailing-whitespace] on all
 command-line files, and saves the buffers."
   (unless noninteractive
-    (error "Use verilog-batch-delete-trailing-whitespace only with --batch"))  
;; Otherwise we'd mess up buffer modes
+    (error "Use verilog-batch-delete-trailing-whitespace only with --batch"))  
; Otherwise we'd mess up buffer modes
   (verilog-batch-execute-func `verilog-delete-trailing-whitespace))
 
 (defun verilog-batch-diff-auto ()
@@ -5329,7 +5344,7 @@ with \\[verilog-diff-auto] on all command-line files, and 
reports an error
 if any differences are observed.  This is appropriate for adding to regressions
 to insure automatics are always properly maintained."
   (unless noninteractive
-    (error "Use verilog-batch-diff-auto only with --batch"))  ;; Otherwise 
we'd mess up buffer modes
+    (error "Use verilog-batch-diff-auto only with --batch"))  ; Otherwise we'd 
mess up buffer modes
   (verilog-batch-execute-func `verilog-diff-auto t))
 
 (defun verilog-batch-inject-auto ()
@@ -5339,7 +5354,7 @@ with \\[verilog-inject-auto] on all command-line files, 
and saves the buffers.
 For proper results, multiple filenames need to be passed on the command
 line in bottom-up order."
   (unless noninteractive
-    (error "Use verilog-batch-inject-auto only with --batch"))  ;; Otherwise 
we'd mess up buffer modes
+    (error "Use verilog-batch-inject-auto only with --batch"))  ; Otherwise 
we'd mess up buffer modes
   (verilog-batch-execute-func `verilog-inject-auto))
 
 (defun verilog-batch-indent ()
@@ -5347,12 +5362,10 @@ line in bottom-up order."
 This sets up the appropriate Verilog mode environment, calls
 \\[verilog-indent-buffer] on all command-line files, and saves the buffers."
   (unless noninteractive
-    (error "Use verilog-batch-indent only with --batch"))  ;; Otherwise we'd 
mess up buffer modes
+    (error "Use verilog-batch-indent only with --batch"))  ; Otherwise we'd 
mess up buffer modes
   (verilog-batch-execute-func `verilog-indent-buffer))
 
-
-;;
-;; Indentation
+;;; Indentation:
 ;;
 (defconst verilog-indent-alist
   '((block       . (+ ind verilog-indent-level))
@@ -5391,6 +5404,7 @@ type of the current line, return that lines' indent level 
and its type.
 Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)."
   (save-excursion
     (let* ((starting_position (point))
+          (case-fold-search nil)
           (par 0)
           (begin (looking-at "[ \t]*begin\\>"))
           (lim (save-excursion (verilog-re-search-backward 
"\\(\\<begin\\>\\)\\|\\(\\<module\\>\\)" nil t)))
@@ -5412,132 +5426,132 @@ Return a list of two elements: (INDENT-TYPE 
INDENT-LEVEL)."
                                            (not (or (looking-at "[ 
\t]*`[ou]vm_")
                                                     (looking-at "[ 
\t]*`vmm_")))))
                       (throw 'nesting 'directive))
-           ;; indent structs as if there were module level
-           (setq structres (verilog-in-struct-nested-p))
-           (cond ((not structres) nil)
-                 ;;((and structres (equal (char-after) ?\})) (throw 'nesting 
'struct-close))
-                 ((> structres 0) (throw 'nesting 'nested-struct))
-                 ((= structres 0) (throw 'nesting 'block))
-                 (t nil))
-
-          ;; if we are in a parenthesized list, and the user likes to indent 
these, return.
-          ;; unless we are in the newfangled coverpoint or constraint blocks
-          (if (and
-                verilog-indent-lists
-                (verilog-in-paren)
-                (not (verilog-in-coverage-p))
-                )
-              (progn (setq par 1)
-                      (throw 'nesting 'block)))
-
-          ;; See if we are continuing a previous line
-          (while t
-            ;; trap out if we crawl off the top of the buffer
-            (if (bobp) (throw 'nesting 'cpp))
-
-            (if (and (verilog-continued-line-1 lim)
-                      (or (not (verilog-in-coverage-p))
-                          (looking-at verilog-in-constraint-re) ))  ;; may 
still get hosed if concat in constraint
-                (let ((sp (point)))
-                  (if (and
-                       (not (looking-at verilog-complete-reg))
-                       (verilog-continued-line-1 lim))
-                      (progn (goto-char sp)
-                             (throw 'nesting 'cexp))
-
-                    (goto-char sp))
-                   (if (and (verilog-in-coverage-p)
-                            (looking-at verilog-in-constraint-re))
-                       (progn
-                        (beginning-of-line)
-                        (skip-chars-forward " \t")
-                        (throw 'nesting 'constraint)))
-                  (if (and begin
-                            (not verilog-indent-begin-after-if)
-                            (looking-at verilog-no-indent-begin-re))
-                      (progn
-                        (beginning-of-line)
-                        (skip-chars-forward " \t")
-                        (throw 'nesting 'statement))
-                    (progn
-                      (throw 'nesting 'cexp))))
-              ;; not a continued line
-              (goto-char starting_position))
-
-            (if (looking-at "\\<else\\>")
-                ;; search back for governing if, striding across begin..end 
pairs
-                ;; appropriately
-                (let ((elsec 1))
-                  (while (verilog-re-search-backward verilog-ends-re nil 'move)
-                    (cond
-                     ((match-end 1) ; else, we're in deep
-                      (setq elsec (1+ elsec)))
-                     ((match-end 2) ; if
-                      (setq elsec (1- elsec))
-                      (if (= 0 elsec)
-                          (if verilog-align-ifelse
-                              (throw 'nesting 'statement)
-                            (progn ;; back up to first word on this line
-                              (beginning-of-line)
-                              (verilog-forward-syntactic-ws)
-                              (throw 'nesting 'statement)))))
-                     ((match-end 3) ; assert block
-                      (setq elsec (1- elsec))
-                      (verilog-beg-of-statement) ;; doesn't get to beginning
-                      (if (looking-at verilog-property-re)
-                          (throw 'nesting 'statement) ; We don't need an 
endproperty for these
-                        (throw 'nesting 'block)        ;We still need an 
endproperty
-                        ))
-                     (t ; endblock
-                                       ; try to leap back to matching outward 
block by striding across
-                                       ; indent level changing tokens then 
immediately
-                                       ; previous line governs indentation.
-                      (let (( reg) (nest 1))
-                        ;;      verilog-ends =>  
else|if|end|join(_any|_none|)|endcase|endclass|endtable|endspecify|endfunction|endtask|endgenerate|endgroup
-                        (cond
-                         ((match-end 4) ; end
-                          ;; Search back for matching begin
-                          (setq reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)" ))
-                         ((match-end 5) ; endcase
-                          ;; Search back for matching case
-                          (setq reg 
"\\(\\<randcase\\>\\|\\<case[xz]?\\>[^:]\\)\\|\\(\\<endcase\\>\\)" ))
-                         ((match-end 6) ; endfunction
-                          ;; Search back for matching function
-                          (setq reg 
"\\(\\<function\\>\\)\\|\\(\\<endfunction\\>\\)" ))
-                         ((match-end 7) ; endtask
-                          ;; Search back for matching task
-                          (setq reg "\\(\\<task\\>\\)\\|\\(\\<endtask\\>\\)" ))
-                         ((match-end 8) ; endspecify
-                          ;; Search back for matching specify
-                          (setq reg 
"\\(\\<specify\\>\\)\\|\\(\\<endspecify\\>\\)" ))
-                         ((match-end 9) ; endtable
-                          ;; Search back for matching table
-                          (setq reg "\\(\\<table\\>\\)\\|\\(\\<endtable\\>\\)" 
))
-                         ((match-end 10) ; endgenerate
-                          ;; Search back for matching generate
-                          (setq reg 
"\\(\\<generate\\>\\)\\|\\(\\<endgenerate\\>\\)" ))
-                         ((match-end 11) ; joins
-                          ;; Search back for matching fork
-                          (setq reg 
"\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|none\\)?\\>\\)" ))
-                         ((match-end 12) ; class
-                          ;; Search back for matching class
-                          (setq reg "\\(\\<class\\>\\)\\|\\(\\<endclass\\>\\)" 
))
-                         ((match-end 13) ; covergroup
-                          ;; Search back for matching covergroup
-                          (setq reg 
"\\(\\<covergroup\\>\\)\\|\\(\\<endgroup\\>\\)" )))
-                        (catch 'skip
-                          (while (verilog-re-search-backward reg nil 'move)
-                            (cond
-                             ((match-end 1) ; begin
-                              (setq nest (1- nest))
-                              (if (= 0 nest)
-                                  (throw 'skip 1)))
-                             ((match-end 2) ; end
-                              (setq nest (1+ nest)))))
-                          )))))))
-            (throw 'nesting (verilog-calc-1)))
-          );; catch nesting
-                );; type
+                   ;; indent structs as if there were module level
+                   (setq structres (verilog-in-struct-nested-p))
+                   (cond ((not structres) nil)
+                         ;;((and structres (equal (char-after) ?\})) (throw 
'nesting 'struct-close))
+                         ((> structres 0) (throw 'nesting 'nested-struct))
+                         ((= structres 0) (throw 'nesting 'block))
+                         (t nil))
+
+                   ;; if we are in a parenthesized list, and the user likes to 
indent these, return.
+                   ;; unless we are in the newfangled coverpoint or constraint 
blocks
+                   (if (and
+                        verilog-indent-lists
+                        (verilog-in-paren)
+                        (not (verilog-in-coverage-p))
+                        )
+                       (progn (setq par 1)
+                              (throw 'nesting 'block)))
+
+                   ;; See if we are continuing a previous line
+                   (while t
+                     ;; trap out if we crawl off the top of the buffer
+                     (if (bobp) (throw 'nesting 'cpp))
+
+                     (if (and (verilog-continued-line-1 lim)
+                              (or (not (verilog-in-coverage-p))
+                                  (looking-at verilog-in-constraint-re) ))  ; 
may still get hosed if concat in constraint
+                         (let ((sp (point)))
+                           (if (and
+                                (not (looking-at verilog-complete-reg))
+                                (verilog-continued-line-1 lim))
+                               (progn (goto-char sp)
+                                      (throw 'nesting 'cexp))
+
+                             (goto-char sp))
+                           (if (and (verilog-in-coverage-p)
+                                    (looking-at verilog-in-constraint-re))
+                               (progn
+                                 (beginning-of-line)
+                                 (skip-chars-forward " \t")
+                                 (throw 'nesting 'constraint)))
+                           (if (and begin
+                                    (not verilog-indent-begin-after-if)
+                                    (looking-at verilog-no-indent-begin-re))
+                               (progn
+                                 (beginning-of-line)
+                                 (skip-chars-forward " \t")
+                                 (throw 'nesting 'statement))
+                             (progn
+                               (throw 'nesting 'cexp))))
+                       ;; not a continued line
+                       (goto-char starting_position))
+
+                     (if (looking-at "\\<else\\>")
+                         ;; search back for governing if, striding across 
begin..end pairs
+                         ;; appropriately
+                         (let ((elsec 1))
+                           (while (verilog-re-search-backward verilog-ends-re 
nil 'move)
+                             (cond
+                              ((match-end 1) ; else, we're in deep
+                               (setq elsec (1+ elsec)))
+                              ((match-end 2) ; if
+                               (setq elsec (1- elsec))
+                               (if (= 0 elsec)
+                                   (if verilog-align-ifelse
+                                       (throw 'nesting 'statement)
+                                     (progn  ; back up to first word on this 
line
+                                       (beginning-of-line)
+                                       (verilog-forward-syntactic-ws)
+                                       (throw 'nesting 'statement)))))
+                              ((match-end 3) ; assert block
+                               (setq elsec (1- elsec))
+                               (verilog-beg-of-statement)  ; doesn't get to 
beginning
+                               (if (looking-at verilog-property-re)
+                                   (throw 'nesting 'statement)  ; We don't 
need an endproperty for these
+                                 (throw 'nesting 'block)       ; We still need 
an endproperty
+                                 ))
+                              (t ; endblock
+                               ;; try to leap back to matching outward block 
by striding across
+                               ;; indent level changing tokens then immediately
+                               ;; previous line governs indentation.
+                               (let (( reg) (nest 1))
+                                 ;;     verilog-ends =>  
else|if|end|join(_any|_none|)|endcase|endclass|endtable|endspecify|endfunction|endtask|endgenerate|endgroup
+                                 (cond
+                                  ((match-end 4) ; end
+                                   ;; Search back for matching begin
+                                   (setq reg 
"\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)" ))
+                                  ((match-end 5) ; endcase
+                                   ;; Search back for matching case
+                                   (setq reg 
"\\(\\<randcase\\>\\|\\<case[xz]?\\>[^:]\\)\\|\\(\\<endcase\\>\\)" ))
+                                  ((match-end 6) ; endfunction
+                                   ;; Search back for matching function
+                                   (setq reg 
"\\(\\<function\\>\\)\\|\\(\\<endfunction\\>\\)" ))
+                                  ((match-end 7) ; endtask
+                                   ;; Search back for matching task
+                                   (setq reg 
"\\(\\<task\\>\\)\\|\\(\\<endtask\\>\\)" ))
+                                  ((match-end 8) ; endspecify
+                                   ;; Search back for matching specify
+                                   (setq reg 
"\\(\\<specify\\>\\)\\|\\(\\<endspecify\\>\\)" ))
+                                  ((match-end 9) ; endtable
+                                   ;; Search back for matching table
+                                   (setq reg 
"\\(\\<table\\>\\)\\|\\(\\<endtable\\>\\)" ))
+                                  ((match-end 10) ; endgenerate
+                                   ;; Search back for matching generate
+                                   (setq reg 
"\\(\\<generate\\>\\)\\|\\(\\<endgenerate\\>\\)" ))
+                                  ((match-end 11) ; joins
+                                   ;; Search back for matching fork
+                                   (setq reg 
"\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|none\\)?\\>\\)" ))
+                                  ((match-end 12) ; class
+                                   ;; Search back for matching class
+                                   (setq reg 
"\\(\\<class\\>\\)\\|\\(\\<endclass\\>\\)" ))
+                                  ((match-end 13) ; covergroup
+                                   ;; Search back for matching covergroup
+                                   (setq reg 
"\\(\\<covergroup\\>\\)\\|\\(\\<endgroup\\>\\)" )))
+                                 (catch 'skip
+                                   (while (verilog-re-search-backward reg nil 
'move)
+                                     (cond
+                                      ((match-end 1) ; begin
+                                       (setq nest (1- nest))
+                                       (if (= 0 nest)
+                                           (throw 'skip 1)))
+                                      ((match-end 2) ; end
+                                       (setq nest (1+ nest)))))
+                                   )))))))
+                     (throw 'nesting (verilog-calc-1)))
+                   )  ; catch nesting
+                ) ; type
           )
       ;; Return type of block and indent level.
       (if (not type)
@@ -5545,18 +5559,18 @@ Return a list of two elements: (INDENT-TYPE 
INDENT-LEVEL)."
       (if (> par 0)                    ; Unclosed Parenthesis
          (list 'cparenexp par)
        (cond
-         ((eq type 'case)
-          (list type (verilog-case-indent-level)))
-         ((eq type 'statement)
-          (list type (current-column)))
-         ((eq type 'defun)
-          (list type 0))
-         ((eq type 'constraint)
-          (list 'block (current-column)))
-         ((eq type 'nested-struct)
-          (list 'block structres))
-         (t
-          (list type (verilog-current-indent-level))))))))
+         ((eq type 'case)
+          (list type (verilog-case-indent-level)))
+         ((eq type 'statement)
+          (list type (current-column)))
+         ((eq type 'defun)
+          (list type 0))
+         ((eq type 'constraint)
+          (list 'block (current-column)))
+         ((eq type 'nested-struct)
+          (list 'block structres))
+         (t
+          (list type (verilog-current-indent-level))))))))
 
 (defun verilog-wai ()
   "Show matching nesting block for debugging."
@@ -5570,18 +5584,18 @@ Return a list of two elements: (INDENT-TYPE 
INDENT-LEVEL)."
       (if (and
           verilog-indent-lists
           (not(or (verilog-in-coverage-p)
-               (verilog-in-struct-p)))
+                   (verilog-in-struct-p)))
           (verilog-in-paren))
          (setq depth 1)
        (cond
-         ((eq type 'case)
-          (setq depth (verilog-case-indent-level)))
-         ((eq type 'statement)
-          (setq depth (current-column)))
-         ((eq type 'defun)
-          (setq depth 0))
-         (t
-          (setq depth (verilog-current-indent-level)))))
+         ((eq type 'case)
+          (setq depth (verilog-case-indent-level)))
+         ((eq type 'statement)
+          (setq depth (current-column)))
+         ((eq type 'defun)
+          (setq depth 0))
+         (t
+          (setq depth (verilog-current-indent-level)))))
       (message "You are at nesting %s depth %d" type depth))))
 
 (defun verilog-calc-1 ()
@@ -5589,108 +5603,115 @@ Return a list of two elements: (INDENT-TYPE 
INDENT-LEVEL)."
     (let ((re (concat "\\({\\|}\\|" verilog-indent-re "\\)"))
           (inconstraint (verilog-in-coverage-p)))
       (while (verilog-re-search-backward re nil 'move)
-       (catch 'continue
-         (cond
-          ((equal (char-after) ?\{)
+        (catch 'continue
+          (cond
+           ((equal (char-after) ?\{)
             ;; block type returned based on outer constraint { or inner
-           (if (verilog-at-constraint-p)
+            (if (verilog-at-constraint-p)
                 (cond (inconstraint
                        (beginning-of-line nil)
                        (skip-chars-forward " \t")
                        (throw 'nesting 'constraint))
                       (t
                        (throw 'nesting 'statement)))))
-          ((equal (char-after) ?\})
-           (let (par-pos
+           ((equal (char-after) ?\})
+            (let (par-pos
                   (there (verilog-at-close-constraint-p)))
-             (if there ;; we are at the } that closes a constraint.  Find the 
{ that opens it
-                 (progn
-                   (if (> (verilog-in-paren-count) 0)
+              (if there  ; we are at the } that closes a constraint.  Find the 
{ that opens it
+                  (progn
+                    (if (> (verilog-in-paren-count) 0)
                         (forward-char 1))
                     (setq par-pos (verilog-parenthesis-depth))
                     (cond (par-pos
-                          (goto-char par-pos)
-                          (forward-char 1))
-                         (t
-                          (backward-char 1)))))))
-
-          ((looking-at verilog-beg-block-re-ordered)
-           (cond
-            ((match-end 2)  ; *sigh* could be "unique case" or "priority casex"
-             (let ((here (point)))
-               (verilog-beg-of-statement)
-               (if (looking-at verilog-extended-case-re)
-                   (throw 'nesting 'case)
-                 (goto-char here)))
-             (throw 'nesting 'case))
-
-            ((match-end 4)  ; *sigh* could be "disable fork"
-             (let ((here (point)))
-               (verilog-beg-of-statement)
-               (if (looking-at verilog-disable-fork-re)
-                   t ; this is a normal statement
-                 (progn ; or is fork, starts a new block
-                   (goto-char here)
-                   (throw 'nesting 'block)))))
-
-            ((match-end 27)  ; *sigh* might be a clocking declaration
-             (let ((here (point)))
-               (if (verilog-in-paren)
-                   t ; this is a normal statement
-                 (progn ; or is fork, starts a new block
-                   (goto-char here)
-                   (throw 'nesting 'block)))))
-
-            ;; need to consider typedef struct here...
-            ((looking-at "\\<class\\|struct\\|function\\|task\\>")
-                                       ; *sigh* These words have an optional 
prefix:
-                                       ; extern {virtual|protected}? function 
a();
-                                       ; typedef class foo;
-                                       ; and we don't want to confuse this with
-                                       ; function a();
-                                       ; property
-                                       ; ...
-                                       ; endfunction
-             (verilog-beg-of-statement)
-             (if (looking-at verilog-beg-block-re-ordered)
-                 (throw 'nesting 'block)
-               (throw 'nesting 'defun)))
-
-            ;;
-            ((looking-at "\\<property\\>")
-                                       ; *sigh*
-                                       ;    {assert|assume|cover} property (); 
are complete
-                                       ;   and could also be labeled: - foo: 
assert property
-                                       ; but
-                                        ;    property ID () ... needs 
end_property
-             (verilog-beg-of-statement)
-             (if (looking-at verilog-property-re)
-                 (throw 'continue 'statement) ; We don't need an endproperty 
for these
-               (throw 'nesting 'block) ;We still need an endproperty
-               ))
-
-            (t              (throw 'nesting 'block))))
-
-          ((looking-at verilog-end-block-re)
-           (verilog-leap-to-head)
-           (if (verilog-in-case-region-p)
-               (progn
-                 (verilog-leap-to-case-head)
-                 (if (looking-at verilog-extended-case-re)
-                     (throw 'nesting 'case)))))
-
-          ((looking-at verilog-defun-level-re)
-           (if (looking-at verilog-defun-level-generate-only-re)
-               (if (verilog-in-generate-region-p)
-                   (throw 'continue 'foo)  ; always block in a generate - keep 
looking
-                 (throw 'nesting 'defun))
-             (throw 'nesting 'defun)))
-
-          ((looking-at verilog-cpp-level-re)
-           (throw 'nesting 'cpp))
-
-          ((bobp)
-           (throw 'nesting 'cpp)))))
+                           (goto-char par-pos)
+                           (forward-char 1))
+                          (t
+                           (backward-char 1)))))))
+
+           ((looking-at verilog-beg-block-re-ordered)
+            (cond
+             ((match-end 2)  ; *sigh* could be "unique case" or "priority 
casex"
+              (let ((here (point)))
+                (verilog-beg-of-statement)
+                (if (looking-at verilog-extended-case-re)
+                    (throw 'nesting 'case)
+                  (goto-char here)))
+              (throw 'nesting 'case))
+
+             ((match-end 4)  ; *sigh* could be "disable fork"
+              (let ((here (point)))
+                (verilog-beg-of-statement)
+                (if (looking-at verilog-disable-fork-re)
+                    t ; this is a normal statement
+                  (progn ; or is fork, starts a new block
+                    (goto-char here)
+                    (throw 'nesting 'block)))))
+
+             ((match-end 27)  ; *sigh* might be a clocking declaration
+              (let ((here (point)))
+                (if (verilog-in-paren)
+                    t ; this is a normal statement
+                  (progn ; or is fork, starts a new block
+                    (goto-char here)
+                    (throw 'nesting 'block)))))
+
+             ;; need to consider typedef struct here...
+             ((looking-at "\\<class\\|struct\\|function\\|task\\>")
+              ;; *sigh* These words have an optional prefix:
+              ;; extern {virtual|protected}? function a();
+              ;; typedef class foo;
+              ;; and we don't want to confuse this with
+              ;; function a();
+              ;; property
+              ;; ...
+              ;; endfunction
+              (verilog-beg-of-statement)
+              (cond
+               ((looking-at verilog-dpi-import-export-re)
+                (throw 'continue 'foo))
+               ((looking-at 
"\\<pure\\>\\s-+\\<virtual\\>\\s-+\\(?:\\<\\(local\\|protected\\|static\\)\\>\\s-+\\)?\\<\\(function\\|task\\)\\>\\s-+")
+                (throw 'nesting 'statement))
+               ((looking-at verilog-beg-block-re-ordered)
+                (throw 'nesting 'block))
+               (t
+                (throw 'nesting 'defun))))
+
+             ;;
+             ((looking-at "\\<property\\>")
+              ;; *sigh*
+              ;;    {assert|assume|cover} property (); are complete
+              ;;   and could also be labeled: - foo: assert property
+              ;; but
+              ;;    property ID () ... needs end_property
+              (verilog-beg-of-statement)
+              (if (looking-at verilog-property-re)
+                  (throw 'continue 'statement) ; We don't need an endproperty 
for these
+                (throw 'nesting 'block)        ;We still need an endproperty
+                ))
+
+             (t              (throw 'nesting 'block))))
+
+           ((looking-at verilog-end-block-re)
+            (verilog-leap-to-head)
+            (if (verilog-in-case-region-p)
+                (progn
+                  (verilog-leap-to-case-head)
+                  (if (looking-at verilog-extended-case-re)
+                      (throw 'nesting 'case)))))
+
+           ((looking-at verilog-defun-level-re)
+            (if (looking-at verilog-defun-level-generate-only-re)
+                (if (or (verilog-in-generate-region-p)
+                        (verilog-in-deferred-immediate-final-p))
+                    (throw 'continue 'foo)  ; always block in a generate - 
keep looking
+                  (throw 'nesting 'defun))
+              (throw 'nesting 'defun)))
+
+           ((looking-at verilog-cpp-level-re)
+            (throw 'nesting 'cpp))
+
+           ((bobp)
+            (throw 'nesting 'cpp)))))
 
       (throw 'nesting 'cpp))))
 
@@ -5698,8 +5719,8 @@ Return a list of two elements: (INDENT-TYPE 
INDENT-LEVEL)."
   "Return indentation level for directive.
 For speed, the searcher looks at the last directive, not the indent
 of the appropriate enclosing block."
-  (let ((base -1)      ;; Indent of the line that determines our indentation
-       (ind 0))        ;; Relative offset caused by other directives (like 
`endif on same line as `else)
+  (let ((base -1)  ; Indent of the line that determines our indentation
+        (ind 0))   ; Relative offset caused by other directives (like `endif 
on same line as `else)
     ;; Start at current location, scan back for another directive
 
     (save-excursion
@@ -5708,9 +5729,9 @@ of the appropriate enclosing block."
                  (verilog-re-search-backward verilog-directive-re nil t))
        (cond ((save-excursion (skip-chars-backward " \t") (bolp))
               (setq base (current-indentation))))
-       (cond ((and (looking-at verilog-directive-end) (< base 0))  ;; Only 
matters when not at BOL
+        (cond ((and (looking-at verilog-directive-end) (< base 0))  ; Only 
matters when not at BOL
               (setq ind (- ind verilog-indent-level-directive)))
-             ((and (looking-at verilog-directive-middle) (>= base 0))  ;; Only 
matters when at BOL
+              ((and (looking-at verilog-directive-middle) (>= base 0))  ; Only 
matters when at BOL
               (setq ind (+ ind verilog-indent-level-directive)))
              ((looking-at verilog-directive-begin)
               (setq ind (+ ind verilog-indent-level-directive)))))
@@ -5723,7 +5744,7 @@ of the appropriate enclosing block."
       (cond ((or (looking-at verilog-directive-middle)
                 (looking-at verilog-directive-end))
             (setq ind (max 0 (- ind verilog-indent-level-directive))))))
-   ind))
+    ind))
 
 (defun verilog-leap-to-case-head ()
   (let ((nest 1))
@@ -5784,7 +5805,7 @@ Jump from end to matching begin, from endcase to matching 
case, and so on."
       ;; 8: Search back for matching function
       (setq reg 
"\\(\\<function\\>\\)\\|\\(\\(\\(\\<virtual\\>\\s-+\\)\\|\\(\\<protected\\>\\s-+\\)\\)+\\<function\\>\\)")
       (setq nesting 'no))
-      ;;(setq reg "\\(\\<function\\>\\)\\|\\(\\<endfunction\\>\\)" ))
+     ;;(setq reg "\\(\\<function\\>\\)\\|\\(\\<endfunction\\>\\)" ))
      ((looking-at "\\<endgenerate\\>")
       ;; 8: Search back for matching generate
       (setq reg "\\(\\<generate\\>\\)\\|\\(\\<endgenerate\\>\\)" ))
@@ -5870,7 +5891,7 @@ Set point to where line starts."
                        (save-excursion
                          (skip-chars-backward " \t")
                          (not (bolp))))
-           (setq continued (verilog-backward-token)))))
+              (setq continued (verilog-backward-token)))))
       (setq continued nil))
     continued))
 
@@ -5884,14 +5905,14 @@ Set point to where line starts."
    (;-- Anything ending in a ; is complete
     (= (preceding-char) ?\;)
     nil)
-   (; If a "}" is prefixed by a ";", then this is a complete statement
-    ; i.e.: constraint foo { a = b; }
+   (;  If a "}" is prefixed by a ";", then this is a complete statement
+    ;; i.e.: constraint foo { a = b; }
     (= (preceding-char) ?\})
     (progn
       (backward-char)
       (not(verilog-at-close-constraint-p))))
    (;-- constraint foo { a = b }
-    ;   is a complete statement. *sigh*
+    ;;  is a complete statement. *sigh*
     (= (preceding-char) ?\{)
     (progn
       (backward-char)
@@ -5909,10 +5930,10 @@ Set point to where line starts."
     t)
 
    (;-- Could be 'case (foo)' or 'always @(bar)' which is complete
-    ;   also could be simply '@(foo)'
-    ;   or foo u1 #(a=8)
-    ;            (b, ... which ISN'T complete
-    ;;;; Do we need this???
+    ;;  also could be simply '@(foo)'
+    ;;  or foo u1 #(a=8)
+    ;;           (b, ... which ISN'T complete
+    ;; Do we need this???
     (= (preceding-char) ?\))
     (progn
       (backward-char)
@@ -5936,16 +5957,16 @@ Set point to where line starts."
          t)
         ((looking-at verilog-ovm-end-re)
          t)
-     ;; JBA find VMM macros
-     ((looking-at verilog-vmm-statement-re)
-      nil )
-     ((looking-at verilog-vmm-begin-re)
-      t)
-     ((looking-at verilog-vmm-end-re)
-      nil)
-     ;; JBA trying to catch macro lines with no ; at end
-     ((looking-at "\\<`")
-      nil)
+         ;; JBA find VMM macros
+         ((looking-at verilog-vmm-statement-re)
+          nil )
+         ((looking-at verilog-vmm-begin-re)
+          t)
+         ((looking-at verilog-vmm-end-re)
+          nil)
+         ;; JBA trying to catch macro lines with no ; at end
+         ((looking-at "\\<`")
+          nil)
         (t
          (goto-char back)
          (cond
@@ -6003,16 +6024,16 @@ Set point to where line starts."
 (defun verilog-backward-syntactic-ws-quick ()
   "As with `verilog-backward-syntactic-ws' but use `verilog-scan' cache."
   (while (cond ((bobp)
-               nil) ; Done
-              ((> (skip-syntax-backward " ") 0)
-               t)
-              ((eq (preceding-char) ?\n)  ;; \n's terminate // so aren't space 
syntax
-               (forward-char -1)
-               t)
-              ((or (verilog-inside-comment-or-string-p (1- (point)))
-                   (verilog-inside-comment-or-string-p (point)))
-               (re-search-backward "[/\"]" nil t) ;; Only way a comment or 
quote can begin
-               t))))
+                nil) ; Done
+               ((< (skip-syntax-backward " ") 0)
+                t)
+               ((eq (preceding-char) ?\n)  ; \n's terminate // so aren't space 
syntax
+                (forward-char -1)
+                t)
+               ((or (verilog-inside-comment-or-string-p (1- (point)))
+                    (verilog-inside-comment-or-string-p (point)))
+                (re-search-backward "[/\"]" nil t)  ; Only way a comment or 
quote can begin
+                t))))
 
 (defun verilog-forward-syntactic-ws ()
   (verilog-skip-forward-comment-p)
@@ -6029,10 +6050,10 @@ Optional BOUND limits search."
          (progn
            (let ((state (save-excursion (verilog-syntax-ppss))))
              (cond
-              ((nth 7 state) ;; in // comment
+               ((nth 7 state)  ; in // comment
                (verilog-re-search-backward "//" nil 'move)
                 (skip-chars-backward "/"))
-              ((nth 4 state) ;; in /* */ comment
+               ((nth 4 state)  ; in /* */ comment
                (verilog-re-search-backward "/\*" nil 'move))))
            (narrow-to-region bound (point))
            (while (/= here (point))
@@ -6041,6 +6062,9 @@ Optional BOUND limits search."
              (setq p
                    (save-excursion
                      (beginning-of-line)
+                     ;; for as long as we're right after a continued line, 
keep moving up
+                     (while (and (verilog-looking-back "\\\\[\n\r\f]" nil)
+                                  (forward-line -1)))
                      (cond
                       ((and verilog-highlight-translate-off
                             (verilog-within-translate-off))
@@ -6062,19 +6086,19 @@ Optional BOUND limits search."
          (progn
            (let ((state (save-excursion (verilog-syntax-ppss))))
              (cond
-              ((nth 7 state) ;; in // comment
+               ((nth 7 state)  ; in // comment
                (end-of-line)
                (forward-char 1)
                (skip-chars-forward " \t\n\f")
                )
-              ((nth 4 state) ;; in /* */ comment
+               ((nth 4 state)  ; in /* */ comment
                (verilog-re-search-forward "\*\/\\s-*" nil 'move))))
            (narrow-to-region (point) bound)
            (while (/= here (point))
              (setq here (point)
                    jump nil)
              (forward-comment (buffer-size))
-             (and (looking-at "\\s-*(\\*.*\\*)\\s-*") ;; Attribute
+              (and (looking-at "\\s-*(\\*.*\\*)\\s-*")  ; Attribute
                   (goto-char (match-end 0)))
              (save-excursion
                (beginning-of-line)
@@ -6084,38 +6108,38 @@ Optional BOUND limits search."
                  (beginning-of-line 2))))))))
 
 (defun verilog-in-comment-p ()
- "Return true if in a star or // comment."
- (let ((state (save-excursion (verilog-syntax-ppss))))
-   (or (nth 4 state) (nth 7 state))))
+  "Return true if in a star or // comment."
+  (let ((state (save-excursion (verilog-syntax-ppss))))
+    (or (nth 4 state) (nth 7 state))))
 
 (defun verilog-in-star-comment-p ()
- "Return true if in a star comment."
- (let ((state (save-excursion (verilog-syntax-ppss))))
-   (and
-    (nth 4 state)                      ; t if in a comment of style a // or b 
/**/
-       (not
-        (nth 7 state)                  ; t if in a comment of style b /**/
-        ))))
+  "Return true if in a star comment."
+  (let ((state (save-excursion (verilog-syntax-ppss))))
+    (and
+     (nth 4 state)                     ; t if in a comment of style a // or b 
/**/
+     (not
+      (nth 7 state)                    ; t if in a comment of style b /**/
+      ))))
 
 (defun verilog-in-slash-comment-p ()
- "Return true if in a slash comment."
- (let ((state (save-excursion (verilog-syntax-ppss))))
-   (nth 7 state)))
+  "Return true if in a slash comment."
+  (let ((state (save-excursion (verilog-syntax-ppss))))
+    (nth 7 state)))
 
 (defun verilog-in-comment-or-string-p ()
- "Return true if in a string or comment."
- (let ((state (save-excursion (verilog-syntax-ppss))))
-   (or (nth 3 state) (nth 4 state) (nth 7 state)))) ; Inside string or comment)
+  "Return true if in a string or comment."
+  (let ((state (save-excursion (verilog-syntax-ppss))))
+    (or (nth 3 state) (nth 4 state) (nth 7 state)))) ; Inside string or 
comment)
 
 (defun verilog-in-attribute-p ()
- "Return true if point is in an attribute (* [] attribute *)."
- (save-match-data
-   (save-excursion
-     (verilog-re-search-backward "\\((\\*\\)\\|\\(\\*)\\)" nil 'move)
-     (cond
-      ((match-end 1)
-         (progn (goto-char (match-end 1))
-                (not (looking-at "\\s-*)")))
+  "Return true if point is in an attribute (* [] attribute *)."
+  (save-match-data
+    (save-excursion
+      (verilog-re-search-backward "\\((\\*\\)\\|\\(\\*)\\)" nil 'move)
+      (cond
+       ((match-end 1)
+        (progn (goto-char (match-end 1))
+               (not (looking-at "\\s-*)")))
         nil)
        ((match-end 2)
         (progn (goto-char (match-beginning 2))
@@ -6124,91 +6148,93 @@ Optional BOUND limits search."
        (t nil)))))
 
 (defun verilog-in-parameter-p ()
- "Return true if point is in a parameter assignment #( p1=1, p2=5)."
- (save-match-data
-   (save-excursion
-     (verilog-re-search-backward "\\(#(\\)\\|\\()\\)" nil 'move)
-     (numberp (match-beginning 1)))))
+  "Return true if point is in a parameter assignment #( p1=1, p2=5)."
+  (save-match-data
+    (save-excursion
+      (verilog-re-search-backward "\\(#(\\)\\|\\()\\)" nil 'move)
+      (numberp (match-beginning 1)))))
 
 (defun verilog-in-escaped-name-p ()
- "Return true if in an escaped name."
- (save-excursion
-   (backward-char)
-   (skip-chars-backward "^ \t\n\f")
-   (if (equal (char-after (point) ) ?\\ )
-       t
-     nil)))
+  "Return true if in an escaped name."
+  (save-excursion
+    (backward-char)
+    (skip-chars-backward "^ \t\n\f")
+    (if (equal (char-after (point) ) ?\\ )
+        t
+      nil)))
+
 (defun verilog-in-directive-p ()
- "Return true if in a directive."
- (save-excursion
-   (beginning-of-line)
-   (looking-at verilog-directive-re-1)))
+  "Return true if in a directive."
+  (save-excursion
+    (beginning-of-line)
+    (looking-at verilog-directive-re-1)))
 
 (defun verilog-in-parenthesis-p ()
- "Return true if in a ( ) expression (but not { } or [ ])."
- (save-match-data
-   (save-excursion
-     (verilog-re-search-backward "\\((\\)\\|\\()\\)" nil 'move)
-     (numberp (match-beginning 1)))))
+  "Return true if in a ( ) expression (but not { } or [ ])."
+  (save-match-data
+    (save-excursion
+      (verilog-re-search-backward "\\((\\)\\|\\()\\)" nil 'move)
+      (numberp (match-beginning 1)))))
 
 (defun verilog-in-paren ()
- "Return true if in a parenthetical expression.
+  "Return true if in a parenthetical expression.
 May cache result using `verilog-syntax-ppss'."
- (let ((state (save-excursion (verilog-syntax-ppss))))
-   (> (nth 0 state) 0 )))
+  (let ((state (save-excursion (verilog-syntax-ppss))))
+    (> (nth 0 state) 0 )))
 
 (defun verilog-in-paren-count ()
- "Return paren depth, floor to 0.
+  "Return paren depth, floor to 0.
 May cache result using `verilog-syntax-ppss'."
- (let ((state (save-excursion (verilog-syntax-ppss))))
-   (if (> (nth 0 state) 0)
-       (nth 0 state)
-     0 )))
+  (let ((state (save-excursion (verilog-syntax-ppss))))
+    (if (> (nth 0 state) 0)
+        (nth 0 state)
+      0 )))
 
 (defun verilog-in-paren-quick ()
- "Return true if in a parenthetical expression.
+  "Return true if in a parenthetical expression.
 Always starts from `point-min', to allow inserts with hooks disabled."
- ;; The -quick refers to its use alongside the other -quick functions,
- ;; not that it's likely to be faster than verilog-in-paren.
- (let ((state (save-excursion (parse-partial-sexp (point-min) (point)))))
-   (> (nth 0 state) 0 )))
+  ;; The -quick refers to its use alongside the other -quick functions,
+  ;; not that it's likely to be faster than verilog-in-paren.
+  (let ((state (save-excursion (parse-partial-sexp (point-min) (point)))))
+    (> (nth 0 state) 0 )))
 
 (defun verilog-in-struct-p ()
- "Return true if in a struct declaration."
- (interactive)
- (save-excursion
-   (if (verilog-in-paren)
-       (progn
-        (verilog-backward-up-list 1)
-        (verilog-at-struct-p)
-        )
-     nil)))
+  "Return true if in a struct declaration."
+  (interactive)
+  (save-excursion
+    (if (verilog-in-paren)
+        (progn
+          (verilog-backward-up-list 1)
+          (verilog-at-struct-p)
+          )
+      nil)))
 
 (defun verilog-in-struct-nested-p ()
- "Return nil for not in struct.
+  "Return nil for not in struct.
 Return 0 for in non-nested struct.
 Return >0 for nested struct."
- (interactive)
- (let (col)
-   (save-excursion
-     (if (verilog-in-paren)
-         (progn
-           (verilog-backward-up-list 1)
-           (setq col (verilog-at-struct-mv-p))
-           (if col
-               (if (verilog-in-struct-p) (current-column) 0)))
-       nil))))
+  (interactive)
+  (let (col)
+    (save-excursion
+      (if (verilog-in-paren)
+          (progn
+            (verilog-backward-up-list 1)
+            (setq col (verilog-at-struct-mv-p))
+            (if col
+                (if (verilog-in-struct-p) (current-column) 0)))
+        nil))))
 
 (defun verilog-in-coverage-p ()
- "Return true if in a constraint or coverpoint expression."
- (interactive)
- (save-excursion
-   (if (verilog-in-paren)
-       (progn
-        (verilog-backward-up-list 1)
-        (verilog-at-constraint-p)
-        )
-     nil)))
+  "Return true if in a constraint or coverpoint expression."
+  (interactive)
+  (save-excursion
+    (if (verilog-in-paren)
+        (progn
+          (verilog-backward-up-list 1)
+          (verilog-at-constraint-p)
+          )
+      nil)))
+
 (defun verilog-at-close-constraint-p ()
   "If at the } that closes a constraint or covergroup, return true."
   (if (and
@@ -6218,8 +6244,8 @@ Return >0 for nested struct."
       (save-excursion
        (verilog-backward-ws&directives)
        (if (or (equal (char-before) ?\;)
-                (equal (char-before) ?\}) ;; can end with inner constraint { } 
block or ;
-                (equal (char-before) ?\{)) ;; empty constraint block
+                (equal (char-before) ?\})  ; can end with inner constraint { } 
block or ;
+                (equal (char-before) ?\{))  ; empty constraint block
            (point)
          nil))))
 
@@ -6227,17 +6253,17 @@ Return >0 for nested struct."
   "If at the { of a constraint or coverpoint definition, return true, moving 
point to constraint."
   (if (save-excursion
        (let ((p (point)))
-       (and
-        (equal (char-after) ?\{)
-        (forward-list)
-        (progn (backward-char 1)
-               (verilog-backward-ws&directives)
-         (and
-               (or (equal (char-before) ?\{) ;; empty case
-                    (equal (char-before) ?\;)
-                    (equal (char-before) ?\}))
-                    ;; skip what looks like bus repetition operator {#{
-                    (not (string-match "^{\\s-*[0-9]+\\s-*{" (buffer-substring 
p (point)))))))))
+          (and
+           (equal (char-after) ?\{)
+           (forward-list)
+           (progn (backward-char 1)
+                  (verilog-backward-ws&directives)
+                  (and
+                   (or (equal (char-before) ?\{)  ; empty case
+                       (equal (char-before) ?\;)
+                       (equal (char-before) ?\}))
+                   ;; skip what looks like bus repetition operator {#{
+                   (not (string-match "^{\\s-*[0-9]+\\s-*{" (buffer-substring 
p (point)))))))))
       (progn
         (let ( (pt (point)) (pass 0))
           (verilog-backward-ws&directives)
@@ -6246,7 +6272,7 @@ Return >0 for nested struct."
               (progn (setq pass 1)
                      (if (looking-at "\\<with\\>")
                          (progn (verilog-backward-ws&directives)
-                                (beginning-of-line) ;; 1
+                                (beginning-of-line)  ; 1
                                 (verilog-forward-ws&directives)
                                 1 )
                        (verilog-beg-of-statement)
@@ -6294,76 +6320,78 @@ Return >0 for nested struct."
     nil))
 
 (defun verilog-parenthesis-depth ()
- "Return non zero if in parenthetical-expression."
- (save-excursion (nth 1 (verilog-syntax-ppss))))
+  "Return non zero if in parenthetical-expression."
+  (save-excursion (nth 1 (verilog-syntax-ppss))))
 
 
 (defun verilog-skip-forward-comment-or-string ()
- "Return true if in a string or comment."
- (let ((state (save-excursion (verilog-syntax-ppss))))
-   (cond
-    ((nth 3 state)                     ;Inside string
-     (search-forward "\"")
-     t)
-    ((nth 7 state)                     ;Inside // comment
-     (forward-line 1)
-     t)
-    ((nth 4 state)                     ;Inside any comment (hence /**/)
-     (search-forward "*/"))
-    (t
-     nil))))
+  "Return true if in a string or comment."
+  (let ((state (save-excursion (verilog-syntax-ppss))))
+    (cond
+     ((nth 3 state)                    ;Inside string
+      (search-forward "\"")
+      t)
+     ((nth 7 state)                    ;Inside // comment
+      (forward-line 1)
+      t)
+     ((nth 4 state)                    ;Inside any comment (hence /**/)
+      (search-forward "*/"))
+     (t
+      nil))))
 
 (defun verilog-skip-backward-comment-or-string ()
- "Return true if in a string or comment."
- (let ((state (save-excursion (verilog-syntax-ppss))))
-   (cond
-    ((nth 3 state)                     ;Inside string
-     (search-backward "\"")
-     t)
-    ((nth 7 state)                     ;Inside // comment
-     (search-backward "//")
-     (skip-chars-backward "/")
-     t)
-    ((nth 4 state)                     ;Inside /* */ comment
-     (search-backward "/*")
-     t)
-    (t
-     nil))))
+  "Return true if in a string or comment."
+  (let ((state (save-excursion (verilog-syntax-ppss))))
+    (cond
+     ((nth 3 state)                    ;Inside string
+      (search-backward "\"")
+      t)
+     ((nth 7 state)                    ;Inside // comment
+      (search-backward "//")
+      (skip-chars-backward "/")
+      t)
+     ((nth 4 state)                    ;Inside /* */ comment
+      (search-backward "/*")
+      t)
+     (t
+      nil))))
 
 (defun verilog-skip-backward-comments ()
- "Return true if a comment was skipped."
- (let ((more t))
-   (while more
-     (setq more
-          (let ((state (save-excursion (verilog-syntax-ppss))))
-            (cond
-             ((nth 7 state)                    ;Inside // comment
-              (search-backward "//")
-              (skip-chars-backward "/")
-              (skip-chars-backward " \t\n\f")
-              t)
-             ((nth 4 state)                    ;Inside /* */ comment
-              (search-backward "/*")
-              (skip-chars-backward " \t\n\f")
-              t)
-             ((and (not (bobp))
-                   (= (char-before) ?\/)
-                   (= (char-before (1- (point))) ?\*))
-              (goto-char (- (point) 2))
-              t) ;; Let nth 4 state handle the rest
-             ((and (not (bobp))
-                   (verilog-looking-back "\\*)" nil)
-                   (not (verilog-looking-back "(\\s-*\\*)" nil)))
-              (goto-char (- (point) 2))
-              (if (search-backward "(*" nil t)
-                  (progn
-                    (skip-chars-backward " \t\n\f")
-                    t)
-                (progn
-                  (goto-char (+ (point) 2))
-                  nil)))
-             (t
-              (/= (skip-chars-backward " \t\n\f") 0))))))))
+  "Return true if a comment was skipped."
+  (let ((more t))
+    (while more
+      (setq more
+            (let ((state (save-excursion (verilog-syntax-ppss))))
+              (cond
+               ((nth 7 state)                  ;Inside // comment
+                (search-backward "//")
+                (skip-chars-backward "/")
+                (skip-chars-backward " \t\n\f")
+                t)
+               ((nth 4 state)                  ;Inside /* */ comment
+                (search-backward "/*")
+                (skip-chars-backward " \t\n\f")
+                t)
+               ((and (not (bobp))
+                     (= (char-before) ?\/)
+                     (= (char-before (1- (point))) ?\*))
+                (goto-char (- (point) 2))
+                t)  ; Let nth 4 state handle the rest
+               ((and (not (bobp))
+                     ;;(verilog-looking-back "\\*)" nil) ;; super slow, use 
two char-before instead
+                     (= (char-before) ?\))
+                     (= (char-before (1- (point))) ?\*)
+                     (not (verilog-looking-back "(\\s-*\\*)" nil))) ;; slow 
but unlikely to be called
+                (goto-char (- (point) 2))
+                (if (search-backward "(*" nil t)
+                    (progn
+                      (skip-chars-backward " \t\n\f")
+                      t)
+                  (progn
+                    (goto-char (+ (point) 2))
+                    nil)))
+               (t
+                (/= (skip-chars-backward " \t\n\f") 0))))))))
 
 (defun verilog-skip-forward-comment-p ()
   "If in comment, move to end and return true."
@@ -6397,7 +6425,7 @@ Return >0 for nested struct."
              (progn
                (goto-char h)
                nil))))
-        ((and (looking-at "(\\*")              ;; attribute start, but not an 
event (*) or (* )
+         ((and (looking-at "(\\*")  ; attribute start, but not an event (*) or 
(* )
               (not (looking-at "(\\*\\s-*)")))
          (progn
            (setq h (point))
@@ -6463,7 +6491,7 @@ Only look at a few lines to determine indent level."
                     (verilog-beg-of-statement-1)
                     (setq fst (point))
                     (if (looking-at verilog-declaration-re)
-                        (progn ;; we have multiple words
+                         (progn  ; we have multiple words
                           (goto-char (match-end 0))
                           (skip-chars-forward " \t")
                           (cond
@@ -6497,7 +6525,11 @@ Only look at a few lines to determine indent level."
          (let ((val))
            (verilog-beg-of-statement-1)
            (if (and (< (point) here)
-                    (verilog-re-search-forward "=[ \\t]*" here 'move))
+                    (verilog-re-search-forward "=[ \\t]*" here 'move)
+                    ;; not at a |=>, #=#, or [=n] operator
+                    (not (string-match "\\[=.\\|#=#\\||=>"
+                                        (or (buffer-substring (- (point) 2) 
(1+ (point)))
+                                            ""))))  ; don't let buffer 
over/under-run spoil the party
                (setq val (current-column))
              (setq val (eval (cdr (assoc type verilog-indent-alist)))))
            (goto-char here)
@@ -6509,11 +6541,11 @@ Only look at a few lines to determine indent level."
              (val (save-excursion
                     (verilog-backward-up-list 1)
                     (forward-char 1)
-             (if verilog-indent-lists
-                 (skip-chars-forward " \t")
-               (verilog-forward-syntactic-ws))
-             (setq here (point))
-             (current-column)))
+                     (if verilog-indent-lists
+                         (skip-chars-forward " \t")
+                       (verilog-forward-syntactic-ws))
+                     (setq here (point))
+                     (current-column)))
 
              (decl (save-excursion
                      (goto-char here)
@@ -6553,7 +6585,11 @@ Only look at a few lines to determine indent level."
       (and (or
            (eq type 'defun)
            (eq type 'block))
-          (looking-at verilog-declaration-re))
+          (looking-at verilog-declaration-re)
+           ;; Do not consider "virtual function", "virtual task", "virtual 
class"
+           ;; as declarations
+           (not (looking-at (concat verilog-declaration-re
+                                    "\\s-+\\(function\\|task\\|class\\)\\b"))))
       (verilog-indent-declaration ind))
 
      (;-- form feeds - ignored as bug in indent-line-to in < 24.5
@@ -6607,7 +6643,7 @@ Do not count named blocks or case-statements."
              (re-search-backward "/\\*" nil t)
              (1+(current-column))))
           (comment-column
-            comment-column )
+            comment-column )
           (t
            (save-excursion
              (re-search-backward "//" nil t)
@@ -6681,11 +6717,11 @@ Be verbose about progress unless optional QUIET set."
          )
     (save-excursion
       (if (progn
-;          (verilog-beg-of-statement-1)
-          (beginning-of-line)
-          (verilog-forward-syntactic-ws)
-          (and (not (verilog-in-directive-p))    ;; could have `define input 
foo
-               (looking-at verilog-declaration-re)))
+            ;; (verilog-beg-of-statement-1)
+            (beginning-of-line)
+            (verilog-forward-syntactic-ws)
+            (and (not (verilog-in-directive-p))  ; could have `define input foo
+                 (looking-at verilog-declaration-re)))
          (progn
            (if (verilog-parenthesis-depth)
                ;; in an argument list or parameter block
@@ -6693,7 +6729,7 @@ Be verbose about progress unless optional QUIET set."
                      start (progn
                              (goto-char e)
                              (verilog-backward-up-list 1)
-                             (forward-line) ;; ignore ( input foo,
+                              (forward-line)  ; ignore ( input foo,
                              (verilog-re-search-forward verilog-declaration-re 
el 'move)
                              (goto-char (match-beginning 0))
                              (skip-chars-backward " \t")
@@ -6752,11 +6788,11 @@ Be verbose about progress unless optional QUIET set."
              (cond
               ((save-excursion (skip-chars-backward " \t")
                                (bolp))
-                (verilog-forward-ws&directives)
-                (indent-line-to base-ind)
-                (verilog-forward-ws&directives)
-                (if (< (point) e)
-                    (verilog-re-search-forward "[ \t\n\f]" e 'move)))
+                (verilog-forward-ws&directives)
+                (indent-line-to base-ind)
+                (verilog-forward-ws&directives)
+                (if (< (point) e)
+                    (verilog-re-search-forward "[ \t\n\f]" e 'move)))
               (t
                (just-one-space)
                (verilog-re-search-forward "[ \t\n\f]" e 'move)))
@@ -6771,7 +6807,7 @@ Be verbose about progress unless optional QUIET set."
                          (> r 0))
              (setq e (point))
              (unless quiet (message "%d" r))
-          ;;(verilog-do-indent (verilog-calculate-indent)))
+              ;; (verilog-do-indent (verilog-calculate-indent)))
              (verilog-forward-ws&directives)
              (cond
               ((or (and verilog-indent-declaration-macros
@@ -6885,7 +6921,7 @@ Be verbose about progress unless optional QUIET set."
                   (cond
                    ((looking-at verilog-assignment-operation-re)
                     (goto-char (match-beginning 2))
-                    (if (not (or (verilog-in-parenthesis-p) ;; leave 
attributes and comparisons alone
+                    (if (not (or (verilog-in-parenthesis-p)  ; leave 
attributes and comparisons alone
                                  (verilog-in-coverage-p)))
                         (if (eq (char-after) ?=)
                             (indent-to (1+ ind))       ; line up the = of the 
<= with surrounding =
@@ -7018,7 +7054,7 @@ Region is defined by B and EDPOS."
       (while (progn (setq e (marker-position edpos))
                    (< (point) e))
        (if (and (verilog-re-search-forward myre e 'move)
-                (not (verilog-in-attribute-p))) ;; skip attribute exprs
+                 (not (verilog-in-attribute-p)))  ; skip attribute exprs
            (progn
              (goto-char (match-beginning 2))
              (verilog-backward-syntactic-ws)
@@ -7053,9 +7089,8 @@ Region is defined by B and EDPOS."
     (insert
      (format "%s %d" type val))))
 
-;; 
-;;
-;; Completion
+
+;;; Completion:
 ;;
 (defvar verilog-str nil)
 (defvar verilog-all nil)
@@ -7190,10 +7225,10 @@ TYPE is 'module, 'tf for task or function, or t if 
unknown."
   (if (string= verilog-str "")
       (setq verilog-str "[a-zA-Z_]"))
   (let ((verilog-str (concat (cond
-                            ((eq type 'module) "\\<\\(module\\)\\s +")
-                            ((eq type 'tf) "\\<\\(task\\|function\\)\\s +")
-                            (t "\\<\\(task\\|function\\|module\\)\\s +"))
-                           "\\<\\(" verilog-str "[a-zA-Z0-9_.]*\\)\\>"))
+                              ((eq type 'module) "\\<\\(module\\)\\s +")
+                              ((eq type 'tf) "\\<\\(task\\|function\\)\\s +")
+                              (t "\\<\\(task\\|function\\|module\\)\\s +"))
+                             "\\<\\(" verilog-str "[a-zA-Z0-9_.]*\\)\\>"))
        match)
 
     (if (not (looking-at verilog-defun-re))
@@ -7533,7 +7568,7 @@ If search fails, other files are checked based on
        (regexp "\\(module\\s-+\\w+\\s-*(\\)\\|\\(\\w+\\s-+\\w+\\s-*(\\)"))
     (with-output-to-temp-buffer "*Occur*"
       (save-excursion
-       (message (format "Searching for %s ..." regexp))
+       (message "Searching for %s ..." regexp)
        ;; Find next match, but give up if prev match was at end of buffer.
        (while (and (not (= prevpos (point-max)))
                    (verilog-re-search-forward regexp nil t))
@@ -7551,7 +7586,7 @@ If search fails, other files are checked based on
                        (goto-char (match-end 0))
                        (if (> nlines 0)
                            (forward-line (1+ nlines))
-                           (forward-line 1))
+                          (forward-line 1))
                        (point)))
                 (tag (format "%3d" linenum))
                 (empty (make-string (length tag) ?\ ))
@@ -7583,6 +7618,7 @@ If search fails, other files are checked based on
 
 ;; Highlight helper functions
 (defconst verilog-directive-regexp "\\(translate\\|coverage\\|lint\\)_")
+
 (defun verilog-within-translate-off ()
   "Return point if within translate-off region, else nil."
   (and (save-excursion
@@ -7595,15 +7631,15 @@ If search fails, other files are checked based on
 (defun verilog-start-translate-off (limit)
   "Return point before translate-off directive if before LIMIT, else nil."
   (when (re-search-forward
-         (concat "//\\s-*.*\\s-*" verilog-directive-regexp "off\\>")
-         limit t)
+         (concat "//\\s-*.*\\s-*" verilog-directive-regexp "off\\>")
+         limit t)
     (match-beginning 0)))
 
 (defun verilog-back-to-start-translate-off (limit)
   "Return point before translate-off directive if before LIMIT, else nil."
   (when (re-search-backward
-         (concat "//\\s-*.*\\s-*" verilog-directive-regexp "off\\>")
-         limit t)
+         (concat "//\\s-*.*\\s-*" verilog-directive-regexp "off\\>")
+         limit t)
     (match-beginning 0)))
 
 (defun verilog-end-translate-off (limit)
@@ -7649,7 +7685,7 @@ Bound search by LIMIT.  Adapted from
 See also `verilog-sk-header' for an alternative format."
   (interactive)
   (let ((start (point)))
-  (insert "\
+    (insert "\
 //-----------------------------------------------------------------------------
 // Title         : <title>
 // Project       : <project>
@@ -7721,8 +7757,7 @@ See also `verilog-sk-header' for an alternative format."
   (insert (format-time-string "%Y")))
 
 
-;;
-;; Signal list parsing
+;;; Signal list parsing:
 ;;
 
 ;; Elements of a signal list
@@ -7731,11 +7766,11 @@ See also `verilog-sk-header' for an alternative format."
   (list name bits comment mem enum signed type multidim modport))
 (defsubst verilog-sig-name (sig)
   (car sig))
-(defsubst verilog-sig-bits (sig) ;; First element of packed array (pre 
signal-name)
+(defsubst verilog-sig-bits (sig)  ; First element of packed array (pre 
signal-name)
   (nth 1 sig))
 (defsubst verilog-sig-comment (sig)
   (nth 2 sig))
-(defsubst verilog-sig-memory (sig) ;; Unpacked array (post signal-name)
+(defsubst verilog-sig-memory (sig)  ; Unpacked array (post signal-name)
   (nth 3 sig))
 (defsubst verilog-sig-enum (sig)
   (nth 4 sig))
@@ -7745,7 +7780,7 @@ See also `verilog-sk-header' for an alternative format."
   (nth 6 sig))
 (defsubst verilog-sig-type-set (sig type)
   (setcar (nthcdr 6 sig) type))
-(defsubst verilog-sig-multidim (sig) ;; Second and additional elements of 
packed array
+(defsubst verilog-sig-multidim (sig)  ; Second and additional elements of 
packed array
   (nth 7 sig))
 (defsubst verilog-sig-multidim-string (sig)
   (if (verilog-sig-multidim sig)
@@ -7777,11 +7812,11 @@ See also `verilog-sk-header' for an alternative format."
 (defsubst verilog-modport-name (sig)
   (car sig))
 (defsubst verilog-modport-clockings (sig)
-  (nth 1 sig)) ;; Returns list of names
+  (nth 1 sig))  ; Returns list of names
 (defsubst verilog-modport-clockings-add (sig val)
   (setcar (nthcdr 1 sig) (cons val (nth 1 sig))))
 (defsubst verilog-modport-decls (sig)
-  (nth 2 sig)) ;; Returns verilog-decls-* structure
+  (nth 2 sig))  ; Returns verilog-decls-* structure
 (defsubst verilog-modport-decls-set (sig val)
   (setcar (nthcdr 2 sig) val))
 
@@ -7793,7 +7828,7 @@ See also `verilog-sk-header' for an alternative format."
   (aref modi 1))
 (defsubst verilog-modi-get-point (modi)
   (aref modi 2))
-(defsubst verilog-modi-get-type (modi) ;; "module" or "interface"
+(defsubst verilog-modi-get-type (modi)  ; "module" or "interface"
   (aref modi 3))
 (defsubst verilog-modi-get-decls (modi)
   (verilog-modi-cache-results modi 'verilog-read-decls))
@@ -7819,8 +7854,8 @@ See also `verilog-sk-header' for an alternative format."
   (aref decls 2))
 (defsubst verilog-decls-get-vars (decls)
   (aref decls 3))
-(defsubst verilog-decls-get-modports (decls) ;; Also for clocking blocks; 
contains another verilog-decls struct
-  (aref decls 4))  ;; Returns verilog-modport* structure
+(defsubst verilog-decls-get-modports (decls)  ; Also for clocking blocks; 
contains another verilog-decls struct
+  (aref decls 4))  ; Returns verilog-modport* structure
 (defsubst verilog-decls-get-assigns (decls)
   (aref decls 5))
 (defsubst verilog-decls-get-consts (decls)
@@ -7985,7 +8020,8 @@ Signals must be in standard (base vector) form."
 (defun verilog-signals-combine-bus (in-list)
   "Return a list of signals in IN-LIST, with buses combined.
 Duplicate signals are also removed.  For example A[2] and A[1] become A[2:1]."
-  (let (combo buswarn
+  (let (combo
+        buswarn
        out-list
        sig highbit lowbit              ; Temp information about current signal
        sv-name sv-highbit sv-lowbit    ; Details about signal we are forming
@@ -8037,7 +8073,7 @@ Duplicate signals are also removed.  For example A[2] and 
A[1] become A[2:1]."
             ;; Combine with this signal
             (when (and sv-busstring
                        (not (equal sv-busstring (verilog-sig-bits sig))))
-              (when nil  ;; Debugging
+               (when nil  ; Debugging
                 (message (concat "Warning, can't merge into single bus "
                                  sv-name bus
                                  ", the AUTOs may be wrong")))
@@ -8157,17 +8193,17 @@ Tieoff value uses `verilog-active-low-regexp' and
 
 (defun verilog-read-inst-backward-name ()
   "Internal.  Move point back to beginning of inst-name."
-    (verilog-backward-open-paren)
-    (let (done)
-      (while (not done)
-       (verilog-re-search-backward-quick "\\()\\|\\b[a-zA-Z0-9`_\$]\\|\\]\\)" 
nil nil)  ; ] isn't word boundary
-       (cond ((looking-at ")")
-              (verilog-backward-open-paren))
-             (t (setq done t)))))
-    (while (looking-at "\\]")
-      (verilog-backward-open-bracket)
-      (verilog-re-search-backward-quick "\\(\\b[a-zA-Z0-9`_\$]\\|\\]\\)" nil 
nil))
-    (skip-chars-backward "a-zA-Z0-9`_$"))
+  (verilog-backward-open-paren)
+  (let (done)
+    (while (not done)
+      (verilog-re-search-backward-quick "\\()\\|\\b[a-zA-Z0-9`_\$]\\|\\]\\)" 
nil nil)  ; ] isn't word boundary
+      (cond ((looking-at ")")
+             (verilog-backward-open-paren))
+            (t (setq done t)))))
+  (while (looking-at "\\]")
+    (verilog-backward-open-bracket)
+    (verilog-re-search-backward-quick "\\(\\b[a-zA-Z0-9`_\$]\\|\\]\\)" nil 
nil))
+  (skip-chars-backward "a-zA-Z0-9`_$"))
 
 (defun verilog-read-inst-module-matcher ()
   "Set match data 0 with module_name when point is inside instantiation."
@@ -8296,12 +8332,12 @@ Return an array of [outputs inouts inputs wire reg 
assign const]."
          (or (search-forward "*)")
              (error "%s: Unmatched (* *), at char %d" (verilog-point-text) 
(point))))
         ((eq ?\" (following-char))
-         (or (re-search-forward "[^\\]\"" nil t)       ;; don't forward-char 
first, since we look for a non backslash first
+          (or (re-search-forward "[^\\]\"" nil t)  ; don't forward-char first, 
since we look for a non backslash first
              (error "%s: Unmatched quotes, at char %d" (verilog-point-text) 
(point))))
         ((eq ?\; (following-char))
-         (cond (in-ign-to-semi  ;; Such as inside a "import ...;" in a module 
header
+          (cond (in-ign-to-semi  ; Such as inside a "import ...;" in a module 
header
                 (setq in-ign-to-semi nil))
-               ((and in-modport (not (eq in-modport t))) ;; end of a modport 
declaration
+                ((and in-modport (not (eq in-modport t)))  ; end of a modport 
declaration
                 (verilog-modport-decls-set
                  in-modport
                  (verilog-decls-new sigs-out sigs-inout sigs-in
@@ -8341,11 +8377,11 @@ Return an array of [outputs inouts inputs wire reg 
assign const]."
                         (if (verilog-sig-memory newsig)
                             (concat (verilog-sig-memory newsig) (match-string 
1))
                           (match-string 1))))
-               (vec ;; Multidimensional
+                (vec  ; Multidimensional
                 (setq multidim (cons vec multidim))
                 (setq vec (verilog-string-replace-matches
                            "\\s-+" "" nil nil (match-string 1))))
-               (t ;; Bit width
+                (t  ; Bit width
                 (setq vec (verilog-string-replace-matches
                            "\\s-+" "" nil nil (match-string 1))))))
         ;; Normal or escaped identifier -- note we remember the \ if escaped
@@ -8353,13 +8389,13 @@ Return an array of [outputs inouts inputs wire reg 
assign const]."
          (goto-char (match-end 0))
          (setq keywd (match-string 1))
          (when (string-match "^\\\\" (match-string 1))
-           (setq keywd (concat keywd " ")))  ;; Escaped ID needs space at end
+            (setq keywd (concat keywd " ")))  ; Escaped ID needs space at end
          ;; Add any :: package names to same identifier
          (while (looking-at "\\s-*::\\s-*\\([a-zA-Z0-9`_$]+\\|\\\\[^ 
\t\n\f]+\\)")
            (goto-char (match-end 0))
            (setq keywd (concat keywd "::" (match-string 1)))
            (when (string-match "^\\\\" (match-string 1))
-             (setq keywd (concat keywd " "))))  ;; Escaped ID needs space at 
end
+              (setq keywd (concat keywd " "))))  ; Escaped ID needs space at 
end
          (cond ((equal keywd "input")
                 (setq vec nil        enum nil      rvalue nil  newsig nil  
signed nil
                       typedefed nil  multidim nil  ptype nil   modport nil
@@ -8419,7 +8455,7 @@ Return an array of [outputs inouts inputs wire reg assign 
const]."
                ((equal keywd "clocking")
                 (setq in-clocking t))
                ((equal keywd "import")
-                (if v2kargs-ok  ;; import in module header, not a modport 
import
+                 (if v2kargs-ok  ; import in module header, not a modport 
import
                     (setq in-ign-to-semi t  rvalue t)))
                ((equal keywd "type")
                 (setq ptype t))
@@ -8552,7 +8588,7 @@ Return an array of [outputs inouts inputs wire reg assign 
const]."
       (if vec (setq vec  (verilog-symbol-detick-denumber vec)))
       (if multidim (setq multidim  (mapcar `verilog-symbol-detick-denumber 
multidim)))
       (unless (or (not sig)
-                 (equal sig ""))  ;; Ignore .foo(1'b1) assignments
+                  (equal sig ""))  ; Ignore .foo(1'b1) assignments
        (cond ((or (setq portdata (assoc port (verilog-decls-get-inouts 
submoddecls)))
                   (equal "inout" verilog-read-sub-decls-gate-ios))
               (setq sigs-inout
@@ -8650,7 +8686,7 @@ Return an array of [outputs inouts inputs wire reg assign 
const]."
       ;; Remove leading reduction operators, etc
       (setq expr (verilog-string-replace-matches "^\\s-*[---+~!|&]+\\s-*" "" 
nil nil expr))
       ;;(message "vrsde-ptop: '%s'" expr)
-      (cond ;; Find \signal. Final space is part of escaped signal name
+      (cond  ; Find \signal. Final space is part of escaped signal name
        ((string-match "^\\s-*\\(\\\\[^ \t\n\f]+\\s-\\)" expr)
        ;;(message "vrsde-s: '%s'" (match-string 1 expr))
        (setq sig (match-string 1 expr)
@@ -8684,7 +8720,7 @@ Inserts the list of signals found, using submodi to look 
up each port."
               (goto-char (match-end 0)))
              ;; .\escaped (
              ((looking-at "\\s-*\\.\\s-*\\(\\\\[^ \t\n\f]*\\)\\s-*(\\s-*")
-              (setq port (concat (match-string 1) " ")) ;; escaped id's need 
trailing space
+               (setq port (concat (match-string 1) " "))  ; escaped id's need 
trailing space
               (goto-char (match-end 0)))
              ;; .name
              ((looking-at "\\s-*\\.\\s-*\\([a-zA-Z0-9`_$]*\\)\\s-*[,)/]")
@@ -8700,10 +8736,10 @@ Inserts the list of signals found, using submodi to 
look up each port."
               (setq port nil))
              ;; random
              ((looking-at "\\s-*\\.[^(]*(")
-              (setq port nil) ;; skip this line
+               (setq port nil)  ; skip this line
               (goto-char (match-end 0)))
              (t
-              (setq port nil  done t))) ;; Unknown, ignore rest of line
+               (setq port nil  done t)))  ; Unknown, ignore rest of line
        ;; Get signal name.  Point is at the first-non-space after (
        ;; We intentionally ignore (non-escaped) signals with .s in them
        ;; this prevents AUTOWIRE etc from noticing hierarchical sigs.
@@ -8819,19 +8855,19 @@ Outputs comments above subcell signals, for example:
                  ;; However I want it to be runnable even on user's manually 
added signals
                  (let ((verilog-read-sub-decls-in-interfaced t))
                    (while (re-search-forward "\\s *(?\\s *// Interfaced" 
end-inst-point t)
-                     (verilog-read-sub-decls-line submoddecls comment))) ;; 
Modifies sigs-ifd
+                      (verilog-read-sub-decls-line submoddecls comment)))  ; 
Modifies sigs-ifd
                  (goto-char st-point)
                  (while (re-search-forward "\\s *(?\\s *// Interfaces" 
end-inst-point t)
-                   (verilog-read-sub-decls-line submoddecls comment)) ;; 
Modifies sigs-out
+                    (verilog-read-sub-decls-line submoddecls comment))  ; 
Modifies sigs-out
                  (goto-char st-point)
                  (while (re-search-forward "\\s *(?\\s *// Outputs" 
end-inst-point t)
-                   (verilog-read-sub-decls-line submoddecls comment)) ;; 
Modifies sigs-out
+                    (verilog-read-sub-decls-line submoddecls comment))  ; 
Modifies sigs-out
                  (goto-char st-point)
                  (while (re-search-forward "\\s *(?\\s *// Inouts" 
end-inst-point t)
-                   (verilog-read-sub-decls-line submoddecls comment)) ;; 
Modifies sigs-inout
+                    (verilog-read-sub-decls-line submoddecls comment))  ; 
Modifies sigs-inout
                  (goto-char st-point)
                  (while (re-search-forward "\\s *(?\\s *// Inputs" 
end-inst-point t)
-                   (verilog-read-sub-decls-line submoddecls comment)) ;; 
Modifies sigs-in
+                    (verilog-read-sub-decls-line submoddecls comment))  ; 
Modifies sigs-in
                  )))))))
       ;; Combine duplicate bits
       ;;(setq rr (vector sigs-out sigs-inout sigs-in))
@@ -8846,7 +8882,7 @@ Outputs comments above subcell signals, for example:
   "Return an array of [ pins ] for the current instantiation at point.
 For example if declare A A (.B(SIG)) then B will be included in the list."
   (save-excursion
-    (let ((end-mod-point (point))      ;; presume at /*AUTOINST*/ point
+    (let ((end-mod-point (point))  ; presume at /*AUTOINST*/ point
          pins pin)
       (verilog-backward-open-paren)
       (while (re-search-forward "\\.\\([^(,) \t\n\f]*\\)\\s-*" end-mod-point t)
@@ -8860,7 +8896,7 @@ For example if declare A A (.B(SIG)) then B will be 
included in the list."
 (defun verilog-read-arg-pins ()
   "Return an array of [ pins ] for the current argument declaration at point."
   (save-excursion
-    (let ((end-mod-point (point))      ;; presume at /*AUTOARG*/ point
+    (let ((end-mod-point (point))  ; presume at /*AUTOARG*/ point
          pins pin)
       (verilog-backward-open-paren)
       (while (re-search-forward "\\([a-zA-Z0-9$_.%`]+\\)" end-mod-point t)
@@ -8881,7 +8917,7 @@ For example if declare A A (.B(SIG)) then B will be 
included in the list."
        (search-forward "(" end-mod-point)
        (setq tpl-end-pt (save-excursion
                           (backward-char 1)
-                          (verilog-forward-sexp-cmt 1)   ;; Moves to paren 
that closes argdecl's
+                           (verilog-forward-sexp-cmt 1)  ; Moves to paren that 
closes argdecl's
                           (backward-char 1)
                           (point)))
        (while (re-search-forward "\\s-*\\([\"a-zA-Z0-9$_.%`]+\\)\\s-*,*" 
tpl-end-pt t)
@@ -8907,18 +8943,18 @@ Must call `verilog-read-auto-lisp-present' before this 
function."
       (while (re-search-forward "\\<AUTO_LISP(" end t)
        (backward-char)
        (let* ((beg-pt (prog1 (point)
-                        (verilog-forward-sexp-cmt 1))) ;; Closing paren
+                         (verilog-forward-sexp-cmt 1)))  ; Closing paren
               (end-pt (point))
               (verilog-in-hooks t))
          (eval-region beg-pt end-pt nil))))))
 
 (defun verilog-read-always-signals-recurse
-  (exit-keywd rvalue temp-next)
+    (exit-keywd rvalue temp-next)
   "Recursive routine for parentheses/bracket matching.
 EXIT-KEYWD is expression to stop at, nil if top level.
 RVALUE is true if at right hand side of equal.
 IGNORE-NEXT is true to ignore next token, fake from inside case statement."
-  (let* ((semi-rvalue (equal "endcase" exit-keywd)) ;; true if after a ; we 
are looking for rvalue
+  (let* ((semi-rvalue (equal "endcase" exit-keywd))  ; true if after a ; we 
are looking for rvalue
         keywd last-keywd sig-tolk sig-last-tolk gotend got-sig got-list 
end-else-check
         ignore-next)
     ;;(if dbg (setq dbg (concat dbg (format "Recursion %S %S %S\n" exit-keywd 
rvalue temp-next))))
@@ -8971,16 +9007,16 @@ IGNORE-NEXT is true to ignore next token, fake from 
inside case statement."
            (if (looking-at "'[sS]?[hdxboHDXBO]?[ \t]*[0-9a-fA-F_xzXZ?]+")
                (goto-char (match-end 0))
              (forward-char 1)))
-          ((equal keywd ":")   ;; Case statement, begin/end label, x?y:z
-           (cond ((equal "endcase" exit-keywd)  ;; case x: y=z; statement next
+           ((equal keywd ":")  ; Case statement, begin/end label, x?y:z
+            (cond ((equal "endcase" exit-keywd)  ; case x: y=z; statement next
                   (setq ignore-next nil rvalue nil))
-                 ((equal "?" exit-keywd)  ;; x?y:z rvalue
-                  ) ;; NOP
-                 ((equal "]" exit-keywd)  ;; [x:y] rvalue
-                  ) ;; NOP
-                 (got-sig      ;; label: statement
+                  ((equal "?" exit-keywd)  ; x?y:z rvalue
+                   )  ; NOP
+                  ((equal "]" exit-keywd)  ; [x:y] rvalue
+                   )  ; NOP
+                  (got-sig  ; label: statement
                   (setq ignore-next nil rvalue semi-rvalue got-sig nil))
-                 ((not rvalue) ;; begin label
+                  ((not rvalue)  ; begin label
                   (setq ignore-next t rvalue nil)))
            (forward-char 1))
           ((equal keywd "=")
@@ -9004,7 +9040,7 @@ IGNORE-NEXT is true to ignore next token, fake from 
inside case statement."
            (verilog-read-always-signals-recurse "]" t nil))
           ((equal keywd "(")
            (forward-char 1)
-           (cond (sig-last-tolk        ;; Function call; zap last signal
+            (cond (sig-last-tolk  ; Function call; zap last signal
                   (setq got-sig nil)))
            (cond ((equal last-keywd "for")
                   ;; temp-next: Variables on LHS are lvalues, but generally we 
want
@@ -9023,13 +9059,13 @@ IGNORE-NEXT is true to ignore next token, fake from 
inside case statement."
            (skip-syntax-forward "w_")
            (verilog-read-always-signals-recurse "endcase" t nil)
            (setq ignore-next nil  rvalue semi-rvalue)
-           (if (not exit-keywd) (setq gotend t)))      ;; top level begin/end
-          ((string-match "^[$`a-zA-Z_]" keywd) ;; not exactly word constituent
+            (if (not exit-keywd) (setq gotend t)))  ; top level begin/end
+           ((string-match "^[$`a-zA-Z_]" keywd)  ; not exactly word constituent
            (cond ((member keywd '("`ifdef" "`ifndef" "`elsif"))
                   (setq ignore-next t))
                  ((or ignore-next
                       (member keywd verilog-keywords)
-                      (string-match "^\\$" keywd))     ;; PLI task
+                       (string-match "^\\$" keywd))  ; PLI task
                   (setq ignore-next nil))
                  (t
                   (setq keywd (verilog-symbol-detick-denumber keywd))
@@ -9062,7 +9098,7 @@ IGNORE-NEXT is true to ignore next token, fake from 
inside case statement."
 (defun verilog-read-always-signals ()
   "Parse always block at point and return list of (outputs inout inputs)."
   (save-excursion
-    (let* (;;(dbg "")
+    (let* (;(dbg "")
           sigs-out-d sigs-out-i sigs-out-unk sigs-temp sigs-in)
       (verilog-read-always-signals-recurse nil nil nil)
       (setq sigs-out-i (append sigs-out-i sigs-out-unk)
@@ -9126,7 +9162,7 @@ Returns REGEXP and list of ( (signal_name 
connection_name)... )."
              (setq lineno (1+ lineno))))))
       (setq tpl-end-pt (save-excursion
                         (backward-char 1)
-                        (verilog-forward-sexp-cmt 1)   ;; Moves to paren that 
closes argdecl's
+                         (verilog-forward-sexp-cmt 1)  ; Moves to paren that 
closes argdecl's
                         (backward-char 1)
                         (point)))
       ;;
@@ -9207,13 +9243,19 @@ If found returns `verilog-read-auto-template-inside' 
structure."
 (defvar verilog-auto-template-hits nil "Successful lookups with 
`verilog-read-auto-template-hit'.")
 (make-variable-buffer-local 'verilog-auto-template-hits)
 
+(defun verilog-read-auto-template-init ()
+  "Initialize `verilog-read-auto-template'."
+  (when (eval-when-compile (fboundp 'make-hash-table))  ; else feature not 
allowed
+    (when verilog-auto-template-warn-unused
+      (setq verilog-auto-template-hits
+           (make-hash-table :test 'equal :rehash-size 4.0)))))
+
 (defun verilog-read-auto-template-hit (tpl-ass)
   "Record that TPL-ASS template from `verilog-read-auto-template' was used."
-  (when (eval-when-compile (fboundp 'make-hash-table)) ;; else feature not 
allowed
+  (when (eval-when-compile (fboundp 'make-hash-table))  ; else feature not 
allowed
     (when verilog-auto-template-warn-unused
       (unless verilog-auto-template-hits
-       (setq verilog-auto-template-hits
-             (make-hash-table :test 'equal :rehash-size 4.0)))
+       (verilog-read-auto-template-init))
       (puthash (vector (nth 2 tpl-ass) (nth 3 tpl-ass)) t
               verilog-auto-template-hits))))
 
@@ -9372,10 +9414,10 @@ Some macros and such are also found and included.  For 
dinotrace.el."
         ((looking-at "/\\*")
          (search-forward "*/"))
         ((looking-at "(\\*")
-         (or (looking-at "(\\*\\s-*)")   ; It's a "always @ (*)"
+          (or (looking-at "(\\*\\s-*)")  ; It's an "always @ (*)"
              (search-forward "*)")))
         ((eq ?\" (following-char))
-         (re-search-forward "[^\\]\""))        ;; don't forward-char first, 
since we look for a non backslash first
+          (re-search-forward "[^\\]\""))  ; don't forward-char first, since we 
look for a non backslash first
         ((looking-at "\\s-*\\([a-zA-Z0-9$_.%`]+\\)")
          (goto-char (match-end 0))
          (setq keywd (match-string-no-properties 1))
@@ -9423,19 +9465,19 @@ Some macros and such are also found and included.  For 
dinotrace.el."
                                   (match-string 1 arg))
          (setq arg (match-string 2 arg))))
        ;;
-       ((or (string-match "^-D\\([^+=]*\\)[+=]\\(.*\\)" arg)   ;; -Ddefine=val
-           (string-match "^-D\\([^+=]*\\)\\(\\)" arg)  ;; -Ddefine
-           (string-match "^\\+define\\([^+=]*\\)[+=]\\(.*\\)" arg)     ;; 
+define+val
-           (string-match "^\\+define\\([^+=]*\\)\\(\\)" arg))          ;; 
+define+define
+       ((or (string-match "^-D\\([^+=]*\\)[+=]\\(.*\\)" arg)  ; -Ddefine=val
+            (string-match "^-D\\([^+=]*\\)\\(\\)" arg)  ; -Ddefine
+            (string-match "^\\+define\\([^+=]*\\)[+=]\\(.*\\)" arg)  ; 
+define+val
+            (string-match "^\\+define\\([^+=]*\\)\\(\\)" arg))  ; 
+define+define
        (verilog-set-define (match-string 1 arg) (match-string 2 arg)))
        ;;
-       ((or (string-match "^\\+incdir\\+\\(.*\\)" arg) ;; +incdir+dir
-           (string-match "^-I\\(.*\\)" arg))   ;; -Idir
+       ((or (string-match "^\\+incdir\\+\\(.*\\)" arg)  ; +incdir+dir
+            (string-match "^-I\\(.*\\)" arg))   ; -Idir
        (verilog-add-list-unique `verilog-library-directories
                                 (match-string 1 (substitute-in-file-name 
arg))))
        ;; Ignore
        ((equal "+librescan" arg))
-       ((string-match "^-U\\(.*\\)" arg))      ;; -Udefine
+       ((string-match "^-U\\(.*\\)" arg))  ; -Udefine
        ;; Second parameters
        ((equal next-param "-f")
        (setq next-param nil)
@@ -9513,8 +9555,7 @@ Used for __FLAGS__ in `verilog-expand-command'."
 ;;(verilog-current-flags)
 
 
-;;
-;; Cached directory support
+;;; Cached directory support:
 ;;
 
 (defvar verilog-dir-cache-preserving nil
@@ -9541,12 +9582,12 @@ seen by the `verilog-dir-files' and related functions."
 Relative paths depend on the `default-directory'.
 Results are cached if inside `verilog-preserve-dir-cache'."
   (unless verilog-dir-cache-preserving
-    (setq verilog-dir-cache-list nil)) ;; Cache disabled
+    (setq verilog-dir-cache-list nil))  ; Cache disabled
   ;; We don't use expand-file-name on the dirname to make key, as it's slow
   (let* ((cache-key (list dirname default-directory))
         (fass (assoc cache-key verilog-dir-cache-list))
         exp-dirname data)
-    (cond (fass  ;; Return data from cache hit
+    (cond (fass  ; Return data from cache hit
           (nth 1 fass))
          (t
           (setq exp-dirname (expand-file-name dirname)
@@ -9576,8 +9617,7 @@ Like `file-exists-p' but results are cached if inside
 ;;(verilog-dir-file-exists-p "../verilog-mode/verilog-mode.el")
 
 
-;;
-;; Module name lookup
+;;; Module name lookup:
 ;;
 
 (defun verilog-module-inside-filename-p (module filename)
@@ -9676,9 +9716,9 @@ Or, just the existing dirnames themselves if there are no 
wildcards."
     (while dirnames
       (setq dirname (substitute-in-file-name (car dirnames))
            dirnames (cdr dirnames))
-      (cond ((string-match (concat "^\\(\\|[/\\]*[^*?]*[/\\]\\)"  ;; root
-                                  "\\([^/\\]*[*?][^/\\]*\\)"     ;; filename 
with *?
-                                  "\\(.*\\)")                    ;; rest
+      (cond ((string-match (concat "^\\(\\|[/\\]*[^*?]*[/\\]\\)"  ; root
+                                   "\\([^/\\]*[*?][^/\\]*\\)"     ; filename 
with *?
+                                   "\\(.*\\)")                    ; rest
                           dirname)
             (setq root (match-string 1 dirname)
                   filename (match-string 2 dirname)
@@ -9719,7 +9759,7 @@ variables to build the path.  With optional CHECK-EXT 
also check
   (let* ((cache-key (list filename current check-ext))
         (fass (assoc cache-key verilog-dir-cache-lib-filenames))
         chkdirs chkdir chkexts fn outlist)
-    (cond (fass  ;; Return data from cache hit
+    (cond (fass  ; Return data from cache hit
           (nth 1 fass))
          (t
           ;; Note this expand can't be easily cached, as we need to
@@ -9881,7 +9921,7 @@ Return modi if successful, else print message unless 
IGNORE-ERROR is true."
   (set-buffer (if (bufferp (verilog-modi-file-or-buffer modi))
                  (verilog-modi-file-or-buffer modi)
                (find-file-noselect (verilog-modi-file-or-buffer modi))))
-  (or (equal major-mode `verilog-mode) ;; Put into Verilog mode to get syntax
+  (or (equal major-mode `verilog-mode)  ; Put into Verilog mode to get syntax
       (verilog-mode))
   (goto-char (verilog-modi-get-point modi)))
 
@@ -9897,7 +9937,7 @@ Return modi if successful, else print message unless 
IGNORE-ERROR is true."
   "Run on MODI the given FUNCTION.  Locate the module in a file.
 Cache the output of function so next call may have faster access."
   (let (fass)
-    (save-excursion  ;; Cache is buffer-local so can't avoid this.
+    (save-excursion  ; Cache is buffer-local so can't avoid this.
       (verilog-modi-goto modi)
       (if (and (setq fass (assoc (list modi function)
                                 verilog-modi-cache-list))
@@ -10093,8 +10133,7 @@ if non-nil."
   (verilog-modi-cache-add modi 'verilog-read-decls 7 sig-list))
 
 
-;;
-;; Auto creation utilities
+;;; Auto creation utilities:
 ;;
 
 (defun verilog-auto-re-search-do (search-for func)
@@ -10164,7 +10203,7 @@ When MODI is non-null, also add to modi-cache, for 
tracking."
               (when (member direction '("input" "output" "inout"))
                 (concat direction " "))
               (or (verilog-sig-type sig)
-                 verilog-auto-wire-type)))
+                   verilog-auto-wire-type)))
             ((and verilog-auto-declare-nettype
                   (member direction '("input" "output" "inout")))
              (concat direction " " verilog-auto-declare-nettype))
@@ -10206,10 +10245,10 @@ Presumes that any newlines end a list element."
   ;; Also want "`ifdef X   input foo   `endif" to just leave things to the 
human to deal with
   (save-excursion
     (verilog-backward-syntactic-ws-quick)
-    (when (and (not (save-excursion ;; Not beginning (, or existing ,
+    (when (and (not (save-excursion  ; Not beginning (, or existing ,
                      (backward-char 1)
                      (looking-at "[(,]")))
-              (not (save-excursion ;; Not `endif, or user define
+               (not (save-excursion  ; Not `endif, or user define
                      (backward-char 1)
                      (skip-chars-backward "[a-zA-Z0-9_`]")
                      (looking-at "`"))))
@@ -10250,7 +10289,7 @@ This repairs those mis-inserted by an AUTOARG."
               ((string-match "^\\(.*\\)\\s *:\\s *\\(.*\\)\\s *$" range-exp)
                (concat "(1+(" (match-string 1 range-exp) ")"
                        (if (equal "0" (match-string 2 range-exp))
-                           ""  ;; Don't bother with -(0)
+                           ""  ; Don't bother with -(0)
                          (concat "-(" (match-string 2 range-exp) ")"))
                        ")"))
               (t nil)))))
@@ -10260,7 +10299,7 @@ This repairs those mis-inserted by an AUTOARG."
   "Return a simplified range expression with constants eliminated from EXPR."
   ;; Note this is always called with brackets; ie [z] or [z:z]
   (if (not (string-match "[---+*()]" expr))
-      expr ;; short-circuit
+      expr  ; short-circuit
     (let ((out expr)
          (last-pass ""))
       (while (not (equal last-pass out))
@@ -10315,23 +10354,23 @@ This repairs those mis-inserted by an AUTOARG."
                  out (replace-match
                       (concat (if (and (equal pre "-")
                                        (< val 0))
-                                  "" ;; Not "--20" but just "-20"
+                                  ""  ; Not "--20" but just "-20"
                                 pre)
                               (int-to-string val)
                               post)
                       nil nil out)) )))
       out)))
 
-;;(verilog-simplify-range-expression "[1:3]") ;; 1
-;;(verilog-simplify-range-expression "[(1):3]") ;; 1
-;;(verilog-simplify-range-expression "[(((16)+1)+1+(1+1))]")  ;;20
-;;(verilog-simplify-range-expression "[(2*3+6*7)]") ;; 48
-;;(verilog-simplify-range-expression "[(FOO*4-1*2)]") ;; FOO*4-2
-;;(verilog-simplify-range-expression "[(FOO*4+1-1)]") ;; FOO*4+0
-;;(verilog-simplify-range-expression "[(func(BAR))]") ;; func(BAR)
-;;(verilog-simplify-range-expression "[FOO-1+1-1+1]") ;; FOO-0
-;;(verilog-simplify-range-expression "[$clog2(2)]") ;; 1
-;;(verilog-simplify-range-expression "[$clog2(7)]") ;; 3
+;;(verilog-simplify-range-expression "[1:3]")  ; 1
+;;(verilog-simplify-range-expression "[(1):3]")  ; 1
+;;(verilog-simplify-range-expression "[(((16)+1)+1+(1+1))]")  ; 20
+;;(verilog-simplify-range-expression "[(2*3+6*7)]")  ; 48
+;;(verilog-simplify-range-expression "[(FOO*4-1*2)]")  ; FOO*4-2
+;;(verilog-simplify-range-expression "[(FOO*4+1-1)]")  ; FOO*4+0
+;;(verilog-simplify-range-expression "[(func(BAR))]")  ; func(BAR)
+;;(verilog-simplify-range-expression "[FOO-1+1-1+1]")  ; FOO-0
+;;(verilog-simplify-range-expression "[$clog2(2)]")  ; 1
+;;(verilog-simplify-range-expression "[$clog2(7)]")  ; 3
 
 (defun verilog-clog2 (value)
   "Compute $clog2 - ceiling log2 of VALUE."
@@ -10344,8 +10383,7 @@ This repairs those mis-inserted by an AUTOARG."
   (when verilog-typedef-regexp
     (verilog-string-match-fold verilog-typedef-regexp variable-name)))
 
-;;
-;; Auto deletion
+;;; Auto deletion:
 ;;
 
 (defun verilog-delete-autos-lined ()
@@ -10411,7 +10449,7 @@ Deletion stops at the matching end parenthesis, outside 
comments."
   (delete-region (point)
                 (save-excursion
                   (verilog-backward-open-paren)
-                  (verilog-forward-sexp-ign-cmt 1)   ;; Moves to paren that 
closes argdecl's
+                   (verilog-forward-sexp-ign-cmt 1)  ; Moves to paren that 
closes argdecl's
                   (backward-char 1)
                   (point))))
 
@@ -10477,7 +10515,7 @@ called before and after this function, respectively."
   (interactive)
   (save-excursion
     (if (buffer-file-name)
-       (find-file-noselect (buffer-file-name)))        ;; To check we have 
latest version
+        (find-file-noselect (buffer-file-name)))  ; To check we have latest 
version
     (verilog-save-no-change-functions
      (verilog-save-scan-cache
       ;; Allow user to customize
@@ -10512,8 +10550,7 @@ called before and after this function, respectively."
       ;; Final customize
       (verilog-run-hooks 'verilog-delete-auto-hook)))))
 
-;;
-;; Auto inject
+;;; Auto inject:
 ;;
 
 (defun verilog-inject-auto ()
@@ -10589,7 +10626,7 @@ Typing \\[verilog-inject-auto] will make this into:
             got-sigs)
        (backward-char 1)
        (verilog-forward-sexp-ign-cmt 1)
-       (backward-char 1) ;; End )
+        (backward-char 1)  ; End )
        (when (not (verilog-re-search-backward-quick 
"/\\*\\(AUTOSENSE\\|AS\\)\\*/" start-pt t))
          (setq pre-sigs (verilog-signals-from-signame
                          (verilog-read-signals start-pt (point)))
@@ -10605,23 +10642,23 @@ Typing \\[verilog-inject-auto] will make this into:
     (goto-char (point-min))
     ;; It's hard to distinguish modules; we'll instead search for pins.
     (while (verilog-re-search-forward-quick "\\.\\s *[a-zA-Z0-9`_\$]+\\s *(\\s 
*[a-zA-Z0-9`_\$]+\\s *)" nil t)
-      (verilog-backward-open-paren) ;; Inst start
+      (verilog-backward-open-paren)  ; Inst start
       (cond
-       ((= (preceding-char) ?\#)  ;; #(...) parameter section, not pin.  Skip.
+       ((= (preceding-char) ?\#)  ; #(...) parameter section, not pin.  Skip.
        (forward-char 1)
-       (verilog-forward-close-paren)) ;; Parameters done
+        (verilog-forward-close-paren))  ; Parameters done
        (t
        (forward-char 1)
        (let ((indent-pt (+ (current-column)))
              (end-pt (save-excursion (verilog-forward-close-paren) (point))))
          (cond ((verilog-re-search-forward-quick 
"\\(/\\*AUTOINST\\*/\\|\\.\\*\\)" end-pt t)
-                (goto-char end-pt)) ;; Already there, continue search with 
next instance
+                 (goto-char end-pt))  ; Already there, continue search with 
next instance
                (t
                 ;; Delete identical interconnect
-                (let ((case-fold-search nil))  ;; So we don't convert 
upper-to-lower, etc
+                 (let ((case-fold-search nil))  ; So we don't convert 
upper-to-lower, etc
                   (while (verilog-re-search-forward-quick "\\.\\s 
*\\([a-zA-Z0-9`_\$]+\\)*\\s *(\\s *\\1\\s *)\\s *" end-pt t)
                     (delete-region (match-beginning 0) (match-end 0))
-                    (setq end-pt (- end-pt (- (match-end 0) (match-beginning 
0)))) ;; Keep it correct
+                     (setq end-pt (- end-pt (- (match-end 0) (match-beginning 
0))))  ; Keep it correct
                     (while (or (looking-at "[ \t\n\f,]+")
                                (looking-at "//[^\n]*"))
                       (delete-region (match-beginning 0) (match-end 0))
@@ -10633,9 +10670,9 @@ Typing \\[verilog-inject-auto] will make this into:
                   (delete-region (match-beginning 0) (match-end 0)))
                 (verilog-insert "\n")
                 (verilog-insert-indent "/*AUTOINST*/")))))))))
-
+
 ;;
-;; Auto diff
+;; Auto diff:
 ;;
 
 (defun verilog-diff-buffers-p (b1 b2 &optional whitespace)
@@ -10643,7 +10680,7 @@ Typing \\[verilog-inject-auto] will make this into:
 Else, return point in B1 that first mismatches.
 If optional WHITESPACE true, ignore whitespace."
   (save-excursion
-    (let* ((case-fold-search nil)  ;; compare-buffer-substrings cares
+    (let* ((case-fold-search nil)  ; compare-buffer-substrings cares
           (p1 (with-current-buffer b1 (goto-char (point-min))))
           (p2 (with-current-buffer b2 (goto-char (point-min))))
           (maxp1 (with-current-buffer b1 (point-max)))
@@ -10684,25 +10721,25 @@ Ignores WHITESPACE if t, and writes output to stdout 
if SHOW."
   (if (not (file-exists-p f1))
       (message "Buffer %s has no associated file on disc" (buffer-name b2))
     (with-temp-buffer "*Verilog-Diff*"
-      (let ((outbuf (current-buffer))
-           (f2 (make-temp-file "vm-diff-auto-")))
-       (unwind-protect
-           (progn
-             (with-current-buffer b2
-               (save-restriction
-                 (widen)
-                 (write-region (point-min) (point-max) f2 nil 'nomessage)))
-             (call-process diff-command nil outbuf t
-                           diff-switches ;; User may want -u in diff-switches
-                           (if whitespace "-b" "")
-                           f1 f2)
-             ;; Print out results.  Alternatively we could have call-processed
-             ;; ourself, but this way we can reuse diff switches
-             (when show
-               (with-current-buffer outbuf (message "%s" (buffer-string))))))
-       (sit-for 0)
-       (when (file-exists-p f2)
-         (delete-file f2))))))
+                      (let ((outbuf (current-buffer))
+                            (f2 (make-temp-file "vm-diff-auto-")))
+                        (unwind-protect
+                            (progn
+                              (with-current-buffer b2
+                                (save-restriction
+                                  (widen)
+                                  (write-region (point-min) (point-max) f2 nil 
'nomessage)))
+                              (call-process diff-command nil outbuf t
+                                            diff-switches  ; User may want -u 
in diff-switches
+                                            (if whitespace "-b" "")
+                                            f1 f2)
+                              ;; Print out results.  Alternatively we could 
have call-processed
+                              ;; ourself, but this way we can reuse diff 
switches
+                              (when show
+                                (with-current-buffer outbuf (message "%s" 
(buffer-string))))))
+                        (sit-for 0)
+                        (when (file-exists-p f2)
+                          (delete-file f2))))))
 
 (defun verilog-diff-report (b1 b2 diffpt)
   "Report differences detected with `verilog-diff-auto'.
@@ -10735,7 +10772,7 @@ or `diff' in batch mode."
     (save-excursion
       (when (get-buffer newname)
        (kill-buffer newname))
-      (setq b2 (let (buffer-file-name)  ;; Else clone is upset
+      (setq b2 (let (buffer-file-name)  ; Else clone is upset
                 (clone-buffer newname)))
       (with-current-buffer b2
        ;; auto requires the filename, but can't have same filename in two
@@ -10753,13 +10790,12 @@ or `diff' in batch mode."
       (setq diffpt (verilog-diff-buffers-p b1 b2 t))
       (cond ((not diffpt)
             (unless noninteractive (message "AUTO expansion identical"))
-            (kill-buffer newname)) ;; Nice to cleanup after oneself
+             (kill-buffer newname))  ; Nice to cleanup after oneself
            (t
             (funcall verilog-diff-function b1 b2 diffpt)))
       ;; Return result of compare
       diffpt)))
 
-
 ;;
 ;; Auto save
 ;;
@@ -10785,7 +10821,7 @@ or `diff' in batch mode."
         (set (make-local-variable 'verilog-auto-update-tick) 
(buffer-chars-modified-tick))))
   (when (not verilog-auto-star-save)
     (verilog-delete-auto-star-implicit))
-  nil) ;; Always return nil -- we don't write the file ourselves
+  nil)  ; Always return nil -- we don't write the file ourselves
 
 (defun verilog-auto-read-locals ()
   "Return file local variable segment at bottom of file."
@@ -10807,8 +10843,7 @@ If FORCE, always reread it."
       (hack-local-variables)
       t)))
 
-;;
-;; Auto creation
+;;; Auto creation:
 ;;
 
 (defun verilog-auto-arg-ports (sigs message indent-pt)
@@ -10944,19 +10979,19 @@ See the example in `verilog-auto-inout-modport'."
           (modport-re (nth 1 params))
           (inst-name (nth 2 params))
           (regexp (nth 3 params))
-          direction-re submodi) ;; direction argument not supported until 
requested
+           direction-re submodi)  ; direction argument not supported until 
requested
       ;; Lookup position, etc of co-module
       ;; Note this may raise an error
       (when (setq submodi (verilog-modi-lookup submod t))
        (let* ((indent-pt (current-indentation))
               (submoddecls (verilog-modi-get-decls submodi))
               (submodportdecls (verilog-modi-modport-lookup submodi 
modport-re))
-              (sig-list-i (verilog-signals-in ;; Decls doesn't have data 
types, must resolve
+               (sig-list-i (verilog-signals-in  ; Decls doesn't have data 
types, must resolve
                            (verilog-decls-get-vars submoddecls)
                            (verilog-signals-not-in
                             (verilog-decls-get-inputs submodportdecls)
                             (verilog-decls-get-ports submoddecls))))
-              (sig-list-o (verilog-signals-in ;; Decls doesn't have data 
types, must resolve
+               (sig-list-o (verilog-signals-in  ; Decls doesn't have data 
types, must resolve
                            (verilog-decls-get-vars submoddecls)
                            (verilog-signals-not-in
                             (verilog-decls-get-outputs submodportdecls)
@@ -11140,10 +11175,10 @@ If PAR-VALUES replace final strings with these 
parameter values."
   ;; There maybe an ifdef or something similar before us.  What a mess.  Thus
   ;; to avoid trouble we only insert on preceding ) or *.
   ;; Insert first port on new line
-  (insert "\n")  ;; Must insert before search, so point will move forward if 
insert comma
+  (insert "\n")  ; Must insert before search, so point will move forward if 
insert comma
   (save-excursion
     (verilog-re-search-backward-quick "[^ \t\n\f]" nil nil)
-    (when (looking-at ")\\|\\*")  ;; Generally don't insert, unless we are 
fairly sure
+    (when (looking-at ")\\|\\*")  ; Generally don't insert, unless we are 
fairly sure
       (forward-char 1)
       (insert ","))))
 
@@ -11575,11 +11610,11 @@ For more information see the \\[verilog-faq] and 
forums at URL
                 (re-search-backward "," pt t)
                 (delete-char 1)
                 (insert ");")
-                (search-forward "\n")  ;; Added by inst-port
+                 (search-forward "\n")  ; Added by inst-port
                 (delete-char -1)
-                (if (search-forward ")" nil t) ;; From user, moved up a line
+                 (if (search-forward ")" nil t)  ; From user, moved up a line
                     (delete-char -1))
-                (if (search-forward ";" nil t) ;; Don't error if user had 
syntax error and forgot it
+                 (if (search-forward ";" nil t)  ; Don't error if user had 
syntax error and forgot it
                     (delete-char -1)))))))))
 
 (defun verilog-auto-inst-param ()
@@ -11677,9 +11712,9 @@ Templates:
                 (re-search-backward "," pt t)
                 (delete-char 1)
                 (insert ")")
-                (search-forward "\n")  ;; Added by inst-port
+                 (search-forward "\n")  ; Added by inst-port
                 (delete-char -1)
-                (if (search-forward ")" nil t) ;; From user, moved up a line
+                 (if (search-forward ")" nil t)  ; From user, moved up a line
                     (delete-char -1)))))))))
 
 (defun verilog-auto-reg ()
@@ -11721,7 +11756,7 @@ Typing \\[verilog-auto] will make this into:
           (modsubdecls (verilog-modi-get-sub-decls modi))
           (sig-list (verilog-signals-not-in
                      (verilog-decls-get-outputs moddecls)
-                     (append (verilog-signals-with ;; ignore typed signals
+                      (append (verilog-signals-with  ; ignore typed signals
                               'verilog-sig-type
                               (verilog-decls-get-outputs moddecls))
                              (verilog-decls-get-vars moddecls)
@@ -12594,7 +12629,7 @@ driver/monitor using AUTOINST in the testbench."
           (submod (nth 0 params))
           (modport-re (nth 1 params))
           (regexp (nth 2 params))
-          direction-re submodi) ;; direction argument not supported until 
requested
+           direction-re submodi)  ; direction argument not supported until 
requested
       ;; Lookup position, etc of co-module
       ;; Note this may raise an error
       (when (setq submodi (verilog-modi-lookup submod t))
@@ -12604,19 +12639,19 @@ driver/monitor using AUTOINST in the testbench."
               (moddecls (verilog-modi-get-decls modi))
               (submoddecls (verilog-modi-get-decls submodi))
               (submodportdecls (verilog-modi-modport-lookup submodi 
modport-re))
-              (sig-list-i (verilog-signals-in ;; Decls doesn't have data 
types, must resolve
+               (sig-list-i (verilog-signals-in  ; Decls doesn't have data 
types, must resolve
                            (verilog-decls-get-vars submoddecls)
                            (verilog-signals-not-in
                             (verilog-decls-get-inputs submodportdecls)
                             (append (verilog-decls-get-ports submoddecls)
                                     (verilog-decls-get-ports moddecls)))))
-              (sig-list-o (verilog-signals-in ;; Decls doesn't have data 
types, must resolve
+               (sig-list-o (verilog-signals-in  ; Decls doesn't have data 
types, must resolve
                            (verilog-decls-get-vars submoddecls)
                            (verilog-signals-not-in
                             (verilog-decls-get-outputs submodportdecls)
                             (append (verilog-decls-get-ports submoddecls)
                                     (verilog-decls-get-ports moddecls)))))
-              (sig-list-io (verilog-signals-in ;; Decls doesn't have data 
types, must resolve
+               (sig-list-io (verilog-signals-in  ; Decls doesn't have data 
types, must resolve
                             (verilog-decls-get-vars submoddecls)
                             (verilog-signals-not-in
                              (verilog-decls-get-inouts submodportdecls)
@@ -12694,10 +12729,10 @@ text:
     (let* ((indent-pt (current-indentation))
           (cmd-end-pt (save-excursion (search-backward ")")
                                       (forward-char)
-                                      (point)))        ;; Closing paren
+                                       (point)))  ; Closing paren
           (cmd-beg-pt (save-excursion (goto-char cmd-end-pt)
-                                      (backward-sexp 1)  ;; Inside comment
-                                      (point))) ;; Beginning paren
+                                       (backward-sexp 1)  ; Inside comment
+                                       (point)))  ; Beginning paren
           (cmd (buffer-substring-no-properties cmd-beg-pt cmd-end-pt)))
       (verilog-forward-or-insert-line)
       ;; Some commands don't move point (like insert-file) so we always
@@ -12707,7 +12742,7 @@ text:
       (forward-line -1)
       (eval (read cmd))
       (forward-line -1)
-      (setq verilog-scan-cache-tick nil) ;; Clear cache; inserted unknown text
+      (setq verilog-scan-cache-tick nil)  ; Clear cache; inserted unknown text
       (verilog-delete-empty-auto-pair))))
 
 (defun verilog-auto-insert-last ()
@@ -12817,7 +12852,7 @@ operator.  (This was added to the language in part due 
to AUTOSENSE!)
        (let ((tlen (length sig-list)))
          (setq sig-list (verilog-signals-not-in sig-list sig-memories))
          (if (not (eq tlen (length sig-list))) (verilog-insert " /*memory or*/ 
"))))
-      (if (and presense-sigs  ;; Add a "or" if not "(.... or /*AUTOSENSE*/"
+      (if (and presense-sigs  ; Add a "or" if not "(.... or /*AUTOSENSE*/"
               (save-excursion (goto-char (point))
                               (verilog-re-search-backward-quick 
"[a-zA-Z0-9$_.%`]+" start-pt t)
                               (verilog-re-search-backward-quick "\\s-" 
start-pt t)
@@ -12940,7 +12975,7 @@ Typing \\[verilog-auto] will make this into:
        (insert "\n");
        (verilog-insert-indent "// Beginning of autoreset for uninitialized 
flops\n");
        (while sig-list
-         (let ((sig (or (assoc (verilog-sig-name (car sig-list)) all-list) ;; 
As sig-list has no widths
+          (let ((sig (or (assoc (verilog-sig-name (car sig-list)) all-list)  ; 
As sig-list has no widths
                         (car sig-list))))
            (indent-to indent-pt)
            (insert (verilog-sig-name sig)
@@ -13092,7 +13127,7 @@ defines the regular expression will be undefed."
                 (setq def (match-string-no-properties 2))
                 (when (and (or (not regexp)
                                (string-match regexp def))
-                           (not (member def defs))) ;; delete-dups not in 21.1
+                            (not (member def defs)))  ; delete-dups not in 21.1
                   (setq defs (cons def defs))))
                (t
                 (setq defs (delete (match-string-no-properties 2) defs))))))
@@ -13288,7 +13323,7 @@ Typing \\[verilog-auto] will make this into:
           ;;
           (one-hot (or
                     (string-match "onehot" (or one-hot-flag ""))
-                    (and ;; width(enum) != width(sig)
+                     (and  ; width(enum) != width(sig)
                      (or (not (verilog-sig-bits (car enum-sigs)))
                          (not (equal (verilog-sig-width (car enum-sigs))
                                      (verilog-sig-width undecode-sig))))
@@ -13387,21 +13422,20 @@ Enable with `verilog-auto-template-warn-unused'."
          (while tlines
            (setq tpl-ass (car tlines)
                  tlines (cdr tlines))
-           ;;;
-           (unless (or (not (eval-when-compile (fboundp 'make-hash-table))) ;; 
Not supported, no warning
+           ;;
+            (unless (or (not (eval-when-compile (fboundp 'make-hash-table)))  
; Not supported, no warning
                        (not verilog-auto-template-hits)
                        (gethash (vector (nth 2 tpl-ass) (nth 3 tpl-ass))
                                 verilog-auto-template-hits))
              (verilog-warn-error "%s:%d: AUTO_TEMPLATE line unused: \".%s 
(%s)\""
                                  name1
-                                 (+ (elt tpl-ass 3)  ;; Template line number
+                                  (+ (elt tpl-ass 3)  ; Template line number
                                     (count-lines (point-min) (point)))
                                  (elt tpl-ass 0) (elt tpl-ass 1))
              )))))))
 
 
-;;
-;; Auto top level
+;;; Auto top level:
 ;;
 
 (defun verilog-auto (&optional inject)  ; Use verilog-inject-auto instead of 
passing an arg
@@ -13501,7 +13535,7 @@ Wilson Snyder (address@hidden)."
             ;; we'll misremember we have generated IOs, confusing AUTOOUTPUT
             (setq verilog-modi-cache-list nil)
             ;; Local state
-            (setq verilog-auto-template-hits nil)
+            (verilog-read-auto-template-init)
             ;; If we're not in verilog-mode, change syntax table so parsing 
works right
             (unless (eq major-mode `verilog-mode) (verilog-mode))
             ;; Allow user to customize
@@ -13595,10 +13629,9 @@ Wilson Snyder (address@hidden)."
        ;; Currently handled in verilog-save-font-mods
        ))))
 
-
-;;
-;; Skeleton based code insertion
+;;; Skeletons:
 ;;
+
 (defvar verilog-template-map
   (let ((map (make-sparse-keymap)))
     (define-key map "a" 'verilog-sk-always)
@@ -13645,7 +13678,7 @@ Wilson Snyder (address@hidden)."
 ;; Note \C-c and letter are reserved for users
 (define-key verilog-mode-map "\C-c\C-t" verilog-template-map)
 
-;;; ---- statement skeletons ------------------------------------------
+;; ---- statement skeletons ------------------------------------------
 
 (define-skeleton verilog-sk-prompt-condition
   "Prompt for the loop condition."
@@ -13727,9 +13760,9 @@ See also `verilog-header' for an alternative format."
   > _ \n
   > (- verilog-indent-level-behavioral) "endmodule" (progn 
(electric-verilog-terminate-line) nil))
 
-;;; ------------------------------------------------------------------------
-;;; Define a default OVM class, with macros and new()
-;;; ------------------------------------------------------------------------
+;; ------------------------------------------------------------------------
+;; Define a default OVM class, with macros and new()
+;; ------------------------------------------------------------------------
 
 (define-skeleton verilog-sk-ovm-class
   "Insert a class definition"
@@ -13919,12 +13952,12 @@ and the case items."
   (interactive "*")
   (let* ((sig-re "[a-zA-Z0-9_]*")
         (v1 (buffer-substring
-              (save-excursion
-                (skip-chars-backward sig-re)
-                (point))
-              (save-excursion
-                (skip-chars-forward sig-re)
-                (point)))))
+              (save-excursion
+                (skip-chars-backward sig-re)
+                (point))
+              (save-excursion
+                (skip-chars-forward sig-re)
+                (point)))))
     (if (not (member v1 verilog-keywords))
        (save-excursion
          (setq verilog-sk-signal v1)
@@ -14004,7 +14037,7 @@ and the case items."
   resume: >  (- verilog-case-indent) "endcase" (progn 
(electric-verilog-terminate-line) nil)
   > (- verilog-indent-level-behavioral) "end" (progn 
(electric-verilog-terminate-line) nil))
 
-
+;;; Mouse Events:
 ;;
 ;; Include file loading with mouse/return event
 ;;
@@ -14039,7 +14072,7 @@ Clicking on the middle-mouse button loads them in a 
buffer (as in dired)."
   (when (or verilog-highlight-includes
            verilog-highlight-modules)
     (save-excursion
-      (save-match-data  ;; A query-replace may call this function - do not 
disturb
+      (save-match-data  ; A query-replace may call this function - do not 
disturb
        (verilog-save-buffer-state
         (verilog-save-scan-cache
          (let (end-point)
@@ -14078,7 +14111,7 @@ Clicking on the middle-mouse button loads them in a 
buffer (as in dired)."
                    (save-excursion
                      (goto-char (match-beginning 0))
                      (unless (verilog-inside-comment-or-string-p)
-                       (verilog-read-inst-module-matcher)   ;; sets match 0
+                        (verilog-read-inst-module-matcher)  ; sets match 0
                        (let* ((ov (make-overlay (match-beginning 0) (match-end 
0))))
                          (overlay-put ov 'start-closed 't)
                          (overlay-put ov 'end-closed 't)
@@ -14110,7 +14143,7 @@ Clicking on the middle-mouse button loads them in a 
buffer (as in dired)."
   "Load file under button 2 click's EVENT.
 Files are checked based on `verilog-library-flags'."
   (interactive "@e")
-  (save-excursion ;; implement a Verilog specific ffap-at-mouse
+  (save-excursion  ; implement a Verilog specific ffap-at-mouse
     (mouse-set-point event)
     (verilog-load-file-at-point t)))
 
@@ -14122,7 +14155,7 @@ Files are checked based on `verilog-library-flags'."
 If WARN, throw warning if not found.
 Files are checked based on `verilog-library-flags'."
   (interactive)
-  (save-excursion ;; implement a Verilog specific ffap
+  (save-excursion  ; implement a Verilog specific ffap
     (let ((overlays (overlays-in (point) (point)))
          hit)
       (while (and overlays (not hit))
@@ -14147,8 +14180,8 @@ Files are checked based on `verilog-library-flags'."
             "File '%s' isn't readable, use shift-mouse2 to paste in this field"
             (match-string 1))))))))
 
-;;
-;; Bug reporting
+
+;;; Bug reporting:
 ;;
 
 (defun verilog-faq ()
@@ -14284,6 +14317,7 @@ but instead, [[Fill in here]] happens!.
 ;; Local Variables:
 ;; checkdoc-permit-comma-termination-flag:t
 ;; checkdoc-force-docstrings-flag:nil
+;; indent-tabs-mode:nil
 ;; End:
 
 ;;; verilog-mode.el ends here
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 27e56f2..b0a8eb7 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -65,8 +65,6 @@
 (defclass xref-location () ()
   :documentation "A location represents a position in a file or buffer.")
 
-;; If a backend decides to subclass xref-location it can provide
-;; methods for some of the following functions:
 (cl-defgeneric xref-location-marker (location)
   "Return the marker for LOCATION.")
 
@@ -204,8 +202,10 @@ LOCATION is an `xref-location'."
 It can be called in several ways:
 
  (definitions IDENTIFIER): Find definitions of IDENTIFIER.  The
-result must be a list of xref objects.  If no definitions can be
-found, return nil.
+result must be a list of xref objects.  If IDENTIFIER contains
+sufficient information to determine a unique definition, returns
+only that definition. If there are multiple possible definitions,
+return all of them.  If no definitions can be found, return nil.
 
  (references IDENTIFIER): Find references of IDENTIFIER.  The
 result must be a list of xref objects.  If no references can be
@@ -372,14 +372,19 @@ elements is negated."
   (ring-empty-p xref--marker-ring))
 
 
+
+(defun xref--goto-char (pos)
+  (cond
+   ((and (<= (point-min) pos) (<= pos (point-max))))
+   (widen-automatically (widen))
+   (t (user-error "Position is outside accessible part of buffer")))
+  (goto-char pos))
+
 (defun xref--goto-location (location)
   "Set buffer and point according to xref-location LOCATION."
   (let ((marker (xref-location-marker location)))
     (set-buffer (marker-buffer marker))
-    (cond ((and (<= (point-min) marker) (<= marker (point-max))))
-          (widen-automatically (widen))
-          (t (error "Location is outside accessible part of buffer")))
-    (goto-char marker)))
+    (xref--goto-char marker)))
 
 (defun xref--pop-to-location (item &optional window)
   "Go to the location of ITEM and display the buffer.
@@ -387,11 +392,14 @@ WINDOW controls how the buffer is displayed:
   nil      -- switch-to-buffer
   'window  -- pop-to-buffer (other window)
   'frame   -- pop-to-buffer (other frame)"
-  (xref--goto-location (xref-item-location item))
-  (cl-ecase window
-    ((nil)  (switch-to-buffer (current-buffer)))
-    (window (pop-to-buffer (current-buffer) t))
-    (frame  (let ((pop-up-frames t)) (pop-to-buffer (current-buffer) t))))
+  (let* ((marker (save-excursion
+                   (xref-location-marker (xref-item-location item))))
+         (buf (marker-buffer marker)))
+    (cl-ecase window
+      ((nil)  (switch-to-buffer buf))
+      (window (pop-to-buffer buf t))
+      (frame  (let ((pop-up-frames t)) (pop-to-buffer buf t))))
+    (xref--goto-char marker))
   (let ((xref--current-item item))
     (run-hooks 'xref-after-jump-hook)))
 
@@ -424,30 +432,29 @@ Used for temporary buffers.")
     (when (and restore (not (eq (car restore) 'same)))
       (push (cons buf win) xref--display-history))))
 
-(defun xref--display-position (pos other-window xref-buf)
+(defun xref--display-position (pos other-window buf)
   ;; Show the location, but don't hijack focus.
-  (with-selected-window (display-buffer (current-buffer) other-window)
-    (goto-char pos)
-    (run-hooks 'xref-after-jump-hook)
-    (let ((buf (current-buffer))
-          (win (selected-window)))
-      (with-current-buffer xref-buf
-        (setq-local other-window-scroll-buffer buf)
-        (xref--save-to-history buf win)))))
+  (let ((xref-buf (current-buffer)))
+    (with-selected-window (display-buffer buf other-window)
+      (xref--goto-char pos)
+      (run-hooks 'xref-after-jump-hook)
+      (let ((buf (current-buffer))
+            (win (selected-window)))
+        (with-current-buffer xref-buf
+          (setq-local other-window-scroll-buffer buf)
+          (xref--save-to-history buf win))))))
 
 (defun xref--show-location (location)
   (condition-case err
-      (let ((xref-buf (current-buffer))
-            (bl (buffer-list))
-            (xref--inhibit-mark-current t))
-        (xref--goto-location location)
-        (let ((buf (current-buffer)))
+      (let ((bl (buffer-list))
+            (xref--inhibit-mark-current t)
+            (marker (xref-location-marker location)))
+        (let ((buf (marker-buffer marker)))
           (unless (memq buf bl)
             ;; Newly created.
             (add-hook 'buffer-list-update-hook #'xref--mark-selected nil t)
-            (with-current-buffer xref-buf
-              (push buf xref--temporary-buffers))))
-        (xref--display-position (point) t xref-buf))
+            (push buf xref--temporary-buffers))
+          (xref--display-position marker t buf)))
     (user-error (message (error-message-string err)))))
 
 (defun xref-show-location-at-point ()
@@ -504,6 +511,8 @@ Used for temporary buffers.")
             (while (setq item (xref--search-property 'xref-item))
               (when (xref-match-bounds item)
                 (save-excursion
+                  ;; FIXME: Get rid of xref--goto-location, by making
+                  ;; xref-match-bounds return markers already.
                   (xref--goto-location (xref-item-location item))
                   (let ((bounds (xref--match-buffer-bounds item))
                         (beg (make-marker))
@@ -744,7 +753,14 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
 (defun xref-find-definitions (identifier)
   "Find the definition of the identifier at point.
 With prefix argument or when there's no identifier at point,
-prompt for it."
+prompt for it.
+
+If the backend has sufficient information to determine a unique
+definition for IDENTIFIER, it returns only that definition. If
+there are multiple possible definitions, it returns all of them.
+
+If the backend returns one definition, jump to it; otherwise,
+display the list in a buffer."
   (interactive (list (xref--read-identifier "Find definitions of: ")))
   (xref--find-definitions identifier nil))
 
@@ -849,7 +865,6 @@ and just use etags."
                 (cdr xref-etags-mode--saved))))
 
 (declare-function semantic-symref-find-references-by-name "semantic/symref")
-(declare-function semantic-symref-find-text "semantic/symref")
 (declare-function semantic-find-file-noselect "semantic/fw")
 (declare-function grep-read-files "grep")
 (declare-function grep-expand-template "grep")
@@ -929,12 +944,12 @@ IGNORES is a list of glob patterns."
     " -path "
     (mapconcat
      (lambda (ignore)
-       (when (string-match "\\(\\.\\)/" ignore)
-         (setq ignore (replace-match dir t t ignore 1)))
        (when (string-match-p "/\\'" ignore)
          (setq ignore (concat ignore "*")))
-       (unless (string-prefix-p "*" ignore)
-         (setq ignore (concat "*/" ignore)))
+       (if (string-match "\\`\\./" ignore)
+           (setq ignore (replace-match dir t t ignore))
+         (unless (string-prefix-p "*" ignore)
+           (setq ignore (concat "*/" ignore))))
        (shell-quote-argument ignore))
      ignores
      " -o -path ")
diff --git a/lisp/replace.el b/lisp/replace.el
index 41debdd..3cdb54f 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -33,7 +33,7 @@
   :type 'boolean
   :group 'matching)
 
-(defcustom replace-character-fold t
+(defcustom replace-character-fold nil
   "Non-nil means `query-replace' should do character folding in matches.
 This means, for instance, that ' will match a large variety of
 unicode quotes."
@@ -209,9 +209,9 @@ wants to replace FROM with TO."
              (let ((match (match-string 3 from)))
                (cond
                 ((string= match "\\n")
-                 (message "Note: `\\n' here doesn't match a newline; to do 
that, type C-q C-j instead"))
+                 (message "Note: ‘\\n’ here doesn't match a newline; to do 
that, type C-q C-j instead"))
                 ((string= match "\\t")
-                 (message "Note: `\\t' here doesn't match a tab; to do that, 
just type TAB")))
+                 (message "Note: ‘\\t’ here doesn't match a tab; to do that, 
just type TAB")))
                (sit-for 2)))
         (if (not to)
             from
@@ -1140,7 +1140,7 @@ To return to ordinary Occur mode, use 
\\[occur-cease-edit]."
            (goto-char m)
            (recenter line)
            (if readonly
-               (message "Buffer `%s' is read only." buf)
+               (message "Buffer ‘%s’ is read only." buf)
              (delete-region (line-beginning-position) (line-end-position))
              (insert text))
            (move-to-column col)))))))
@@ -1495,7 +1495,7 @@ See also `multi-occur'."
                     ;; Don't display regexp if with remaining text
                     ;; it is longer than window-width.
                     (if (> (+ (length regexp) 42) (window-width))
-                        "" (format " for `%s'" (query-replace-descr regexp)))))
+                        "" (format " for ‘%s’" (query-replace-descr regexp)))))
          (setq occur-revert-arguments (list regexp nlines bufs))
           (if (= count 0)
               (kill-buffer occur-buf)
@@ -2080,7 +2080,13 @@ see the documentation of `replace-match' to find out how 
to simulate
 `case-replace'.
 
 This function returns nil if and only if there were no matches to
-make, or the user didn't cancel the call."
+make, or the user didn't cancel the call.
+
+REPLACEMENTS is either a string, a list of strings, or a cons cell
+containing a function and its first argument.  The function is
+called to generate each replacement like this:
+  (funcall (car replacements) (cdr replacements) replace-count)
+It must return a string."
   (or map (setq map query-replace-map))
   (and query-flag minibuffer-auto-raise
        (raise-frame (window-frame (minibuffer-window))))
@@ -2136,11 +2142,6 @@ make, or the user didn't cancel the call."
     (when (eq (lookup-key map (vector last-input-event)) 'automatic-all)
       (setq query-flag nil multi-buffer t))
 
-    ;; REPLACEMENTS is either a string, a list of strings, or a cons cell
-    ;; containing a function and its first argument.  The function is
-    ;; called to generate each replacement like this:
-    ;;   (funcall (car replacements) (cdr replacements) replace-count)
-    ;; It must return a string.
     (cond
      ((stringp replacements)
       (setq next-replacement replacements
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el
index 635990a..c46e05d 100644
--- a/lisp/scroll-bar.el
+++ b/lisp/scroll-bar.el
@@ -61,7 +61,7 @@ SIDE must be the symbol `left' or `right'."
          (cols  (nth 1 wsb)))
     (cond
      ((not (memq side '(left right)))
-      (error "`left' or `right' expected instead of %S" side))
+      (error "‘left’ or ‘right’ expected instead of %S" side))
      ((and (eq vtype side) cols))
      ((eq (frame-parameter nil 'vertical-scroll-bars) side)
       ;; nil means it's a non-toolkit scroll bar, and its width in
diff --git a/lisp/simple.el b/lisp/simple.el
index a9ef93e..afb2d4a 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1655,7 +1655,7 @@ invoking, give a prefix argument to 
`execute-extended-command'."
                       (not executing-kbd-macro)
                       (where-is-internal function overriding-local-map t))))
     (unless (commandp function)
-      (error "`%s' is not a valid command name" command-name))
+      (error "‘%s’ is not a valid command name" command-name))
     (setq this-command function)
     ;; Normally `real-this-command' should never be changed, but here we really
     ;; want to pretend that M-x <cmd> RET is nothing more than a "key
@@ -1689,7 +1689,7 @@ invoking, give a prefix argument to 
`execute-extended-command'."
                            (symbol-name function) typed))))
         (when binding
           (with-temp-message
-              (format "You can run the command `%s' with %s"
+              (format "You can run the command ‘%s’ with %s"
                       function
                       (if (stringp binding)
                           (concat "M-x " binding " RET")
@@ -2796,7 +2796,7 @@ This variable only matters if `undo-ask-before-discard' 
is non-nil.")
        ;; but we don't want to ask the question again.
        (setq undo-extra-outer-limit (+ size 50000))
        (if (let (use-dialog-box track-mouse executing-kbd-macro )
-             (yes-or-no-p (format "Buffer `%s' undo info is %d bytes long; 
discard it? "
+             (yes-or-no-p (format "Buffer ‘%s’ undo info is %d bytes long; 
discard it? "
                                   (buffer-name) size)))
            (progn (setq buffer-undo-list nil)
                   (setq undo-extra-outer-limit nil)
@@ -2804,7 +2804,7 @@ This variable only matters if `undo-ask-before-discard' 
is non-nil.")
          nil))
     (display-warning '(undo discard-info)
                     (concat
-                     (format "Buffer `%s' undo info was %d bytes long.\n"
+                     (format "Buffer ‘%s’ undo info was %d bytes long.\n"
                              (buffer-name) size)
                      "The undo info was discarded because it exceeded \
 `undo-outer-limit'.
@@ -7271,8 +7271,8 @@ buffer buried."
                            (format "\
 The default mail mode is now Message mode.
 You have the following Mail mode variable%s customized:
-\n  %s\n\nTo use Mail mode, set `mail-user-agent' to sendmail-user-agent.
-To disable this warning, set `compose-mail-user-agent-warnings' to nil."
+\n  %s\n\nTo use Mail mode, set ‘mail-user-agent’ to sendmail-user-agent.
+To disable this warning, set ‘compose-mail-user-agent-warnings’ to nil."
                                    (if (> (length warn-vars) 1) "s" "")
                                    (mapconcat 'symbol-name
                                               warn-vars " "))))))
@@ -7343,8 +7343,8 @@ With a prefix argument, set VARIABLE to VALUE 
buffer-locally."
                                (t "globally"))))
          (val (progn
                  (when obsolete
-                   (message (concat "`%S' is obsolete; "
-                                    (if (symbolp obsolete) "use `%S' instead" 
"%s"))
+                   (message (concat "‘%S’ is obsolete; "
+                                    (if (symbolp obsolete) "use ‘%S’ instead" 
"%s"))
                             var obsolete)
                    (sit-for 3))
                  (if prop
@@ -7368,7 +7368,7 @@ With a prefix argument, set VARIABLE to VALUE 
buffer-locally."
       (require 'cus-edit)
       (setq type (widget-convert type))
       (unless (widget-apply type :match value)
-       (user-error "Value `%S' does not match type %S of %S"
+       (user-error "Value ‘%S’ does not match type %S of %S"
                    value (car type) variable))))
 
   (if make-local
@@ -7579,7 +7579,7 @@ back on `completion-list-insert-choice-function' when 
nil."
   ;; `base-position'.  It's difficult to make any use of `base-size',
   ;; so we just ignore it.
   (unless (consp base-position)
-    (message "Obsolete `base-size' passed to choose-completion-string")
+    (message "Obsolete ‘base-size’ passed to choose-completion-string")
     (setq base-position nil))
 
   (let* ((buffer (or buffer completion-reference-buffer))
@@ -7692,8 +7692,7 @@ Called from `temp-buffer-show-hook'."
       (when completion-show-help
        (goto-char (point-min))
        (if (display-mouse-p)
-           (insert (substitute-command-keys
-                    "Click on a completion to select it.\n")))
+           (insert "Click on a completion to select it.\n"))
        (insert (substitute-command-keys
                 "In this buffer, type \\[choose-completion] to \
 select the completion near point.\n\n"))))))
@@ -8305,7 +8304,7 @@ CUSTOMIZATIONS, if non-nil, should be composed of 
alternating
     `(progn
 
        (defcustom ,varalt-sym nil
-         ,(format "Alist of alternative implementations for the `%s' command.
+         ,(format "Alist of alternative implementations for the ‘%s’ command.
 
 Each entry must be a pair (ALTNAME . ALTFUN), where:
 ALTNAME - The name shown at user to describe the alternative implementation.
@@ -8318,28 +8317,28 @@ ALTFUN  - The function called to implement this 
alternative."
        (defvar ,varimp-sym nil "Internal use only.")
 
        (defun ,command (&optional arg)
-         ,(format "Run generic command `%s'.
+         ,(format "Run generic command ‘%s’.
 If used for the first time, or with interactive ARG, ask the user which
-implementation to use for `%s'.  The variable `%s'
+implementation to use for ‘%s’.  The variable ‘%s’
 contains the list of implementations currently supported for this command."
                   command-name command-name varalt-name)
          (interactive "P")
          (when (or arg (null ,varimp-sym))
            (let ((val (completing-read
-                      ,(format "Select implementation for command `%s': "
+                      ,(format "Select implementation for command ‘%s’: "
                                command-name)
                       ,varalt-sym nil t)))
              (unless (string-equal val "")
               (when (null ,varimp-sym)
                 (message
-                 "Use `C-u M-x %s RET' to select another implementation"
+                 "Use ‘C-u M-x %s RET’ to select another implementation"
                  ,command-name)
                 (sit-for 3))
               (customize-save-variable ',varimp-sym
                                        (cdr (assoc-string val ,varalt-sym))))))
          (if ,varimp-sym
              (call-interactively ,varimp-sym)
-           (message ,(format "No implementation selected for command `%s'"
+           (message ,(format "No implementation selected for command ‘%s’"
                              command-name)))))))
 
 
diff --git a/lisp/startup.el b/lisp/startup.el
index cfe2269..ec159c2 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -360,7 +360,7 @@ this variable usefully is to set it while building and 
dumping Emacs."
   :group 'initialization
   :initialize #'custom-initialize-default
   :set (lambda (_variable _value)
-         (error "Customizing `site-run-file' does not work")))
+         (error "Customizing ‘site-run-file’ does not work")))
 
 (make-obsolete-variable 'system-name "use (system-name) instead" "25.1")
 
@@ -752,7 +752,7 @@ to prepare for opening the first frame (e.g. open a 
connection to an X server)."
                (let ((elt (assoc completion tty-long-option-alist)))
                  ;; Check for abbreviated long option.
                  (or elt
-                     (error "Option `%s' is ambiguous" argi))
+                     (error "Option ‘%s’ is ambiguous" argi))
                  (setq argi (cdr elt)))
              ;; Check for a short option.
              (setq argval nil
@@ -902,7 +902,7 @@ please check its value")
                  ((stringp completion)
                   (let ((elt (assoc completion longopts)))
                     (unless elt
-                      (error "Option `%s' is ambiguous" argi))
+                      (error "Option ‘%s’ is ambiguous" argi))
                     (setq argi (substring (car elt) 1))))
                  (t
                   (setq argval nil
@@ -945,7 +945,7 @@ please check its value")
           (setq done t)))
        ;; Was argval set but not used?
        (and argval
-            (error "Option `%s' doesn't allow an argument" argi))))
+            (error "Option ‘%s’ doesn't allow an argument" argi))))
 
     ;; Re-attach the --display arg.
     (and display-arg (setq args (append display-arg args)))
@@ -964,7 +964,7 @@ please check its value")
               (not (featurep
                     (intern
                      (concat (symbol-name initial-window-system) "-win")))))
-         (error "Unsupported window system `%s'" initial-window-system))
+         (error "Unsupported window system ‘%s’" initial-window-system))
       ;; Process window-system specific command line parameters.
       (setq command-line-args
             (let ((window-system initial-window-system)) ;Hack attack!
@@ -1023,6 +1023,7 @@ please check its value")
       (or standard-display-table
           (setq standard-display-table (make-display-table)))
       (aset standard-display-table (car char-repl) (cdr char-repl))))
+  (setq internal--text-quoting-flag t)
 
   ;; Re-evaluate predefined variables whose initial value depends on
   ;; the runtime context.
@@ -1176,10 +1177,10 @@ please check its value")
            (error
             (display-warning
              'initialization
-             (format "An error occurred while loading `%s':\n\n%s%s%s\n\n\
+             (format "An error occurred while loading ‘%s’:\n\n%s%s%s\n\n\
 To ensure normal operation, you should investigate and remove the
 cause of the error in your initialization file.  Start Emacs with
-the `--debug-init' option to view a complete error backtrace."
+the ‘--debug-init’ option to view a complete error backtrace."
                      user-init-file
                      (get (car error) 'error-message)
                      (if (cdr error) ": " "")
@@ -1311,8 +1312,8 @@ the `--debug-init' option to view a complete error 
backtrace."
                         (expand-file-name user-emacs-directory))
           (setq warned t)
           (display-warning 'initialization
-                           (format "Your `load-path' seems to contain
-your `.emacs.d' directory: %s\n\
+                           (format "Your ‘load-path’ seems to contain
+your ‘.emacs.d’ directory: %s\n\
 This is likely to cause problems...\n\
 Consider using a subdirectory instead, e.g.: %s"
                                     dir (expand-file-name
@@ -2160,9 +2161,12 @@ A fancy display is used on graphic displays, normal 
otherwise."
   ;; which includes files parsed from the command line arguments and
   ;; `initial-buffer-choice'.  All of the display logic happens at the
   ;; end of this `let'.  As files as processed from the command line
-  ;; arguments, their buffers are prepended to `displayable-buffers'
-  ;; but they are not displayed until command line parsing has
-  ;; finished.
+  ;; arguments, their buffers are prepended to `displayable-buffers'.
+  ;; In order for options like "--eval" to work with the "--file" arg,
+  ;; the file buffers are set as the current buffer as they are seen
+  ;; on the command line (so "emacs --batch --file a --file b
+  ;; --eval='(message "%s" (buffer-name))'" will print "b"), but this
+  ;; does not affect the final displayed state of the buffers.
   (let ((displayable-buffers nil))
     ;; This `let' processes the command line arguments.
     (let ((command-line-args-left args-left))
@@ -2193,10 +2197,11 @@ A fancy display is used on graphic displays, normal 
otherwise."
                                 command-switch-alist)))
                (line 0)
                (column 0)
-               ;; `process-file-arg' opens a file buffer for `name'
-               ;; without switching to the buffer, adds the buffer to
+               ;; `process-file-arg' opens a file buffer for `name',
+               ;; sets that buffer as the current buffer without
+               ;; displaying it, adds the buffer to
                ;; `displayable-buffers', and puts the point at
-               ;; `line':`column'. `line' and `column' are both reset
+               ;; `line':`column'.  `line' and `column' are both reset
                ;; to zero when `process-file-arg' returns.
                (process-file-arg
                 (lambda (name)
@@ -2209,14 +2214,19 @@ nil default-directory" name)
                                  dir))
                           (buf (find-file-noselect file)))
                      (setq displayable-buffers (cons buf displayable-buffers))
-                     (with-current-buffer buf
-                       (unless (zerop line)
-                         (goto-char (point-min))
-                         (forward-line (1- line)))
-                       (setq line 0)
-                       (unless (< column 1)
-                         (move-to-column (1- column)))
-                       (setq column 0)))))))
+                      ;; Set the file buffer to the current buffer so
+                      ;; that it will be used with "--eval" and
+                      ;; similar options.
+                      (set-buffer buf)
+                      ;; Put the point at `line':`column' in the file
+                      ;; buffer, and reset `line' and `column' to 0.
+                      (unless (zerop line)
+                        (goto-char (point-min))
+                        (forward-line (1- line)))
+                      (setq line 0)
+                      (unless (< column 1)
+                        (move-to-column (1- column)))
+                      (setq column 0))))))
 
           ;; Add the long X options to longopts.
           (dolist (tem command-line-x-option-alist)
@@ -2251,7 +2261,7 @@ nil default-directory" name)
                     (if (stringp completion)
                         (let ((elt (member completion longopts)))
                           (or elt
-                              (error "Option `%s' is ambiguous" argi))
+                              (error "Option ‘%s’ is ambiguous" argi))
                           (setq argi (substring (car elt) 1)))
                       (setq argval nil
                             argi orig-argi)))))
@@ -2321,7 +2331,7 @@ nil default-directory" name)
                      (setq inhibit-startup-screen t)
                      (setq tem (or argval (pop command-line-args-left)))
                      (or (stringp tem)
-                         (error "File name omitted from `-insert' option"))
+                         (error "File name omitted from ‘-insert’ option"))
                      (insert-file-contents (command-line-normalize-file-name 
tem)))
 
                     ((equal argi "-kill")
@@ -2356,7 +2366,7 @@ nil default-directory" name)
                      ;; An explicit option to specify visiting a file.
                      (setq tem (or argval (pop command-line-args-left)))
                      (unless (stringp tem)
-                       (error "File name omitted from `%s' option" argi))
+                       (error "File name omitted from ‘%s’ option" argi))
                      (funcall process-file-arg tem))
 
                     ;; These command lines now have no effect.
@@ -2377,7 +2387,7 @@ nil default-directory" name)
                        (unless did-hook
                          ;; Presume that the argument is a file name.
                          (if (string-match "\\`-" argi)
-                             (error "Unknown option `%s'" argi))
+                             (error "Unknown option ‘%s’" argi))
                          ;; FIXME: Why do we only inhibit the startup
                          ;; screen for -nw?
                          (unless initial-window-system
diff --git a/lisp/subr.el b/lisp/subr.el
index 3dd87d6..7e7dbd1 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -72,7 +72,7 @@ For more information, see Info node `(elisp)Declaring 
Functions'."
 If FORM does return, signal an error."
   (declare (debug t))
   `(prog1 ,form
-     (error "Form marked with `noreturn' did return")))
+     (error "Form marked with ‘noreturn’ did return")))
 
 (defmacro 1value (form)
   "Evaluate FORM, expecting a constant return value.
@@ -320,7 +320,7 @@ Defaults to `error'."
                     (mapcar (lambda (parent)
                               (cons parent
                                     (or (get parent 'error-conditions)
-                                        (error "Unknown signal `%s'" parent))))
+                                        (error "Unknown signal ‘%s’" parent))))
                             parent))
            (cons parent (get parent 'error-conditions)))))
     (put name 'error-conditions
@@ -1606,7 +1606,7 @@ can do the job."
           exp
         (let* ((sym (cadr list-var))
                (append (eval append))
-               (msg (format "`add-to-list' can't use lexical var `%s'; use 
`push' or `cl-pushnew'"
+               (msg (format "‘add-to-list’ can't use lexical var ‘%s’; use 
‘push’ or ‘cl-pushnew’"
                             sym))
                ;; Big ugly hack so we only output a warning during
                ;; byte-compilation, and so we can use
@@ -2207,7 +2207,7 @@ Any input that is not one of CHARS is ignored.
 If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
 keyboard-quit events while waiting for a valid input."
   (unless (consp chars)
-    (error "Called `read-char-choice' without valid char choices"))
+    (error "Called ‘read-char-choice’ without valid char choices"))
   (let (char done show-help (helpbuf " *Char Help*"))
     (let ((cursor-in-echo-area t)
           (executing-kbd-macro executing-kbd-macro)
diff --git a/lisp/term/common-win.el b/lisp/term/common-win.el
index 98ad5ac..ccac142 100644
--- a/lisp/term/common-win.el
+++ b/lisp/term/common-win.el
@@ -112,7 +112,7 @@
 ;; Handle the -xrm option.
 (defun x-handle-xrm-switch (switch)
   (unless (consp x-invocation-args)
-    (error "%s: missing argument to `%s' option" (invocation-name) switch))
+    (error "%s: missing argument to ‘%s’ option" (invocation-name) switch))
   (setq x-command-line-resources
        (if (null x-command-line-resources)
            (pop x-invocation-args)
@@ -152,7 +152,7 @@
 ;; the initial frame, too.
 (defun x-handle-name-switch (switch)
   (or (consp x-invocation-args)
-      (error "%s: missing argument to `%s' option" (invocation-name) switch))
+      (error "%s: missing argument to ‘%s’ option" (invocation-name) switch))
   (setq x-resource-name (pop x-invocation-args)
        initial-frame-alist (cons (cons 'name x-resource-name)
                                  initial-frame-alist)))
@@ -207,7 +207,7 @@ have been processed."
                  (let ((elt (assoc completion option-alist)))
                    ;; Check for abbreviated long option.
                    (or elt
-                       (error "Option `%s' is ambiguous" this-switch))
+                       (error "Option ‘%s’ is ambiguous" this-switch))
                    (setq this-switch completion))))))
       (setq aelt (assoc this-switch option-alist))
       (if aelt (setq handler (nth 2 aelt)))
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 39145ff..c325661 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -1,4 +1,4 @@
-;;; x-win.el --- parse relevant switches and set up for X  -*-coding: 
iso-2022-7bit; lexical-binding:t -*-
+;;; x-win.el --- parse relevant switches and set up for X  -*-coding: utf-8; 
lexical-binding:t -*-
 
 ;; Copyright (C) 1993-1994, 2001-2015 Free Software Foundation, Inc.
 
@@ -93,7 +93,7 @@
 ;; Handle the --parent-id option.
 (defun x-handle-parent-id (switch)
   (or (consp x-invocation-args)
-      (error "%s: missing argument to `%s' option" (invocation-name) switch))
+      (error "%s: missing argument to ‘%s’ option" (invocation-name) switch))
   (setq initial-frame-alist (cons
                              (cons 'parent-id
                                    (string-to-number (car x-invocation-args)))
@@ -104,7 +104,7 @@
 ;; to give us back our session id we had on the previous run.
 (defun x-handle-smid (switch)
   (or (consp x-invocation-args)
-      (error "%s: missing argument to `%s' option" (invocation-name) switch))
+      (error "%s: missing argument to ‘%s’ option" (invocation-name) switch))
   (setq x-session-previous-id (car x-invocation-args)
        x-invocation-args (cdr x-invocation-args)))
 
@@ -307,830 +307,822 @@ as returned by `x-server-vendor'."
      (pair
       '(
        ;; Latin-2
-       (#x1a1 . ?,B!(B)
-       (#x1a2 . ?,B"(B)
-       (#x1a3 . ?,B#(B)
-       (#x1a5 . ?,B%(B)
-       (#x1a6 . ?,B&(B)
-       (#x1a9 . ?,B)(B)
-       (#x1aa . ?,B*(B)
-       (#x1ab . ?,B+(B)
-       (#x1ac . ?,B,(B)
-       (#x1ae . ?,B.(B)
-       (#x1af . ?,B/(B)
-       (#x1b1 . ?,B1(B)
-       (#x1b2 . ?,B2(B)
-       (#x1b3 . ?,B3(B)
-       (#x1b5 . ?,B5(B)
-       (#x1b6 . ?,B6(B)
-       (#x1b7 . ?,B7(B)
-       (#x1b9 . ?,B9(B)
-       (#x1ba . ?,B:(B)
-       (#x1bb . ?,B;(B)
-       (#x1bc . ?,B<(B)
-       (#x1bd . ?,B=(B)
-       (#x1be . ?,B>(B)
-       (#x1bf . ?,B?(B)
-       (#x1c0 . ?,address@hidden(B)
-       (#x1c3 . ?,BC(B)
-       (#x1c5 . ?,BE(B)
-       (#x1c6 . ?,BF(B)
-       (#x1c8 . ?,BH(B)
-       (#x1ca . ?,BJ(B)
-       (#x1cc . ?,BL(B)
-       (#x1cf . ?,BO(B)
-       (#x1d0 . ?,BP(B)
-       (#x1d1 . ?,BQ(B)
-       (#x1d2 . ?,BR(B)
-       (#x1d5 . ?,BU(B)
-       (#x1d8 . ?,BX(B)
-       (#x1d9 . ?,BY(B)
-       (#x1db . ?,B[(B)
-       (#x1de . ?,B^(B)
-       (#x1e0 . ?,B`(B)
-       (#x1e3 . ?,Bc(B)
-       (#x1e5 . ?,Be(B)
-       (#x1e6 . ?,Bf(B)
-       (#x1e8 . ?,Bh(B)
-       (#x1ea . ?,Bj(B)
-       (#x1ec . ?,Bl(B)
-       (#x1ef . ?,Bo(B)
-       (#x1f0 . ?,Bp(B)
-       (#x1f1 . ?,Bq(B)
-       (#x1f2 . ?,Br(B)
-       (#x1f5 . ?,Bu(B)
-       (#x1f8 . ?,Bx(B)
-       (#x1f9 . ?,By(B)
-       (#x1fb . ?,B{(B)
-       (#x1fe . ?,B~(B)
-       (#x1ff . ?,B(B)
+       (#x1a1 . ?Ą)
+       (#x1a2 . ?˘)
+       (#x1a3 . ?Ł)
+       (#x1a5 . ?Ľ)
+       (#x1a6 . ?Ś)
+       (#x1a9 . ?Š)
+       (#x1aa . ?Ş)
+       (#x1ab . ?Ť)
+       (#x1ac . ?Ź)
+       (#x1ae . ?Ž)
+       (#x1af . ?Ż)
+       (#x1b1 . ?ą)
+       (#x1b2 . ?˛)
+       (#x1b3 . ?ł)
+       (#x1b5 . ?ľ)
+       (#x1b6 . ?ś)
+       (#x1b7 . ?ˇ)
+       (#x1b9 . ?š)
+       (#x1ba . ?ş)
+       (#x1bb . ?ť)
+       (#x1bc . ?ź)
+       (#x1bd . ?˝)
+       (#x1be . ?ž)
+       (#x1bf . ?ż)
+       (#x1c0 . ?Ŕ)
+       (#x1c3 . ?Ă)
+       (#x1c5 . ?Ĺ)
+       (#x1c6 . ?Ć)
+       (#x1c8 . ?Č)
+       (#x1ca . ?Ę)
+       (#x1cc . ?Ě)
+       (#x1cf . ?Ď)
+       (#x1d0 . ?Đ)
+       (#x1d1 . ?Ń)
+       (#x1d2 . ?Ň)
+       (#x1d5 . ?Ő)
+       (#x1d8 . ?Ř)
+       (#x1d9 . ?Ů)
+       (#x1db . ?Ű)
+       (#x1de . ?Ţ)
+       (#x1e0 . ?ŕ)
+       (#x1e3 . ?ă)
+       (#x1e5 . ?ĺ)
+       (#x1e6 . ?ć)
+       (#x1e8 . ?č)
+       (#x1ea . ?ę)
+       (#x1ec . ?ě)
+       (#x1ef . ?ď)
+       (#x1f0 . ?đ)
+       (#x1f1 . ?ń)
+       (#x1f2 . ?ň)
+       (#x1f5 . ?ő)
+       (#x1f8 . ?ř)
+       (#x1f9 . ?ů)
+       (#x1fb . ?ű)
+       (#x1fe . ?ţ)
+       (#x1ff . ?˙)
        ;; Latin-3
-       (#x2a1 . ?,C!(B)
-       (#x2a6 . ?,C&(B)
-       (#x2a9 . ?,C)(B)
-       (#x2ab . ?,C+(B)
-       (#x2ac . ?,C,(B)
-       (#x2b1 . ?,C1(B)
-       (#x2b6 . ?,C6(B)
-       (#x2b9 . ?,C9(B)
-       (#x2bb . ?,C;(B)
-       (#x2bc . ?,C<(B)
-       (#x2c5 . ?,CE(B)
-       (#x2c6 . ?,CF(B)
-       (#x2d5 . ?,CU(B)
-       (#x2d8 . ?,CX(B)
-       (#x2dd . ?,C](B)
-       (#x2de . ?,C^(B)
-       (#x2e5 . ?,Ce(B)
-       (#x2e6 . ?,Cf(B)
-       (#x2f5 . ?,Cu(B)
-       (#x2f8 . ?,Cx(B)
-       (#x2fd . ?,C}(B)
-       (#x2fe . ?,C~(B)
+       (#x2a1 . ?Ħ)
+       (#x2a6 . ?Ĥ)
+       (#x2a9 . ?İ)
+       (#x2ab . ?Ğ)
+       (#x2ac . ?Ĵ)
+       (#x2b1 . ?ħ)
+       (#x2b6 . ?ĥ)
+       (#x2b9 . ?ı)
+       (#x2bb . ?ğ)
+       (#x2bc . ?ĵ)
+       (#x2c5 . ?Ċ)
+       (#x2c6 . ?Ĉ)
+       (#x2d5 . ?Ġ)
+       (#x2d8 . ?Ĝ)
+       (#x2dd . ?Ŭ)
+       (#x2de . ?Ŝ)
+       (#x2e5 . ?ċ)
+       (#x2e6 . ?ĉ)
+       (#x2f5 . ?ġ)
+       (#x2f8 . ?ĝ)
+       (#x2fd . ?ŭ)
+       (#x2fe . ?ŝ)
        ;; Latin-4
-       (#x3a2 . ?,D"(B)
-       (#x3a3 . ?,D#(B)
-       (#x3a5 . ?,D%(B)
-       (#x3a6 . ?,D&(B)
-       (#x3aa . ?,D*(B)
-       (#x3ab . ?,D+(B)
-       (#x3ac . ?,D,(B)
-       (#x3b3 . ?,D3(B)
-       (#x3b5 . ?,D5(B)
-       (#x3b6 . ?,D6(B)
-       (#x3ba . ?,D:(B)
-       (#x3bb . ?,D;(B)
-       (#x3bc . ?,D<(B)
-       (#x3bd . ?,D=(B)
-       (#x3bf . ?,D?(B)
-       (#x3c0 . ?,address@hidden(B)
-       (#x3c7 . ?,DG(B)
-       (#x3cc . ?,DL(B)
-       (#x3cf . ?,DO(B)
-       (#x3d1 . ?,DQ(B)
-       (#x3d2 . ?,DR(B)
-       (#x3d3 . ?,DS(B)
-       (#x3d9 . ?,DY(B)
-       (#x3dd . ?,D](B)
-       (#x3de . ?,D^(B)
-       (#x3e0 . ?,D`(B)
-       (#x3e7 . ?,Dg(B)
-       (#x3ec . ?,Dl(B)
-       (#x3ef . ?,Do(B)
-       (#x3f1 . ?,Dq(B)
-       (#x3f2 . ?,Dr(B)
-       (#x3f3 . ?,Ds(B)
-       (#x3f9 . ?,Dy(B)
-       (#x3fd . ?,D}(B)
-       (#x3fe . ?,D~(B)
-       ;; Kana: Fixme: needs conversion to Japanese charset -- seems
-       ;; to require jisx0213, for which the Unicode translation
-       ;; isn't clear.  Using Emacs to convert this to Unicode and back changes
-       ;; this from "(J~(B" (i.e., bytes "ESC ( J ~ ESC ( B") to "$(G"#(B" 
(i.e., bytes
-       ;; "ESC $ ( G " # ESC ( B").
-       (#x47e . ?(J~(B)
-       (#x4a1 . ?$A!#(B)
-       (#x4a2 . ?\$A!8(B)
-       (#x4a3 . ?\$A!9(B)
-       (#x4a4 . ?$A!"(B)
-       (#x4a5 . ?$A!$(B)
-       (#x4a6 . ?$A%r(B)
-       (#x4a7 . ?$A%!(B)
-       (#x4a8 . ?$A%#(B)
-       (#x4a9 . ?$A%%(B)
-       (#x4aa . ?$A%'(B)
-       (#x4ab . ?$A%)(B)
-       (#x4ac . ?$A%c(B)
-       (#x4ad . ?$A%e(B)
-       (#x4ae . ?$A%g(B)
-       (#x4af . ?$A%C(B)
-       (#x4b0 . ?$B!<(B)
-       (#x4b1 . ?$A%"(B)
-       (#x4b2 . ?$A%$(B)
-       (#x4b3 . ?$A%&(B)
-       (#x4b4 . ?$A%((B)
-       (#x4b5 . ?$A%*(B)
-       (#x4b6 . ?$A%+(B)
-       (#x4b7 . ?$A%-(B)
-       (#x4b8 . ?$A%/(B)
-       (#x4b9 . ?$A%1(B)
-       (#x4ba . ?$A%3(B)
-       (#x4bb . ?$A%5(B)
-       (#x4bc . ?$A%7(B)
-       (#x4bd . ?$A%9(B)
-       (#x4be . ?$A%;(B)
-       (#x4bf . ?$A%=(B)
-       (#x4c0 . ?$A%?(B)
-       (#x4c1 . ?$A%A(B)
-       (#x4c2 . ?$A%D(B)
-       (#x4c3 . ?$A%F(B)
-       (#x4c4 . ?$A%H(B)
-       (#x4c5 . ?$A%J(B)
-       (#x4c6 . ?$A%K(B)
-       (#x4c7 . ?$A%L(B)
-       (#x4c8 . ?$A%M(B)
-       (#x4c9 . ?$A%N(B)
-       (#x4ca . ?$A%O(B)
-       (#x4cb . ?$A%R(B)
-       (#x4cc . ?$A%U(B)
-       (#x4cd . ?$A%X(B)
-       (#x4ce . ?$A%[(B)
-       (#x4cf . ?$A%^(B)
-       (#x4d0 . ?$A%_(B)
-       (#x4d1 . ?$A%`(B)
-       (#x4d2 . ?$A%a(B)
-       (#x4d3 . ?$A%b(B)
-       (#x4d4 . ?$A%d(B)
-       (#x4d5 . ?$A%f(B)
-       (#x4d6 . ?$A%h(B)
-       (#x4d7 . ?$A%i(B)
-       (#x4d8 . ?$A%j(B)
-       (#x4d9 . ?$A%k(B)
-       (#x4da . ?$A%l(B)
-       (#x4db . ?$A%m(B)
-       (#x4dc . ?$A%o(B)
-       (#x4dd . ?$A%s(B)
-       (#x4de . ?$B!+(B)
-       (#x4df . ?$B!,(B)
+       (#x3a2 . ?ĸ)
+       (#x3a3 . ?Ŗ)
+       (#x3a5 . ?Ĩ)
+       (#x3a6 . ?Ļ)
+       (#x3aa . ?Ē)
+       (#x3ab . ?Ģ)
+       (#x3ac . ?Ŧ)
+       (#x3b3 . ?ŗ)
+       (#x3b5 . ?ĩ)
+       (#x3b6 . ?ļ)
+       (#x3ba . ?ē)
+       (#x3bb . ?ģ)
+       (#x3bc . ?ŧ)
+       (#x3bd . ?Ŋ)
+       (#x3bf . ?ŋ)
+       (#x3c0 . ?Ā)
+       (#x3c7 . ?Į)
+       (#x3cc . ?Ė)
+       (#x3cf . ?Ī)
+       (#x3d1 . ?Ņ)
+       (#x3d2 . ?Ō)
+       (#x3d3 . ?Ķ)
+       (#x3d9 . ?Ų)
+       (#x3dd . ?Ũ)
+       (#x3de . ?Ū)
+       (#x3e0 . ?ā)
+       (#x3e7 . ?į)
+       (#x3ec . ?ė)
+       (#x3ef . ?ī)
+       (#x3f1 . ?ņ)
+       (#x3f2 . ?ō)
+       (#x3f3 . ?ķ)
+       (#x3f9 . ?ų)
+       (#x3fd . ?ũ)
+       (#x3fe . ?ū)
+       (#x47e . ?‾)
+       (#x4a1 . ?。)
+       (#x4a2 . ?\「)
+       (#x4a3 . ?\」)
+       (#x4a4 . ?、)
+       (#x4a5 . ?・)
+       (#x4a6 . ?ヲ)
+       (#x4a7 . ?ァ)
+       (#x4a8 . ?ィ)
+       (#x4a9 . ?ゥ)
+       (#x4aa . ?ェ)
+       (#x4ab . ?ォ)
+       (#x4ac . ?ャ)
+       (#x4ad . ?ュ)
+       (#x4ae . ?ョ)
+       (#x4af . ?ッ)
+       (#x4b0 . ?ー)
+       (#x4b1 . ?ア)
+       (#x4b2 . ?イ)
+       (#x4b3 . ?ウ)
+       (#x4b4 . ?エ)
+       (#x4b5 . ?オ)
+       (#x4b6 . ?カ)
+       (#x4b7 . ?キ)
+       (#x4b8 . ?ク)
+       (#x4b9 . ?ケ)
+       (#x4ba . ?コ)
+       (#x4bb . ?サ)
+       (#x4bc . ?シ)
+       (#x4bd . ?ス)
+       (#x4be . ?セ)
+       (#x4bf . ?ソ)
+       (#x4c0 . ?タ)
+       (#x4c1 . ?チ)
+       (#x4c2 . ?ツ)
+       (#x4c3 . ?テ)
+       (#x4c4 . ?ト)
+       (#x4c5 . ?ナ)
+       (#x4c6 . ?ニ)
+       (#x4c7 . ?ヌ)
+       (#x4c8 . ?ネ)
+       (#x4c9 . ?ノ)
+       (#x4ca . ?ハ)
+       (#x4cb . ?ヒ)
+       (#x4cc . ?フ)
+       (#x4cd . ?ヘ)
+       (#x4ce . ?ホ)
+       (#x4cf . ?マ)
+       (#x4d0 . ?ミ)
+       (#x4d1 . ?ム)
+       (#x4d2 . ?メ)
+       (#x4d3 . ?モ)
+       (#x4d4 . ?ヤ)
+       (#x4d5 . ?ユ)
+       (#x4d6 . ?ヨ)
+       (#x4d7 . ?ラ)
+       (#x4d8 . ?リ)
+       (#x4d9 . ?ル)
+       (#x4da . ?レ)
+       (#x4db . ?ロ)
+       (#x4dc . ?ワ)
+       (#x4dd . ?ン)
+       (#x4de . ?゛)
+       (#x4df . ?゜)
        ;; Arabic
-       (#x5ac . ?,G,(B)
-       (#x5bb . ?,G;(B)
-       (#x5bf . ?,G?(B)
-       (#x5c1 . ?,GA(B)
-       (#x5c2 . ?,GB(B)
-       (#x5c3 . ?,GC(B)
-       (#x5c4 . ?,GD(B)
-       (#x5c5 . ?,GE(B)
-       (#x5c6 . ?,GF(B)
-       (#x5c7 . ?,GG(B)
-       (#x5c8 . ?,GH(B)
-       (#x5c9 . ?,GI(B)
-       (#x5ca . ?,GJ(B)
-       (#x5cb . ?,GK(B)
-       (#x5cc . ?,GL(B)
-       (#x5cd . ?,GM(B)
-       (#x5ce . ?,GN(B)
-       (#x5cf . ?,GO(B)
-       (#x5d0 . ?,GP(B)
-       (#x5d1 . ?,GQ(B)
-       (#x5d2 . ?,GR(B)
-       (#x5d3 . ?,GS(B)
-       (#x5d4 . ?,GT(B)
-       (#x5d5 . ?,GU(B)
-       (#x5d6 . ?,GV(B)
-       (#x5d7 . ?,GW(B)
-       (#x5d8 . ?,GX(B)
-       (#x5d9 . ?,GY(B)
-       (#x5da . ?,GZ(B)
-       (#x5e0 . ?,G`(B)
-       (#x5e1 . ?,Ga(B)
-       (#x5e2 . ?,Gb(B)
-       (#x5e3 . ?,Gc(B)
-       (#x5e4 . ?,Gd(B)
-       (#x5e5 . ?,Ge(B)
-       (#x5e6 . ?,Gf(B)
-       (#x5e7 . ?,Gg(B)
-       (#x5e8 . ?,Gh(B)
-       (#x5e9 . ?,Gi(B)
-       (#x5ea . ?,Gj(B)
-       (#x5eb . ?,Gk(B)
-       (#x5ec . ?,Gl(B)
-       (#x5ed . ?,Gm(B)
-       (#x5ee . ?,Gn(B)
-       (#x5ef . ?,Go(B)
-       (#x5f0 . ?,Gp(B)
-       (#x5f1 . ?,Gq(B)
-       (#x5f2 . ?,Gr(B)
+       (#x5ac . ?،)
+       (#x5bb . ?؛)
+       (#x5bf . ?؟)
+       (#x5c1 . ?ء)
+       (#x5c2 . ?آ)
+       (#x5c3 . ?أ)
+       (#x5c4 . ?ؤ)
+       (#x5c5 . ?إ)
+       (#x5c6 . ?ئ)
+       (#x5c7 . ?ا)
+       (#x5c8 . ?ب)
+       (#x5c9 . ?ة)
+       (#x5ca . ?ت)
+       (#x5cb . ?ث)
+       (#x5cc . ?ج)
+       (#x5cd . ?ح)
+       (#x5ce . ?خ)
+       (#x5cf . ?د)
+       (#x5d0 . ?ذ)
+       (#x5d1 . ?ر)
+       (#x5d2 . ?ز)
+       (#x5d3 . ?س)
+       (#x5d4 . ?ش)
+       (#x5d5 . ?ص)
+       (#x5d6 . ?ض)
+       (#x5d7 . ?ط)
+       (#x5d8 . ?ظ)
+       (#x5d9 . ?ع)
+       (#x5da . ?غ)
+       (#x5e0 . ?ـ)
+       (#x5e1 . ?ف)
+       (#x5e2 . ?ق)
+       (#x5e3 . ?ك)
+       (#x5e4 . ?ل)
+       (#x5e5 . ?م)
+       (#x5e6 . ?ن)
+       (#x5e7 . ?ه)
+       (#x5e8 . ?و)
+       (#x5e9 . ?ى)
+       (#x5ea . ?ي)
+       (#x5eb . ?ً)
+       (#x5ec . ?ٌ)
+       (#x5ed . ?ٍ)
+       (#x5ee . ?َ)
+       (#x5ef . ?ُ)
+       (#x5f0 . ?ِ)
+       (#x5f1 . ?ّ)
+       (#x5f2 . ?ْ)
        ;; Cyrillic
-       (#x680 . ?$,1)R(B)
-       (#x681 . ?$,1)V(B)
-       (#x682 . ?$,1)Z(B)
-       (#x683 . ?$,1)\(B)
-       (#x684 . ?$,1)b(B)
-       (#x685 . ?$,1)n(B)
-       (#x686 . ?$,1)p(B)
-       (#x687 . ?$,1)r(B)
-       (#x688 . ?$,1)v(B)
-       (#x689 . ?$,1)x(B)
-       (#x68a . ?$,1)z(B)
-       (#x68c . ?$,1*8(B)
-       (#x68d . ?$,1*B(B)
-       (#x68e . ?$,1*H(B)
-       (#x68f . ?$,1*N(B)
-       (#x690 . ?$,1)S(B)
-       (#x691 . ?$,1)W(B)
-       (#x692 . ?$,1)[(B)
-       (#x693 . ?$,1)](B)
-       (#x694 . ?$,1)c(B)
-       (#x695 . ?$,1)o(B)
-       (#x696 . ?$,1)q(B)
-       (#x697 . ?$,1)s(B)
-       (#x698 . ?$,1)w(B)
-       (#x699 . ?$,1)y(B)
-       (#x69a . ?$,1){(B)
-       (#x69c . ?$,1*9(B)
-       (#x69d . ?$,1*C(B)
-       (#x69e . ?$,1*I(B)
-       (#x69f . ?$,1*O(B)
-       (#x6a1 . ?,Lr(B)
-       (#x6a2 . ?,Ls(B)
-       (#x6a3 . ?,Lq(B)
-       (#x6a4 . ?,Lt(B)
-       (#x6a5 . ?,Lu(B)
-       (#x6a6 . ?,Lv(B)
-       (#x6a7 . ?,Lw(B)
-       (#x6a8 . ?,Lx(B)
-       (#x6a9 . ?,Ly(B)
-       (#x6aa . ?,Lz(B)
-       (#x6ab . ?,L{(B)
-       (#x6ac . ?,L|(B)
-       (#x6ae . ?,L~(B)
-       (#x6af . ?,L(B)
-       (#x6b0 . ?,Lp(B)
-       (#x6b1 . ?,L"(B)
-       (#x6b2 . ?,L#(B)
-       (#x6b3 . ?,L!(B)
-       (#x6b4 . ?,L$(B)
-       (#x6b5 . ?,L%(B)
-       (#x6b6 . ?,L&(B)
-       (#x6b7 . ?,L'(B)
-       (#x6b8 . ?,L((B)
-       (#x6b9 . ?,L)(B)
-       (#x6ba . ?,L*(B)
-       (#x6bb . ?,L+(B)
-       (#x6bc . ?,L,(B)
-       (#x6be . ?,L.(B)
-       (#x6bf . ?,L/(B)
-       (#x6c0 . ?,Ln(B)
-       (#x6c1 . ?,LP(B)
-       (#x6c2 . ?,LQ(B)
-       (#x6c3 . ?,Lf(B)
-       (#x6c4 . ?,LT(B)
-       (#x6c5 . ?,LU(B)
-       (#x6c6 . ?,Ld(B)
-       (#x6c7 . ?,LS(B)
-       (#x6c8 . ?,Le(B)
-       (#x6c9 . ?,LX(B)
-       (#x6ca . ?,LY(B)
-       (#x6cb . ?,LZ(B)
-       (#x6cc . ?,L[(B)
-       (#x6cd . ?,L\(B)
-       (#x6ce . ?,L](B)
-       (#x6cf . ?,L^(B)
-       (#x6d0 . ?,L_(B)
-       (#x6d1 . ?,Lo(B)
-       (#x6d2 . ?,L`(B)
-       (#x6d3 . ?,La(B)
-       (#x6d4 . ?,Lb(B)
-       (#x6d5 . ?,Lc(B)
-       (#x6d6 . ?,LV(B)
-       (#x6d7 . ?,LR(B)
-       (#x6d8 . ?,Ll(B)
-       (#x6d9 . ?,Lk(B)
-       (#x6da . ?,LW(B)
-       (#x6db . ?,Lh(B)
-       (#x6dc . ?,Lm(B)
-       (#x6dd . ?,Li(B)
-       (#x6de . ?,Lg(B)
-       (#x6df . ?,Lj(B)
-       (#x6e0 . ?,LN(B)
-       (#x6e1 . ?,L0(B)
-       (#x6e2 . ?,L1(B)
-       (#x6e3 . ?,LF(B)
-       (#x6e4 . ?,L4(B)
-       (#x6e5 . ?,L5(B)
-       (#x6e6 . ?,LD(B)
-       (#x6e7 . ?,L3(B)
-       (#x6e8 . ?,LE(B)
-       (#x6e9 . ?,L8(B)
-       (#x6ea . ?,L9(B)
-       (#x6eb . ?,L:(B)
-       (#x6ec . ?,L;(B)
-       (#x6ed . ?,L<(B)
-       (#x6ee . ?,L=(B)
-       (#x6ef . ?,L>(B)
-       (#x6f0 . ?,L?(B)
-       (#x6f1 . ?,LO(B)
-       (#x6f2 . ?,address@hidden(B)
-       (#x6f3 . ?,LA(B)
-       (#x6f4 . ?,LB(B)
-       (#x6f5 . ?,LC(B)
-       (#x6f6 . ?,L6(B)
-       (#x6f7 . ?,L2(B)
-       (#x6f8 . ?,LL(B)
-       (#x6f9 . ?,LK(B)
-       (#x6fa . ?,L7(B)
-       (#x6fb . ?,LH(B)
-       (#x6fc . ?,LM(B)
-       (#x6fd . ?,LI(B)
-       (#x6fe . ?,LG(B)
-       (#x6ff . ?,LJ(B)
+       (#x680 . ?Ғ)
+       (#x681 . ?Җ)
+       (#x682 . ?Қ)
+       (#x683 . ?Ҝ)
+       (#x684 . ?Ң)
+       (#x685 . ?Ү)
+       (#x686 . ?Ұ)
+       (#x687 . ?Ҳ)
+       (#x688 . ?Ҷ)
+       (#x689 . ?Ҹ)
+       (#x68a . ?Һ)
+       (#x68c . ?Ә)
+       (#x68d . ?Ӣ)
+       (#x68e . ?Ө)
+       (#x68f . ?Ӯ)
+       (#x690 . ?ғ)
+       (#x691 . ?җ)
+       (#x692 . ?қ)
+       (#x693 . ?ҝ)
+       (#x694 . ?ң)
+       (#x695 . ?ү)
+       (#x696 . ?ұ)
+       (#x697 . ?ҳ)
+       (#x698 . ?ҷ)
+       (#x699 . ?ҹ)
+       (#x69a . ?һ)
+       (#x69c . ?ә)
+       (#x69d . ?ӣ)
+       (#x69e . ?ө)
+       (#x69f . ?ӯ)
+       (#x6a1 . ?ђ)
+       (#x6a2 . ?ѓ)
+       (#x6a3 . ?ё)
+       (#x6a4 . ?є)
+       (#x6a5 . ?ѕ)
+       (#x6a6 . ?і)
+       (#x6a7 . ?ї)
+       (#x6a8 . ?ј)
+       (#x6a9 . ?љ)
+       (#x6aa . ?њ)
+       (#x6ab . ?ћ)
+       (#x6ac . ?ќ)
+       (#x6ae . ?ў)
+       (#x6af . ?џ)
+       (#x6b0 . ?№)
+       (#x6b1 . ?Ђ)
+       (#x6b2 . ?Ѓ)
+       (#x6b3 . ?Ё)
+       (#x6b4 . ?Є)
+       (#x6b5 . ?Ѕ)
+       (#x6b6 . ?І)
+       (#x6b7 . ?Ї)
+       (#x6b8 . ?Ј)
+       (#x6b9 . ?Љ)
+       (#x6ba . ?Њ)
+       (#x6bb . ?Ћ)
+       (#x6bc . ?Ќ)
+       (#x6be . ?Ў)
+       (#x6bf . ?Џ)
+       (#x6c0 . ?ю)
+       (#x6c1 . ?а)
+       (#x6c2 . ?б)
+       (#x6c3 . ?ц)
+       (#x6c4 . ?д)
+       (#x6c5 . ?е)
+       (#x6c6 . ?ф)
+       (#x6c7 . ?г)
+       (#x6c8 . ?х)
+       (#x6c9 . ?и)
+       (#x6ca . ?й)
+       (#x6cb . ?к)
+       (#x6cc . ?л)
+       (#x6cd . ?м)
+       (#x6ce . ?н)
+       (#x6cf . ?о)
+       (#x6d0 . ?п)
+       (#x6d1 . ?я)
+       (#x6d2 . ?р)
+       (#x6d3 . ?с)
+       (#x6d4 . ?т)
+       (#x6d5 . ?у)
+       (#x6d6 . ?ж)
+       (#x6d7 . ?в)
+       (#x6d8 . ?ь)
+       (#x6d9 . ?ы)
+       (#x6da . ?з)
+       (#x6db . ?ш)
+       (#x6dc . ?э)
+       (#x6dd . ?щ)
+       (#x6de . ?ч)
+       (#x6df . ?ъ)
+       (#x6e0 . ?Ю)
+       (#x6e1 . ?А)
+       (#x6e2 . ?Б)
+       (#x6e3 . ?Ц)
+       (#x6e4 . ?Д)
+       (#x6e5 . ?Е)
+       (#x6e6 . ?Ф)
+       (#x6e7 . ?Г)
+       (#x6e8 . ?Х)
+       (#x6e9 . ?И)
+       (#x6ea . ?Й)
+       (#x6eb . ?К)
+       (#x6ec . ?Л)
+       (#x6ed . ?М)
+       (#x6ee . ?Н)
+       (#x6ef . ?О)
+       (#x6f0 . ?П)
+       (#x6f1 . ?Я)
+       (#x6f2 . ?Р)
+       (#x6f3 . ?С)
+       (#x6f4 . ?Т)
+       (#x6f5 . ?У)
+       (#x6f6 . ?Ж)
+       (#x6f7 . ?В)
+       (#x6f8 . ?Ь)
+       (#x6f9 . ?Ы)
+       (#x6fa . ?З)
+       (#x6fb . ?Ш)
+       (#x6fc . ?Э)
+       (#x6fd . ?Щ)
+       (#x6fe . ?Ч)
+       (#x6ff . ?Ъ)
        ;; Greek
-       (#x7a1 . ?,F6(B)
-       (#x7a2 . ?,F8(B)
-       (#x7a3 . ?,F9(B)
-       (#x7a4 . ?,F:(B)
-       (#x7a5 . ?,FZ(B)
-       (#x7a7 . ?,F<(B)
-       (#x7a8 . ?,F>(B)
-       (#x7a9 . ?,F[(B)
-       (#x7ab . ?,F?(B)
-       (#x7ae . ?,F5(B)
-       (#x7af . ?,F/(B)
-       (#x7b1 . ?,F\(B)
-       (#x7b2 . ?,F](B)
-       (#x7b3 . ?,F^(B)
-       (#x7b4 . ?,F_(B)
-       (#x7b5 . ?,Fz(B)
-       (#x7b6 . ?,address@hidden(B)
-       (#x7b7 . ?,F|(B)
-       (#x7b8 . ?,F}(B)
-       (#x7b9 . ?,F{(B)
-       (#x7ba . ?,F`(B)
-       (#x7bb . ?,F~(B)
-       (#x7c1 . ?,FA(B)
-       (#x7c2 . ?,FB(B)
-       (#x7c3 . ?,FC(B)
-       (#x7c4 . ?,FD(B)
-       (#x7c5 . ?,FE(B)
-       (#x7c6 . ?,FF(B)
-       (#x7c7 . ?,FG(B)
-       (#x7c8 . ?,FH(B)
-       (#x7c9 . ?,FI(B)
-       (#x7ca . ?,FJ(B)
-       (#x7cb . ?,FK(B)
-       (#x7cc . ?,FL(B)
-       (#x7cd . ?,FM(B)
-       (#x7ce . ?,FN(B)
-       (#x7cf . ?,FO(B)
-       (#x7d0 . ?,FP(B)
-       (#x7d1 . ?,FQ(B)
-       (#x7d2 . ?,FS(B)
-       (#x7d4 . ?,FT(B)
-       (#x7d5 . ?,FU(B)
-       (#x7d6 . ?,FV(B)
-       (#x7d7 . ?,FW(B)
-       (#x7d8 . ?,FX(B)
-       (#x7d9 . ?,FY(B)
-       (#x7e1 . ?,Fa(B)
-       (#x7e2 . ?,Fb(B)
-       (#x7e3 . ?,Fc(B)
-       (#x7e4 . ?,Fd(B)
-       (#x7e5 . ?,Fe(B)
-       (#x7e6 . ?,Ff(B)
-       (#x7e7 . ?,Fg(B)
-       (#x7e8 . ?,Fh(B)
-       (#x7e9 . ?,Fi(B)
-       (#x7ea . ?,Fj(B)
-       (#x7eb . ?,Fk(B)
-       (#x7ec . ?,Fl(B)
-       (#x7ed . ?,Fm(B)
-       (#x7ee . ?,Fn(B)
-       (#x7ef . ?,Fo(B)
-       (#x7f0 . ?,Fp(B)
-       (#x7f1 . ?,Fq(B)
-       (#x7f2 . ?,Fs(B)
-       (#x7f3 . ?,Fr(B)
-       (#x7f4 . ?,Ft(B)
-       (#x7f5 . ?,Fu(B)
-       (#x7f6 . ?,Fv(B)
-       (#x7f7 . ?,Fw(B)
-       (#x7f8 . ?,Fx(B)
-       (#x7f9 . ?,Fy(B)
+       (#x7a1 . ?Ά)
+       (#x7a2 . ?Έ)
+       (#x7a3 . ?Ή)
+       (#x7a4 . ?Ί)
+       (#x7a5 . ?Ϊ)
+       (#x7a7 . ?Ό)
+       (#x7a8 . ?Ύ)
+       (#x7a9 . ?Ϋ)
+       (#x7ab . ?Ώ)
+       (#x7ae . ?΅)
+       (#x7af . ?―)
+       (#x7b1 . ?ά)
+       (#x7b2 . ?έ)
+       (#x7b3 . ?ή)
+       (#x7b4 . ?ί)
+       (#x7b5 . ?ϊ)
+       (#x7b6 . ?ΐ)
+       (#x7b7 . ?ό)
+       (#x7b8 . ?ύ)
+       (#x7b9 . ?ϋ)
+       (#x7ba . ?ΰ)
+       (#x7bb . ?ώ)
+       (#x7c1 . ?Α)
+       (#x7c2 . ?Β)
+       (#x7c3 . ?Γ)
+       (#x7c4 . ?Δ)
+       (#x7c5 . ?Ε)
+       (#x7c6 . ?Ζ)
+       (#x7c7 . ?Η)
+       (#x7c8 . ?Θ)
+       (#x7c9 . ?Ι)
+       (#x7ca . ?Κ)
+       (#x7cb . ?Λ)
+       (#x7cc . ?Μ)
+       (#x7cd . ?Ν)
+       (#x7ce . ?Ξ)
+       (#x7cf . ?Ο)
+       (#x7d0 . ?Π)
+       (#x7d1 . ?Ρ)
+       (#x7d2 . ?Σ)
+       (#x7d4 . ?Τ)
+       (#x7d5 . ?Υ)
+       (#x7d6 . ?Φ)
+       (#x7d7 . ?Χ)
+       (#x7d8 . ?Ψ)
+       (#x7d9 . ?Ω)
+       (#x7e1 . ?α)
+       (#x7e2 . ?β)
+       (#x7e3 . ?γ)
+       (#x7e4 . ?δ)
+       (#x7e5 . ?ε)
+       (#x7e6 . ?ζ)
+       (#x7e7 . ?η)
+       (#x7e8 . ?θ)
+       (#x7e9 . ?ι)
+       (#x7ea . ?κ)
+       (#x7eb . ?λ)
+       (#x7ec . ?μ)
+       (#x7ed . ?ν)
+       (#x7ee . ?ξ)
+       (#x7ef . ?ο)
+       (#x7f0 . ?π)
+       (#x7f1 . ?ρ)
+       (#x7f2 . ?σ)
+       (#x7f3 . ?ς)
+       (#x7f4 . ?τ)
+       (#x7f5 . ?υ)
+       (#x7f6 . ?φ)
+       (#x7f7 . ?χ)
+       (#x7f8 . ?ψ)
+       (#x7f9 . ?ω)
         ;; Technical
-       (#x8a1 . ?$,1|W(B)
-       (#x8a2 . ?$A)0(B)
-       (#x8a3 . ?$A)$(B)
-       (#x8a4 . ?$,1{ (B)
-       (#x8a5 . ?$,1{!(B)
-       (#x8a6 . ?$A)&(B)
-       (#x8a7 . ?$,1|A(B)
-       (#x8a8 . ?$,1|C(B)
-       (#x8a9 . ?$,1|D(B)
-       (#x8aa . ?$,1|F(B)
-       (#x8ab . ?$,1|;(B)
-       (#x8ac . ?$,1|=(B)
-       (#x8ad . ?$,1|>(B)
-       (#x8ae . ?$,1|@(B)
-       (#x8af . ?$,1|H(B)
-       (#x8b0 . ?$,1|L(B)
-       (#x8bc . ?$A!\(B)
-       (#x8bd . ?$A!Y(B)
-       (#x8be . ?$A!](B)
-       (#x8bf . ?$A!R(B)
-       (#x8c0 . ?$A!`(B)
-       (#x8c1 . ?$A!X(B)
-       (#x8c2 . ?$A!^(B)
-       (#x8c5 . ?$B"`(B)
-       (#x8c8 . ?$(G"D(B)
-       (#x8c9 . ?$(O"l(B)
-       (#x8cd . ?$B"N(B)
-       (#x8ce . ?$B"M(B)
-       (#x8cf . ?$A!T(B)
-       (#x8d6 . ?$A!L(B)
-       (#x8da . ?$B">(B)
-       (#x8db . ?$B"?(B)
-       (#x8dc . ?$A!I(B)
-       (#x8dd . ?$A!H(B)
-       (#x8de . ?$A!D(B)
-       (#x8df . ?$A!E(B)
-       (#x8ef . ?$B"_(B)
-       (#x8f6 . ?$,1!R(B)
-       (#x8fb . ?$A!{(B)
-       (#x8fc . ?$A!|(B)
-       (#x8fd . ?$A!z(B)
-       (#x8fe . ?$A!}(B)
+       (#x8a1 . ?⎷)
+       (#x8a2 . ?┌)
+       (#x8a3 . ?─)
+       (#x8a4 . ?⌠)
+       (#x8a5 . ?⌡)
+       (#x8a6 . ?│)
+       (#x8a7 . ?⎡)
+       (#x8a8 . ?⎣)
+       (#x8a9 . ?⎤)
+       (#x8aa . ?⎦)
+       (#x8ab . ?⎛)
+       (#x8ac . ?⎝)
+       (#x8ad . ?⎞)
+       (#x8ae . ?⎠)
+       (#x8af . ?⎨)
+       (#x8b0 . ?⎬)
+       (#x8bc . ?≤)
+       (#x8bd . ?≠)
+       (#x8be . ?≥)
+       (#x8bf . ?∫)
+       (#x8c0 . ?∴)
+       (#x8c1 . ?∝)
+       (#x8c2 . ?∞)
+       (#x8c5 . ?∇)
+       (#x8c8 . ?∼)
+       (#x8c9 . ?≃)
+       (#x8cd . ?⇔)
+       (#x8ce . ?⇒)
+       (#x8cf . ?≡)
+       (#x8d6 . ?√)
+       (#x8da . ?⊂)
+       (#x8db . ?⊃)
+       (#x8dc . ?∩)
+       (#x8dd . ?∪)
+       (#x8de . ?∧)
+       (#x8df . ?∨)
+       (#x8ef . ?∂)
+       (#x8f6 . ?ƒ)
+       (#x8fb . ?←)
+       (#x8fc . ?↑)
+       (#x8fd . ?→)
+       (#x8fe . ?↓)
        ;; Special
-       (#x9e0 . ?$A!t(B)
-       (#x9e1 . ?$(C"F(B)
-       (#x9e2 . ?$(GB*(B)
-       (#x9e3 . ?$(GB-(B)
-       (#x9e4 . ?$(GB.(B)
-       (#x9e5 . ?$(GB+(B)
-       (#x9e8 . ?$,1}d(B)
-       (#x9e9 . ?$(GB,(B)
-       (#x9ea . ?$A)<(B)
-       (#x9eb . ?$A)4(B)
-       (#x9ec . ?$A)0(B)
-       (#x9ed . ?$A)8(B)
-       (#x9ee . ?$A)`(B)
-       (#x9ef . ?$,1|Z(B)
-       (#x9f0 . ?$,1|[(B)
-       (#x9f1 . ?$A)$(B)
-       (#x9f2 . ?$,1|\(B)
-       (#x9f3 . ?$,1|](B)
-       (#x9f4 . ?$A)@(B)
-       (#x9f5 . ?$A)H(B)
-       (#x9f6 . ?$A)X(B)
-       (#x9f7 . ?$A)P(B)
-       (#x9f8 . ?$A)&(B)
+       (#x9e0 . ?◆)
+       (#x9e1 . ?▒)
+       (#x9e2 . ?␉)
+       (#x9e3 . ?␌)
+       (#x9e4 . ?␍)
+       (#x9e5 . ?␊)
+       (#x9e8 . ?␤)
+       (#x9e9 . ?␋)
+       (#x9ea . ?┘)
+       (#x9eb . ?┐)
+       (#x9ec . ?┌)
+       (#x9ed . ?└)
+       (#x9ee . ?┼)
+       (#x9ef . ?⎺)
+       (#x9f0 . ?⎻)
+       (#x9f1 . ?─)
+       (#x9f2 . ?⎼)
+       (#x9f3 . ?⎽)
+       (#x9f4 . ?├)
+       (#x9f5 . ?┤)
+       (#x9f6 . ?┴)
+       (#x9f7 . ?┬)
+       (#x9f8 . ?│)
        ;; Publishing
-       (#xaa1 . ?$,1rc(B)
-       (#xaa2 . ?$,1rb(B)
-       (#xaa3 . ?$,1rd(B)
-       (#xaa4 . ?$,1re(B)
-       (#xaa5 . ?$,1rg(B)
-       (#xaa6 . ?$,1rh(B)
-       (#xaa7 . ?$,1ri(B)
-       (#xaa8 . ?$,1rj(B)
-       (#xaa9 . ?$(G!7(B)
-       (#xaaa . ?$(G!9(B)
-       (#xaae . ?$A!-(B)
-       (#xaaf . ?$(G!-(B)
-       (#xab0 . ?$(O'x(B)
-       (#xab1 . ?$(O'y(B)
-       (#xab2 . ?$(O'z(B)
-       (#xab3 . ?$,1v6(B)
-       (#xab4 . ?$,1v7(B)
-       (#xab5 . ?$,1v8(B)
-       (#xab6 . ?$,1v9(B)
-       (#xab7 . ?$,1v:(B)
-       (#xab8 . ?$(G""(B)
-       (#xabb . ?$,1rr(B)
-       (#xabc . ?$,1{)(B)
-       (#xabe . ?$,1{*(B)
-       (#xac3 . ?$(C({(B)
-       (#xac4 . ?$(C(|(B)
-       (#xac5 . ?$(C(}(B)
-       (#xac6 . ?$(C(~(B)
-       (#xac9 . ?$(D"o(B)
-       (#xaca . ?$,2"s(B)
-       (#xacc . ?$(O##(B)
-       (#xacd . ?$(O#!(B)
-       (#xace . ?$A!p(B)
-       (#xacf . ?$,2!o(B)
-       (#xad0 . ?,F!(B)
-       (#xad1 . ?,F"(B)
-       (#xad2 . ?,Y4(B)
-       (#xad3 . ?,Y!(B)
-       (#xad4 . ?$,1u^(B)
-       (#xad6 . ?$A!d(B)
-       (#xad7 . ?$A!e(B)
-       (#xad9 . ?$,2%](B)
-       (#xadb . ?$,2!l(B)
-       (#xadc . ?$(O#$(B)
-       (#xadd . ?$(O#"(B)
-       (#xade . ?$A!q(B)
-       (#xadf . ?$,2!n(B)
-       (#xae0 . ?$(O#?(B)
-       (#xae1 . ?$,2!k(B)
-       (#xae2 . ?$,2!m(B)
-       (#xae3 . ?$A!w(B)
-       (#xae4 . ?$(G!}(B)
-       (#xae5 . ?$A!n(B)
-       (#xae6 . ?$(address@hidden(B)
-       (#xae7 . ?$,2!j(B)
-       (#xae8 . ?$A!x(B)
-       (#xae9 . ?$(G!~(B)
-       (#xaea . ?$(C"P(B)
-       (#xaeb . ?$(O-~(B)
-       (#xaec . ?$(O&@(B)
-       (#xaed . ?$(O&<(B)
-       (#xaee . ?$(O&>(B)
-       (#xaf0 . ?$,2%`(B)
-       (#xaf1 . ?$B"w(B)
-       (#xaf2 . ?$B"x(B)
-       (#xaf3 . ?$(O'{(B)
-       (#xaf4 . ?$,2%W(B)
-       (#xaf5 . ?$B"t(B)
-       (#xaf6 . ?$B"u(B)
-       (#xaf7 . ?$A!a(B)
-       (#xaf8 . ?$A!b(B)
-       (#xaf9 . ?$(O&g(B)
-       (#xafa . ?$,1zu(B)
-       (#xafb . ?$,1uW(B)
-       (#xafc . ?$,1s8(B)
-       (#xafd . ?$,1rz(B)
-       (#xafe . ?,Y%(B)
+       (#xaa1 . ? )
+       (#xaa2 . ? )
+       (#xaa3 . ? )
+       (#xaa4 . ? )
+       (#xaa5 . ? )
+       (#xaa6 . ? )
+       (#xaa7 . ? )
+       (#xaa8 . ? )
+       (#xaa9 . ?—)
+       (#xaaa . ?–)
+       (#xaae . ?…)
+       (#xaaf . ?‥)
+       (#xab0 . ?⅓)
+       (#xab1 . ?⅔)
+       (#xab2 . ?⅕)
+       (#xab3 . ?⅖)
+       (#xab4 . ?⅗)
+       (#xab5 . ?⅘)
+       (#xab6 . ?⅙)
+       (#xab7 . ?⅚)
+       (#xab8 . ?℅)
+       (#xabb . ?‒)
+       (#xabc . ?〈)
+       (#xabe . ?〉)
+       (#xac3 . ?⅛)
+       (#xac4 . ?⅜)
+       (#xac5 . ?⅝)
+       (#xac6 . ?⅞)
+       (#xac9 . ?™)
+       (#xaca . ?☓)
+       (#xacc . ?◁)
+       (#xacd . ?▷)
+       (#xace . ?○)
+       (#xacf . ?▯)
+       (#xad0 . ?‘)
+       (#xad1 . ?’)
+       (#xad2 . ?“)
+       (#xad3 . ?”)
+       (#xad4 . ?℞)
+       (#xad6 . ?′)
+       (#xad7 . ?″)
+       (#xad9 . ?✝)
+       (#xadb . ?▬)
+       (#xadc . ?◀)
+       (#xadd . ?▶)
+       (#xade . ?●)
+       (#xadf . ?▮)
+       (#xae0 . ?◦)
+       (#xae1 . ?▫)
+       (#xae2 . ?▭)
+       (#xae3 . ?△)
+       (#xae4 . ?▽)
+       (#xae5 . ?☆)
+       (#xae6 . ?•)
+       (#xae7 . ?▪)
+       (#xae8 . ?▲)
+       (#xae9 . ?▼)
+       (#xaea . ?☜)
+       (#xaeb . ?☞)
+       (#xaec . ?♣)
+       (#xaed . ?♦)
+       (#xaee . ?♥)
+       (#xaf0 . ?✠)
+       (#xaf1 . ?†)
+       (#xaf2 . ?‡)
+       (#xaf3 . ?✓)
+       (#xaf4 . ?✗)
+       (#xaf5 . ?♯)
+       (#xaf6 . ?♭)
+       (#xaf7 . ?♂)
+       (#xaf8 . ?♀)
+       (#xaf9 . ?☎)
+       (#xafa . ?⌕)
+       (#xafb . ?℗)
+       (#xafc . ?‸)
+       (#xafd . ?‚)
+       (#xafe . ?„)
        ;; APL
        (#xba3 . ?<)
        (#xba6 . ?>)
-       (#xba8 . ?$A!E(B)
-       (#xba9 . ?$A!D(B)
-       (#xbc0 . ?,A/(B)
-       (#xbc2 . ?$A!M(B)
-       (#xbc3 . ?$A!I(B)
-       (#xbc4 . ?$,1zj(B)
+       (#xba8 . ?∨)
+       (#xba9 . ?∧)
+       (#xbc0 . ?¯)
+       (#xbc2 . ?⊥)
+       (#xbc3 . ?∩)
+       (#xbc4 . ?⌊)
        (#xbc6 . ?_)
-       (#xbca . ?$,1x8(B)
-       (#xbcc . ?$,1|5(B)
-       (#xbce . ?$,1yd(B)
-       (#xbcf . ?$A!p(B)
-       (#xbd3 . ?$,1zh(B)
-       (#xbd6 . ?$A!H(B)
-       (#xbd8 . ?$B"?(B)
-       (#xbda . ?$B">(B)
-       (#xbdc . ?$,1yb(B)
-       (#xbfc . ?$,1yc(B)
+       (#xbca . ?∘)
+       (#xbcc . ?⎕)
+       (#xbce . ?⊤)
+       (#xbcf . ?○)
+       (#xbd3 . ?⌈)
+       (#xbd6 . ?∪)
+       (#xbd8 . ?⊃)
+       (#xbda . ?⊂)
+       (#xbdc . ?⊢)
+       (#xbfc . ?⊣)
        ;; Hebrew
-       (#xcdf . ?,H_(B)
-       (#xce0 . ?,H`(B)
-       (#xce1 . ?,Ha(B)
-       (#xce2 . ?,Hb(B)
-       (#xce3 . ?,Hc(B)
-       (#xce4 . ?,Hd(B)
-       (#xce5 . ?,He(B)
-       (#xce6 . ?,Hf(B)
-       (#xce7 . ?,Hg(B)
-       (#xce8 . ?,Hh(B)
-       (#xce9 . ?,Hi(B)
-       (#xcea . ?,Hj(B)
-       (#xceb . ?,Hk(B)
-       (#xcec . ?,Hl(B)
-       (#xced . ?,Hm(B)
-       (#xcee . ?,Hn(B)
-       (#xcef . ?,Ho(B)
-       (#xcf0 . ?,Hp(B)
-       (#xcf1 . ?,Hq(B)
-       (#xcf2 . ?,Hr(B)
-       (#xcf3 . ?,Hs(B)
-       (#xcf4 . ?,Ht(B)
-       (#xcf5 . ?,Hu(B)
-       (#xcf6 . ?,Hv(B)
-       (#xcf7 . ?,Hw(B)
-       (#xcf8 . ?,Hx(B)
-       (#xcf9 . ?,Hy(B)
-       (#xcfa . ?,Hz(B)
+       (#xcdf . ?‗)
+       (#xce0 . ?א)
+       (#xce1 . ?ב)
+       (#xce2 . ?ג)
+       (#xce3 . ?ד)
+       (#xce4 . ?ה)
+       (#xce5 . ?ו)
+       (#xce6 . ?ז)
+       (#xce7 . ?ח)
+       (#xce8 . ?ט)
+       (#xce9 . ?י)
+       (#xcea . ?ך)
+       (#xceb . ?כ)
+       (#xcec . ?ל)
+       (#xced . ?ם)
+       (#xcee . ?מ)
+       (#xcef . ?ן)
+       (#xcf0 . ?נ)
+       (#xcf1 . ?ס)
+       (#xcf2 . ?ע)
+       (#xcf3 . ?ף)
+       (#xcf4 . ?פ)
+       (#xcf5 . ?ץ)
+       (#xcf6 . ?צ)
+       (#xcf7 . ?ק)
+       (#xcf8 . ?ר)
+       (#xcf9 . ?ש)
+       (#xcfa . ?ת)
        ;; Thai
-       (#xda1 . ?,T!(B)
-       (#xda2 . ?,T"(B)
-       (#xda3 . ?,T#(B)
-       (#xda4 . ?,T$(B)
-       (#xda5 . ?,T%(B)
-       (#xda6 . ?,T&(B)
-       (#xda7 . ?,T'(B)
-       (#xda8 . ?,T((B)
-       (#xda9 . ?,T)(B)
-       (#xdaa . ?,T*(B)
-       (#xdab . ?,T+(B)
-       (#xdac . ?,T,(B)
-       (#xdad . ?,T-(B)
-       (#xdae . ?,T.(B)
-       (#xdaf . ?,T/(B)
-       (#xdb0 . ?,T0(B)
-       (#xdb1 . ?,T1(B)
-       (#xdb2 . ?,T2(B)
-       (#xdb3 . ?,T3(B)
-       (#xdb4 . ?,T4(B)
-       (#xdb5 . ?,T5(B)
-       (#xdb6 . ?,T6(B)
-       (#xdb7 . ?,T7(B)
-       (#xdb8 . ?,T8(B)
-       (#xdb9 . ?,T9(B)
-       (#xdba . ?,T:(B)
-       (#xdbb . ?,T;(B)
-       (#xdbc . ?,T<(B)
-       (#xdbd . ?,T=(B)
-       (#xdbe . ?,T>(B)
-       (#xdbf . ?,T?(B)
-       (#xdc0 . ?,address@hidden(B)
-       (#xdc1 . ?,TA(B)
-       (#xdc2 . ?,TB(B)
-       (#xdc3 . ?,TC(B)
-       (#xdc4 . ?,TD(B)
-       (#xdc5 . ?,TE(B)
-       (#xdc6 . ?,TF(B)
-       (#xdc7 . ?,TG(B)
-       (#xdc8 . ?,TH(B)
-       (#xdc9 . ?,TI(B)
-       (#xdca . ?,TJ(B)
-       (#xdcb . ?,TK(B)
-       (#xdcc . ?,TL(B)
-       (#xdcd . ?,TM(B)
-       (#xdce . ?,TN(B)
-       (#xdcf . ?,TO(B)
-       (#xdd0 . ?,TP(B)
-       (#xdd1 . ?,TQ(B)
-       (#xdd2 . ?,TR(B)
-       (#xdd3 . ?,TS(B)
-       (#xdd4 . ?,TT(B)
-       (#xdd5 . ?,TU(B)
-       (#xdd6 . ?,TV(B)
-       (#xdd7 . ?,TW(B)
-       (#xdd8 . ?,TX(B)
-       (#xdd9 . ?,TY(B)
-       (#xdda . ?,TZ(B)
-       (#xddf . ?,T_(B)
-       (#xde0 . ?,T`(B)
-       (#xde1 . ?,Ta(B)
-       (#xde2 . ?,Tb(B)
-       (#xde3 . ?,Tc(B)
-       (#xde4 . ?,Td(B)
-       (#xde5 . ?,Te(B)
-       (#xde6 . ?,Tf(B)
-       (#xde7 . ?,Tg(B)
-       (#xde8 . ?,Th(B)
-       (#xde9 . ?,Ti(B)
-       (#xdea . ?,Tj(B)
-       (#xdeb . ?,Tk(B)
-       (#xdec . ?,Tl(B)
-       (#xded . ?,Tm(B)
-       (#xdf0 . ?,Tp(B)
-       (#xdf1 . ?,Tq(B)
-       (#xdf2 . ?,Tr(B)
-       (#xdf3 . ?,Ts(B)
-       (#xdf4 . ?,Tt(B)
-       (#xdf5 . ?,Tu(B)
-       (#xdf6 . ?,Tv(B)
-       (#xdf7 . ?,Tw(B)
-       (#xdf8 . ?,Tx(B)
-       (#xdf9 . ?,Ty(B)
+       (#xda1 . ?ก)
+       (#xda2 . ?ข)
+       (#xda3 . ?ฃ)
+       (#xda4 . ?ค)
+       (#xda5 . ?ฅ)
+       (#xda6 . ?ฆ)
+       (#xda7 . ?ง)
+       (#xda8 . ?จ)
+       (#xda9 . ?ฉ)
+       (#xdaa . ?ช)
+       (#xdab . ?ซ)
+       (#xdac . ?ฌ)
+       (#xdad . ?ญ)
+       (#xdae . ?ฎ)
+       (#xdaf . ?ฏ)
+       (#xdb0 . ?ฐ)
+       (#xdb1 . ?ฑ)
+       (#xdb2 . ?ฒ)
+       (#xdb3 . ?ณ)
+       (#xdb4 . ?ด)
+       (#xdb5 . ?ต)
+       (#xdb6 . ?ถ)
+       (#xdb7 . ?ท)
+       (#xdb8 . ?ธ)
+       (#xdb9 . ?น)
+       (#xdba . ?บ)
+       (#xdbb . ?ป)
+       (#xdbc . ?ผ)
+       (#xdbd . ?ฝ)
+       (#xdbe . ?พ)
+       (#xdbf . ?ฟ)
+       (#xdc0 . ?ภ)
+       (#xdc1 . ?ม)
+       (#xdc2 . ?ย)
+       (#xdc3 . ?ร)
+       (#xdc4 . ?ฤ)
+       (#xdc5 . ?ล)
+       (#xdc6 . ?ฦ)
+       (#xdc7 . ?ว)
+       (#xdc8 . ?ศ)
+       (#xdc9 . ?ษ)
+       (#xdca . ?ส)
+       (#xdcb . ?ห)
+       (#xdcc . ?ฬ)
+       (#xdcd . ?อ)
+       (#xdce . ?ฮ)
+       (#xdcf . ?ฯ)
+       (#xdd0 . ?ะ)
+       (#xdd1 . ?ั)
+       (#xdd2 . ?า)
+       (#xdd3 . ?ำ)
+       (#xdd4 . ?ิ)
+       (#xdd5 . ?ี)
+       (#xdd6 . ?ึ)
+       (#xdd7 . ?ื)
+       (#xdd8 . ?ุ)
+       (#xdd9 . ?ู)
+       (#xdda . ?ฺ)
+       (#xddf . ?฿)
+       (#xde0 . ?เ)
+       (#xde1 . ?แ)
+       (#xde2 . ?โ)
+       (#xde3 . ?ใ)
+       (#xde4 . ?ไ)
+       (#xde5 . ?ๅ)
+       (#xde6 . ?ๆ)
+       (#xde7 . ?็)
+       (#xde8 . ?่)
+       (#xde9 . ?้)
+       (#xdea . ?๊)
+       (#xdeb . ?๋)
+       (#xdec . ?์)
+       (#xded . ?ํ)
+       (#xdf0 . ?๐)
+       (#xdf1 . ?๑)
+       (#xdf2 . ?๒)
+       (#xdf3 . ?๓)
+       (#xdf4 . ?๔)
+       (#xdf5 . ?๕)
+       (#xdf6 . ?๖)
+       (#xdf7 . ?๗)
+       (#xdf8 . ?๘)
+       (#xdf9 . ?๙)
        ;; Korean
-       (#xea1 . ?$(C$!(B)
-       (#xea2 . ?$(C$"(B)
-       (#xea3 . ?$(C$#(B)
-       (#xea4 . ?$(C$$(B)
-       (#xea5 . ?$(C$%(B)
-       (#xea6 . ?$(C$&(B)
-       (#xea7 . ?$(C$'(B)
-       (#xea8 . ?$(C$((B)
-       (#xea9 . ?$(C$)(B)
-       (#xeaa . ?$(C$*(B)
-       (#xeab . ?$(C$+(B)
-       (#xeac . ?$(C$,(B)
-       (#xead . ?$(C$-(B)
-       (#xeae . ?$(C$.(B)
-       (#xeaf . ?$(C$/(B)
-       (#xeb0 . ?$(C$0(B)
-       (#xeb1 . ?$(C$1(B)
-       (#xeb2 . ?$(C$2(B)
-       (#xeb3 . ?$(C$3(B)
-       (#xeb4 . ?$(C$4(B)
-       (#xeb5 . ?$(C$5(B)
-       (#xeb6 . ?$(C$6(B)
-       (#xeb7 . ?$(C$7(B)
-       (#xeb8 . ?$(C$8(B)
-       (#xeb9 . ?$(C$9(B)
-       (#xeba . ?$(C$:(B)
-       (#xebb . ?$(C$;(B)
-       (#xebc . ?$(C$<(B)
-       (#xebd . ?$(C$=(B)
-       (#xebe . ?$(C$>(B)
-       (#xebf . ?$(C$?(B)
-       (#xec0 . ?$(address@hidden(B)
-       (#xec1 . ?$(C$A(B)
-       (#xec2 . ?$(C$B(B)
-       (#xec3 . ?$(C$C(B)
-       (#xec4 . ?$(C$D(B)
-       (#xec5 . ?$(C$E(B)
-       (#xec6 . ?$(C$F(B)
-       (#xec7 . ?$(C$G(B)
-       (#xec8 . ?$(C$H(B)
-       (#xec9 . ?$(C$I(B)
-       (#xeca . ?$(C$J(B)
-       (#xecb . ?$(C$K(B)
-       (#xecc . ?$(C$L(B)
-       (#xecd . ?$(C$M(B)
-       (#xece . ?$(C$N(B)
-       (#xecf . ?$(C$O(B)
-       (#xed0 . ?$(C$P(B)
-       (#xed1 . ?$(C$Q(B)
-       (#xed2 . ?$(C$R(B)
-       (#xed3 . ?$(C$S(B)
-       (#xed4 . ?$,1LH(B)
-       (#xed5 . ?$,1LI(B)
-       (#xed6 . ?$,1LJ(B)
-       (#xed7 . ?$,1LK(B)
-       (#xed8 . ?$,1LL(B)
-       (#xed9 . ?$,1LM(B)
-       (#xeda . ?$,1LN(B)
-       (#xedb . ?$,1LO(B)
-       (#xedc . ?$,1LP(B)
-       (#xedd . ?$,1LQ(B)
-       (#xede . ?$,1LR(B)
-       (#xedf . ?$,1LS(B)
-       (#xee0 . ?$,1LT(B)
-       (#xee1 . ?$,1LU(B)
-       (#xee2 . ?$,1LV(B)
-       (#xee3 . ?$,1LW(B)
-       (#xee4 . ?$,1LX(B)
-       (#xee5 . ?$,1LY(B)
-       (#xee6 . ?$,1LZ(B)
-       (#xee7 . ?$,1L[(B)
-       (#xee8 . ?$,1L\(B)
-       (#xee9 . ?$,1L](B)
-       (#xeea . ?$,1L^(B)
-       (#xeeb . ?$,1L_(B)
-       (#xeec . ?$,1L`(B)
-       (#xeed . ?$,1La(B)
-       (#xeee . ?$,1Lb(B)
-       (#xeef . ?$(C$](B)
-       (#xef0 . ?$(C$a(B)
-       (#xef1 . ?$(C$h(B)
-       (#xef2 . ?$(C$o(B)
-       (#xef3 . ?$(C$q(B)
-       (#xef4 . ?$(C$t(B)
-       (#xef5 . ?$(C$v(B)
-       (#xef6 . ?$(C$}(B)
-       (#xef7 . ?$(C$~(B)
-       (#xef8 . ?$,1M+(B)
-       (#xef9 . ?$,1M0(B)
-       (#xefa . ?$,1M9(B)
-       (#xeff . ?$,1tI(B)
+       (#xea1 . ?ㄱ)
+       (#xea2 . ?ㄲ)
+       (#xea3 . ?ㄳ)
+       (#xea4 . ?ㄴ)
+       (#xea5 . ?ㄵ)
+       (#xea6 . ?ㄶ)
+       (#xea7 . ?ㄷ)
+       (#xea8 . ?ㄸ)
+       (#xea9 . ?ㄹ)
+       (#xeaa . ?ㄺ)
+       (#xeab . ?ㄻ)
+       (#xeac . ?ㄼ)
+       (#xead . ?ㄽ)
+       (#xeae . ?ㄾ)
+       (#xeaf . ?ㄿ)
+       (#xeb0 . ?ㅀ)
+       (#xeb1 . ?ㅁ)
+       (#xeb2 . ?ㅂ)
+       (#xeb3 . ?ㅃ)
+       (#xeb4 . ?ㅄ)
+       (#xeb5 . ?ㅅ)
+       (#xeb6 . ?ㅆ)
+       (#xeb7 . ?ㅇ)
+       (#xeb8 . ?ㅈ)
+       (#xeb9 . ?ㅉ)
+       (#xeba . ?ㅊ)
+       (#xebb . ?ㅋ)
+       (#xebc . ?ㅌ)
+       (#xebd . ?ㅍ)
+       (#xebe . ?ㅎ)
+       (#xebf . ?ㅏ)
+       (#xec0 . ?ㅐ)
+       (#xec1 . ?ㅑ)
+       (#xec2 . ?ㅒ)
+       (#xec3 . ?ㅓ)
+       (#xec4 . ?ㅔ)
+       (#xec5 . ?ㅕ)
+       (#xec6 . ?ㅖ)
+       (#xec7 . ?ㅗ)
+       (#xec8 . ?ㅘ)
+       (#xec9 . ?ㅙ)
+       (#xeca . ?ㅚ)
+       (#xecb . ?ㅛ)
+       (#xecc . ?ㅜ)
+       (#xecd . ?ㅝ)
+       (#xece . ?ㅞ)
+       (#xecf . ?ㅟ)
+       (#xed0 . ?ㅠ)
+       (#xed1 . ?ㅡ)
+       (#xed2 . ?ㅢ)
+       (#xed3 . ?ㅣ)
+       (#xed4 . ?ᆨ)
+       (#xed5 . ?ᆩ)
+       (#xed6 . ?ᆪ)
+       (#xed7 . ?ᆫ)
+       (#xed8 . ?ᆬ)
+       (#xed9 . ?ᆭ)
+       (#xeda . ?ᆮ)
+       (#xedb . ?ᆯ)
+       (#xedc . ?ᆰ)
+       (#xedd . ?ᆱ)
+       (#xede . ?ᆲ)
+       (#xedf . ?ᆳ)
+       (#xee0 . ?ᆴ)
+       (#xee1 . ?ᆵ)
+       (#xee2 . ?ᆶ)
+       (#xee3 . ?ᆷ)
+       (#xee4 . ?ᆸ)
+       (#xee5 . ?ᆹ)
+       (#xee6 . ?ᆺ)
+       (#xee7 . ?ᆻ)
+       (#xee8 . ?ᆼ)
+       (#xee9 . ?ᆽ)
+       (#xeea . ?ᆾ)
+       (#xeeb . ?ᆿ)
+       (#xeec . ?ᇀ)
+       (#xeed . ?ᇁ)
+       (#xeee . ?ᇂ)
+       (#xeef . ?ㅭ)
+       (#xef0 . ?ㅱ)
+       (#xef1 . ?ㅸ)
+       (#xef2 . ?ㅿ)
+       (#xef3 . ?ㆁ)
+       (#xef4 . ?ㆄ)
+       (#xef5 . ?ㆆ)
+       (#xef6 . ?ㆍ)
+       (#xef7 . ?ㆎ)
+       (#xef8 . ?ᇫ)
+       (#xef9 . ?ᇰ)
+       (#xefa . ?ᇹ)
+       (#xeff . ?₩)
        ;; Latin-5
        ;; Latin-6
        ;; Latin-7
        ;; Latin-8
        ;; Latin-9
-       (#x13bc . ?,b<(B)
-       (#x13bd . ?,b=(B)
-       (#x13be . ?,_/(B)
+       (#x13bc . ?Œ)
+       (#x13bd . ?œ)
+       (#x13be . ?Ÿ)
        ;; Currency
-       (#x20a0 . ?$,address@hidden(B)
-       (#x20a1 . ?$,1tA(B)
-       (#x20a2 . ?$,1tB(B)
-       (#x20a3 . ?$,1tC(B)
-       (#x20a4 . ?$,1tD(B)
-       (#x20a5 . ?$,1tE(B)
-       (#x20a6 . ?$,1tF(B)
-       (#x20a7 . ?$,1tG(B)
-       (#x20a8 . ?$,1tH(B)
-       (#x20aa . ?$,1tJ(B)
-       (#x20ab . ?$,1tK(B)
-       ;; Kana: Fixme: needs checking.  Using Emacs to convert this to Unicode
-       ;; and back changes this from ",b$(B" (i.e., bytes "ESC , b $ ESC ( 
B") to
-       ;; ",F$(B" (i.e., bytes "ESC , F $ ESC ( B").
-       (#x20ac . ?,b$(B)))
+       (#x20a0 . ?₠)
+       (#x20a1 . ?₡)
+       (#x20a2 . ?₢)
+       (#x20a3 . ?₣)
+       (#x20a4 . ?₤)
+       (#x20a5 . ?₥)
+       (#x20a6 . ?₦)
+       (#x20a7 . ?₧)
+       (#x20a8 . ?₨)
+       (#x20aa . ?₪)
+       (#x20ab . ?₫)
+       (#x20ac . ?€)))
   (puthash (car pair) (cdr pair) x-keysym-table))
 
 ;; The following keysym codes for graphics are listed in the document
diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el
index 9d3f2a9..7a2857a 100644
--- a/lisp/textmodes/rst.el
+++ b/lisp/textmodes/rst.el
@@ -4161,7 +4161,7 @@ cand replace with char: ")
         (let ((width (current-column)))
           (rst-delete-entire-line)
           (insert-char tochar width)))
-      (message (format "%d lines replaced." found)))))
+      (message "%d lines replaced." found))))
 
 ;; FIXME: Unbound command - should be bound or removed.
 (defun rst-join-paragraph ()
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el
index e1259ff..8e4a7e9 100644
--- a/lisp/textmodes/texinfmt.el
+++ b/lisp/textmodes/texinfmt.el
@@ -3127,7 +3127,7 @@ Default is to leave paragraph indentation as is."
 ;; (put '\` 'texinfo-format 'texinfo-format-grave-accent)
 ;; (defun texinfo-format-grave-accent ()
 ;;   (texinfo-discard-command)
-;;   (insert "\`"))
+;;   (insert "`"))
 ;;
 ;; @'              ==>    '         acute accent
 ;; (put '\' 'texinfo-format 'texinfo-format-acute-accent)
diff --git a/lisp/uniquify.el b/lisp/uniquify.el
index ce681b4..c5692ff 100644
--- a/lisp/uniquify.el
+++ b/lisp/uniquify.el
@@ -116,20 +116,11 @@ you can set, browse the `uniquify' custom group."
                (const post-forward-angle-brackets)
                (const :tag "numeric suffixes" nil))
   :version "24.4"
-  :require 'uniquify
-  :group 'uniquify)
+  :require 'uniquify)
 
 (defcustom uniquify-after-kill-buffer-p t
   "If non-nil, rerationalize buffer names after a buffer has been killed."
-  :type 'boolean
-  :group 'uniquify)
-
-(defcustom uniquify-ask-about-buffer-names-p nil
-  "If non-nil, permit user to choose names for buffers with same base file.
-If the user chooses to name a buffer, uniquification is preempted and no
-other buffer names are changed."
-  :type 'boolean
-  :group 'uniquify)
+  :type 'boolean)
 
 ;; The default value matches certain Gnus buffers.
 (defcustom uniquify-ignore-buffers-re nil
@@ -137,13 +128,11 @@ other buffer names are changed."
 For instance, set this to \"^draft-[0-9]+$\" to avoid having uniquify rename
 draft buffers even if `uniquify-after-kill-buffer-p' is non-nil and the
 visited file name isn't the same as that of the buffer."
-  :type '(choice (const :tag "Uniquify all buffers" nil) regexp)
-  :group 'uniquify)
+  :type '(choice (const :tag "Uniquify all buffers" nil) regexp))
 
 (defcustom uniquify-min-dir-content 0
   "Minimum number of directory name components included in buffer name."
-  :type 'integer
-  :group 'uniquify)
+  :type 'integer)
 
 (defcustom uniquify-separator nil
   "String separator for buffer name components.
@@ -151,16 +140,14 @@ When `uniquify-buffer-name-style' is `post-forward', 
separates
 base file name from directory part in buffer names (default \"|\").
 When `uniquify-buffer-name-style' is `reverse', separates all
 file name components (default \"\\\")."
-  :type '(choice (const nil) string)
-  :group 'uniquify)
+  :type '(choice (const nil) string))
 
 (defcustom uniquify-trailing-separator-p nil
   "If non-nil, add a file name separator to dired buffer names.
 If `uniquify-buffer-name-style' is `forward', add the separator at the end;
 if it is `reverse', add the separator at the beginning; otherwise, this
 variable is ignored."
-  :type 'boolean
-  :group 'uniquify)
+  :type 'boolean)
 
 (defcustom uniquify-strip-common-suffix
   ;; Using it when uniquify-min-dir-content>0 doesn't make much sense.
@@ -169,8 +156,7 @@ variable is ignored."
 E.g. if you open /a1/b/c/d and /a2/b/c/d, the buffer names will say
 \"d|a1\" and \"d|a2\" instead of \"d|a1/b/c\" and \"d|a2/b/c\".
 This can be handy when you have deep parallel hierarchies."
-  :type 'boolean
-  :group 'uniquify)
+  :type 'boolean)
 
 (defvar uniquify-list-buffers-directory-modes '(dired-mode cvs-mode 
vc-dir-mode)
   "List of modes for which uniquify should obey `list-buffers-directory'.
diff --git a/lisp/window.el b/lisp/window.el
index 238e53c..d9c0d0a 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -6244,6 +6244,7 @@ The actual non-nil value of this variable will be copied 
to the
           (const display-buffer-at-bottom)
           (const display-buffer-in-previous-window)
           (const display-buffer-use-some-window)
+          (const display-buffer-use-some-frame)
           (function :tag "Other function"))
   "Custom type for `display-buffer' action functions.")
 
@@ -6388,6 +6389,7 @@ Available action functions include:
  `display-buffer-pop-up-window'
  `display-buffer-in-previous-window'
  `display-buffer-use-some-window'
+ `display-buffer-use-some-frame'
 
 Recognized alist entries include:
 
@@ -6490,7 +6492,7 @@ its documentation for additional customization 
information."
 
 (defun display-buffer-use-some-frame (buffer alist)
   "Display BUFFER in an existing frame that meets a predicate
-(by default any frame other than the current frame).  If
+\(by default any frame other than the current frame).  If
 successful, return the window used; otherwise return nil.
 
 If ALIST has a non-nil `inhibit-switch-frame' entry, avoid
@@ -6499,8 +6501,12 @@ raising the frame.
 If ALIST has a non-nil `frame-predicate' entry, its value is a
 function taking one argument (a frame), returning non-nil if the
 frame is a candidate; this function replaces the default
-predicate."
-  (let* ((predicate (or (cdr (assoc 'frame-predicate alist))
+predicate.
+
+If ALIST has a non-nil `inhibit-same-window' entry, avoid using
+the currently selected window (only useful with a frame-predicate
+that allows the selected frame)."
+  (let* ((predicate (or (cdr (assq 'frame-predicate alist))
                         (lambda (frame)
                           (and
                            (not (eq frame (selected-frame)))
@@ -6510,7 +6516,7 @@ predicate."
                                   (frame-first-window frame)))))
                           )))
          (frame (car (filtered-frame-list predicate)))
-         (window (and frame (get-lru-window frame))))
+         (window (and frame (get-lru-window frame nil (cdr (assq 
'inhibit-same-window alist))))))
     (when window
       (prog1
           (window--display-buffer
diff --git a/make-dist b/make-dist
index 6bf01ff..79db904 100755
--- a/make-dist
+++ b/make-dist
@@ -338,7 +338,7 @@ files=`find lisp \( -name '*.el' -o -name '*.elc' -o -name 
'ChangeLog*' \
  -o -name 'README' \)`
 
 ### Don't distribute site-init.el, site-load.el, or default.el.
-for file in lisp/Makefile.in lisp/makefile.w32-in $files; do
+for file in lisp/Makefile.in $files; do
   case $file in
     */site-init*|*/site-load*|*/default*) continue ;;
   esac
@@ -347,7 +347,6 @@ done
 
 echo "Making links to 'leim' and its subdirectories"
 (cd leim
- ln makefile.w32-in ../${tempdir}/leim
  ln ChangeLog.*[0-9] README ../${tempdir}/leim
  ln CXTERM-DIC/README CXTERM-DIC/*.tit ../${tempdir}/leim/CXTERM-DIC
  ln SKK-DIC/README SKK-DIC/SKK-JISYO.L ../${tempdir}/leim/SKK-DIC
@@ -377,7 +376,6 @@ echo "Making links to 'src'"
  ln [a-zA-Z]*.in ../${tempdir}/src
  ln deps.mk ../${tempdir}/src
  ln README ChangeLog.*[0-9] ../${tempdir}/src
- ln makefile.w32-in ../${tempdir}/src
  ln .gdbinit .dbxinit ../${tempdir}/src
  cd ../${tempdir}/src
  rm -f globals.h config.h epaths.h Makefile buildobj.h)
@@ -390,7 +388,7 @@ echo "Making links to 'lib'"
 (snippet_h=`(cd build-aux/snippet && ls *.h)`
  cd lib
  ln [a-zA-Z]*.[ch] ../${tempdir}/lib
- ln gnulib.mk Makefile.am Makefile.in makefile.w32-in ../${tempdir}/lib
+ ln gnulib.mk Makefile.am Makefile.in ../${tempdir}/lib
  cd ../${tempdir}/lib
  script='/[*]/d; s/\.in\.h$/.h/'
  rm -f `(echo "$snippet_h"; ls *.in.h) | sed "$script"`)
@@ -400,7 +398,6 @@ echo "Making links to 'lib-src'"
  ln [a-zA-Z]*.[ch] ../${tempdir}/lib-src
  ln ChangeLog.*[0-9] Makefile.in README ../${tempdir}/lib-src
  ln rcs2log ../${tempdir}/lib-src
- ln makefile.w32-in ../${tempdir}/lib-src
  ln update-game-score.exe.manifest ../${tempdir}/lib-src)
 
 echo "Making links to 'm4'"
@@ -410,11 +407,10 @@ echo "Making links to 'm4'"
 echo "Making links to 'nt'"
 (cd nt
  ln emacs-x86.manifest emacs-x64.manifest ../${tempdir}/nt
- ln config.nt emacs-src.tags ../${tempdir}/nt
- ln nmake.defs gmake.defs subdirs.el [a-z]*.bat [a-z]*.[ch] ../${tempdir}/nt
+ ln subdirs.el [a-z]*.bat [a-z]*.[ch] ../${tempdir}/nt
  ln *.in gnulib.mk ../${tempdir}/nt
  ln mingw-cfg.site epaths.nt INSTALL.OLD ../${tempdir}/nt
- ln ChangeLog.*[0-9] INSTALL README README.W32 makefile.w32-in 
../${tempdir}/nt)
+ ln ChangeLog.*[0-9] INSTALL README README.W32 ../${tempdir}/nt)
 
 echo "Making links to 'nt/inc' and its subdirectories"
 for f in `find nt/inc -type f -name '[a-z]*.h'`; do
@@ -500,23 +496,22 @@ ln `find info -type f -print` ${tempdir}/info
 
 echo "Making links to 'doc/emacs'"
 (cd doc/emacs
- ln *.texi *.in makefile.w32-in ChangeLog.*[0-9] ../../${tempdir}/doc/emacs)
+ ln *.texi *.in ChangeLog.*[0-9] ../../${tempdir}/doc/emacs)
 
 echo "Making links to 'doc/misc'"
 (cd doc/misc
- ln *.texi *.tex *.in makefile.w32-in gnus-news.el ChangeLog.*[0-9] \
+ ln *.texi *.tex *.in gnus-news.el ChangeLog.*[0-9] \
     ../../${tempdir}/doc/misc)
 
 echo "Making links to 'doc/lispref'"
 (cd doc/lispref
- ln *.texi *.in makefile.w32-in README ChangeLog.*[0-9] \
-    ../../${tempdir}/doc/lispref
+ ln *.texi *.in README ChangeLog.*[0-9] ../../${tempdir}/doc/lispref
  ln spellfile ../../${tempdir}/doc/lispref
  ln two-volume.make two-volume-cross-refs.txt ../../${tempdir}/doc/lispref)
 
 echo "Making links to 'doc/lispintro'"
 (cd doc/lispintro
- ln *.texi *.in makefile.w32-in *.eps *.pdf ../../${tempdir}/doc/lispintro
+ ln *.texi *.in *.eps *.pdf ../../${tempdir}/doc/lispintro
  ln README ChangeLog.*[0-9] ../../${tempdir}/doc/lispintro
  cd ../../${tempdir}/doc/lispintro)
 
diff --git a/nt/INSTALL.OLD b/nt/INSTALL.OLD
deleted file mode 100644
index 89e87b2..0000000
--- a/nt/INSTALL.OLD
+++ /dev/null
@@ -1,752 +0,0 @@
-                   Building and Installing Emacs on Windows
-                          (from 95 to 7 and beyond)
-
-  Copyright (C) 2001-2015 Free Software Foundation, Inc.
-  See the end of the file for license conditions.
-
-*** This method of building Emacs is no longer supported. ***
-    It may fail to produce a correctly working Emacs.
-    Do not report bugs associated with this build method.
-    Instead, follow the new instructions in INSTALL.
-
-* For the impatient
-
-  Here are the concise instructions for configuring and building the
-  native Windows binary of Emacs, for those who want to skip the
-  complex explanations and ``just do it'':
-
-  Do not use this recipe with Cygwin.  For building on Cygwin,
-  use the normal installation instructions, ../INSTALL.
-
-  Do not use these instructions with MSYS environment.  For building
-  the native Windows binary with MinGW and MSYS, follow the
-  instructions in the file INSTALL in this directory.
-
-  For building without MSYS, if you have a Cygwin or MSYS port of Bash
-  on your Path, you will be better off removing it from PATH.  (For
-  details, search for "MSYS sh.exe" below.)
-
-  1. Change to the `nt' directory (the directory of this file):
-
-       cd nt
-
-  2. Run configure.bat.
-
-  2a.If you use MSVC, set up the build environment by running the
-     SetEnv.cmd batch file from the appropriate SDK directory.  (Skip
-     this step if you are using MinGW.)  For example:
-
-       "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 
/Debug
-
-      if you are going to compile a debug version, or
-
-       "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 
/Release
-
-      if you are going to compile an optimized version.
-
-  2b.From the COMMAND.COM/CMD.EXE command prompt type:
-
-       configure
-
-     From a Unixy shell prompt:
-
-       cmd /c configure.bat
-     or
-       command.com /c configure.bat
-
-  3. Run the Make utility suitable for your environment.  If you build
-     with the Microsoft's Visual C compiler:
-
-       nmake
-
-     For the development environments based on GNU GCC (MinGW, MSYS,
-     Cygwin - but see notes about Cygwin make below), depending on how
-     Make is called, it could be:
-
-       make
-     or
-       mingw32-make
-     or
-       gnumake
-     or
-       gmake
-
-     (If you are building from Bazaar, say "make bootstrap" or "nmake
-     bootstrap" instead, and avoid using Cygwin make.)
-
-     With GNU Make, you can use the -j command-line option to have
-     Make execute several commands at once, like this:
-
-       gmake -j 2
-
-     (With versions of GNU Make before 3.82, you need also set the
-     XMFLAGS variable, like this:
-
-       gmake -j 2 XMFLAGS="-j 2"
-
-     The XMFLAGS variable overrides the default behavior of version
-     3.82 and older of GNU Make on Windows, whereby recursive Make
-     invocations reset the maximum number of simultaneous commands to
-     1.  The above command allows up to 4 simultaneous commands at
-     once in the top-level Make, and up to 3 in each one of the
-     recursive Make's.)
-
-  4. Generate the Info manuals (only if you are building out of Bazaar,
-     and if you have makeinfo.exe installed):
-
-     make info
-
-     (change "make" to "nmake" if you use MSVC).
-
-  5. Install the produced binaries:
-
-     make install
-
-  That's it!
-
-  If these short instructions somehow fail, read the rest of this
-  file.
-
-* Preliminaries
-
-  If you want to build a Cygwin port of Emacs, use the instructions in
-  the INSTALL file in the main Emacs directory (the parent of this
-  directory).  These instructions are for building a native Windows
-  binary of Emacs.
-
-  If you used WinZip to unpack the distribution, we suggest to
-  remove the files and unpack again with a different program!
-  WinZip is known to create some subtle and hard to debug problems,
-  such as converting files to DOS CR-LF format, not creating empty
-  directories, etc.  We suggest to use djtarnt.exe from the GNU FTP
-  site.  For modern formats, such as .tar.xz, we suggest bsdtar.exe
-  from the libarchive package; its precompiled Windows binaries are
-  available from this site:
-
-    http://sourceforge.net/projects/ezwinports/files/
-
-  In addition to this file, if you build a development snapshot, you
-  should also read INSTALL.REPO in the parent directory.
-
-* Supported development environments
-
-  To compile Emacs, you will need either Microsoft Visual C++ 2.0, or
-  later and nmake, or a Windows port of GCC 2.95 or later with MinGW
-  and Windows API support and a port of GNU Make.  You can use the Cygwin
-  ports of GCC, but Emacs requires the MinGW headers and libraries to
-  build (latest versions of the Cygwin toolkit, at least since v1.3.3,
-  include the MinGW headers and libraries as an integral part).
-
-  The rest of this file assumes you have a working development
-  environment.  If you just installed such an environment, try
-  building a trivial C "Hello world" program, and see if it works.  If
-  it doesn't work, resolve that problem first!  If you use Microsoft
-  Visual Studio .NET 2003, don't forget to run the VCVARS32.BAT batch
-  file from the `Bin' subdirectory of the directory where you have
-  installed VS.NET.  With other versions of MSVC, run the SetEnv.cmd
-  batch file from the `Bin' subdirectory of the directory where you
-  have the SDK installed.
-
-  If you use the MinGW port of GCC and GNU Make to build Emacs, there
-  are some compatibility issues wrt Make and the shell that is run by
-  Make, either the standard COMMAND.COM/CMD.EXE supplied with Windows
-  or sh.exe, a port of a Unixy shell.  For reference, below is a list
-  of which builds of GNU Make are known to work or not, and whether
-  they work in the presence and/or absence of sh.exe, the Cygwin port
-  of Bash.  Note that any version of Make that is compiled with Cygwin
-  will only work with Cygwin tools, due to the use of Cygwin style
-  paths.  This means Cygwin Make is unsuitable for building parts of
-  Emacs that need to invoke Emacs itself (leim and "make bootstrap",
-  for example).  Also see the Trouble-shooting section below if you
-  decide to go ahead and use Cygwin make.
-
-  In addition, using 4NT or TCC as your shell is known to fail the
-  build process, at least since 4NT version 3.01.  Use CMD.EXE, the
-  default Windows shell, instead.  MSYS sh.exe also appears to cause
-  various problems, e.g., it is known to cause failures in commands
-  like "cmd /c FOO" in the Makefiles, because it thinks "/c" is a
-  Unix-style file name that needs conversion to the Windows format.
-  If you have MSYS installed, try "make SHELL=cmd.exe" to force the
-  use of cmd.exe instead of the MSYS sh.exe.
-
-                                         sh exists     no sh
-
-    cygwin b20.1 make (3.75):            fails[1, 5]   fails[2, 5]
-    MSVC compiled gmake 3.77:            okay          okay
-    MSVC compiled gmake 3.78.1:          okay          okay
-    MSVC compiled gmake 3.79.1:          okay          okay
-    mingw32/gcc-2.92.2 make (3.77):      okay          okay[4]
-    cygwin compiled gmake 3.77:          fails[1, 5]   fails[2, 5]
-    cygwin compiled make 3.78.1:         fails[5]      fails[2, 5]
-    cygwin compiled make 3.79.1:         fails[3, 5]   fails[2?, 5]
-    cygwin compiled make 3.80:           okay[6]       fails?[7]
-    cygwin compiled make 3.81:           fails         fails?[7]
-    mingw32 compiled make 3.79.1:        okay          okay
-    mingw32 compiled make 3.80:          okay          okay[7]
-    mingw32 compiled make 3.81:          okay          okay[8]
-
-  Notes:
-
-    [1] doesn't cope with makefiles with DOS line endings, so must mount
-        emacs source with text!=binary.
-    [2] fails when needs to invoke shell commands; okay invoking gcc etc.
-    [3] requires LC_MESSAGES support to build; cannot build with early
-        versions of Cygwin.
-    [4] may fail on Windows 9X and Windows ME; if so, install Bash.
-    [5] fails when building leim due to the use of cygwin style paths.
-        May work if building emacs without leim.
-    [6] need to uncomment 3 lines in nt/gmake.defs that invoke `cygpath'
-       (look for "cygpath" near line 85 of gmake.defs).
-    [7] not recommended; please report if you try this combination.
-    [8] tested only on Windows XP.
-
-  Other compilers may work, but specific reports from people that have
-  tried suggest that the Intel C compiler (for example) may produce an
-  Emacs executable with strange filename completion behavior.  Unless
-  you would like to assist by finding and fixing the cause of any bugs
-  like this, we recommend the use of the supported compilers mentioned
-  in the previous paragraph.
-
-  You will also need a copy of the POSIX cp, rm and mv programs.  These
-  and other useful POSIX utilities can be obtained from one of several
-  projects:
-
-  * http://gnuwin32.sourceforge.net/              ( GnuWin32 )
-  * http://www.mingw.org/                         ( MinGW    )
-  * http://www.cygwin.com/                        ( Cygwin   )
-  * http://unxutils.sourceforge.net/              ( UnxUtils )
-
-  If you build Emacs on 16-bit versions of Windows (9X or ME), we
-  suggest to install the Cygwin port of Bash.  That is because the
-  native Windows shell COMMAND.COM is too limited; the Emacs build
-  procedure tries very hard to support even such limited shells, but
-  as none of the Windows developers of Emacs work on Windows 9X, we
-  cannot guarantee that it works without a more powerful shell.
-
-  Additional instructions and help for building Emacs on Windows can be
-  found at the Emacs Wiki:
-
-    http://www.emacswiki.org/cgi-bin/wiki/WThirtyTwoInstallationKit
-
-  and on these URLs:
-
-    http://ourcomments.org/Emacs/w32-build-emacs.html
-    
http://derekslager.com/blog/posts/2007/01/emacs-hack-3-compile-emacs-from-cvs-on-windows.ashx
-
-  Both of those pages were written before Emacs switched from CVS to
-  Bazaar, but the parts about building Emacs still apply in Bazaar.
-  The second URL has instructions for building with MSVC, as well as
-  with MinGW, while the first URL covers only MinGW, but has more
-  details about it.
-
-* Configuring
-
-  Configuration of Emacs is now handled by running configure.bat in the
-  `nt' subdirectory.  It will detect which compiler you have available,
-  and generate makefiles accordingly.  You can override the compiler
-  detection, and control optimization and debug settings, by specifying
-  options on the command line when invoking configure.
-
-  To configure Emacs to build with GCC or MSVC, whichever is available,
-  simply change to the `nt' subdirectory and run `configure.bat' with no
-  options.  To see what options are available, run `configure --help'.
-  Do NOT use the --no-debug option to configure.bat unless you are
-  absolutely sure the produced binaries will never need to be run under
-  a debugger.
-
-  Because of limitations of the stock Windows command shells, special
-  care is needed to pass some characters in the arguments of the
-  --cflags and --ldflags options.  Backslashes should not be used in
-  file names passed to the compiler and linker via these options.  Use
-  forward slashes instead.  If the arguments to these two options
-  include the `=' character, like when passing a -DFOO=bar preprocessor
-  option, the argument with the `=' character should be enclosed in
-  quotes, like this:
-
-    configure --cflags "-DFOO=bar"
-
-  Support for options that include the `=' character require "command
-  extensions" to be enabled.  (They are enabled by default, but your
-  system administrator could have changed that.  See "cmd /?" for
-  details.)  If command extensions are disabled, a warning message might
-  be displayed informing you that "using parameters that include the =
-  character by enclosing them in quotes will not be supported."
-
-  You may also use the --cflags and --ldflags options to pass
-  additional parameters to the compiler and linker, respectively; they
-  are frequently used to pass -I and -L flags to specify supplementary
-  include and library directories.  If a directory name includes
-  spaces, you will need to enclose it in quotes, as follows
-  -I"C:/Program Files/GnuTLS-2.10.1/include".  Note that only the
-  directory name is enclosed in quotes, not the entire argument.  Also
-  note that this functionality is only supported if command extensions
-  are available.  If command extensions are disabled and you attempt to
-  use this functionality you may see the following warning message
-  "Error in --cflags argument: ... Backslashes and quotes cannot be
-  used with --cflags.  Please use forward slashes for filenames and
-  paths (e.g. when passing directories to -I)."
-
-  N.B.  It is normal to see a few error messages output while configure
-  is running, when gcc support is being tested.  These cannot be
-  suppressed because of limitations in the Windows 9X command.com shell.
-
-  You are encouraged to look at the file config.log which shows details
-  for failed tests, after configure.bat finishes.  Any unexplained failure
-  should be investigated and perhaps reported as a bug (see the section
-  about reporting bugs in the file README in this directory and in the
-  Emacs manual).
-
-* Optional image library support
-
-  In addition to its "native" image formats (pbm and xbm), Emacs can
-  handle other image types: xpm, tiff, gif, png, jpeg and experimental
-  support for svg.
-
-  To build Emacs with support for them, the corresponding headers must
-  be in the include path when the configure script is run.  This can
-  be setup using environment variables, or by specifying --cflags
-  -I... options on the command-line to configure.bat.  The configure
-  script will report whether it was able to detect the headers.  If
-  the results of this testing appear to be incorrect, please look for
-  details in the file config.log: it will show the failed test
-  programs and compiler error messages that should explain what is
-  wrong.  (Usually, any such failures happen because some headers are
-  missing due to bad packaging of the image support libraries.)
-
-  Note that any file path passed to the compiler or linker must use
-  forward slashes; using backslashes will cause compiler warnings or
-  errors about unrecognized escape sequences.
-
-  To use the external image support, the DLLs implementing the
-  functionality must be found when Emacs first needs them, either on the
-  PATH, or in the same directory as emacs.exe.  Failure to find a
-  library is not an error; the associated image format will simply be
-  unavailable.  Note that once Emacs has determined that a library can
-  not be found, there's no way to force it to try again, other than
-  restarting.  See the variable `dynamic-library-alist' to configure the
-  expected names of the libraries.
-
-  Some image libraries have dependencies on one another, or on zlib.
-  For example, tiff support depends on the jpeg library.  If you did not
-  compile the libraries yourself, you must make sure that any dependency
-  is in the PATH or otherwise accessible and that the binaries are
-  compatible (for example, that they were built with the same compiler).
-
-  Binaries for the image libraries (among many others) can be found at
-  the GnuWin32 project.  PNG, JPEG and TIFF libraries are also
-  included with GTK, which is installed along with other Free Software
-  that requires it.  These are built with MinGW, but they can be used
-  with both GCC/MinGW and MSVC builds of Emacs.  See the info on
-  http://ourcomments.org/Emacs/w32-build-emacs.html, under "How to Get
-  Images Support", for more details about installing image support
-  libraries.  Note specifically that, due to some packaging snafus in
-  the GnuWin32-supplied image libraries, you will need to download
-  _source_ packages for some of the libraries in order to get the
-  header files necessary for building Emacs with image support.
-
-  If GTK 2.0 is installed, addpm will arrange for its image libraries
-  to be on the DLL search path for Emacs.
-
-  For PNG images, we recommend to use versions 1.4.x and later of
-  libpng, because previous versions had security issues.  You can find
-  precompiled libraries and headers on the GTK download page for
-  Windows (http://www.gtk.org/download/win32.php).
-
-  Versions 1.4.0 and later of libpng are binary incompatible with
-  earlier versions, so Emacs will only look for libpng libraries which
-  are compatible with the version it was compiled against.  That
-  version is given by the value of the Lisp variable `libpng-version';
-  e.g., 10403 means version 1.4.3.  The variable `dynamic-library-alist'
-  is automatically set to name only those DLL names that are known to
-  be compatible with the version given by `libpng-version'.  If PNG
-  support does not work for you even though you have the support DLL
-  installed, check the name of the installed DLL against
-  `dynamic-library-alist' and the value of `libpng-version', and
-  download compatible DLLs if needed.
-
-* Optional GnuTLS support
-
-  If configure.bat finds the gnutls/gnutls.h file in the include path,
-  Emacs is built with GnuTLS support by default; to avoid that you can
-  pass the argument --without-gnutls.
-
-  In order to support GnuTLS at runtime, a GnuTLS-enabled Emacs must
-  be able to find the relevant DLLs during startup; failure to do so
-  is not an error, but GnuTLS won't be available to the running
-  session.
-
-  You can get pre-built binaries (including any required DLL and the
-  header files) at http://sourceforge.net/projects/ezwinports/files/.
-
-* Optional libxml2 support
-
-  If configure.bat finds the libxml/HTMLparser.h file in the include path,
-  Emacs is built with libxml2 support by default; to avoid that you can
-  pass the argument --without-libxml2.
-
-  In order to support libxml2 at runtime, a libxml2-enabled Emacs must
-  be able to find the relevant DLLs during startup; failure to do so
-  is not an error, but libxml2 features won't be available to the
-  running session.
-
-  One place where you can get pre-built Windows binaries of libxml2
-  (including any required DLL and the header files) is here:
-
-     http://sourceforge.net/projects/ezwinports/files/
-
-  To compile Emacs with libxml2 from that site, you will need to pass
-  the "--cflags -I/path/to/include/libxml2" option to configure.bat,
-  because libxml2 header files are installed in the include/libxml2
-  subdirectory of the directory where you unzip the binary
-  distribution.  Other binary distributions might use other
-  directories, although include/libxml2 is the canonical place where
-  libxml2 headers are installed on Posix platforms.
-
-  You will also need to install the libiconv "development" tarball,
-  because the libiconv headers need to be available to the compiler
-  when you compile with libxml2 support.  A MinGW port of libiconv can
-  be found on the MinGW site:
-
-   http://sourceforge.net/projects/mingw/files/MinGW/Base/libiconv/
-
-  You need the libiconv-X.Y.Z-N-mingw32-dev.tar.lzma tarball from that
-  site.
-
-* Experimental SVG support
-
-  SVG support is currently experimental, and not built by default.
-  Specify --with-svg and ensure you have all the dependencies in your
-  include path.  Unless you have built a minimalist librsvg yourself
-  (untested), librsvg depends on a significant chunk of GTK+ to build,
-  plus a few Gnome libraries, libxml2, libbz2 and zlib at runtime.  The
-  easiest way to obtain the dependencies required for building is to
-  download a pre-bundled GTK+ development environment for Windows.
-  GTK puts its header files all over the place, so you will need to
-  run pkgconfig to list the include path you will need (either passed
-  to configure.bat as --cflags options, or set in the environment).
-
-  To use librsvg at runtime, ensure that librsvg and its dependencies
-  are on your PATH.  If you didn't build librsvg yourself, you will
-  need to check with where you downloaded it from for the
-  dependencies, as there are different build options.  If it is a
-  short list, then it most likely only lists the immediate
-  dependencies of librsvg, but the dependencies themselves have
-  dependencies - so don't download individual libraries from GTK+,
-  download and install the whole thing.  If you think you've got all
-  the dependencies and SVG support is still not working, check your
-  PATH for other libraries that shadow the ones you downloaded.
-  Libraries of the same name from different sources may not be
-  compatible, this problem was encountered with libbzip2 from GnuWin32
-  with libcroco from gnome.org.
-
-  If you can see etc/images/splash.svg, then you have managed to get
-  SVG support working.  Congratulations for making it through DLL hell
-  to this point.  You'll probably find that some SVG images crash
-  Emacs.  Problems have been observed in some images that contain
-  text, they seem to be a problem in the Windows port of Pango, or
-  maybe a problem with the way Cairo or librsvg is using it that
-  doesn't show up on other platforms.
-
-* Optional extra runtime checks
-
-  The configure.bat option --enable-checking builds Emacs with some
-  optional extra runtime checks and assertions enabled.  This may be
-  useful for debugging.
-
-* Optional extra libraries
-
-  You can pass --lib LIBNAME option to configure.bat to cause Emacs to
-  link with the specified library.  You can use this option more than once.
-
-* Building
-
-  After running configure, simply run the appropriate `make' program for
-  your compiler to build Emacs.  For MSVC, this is nmake; for GCC, it is
-  GNU make.  (If you are building out of Bazaar, say "make bootstrap" or
-  "nmake bootstrap" instead.)
-
-  As the files are compiled, you will see some warning messages
-  declaring that some functions don't return a value, or that some data
-  conversions will be lossy, etc.  You can safely ignore these messages.
-  The warnings may be fixed in the main FSF source at some point, but
-  until then we will just live with them.
-
-  With GNU Make, you can use the -j command-line option to have Make
-  execute several commands at once, like this:
-
-    gmake -j 4 XMFLAGS="-j 3"
-
-  The XMFLAGS variable overrides the default behavior of GNU Make on
-  Windows, whereby recursive Make invocations reset the maximum number
-  of simultaneous commands to 1.  The above command allows up to 4
-  simultaneous commands at once in the top-level Make, and up to 3 in
-  each one of the recursive Make's; you can use other numbers of jobs,
-  if you wish.
-
-  If you are building from Bazaar, the following commands will produce
-  the Info manuals (which are not part of the Bazaar sources):
-
-    make info
-  or
-    nmake info
-
-  Note that you will need makeinfo.exe (from the GNU Texinfo package)
-  in order for this command to succeed.
-
-* Installing
-
-  To install Emacs after it has compiled, simply run `nmake install'
-  or `make install', depending on which version of the Make utility
-  do you have.
-
-  By default, Emacs will be installed in the location where it was
-  built, but a different location can be specified either using the
-  --prefix option to configure, or by setting INSTALL_DIR when running
-  make, like so:
-
-     make install INSTALL_DIR=D:/emacs
-
-  (for `nmake', type "nmake install INSTALL_DIR=D:/emacs" instead).
-
-  The install process will run addpm to setup the registry entries, and
-  to create a Start menu icon for Emacs.
-
-* Make targets
-
-  The following make targets may be used by users building the source
-  distribution, or users who have checked out of Bazaar after
-  an initial bootstrapping.
-
-  make
-  Builds Emacs from the available sources and pre-compiled lisp files.
-
-  make install
-  Installs programs to the bin directory, and runs addpm to create
-  Start Menu icons.
-
-  make clean
-  Removes object and executable files produced by the build process in
-  the current configuration.  After make clean, you can rebuild with
-  the same configuration using make.
-
-  make distclean
-  In addition to the files removed by make clean, this also removes
-  Makefiles and other generated files to get back to the state of a
-  freshly unpacked source distribution.  Note that this will not remove
-  installed files, or the results of builds performed with different
-  compiler or optimization options than the current configuration.
-  After make distclean, it is necessary to run configure.bat followed
-  by make to rebuild.
-
-  make cleanall
-  Removes object and executable files that may have been created by
-  previous builds with different configure options, in addition to
-  the files produced by the current configuration.
-
-  make realclean
-  Removes the installed files in the bin subdirectory in addition to
-  the files removed by make cleanall.
-
-  make dist
-  Builds Emacs from the available sources and pre-compiled lisp files.
-  Packages Emacs binaries as full distribution and barebin distribution.
-
-  The following targets are intended only for use with the Bazaar sources.
-
-  make bootstrap
-  Creates a temporary emacs binary with lisp source files and
-  uses it to compile the lisp files.  Once the lisp files are built,
-  emacs is redumped with the compiled lisp.
-
-  make recompile
-  Recompiles any changed lisp files after an update.  This saves
-  doing a full bootstrap after every update.  If this or a subsequent
-  make fail, you probably need to perform a full bootstrap, though
-  running this target multiple times may eventually sort out the
-  interdependencies.
-
-  make maintainer-clean
-  Removes everything that can be recreated, including compiled lisp
-  files, to get back to the state of a fresh Bazaar tree.  After make
-  maintainer-clean, it is necessary to run configure.bat and make
-  bootstrap to rebuild.  Occasionally it may be necessary to run this
-  target after an update.
-
-* Creating binary distributions
-
-  Binary distributions (full and barebin distributions) can be
-  automatically built and packaged from source tarballs or a repository
-  checkout.
-
-  When building Emacs binary distributions, the --distfiles argument
-  to configure.bat specifies files to be included in the bin directory
-  of the binary distributions. This is intended for libraries that are
-  not built as part of Emacs, e.g. image libraries.
-
-  For example, specifying
-
-       --distfiles D:\distfiles\libXpm.dll
-
-  results in libXpm.dll being copied from D:\distfiles to the
-  bin directory before packaging starts.
-
-  Multiple files can be specified using multiple --distfiles arguments:
-
-       --distfiles D:\distfiles\libXpm.dll --distfiles C:\jpeglib\jpeg.dll
-
-  For packaging the binary distributions, the 'dist' make target uses
-  7-Zip (http://www.7-zip.org), which must be installed and available
-  on the Windows Path.
-
-
-* Trouble-shooting
-
-  The main problems that are likely to be encountered when building
-  Emacs stem from using an old version of GCC, or old MinGW or Windows API
-  headers.  Additionally, Cygwin ports of GNU make may require the Emacs
-  source tree to be mounted with text!=binary, because the makefiles
-  generated by configure.bat necessarily use DOS line endings.  Also,
-  Cygwin ports of make must run in UNIX mode, either by specifying
-  --unix on the command line, or MAKE_MODE=UNIX in the environment.
-
-  When configure runs, it attempts to detect when GCC itself, or the
-  headers it is using, are not suitable for building Emacs.  GCC version
-  2.95 or later is needed, because that is when the Windows port gained
-  sufficient support for anonymous structs and unions to cope with some
-  definitions from winnt.h that are used by addsection.c.
-  Older versions of the Windows API headers that come with Cygwin and MinGW
-  may be missing some definitions required by Emacs, or broken in other
-  ways.  In particular, uniscribe APIs were added to MinGW CVS only on
-  2006-03-26, so releases from before then cannot be used.
-
-  When in doubt about correctness of what configure did, look at the file
-  config.log, which shows all the failed test programs and compiler
-  messages associated with the failures.  If that doesn't give a clue,
-  please report the problems, together with the relevant fragments from
-  config.log, as bugs.
-
-  If configure succeeds, but make fails, install the Cygwin port of
-  Bash, even if the table above indicates that Emacs should be able to
-  build without sh.exe.  (Some versions of Windows shells are too dumb
-  for Makefile's used by Emacs.)
-
-  If you are using certain Cygwin builds of GCC, such as Cygwin version
-  1.1.8, you may need to specify some extra compiler flags like so:
-
-    configure --with-gcc --cflags -mwin32 --cflags -D__MSVCRT__
-      --ldflags -mwin32
-
-  However, the latest Cygwin versions, such as 1.3.3, don't need those
-  switches; you can simply use "configure --with-gcc".
-
-  We will attempt to auto-detect the need for these flags in a future
-  release.
-
-* Debugging
-
-  You should be able to debug Emacs using the debugger that is
-  appropriate for the compiler you used, namely DevStudio or Windbg if
-  compiled with MSVC, or GDB if compiled with GCC.  (GDB for Windows
-  is available from the MinGW site, http://www.mingw.org/download.shtml.)
-
-  When Emacs aborts due to a fatal internal error, Emacs on Windows
-  pops up an Emacs Abort Dialog asking you whether you want to debug
-  Emacs or terminate it.  If Emacs was built with MSVC, click YES
-  twice, and Windbg or the DevStudio debugger will start up
-  automatically.  If Emacs was built with GCC, first start GDB and
-  attach it to the Emacs process with the "gdb -p EMACS-PID" command,
-  where EMACS-PID is the Emacs process ID (which you can see in the
-  Windows Task Manager), type the "continue" command inside GDB, and
-  only then click YES on the abort dialog.  This will pass control to
-  the debugger, and you will be able to debug the cause of the fatal
-  error.
-
-  The single most important thing to find out when Emacs aborts or
-  crashes is where did that happen in the Emacs code.  This is called
-  "backtrace".
-
-  Emacs on Windows uses more than one thread.  When Emacs aborts due
-  to a fatal error, the current thread may not be the application
-  thread running Emacs code.  Therefore, to produce a meaningful
-  backtrace from a debugger, you need to instruct it to show the
-  backtrace for every thread.  With GDB, you do it like this:
-
-   (gdb) thread apply all backtrace
-
-  To run Emacs under a debugger to begin with, simply start it from
-  the debugger.  With GDB, chdir to the `src' directory (if you have
-  the source tree) or to a directory with the `.gdbinit' file (if you
-  don't have the source tree), and type these commands:
-
-    C:\whatever\src> gdb x:\path\to\emacs.exe
-    (gdb) run <ARGUMENTS TO EMACS>
-
-  Thereafter, use Emacs as usual; you can minimize the debugger
-  window, if you like.  The debugger will take control if and when
-  Emacs crashes.
-
-  Emacs functions implemented in C use a naming convention that reflects
-  their names in lisp.  The names of the C routines are the lisp names
-  prefixed with 'F', and with dashes converted to underscores.  For
-  example, the function call-process is implemented in C by
-  Fcall_process.  Similarly, lisp variables are prefixed with 'V', again
-  with dashes converted to underscores.  These conventions enable you to
-  easily set breakpoints or examine familiar lisp variables by name.
-
-  Since Emacs data is often in the form of a lisp object, and the
-  Lisp_Object type is difficult to examine manually in a debugger,
-  Emacs provides a helper routine called debug_print that prints out a
-  readable representation of a Lisp_Object.  If you are using GDB,
-  there is a .gdbinit file in the src directory which provides
-  definitions that are useful for examining lisp objects.  Therefore,
-  the following tips are mainly of interest when using MSVC.
-
-  The output from debug_print is sent to stderr, and to the debugger
-  via the OutputDebugString routine.  The output sent to stderr should
-  be displayed in the console window that was opened when the
-  emacs.exe executable was started.  The output sent to the debugger
-  should be displayed in its "Debug" output window.
-
-  When you are in the process of debugging Emacs and you would like to
-  examine the contents of a Lisp_Object variable, pop up the QuickWatch
-  window (QuickWatch has an eyeglass symbol on its button in the
-  toolbar).  In the text field at the top of the window, enter
-  debug_print(<variable>) and hit return.  For example, start and run
-  Emacs in the debugger until it is waiting for user input.  Then click
-  on the Break button in the debugger to halt execution.  Emacs should
-  halt in ZwUserGetMessage waiting for an input event.  Use the Call
-  Stack window to select the procedure w32_msp_pump up the call stack
-  (see below for why you have to do this).  Open the QuickWatch window
-  and enter debug_print(Vexec_path).  Evaluating this expression will
-  then print out the contents of the lisp variable exec-path.
-
-  If QuickWatch reports that the symbol is unknown, then check the call
-  stack in the Call Stack window.  If the selected frame in the call
-  stack is not an Emacs procedure, then the debugger won't recognize
-  Emacs symbols.  Instead, select a frame that is inside an Emacs
-  procedure and try using debug_print again.
-
-  If QuickWatch invokes debug_print but nothing happens, then check the
-  thread that is selected in the debugger.  If the selected thread is
-  not the last thread to run (the "current" thread), then it cannot be
-  used to execute debug_print.  Use the Debug menu to select the current
-  thread and try using debug_print again.  Note that the debugger halts
-  execution (e.g., due to a breakpoint) in the context of the current
-  thread, so this should only be a problem if you've explicitly switched
-  threads.
-
-
-This file is part of GNU Emacs.
-
-GNU Emacs is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
diff --git a/nt/config.nt b/nt/config.nt
deleted file mode 100644
index aa4a8bc..0000000
--- a/nt/config.nt
+++ /dev/null
@@ -1,1847 +0,0 @@
-/* GNU Emacs site configuration template file.
-
-Copyright (C) 1988, 1993-1994, 2001-2015 Free Software Foundation, Inc.
-
-This file is part of GNU Emacs.
-
-GNU Emacs is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* NOTE:
-   *** WARNING This file is no longer being updated ***
-   Please do not remove non-Windows related stuff
-   unless strictly necessary.  Also, before adding anything here
-   consider whether inc/ms-w32.h would be a better place; this is
-   particularly true for gcc vs. MSVC conditional defines, MinGW or
-   MSVC specific code, and macros not already defined in config.in.  */
-
-/* No code in Emacs #includes config.h twice, but some bits of code
-   intended to work with other packages as well (like gmalloc.c)
-   think they can include it as many times as they like.  */
-#ifndef EMACS_CONFIG_H
-#define EMACS_CONFIG_H
-
-
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* Define to use the convention that & in the full name stands for the login
-   id. */
-#undef AMPERSAND_FULL_NAME
-
-/* Define to the number of bits in type 'ptrdiff_t'. */
-#undef BITSIZEOF_PTRDIFF_T
-
-/* Define to the number of bits in type 'sig_atomic_t'. */
-#undef BITSIZEOF_SIG_ATOMIC_T
-
-/* Define to the number of bits in type 'size_t'. */
-#undef BITSIZEOF_SIZE_T
-
-/* Define to the number of bits in type 'wchar_t'. */
-#undef BITSIZEOF_WCHAR_T
-
-/* Define to the number of bits in type 'wint_t'. */
-#undef BITSIZEOF_WINT_T
-
-/* Define if get_current_dir_name should not be used. */
-#undef BROKEN_GET_CURRENT_DIR_NAME
-
-/* Define on FreeBSD to work around an issue when reading from a PTY. */
-#undef BROKEN_PTY_READ_AFTER_EAGAIN
-
-/* Define if Emacs cannot be dumped on your system. */
-#undef CANNOT_DUMP
-
-/* Define this to enable compile time checks for the Lisp_Object data type. */
-/* #undef CHECK_LISP_OBJECT_TYPE */
-
-/* Define if you want lock files to be written, so that Emacs can tell
-   instantly when you try to modify a file that someone else has modified in
-   his/her Emacs. */
-#define CLASH_DETECTION 1
-
-/* Short copyright string for this version of Emacs. */
-#define COPYRIGHT "Copyright (C) 2015 Free Software Foundation, Inc."
-
-/* Define to one of '_getb67', 'GETB67', 'getb67' for Cray-2 and Cray-YMP
-   systems. This function is required for 'alloca.c' support on those systems.
-   */
-#undef CRAY_STACKSEG_END
-
-/* Define if the system is Cygwin. */
-#undef CYGWIN
-
-/* Define to 1 if using 'alloca.c'. */
-#undef C_ALLOCA
-
-/* Define if the system is Darwin. */
-#undef DARWIN_OS
-
-/* Extra bits to be or'd in with any pointers stored in a Lisp_Object. */
-#undef DATA_SEG_BITS
-
-/* Name of the default sound device. */
-#undef DEFAULT_SOUND_DEVICE
-
-/* Character that separates a device in a file name. */
-#define DEVICE_SEP ':'
-
-/* Define to 1 for DGUX with <sys/dg_sys_info.h>. */
-#undef DGUX
-
-/* Character that separates directories in a file name. */
-#define DIRECTORY_SEP '/'
-
-/* Define if process.c does not need to close a pty to make it a controlling
-   terminal (it is already a controlling terminal of the subprocess, because
-   we did ioctl TIOCSCTTY). */
-#undef DONT_REOPEN_PTY
-
-/* Define if the system is MS DOS or MS Windows. */
-#define DOS_NT
-
-/* Define to 1 if you are using the GNU C Library. */
-#undef DOUG_LEA_MALLOC
-
-/* Define to the canonical Emacs configuration name. */
-#undef EMACS_CONFIGURATION
-
-/* Define to the options passed to configure. */
-#undef EMACS_CONFIG_OPTIONS
-
-/* Define to 1 if expensive run-time data type and consistency checks are
-   enabled. */
-#undef ENABLE_CHECKING
-
-/* Letter to use in finding device name of first PTY, if PTYs are supported.
-   */
-#define FIRST_PTY_LETTER 'a'
-
-/* Enable compile-time and run-time bounds-checking, and some warnings,
-      without upsetting glibc 2.15+. */
-   #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
-   # define _FORTIFY_SOURCE 2
-   #endif
-
-
-/* Define to 1 if futimesat mishandles a NULL file name. */
-#undef FUTIMESAT_NULL_BUG
-
-/* Define this to check for errors in cons list. */
-#undef GC_CHECK_CONS_LIST
-
-/* Define this temporarily to hunt a bug. If defined, the size of strings is
-   redundantly recorded in sdata structures so that it can be compared to the
-   sizes recorded in Lisp strings. */
-#undef GC_CHECK_STRING_BYTES
-
-/* Define this to check the string free list. */
-#undef GC_CHECK_STRING_FREE_LIST
-
-/* Define this to check for short string overrun. */
-#undef GC_CHECK_STRING_OVERRUN
-
-/* Mark a secondary stack, like the register stack on the ia64. */
-#undef GC_MARK_SECONDARY_STACK
-
-/* Define if setjmp is known to save all registers relevant for conservative
-   garbage collection in the jmp_buf.
-   MSVC ignores the "register" keyword, so test fails even though
-   setjmp does work.  */
-#define GC_SETJMP_WORKS 1
-
-/* Define to the type of elements in the array set by `getgroups'. Usually
-   this is either `int' or `gid_t'. */
-#undef GETGROUPS_T
-
-/* Define this to 1 if getgroups(0,NULL) does not return the number of groups.
-   */
-#undef GETGROUPS_ZERO_BUG
-
-/* Define if gettimeofday clobbers the localtime buffer. */
-#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME
-
-/* Define this to 'void' or 'struct timezone' to match the system's
-   declaration of the second argument to gettimeofday. */
-#undef GETTIMEOFDAY_TIMEZONE
-
-/* Define this to enable glyphs debugging code. */
-/* #undef GLYPH_DEBUG */
-
-/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
-   whether the gnulib module close-stream shall be considered present. */
-#undef GNULIB_CLOSE_STREAM
-
-/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
-   whether the gnulib module faccessat shall be considered present. */
-#undef GNULIB_FACCESSAT
-
-/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
-   whether the gnulib module fdopendir shall be considered present. */
-#undef GNULIB_FDOPENDIR
-
-/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
-   whether the gnulib module fscanf shall be considered present. */
-#undef GNULIB_FSCANF
-
-/* enable some gnulib portability checks */
-#undef GNULIB_PORTCHECK
-
-/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
-   whether the gnulib module scanf shall be considered present. */
-#undef GNULIB_SCANF
-
-/* Define if ths system is compatible with GNU/Linux. */
-#undef GNU_LINUX
-
-/* Define to 1 if you want to use the GNU memory allocator. */
-#define GNU_MALLOC 1
-
-/* Define to set the G_SLICE environment variable to "always-malloc" at
-   startup, if using GTK. */
-#undef G_SLICE_ALWAYS_MALLOC
-
-/* Define to 1 if you have the `access' function. */
-#undef HAVE_ACCESS
-
-/* Define to 1 if you have the `aclsort' function. */
-#undef HAVE_ACLSORT
-
-/* Define to 1 if you have the <aclv.h> header file. */
-#undef HAVE_ACLV_H
-
-/* Define to 1 if you have the `aclx_get' function. */
-#undef HAVE_ACLX_GET
-
-/* Define to 1 if you have the `acl_copy_ext_native' function. */
-#undef HAVE_ACL_COPY_EXT_NATIVE
-
-/* Define to 1 if you have the `acl_create_entry_np' function. */
-#undef HAVE_ACL_CREATE_ENTRY_NP
-
-/* Define to 1 if you have the `acl_delete_def_file' function. */
-#undef HAVE_ACL_DELETE_DEF_FILE
-
-/* Define to 1 if you have the `acl_delete_fd_np' function. */
-#undef HAVE_ACL_DELETE_FD_NP
-
-/* Define to 1 if you have the `acl_delete_file_np' function. */
-#undef HAVE_ACL_DELETE_FILE_NP
-
-/* Define to 1 if you have the `acl_entries' function. */
-#undef HAVE_ACL_ENTRIES
-
-/* Define to 1 if you have the `acl_extended_file' function. */
-#undef HAVE_ACL_EXTENDED_FILE
-
-/* Define to 1 if the constant ACL_FIRST_ENTRY exists. */
-#undef HAVE_ACL_FIRST_ENTRY
-
-/* Define to 1 if you have the `acl_free' function. */
-#define HAVE_ACL_FREE 1
-
-/* Define to 1 if you have the `acl_free_text' function. */
-#undef HAVE_ACL_FREE_TEXT
-
-/* Define to 1 if you have the `acl_from_mode' function. */
-#undef HAVE_ACL_FROM_MODE
-
-/* Define to 1 if you have the `acl_from_text' function. */
-#define HAVE_ACL_FROM_TEXT 1
-
-/* Define to 1 if you have the `acl_get_fd' function. */
-#undef HAVE_ACL_GET_FD
-
-/* Define to 1 if you have the `acl_get_file' function. */
-#define HAVE_ACL_GET_FILE 1
-
-/* Define to 1 if you have the <acl/libacl.h> header file. */
-#undef HAVE_ACL_LIBACL_H
-
-/* Define to 1 if you have the `acl_set_fd' function. */
-#undef HAVE_ACL_SET_FD
-
-/* Define to 1 if you have the `acl_set_file' function. */
-#define HAVE_ACL_SET_FILE 1
-
-/* Define to 1 if you have the `acl_to_short_text' function. */
-#undef HAVE_ACL_TO_SHORT_TEXT
-
-/* Define to 1 if you have the `acl_trivial' function. */
-#undef HAVE_ACL_TRIVIAL
-
-/* Define to 1 if the ACL type ACL_TYPE_EXTENDED exists. */
-#undef HAVE_ACL_TYPE_EXTENDED
-
-/* Define to 1 if the file /usr/lpp/X11/bin/smt.exp exists. */
-#undef HAVE_AIX_SMT_EXP
-
-/* Define to 1 if you have 'alloca' after including <alloca.h>, a header that
-   may be supplied by this distribution. */
-#undef HAVE_ALLOCA
-
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
-   */
-#undef HAVE_ALLOCA_H
-
-/* Define to 1 if ALSA is available. */
-#undef HAVE_ALSA
-
-/* Define to 1 if strtold conforms to C99. */
-#undef HAVE_C99_STRTOLD
-
-/* Define to 1 if you have the `cfmakeraw' function. */
-#undef HAVE_CFMAKERAW
-
-/* Define to 1 if you have the `cfsetspeed' function. */
-#undef HAVE_CFSETSPEED
-
-/* Define to 1 if you have the `clock_gettime' function. */
-#undef HAVE_CLOCK_GETTIME
-
-/* Define to 1 if you have the `clock_settime' function. */
-#undef HAVE_CLOCK_SETTIME
-
-/* Define to 1 if you have the <coff.h> header file. */
-#undef HAVE_COFF_H
-
-/* Define to 1 if you have the <com_err.h> header file. */
-#undef HAVE_COM_ERR_H
-
-/* Define to 1 if you have the `copysign' function. */
-#define HAVE_COPYSIGN 1
-
-/* Define to 1 if data_start is the address of the start of the main data
-   segment. */
-#undef HAVE_DATA_START
-
-/* Define to 1 if using D-Bus. */
-#undef HAVE_DBUS
-
-/* Define to 1 if you have the `dbus_type_is_valid' function. */
-#undef HAVE_DBUS_TYPE_IS_VALID
-
-/* Define to 1 if you have the `dbus_validate_bus_name' function. */
-#undef HAVE_DBUS_VALIDATE_BUS_NAME
-
-/* Define to 1 if you have the `dbus_validate_interface' function. */
-#undef HAVE_DBUS_VALIDATE_INTERFACE
-
-/* Define to 1 if you have the `dbus_validate_member' function. */
-#undef HAVE_DBUS_VALIDATE_MEMBER
-
-/* Define to 1 if you have the `dbus_validate_path' function. */
-#undef HAVE_DBUS_VALIDATE_PATH
-
-/* Define to 1 if you have the `dbus_watch_get_unix_fd' function. */
-#undef HAVE_DBUS_WATCH_GET_UNIX_FD
-
-/* Define to 1 if you have the declaration of `alarm', and to 0 if you don't.
-   */
-#undef HAVE_DECL_ALARM
-
-/* Define to 1 if you have the declaration of `fdatasync', and to 0 if you
-   don't. */
-#undef HAVE_DECL_FDATASYNC
-
-/* Define to 1 if you have the declaration of `fdopendir', and to 0 if you
-   don't. */
-#undef HAVE_DECL_FDOPENDIR
-
-/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
-   */
-#define HAVE_DECL_GETENV 1
-
-/* Define to 1 if you have the declaration of `localtime_r', and to 0 if you
-   don't. */
-#undef HAVE_DECL_LOCALTIME_R
-
-/* Define to 1 if you have the declaration of `memrchr', and to 0 if you
-   don't. */
-#undef HAVE_DECL_MEMRCHR
-
-/* Define to 1 if you have the declaration of `strmode', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRMODE
-
-/* Define to 1 if you have the declaration of `strtoimax', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOIMAX
-
-/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
-   don't. */
-#define HAVE_DECL_STRTOLL 1
-
-/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
-   don't. */
-#define HAVE_DECL_STRTOULL 1
-
-/* Define to 1 if you have the declaration of `strtoumax', and to 0 if you
-   don't. */
-#define HAVE_DECL_STRTOUMAX 1
-
-/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
-   don't. */
-#undef HAVE_DECL_SYS_SIGLIST
-
-/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
-   */
-#define HAVE_DECL_TZNAME 1
-
-/* Define to 1 if you have the declaration of `unsetenv', and to 0 if you
-   don't. */
-#undef HAVE_DECL_UNSETENV
-
-/* Define to 1 if you have the declaration of `_putenv', and to 0 if you
-   don't. */
-#undef HAVE_DECL__PUTENV
-
-/* Define to 1 if you have the declaration of `__fpending', and to 0 if you
-   don't. */
-#undef HAVE_DECL___FPENDING
-
-/* Define to 1 if you have the declaration of `__sys_siglist', and to 0 if you
-   don't. */
-#undef HAVE_DECL___SYS_SIGLIST
-
-/* Define to 1 if you have the <des.h> header file. */
-#undef HAVE_DES_H
-
-/* Define to 1 if dynamic ptys are supported. */
-#undef HAVE_DEV_PTMX
-
-/* Define to 1 if you have the `difftime' function. */
-#undef HAVE_DIFFTIME
-
-/* Define to 1 if you have the <dirent.h> header file. */
-#undef HAVE_DIRENT_H
-
-/* Define to 1 if you have the 'dup2' function. */
-#define HAVE_DUP2 1
-
-/* Define to 1 if you have the `eaccess' function. */
-#undef HAVE_EACCESS
-
-/* Define to 1 if you have the `endgrent' function. */
-#undef HAVE_ENDGRENT
-
-/* Define to 1 if you have the `endpwent' function. */
-#undef HAVE_ENDPWENT
-
-/* Define if you have the declaration of environ. */
-#undef HAVE_ENVIRON_DECL
-
-/* Define to 1 if you have the `euidaccess' function. */
-#undef HAVE_EUIDACCESS
-
-/* Define to 1 if you have the <execinfo.h> header file. */
-#define HAVE_EXECINFO_H 1
-
-/* Define to 1 if you have the `faccessat' function. */
-#undef HAVE_FACCESSAT
-
-/* Define to 1 if you have the `facl' function. */
-#undef HAVE_FACL
-
-/* Define to 1 if you have the `fdatasync' function. */
-#undef HAVE_FDATASYNC
-
-/* Define to 1 if you have the `fdopendir' function. */
-#undef HAVE_FDOPENDIR
-
-/* Define to 1 if you have the `fork' function. */
-#undef HAVE_FORK
-
-/* Define to 1 if you have the `freeifaddrs' function. */
-#undef HAVE_FREEIFADDRS
-
-/* Define to 1 if using the freetype and fontconfig libraries. */
-#undef HAVE_FREETYPE
-
-/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
-#undef HAVE_FSEEKO
-
-/* Define to 1 if you have the `fstatat' function. */
-#undef HAVE_FSTATAT
-
-/* Define to 1 if you have the `fsync' function. */
-#define HAVE_FSYNC 1
-
-/* Define to 1 if you have the `futimens' function. */
-#undef HAVE_FUTIMENS
-
-/* Define to 1 if you have the `futimes' function. */
-#undef HAVE_FUTIMES
-
-/* Define to 1 if you have the `futimesat' function. */
-#undef HAVE_FUTIMESAT
-
-/* Define to 1 if you have the `gai_strerror' function. */
-#undef HAVE_GAI_STRERROR
-
-/* Define to 1 if using GConf. */
-#undef HAVE_GCONF
-
-/* Define to 1 if you have the `getacl' function. */
-#undef HAVE_GETACL
-
-/* Define to 1 if you have the `getaddrinfo' function. */
-#undef HAVE_GETADDRINFO
-
-/* Define to 1 if you have the `getdelim' function. */
-#undef HAVE_GETDELIM
-
-/* Define to 1 if you have the `getgrent' function. */
-#undef HAVE_GETGRENT
-
-/* Define to 1 if your system has a working `getgroups' function. */
-#undef HAVE_GETGROUPS
-
-/* Define to 1 if you have the `gethostname' function. */
-#define HAVE_GETHOSTNAME 1
-
-/* Define to 1 if you have the `getifaddrs' function. */
-#undef HAVE_GETIFADDRS
-
-/* Define to 1 if you have the `getline' function. */
-#undef HAVE_GETLINE
-
-/* Define to 1 if you have the <getopt.h> header file. */
-#undef HAVE_GETOPT_H
-
-/* Define to 1 if you have the `getopt_long_only' function. */
-#undef HAVE_GETOPT_LONG_ONLY
-
-/* Define to 1 if you have the `getpagesize' function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define to 1 if you have the `getpeername' function. */
-#define HAVE_GETPEERNAME 1
-
-/* Define to 1 if you have the `getpt' function. */
-#undef HAVE_GETPT
-
-/* Define to 1 if you have the `getpwent' function. */
-#undef HAVE_GETPWENT
-
-/* Define to 1 if you have the `getrlimit' function. */
-#undef HAVE_GETRLIMIT
-
-/* Define to 1 if you have the `getrusage' function. */
-#undef HAVE_GETRUSAGE
-
-/* Define to 1 if you have the `getsockname' function. */
-#define HAVE_GETSOCKNAME 1
-
-/* Define to 1 if you have the `gettimeofday' function. */
-#define HAVE_GETTIMEOFDAY 1
-
-/* Define to 1 if using GFile. */
-#undef HAVE_GFILENOTIFY
-
-/* Define to 1 if you have the `get_current_dir_name' function. */
-#undef HAVE_GET_CURRENT_DIR_NAME
-
-/* Define to 1 if you have a gif (or ungif) library. */
-#undef HAVE_GIF
-
-/* Define if using GnuTLS. */
-#undef HAVE_GNUTLS
-
-/* Define if using GnuTLS certificate verification callbacks. */
-#undef HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY
-
-/* Define to 1 if you have the `gnutls_certificate_set_verify_function'
-   function. */
-#undef HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION
-
-/* Define to 1 if you have the gpm library (-lgpm). */
-#undef HAVE_GPM
-
-/* Define to 1 if you have the `grantpt' function. */
-#undef HAVE_GRANTPT
-
-/* Define to 1 if using GSettings. */
-#undef HAVE_GSETTINGS
-
-/* Define to 1 if using GTK 3 or later. */
-#undef HAVE_GTK3
-
-/* Define to 1 if you have the `gtk_adjustment_get_page_size' function. */
-#undef HAVE_GTK_ADJUSTMENT_GET_PAGE_SIZE
-
-/* Define to 1 if you have the `gtk_dialog_get_action_area' function. */
-#undef HAVE_GTK_DIALOG_GET_ACTION_AREA
-
-/* Define to 1 if you have the `gtk_file_selection_new' function. */
-#undef HAVE_GTK_FILE_SELECTION_NEW
-
-/* Define to 1 if you have the `gtk_handle_box_new' function. */
-#undef HAVE_GTK_HANDLE_BOX_NEW
-
-/* Define to 1 if you have the `gtk_main' function. */
-#undef HAVE_GTK_MAIN
-
-/* Define to 1 if you have the `gtk_orientable_set_orientation' function. */
-#undef HAVE_GTK_ORIENTABLE_SET_ORIENTATION
-
-/* Define to 1 if you have the `gtk_tearoff_menu_item_new' function. */
-#undef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
-
-/* Define to 1 if you have the `gtk_widget_get_mapped' function. */
-#undef HAVE_GTK_WIDGET_GET_MAPPED
-
-/* Define to 1 if you have the `gtk_widget_get_sensitive' function. */
-#undef HAVE_GTK_WIDGET_GET_SENSITIVE
-
-/* Define to 1 if you have the `gtk_widget_get_window' function. */
-#undef HAVE_GTK_WIDGET_GET_WINDOW
-
-/* Define to 1 if you have the `gtk_widget_set_has_window' function. */
-#undef HAVE_GTK_WIDGET_SET_HAS_WINDOW
-
-/* Define to 1 if you have the `gtk_window_set_has_resize_grip' function. */
-#undef HAVE_GTK_WINDOW_SET_HAS_RESIZE_GRIP
-
-/* Define to 1 if you have the `g_type_init' function. */
-#undef HAVE_G_TYPE_INIT
-
-/* Define to 1 if netdb.h declares h_errno. */
-#define HAVE_H_ERRNO 1
-
-/* Define to 1 if you have the <ifaddrs.h> header file. */
-#undef HAVE_IFADDRS_H
-
-/* Define to 1 if using imagemagick. */
-#undef HAVE_IMAGEMAGICK
-
-/* Define to 1 if you have inet sockets. */
-#define HAVE_INET_SOCKETS 1
-
-/* Define to 1 to use inotify. */
-#undef HAVE_INOTIFY
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the jpeg library (-ljpeg). */
-#undef HAVE_JPEG
-
-/* Define to 1 if you have the <kerberosIV/des.h> header file. */
-#undef HAVE_KERBEROSIV_DES_H
-
-/* Define to 1 if you have the <kerberosIV/krb.h> header file. */
-#undef HAVE_KERBEROSIV_KRB_H
-
-/* Define to 1 if you have the <kerberos/des.h> header file. */
-#undef HAVE_KERBEROS_DES_H
-
-/* Define to 1 if you have the <kerberos/krb.h> header file. */
-#undef HAVE_KERBEROS_KRB_H
-
-/* Define to 1 if `e_text' is a member of `krb5_error'. */
-#undef HAVE_KRB5_ERROR_E_TEXT
-
-/* Define to 1 if `text' is a member of `krb5_error'. */
-#undef HAVE_KRB5_ERROR_TEXT
-
-/* Define to 1 if you have the <krb5.h> header file. */
-#undef HAVE_KRB5_H
-
-/* Define to 1 if you have the <krb.h> header file. */
-#undef HAVE_KRB_H
-
-/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
-#define HAVE_LANGINFO_CODESET 1
-
-/* Define to 1 if you have the `com_err' library (-lcom_err). */
-#undef HAVE_LIBCOM_ERR
-
-/* Define to 1 if you have the `crypto' library (-lcrypto). */
-#undef HAVE_LIBCRYPTO
-
-/* Define to 1 if you have the `des' library (-ldes). */
-#undef HAVE_LIBDES
-
-/* Define to 1 if you have the `des425' library (-ldes425). */
-#undef HAVE_LIBDES425
-
-/* Define to 1 if you have the `dgc' library (-ldgc). */
-#undef HAVE_LIBDGC
-
-/* Define to 1 if you have the `dnet' library (-ldnet). */
-#undef HAVE_LIBDNET
-
-/* Define to 1 if you have the <libgen.h> header file. */
-#undef HAVE_LIBGEN_H
-
-/* Define to 1 if you have the hesiod library (-lhesiod). */
-#undef HAVE_LIBHESIOD
-
-/* Define to 1 if you have the `k5crypto' library (-lk5crypto). */
-#undef HAVE_LIBK5CRYPTO
-
-/* Define to 1 if you have the `krb' library (-lkrb). */
-#undef HAVE_LIBKRB
-
-/* Define to 1 if you have the `krb4' library (-lkrb4). */
-#undef HAVE_LIBKRB4
-
-/* Define to 1 if you have the `krb5' library (-lkrb5). */
-#undef HAVE_LIBKRB5
-
-/* Define to 1 if you have the `kstat' library (-lkstat). */
-#undef HAVE_LIBKSTAT
-
-/* Define to 1 if you have the `lockfile' library (-llockfile). */
-#undef HAVE_LIBLOCKFILE
-
-/* Define to 1 if you have the `m' library (-lm). */
-#undef HAVE_LIBM
-
-/* Define to 1 if you have the `mail' library (-lmail). */
-#undef HAVE_LIBMAIL
-
-/* Define to 1 if using libotf. */
-#undef HAVE_LIBOTF
-
-/* Define to 1 if you have the `perfstat' library (-lperfstat). */
-#undef HAVE_LIBPERFSTAT
-
-/* Define to 1 if you have the <libpng/png.h> header file. */
-#undef HAVE_LIBPNG_PNG_H
-
-/* Define to 1 if you have the `pthreads' library (-lpthreads). */
-#undef HAVE_LIBPTHREADS
-
-/* Define to 1 if you have the resolv library (-lresolv). */
-#undef HAVE_LIBRESOLV
-
-/* Define to 1 if using SELinux. */
-#undef HAVE_LIBSELINUX
-
-/* Define to 1 if you have the `Xext' library (-lXext). */
-#undef HAVE_LIBXEXT
-
-/* Define to 1 if you have the libxml library (-lxml2). */
-#undef HAVE_LIBXML2
-
-/* Define to 1 if you have the `Xmu' library (-lXmu). */
-#undef HAVE_LIBXMU
-
-/* Define to 1 if you have the <linux/version.h> header file. */
-#undef HAVE_LINUX_VERSION_H
-
-/* Define to 1 if you have the `localtime_r' function. */
-#undef HAVE_LOCALTIME_R
-
-/* Define to 1 if you support file names longer than 14 characters. */
-#define HAVE_LONG_FILE_NAMES 1
-
-/* Define to 1 if the system has the type 'long long int'. */
-#undef HAVE_LONG_LONG_INT
-
-/* Define to 1 if you have the `lrand48' function. */
-#undef HAVE_LRAND48
-
-/* Define to 1 if you have the `lstat' function. */
-#undef HAVE_LSTAT
-
-/* Define to 1 if you have the `lutimes' function. */
-#undef HAVE_LUTIMES
-
-/* Define to 1 if using libm17n-flt. */
-#undef HAVE_M17N_FLT
-
-/* Define to 1 if you have the <machine/soundcard.h> header file. */
-#undef HAVE_MACHINE_SOUNDCARD_H
-
-/* Define to 1 if you have the <mach/mach.h> header file. */
-#undef HAVE_MACH_MACH_H
-
-/* Define to 1 if you have the `MagickExportImagePixels' function. */
-#undef HAVE_MAGICKEXPORTIMAGEPIXELS
-
-/* Define to 1 if you have the `MagickMergeImageLayers' function. */
-#undef HAVE_MAGICKMERGEIMAGELAYERS
-
-/* Define to 1 if you have the <maillock.h> header file. */
-#undef HAVE_MAILLOCK_H
-
-/* Define to 1 if you have the <malloc/malloc.h> header file. */
-#undef HAVE_MALLOC_MALLOC_H
-
-/* Define to 1 if <wchar.h> declares mbstate_t. */
-#undef HAVE_MBSTATE_T
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `memrchr' function. */
-#undef HAVE_MEMRCHR
-
-/* Define to 1 if you have mouse menus. (This is automatic if you use X, but
-   the option to specify it remains.) It is also defined with other window
-   systems that support xmenu.c. */
-#undef HAVE_MENUS
-
-/* Define to 1 if you have the `mkostemp' function. */
-#define HAVE_MKOSTEMP 1
-
-/* Define to 1 if you have the `mkstemp' function. */
-#undef HAVE_MKSTEMP
-
-/* Define to 1 if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define to 1 if you have the `nanotime' function. */
-#undef HAVE_NANOTIME
-
-/* Define to 1 if you have the <net/if_dl.h> header file. */
-#undef HAVE_NET_IF_DL_H
-
-/* Define to 1 if you have the <net/if.h> header file. */
-#undef HAVE_NET_IF_H
-
-/* Define to 1 if you have the <nlist.h> header file. */
-#undef HAVE_NLIST_H
-
-/* Define to 1 if you are using the NeXTstep API, either GNUstep or Cocoa on
-   Mac OS X. */
-#undef HAVE_NS
-
-/* Define to use native MS Windows GUI. */
-#define HAVE_NTGUI 1
-
-/* Define to 1 if libotf has OTF_get_variation_glyphs. */
-#undef HAVE_OTF_GET_VARIATION_GLYPHS
-
-/* Define to 1 if personality LINUX32 can be set. */
-#undef HAVE_PERSONALITY_LINUX32
-
-/* Define to 1 if you have the png library (-lpng). */
-#undef HAVE_PNG
-
-/* Define to 1 if you have the <png.h> header file. */
-#undef HAVE_PNG_H
-
-/* Define to 1 if you have the `posix_memalign' function. */
-#undef HAVE_POSIX_MEMALIGN
-
-/* Define to 1 if you have the `posix_openpt' function. */
-#undef HAVE_POSIX_OPENPT
-
-/* Define if you have the /proc filesystem. */
-#undef HAVE_PROCFS
-
-/* Define to 1 if you have the `pselect' function. */
-#undef HAVE_PSELECT
-
-/* Define to 1 if you have the `pstat_getdynamic' function. */
-#undef HAVE_PSTAT_GETDYNAMIC
-
-/* Define to 1 if you have pthread (-lpthread). */
-#undef HAVE_PTHREAD
-
-/* Define to 1 if you have the <pthread.h> header file. */
-#undef HAVE_PTHREAD_H
-
-/* Define to 1 if the pthread_sigmask function can be used (despite bugs). */
-#undef HAVE_PTHREAD_SIGMASK
-
-/* Define if the system supports pty devices. */
-#undef HAVE_PTYS
-
-/* Define to 1 if you have the <pty.h> header file. */
-#undef HAVE_PTY_H
-
-/* Define to 1 if you have the <pwd.h> header file. */
-#define HAVE_PWD_H 1
-
-/* Define to 1 if you have the `random' function. */
-#define HAVE_RANDOM 1
-
-/* Define to 1 if you have the `readlink' function. */
-#undef HAVE_READLINK
-
-/* Define to 1 if you have the `readlinkat' function. */
-#undef HAVE_READLINKAT
-
-/* Define to 1 if you have the `recvfrom' function. */
-#define HAVE_RECVFROM 1
-
-/* Define to 1 if res_init is available. */
-#undef HAVE_RES_INIT
-
-/* Define to 1 if you have the `rint' function. */
-#undef HAVE_RINT
-
-/* Define to 1 if using librsvg. */
-#undef HAVE_RSVG
-
-/* Define to 1 if you have the `select' function. */
-#define HAVE_SELECT 1
-
-/* Define to 1 if you have the `sendto' function. */
-#define HAVE_SENDTO 1
-
-/* Define to 1 if you have the `setitimer' function. */
-#define HAVE_SETITIMER 1
-
-/* Define to 1 if you have the `setlocale' function. */
-#define HAVE_SETLOCALE 1
-
-/* Define to 1 if you have the `setrlimit' function. */
-#undef HAVE_SETRLIMIT
-
-/* Define to 1 if you have the `shutdown' function. */
-#define HAVE_SHUTDOWN 1
-
-/* Define to 1 if you have the `sig2str' function. */
-#undef HAVE_SIG2STR
-
-/* Define to 1 if 'sig_atomic_t' is a signed integer type. */
-#undef HAVE_SIGNED_SIG_ATOMIC_T
-
-/* Define to 1 if 'wchar_t' is a signed integer type. */
-#undef HAVE_SIGNED_WCHAR_T
-
-/* Define to 1 if 'wint_t' is a signed integer type. */
-#undef HAVE_SIGNED_WINT_T
-
-/* Define to 1 if sigsetjmp and siglongjmp work. The value of this symbol is
-   irrelevant if HAVE__SETJMP is defined. */
-#undef HAVE_SIGSETJMP
-
-/* Define to 1 if the system has the type `sigset_t'. */
-#undef HAVE_SIGSET_T
-
-/* Define to 1 if you have the `snprintf' function. */
-#define HAVE_SNPRINTF 1
-
-/* Define if the system supports 4.2-compatible sockets.
-   NT supports Winsock which is close enough (with some hacks).  */
-#define HAVE_SOCKETS 1
-
-/* Define to 1 if you have sound support. */
-#define HAVE_SOUND 1
-
-/* Define to 1 if you have the <soundcard.h> header file. */
-#undef HAVE_SOUNDCARD_H
-
-/* Define to 1 if `speed_t' is declared by <termios.h>. */
-#undef HAVE_SPEED_T
-
-/* Define to 1 if you have the `statacl' function. */
-#undef HAVE_STATACL
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdio_ext.h> header file. */
-#undef HAVE_STDIO_EXT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the `strsignal' function. */
-#undef HAVE_STRSIGNAL
-
-/* Define to 1 if you have the `strtoimax' function. */
-#undef HAVE_STRTOIMAX
-
-/* Define to 1 if you have the `strtoll' function. */
-#undef HAVE_STRTOLL
-
-/* Define to 1 if you have the `strtoull' function. */
-#define HAVE_STRTOULL 1
-
-/* Define to 1 if you have the `strtoumax' function. */
-#define HAVE_STRTOUMAX 1
-
-/* Define to 1 if `ifr_addr' is a member of `struct ifreq'. */
-#undef HAVE_STRUCT_IFREQ_IFR_ADDR
-
-/* Define to 1 if `ifr_addr.sa_len' is a member of `struct ifreq'. */
-#undef HAVE_STRUCT_IFREQ_IFR_ADDR_SA_LEN
-
-/* Define to 1 if `ifr_broadaddr' is a member of `struct ifreq'. */
-#undef HAVE_STRUCT_IFREQ_IFR_BROADADDR
-
-/* Define to 1 if `ifr_flags' is a member of `struct ifreq'. */
-#undef HAVE_STRUCT_IFREQ_IFR_FLAGS
-
-/* Define to 1 if `ifr_hwaddr' is a member of `struct ifreq'. */
-#undef HAVE_STRUCT_IFREQ_IFR_HWADDR
-
-/* Define to 1 if `ifr_netmask' is a member of `struct ifreq'. */
-#undef HAVE_STRUCT_IFREQ_IFR_NETMASK
-
-/* Define to 1 if `n_un.n_name' is a member of `struct nlist'. */
-#undef HAVE_STRUCT_NLIST_N_UN_N_NAME
-
-/* Define to 1 if `st_atimensec' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_ATIMENSEC
-
-/* Define to 1 if `st_atimespec.tv_nsec' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
-
-/* Define to 1 if `st_atim.st__tim.tv_nsec' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC
-
-/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
-
-/* Define to 1 if `st_birthtimensec' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
-
-/* Define to 1 if `st_birthtimespec.tv_nsec' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
-
-/* Define to 1 if `st_birthtim.tv_nsec' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC
-
-/* Define to 1 if `tm_zone' is a member of `struct tm'. */
-#undef HAVE_STRUCT_TM_TM_ZONE
-
-/* Define if struct utimbuf is declared -- usually in <utime.h>. Some systems
-   have utime.h but don't declare the struct anywhere. */
-#undef HAVE_STRUCT_UTIMBUF
-
-/* Define if struct stat has an st_dm_mode member. */
-#undef HAVE_ST_DM_MODE
-
-/* Define to 1 if you have the `symlink' function. */
-#undef HAVE_SYMLINK
-
-/* Define to 1 if you have the `sync' function. */
-#undef HAVE_SYNC
-
-/* Define to 1 if you have the <sys/acl.h> header file. */
-#define HAVE_SYS_ACL_H 1
-
-/* Define to 1 if you have the <sys/bitypes.h> header file. */
-#undef HAVE_SYS_BITYPES_H
-
-/* Define to 1 if you have the <sys/inotify.h> header file. */
-#undef HAVE_SYS_INOTIFY_H
-
-/* Define to 1 if you have the <sys/inttypes.h> header file. */
-#undef HAVE_SYS_INTTYPES_H
-
-/* Define to 1 if you have the <sys/loadavg.h> header file. */
-#undef HAVE_SYS_LOADAVG_H
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#undef HAVE_SYS_RESOURCE_H
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#undef HAVE_SYS_SELECT_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/soundcard.h> header file. */
-#undef HAVE_SYS_SOUNDCARD_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/systeminfo.h> header file. */
-#undef HAVE_SYS_SYSTEMINFO_H
-
-/* Define to 1 if you have the <sys/timeb.h> header file. */
-#define HAVE_SYS_TIMEB_H 1
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/un.h> header file. */
-#undef HAVE_SYS_UN_H
-
-/* Define to 1 if you have the <sys/utsname.h> header file. */
-#undef HAVE_SYS_UTSNAME_H
-
-/* Define to 1 if you have the <sys/vlimit.h> header file. */
-#undef HAVE_SYS_VLIMIT_H
-
-/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define to 1 if you have the <term.h> header file. */
-#undef HAVE_TERM_H
-
-/* Define to 1 if you have the tiff library (-ltiff). */
-#undef HAVE_TIFF
-
-/* Define to 1 if you have the `timer_settime' function. */
-#undef HAVE_TIMER_SETTIME
-
-/* Define if struct tm has the tm_gmtoff member. */
-#undef HAVE_TM_GMTOFF
-
-/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
-   `HAVE_STRUCT_TM_TM_ZONE' instead. */
-#undef HAVE_TM_ZONE
-
-/* Define to 1 if you have the `touchlock' function. */
-#undef HAVE_TOUCHLOCK
-
-/* Define to 1 if you don't have `tm_zone' but do have the external array
-   `tzname'. */
-#define HAVE_TZNAME 1
-
-/* Define to 1 if you have the `tzset' function. */
-#define HAVE_TZSET 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to 1 if you have the `unsetenv' function. */
-#define HAVE_UNSETENV 1
-
-/* Define to 1 if the system has the type 'unsigned long long int'. */
-#undef HAVE_UNSIGNED_LONG_LONG_INT
-
-/* Define to 1 if you have the <util.h> header file. */
-#undef HAVE_UTIL_H
-
-/* Define to 1 if you have the `utimensat' function. */
-#undef HAVE_UTIMENSAT
-
-/* Define to 1 if you have the `utimes' function. */
-#undef HAVE_UTIMES
-
-/* Define to 1 if you have the <utime.h> header file. */
-#undef HAVE_UTIME_H
-
-/* Define to 1 if you have the <utmp.h> header file. */
-#undef HAVE_UTMP_H
-
-/* Define to 1 if you have the `vfork' function. */
-#undef HAVE_VFORK
-
-/* Define to 1 if you have the <vfork.h> header file. */
-#undef HAVE_VFORK_H
-
-/* Define to 1 to use w32notify. */
-#define HAVE_W32NOTIFY 1
-
-/* Define to 1 if you have the <wchar.h> header file. */
-#undef HAVE_WCHAR_H
-
-/* Define if you have the 'wchar_t' type. */
-#define HAVE_WCHAR_T 1
-
-/* Define if you have a window system. */
-#undef HAVE_WINDOW_SYSTEM
-
-/* Define to 1 if you have the <winsock2.h> header file. */
-#undef HAVE_WINSOCK2_H
-
-/* Define to 1 if `fork' works. */
-#undef HAVE_WORKING_FORK
-
-/* Define to 1 if fstatat (..., 0) works. For example, it does not work in AIX
-   7.1. */
-#undef HAVE_WORKING_FSTATAT_ZERO_FLAG
-
-/* Define if utimes works properly. */
-#undef HAVE_WORKING_UTIMES
-
-/* Define to 1 if `vfork' works. */
-#undef HAVE_WORKING_VFORK
-
-/* Define to 1 if you have the <ws2tcpip.h> header file. */
-#undef HAVE_WS2TCPIP_H
-
-/* Define to 1 if you want to use version 11 of X windows. Otherwise, Emacs
-   expects to use version 10. */
-#undef HAVE_X11
-
-/* Define to 1 if you have the X11R6 or newer version of Xlib. */
-#undef HAVE_X11R6
-
-/* Define if you have usable X11R6-style XIM support. */
-#undef HAVE_X11R6_XIM
-
-/* Define to 1 if you have the X11R6 or newer version of Xt. */
-#undef HAVE_X11XTR6
-
-/* Define to 1 if you have the Xaw3d library (-lXaw3d). */
-#undef HAVE_XAW3D
-
-/* Define to 1 if you have the Xft library. */
-#undef HAVE_XFT
-
-/* Define to 1 if XIM is available */
-#undef HAVE_XIM
-
-/* Define to 1 if you have the Xinerama extension. */
-#undef HAVE_XINERAMA
-
-/* Define to 1 if you have the Xkb extension. */
-#undef HAVE_XKB
-
-/* Define to 1 if you have the Xpm library (-lXpm). */
-#undef HAVE_XPM
-
-/* Define to 1 if you have the XRandr extension. */
-#undef HAVE_XRANDR
-
-/* Define to 1 if you have the `XrmSetDatabase' function. */
-#undef HAVE_XRMSETDATABASE
-
-/* Define to 1 if you have the `XRRGetOutputPrimary' function. */
-#undef HAVE_XRRGETOUTPUTPRIMARY
-
-/* Define to 1 if you have the `XRRGetScreenResourcesCurrent' function. */
-#undef HAVE_XRRGETSCREENRESOURCESCURRENT
-
-/* Define to 1 if you have the `XScreenNumberOfScreen' function. */
-#undef HAVE_XSCREENNUMBEROFSCREEN
-
-/* Define to 1 if you have the `XScreenResourceString' function. */
-#undef HAVE_XSCREENRESOURCESTRING
-
-/* Define if you have usable i18n support. */
-#undef HAVE_X_I18N
-
-/* Define to 1 if you have the SM library (-lSM). */
-#undef HAVE_X_SM
-
-/* Define to 1 if you want to use the X window system. */
-#undef HAVE_X_WINDOWS
-
-/* Define to 1 if the system has the type `_Bool'. */
-#undef HAVE__BOOL
-
-/* Define to 1 if you have the `_ftime' function. */
-#undef HAVE__FTIME
-
-/* Define to 1 if _setjmp and _longjmp work.  */
-#define HAVE__SETJMP 1
-
-/* Define to 1 if you have the `__builtin_unwind_init' function. */
-#undef HAVE___BUILTIN_UNWIND_INIT
-
-/* Define to 1 if you have the `__executable_start' function. */
-#undef HAVE___EXECUTABLE_START
-
-/* Define to 1 if you have the `__fpending' function. */
-#undef HAVE___FPENDING
-
-/* Define to support using a Hesiod database to find the POP server. */
-#undef HESIOD
-
-/* Define if the system is HPUX. */
-#undef HPUX
-
-/* This is substituted when $TERM is "internal". */
-#undef INTERNAL_TERMINAL
-
-/* Define to read input using SIGIO. */
-#undef INTERRUPT_INPUT
-
-/* Define if the system is IRIX. */
-#undef IRIX6_5
-
-/* Returns true if character is any form of separator. */
-#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
-
-/* Returns true if character is a device separator. */
-#define IS_DEVICE_SEP(_c_) ((_c_) == DEVICE_SEP)
-
-/* Returns true if character is a directory separator. */
-#define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
-
-/* Define to support Kerberos-authenticated POP mail retrieval. */
-#undef KERBEROS
-
-/* Define to use Kerberos 5 instead of Kerberos 4. */
-#undef KERBEROS5
-
-/* Define to 1 if localtime caches TZ. */
-#define LOCALTIME_CACHE 1
-
-/* Define to 1 if 'lstat' dereferences a symlink specified with a trailing
-   slash. */
-#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
-
-/* String giving fallback POP mail host. */
-#undef MAILHOST
-
-/* Define to unlink, rather than empty, mail spool after reading. */
-#undef MAIL_UNLINK_SPOOL
-
-/* Define if the mailer uses flock to interlock the mail spool. */
-#undef MAIL_USE_FLOCK
-
-/* Define if the mailer uses lockf to interlock the mail spool. */
-#undef MAIL_USE_LOCKF
-
-/* Define to support MMDF mailboxes in movemail. */
-#undef MAIL_USE_MMDF
-
-/* Define to support POP mail retrieval. */
-#define MAIL_USE_POP 1
-
-/* Define if the system is MS DOS. */
-#undef MSDOS
-
-/* Define if system's imake configuration file defines `NeedWidePrototypes' as
-   `NO'. */
-#undef NARROWPROTO
-
-/* Define if XEditRes should not be used. */
-#undef NO_EDITRES
-
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
-/* Minimum value of NSIG. */
-#undef NSIG_MINIMUM
-
-/* Define to 1 if `NSInteger' is defined. */
-#undef NS_HAVE_NSINTEGER
-
-/* Define to 1 if you are using NS windowing under MacOS X. */
-#undef NS_IMPL_COCOA
-
-/* Define to 1 if you are using NS windowing under GNUstep. */
-#undef NS_IMPL_GNUSTEP
-
-/* Name of the file to open to get a null file, or a data sink. */
-#define NULL_DEVICE "NUL:"
-
-/* Define to 1 if the nlist n_name member is a pointer */
-#undef N_NAME_POINTER
-
-/* Name of package */
-#define PACKAGE "emacs"
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* the number of pending output bytes on stream 'fp' */
-#define PENDING_OUTPUT_N_BYTES  (fp->_ptr - fp->_base)
-
-/* Define to empty to suppress deprecation warnings when building with
-   --enable-gcc-warnings and with libpng versions before 1.5, which lack
-   png_longjmp. */
-#undef PNG_DEPSTRUCT
-
-/* Define if process_send_signal should use VSUSP instead of VSWTCH. */
-#undef PREFER_VSUSP
-
-/* Define to 1 if pthread_sigmask(), when it fails, returns -1 and sets errno.
-   */
-#undef PTHREAD_SIGMASK_FAILS_WITH_ERRNO
-
-/* Define to 1 if pthread_sigmask() may returns 0 and have no effect. */
-#undef PTHREAD_SIGMASK_INEFFECTIVE
-
-/* Define to 1 if pthread_sigmask() unblocks signals incorrectly. */
-#undef PTHREAD_SIGMASK_UNBLOCK_BUG
-
-/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
-   'ptrdiff_t'. */
-#undef PTRDIFF_T_SUFFIX
-
-/* How to iterate over PTYs. */
-#undef PTY_ITERATION
-
-/* How to get the device name of the control end of a PTY, if non-standard. */
-#undef PTY_NAME_SPRINTF
-
-/* How to open a PTY, if non-standard. */
-#undef PTY_OPEN
-
-/* How to get device name of the tty end of a PTY, if non-standard. */
-#undef PTY_TTY_NAME_SPRINTF
-
-/* Define to 1 if readlink fails to recognize a trailing slash. */
-#undef READLINK_TRAILING_SLASH_BUG
-
-/* Define REL_ALLOC if you want to use the relocating allocator for buffer
-   space. */
-#define REL_ALLOC 1
-
-/* Define to 1 if stat needs help when passed a directory name with a trailing
-   slash */
-#undef REPLACE_FUNC_STAT_DIR
-
-/* Define to 1 if stat needs help when passed a file name with a trailing
-   slash */
-#undef REPLACE_FUNC_STAT_FILE
-
-/* Define if emacs.c needs to call run_time_remap; for HPUX. */
-#undef RUN_TIME_REMAP
-
-/* Character that separates PATH elements. */
-#define SEPCHAR ';'
-
-/* How to set up a slave PTY, if needed. */
-#undef SETUP_SLAVE_PTY
-
-/* Make process_send_signal work by "typing" a signal character on the pty. */
-#undef SIGNALS_VIA_CHARACTERS
-
-/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
-   'sig_atomic_t'. */
-#undef SIG_ATOMIC_T_SUFFIX
-
-/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
-   'size_t'. */
-#undef SIZE_T_SUFFIX
-
-/* Define if the system is Solaris. */
-#undef SOLARIS2
-
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at runtime.
-        STACK_DIRECTION > 0 => grows toward higher addresses
-        STACK_DIRECTION < 0 => grows toward lower addresses
-        STACK_DIRECTION = 0 => direction of growth unknown */
-#undef STACK_DIRECTION
-
-/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-#undef STAT_MACROS_BROKEN
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define to 1 on System V Release 4. */
-#undef SVR4
-
-/* Define to use system malloc. */
-#undef SYSTEM_MALLOC
-
-/* The type of system you are compiling for; sets `system-type'. */
-#define SYSTEM_TYPE "windows-nt"
-
-/* Undocumented. */
-#undef TAB3
-
-/* Undocumented. */
-#undef TABDLY
-
-/* Define to 1 if you use terminfo instead of termcap. */
-#undef TERMINFO
-
-/* Define to the header for the built-in window system. */
-#define TERM_HEADER "w32term.h"
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#define TIME_WITH_SYS_TIME 1
-
-/* Some platforms redefine this. */
-#undef TIOCSIGSEND
-
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-#undef TM_IN_SYS_TIME
-
-/* Define to 1 if the type of the st_atim member of a struct stat is struct
-   timespec. */
-#undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
-
-/* Define to 1 for Encore UMAX. */
-#undef UMAX
-
-/* Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h> instead of
-   <sys/cpustats.h>. */
-#undef UMAX4_3
-
-/* Define if the system has Unix98 PTYs. */
-#undef UNIX98_PTYS
-
-/* Define to 1 if FIONREAD is usable. */
-#define USABLE_FIONREAD 1
-
-/* Define to 1 if SIGIO is usable. */
-#undef USABLE_SIGIO
-
-/* How to get a user's full name. */
-#define USER_FULL_NAME pw->pw_gecos
-
-/* Define to nonzero if you want access control list support. */
-#undef USE_ACL
-
-/* Define to 1 if using file notifications. */
-#define USE_FILE_NOTIFY 1
-
-/* Define to 1 if using GTK. */
-#undef USE_GTK
-
-/* Define to 1 if using the Lucid X toolkit. */
-#undef USE_LUCID
-
-/* Define to use mmap to allocate buffer text. */
-#undef USE_MMAP_FOR_BUFFERS
-
-/* Define to 1 if using the Motif X toolkit. */
-#undef USE_MOTIF
-
-/* Enable extensions on AIX 3, Interix.  */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable general extensions on OS X.  */
-#ifndef _DARWIN_C_SOURCE
-# undef _DARWIN_C_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them.  */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris.  */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop.  */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable X/Open extensions if necessary.  HP-UX 11.11 defines
-   mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
-   whether compiling with -Ae or -D_HPUX_SOURCE=1.  */
-#ifndef _XOPEN_SOURCE
-# undef _XOPEN_SOURCE
-#endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
-/* Define to 1 if we should use toolkit scroll bars. */
-#define USE_TOOLKIT_SCROLL_BARS 1
-
-/* Define to 1 if we should use XIM, if it is available. */
-#undef USE_XIM
-
-/* Define to 1 if using an X toolkit. */
-#undef USE_X_TOOLKIT
-
-/* Define if the system is compatible with System III. */
-#undef USG
-
-/* Define if the system is compatible with System V. */
-#undef USG5
-
-/* Define if the system is compatible with System V Release 4. */
-#undef USG5_4
-
-/* Define for USG systems where it works to open a pty's tty in the parent
-   process, then close and reopen it in the child. */
-#undef USG_SUBTTY_WORKS
-
-/* Version number of package */
-#define VERSION "25.0.50"
-
-/* Define to 1 if unsetenv returns void instead of int. */
-#undef VOID_UNSETENV
-
-/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
-   'wchar_t'. */
-#undef WCHAR_T_SUFFIX
-
-/* Use long long for EMACS_INT if available. */
-/* #undef WIDE_EMACS_INT */
-
-/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
-   'wint_t'. */
-#undef WINT_T_SUFFIX
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-#  undef WORDS_BIGENDIAN
-# endif
-#endif
-
-/* Define this to check for malloc buffer overrun. */
-#undef XMALLOC_OVERRUN_CHECK
-
-/* Compensate for a bug in Xos.h on some systems, where it requires time.h. */
-#undef XOS_NEEDS_TIME_H
-
-/* Define to the type of the 6th arg of XRegisterIMInstantiateCallback, either
-   XPointer or XPointer*. */
-#undef XRegisterIMInstantiateCallback_arg6
-
-/* Define if the system is AIX. */
-#undef _AIX
-
-/* Enable large inode numbers on Mac OS X 10.5. */
-#undef _DARWIN_USE_64_BIT_INODE
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define to 1 if Gnulib overrides 'struct stat' on Windows so that struct
-   stat.st_size becomes 64-bit. */
-#undef _GL_WINDOWS_64_BIT_ST_SIZE
-
-/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
-#undef _LARGEFILE_SOURCE
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-/* Define if GNUstep uses ObjC exceptions. */
-#undef _NATIVE_OBJC_EXCEPTIONS
-
-/* Define to 1 to make NetBSD features available. MINIX 3 needs this. */
-#undef _NETBSD_SOURCE
-
-/* The _Noreturn keyword of C11.  */
-#if ! (defined _Noreturn \
-       || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
-# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__))
-#  define _Noreturn __attribute__ ((__noreturn__))
-# elif defined _MSC_VER && 1200 <= _MSC_VER
-#  define _Noreturn __declspec (noreturn)
-# else
-#  define _Noreturn
-# endif
-#endif
-
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
-   this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define to 1 if you need to in order for 'stat' and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Needed for system_process_attributes on Solaris. */
-#undef _STRUCTURED_PROC
-
-/* Define to rpl_ if the getopt replacement functions and variables should be
-   used. */
-#undef __GETOPT_PREFIX
-
-/* Define to compiler's equivalent of C99 restrict keyword in array
-   declarations. Define as empty for no equivalent. */
-#undef __restrict_arr
-
-/* Some platforms that do not use configure define this to include extra
-   configuration information. */
-#define config_opsysfile <ms-w32.h>
-
-/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'.
-   _GL_EXTERN_INLINE is a portable alternative to 'extern inline'.
-   _GL_INLINE_HEADER_BEGIN contains useful stuff to put
-     in an include file, before uses of _GL_INLINE.
-     It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic,
-     when FOO is an inline function in the header; see
-     <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.
-   _GL_INLINE_HEADER_END contains useful stuff to put
-     in the same include file, after uses of _GL_INLINE.
-
-   Suppress extern inline with HP-UX cc, as it appears to be broken; see
-   <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
-
-   Suppress extern inline with Sun C in standards-conformance mode, as it
-   mishandles inline functions that call each other.  E.g., for 'inline void f
-   (void) { } inline void g (void) { f (); }', c99 incorrectly complains
-   'reference to static identifier "f" in extern inline function'.
-   This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
-
-   Suppress the use of extern inline on Apple's platforms, as Libc at least
-   through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g.,
-   <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
-   Perhaps Apple will fix this some day.  */
-#if ((__GNUC__ \
-      ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
-      : (199901L <= __STDC_VERSION__ \
-         && !defined __HP_cc \
-         && !(defined __SUNPRO_C && __STDC__))) \
-     && !defined __APPLE__)
-# define _GL_INLINE inline
-# define _GL_EXTERN_INLINE extern inline
-#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __APPLE__
-# if __GNUC_GNU_INLINE__
-   /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */
-#  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
-# else
-#  define _GL_INLINE extern inline
-# endif
-# define _GL_EXTERN_INLINE extern
-#else
-# define _GL_INLINE static _GL_UNUSED
-# define _GL_EXTERN_INLINE static _GL_UNUSED
-#endif
-
-#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
-# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
-#  define _GL_INLINE_HEADER_CONST_PRAGMA
-# else
-#  define _GL_INLINE_HEADER_CONST_PRAGMA \
-     _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
-# endif
-# define _GL_INLINE_HEADER_BEGIN \
-    _Pragma ("GCC diagnostic push") \
-    _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
-    _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
-    _GL_INLINE_HEADER_CONST_PRAGMA
-# define _GL_INLINE_HEADER_END \
-    _Pragma ("GCC diagnostic pop")
-#else
-# define _GL_INLINE_HEADER_BEGIN
-# define _GL_INLINE_HEADER_END
-#endif
-
-/* A replacement for va_copy, if needed.  */
-#define gl_va_copy(a,b) ((a) = (b))
-
-/* Define to rpl_gmtime if the replacement function should be used. */
-#undef gmtime
-
-/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
-   the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
-   earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
-   __APPLE__ && __MACH__ test for Mac OS X.
-   __APPLE_CC__ tests for the Apple compiler and its version.
-   __STDC_VERSION__ tests for the C99 mode.  */
-#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined 
__cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
-# define __GNUC_STDC_INLINE__ 1
-#endif
-
-/* Define to 1 if the compiler is checking for lint. */
-#undef lint
-
-/* Define to rpl_localtime if the replacement function should be used. */
-#undef localtime
-
-/* Define to a type if <wchar.h> does not define. */
-#undef mbstate_t
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef mode_t
-
-/* Define to the name of the strftime replacement function. */
-#define my_strftime nstrftime
-
-/* Define to the type of st_nlink in struct stat, or a supertype. */
-#define nlink_t short
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
-
-/* Define to the equivalent of the C99 'restrict' keyword, or to
-   nothing if this is not supported.  Do not define if restrict is
-   supported directly.  */
-#undef restrict
-/* Work around a bug in Sun C++: it does not support _Restrict or
-   __restrict__, even though the corresponding Sun C compiler ends up with
-   "#define restrict _Restrict" or "#define restrict __restrict__" in the
-   previous line.  Perhaps some future version of Sun C++ will work with
-   restrict; if so, hopefully it defines __RESTRICT like Sun C does.  */
-#if defined __SUNPRO_CC && !defined __RESTRICT
-# define _Restrict
-# define __restrict__
-#endif
-
-/* type to use in place of socklen_t if not defined */
-#undef socklen_t
-
-/* Define as a signed type of the same size as size_t. */
-#undef ssize_t
-
-/* Define to enable asynchronous subprocesses. */
-#define subprocesses
-
-/* Define to any substitute for sys_siglist. */
-#undef sys_siglist
-
-/* Define as a marker that can be attached to declarations that might not
-    be used.  This helps to reduce warnings, such as from
-    GCC -Wunused-parameter.  */
-#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_UNUSED __attribute__ ((__unused__))
-#else
-# define _GL_UNUSED
-#endif
-/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
-   is a misnomer outside of parameter lists.  */
-#define _UNUSED_PARAMETER_ _GL_UNUSED
-
-/* The __pure__ attribute was added in gcc 2.96.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
-#else
-# define _GL_ATTRIBUTE_PURE /* empty */
-#endif
-
-/* The __const__ attribute was added in gcc 2.95.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
-#else
-# define _GL_ATTRIBUTE_CONST /* empty */
-#endif
-
-
-/* Define as a macro for copying va_list variables. */
-#undef va_copy
-
-/* Define as `fork' if `vfork' does not work. */
-#undef vfork
-
-#include <conf_post.h>
-
-#endif /* EMACS_CONFIG_H */
-
-/*
-Local Variables:
-mode: c
-End:
-*/
diff --git a/nt/configure.bat b/nt/configure.bat
index f6ac8fc..629bcc8 100755
--- a/nt/configure.bat
+++ b/nt/configure.bat
@@ -1,6 +1,6 @@
 @echo off
 rem   ----------------------------------------------------------------------
-rem   Configuration script for MS Windows operating systems
+rem   This was the old configuration script for MS Windows operating systems
 rem   Copyright (C) 1999-2015 Free Software Foundation, Inc.
 
 rem   This file is part of GNU Emacs.
@@ -19,956 +19,8 @@ rem   You should have received a copy of the GNU General 
Public License
 rem   along with GNU Emacs.  If not, see http://www.gnu.org/licenses/.
 
 rem   ----------------------------------------------------------------------
-rem   YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:
-rem
-rem   + MS Windows 95, NT or later
-rem   + either MSVC 2.x or later, or gcc-2.95 or later (with GNU make 3.75
-rem     or later) and the Mingw32 and Windows API headers and libraries.
-rem   + Visual Studio 2005 is not supported at this time.
-rem
-rem For reference, here is a list of which builds of GNU make are known to
-rem work or not, and whether they work in the presence and/or absence of
-rem sh.exe.
-rem
-rem                                       sh exists     no sh
-rem  cygwin b20.1 make (3.75):            fails[1,5]    fails[2,5]
-rem  MSVC compiled gmake 3.77:            okay          okay
-rem  MSVC compiled gmake 3.78.1:          okay          okay
-rem  MSVC compiled gmake 3.79.1:          okay          okay
-rem  mingw32/gcc-2.92.2 make (3.77):      okay          okay[4]
-rem  cygwin compiled gmake 3.77:          fails[1,5]    fails[2,5]
-rem  cygwin compiled gmake 3.78.1:        fails[5]      fails[2,5]
-rem  cygwin compiled gmake 3.79.1:        fails[3,5]    fails[2?,5]
-rem  cygwin compiled make 3.80:           okay[6]       fails?[7]
-rem  cygwin compiled make 3.81:           fails         fails?[7]
-rem  mingw32 compiled make 3.79.1:        okay          okay
-rem  mingw32 compiled make 3.80:          okay          okay?[7]
-rem  mingw32 compiled make 3.81:          okay          okay[8]
-rem
-rem [1] doesn't cope with makefiles with DOS line endings, so must mount
-rem     emacs source with text!=binary.
-rem [2] fails when needs to invoke shell commands; okay invoking gcc etc.
-rem [3] requires LC_MESSAGES support to build; cannot build with early
-rem     versions of cygwin.
-rem [4] may fail on Windows 9X and Windows ME; if so, install Bash.
-rem [5] fails when building leim due to the use of cygwin style paths.
-rem     May work if building emacs without leim.
-rem [6] need to uncomment 3 lines in nt/gmake.defs that invoke `cygpath';
-rem            look for "cygpath" near line 85 of gmake.defs.
-rem [7] not recommended; please report if you try this combination.
-rem [8] tested only on Windows XP.
-rem
 echo ****************************************************************
 echo *** THIS METHOD OF BUILDING EMACS IS NO LONGER SUPPORTED.     **
-echo *** INSTEAD, FOLLOW THE INSTRUCTIONS FROM INSTALL.            **
+echo *** INSTEAD, FOLLOW THE INSTRUCTIONS IN THE FILE INSTALL.     **
+echo *** IN THE SAME DIRECTORY AS THIS BATCH FILE.                 **
 echo ****************************************************************
-:confirm_continue
-set /p answer=Continue running this script at your own risks ? (Y/N)
-if x%answer% == xy (goto confirm_continue_y)
-if x%answer% == xY (goto confirm_continue_y)
-if x%answer% == xn (goto end)
-if x%answer% == xN (goto end)
-echo Please answer by Y or N
-goto confirm_continue
-
-:confirm_continue_y
-if exist config.log del config.log
-
-rem ----------------------------------------------------------------------
-rem   See if the environment is large enough.  We need 43 (?) bytes.
-set $foo$=123456789_123456789_123456789_123456789_123
-if not "%$foo$%" == "123456789_123456789_123456789_123456789_123" goto SmallEnv
-set $foo$=
-
-rem ----------------------------------------------------------------------
-rem   Make sure we are running in the nt subdir
-if exist configure.bat goto start
-echo You must run configure from the nt subdirectory.
-goto end
-
-:start
-rem ----------------------------------------------------------------------
-rem   Attempt to enable command extensions.  Set use_extensions to 1 if
-rem   they are available and 0 if they are not available.
-set use_extensions=1
-setlocal ENABLEEXTENSIONS
-if "%CMDEXTVERSION%" == "" set use_extensions=0
-if "%use_extensions%" == "1" goto afterext
-
-echo. Command extensions are not available.  Using parameters that include the 
=
-echo. character by enclosing them in quotes will not be supported.
-
-:afterext
-
-rem ----------------------------------------------------------------------
-rem   Default settings.
-set prefix=
-set nodebug=N
-set noopt=N
-set enablechecking=N
-set profile=N
-set nocygwin=N
-set COMPILER=
-set usercflags=
-set escusercflags=
-set docflags=
-set userldflags=
-set escuserldflags=
-set extrauserlibs=
-set doldflags=
-set doextralibs=
-set sep1=
-set sep2=
-set sep3=
-set sep4=
-set distfiles=
-
-rem ----------------------------------------------------------------------
-rem   Handle arguments.
-:again
-if "%1" == "-h" goto usage
-if "%1" == "--help" goto usage
-if "%1" == "--prefix" goto setprefix
-if "%1" == "--with-gcc" goto withgcc
-if "%1" == "--with-msvc" goto withmsvc
-if "%1" == "--no-debug" goto nodebug
-if "%1" == "--no-opt" goto noopt
-if "%1" == "--enable-checking" goto enablechecking
-if "%1" == "--profile" goto profile
-if "%1" == "--no-cygwin" goto nocygwin
-if "%1" == "--cflags" goto usercflags
-if "%1" == "--ldflags" goto userldflags
-if "%1" == "--lib" goto extrauserlibs
-if "%1" == "--without-png" goto withoutpng
-if "%1" == "--without-jpeg" goto withoutjpeg
-if "%1" == "--without-gif" goto withoutgif
-if "%1" == "--without-tiff" goto withouttiff
-if "%1" == "--without-gnutls" goto withoutgnutls
-if "%1" == "--without-libxml2" goto withoutlibxml2
-if "%1" == "--without-xpm" goto withoutxpm
-if "%1" == "--with-svg" goto withsvg
-if "%1" == "--distfiles" goto distfiles
-if "%1" == "" goto checkutils
-
-:usage
-echo Usage: configure [options]
-echo Options:
-echo.   --prefix PREFIX         install Emacs in directory PREFIX
-echo.   --with-gcc              use GCC to compile Emacs
-echo.   --with-msvc             use MSVC to compile Emacs
-echo.   --no-debug              exclude debug info from executables
-echo.   --no-opt                disable optimization
-echo.   --enable-checking       enable additional run-time checks
-echo.   --profile               enable profiling
-echo.   --no-cygwin             use -mno-cygwin option with GCC
-echo.   --cflags FLAG           pass FLAG to compiler
-echo.   --ldflags FLAG          pass FLAG to compiler when linking
-echo.   --lib LIB               link to extra library LIB
-echo.   --without-png           do not use PNG library even if it is installed
-echo.   --without-jpeg          do not use JPEG library even if it is installed
-echo.   --without-gif           do not use GIF library even if it is installed
-echo.   --without-tiff          do not use TIFF library even if it is installed
-echo.   --without-xpm           do not use XPM library even if it is installed
-echo.   --without-gnutls        do not use GnuTLS library even if it is 
installed
-echo.   --without-libxml2       do not use libxml2 library even if it is 
installed
-echo.   --with-svg              use the RSVG library (experimental)
-echo.   --distfiles             path to files for make dist, e.g. libXpm.dll
-if "%use_extensions%" == "0" goto end
-echo.
-echo. The cflags and ldflags arguments support parameters that include the =
-echo. character.  However, since the = character is normally treated as a
-echo. separator character you will need to enclose any parameter that includes
-echo. the = character in quotes.  For example, to include
-echo. -DSITELOAD_PURESIZE_EXTRA=100000 as one of the cflags you would run
-echo. configure.bat as follows:
-echo. configure.bat --cflags "-DSITELOAD_PURESIZE_EXTRA=100000"
-echo.
-echo. Note that this capability of processing parameters that include the =
-echo. character depends on command extensions.  This batch file attempts to
-echo. enable command extensions.  If command extensions cannot be enabled, a
-echo. warning message will be displayed.
-echo.
-echo. IMPORTANT: This method of building Emacs for MS-Windows is deprecated,
-echo. and could be removed in a future version of Emacs.  The preferred way
-echo  to build Emacs for MS-Windows from now on is using the MSYS environment
-echo. and MinGW development tools.  Please see nt/INSTALL for details.
-goto end
-
-rem ----------------------------------------------------------------------
-
-:setprefix
-shift
-set prefix=%1
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:withgcc
-set COMPILER=gcc
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:withmsvc
-set COMPILER=cl
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:nodebug
-set nodebug=Y
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:noopt
-set noopt=Y
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:enablechecking
-set enablechecking=Y
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:profile
-set profile=Y
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:nocygwin
-set nocygwin=Y
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:usercflags
-if "%use_extensions%" == "1" goto ucflagex
-goto ucflagne
-
-:ucflagex
-shift
-set usercflags=%usercflags%%sep1%%~1
-set escusercflags=%usercflags:"=\"%
-set sep1= %nothing%
-shift
-goto again
-
-:ucflagne
-shift
-set usercflags=%usercflags%%sep1%%1
-set escusercflags=%usercflags%
-set sep1= %nothing%
-shift
-goto again
-
-:extrauserlibs
-shift
-echo. extrauserlibs: %extrauserlibs%
-set extrauserlibs=%extrauserlibs%%sep4%%1
-set sep4= %nothing%
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:userldflags
-if "%use_extensions%" == "1" goto ulflagex
-goto ulflagne
-
-:ulflagex
-shift
-set userldflags=%userldflags%%sep2%%~1
-set escuserldflags=%userldflags:"=\"%
-set sep2= %nothing%
-shift
-goto again
-
-:ulflagne
-shift
-set userldflags=%userldflags%%sep2%%1
-set escuserldflags=%userldflags%
-set sep2= %nothing%
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:withoutpng
-set pngsupport=N
-set HAVE_PNG=
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:withoutjpeg
-set jpegsupport=N
-set HAVE_JPEG=
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:withoutgif
-set gifsupport=N
-set HAVE_GIF=
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:withoutgnutls
-set tlssupport=N
-set HAVE_GNUTLS=
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:withoutlibxml2
-set libxml2support=N
-set HAVE_LIBXML2=
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:withouttiff
-set tiffsupport=N
-set HAVE_TIFF=
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-
-:withoutxpm
-set xpmsupport=N
-set HAVE_XPM=
-shift
-goto again
-
-:withsvg
-shift
-set svgsupport=Y
-goto again
-
-rem ----------------------------------------------------------------------
-
-:distfiles
-set HAVE_DISTFILES=1
-shift
-set distfiles=%distfiles%%sep3%%1
-set sep3= %nothing%
-shift
-goto again
-
-rem ----------------------------------------------------------------------
-rem    Check that necessary utilities (cp and rm) are present.
-
-:checkutils
-echo Checking for 'cp'...
-cp configure.bat junk.bat
-if not exist junk.bat goto needcp
-echo Checking for 'rm'...
-rm junk.bat
-if exist junk.bat goto needrm
-goto checkcompiler
-
-:needcp
-echo You need 'cp' (the Unix file copy program) to build Emacs.
-goto end
-
-:needrm
-del junk.bat
-echo You need 'rm' (the Unix file delete program) to build Emacs.
-goto end
-
-rem ----------------------------------------------------------------------
-rem   Auto-detect compiler if not specified, and validate GCC if chosen.
-
-:checkcompiler
-if (%COMPILER%)==(cl) goto compilercheckdone
-if (%COMPILER%)==(gcc) goto checkgcc
-
-echo Checking whether 'gcc' is available...
-echo main(){} >junk.c
-gcc -c junk.c
-if exist junk.o goto checkgcc
-
-echo Checking whether 'cl' is available...
-cl -nologo -c junk.c
-if exist junk.obj goto clOK
-goto nocompiler
-
-:checkgcc
-if exist junk.o del junk.o
-Rem WARNING -- COMMAND.COM on some systems only looks at the first
-Rem            8 characters of a label.  So do NOT be tempted to change
-Rem            chkapi* into something fancier like checkw32api
-Rem You HAVE been warned!
-if (%nocygwin%) == (Y) goto chkapiN
-echo Checking whether gcc requires '-mno-cygwin'...
-echo #include "cygwin/version.h" >junk.c
-echo main(){} >>junk.c
-echo gcc -c junk.c >>config.log
-gcc -c junk.c >>config.log 2>&1
-if not exist junk.o goto chkapi
-echo gcc -mno-cygwin -c junk.c >>config.log
-gcc -mno-cygwin -c junk.c >>config.log 2>&1
-if exist junk.o set nocygwin=Y
-
-:chkapi
-echo The failed program was: >>config.log
-type junk.c >>config.log
-
-:chkapiN
-rm -f junk.c junk.o
-rem ----------------------------------------------------------------------
-rem   Older versions of the Windows API headers either don't have any of
-rem   the IMAGE_xxx definitions (the headers that come with Cygwin b20.1
-rem   are like this), or have a typo in the definition of
-rem   IMAGE_FIRST_SECTION (the headers with gcc/mingw32 2.95 have this
-rem   problem).  The gcc/mingw32 2.95.2 headers are okay, as are distros
-rem   of w32api-xxx.zip from Anders Norlander since 1999-11-18 at least.
-rem   Beginning with Emacs 23, we need usp10.h.
-rem
-echo Checking whether Windows API headers are too old...
-echo #include "windows.h" >junk.c
-echo #include "usp10.h" >>junk.c
-echo void test(PIMAGE_NT_HEADERS pHeader) >>junk.c
-echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c
-if (%nocygwin%) == (Y) goto chkapi1
-set cf=%usercflags%
-goto chkapi2
-
-:chkapi1
-set cf=%usercflags% -mno-cygwin
-
-:chkapi2
-echo on
-gcc %cf% -c junk.c
address@hidden off
address@hidden gcc %cf% -c junk.c >>config.log
-gcc %cf% -c junk.c >>config.log 2>&1
-set cf=
-if exist junk.o goto chkuser
-echo The failed program was: >>config.log
-type junk.c >>config.log
-goto nocompiler
-
-:chkuser
-rm -f junk.o
-echo int main (int argc, char *argv[]) {>junk.c
-echo char *usercflags = "%escusercflags%";>>junk.c
-echo }>>junk.c
-echo gcc -Werror -c junk.c >>config.log
-gcc -Werror -c junk.c >>config.log 2>&1
-if exist junk.o goto gccOk
-echo.
-echo Error in --cflags argument: %usercflags%
-echo Backslashes and quotes cannot be used with --cflags.  Please use forward
-echo slashes for filenames and paths (e.g. when passing directories to -I).
-rm -f junk.c
-goto end
-
-:nocompiler
-echo.
-echo Configure failed.
-echo To configure Emacs for Windows, you need to have either
-echo gcc-2.95 or later with Mingw32 and the Windows API headers,
-echo or MSVC 2.x or later.
-del junk.c
-goto end
-
-:gccOk
-set COMPILER=gcc
-echo Using 'gcc'
-rm -f junk.c junk.o
-Rem It is not clear what GCC version began supporting -mtune
-Rem and pentium4 on x86, so check this explicitly.
-echo main(){} >junk.c
-echo gcc -c -O2 -mtune=pentium4 junk.c >>config.log
-gcc -c -O2 -mtune=pentium4 junk.c >>config.log 2>&1
-if not errorlevel 1 goto gccMtuneOk
-echo The failed program was: >>config.log
-type junk.c >>config.log
-set mf=-mcpu=i686
-rm -f junk.c junk.o
-goto gccdebug
-
-:gccMtuneOk
-echo GCC supports -mtune=pentium4 >>config.log
-set mf=-mtune=pentium4
-rm -f junk.c junk.o
-
-:gccdebug
-rem Check for DWARF-2 debug info support, else default to stabs
-echo main(){} >junk.c
-echo gcc -c -gdwarf-2 -g3 junk.c >>config.log
-gcc -c -gdwarf-2 -g3 junk.c >>config.log 2>&1
-if not errorlevel 1 goto gccdwarf
-echo The failed program was: >>config.log
-type junk.c >>config.log
-set dbginfo=-gstabs+
-rm -f junk.c junk.o
-goto compilercheckdone
-
-:gccdwarf
-echo GCC supports DWARF-2 >>config.log
-set dbginfo=-gdwarf-2 -g3
-rm -f junk.c junk.o
-goto compilercheckdone
-
-:clOk
-set COMPILER=cl
-rm -f junk.c junk.obj
-echo Using 'MSVC'
-
-:compilercheckdone
-
-rem ----------------------------------------------------------------------
-rem   Check for external image libraries. Since they are loaded
-rem   dynamically, the libraries themselves do not need to be present
-rem   at compile time, but the header files are required.
-
-set mingwflag=
-
-if (%nocygwin%) == (N) goto flagsOK
-set mingwflag=-mno-cygwin
-
-:flagsOK
-
-if (%pngsupport%) == (N) goto pngDone
-
-echo Checking for libpng...
-echo #include "png.h" >junk.c
-echo main (){} >>junk.c
-rem   -o option is ignored with cl, but allows result to be consistent.
-echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
-%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 
2>>config.log
-if exist junk.obj goto havePng
-
-echo ...png.h not found, building without PNG support.
-echo The failed program was: >>config.log
-type junk.c >>config.log
-set HAVE_PNG=
-goto :pngDone
-
-:havePng
-echo ...PNG header available, building with PNG support.
-set HAVE_PNG=1
-
-:pngDone
-rm -f junk.c junk.obj
-
-if (%tlssupport%) == (N) goto tlsDone
-
-rem this is a copy of the PNG detection
-echo Checking for libgnutls...
-echo #include "gnutls/gnutls.h" >junk.c
-echo main (){} >>junk.c
-rem   -o option is ignored with cl, but allows result to be consistent.
-echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
-%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 
2>>config.log
-if exist junk.obj goto haveTls
-
-echo ...gnutls.h not found, building without TLS support.
-echo The failed program was: >>config.log
-type junk.c >>config.log
-set HAVE_GNUTLS=
-goto :tlsDone
-
-:haveTls
-echo ...GnuTLS header available, building with GnuTLS support.
-set HAVE_GNUTLS=1
-
-:tlsDone
-rm -f junk.c junk.obj
-
-if (%libxml2support%) == (N) goto xml2Done
-
-echo Checking for libxml2....
-echo #include "libxml/HTMLparser.h" >junk.c
-echo main(){} >>junk.c
-echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
-%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 
2>>config.log
-if exist junk.obj goto havelibxml2
-
-echo ...libxml/HTMLparser.h not found, building without libxml2 support
-echo The failed program was: >>config.log
-type junk.c >>config.log
-set HAVE_LIBXML2=
-goto xml2Done
-
-:havelibxml2
-echo ...libxml2 header available, building with libxml2 support
-set HAVE_LIBXML2=1
-
-:xml2Done
-rm -f junk.c junk.obj
-
-if (%jpegsupport%) == (N) goto jpegDone
-
-echo Checking for jpeg-6b...
-echo #include "jconfig.h" >junk.c
-echo main (){} >>junk.c
-rem   -o option is ignored with cl, but allows result to be consistent.
-echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
-%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 
2>>config.log
-if exist junk.obj goto haveJpeg
-
-echo ...jconfig.h not found, building without JPEG support.
-echo The failed program was: >>config.log
-type junk.c >>config.log
-set HAVE_JPEG=
-goto :jpegDone
-
-:haveJpeg
-echo ...JPEG header available, building with JPEG support.
-set HAVE_JPEG=1
-
-:jpegDone
-rm -f junk.c junk.obj
-
-if (%gifsupport%) == (N) goto gifDone
-
-echo Checking for libgif...
-rem giflib-5.0.0 needs size_t defined before gif_lib.h is included
-rem redirection characters need to be protected from the shell
-echo #include ^<stddef.h^> >junk.c
-echo #include "gif_lib.h" >>junk.c
-echo main (){} >>junk.c
-rem   -o option is ignored with cl, but allows result to be consistent.
-echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
-%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 
2>>config.log
-if exist junk.obj goto haveGif
-
-echo ...gif_lib.h not found, building without GIF support.
-echo The failed program was: >>config.log
-type junk.c >>config.log
-set HAVE_GIF=
-goto :gifDone
-
-:haveGif
-echo ...GIF header available, building with GIF support.
-set HAVE_GIF=1
-
-:gifDone
-rm -f junk.c junk.obj
-
-if (%tiffsupport%) == (N) goto tiffDone
-
-echo Checking for tiff...
-echo #include "tiffio.h" >junk.c
-echo main (){} >>junk.c
-rem   -o option is ignored with cl, but allows result to be consistent.
-echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
-%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 
2>>config.log
-if exist junk.obj goto haveTiff
-
-echo ...tiffio.h not found, building without TIFF support.
-echo The failed program was: >>config.log
-type junk.c >>config.log
-set HAVE_TIFF=
-goto :tiffDone
-
-:haveTiff
-echo ...TIFF header available, building with TIFF support.
-set HAVE_TIFF=1
-
-:tiffDone
-rm -f junk.c junk.obj
-
-if (%xpmsupport%) == (N) goto xpmDone
-
-echo Checking for libXpm...
-echo #define FOR_MSW 1 >junk.c
-echo #include "X11/xpm.h" >>junk.c
-echo main (){} >>junk.c
-rem   -o option is ignored with cl, but allows result to be consistent.
-echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
-%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 
2>>config.log
-if exist junk.obj goto haveXpm
-
-echo ...X11/xpm.h not found, building without XPM support.
-echo The failed program was: >>config.log
-type junk.c >>config.log
-set HAVE_XPM=
-goto :xpmDone
-
-:haveXpm
-echo ...XPM header available, building with XPM support.
-set HAVE_XPM=1
-
-:xpmDone
-rm -f junk.c junk.obj
-
-if not (%svgsupport%) == (Y) goto :svgDone
-echo Checking for librsvg...
-echo #include "librsvg/rsvg.h" >junk.c
-echo main (){} >>junk.c
-rem   -o option is ignored with cl, but allows result to be consistent.
-echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
-%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 
2>>config.log
-if exist junk.obj goto haveSvg
-
-echo ...librsvg/rsvg.h or dependencies not found, building without SVG support.
-echo The failed program was: >>config.log
-type junk.c >>config.log
-set HAVE_RSVG=
-goto :svgDone
-
-:haveSvg
-echo ...librsvg header available, building with SVG support (EXPERIMENTAL).
-set HAVE_RSVG=1
-
-:svgDone
-rm -f junk.c junk.obj junk.err junk.out
-
-rem Any distfiles provided for building distribution? If no, we're done.
-if "(%HAVE_DISTFILES%)"=="()" goto :distFilesDone
-
-rem Any arguments to --distfiles specified? If no, we're done.
-if not "%distfiles%"=="" goto :checkDistFiles
-set distFilesOk=0
-echo No arguments specified for option --distfiles!
-goto distfilesDone
-
-:checkDistFiles
-echo Checking for distfiles...
-rem Check if all specified distfiles exist
-set fileNotFound=
-for %%d in (%distfiles%) do if not exist %%d set fileNotFound=%%d
-if not "%fileNotFound%"=="" goto distFilesNotFound
-
-set distFilesOK=1
-echo ...all distfiles found.
-goto :distFilesDone
-
-:distFilesNotFound
-set distFilesOk=0
-echo ...%fileNotFound% not found.
-set distfiles=
-goto :distfilesDone
-
-:distFilesDone
-set fileNotFound=
-
-rem ----------------------------------------------------------------------
-
-:genmakefiles
-echo Generating makefiles
-if %COMPILER% == gcc set MAKECMD=gmake
-if %COMPILER% == cl set MAKECMD=nmake
-
-rem   Pass on chosen settings to makefiles.
-rem
-rem   The weird place we put the redirection is to make sure no extra
-rem   whitespace winds up at the end of the Make variables, since some
-rem   variables, e.g. INSTALL_DIR, cannot stand that.  Yes, echo will
-rem   write the blanks between the end of command arguments and the
-rem   redirection symbol to the file.  OTOH, we cannot put the
-rem   redirection immediately after the last character of the command,
-rem   because environment variable expansion can yield a digit there,
-rem   which will then be misinterpreted as the file descriptor to
-rem   redirect...
-echo # Start of settings from configure.bat >config.settings
->>config.settings echo COMPILER=%COMPILER%
-if not "(%mf%)" == "()" >>config.settings echo MCPU_FLAG=%mf%
-if not "(%dbginfo%)" == "()" >>config.settings echo DEBUG_INFO=%dbginfo%
-if (%nodebug%) == (Y) >>config.settings echo NODEBUG=1
-if (%noopt%) == (Y) >>config.settings echo NOOPT=1
-if (%profile%) == (Y) >>config.settings echo PROFILE=1
-if (%nocygwin%) == (Y) >>config.settings echo NOCYGWIN=1
-if not "(%prefix%)" == "()" >>config.settings echo INSTALL_DIR=%prefix%
-if not "(%distfiles%)" == "()" >>config.settings echo DIST_FILES=%distfiles%
-rem We go thru docflags because usercflags could be "-DFOO=bar" -something
-rem and the if command cannot cope with this
-for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y
-if (%docflags%)==(Y) >>config.settings echo USER_CFLAGS=%usercflags%
-if (%docflags%)==(Y) >>config.settings echo ESC_USER_CFLAGS=%escusercflags%
-for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y
-if (%doldflags%)==(Y) >>config.settings echo USER_LDFLAGS=%userldflags%
-for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y
-if (%doextralibs%)==(Y) >>config.settings echo USER_LIBS=%extrauserlibs%
-echo # End of settings from configure.bat>>config.settings
-echo. >>config.settings
-
-copy config.nt config.tmp
-echo. >>config.tmp
-echo /* Start of settings from configure.bat.  */ >>config.tmp
-rem   We write USER_CFLAGS and USER_LDFLAGS starting with a space to simplify
-rem   processing of compiler options in w32.c:get_emacs_configuration_options
-if (%docflags%) == (Y) echo #define USER_CFLAGS " %escusercflags%" >>config.tmp
-if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %escuserldflags%" 
>>config.tmp
-if (%profile%) == (Y) echo #define PROFILING 1 >>config.tmp
-if (%enablechecking%) == (Y) echo #define ENABLE_CHECKING 1 >>config.tmp
-if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp
-if not "(%HAVE_GNUTLS%)" == "()" echo #define HAVE_GNUTLS 1 >>config.tmp
-if not "(%HAVE_LIBXML2%)" == "()" echo #define HAVE_LIBXML2 1 >>config.tmp
-if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp
-if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>config.tmp
-if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>config.tmp
-if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>config.tmp
-if "(%HAVE_RSVG%)" == "(1)" echo #define HAVE_RSVG 1 >>config.tmp
-
-echo /* End of settings from configure.bat.  */ >>config.tmp
-
-Rem See if fc.exe returns a meaningful exit status.  If it does, we
-Rem might as well avoid unnecessary overwriting of config.h and epaths.h,
-Rem since this forces recompilation of every source file.
-if exist foo.bar del foo.bar
-fc /b foo.bar foo.bar >nul 2>&1
-if not errorlevel 2 goto doCopy
-fc /b config.tmp ..\src\config.h >nul 2>&1
-if errorlevel 1 goto doCopy
-fc /b paths.h ..\src\epaths.h >nul 2>&1
-if not errorlevel 1 goto dontCopy
-
-:doCopy
-copy config.tmp ..\src\config.h
-copy paths.h ..\src\epaths.h
-
-:dontCopy
-if exist config.tmp del config.tmp
-copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile
-if exist ..\admin\unidata copy /b 
config.settings+%MAKECMD%.defs+..\admin\unidata\makefile.w32-in 
..\admin\unidata\makefile
-copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in 
..\lib-src\makefile
-copy /b config.settings+%MAKECMD%.defs+..\lib\makefile.w32-in ..\lib\makefile
-copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile
-copy /b config.settings+%MAKECMD%.defs+..\doc\emacs\makefile.w32-in 
..\doc\emacs\makefile
-copy /b config.settings+%MAKECMD%.defs+..\doc\misc\makefile.w32-in 
..\doc\misc\makefile
-copy /b config.settings+%MAKECMD%.defs+..\doc\lispref\makefile.w32-in 
..\doc\lispref\makefile
-copy /b config.settings+%MAKECMD%.defs+..\doc\lispintro\makefile.w32-in 
..\doc\lispintro\makefile
-if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile
-copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile
-rem   Use the default (no-op) Makefile.in if the nt version is not present.
-if exist ..\leim\makefile.w32-in copy /b 
config.settings+%MAKECMD%.defs+..\leim\makefile.w32-in ..\leim\makefile
-if not exist ..\leim\makefile.w32-in copy /b 
config.settings+%MAKECMD%.defs+..\leim\Makefile.in ..\leim\makefile
-del config.settings
-
-Rem Some people use WinZip which doesn't create empty directories!
-if not exist ..\site-lisp\nul mkdir ..\site-lisp\
-Rem Update subdirs.el only if it is different or fc.exe doesn't work.
-if exist foo.bar del foo.bar
-fc /b foo.bar foo.bar >nul 2>&1
-if not errorlevel 2 goto doUpdateSubdirs
-fc /b subdirs.el ..\site-lisp\subdirs.el >nul 2>&1
-if not errorlevel 1 goto dontUpdateSubdirs
-
-:doUpdateSubdirs
-if exist ..\site-lisp\subdirs.el del ..\site-lisp\subdirs.el
-copy subdirs.el ..\site-lisp\subdirs.el
-
-:dontUpdateSubdirs
-echo.
-
-rem check that we have all the libraries we need.
-set libsOK=1
-
-if not "(%HAVE_XPM%)" == "()" goto checkpng
-if (%xpmsupport%) == (N) goto checkpng
- set libsOK=0
- echo XPM support is missing. It is required for color icons in the toolbar.
- echo   Install libXpm development files or use --without-xpm
-
-:checkpng
-if not "(%HAVE_PNG%)" == "()" goto checkjpeg
-if (%pngsupport%) == (N) goto checkjpeg
- set libsOK=0
- echo PNG support is missing.
- echo   Install libpng development files or use --without-png
-
-:checkjpeg
-if not "(%HAVE_JPEG%)" == "()" goto checktiff
-if (%jpegsupport%) == (N) goto checktiff
- set libsOK=0
- echo JPEG support is missing.
- echo   Install jpeg development files or use --without-jpeg
-
-:checktiff
-if not "(%HAVE_TIFF%)" == "()" goto checkgif
-if (%tiffsupport%) == (N) goto checkgif
- set libsOK=0
- echo TIFF support is missing.
- echo   Install libtiff development files or use --without-tiff
-
-:checkgif
-if not "(%HAVE_GIF%)" == "()" goto checkdistfiles
-if (%gifsupport%) == (N) goto checkdistfiles
- set libsOK=0
- echo GIF support is missing.
- echo   Install giflib or libungif development files or use --without-gif
-
-:checkdistfiles
-if "(%HAVE_DISTFILES%)" == "()" goto donelibchecks
-if (%distFilesOk%) == (1) goto donelibchecks
-echo.
-echo Files specified with option --distfiles could not be found.
-echo   Fix these issues before running make dist
-
-:donelibchecks
-if (%libsOK%) == (1) goto success
-echo.
-echo Important libraries are missing. Fix these issues before running make.
-goto end
-
-:success
-echo Emacs successfully configured.
-echo Emacs successfully configured. >>config.log
-if (%MAKECMD%) == (gmake) set MAKECMD=make
-echo Run `%MAKECMD%' to build, then run `%MAKECMD% install' to install.
-goto end
-
-:SmallEnv
-echo Your environment size is too small.  Please enlarge it and rerun 
configure.
-echo For example, type "command.com /e:2048" to have 2048 bytes available.
-set $foo$=
-
-:end
-set prefix=
-set nodebug=
-set noopt=
-set enablechecking=
-set profile=
-set nocygwin=
-set COMPILER=
-set MAKECMD=
-set usercflags=
-set docflags=
-set userldflags=
-set doldflags=
-set mingwflag=
-set mf=
-set distfiles=
-set HAVE_DISTFILES=
-set distFilesOk=
-set pngsupport=
-set tlssupport=
-set libxml2support=
-set jpegsupport=
-set gifsupport=
-set tiffsupport=
-set xpmsupport=
-set svgsupport=
-set libsOK=
-set HAVE_GIF=
-set HAVE_JPEG=
-set HAVE_PNG=
-set HAVE_TIFF=
-set HAVE_XPM=
-set dbginfo=
-endlocal
-set use_extensions=
diff --git a/nt/emacs-src.tags b/nt/emacs-src.tags
deleted file mode 100644
index 8c18713..0000000
--- a/nt/emacs-src.tags
+++ /dev/null
@@ -1,6 +0,0 @@
-  This file defines the regular expressions for etags to look for
-  in the src directory.  It is used by the w32 build to work around
-  the annoyances of quoting command-line arguments with various
-  w32 shell.
-
-/[     ]*DEFVAR_[A-Z_  (]+"\([^"]+\)"/
diff --git a/nt/envadd.bat b/nt/envadd.bat
deleted file mode 100644
index 21f0f4b..0000000
--- a/nt/envadd.bat
+++ /dev/null
@@ -1,43 +0,0 @@
-rem  Hack to change/add environment variables in the makefiles for the
-rem  Windows platform.
-
-rem Copyright (C) 2003-2015 Free Software Foundation, Inc.
-
-rem  This file is part of GNU Emacs.
-
-rem  GNU Emacs is free software: you can redistribute it and/or modify
-rem  it under the terms of the GNU General Public License as published by
-rem  the Free Software Foundation, either version 3 of the License, or
-rem  (at your option) any later version.
-
-rem  GNU Emacs is distributed in the hope that it will be useful,
-rem  but WITHOUT ANY WARRANTY; without even the implied warranty of
-rem  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-rem  GNU General Public License for more details.
-
-rem  You should have received a copy of the GNU General Public License
-rem  along with GNU Emacs.  If not, see http://www.gnu.org/licenses/.
-
-
-rem  Usage:
-rem    envadd "ENV1=VAL1" "ENV2=VAL2" ... /C <command line>
-rem
-rem  The "/C" switch marks the end of environment variables, and the
-rem  beginning of the command line.
-rem
-rem  By Peter 'Luna' Runestig <address@hidden> 2003
-
-:Loop
-if .%1% == ./C goto EndLoop
-rem just to avoid an endless loop:
-if .%1% == . goto EndLoop
-set %1
-shift
-goto Loop
-:EndLoop
-
-rem Eat the "/C"
-shift
-rem Now, run the command line
-%1 %2 %3 %4 %5 %6 %7 %8 %9
-
diff --git a/nt/gmake.defs b/nt/gmake.defs
deleted file mode 100644
index 90a3709..0000000
--- a/nt/gmake.defs
+++ /dev/null
@@ -1,333 +0,0 @@
-#  -*- Makefile -*- definition file for building GNU Emacs on Windows NT.
-# Copyright (C) 2000-2015 Free Software Foundation, Inc.
-
-# This file is part of GNU Emacs.
-
-# GNU Emacs is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# GNU Emacs is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-# Ensure 'all' is the default target
-all:
-
-# NOTES
-#
-# I tried to force gmake to use the native shell for simplicity, by
-# setting SHELL as below, but this didn't work reliably because of
-# various case sensitivity niggles.  Specifically, COMSPEC (which is in
-# fact usually spelled ComSpec on NT, to make life difficult) typically
-# references "cmd.exe" (on NT) when the file is actually called
-# "CMD.EXE" on disk for hysterical raisons.  As a result, GNU make
-# thinks it doesn't exist (unless compiled with a switch to ignore
-# case), and so doesn't change which shell it will invoke to execute
-# commands.
-#
-# It would be possible, though very tedious using just gmake facilities,
-# to convert the COMSPEC value to uppercase to solve this problem, but
-# it isn't worth it.  That is partly because, even when using the native
-# shell, gmake tends to not be happy with backslashes in command
-# strings.  The obvious solution is to use forward slashes as much as
-# possible, which can be made to work most of the time (putting
-# filenames in quotes often helps), but there are still some internal
-# cmd.exe commands like `del' and `copy' that won't work with them.
-# Although it is possible to convert slashes to backslashes when
-# necessary, gmake requires explicitly calling its subst function, which
-# nmake does not understand).  For this reason, it is simplest to
-# mandate that rm and cp be available, so we can use Unix-format file
-# names everywhere.  (Fortunately both MS and GNU make, and the
-# respective compilers, are happy with Unix-format names.)
-#
-# Since we cannot easily force the choice of a particular shell, we must
-# make the effort to cope with whichever shell is being used.
-# Fortunately, the only command we need to use that is shell specific is
-# the testing of a file's existence for the purpose of working out when
-# we are copying files to their original location.  That particular
-# requirement is abstracted easily enough.
-#
-# The only other problem area was the change of directory when running
-# temacs to dump emacs.exe (where gmake doesn't support cd foo in any
-# useful way), but that has been resolved by modifying the Windows
-# unexec function slightly to not require the directory change while
-# still allowing objects and binaries to be in subdirectories.
-
-# This doesn't work.
-#SHELL:=$(COMSPEC)
-
-# Determine whether make is using sh or cmd/command as shell; cmd.exe
-# will output "ECHO is on" when echo is given by itself, while sh will
-# not produce any output.
-sh_output := $(shell echo)
-ifeq "$(findstring ECHO, $(sh_output))" "ECHO"
-THE_SHELL = $(COMSPEC)$(ComSpec)
-SHELLTYPE=CMD
-SWITCHCHAR=/
-else
-USING_SH = 1
-THE_SHELL = $(SHELL)
-SHELLTYPE=SH
-# MSYS needs to double the slash in cmd-style switches to avoid
-# interpreting /x as a Posix style file name reference
-ifneq ($(MSYSTEM),)
-SWITCHCHAR=//
-else
-SWITCHCHAR=/
-endif
-endif
-
-MAKETYPE=gmake
-
-# The following "ifeq" does not appear to DTRT, and therefore breaks
-# the build on mingw32. Also the -m option does not exist in many
-# (reasonably recent even) versions of Cygwin. These issues need to be
-# remedied before putting this cygpath kludge back in.
-
-# Convert CURDIR to native file name, if in Cygwin format
-#ifeq "$(shell cygpath $(CURDIR))" "$(CURDIR)"
-#CURDIR                := $(shell cygpath -m $(CURDIR))
-#endif
-
-THISDIR                = .
-
-# Cygwin has changed quoting rules somewhat since b20, in a way that
-# affects makefiles using sh as the command processor, so we need to
-# detect which rules to use.
-ifdef USING_SH
-sh_output := $(shell echo [Please ignore a syntax error on the next line - it 
is intentional] 1>&2)
-sh_output := $(shell echo foo")
-# This single quote " is to fix fontification due to previous line
-ifeq "$(sh_output)" ""
-NEW_CYGWIN = 1
-endif
-
-# By default, newer versions of Cygwin mess with NTFS ACLs in an
-# attempt to emulate traditional posix file permissions. This can
-# cause bad effects, such as .exe files that are missing the
-# FILE_EXECUTE/FILE_GENERIC_EXECUTE permissions when they are created
-# with Cygwin commands that don't expect to be creating executable
-# files. Then when we later use a non-Cygwin program to create the
-# real .exe, the previous Cygwin defined ACL sticks.
-CYGWIN=nontsec
-export CYGWIN
-endif
-
-ALL_DEPS       = $^
-EMPTY =
-SPACE = $(EMPTY) $(EMPTY)
-
-SUBSYSTEM_WINDOWS=-Wl,-subsystem,windows
-SUBSYSTEM_CONSOLE=-Wl,-subsystem,console
-
-# INSTALL_DIR is the directory into which emacs will be installed.
-#
-ifndef INSTALL_DIR
-INSTALL_DIR     = $(CURDIR)/..
-endif
-
-export EMACSLOADPATH
-
-# Determine the architecture we're running on.
-# Define ARCH for our purposes;
-# Define CPU for use by ntwin32.mak;
-# Define CONFIG_H to the appropriate config.h for the system;
-#
-ifdef PROCESSOR_ARCHITECTURE
-# We're on Windows NT
-CPU            = $(PROCESSOR_ARCHITECTURE)
-CONFIG_H       = config.nt
-OS_TYPE                = windowsnt
- ifeq "$(PROCESSOR_ARCHITECTURE)" "x86"
-ARCH           = i386
-CPU            = i386
-EMACS_HEAPSIZE = 27
-EMACS_PURESIZE = 5000000
-EMACS_MANIFEST = emacs-x86.manifest
- else
-  ifeq "$(PROCESSOR_ARCHITECTURE)" "MIPS"
-ARCH           = mips
-EMACS_HEAPSIZE = 27
-EMACS_PURESIZE = 5000000
-EMACS_MANIFEST = emacs-mips.manifest
-  else
-   ifeq "$(PROCESSOR_ARCHITECTURE)" "ALPHA"
-ARCH           = alpha
-EMACS_HEAPSIZE = 27
-EMACS_PURESIZE = 5000000
-EMACS_MANIFEST = emacs-alpha.manifest
-   else
-    ifeq "$(PROCESSOR_ARCHITECTURE)" "PPC"
-ARCH           = ppc
-EMACS_HEAPSIZE = 27
-EMACS_PURESIZE = 5000000
-EMACS_MANIFEST = emacs-ppc.manifest
-    else
-     $(error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)")
-    endif
-   endif
-  endif
- endif
-else
-# We're on Windows 95
-ARCH           = i386
-CPU            = i386
-CONFIG_H       = config.nt
-OS_TYPE                = windows95
-endif
-
-AR             = ar -rsc
-AR_OUT         =
-CC             = gcc
-CC_OUT         = -o$(SPACE)
-LINK           = gcc
-LINK_OUT       = -o$(SPACE)
-RC             = windres -O coff
-RC_OUT         = -o$(SPACE)
-RC_INCLUDE     = --include-dir$(SPACE)
-
-libc           =
-baselibs       =
-O              = o
-A              = a
-
-BASE_LIBS      = $(libc) $(baselibs)
-
-ADVAPI32       = -ladvapi32
-COMCTL32       = -lcomctl32
-COMDLG32       = -lcomdlg32
-GDI32          = -lgdi32
-MPR            = -lmpr
-SHELL32                = -lshell32
-USER32         = -luser32
-WSOCK32                = -lwsock32
-WINMM          = -lwinmm
-WINSPOOL       = -lwinspool
-OLE32          = -lole32
-UNISCRIBE      = -lusp10
-UUID           = -luuid
-
-# Used by src/makefile.w32-in, since Nmake barfs on $(func SOMETHING)
-OBJ0_c         = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ0))
-OBJ1_c         = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ1))
-OBJ2_c         = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2))
-
-ifdef NOOPT
-DEBUG_CFLAGS   = -DEMACSDEBUG -fno-crossjumping -std=gnu99
-else
-DEBUG_CFLAGS   =
-endif
-
-MWINDOWS        = -mwindows
-
-CFLAGS          = -I. $(ARCH_CFLAGS) $(DEBUG_CFLAGS) $(PROFILE_CFLAGS) 
$(USER_CFLAGS) $(LOCAL_FLAGS)
-ESC_CFLAGS      = -I. $(ARCH_CFLAGS) $(DEBUG_CFLAGS) $(PROFILE_CFLAGS) 
$(ESC_USER_CFLAGS) $(LOCAL_FLAGS)
-EMACS_EXTRA_C_FLAGS = -DUSE_CRT_DLL=1
-
-ifdef PROFILE
-PROFILE_CFLAGS  = -pg
-PROFILE_LDFLAGS  = -pg
-else
-PROFILE_CFLAGS  =
-PROFILE_LDFLAGS =
-endif
-
-
-# see comments in allocate_heap in w32heap.c before changing any of the
-# -stack, -heap, or -image-base settings.
-TEMACS_EXTRA_LINK = -Wl,-stack,0x00800000 -Wl,-heap,0x00100000 
-Wl,-image-base,0x01000000 $(SUBSYSTEM_CONSOLE) -Wl,-entry,__start 
-Wl,-Map,$(BLD)/temacs.map
-
-ifdef NOOPT
-OBJDIR          = oo
-else
-OBJDIR          = oo-spd
-endif
-$(OBJDIR):;    -mkdir "$(OBJDIR)"
-BLD             = $(OBJDIR)/$(ARCH)
-stamp_BLD:      $(OBJDIR)
-               -mkdir "$(BLD)"
-               echo $(BLD) > $@
-
-COMPILER_TEMP_FILES =
-
-CP             = cp -f
-CP_DIR         = cp -rf
-DEL            = rm
-DEL_TREE       = rm -r
-
-DIRNAME                = $(notdir $(CURDIR))
-
-ifdef USING_SH
-
-IFNOTSAMEDIR   = if [ ! -s ../$(DIRNAME)_same-dir.tst ] ; then
-FOREACH                = for f in
-FORVAR         = $${f}
-FORDO          = ; do
-ENDFOR         = ; done
-ENDIF          = ; fi
-ARGQUOTE       = '
-ifdef NEW_CYGWIN
-DQUOTE         = "
-else
-DQUOTE         = ""
-endif
-
-else
-
-IFNOTSAMEDIR   = if not exist ../$(DIRNAME)_same-dir.tst
-FOREACH                = for %%f in (
-FORVAR         = %%f
-FORDO          = ) do
-ENDFOR         =
-ENDIF          =
-ARGQUOTE       = "
-DQUOTE         = \"
-
-endif
-
-ifdef NODEBUG
-DEBUG_FLAG =
-DEBUG_LINK =
-else
-DEBUG_FLAG = $(DEBUG_INFO)
-DEBUG_LINK = $(DEBUG_INFO)
-endif
-
-ifdef NOCYGWIN
-NOCYGWIN = -mno-cygwin
-endif
-
-ifdef USER_LIBS
-USER_LIBS := $(patsubst %,-l%,$(USER_LIBS))
-endif
-
-PRAGMA_SYSTEM_HEADER = \#pragma GCC system_header
-
-ifeq "$(ARCH)" "i386"
-ifdef NOOPT
-ARCH_CFLAGS     = -c $(DEBUG_FLAG) $(NOCYGWIN)
-else
-ARCH_CFLAGS     = -c $(DEBUG_FLAG) $(NOCYGWIN) $(MCPU_FLAG) -O2 \
-                 # -fbuiltin \
-                 # -finline-functions \
-                 # -fomit-frame-pointer
-endif
-ARCH_LDFLAGS   = $(SYS_LDFLAGS)
-else
-ERROR Unknown architecture type "$(ARCH)".
-endif
-
-LINK_FLAGS     = $(ARCH_LDFLAGS) $(DEBUG_LINK) $(PROFILE_LDFLAGS) $(NOCYGWIN) 
$(USER_LDFLAGS)
-
-export XMFLAGS
-
-.DEFAULT:
-
-$(BLD)/%.o: %.c
-               $(CC) $(CFLAGS) $(CC_OUT)$@ $<
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index 4fb32df..e7a94e8 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -187,6 +187,20 @@ extern struct tm * sys_localtime (const time_t *);
 #undef HAVE__SETJMP
 #endif
 
+/* The following is needed for recovery from C stack overflows.  */
+#include <setjmp.h>
+typedef jmp_buf sigjmp_buf;
+#ifdef MINGW_W64
+/* Evidently, MinGW64's longjmp crashes when invoked from an exception
+   handler, see https://sourceforge.net/p/mingw-w64/mailman/message/32421953/.
+   This seems to be an unsolved problem in the MinGW64 runtime.  So we
+   use the GCC intrinsics instead.  FIXME.  */
+#define sigsetjmp(j,m) __builtin_setjmp(j)
+#else
+#define sigsetjmp(j,m) setjmp(j)
+#endif
+extern void w32_reset_stack_overflow_guard (void);
+
 #ifdef _MSC_VER
 #include <sys/timeb.h>
 #include <sys/stat.h>
diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in
deleted file mode 100644
index ff2bf27..0000000
--- a/nt/makefile.w32-in
+++ /dev/null
@@ -1,465 +0,0 @@
-# -*- Makefile -*- for GNU Emacs on the Microsoft Windows API.
-# Copyright (C) 2000-2015 Free Software Foundation, Inc.
-#
-# Top level makefile for building GNU Emacs on Windows NT
-#
-# This file is part of GNU Emacs.
-
-# GNU Emacs is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# GNU Emacs is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-
-# FIXME: This file uses DOS EOLs.  Convert to Unix after 22.1 is out
-#        (and remove or replace this comment).
-
-VERSION                = 25.0.50
-
-TMP_DIST_DIR   = emacs-$(VERSION)
-
-TRES           = $(BLD)/emacs.res
-CLIENTRES      = $(BLD)/emacsclient.res
-
-LOCAL_FLAGS    = -DOLD_PATHS=1
-
-XMFLAGS                =
-
-ALL            = $(BLD)/addpm.exe $(BLD)/ddeclient.exe $(BLD)/runemacs.exe \
-                 $(BLD)/cmdproxy.exe $(BLD)/addsection.exe $(BLD)/preprep.exe
-
-$(BLD)/addpm.exe: $(BLD)/addpm.$(O)
-                 $(LINK) $(LINK_OUT)$@ \
-                 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) \
-                 $(USER32) $(OLE32) $(UUID) $(SHELL32)
-
-$(BLD)/ddeclient.exe: $(BLD)/ddeclient.$(O)
-                 $(LINK) $(LINK_OUT)$@ \
-                 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
-
-$(BLD)/cmdproxy.exe: $(BLD)/cmdproxy.$(O)
-                 $(LINK) $(LINK_OUT)$@ \
-                 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
-
-$(BLD)/addsection.exe: $(BLD)/addsection.$(O)
-                 $(LINK) $(LINK_OUT)$@ \
-                 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
-
-$(BLD)/preprep.exe: $(BLD)/preprep.$(O)
-                 $(LINK) $(LINK_OUT)$@ \
-                 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS)
-
-#
-# The resource file.  NT 3.10 requires the use of cvtres; even though
-# it is not necessary on later versions, it is still ok to use it.
-#
-$(TRES):       emacs.rc icons/emacs.ico $(EMACS_MANIFEST) stamp_BLD
-               $(RC) $(RC_OUT)$(TRES) emacs.rc
-
-$(CLIENTRES):  emacsclient.rc stamp_BLD
-               $(RC) $(RC_OUT)$(CLIENTRES) emacsclient.rc
-
-$(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES)
-                 $(LINK) $(LINK_OUT)$@ $(SUBSYSTEM_WINDOWS) \
-                 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
-
-which-sh:
-       @echo Using $(THE_SHELL) as shell.
-
-# These depend on stamp_BLD to make sure the $(BLD) directory is created
-# before the compilation begins, even if Make runs several commands
-# in parallel under "make -j".
-#
-$(BLD)/addpm.$(O) $(BLD)/ddeclient.$(O) $(BLD)/runemacs.$(O) 
$(BLD)/cmdproxy.$(O) $(BLD)/addsection.$(O) $(BLD)/preprep.$(O): stamp_BLD
-
-#
-# Build emacs
-#
-all:   which-sh $(ALL) $(CLIENTRES) all-other-dirs-$(MAKETYPE)
-
-all-other-dirs-$(MAKETYPE): maybe-bootstrap
-
-all-other-dirs-nmake: $(BLD)/addsection.exe
-       cd ..\lib
-       $(MAKE) $(MFLAGS) all
-       cd ..\lib-src
-       $(MAKE) $(MFLAGS) all
-       cd ..\src
-       $(MAKE) $(MFLAGS) all
-       cd ..\lisp
-       $(MAKE) $(MFLAGS) all
-       cd ..\leim
-       $(MAKE) $(MFLAGS) all
-       cd ..\nt
-
-all-other-dirs-gmake: $(BLD)/addsection.exe
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib all
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src all
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src all
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp all
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim all
-
-recompile:     recompile-$(MAKETYPE)
-
-recompile-nmake:
-       cd ..\lisp
-       $(MAKE) $(MFLAGS) recompile
-       cd ..\nt
-
-recompile-gmake:
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp recompile
-
-#### Bootstrapping.
-
-### This is meant for Emacs maintainers only.  It first cleans the
-### lisp subdirectory, removing all compiled Lisp files.  Then a
-### special emacs executable is built from Lisp sources, which is then
-### used to compile Lisp files.  The last step is a "normal" make.
-
-maybe-bootstrap: maybe-bootstrap-$(SHELLTYPE)
-
-# dummy target to force other targets to be evaluated.
-doit:
-
-maybe-bootstrap-CMD:   doit
-       @echo .
-       @if not EXIST ..\lisp\abbrev.elc echo Essential Lisp files seem to be 
missing.  You should either
-       @if not EXIST ..\lisp\abbrev.elc echo do 'make bootstrap' or create 
'lisp/abbrev.elc' somehow
-       @echo .
-       @if not EXIST ..\lisp\abbrev.elc exit -1
-
-maybe-bootstrap-SH: doit
-       @if [ ! -f ../lisp/abbrev.elc ] ; then \
-         echo; \
-         echo "Essential Lisp files seem to be missing.  You should either"; \
-         echo "do \`make bootstrap' or create \`lisp/abbrev.elc' somehow.";  \
-         echo; \
-         exit -1; \
-       fi
-
-# Bootstrap depends on cmdproxy because some Lisp functions
-# loaded during bootstrap may need to run shell commands.
-bootstrap:     $(BLD)/addsection.exe $(BLD)/cmdproxy.exe bootstrap-$(MAKETYPE)
-       $(MAKE) $(MFLAGS) $(XMFLAGS) all
-
-bootstrap-nmake: $(BLD)/addsection.exe $(BLD)/cmdproxy.exe
-       cd ..\lisp
-       $(MAKE) $(MFLAGS) bootstrap-clean
-       cd ..\src
-       $(MAKE) $(MFLAGS) clean
-       cd ..\lib-src
-       $(MAKE) $(MFLAGS) clean make-docfile
-       cd ..\lib
-       $(MAKE) $(MFLAGS) clean all
-       cd ..\src
-       $(MAKE) $(MFLAGS) bootstrap
-       $(MAKE) $(MFLAGS) bootstrap-clean
-       cd ..\nt
-       $(CP) $(BLD)/cmdproxy.exe ../bin
-       cd ..\lisp
-       $(MAKE) $(MFLAGS) SHELL=$(SHELLTYPE) bootstrap
-       cd ..\lib-src
-       $(MAKE) $(MFLAGS) DOC
-       cd ..\nt
-
-bootstrap-gmake: $(BLD)/addsection.exe $(BLD)/cmdproxy.exe
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src make-docfile
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib all
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean
-       $(CP) $(BLD)/cmdproxy.exe ../bin
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src DOC
-
-bootstrap-clean: bootstrap-clean-$(MAKETYPE)
-
-bootstrap-clean-nmake:
-       cd ..\src
-       $(MAKE) $(MFLAGS) bootstrap-clean
-       cd ..\lib
-       $(MAKE) $(MFLAGS) clean
-       cd ..\lisp
-       $(MAKE) $(MFLAGS) bootstrap-clean
-
-bootstrap-clean-gmake:
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean
-
-$(INSTALL_DIR):
-       - mkdir "$(INSTALL_DIR)"
-
-$(INSTALL_DIR)/bin: $(INSTALL_DIR)
-       - mkdir "$(INSTALL_DIR)/bin"
-
-#
-# Build and install emacs in INSTALL_DIR
-#
-.PHONY: install-bin install-shortcuts
-
-install: install-bin install-shortcuts
-
-install-bin: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE)
-       - $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin
-       - $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin
-       - $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin
-       - $(CP) README.W32 $(INSTALL_DIR)
-       - $(DEL) ../$(DIRNAME)_same-dir.tst
-       - $(DEL) $(INSTALL_DIR)/$(DIRNAME)_same-dir.tst
-       echo SameDirTest > "$(INSTALL_DIR)/$(DIRNAME)_same-dir.tst"
-       - mkdir "$(INSTALL_DIR)/etc"
-       - mkdir "$(INSTALL_DIR)/info"
-       - mkdir "$(INSTALL_DIR)/lock"
-       - mkdir "$(INSTALL_DIR)/data"
-       - mkdir "$(INSTALL_DIR)/site-lisp"
-       - mkdir "$(INSTALL_DIR)/etc/icons"
-       $(IFNOTSAMEDIR) $(CP) ../site-lisp/subdirs.el $(INSTALL_DIR)/site-lisp 
$(ENDIF)
-       $(IFNOTSAMEDIR) $(CP_DIR) ../etc $(INSTALL_DIR) $(ENDIF)
-       - $(CP_DIR) icons $(INSTALL_DIR)/etc
-       $(IFNOTSAMEDIR) $(CP_DIR) ../info $(INSTALL_DIR) $(ENDIF)
-       $(IFNOTSAMEDIR) $(CP) ../COPYING $(INSTALL_DIR) $(ENDIF)
-       - $(CP) ../COPYING $(INSTALL_DIR)/bin
-       - $(DEL) ../$(DIRNAME)_same-dir.tst
-       - $(DEL) $(INSTALL_DIR)/$(DIRNAME)_same-dir.tst
-
-install-other-dirs-nmake: all
-       cd ..\lib-src
-       $(MAKE) $(MFLAGS) install
-       cd ..\src
-       $(MAKE) $(MFLAGS) install
-       cd ..\lisp
-       $(MAKE) $(MFLAGS) install
-       cd ..\leim
-       $(MAKE) $(MFLAGS) install
-       cd ..\nt
-
-install-other-dirs-gmake: all
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src install
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src install
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp install
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim install
-
-install-addpm: $(INSTALL_DIR)/bin $(BLD)/addpm.exe
-       - $(CP) $(BLD)/addpm.exe $(INSTALL_DIR)/bin
-
-install-shortcuts: install-addpm
-       "$(INSTALL_DIR)/bin/addpm" -q
-
-maybe-copy-distfiles: maybe-copy-distfiles-$(SHELLTYPE)
-
-maybe-copy-distfiles-CMD: create-tmp-dist-dir doit
-       @if not $(ARGQUOTE)$(DIST_FILES)$(ARGQUOTE) == "" $(CP_DIR) 
$(DIST_FILES) $(TMP_DIST_DIR)/bin
-
-maybe-copy-distfiles-SH: create-tmp-dist-dir doit
-       @if [ ! $(ARGQUOTE)$(DIST_FILES)$(ARGQUOTE) == "" ] ; then \
-         $(CP_DIR) $(DIST_FILES) $(TMP_DIST_DIR)/bin ; \
-       fi
-
-create-tmp-dist-dir:
-       mkdir "$(TMP_DIST_DIR)"
-# Also create bin directory for dist files.
-       mkdir "$(TMP_DIST_DIR)/bin"
-
-dist: install-bin install-addpm maybe-copy-distfiles
-       $(CP) "$(INSTALL_DIR)/BUGS" $(TMP_DIST_DIR)
-       $(CP) "$(INSTALL_DIR)/COPYING" $(TMP_DIST_DIR)
-       $(CP) "$(INSTALL_DIR)/README" $(TMP_DIST_DIR)
-       $(CP) "$(INSTALL_DIR)/README.W32" $(TMP_DIST_DIR)
-       $(CP_DIR) "$(INSTALL_DIR)/bin" $(TMP_DIST_DIR)
-       $(CP_DIR) "$(INSTALL_DIR)/etc" $(TMP_DIST_DIR)
-       $(CP_DIR) "$(INSTALL_DIR)/info" $(TMP_DIST_DIR)
-       $(CP_DIR) "$(INSTALL_DIR)/lisp" $(TMP_DIST_DIR)
-       $(CP_DIR) "$(INSTALL_DIR)/leim" $(TMP_DIST_DIR)
-       $(CP_DIR) "$(INSTALL_DIR)/site-lisp" $(TMP_DIST_DIR)
-       $(COMSPEC)$(ComSpec) /c $(ARGQUOTE)zipdist.bat $(VERSION)$(ARGQUOTE)
-       $(DEL_TREE) $(TMP_DIST_DIR)
-
-force-info:
-# Note that doc/emacs/makefile knows how to
-# put the info files in $(infodir),
-# so we can do ok running make in the build dir.
-info: force-info info-$(MAKETYPE)
-
-info-nmake:
-       cd ..\doc\emacs
-       $(MAKE) $(MFLAGS) info
-       cd ..\misc
-       $(MAKE) $(MFLAGS) info
-       cd ..\lispref
-       $(MAKE) $(MFLAGS) info
-       cd ..\lispintro
-       $(MAKE) $(MFLAGS) info
-       cd $(MAKEDIR)
-
-info-gmake: emacs misc lispref lispintro
-
-emacs misc lispref lispintro:
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/$@ info
-
-#
-# Maintenance
-#
-clean: clean-other-dirs-$(MAKETYPE)
-       - $(DEL) $(COMPILER_TEMP_FILES)
-       - $(DEL_TREE) $(OBJDIR)
-       - $(DEL) stamp_BLD
-       - $(DEL) ../etc/DOC
-
-clean-other-dirs-nmake:
-       cd ..\lib
-       $(MAKE) $(MFLAGS) clean
-       cd ..\lib-src
-       $(MAKE) $(MFLAGS) clean
-       cd ..\src
-       $(MAKE) $(MFLAGS) clean
-       cd ..\doc\lispintro
-       $(MAKE) $(MFLAGS) clean
-       cd ..\lispref
-       $(MAKE) $(MFLAGS) clean
-       cd ..\..\leim
-       $(MAKE) $(MFLAGS) clean
-       cd ..\doc\emacs
-       $(MAKE) $(MFLAGS) clean
-       cd ..\misc
-       $(MAKE) $(MFLAGS) clean
-       cd ..\..\nt
-
-clean-other-dirs-gmake:
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref clean
-
-cleanall-other-dirs-nmake:
-       cd ..\lib
-       $(MAKE) $(MFLAGS) cleanall
-       cd ..\lib-src
-       $(MAKE) $(MFLAGS) cleanall
-       cd ..\src
-       $(MAKE) $(MFLAGS) cleanall
-       cd ..\nt
-
-cleanall-other-dirs-gmake:
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib cleanall
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src cleanall
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src cleanall
-
-# We used to delete *~ here, but that might inadvertently remove
-# precious files if it happens to match their short 8+3 aliases.
-cleanall: clean cleanall-other-dirs-$(MAKETYPE)
-        - $(DEL_TREE) obj
-        - $(DEL_TREE) obj-spd
-        - $(DEL_TREE) oo
-        - $(DEL_TREE) oo-spd
-
-top-distclean:
-       - $(DEL) $(COMPILER_TEMP_FILES)
-       - $(DEL_TREE) obj
-       - $(DEL_TREE) obj-spd
-       - $(DEL_TREE) oo
-       - $(DEL_TREE) oo-spd
-       - $(DEL) stamp_BLD
-       - $(DEL) ../etc/DOC
-       - $(DEL) config.log Makefile
-       - $(DEL) ../README.W32
-
-distclean: distclean-other-dirs-$(MAKETYPE) top-distclean
-
-distclean-other-dirs-nmake:
-       cd ..\lib
-       $(MAKE) $(MFLAGS) distclean
-       cd ..\lib-src
-       $(MAKE) $(MFLAGS) distclean
-       cd ..\src
-       $(MAKE) $(MFLAGS) distclean
-       cd ..\lisp
-       $(MAKE) $(MFLAGS) distclean
-       cd ..\leim
-       $(MAKE) $(MFLAGS) distclean
-       cd ..\doc\emacs
-       $(MAKE) $(MFLAGS) distclean
-       cd ..\misc
-       $(MAKE) $(MFLAGS) distclean
-       cd ..\lispintro
-       $(MAKE) $(MFLAGS) distclean
-       cd ..\lispref
-       $(MAKE) $(MFLAGS) distclean
-       cd ..\..\nt
-
-distclean-other-dirs-gmake:
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib distclean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src distclean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src distclean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp distclean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim distclean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs distclean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc distclean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro distclean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref distclean
-
-maintainer-clean: maintainer-clean-other-dirs-$(MAKETYPE) top-distclean
-
-maintainer-clean-other-dirs-nmake:
-       cd ..\lib
-       $(MAKE) $(MFLAGS) maintainer-clean
-       cd ..\lib-src
-       $(MAKE) $(MFLAGS) maintainer-clean
-       cd ..\src
-       $(MAKE) $(MFLAGS) maintainer-clean
-       cd ..\lisp
-       $(MAKE) $(MFLAGS) maintainer-clean
-       cd ..\leim
-       $(MAKE) $(MFLAGS) maintainer-clean
-       cd ..\doc\emacs
-       $(MAKE) $(MFLAGS) maintainer-clean
-       cd ..\misc
-       $(MAKE) $(MFLAGS) maintainer-clean
-       cd ..\lispintro
-       $(MAKE) $(MFLAGS) maintainer-clean
-       cd ..\lispref
-       $(MAKE) $(MFLAGS) maintainer-clean
-       cd ..\..\nt
-
-maintainer-clean-other-dirs-gmake:
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib maintainer-clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src maintainer-clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src maintainer-clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp maintainer-clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim maintainer-clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs maintainer-clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc maintainer-clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro maintainer-clean
-       $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref maintainer-clean
-
-realclean: cleanall
-       - $(DEL_TREE) ../bin
-
-TAGS: TAGS-$(MAKETYPE)
-
-frc:
-TAGS-gmake: frc
-       ../lib-src/$(BLD)/etags $(CURDIR)/*.c
-       $(MAKE) $(MFLAGS) -C ../src TAGS TAGS-LISP
-       $(MAKE) $(MFLAGS) -C ../lib-src TAGS
-       $(MAKE) $(MFLAGS) -C ../lib TAGS
-
-TAGS-nmake:
-       echo This target is not supported with NMake
-
-.PHONY: frc
diff --git a/nt/multi-install-info.bat b/nt/multi-install-info.bat
deleted file mode 100644
index f69ee48..0000000
--- a/nt/multi-install-info.bat
+++ /dev/null
@@ -1,40 +0,0 @@
address@hidden off
-
-rem  Hack to run install-info with multiple info files on the command
-rem  line on the Windows platform.
-
-rem Copyright (C) 2003-2015 Free Software Foundation, Inc.
-
-rem  This file is part of GNU Emacs.
-
-rem   GNU Emacs is free software: you can redistribute it and/or modify
-rem   it under the terms of the GNU General Public License as published by
-rem   the Free Software Foundation, either version 3 of the License, or
-rem   (at your option) any later version.
-
-rem   GNU Emacs is distributed in the hope that it will be useful,
-rem   but WITHOUT ANY WARRANTY; without even the implied warranty of
-rem   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-rem   GNU General Public License for more details.
-
-rem   You should have received a copy of the GNU General Public License
-rem   along with GNU Emacs.  If not, see http://www.gnu.org/licenses/.
-
-
-rem  Usage:
-rem   multi-install-info <switch passed to install-info> FILE1 FILE2 ...
-rem
-rem  By Peter 'Luna' Runestig <address@hidden> 2003
-
-set INSTALL_INFO=install-info
-set II_SWITCH=%1=%2
-rem Eat the install-info switch:
-shift
-
-:Loop
-shift
-if .%1% == . goto EndLoop
-%INSTALL_INFO% %II_SWITCH% %1
-goto Loop
-:EndLoop
-
diff --git a/nt/nmake.defs b/nt/nmake.defs
deleted file mode 100644
index 5424b9d..0000000
--- a/nt/nmake.defs
+++ /dev/null
@@ -1,294 +0,0 @@
-#  -*- Makefile -*- definition file for building GNU Emacs on Windows NT.
-# Copyright (C) 2000-2015 Free Software Foundation, Inc.
-
-# This file is part of GNU Emacs.
-
-# GNU Emacs is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# GNU Emacs is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-
-# Ensure 'all' is the default target
-all:
-
-THE_SHELL = $(COMSPEC)
-SHELLTYPE=CMD
-SWITCHCHAR=/
-
-MAKETYPE=nmake
-
-CURDIR         = $(MAKEDIR:\=/)
-THISDIR                = $(MAKEDIR)
-DIRNAME                =
-
-ALL_DEPS       = $**
-
-SUBSYSTEM_WINDOWS=-subsystem:windows
-SUBSYSTEM_CONSOLE=-subsystem:console
-
-# INSTALL_DIR is the directory into which emacs will be installed.
-#
-!ifndef INSTALL_DIR
-INSTALL_DIR     = $(CURDIR)/..
-!endif
-
-# Ensure EMACSLOADPATH is defined in the environment.
-#
-!if [set EMACSLOADPATH=foo]
-!endif
-
-# Allow detection of builds with MSVC 5 or later, so we can
-# speed up compiles (see rule at end).
-#
-_NMAKE_VER_5=162
-_NMAKE_VER_4=0
-
-!IFNDEF _NMAKE_VER
-_NMAKE_VER=$(_NMAKE_VER_4)
-!ENDIF
-
-# Check that the INCLUDE and LIB environment variables are set.
-#
-!ifndef INCLUDE
-!error The INCLUDE environment variable needs to be set.
-!endif
-!ifndef LIB
-!error The LIB environment variable needs to be set.
-!endif
-
-# Determine the architecture we're running on.
-# Define ARCH for our purposes;
-# Define CPU for use by ntwin32.mak;
-# Define CONFIG_H to the appropriate config.h for the system;
-#
-!ifdef PROCESSOR_ARCHITECTURE
-# We're on Windows NT
-CPU            = $(PROCESSOR_ARCHITECTURE)
-CONFIG_H       = config.nt
-OS_TYPE                = windowsnt
-! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
-ARCH           = i386
-CPU            = i386
-! else
-!  if "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
-ARCH           = mips
-!  else
-!   if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
-ARCH           = alpha
-!   else
-!    if "$(PROCESSOR_ARCHITECTURE)" == "PPC"
-ARCH           = ppc
-!    else
-!     if "$(PROCESSOR_ARCHITECTURE)" == "AMD64"
-ARCH           = AMD64
-!     else
-!      error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)"
-!     endif
-!    endif
-!   endif
-!  endif
-! endif
-!else
-# We're on Windows 95
-ARCH           = i386
-CPU            = i386
-CONFIG_H       = config.nt
-OS_TYPE                = windows95
-!endif
-
-AR             = lib
-AR_OUT         = -out:
-CC             = cl
-CC_OUT         = -Fo
-LINK           = link
-LINK_OUT       = -out:
-RC             = rc $(ARCH_RCFLAGS)
-RC_OUT         = -Fo
-RC_INCLUDE     = -i
-
-USE_CRT_DLL    = 1
-
-!if $(USE_CRT_DLL)
-libc           = msvcrt$(D).lib
-EMACS_EXTRA_C_FLAGS= -D_DLL -D_MT -DUSE_CRT_DLL=1
-!else
-libc           = libcmt$(D).lib
-EMACS_EXTRA_C_FLAGS= -D_MT
-!endif
-baselibs       =
-O              = obj
-A              = lib
-
-BASE_LIBS      = $(libc) $(baselibs) oldnames.lib
-
-ADVAPI32       = advapi32.lib
-COMCTL32       = comctl32.lib
-COMDLG32       = comdlg32.lib
-GDI32          = gdi32.lib
-MPR            = mpr.lib
-SHELL32                = shell32.lib
-USER32         = user32.lib
-WSOCK32                = wsock32.lib
-WINMM          = winmm.lib
-WINSPOOL       = winspool.lib
-OLE32          = ole32.lib
-UNISCRIBE      = usp10.lib
-UUID           = uuid.lib
-
-!ifdef NOOPT
-DEBUG_CFLAGS   = -DEMACSDEBUG
-!else
-DEBUG_CFLAGS   =
-!endif
-
-MWINDOWS        = -subsystem:windows -entry:mainCRTStartup
-
-CFLAGS          = -I. $(ARCH_CFLAGS) -D_CRT_SECURE_NO_WARNINGS \
-                 $(DEBUG_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS)
-ESC_CFLAGS      = -I. $(ARCH_CFLAGS) -D_CRT_SECURE_NO_WARNINGS \
-                 $(DEBUG_CFLAGS) $(ESC_USER_CFLAGS) $(LOCAL_FLAGS)
-
-#SYS_LDFLAGS   = -nologo -release -incremental:no -version:3.10 -swaprun:cd 
-swaprun:net setargv.obj
-SYS_LDFLAGS    = -nologo -manifest -dynamicbase:no -incremental:no 
-version:3.10 -swaprun:cd -swaprun:net setargv.obj
-
-# see comments in allocate_heap in w32heap.c before changing any of the
-# -stack, -heap, or -base settings.
-!if "$(ARCH)" == "i386"
-TEMACS_EXTRA_LINK = -stack:0x00800000 -heap:0x00100000 -base:0x01000000 
-pdb:$(BLD)\temacs.pdb -machine:x86 $(SUBSYSTEM_CONSOLE) -entry:_start 
-map:$(BLD)\temacs.map $(EXTRA_LINK)
-!elseif "$(ARCH)" == "AMD64"
-TEMACS_EXTRA_LINK = -stack:0x00800000 -heap:0x00100000 -base:0x400000000 
-pdb:$(BLD)\temacs.pdb -machine:x64 $(SUBSYSTEM_CONSOLE) -entry:_start 
-map:$(BLD)\temacs.map $(EXTRA_LINK)
-!endif
-
-!ifdef NOOPT
-OBJDIR          = obj
-!else
-OBJDIR          = obj-spd
-!endif
-$(OBJDIR):;    -mkdir $(OBJDIR)
-BLD             = $(OBJDIR)/$(ARCH)
-stamp_BLD:      $(OBJDIR)
-               -mkdir "$(BLD)"
-               echo $(BLD) > $@
-
-COMPILER_TEMP_FILES = *.pdb
-
-CP             = cp -f
-CP_DIR         = cp -rf
-IFNOTSAMEDIR   = if not exist ..\$(DIRNAME)_same-dir.tst
-ENDIF          =
-FOREACH                = for %%f in (
-FORVAR         = %%f
-FORDO          = ) do
-ENDFOR         =
-ARGQUOTE       = "
-# "
-DQUOTE         = \"
-DEL            = rm
-DEL_TREE       = rm -r
-
-!ifdef NODEBUG
-DEBUG_FLAG =
-DEBUG_LINK =
-D =
-!else
-DEBUG_FLAG = -Zi
-DEBUG_LINK = -debug
-D = d
-!endif
-
-# gcc-specific pragma (ignore for MSVC)
-PRAGMA_SYSTEM_HEADER =
-
-!if "$(ARCH)" == "i386"
-!ifdef NOOPT
-#ARCH_CFLAGS     = -nologo -c -Zel -W2 -H63 -Od -G3d -Zp8 $(DEBUG_FLAG)
-ARCH_CFLAGS     = -nologo -D_X86_=1 -c -Zl -Zp8 -W2 -Od -Gd $(DEBUG_FLAG)
-!else
-#ARCH_CFLAGS     = -nologo -c -Zel -W2 -H63 -Oxsb2 -Oy- -G6dF -Zp8 
$(DEBUG_FLAG)
-ARCH_CFLAGS     = -nologo -D_X86_=1 -c -Zl -Zp8 -W2 -Oi -Ot -Oy- -Ob2 -GF -Gy 
-Gd $(DEBUG_FLAG)
-!endif
-ARCH_LDFLAGS   = $(SYS_LDFLAGS)
-EMACS_HEAPSIZE = 27
-EMACS_PURESIZE = 5000000
-EMACS_MANIFEST = emacs-x86.manifest
-
-!else
-!if "$(ARCH)" == "mips"
-ARCH_CFLAGS     = -D_MIPS_=1 -c -W2 -Zi -Od -Gt0
-ARCH_LDFLAGS   = $(SYS_LDFLAGS)
-EMACS_HEAPSIZE = 27
-EMACS_PURESIZE = 5000000
-EMACS_MANIFEST = emacs-mips.manifest
-
-!else
-!if "$(ARCH)" == "alpha"
-!if "$(BUILD_TYPE)" == "spd"
-ARCH_CFLAGS     = -D_ALPHA_=1 -c -Ze -Zi -W2 -Od -D__stdcall= -D__cdecl=
-!else
-ARCH_CFLAGS     = -D_ALPHA_=1 -c -Ze -Zi -W2 -O1 -D__stdcall= -D__cdecl=
-!endif
-ARCH_LDFLAGS   = $(SYS_LDFLAGS)
-EMACS_HEAPSIZE = 27
-EMACS_PURESIZE = 5000000
-EMACS_MANIFEST = emacs-alpha.manifest
-
-!else
-!if "$(ARCH)" == "ppc"
-# These flags are a guess...if they don't work, please send me mail.
-ARCH_LDFLAGS   = $(SYS_LDFLAGS)
-EMACS_HEAPSIZE = 27
-EMACS_PURESIZE = 5000000
-EMACS_MANIFEST = emacs-ppc.manifest
-
-!else
-!if "$(ARCH)" == "AMD64"
-!ifdef NOOPT
-ARCH_CFLAGS     = -nologo -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -c -Zl 
-Zp8 -W2 -Od -Gd -Wp64 $(DEBUG_FLAG)
-!else
-ARCH_CFLAGS     = -nologo -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -c -Zl 
-Zp8 -W2 -O2x -GF -Gy -Gd $(DEBUG_FLAG)
-!endif
-ARCH_LDFLAGS   = $(SYS_LDFLAGS) -machine:x64
-ARCH_RCFLAGS   = -DWIN64
-EMACS_HEAPSIZE = 42
-EMACS_PURESIZE = 10000000
-EMACS_MANIFEST = emacs-x64.manifest
-
-!else
-!ERROR Unknown architecture type "$(ARCH)".
-!endif
-!endif
-!endif
-!endif
-!endif
-
-LINK_FLAGS     = $(ARCH_LDFLAGS) $(DEBUG_LINK) $(USER_LDFLAGS)
-
-# From MSVC 5.0 onwards, it seem base relocation information is not included,
-# at least in release builds.  We need to ensure the reloc info is included
-# in order to use the MSVC profiler.
-!IF ("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)")
-EXTRA_LINK      =
-!ELSE
-EXTRA_LINK      = -profile
-!ENDIF
-
-#
-# If the compiler supports compiling multiple .c files to .o files at
-# one time, use this feature.
-#
-!IF ("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)")
-.c{$(BLD)}.obj:
-               $(CC) $(CFLAGS) -Fo$(BLD)\ $<
-!ELSE
-.c{$(BLD)}.obj::
-               $(CC) $(CFLAGS) -Fo$(BLD)\ $<
-!ENDIF
diff --git a/nt/paths.h b/nt/paths.h
deleted file mode 100644
index d6dfaad..0000000
--- a/nt/paths.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* paths.h file for MS Windows
-
-Copyright (C) 1993, 1995, 1997, 1999, 2001-2015 Free Software
-Foundation, Inc.
-
-This file is part of GNU Emacs.
-
-GNU Emacs is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* Relative file names in this file that begin with "%emacs_dir%/" are
-   treated specially by decode_env_path: they are expanded relative to
-   the value of the emacs_dir environment variable, which points to
-   the root of the Emacs tree.  */
-
-/* The default search path for Lisp function "load".
-   Together with PATH_SITELOADSEARCH, this sets load-path.  */
-/* #define PATH_LOADSEARCH "/usr/local/lib/emacs/lisp" */
-#define PATH_LOADSEARCH "%emacs_dir%/lisp"
-
-/* Like PATH_LOADSEARCH, but contains the non-standard pieces.  */
-#define PATH_SITELOADSEARCH "%emacs_dir%/site-lisp;%emacs_dir%/../site-lisp"
-
-/* Like PATH_LOADSEARCH, but used only when Emacs is dumping.  This
-   path is usually identical to PATH_LOADSEARCH except that the entry
-   for the directory containing the installed lisp files has been
-   replaced with ../lisp.  */
-#define PATH_DUMPLOADSEARCH "../lisp"
-
-/* The extra search path for programs to invoke.  This is appended to
-   whatever the PATH environment variable says to set the Lisp
-   variable exec-path and the first file name in it sets the Lisp
-   variable exec-directory.  exec-directory is used for finding
-   executables and other architecture-dependent files.  */
-/* #define PATH_EXEC "/usr/local/lib/emacs/etc" */
-#define PATH_EXEC 
"%emacs_dir%/bin;%emacs_dir%/lib-src/oo-spd/i386;%emacs_dir%/lib-src/oo/i386;%emacs_dir%/nt/oo-spd/i386;%emacs_dir%/nt/oo/i386"
-
-/* Where Emacs should look for its architecture-independent data
-   files, like the NEWS file.  The lisp variable data-directory
-   is set to this value.  */
-/* #define PATH_DATA "/usr/local/lib/emacs/data" */
-#define PATH_DATA "%emacs_dir%/etc"
-
-/* Where Emacs should look for X bitmap files.
-   The lisp variable x-bitmap-file-path is set based on this value.  */
-#define PATH_BITMAPS ""
-
-/* Where Emacs should look for its docstring file.  The lisp variable
-   doc-directory is set to this value.  */
-#define PATH_DOC "%emacs_dir%/etc"
-
-/* Where the configuration process believes the info tree lives.  The
-   lisp variable configure-info-directory gets its value from this
-   macro, and is then used to set the Info-default-directory-list.  */
-/* #define PATH_INFO "/usr/local/info" */
-#define PATH_INFO "C:/emacs/info"
diff --git a/nt/zipdist.bat b/nt/zipdist.bat
deleted file mode 100644
index 55ba9ae..0000000
--- a/nt/zipdist.bat
+++ /dev/null
@@ -1,43 +0,0 @@
address@hidden off
-rem Copyright (C) 2001-2015 Free Software Foundation, Inc.
-
-rem Author: Christoph Scholtes cschol2112 at gmail.com
-
-rem This file is part of GNU Emacs.
-
-rem GNU Emacs is free software: you can redistribute it and/or modify
-rem it under the terms of the GNU General Public License as published by
-rem the Free Software Foundation, either version 3 of the License, or
-rem (at your option) any later version.
-
-rem GNU Emacs is distributed in the hope that it will be useful,
-rem but WITHOUT ANY WARRANTY; without even the implied warranty of
-rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-rem GNU General Public License for more details.
-
-rem You should have received a copy of the GNU General Public License
-rem along with GNU Emacs.  If not, see http://www.gnu.org/licenses/.
-
-SETLOCAL
-rem arg 1: Emacs version number
-set EMACS_VER=%1
-
-set TMP_DIST_DIR=emacs-%EMACS_VER%
-
-rem Check, if 7zip is installed and available on path
-7z 1>NUL 2>NUL
-if %ERRORLEVEL% NEQ 0 goto ZIP_ERROR
-goto ZIP_DIST
-
-:ZIP_ERROR
-echo.
-echo ERROR: Make sure 7zip is installed and available on the Windows Path!
-goto EXIT
-
-rem Build and verify the binary distribution
-:ZIP_DIST
-7z a -bd -tZIP -mx=9 -x!.gitignore -xr!emacs.mdp -xr!*.pdb -xr!*.opt -xr!*~ 
-xr!CVS -xr!.arch-inventory emacs-%EMACS_VER%-bin-i386.zip %TMP_DIST_DIR%
-7z t emacs-%EMACS_VER%-bin-i386.zip
-goto EXIT
-
-:EXIT
diff --git a/src/alloc.c b/src/alloc.c
index 9ac3ad8..91b4c6e 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3765,7 +3765,7 @@ queue_doomed_finalizers (struct Lisp_Finalizer *dest,
 static Lisp_Object
 run_finalizer_handler (Lisp_Object args)
 {
-  add_to_log ("finalizer failed: %S", args, Qnil);
+  add_to_log ("finalizer failed: %S", args);
   return Qnil;
 }
 
@@ -5339,6 +5339,10 @@ purecopy (Lisp_Object obj)
   if (PURE_POINTER_P (XPNTR (obj)) || INTEGERP (obj) || SUBRP (obj))
     return obj;    /* Already pure.  */
 
+  if (STRINGP (obj) && XSTRING (obj)->intervals)
+    message_with_string ("Dropping text-properties while making string `%s' 
pure",
+                        obj, true);
+
   if (HASH_TABLE_P (Vpurify_flag)) /* Hash consing.  */
     {
       Lisp_Object tmp = Fgethash (obj, Vpurify_flag, Qnil);
@@ -5351,13 +5355,9 @@ purecopy (Lisp_Object obj)
   else if (FLOATP (obj))
     obj = make_pure_float (XFLOAT_DATA (obj));
   else if (STRINGP (obj))
-    {
-      if (XSTRING (obj)->intervals)
-       message ("Dropping text-properties when making string pure");
-      obj = make_pure_string (SSDATA (obj), SCHARS (obj),
-                             SBYTES (obj),
-                             STRING_MULTIBYTE (obj));
-    }
+    obj = make_pure_string (SSDATA (obj), SCHARS (obj),
+                           SBYTES (obj),
+                           STRING_MULTIBYTE (obj));
   else if (COMPILEDP (obj) || VECTORP (obj) || HASH_TABLE_P (obj))
     {
       struct Lisp_Vector *objp = XVECTOR (obj);
diff --git a/src/bidi.c b/src/bidi.c
index e06430c..bcc15b8 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -1313,13 +1313,13 @@ bidi_fetch_char (ptrdiff_t charpos, ptrdiff_t bytepos, 
ptrdiff_t *disp_pos,
          /* `(space ...)' display specs are handled as paragraph
             separators for the purposes of the reordering; see UAX#9
             section 3 and clause HL1 in section 4.3 there.  */
-         ch = 0x2029;
+         ch = PARAGRAPH_SEPARATOR;
        }
       else
        {
          /* All other display specs are handled as the Unicode Object
             Replacement Character.  */
-         ch = 0xFFFC;
+         ch = OBJECT_REPLACEMENT_CHARACTER;
        }
       disp_end_pos = compute_display_string_end (*disp_pos, string);
       if (disp_end_pos < 0)
@@ -2482,8 +2482,8 @@ typedef struct bpa_stack_entry {
 
 #define CANONICAL_EQU(c)                                       \
   ( ASCII_CHAR_P (c) ? c                                       \
-    : (c) == 0x2329 ? 0x3008                                   \
-    : (c) == 0x232a ? 0x3009                                   \
+    : (c) == LEFT_POINTING_ANGLE_BRACKET ? LEFT_ANGLE_BRACKET  \
+    : (c) == RIGHT_POINTING_ANGLE_BRACKET ? RIGHT_ANGLE_BRACKET        \
     : c )
 
 #ifdef ENABLE_CHECKING
diff --git a/src/character.h b/src/character.h
index 859d717..67d4bca 100644
--- a/src/character.h
+++ b/src/character.h
@@ -59,6 +59,30 @@ INLINE_HEADER_BEGIN
 /* Maximum leading code of multibyte characters.  */
 #define MAX_MULTIBYTE_LEADING_CODE 0xF8
 
+/* Unicode character values.  */
+enum
+{
+  NO_BREAK_SPACE = 0x00A0,
+  SOFT_HYPHEN = 0x00AD,
+  ZERO_WIDTH_NON_JOINER = 0x200C,
+  ZERO_WIDTH_JOINER = 0x200D,
+  HYPHEN = 0x2010,
+  NON_BREAKING_HYPHEN = 0x2011,
+  LEFT_SINGLE_QUOTATION_MARK = 0x2018,
+  RIGHT_SINGLE_QUOTATION_MARK = 0x2019,
+  PARAGRAPH_SEPARATOR = 0x2029,
+  LEFT_POINTING_ANGLE_BRACKET = 0x2329,
+  RIGHT_POINTING_ANGLE_BRACKET = 0x232A,
+  LEFT_ANGLE_BRACKET = 0x3008,
+  RIGHT_ANGLE_BRACKET = 0x3009,
+  OBJECT_REPLACEMENT_CHARACTER = 0xFFFC,
+};
+
+/* UTF-8 encodings.  Use \x escapes, so they are portable to pre-C11
+   compilers and can be concatenated with ordinary string literals.  */
+#define uLSQM "\xE2\x80\x98" /* U+2018 LEFT SINGLE QUOTATION MARK */
+#define uRSQM "\xE2\x80\x99" /* U+2019 RIGHT SINGLE QUOTATION MARK */
+
 /* Nonzero iff C is a character that corresponds to a raw 8-bit
    byte.  */
 #define CHAR_BYTE8_P(c) ((c) > MAX_5_BYTE_CHAR)
diff --git a/src/charset.c b/src/charset.c
index b19e344..eeebf17 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -555,7 +555,7 @@ load_charset_map_from_vector (struct charset *charset, 
Lisp_Object vec, int cont
 
   if (len % 2 == 1)
     {
-      add_to_log ("Failure in loading charset map: %V", vec, Qnil);
+      add_to_log ("Failure in loading charset map: %V", vec);
       return;
     }
 
diff --git a/src/composite.c b/src/composite.c
index 1c18165..88cef22 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -927,7 +927,7 @@ char_composable_p (int c)
 {
   Lisp_Object val;
   return (c > ' '
-         && (c == 0x200C || c == 0x200D
+         && (c == ZERO_WIDTH_NON_JOINER || c == ZERO_WIDTH_JOINER
              || (val = CHAR_TABLE_REF (Vunicode_category_table, c),
                  (INTEGERP (val) && (XINT (val) <= UNICODE_CATEGORY_So)))));
 }
diff --git a/src/dispnew.c b/src/dispnew.c
index 7833fe3..18afe50 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -177,7 +177,7 @@ add_window_display_history (struct window *w, const char 
*msg, bool paused_p)
   ++history_idx;
 
   snprintf (buf, sizeof redisplay_history[0].trace,
-           "%"pMu": window %p (`%s')%s\n%s",
+           "%"pMu": window %p (%s)%s\n%s",
            history_tick++,
            ptr,
            ((BUFFERP (w->contents)
diff --git a/src/doc.c b/src/doc.c
index 36619e1..9c9bdf3 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -684,18 +684,37 @@ the same file name is found in the `doc-directory'.  */)
   return unbind_to (count, Qnil);
 }
 
-/* Declare named constants for U+2018 LEFT SINGLE QUOTATION MARK and
-   U+2019 RIGHT SINGLE QUOTATION MARK, which have UTF-8 encodings
-   "\xE2\x80\x98" and "\xE2\x80\x99", respectively.  */
-enum
-  {
-    LEFT_SINGLE_QUOTATION_MARK = 0x2018,
-    uLSQM0 = 0xE2, uLSQM1 = 0x80, uLSQM2 = 0x98,
-    uRSQM0 = 0xE2, uRSQM1 = 0x80, uRSQM2 = 0x99,
-  };
+/* Curved quotation marks.  */
 static unsigned char const LSQM[] = { uLSQM0, uLSQM1, uLSQM2 };
 static unsigned char const RSQM[] = { uRSQM0, uRSQM1, uRSQM2 };
 
+static bool
+default_to_grave_quoting_style (void)
+{
+  if (!text_quoting_flag)
+    return true;
+  if (! DISP_TABLE_P (Vstandard_display_table))
+    return false;
+  Lisp_Object dv = DISP_CHAR_VECTOR (XCHAR_TABLE (Vstandard_display_table),
+                                    LEFT_SINGLE_QUOTATION_MARK);
+  return (VECTORP (dv) && ASIZE (dv) == 1
+         && EQ (AREF (dv, 0), make_number ('`')));
+}
+
+/* Return the current effective text quoting style.  */
+enum text_quoting_style
+text_quoting_style (void)
+{
+  if (NILP (Vtext_quoting_style)
+      ? default_to_grave_quoting_style ()
+      : EQ (Vtext_quoting_style, Qgrave))
+    return GRAVE_QUOTING_STYLE;
+  else if (EQ (Vtext_quoting_style, Qstraight))
+    return STRAIGHT_QUOTING_STYLE;
+  else
+    return CURVE_QUOTING_STYLE;
+}
+
 DEFUN ("substitute-command-keys", Fsubstitute_command_keys,
        Ssubstitute_command_keys, 1, 1, 0,
        doc: /* Substitute key descriptions for command names in STRING.
@@ -750,20 +769,7 @@ Otherwise, return a new string.  */)
   name = Qnil;
   GCPRO4 (string, tem, keymap, name);
 
-  enum { unicode, grave_accent, apostrophe } quote_translation = unicode;
-  if (EQ (Vtext_quoting_style, Qgrave))
-    quote_translation = grave_accent;
-  else if (EQ (Vtext_quoting_style, Qstraight))
-    quote_translation = apostrophe;
-  else if (NILP (Vtext_quoting_style)
-          && DISP_TABLE_P (Vstandard_display_table))
-    {
-      Lisp_Object dv = DISP_CHAR_VECTOR (XCHAR_TABLE (Vstandard_display_table),
-                                        LEFT_SINGLE_QUOTATION_MARK);
-      if (VECTORP (dv) && ASIZE (dv) == 1
-         && EQ (AREF (dv, 0), make_number ('`')))
-       quote_translation = grave_accent;
-    }
+  enum text_quoting_style quoting_style = text_quoting_style ();
 
   multibyte = STRING_MULTIBYTE (string);
   nchars = 0;
@@ -921,11 +927,13 @@ Otherwise, return a new string.  */)
          if (NILP (tem))
            {
              name = Fsymbol_name (name);
-             insert_string ("\nUses keymap `");
+             insert1 (CALLN (Fformat, build_string ("\nUses keymap "uLSQM)));
              insert_from_string (name, 0, 0,
                                  SCHARS (name),
                                  SBYTES (name), 1);
-             insert_string ("', which is not currently defined.\n");
+             insert1 (CALLN (Fformat,
+                             (build_string
+                              (uRSQM", which is not currently defined.\n"))));
              if (start[-1] == '<') keymap = Qnil;
            }
          else if (start[-1] == '<')
@@ -962,7 +970,7 @@ Otherwise, return a new string.  */)
            strp = SDATA (string) + idx;
          }
        }
-      else if (strp[0] == '`' && quote_translation == unicode)
+      else if (strp[0] == '`' && quoting_style == CURVE_QUOTING_STYLE)
        {
          in_quote = true;
          start = LSQM;
@@ -972,7 +980,7 @@ Otherwise, return a new string.  */)
          idx = strp - SDATA (string) + 1;
          goto subst;
        }
-      else if (strp[0] == '`' && quote_translation == apostrophe)
+      else if (strp[0] == '`' && quoting_style == STRAIGHT_QUOTING_STYLE)
        {
          *bufp++ = '\'';
          strp++;
@@ -987,9 +995,9 @@ Otherwise, return a new string.  */)
        }
       else if (strp[0] == uLSQM0 && strp[1] == uLSQM1
               && (strp[2] == uLSQM2 || strp[2] == uRSQM2)
-              && quote_translation != unicode)
+              && quoting_style != CURVE_QUOTING_STYLE)
         {
-         *bufp++ = (strp[2] == uLSQM2 && quote_translation == grave_accent
+         *bufp++ = (strp[2] == uLSQM2 && quoting_style == GRAVE_QUOTING_STYLE
                     ? '`' : '\'');
          strp += 3;
          nchars++;
@@ -1044,6 +1052,10 @@ The default value nil acts like ‘curve’ if curved single 
quotes are
 displayable, and like ‘grave’ otherwise.  */);
   Vtext_quoting_style = Qnil;
 
+  DEFVAR_BOOL ("internal--text-quoting-flag", text_quoting_flag,
+              doc: /* If nil, a nil ‘text-quoting-style’ is treated as 
‘grave’.  */);
+  /* Initialized by ‘main’.  */
+
   defsubr (&Sdocumentation);
   defsubr (&Sdocumentation_property);
   defsubr (&Ssnarf_documentation);
diff --git a/src/doprnt.c b/src/doprnt.c
index 68750f5..7c5a6af 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -49,8 +49,9 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
    support features beyond those in `Fformat', which is used by `error' on the
    Lisp level.  */
 
-/* This function supports the following %-sequences in the `format'
-   argument:
+/* In the FORMAT argument this function supports ` and ' as directives
+   that output left and right quotes as per ‘text-quoting style’.  It
+   also supports the following %-sequences:
 
    %s means print a string argument.
    %S is silently treated as %s, for loose compatibility with `Fformat'.
@@ -144,6 +145,7 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format,
   /* Buffer we have got with malloc.  */
   char *big_buffer = NULL;
 
+  enum text_quoting_style quoting_style = text_quoting_style ();
   ptrdiff_t tem = -1;
   char *string;
   char fixed_buffer[20];       /* Default buffer for small formatting. */
@@ -164,7 +166,9 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format,
   /* Loop until end of format string or buffer full. */
   while (fmt < format_end && bufsize > 0)
     {
-      if (*fmt == '%') /* Check for a '%' character */
+      char const *fmt0 = fmt;
+      char fmtchar = *fmt++;
+      if (fmtchar == '%')
        {
          ptrdiff_t size_bound = 0;
          ptrdiff_t width;  /* Columns occupied by STRING on display.  */
@@ -180,7 +184,6 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format,
          int maxmlen = max (max (1, pDlen), max (pIlen, pMlen));
          int mlen;
 
-         fmt++;
          /* Copy this one %-spec into fmtcpy.  */
          string = fmtcpy;
          *string++ = '%';
@@ -438,22 +441,36 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char 
*format,
            }
        }
 
-      {
-       /* Just some character; Copy it if the whole multi-byte form
-          fit in the buffer.  */
-       char *save_bufptr = bufptr;
-
-       do { *bufptr++ = *fmt++; }
-       while (fmt < format_end && --bufsize > 0 && !CHAR_HEAD_P (*fmt));
-       if (!CHAR_HEAD_P (*fmt))
-         {
-           /* Truncate, but return value that will signal to caller
-              that the buffer was too small.  */
-           *save_bufptr = 0;
-           break;
-         }
-      }
-    };
+      char const *src;
+      ptrdiff_t srclen;
+      if (quoting_style == CURVE_QUOTING_STYLE && fmtchar == '`')
+       src = uLSQM, srclen = sizeof uLSQM - 1;
+      else if (quoting_style == CURVE_QUOTING_STYLE && fmtchar == '\'')
+       src = uRSQM, srclen = sizeof uRSQM - 1;
+      else if (quoting_style == STRAIGHT_QUOTING_STYLE && fmtchar == '`')
+       src = "'", srclen = 1;
+      else
+       {
+         while (fmt < format_end && !CHAR_HEAD_P (*fmt))
+           fmt++;
+         src = fmt0, srclen = fmt - fmt0;
+       }
+
+      if (bufsize < srclen)
+       {
+         /* Truncate, but return value that will signal to caller
+            that the buffer was too small.  */
+         do
+           *bufptr++ = '\0';
+         while (--bufsize != 0);
+       }
+      else
+       {
+         do
+           *bufptr++ = *src++;
+         while (--srclen != 0);
+       }
+    }
 
   /* If we had to malloc something, free it.  */
   xfree (big_buffer);
@@ -467,7 +484,8 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format,
 /* Format to an unbounded buffer BUF.  This is like sprintf, except it
    is not limited to returning an 'int' so it doesn't have a silly 2
    GiB limit on typical 64-bit hosts.  However, it is limited to the
-   Emacs-style formats that doprnt supports.
+   Emacs-style formats that doprnt supports, and it requotes ` and '
+   as per ‘text-quoting-style’.
 
    Return the number of bytes put into BUF, excluding the terminating
    '\0'.  */
diff --git a/src/editfns.c b/src/editfns.c
index 9ff39f9..ed57d8a 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3800,8 +3800,9 @@ DEFUN ("format", Fformat, Sformat, 1, MANY, 0,
 The first argument is a format control string.
 The other arguments are substituted into it to make the result, a string.
 
-The format control string may contain %-sequences meaning to substitute
-the next available argument:
+The format control string may contain ordinary characters,
+%-sequences meaning to substitute the next available argument,
+and curved single quotation marks meaning to substitute quotes.
 
 %s means print a string argument.  Actually, prints any object, with `princ'.
 %d means print as number in decimal (%o octal, %x hex).
@@ -3846,6 +3847,12 @@ precision specifier says how many decimal places to 
show; if zero, the
 decimal point itself is omitted.  For %s and %S, the precision
 specifier truncates the string to the given width.
 
+\\=‘ and \\=’ means print left and right quotes as per
+‘text-quoting-style’.
+
+Return the first argument if it contains no format directives.
+Otherwise, return a new string.
+
 usage: (format STRING &rest OBJECTS)  */)
   (ptrdiff_t nargs, Lisp_Object *args)
 {
@@ -3858,6 +3865,7 @@ usage: (format STRING &rest OBJECTS)  */)
   ptrdiff_t buf_save_value_index IF_LINT (= 0);
   char *format, *end, *format_start;
   ptrdiff_t formatlen, nchars;
+  bool changed = false;
   /* True if the format is multibyte.  */
   bool multibyte_format = 0;
   /* True if the output should be a multibyte string,
@@ -3921,6 +3929,8 @@ usage: (format STRING &rest OBJECTS)  */)
     if (STRINGP (args[n]) && STRING_MULTIBYTE (args[n]))
       multibyte = 1;
 
+  enum text_quoting_style quoting_style = text_quoting_style ();
+
   /* If we start out planning a unibyte result,
      then discover it has to be multibyte, we jump back to retry.  */
  retry:
@@ -4005,6 +4015,7 @@ usage: (format STRING &rest OBJECTS)  */)
          if (format == end)
            error ("Format string ends in middle of format specifier");
 
+         changed = true;
          memset (&discarded[format0 - format_start], 1, format - format0);
          conversion = *format;
          if (conversion == '%')
@@ -4426,6 +4437,20 @@ usage: (format STRING &rest OBJECTS)  */)
 
              convbytes = format - src;
              memset (&discarded[src + 1 - format_start], 2, convbytes - 1);
+
+             if (quoting_style != CURVE_QUOTING_STYLE && convbytes == 3
+                 && (unsigned char) src[0] == uLSQM0
+                 && (unsigned char) src[1] == uLSQM1
+                 && ((unsigned char) src[2] == uLSQM2
+                     || (unsigned char) src[2] == uRSQM2))
+               {
+                 convbytes = 1;
+                 str[0] = (((unsigned char) src[2] == uLSQM2
+                            && quoting_style == GRAVE_QUOTING_STYLE)
+                           ? '`' : '\'');
+                 src = (char *) str;
+                 changed = true;
+               }
            }
          else
            {
@@ -4437,6 +4462,7 @@ usage: (format STRING &rest OBJECTS)  */)
                  int c = BYTE8_TO_CHAR (uc);
                  convbytes = CHAR_STRING (c, str);
                  src = (char *) str;
+                 changed = true;
                }
            }
 
@@ -4484,113 +4510,119 @@ usage: (format STRING &rest OBJECTS)  */)
   if (bufsize < p - buf)
     emacs_abort ();
 
-  if (maybe_combine_byte)
-    nchars = multibyte_chars_in_text ((unsigned char *) buf, p - buf);
-  val = make_specified_string (buf, nchars, p - buf, multibyte);
-
-  /* If the format string has text properties, or any of the string
-     arguments has text properties, set up text properties of the
-     result string.  */
-
-  if (string_intervals (args[0]) || arg_intervals)
+  if (!changed)
+    val = args[0];
+  else
     {
-      Lisp_Object len, new_len, props;
-      struct gcpro gcpro1;
+      if (maybe_combine_byte)
+       nchars = multibyte_chars_in_text ((unsigned char *) buf, p - buf);
+      val = make_specified_string (buf, nchars, p - buf, multibyte);
 
-      /* Add text properties from the format string.  */
-      len = make_number (SCHARS (args[0]));
-      props = text_property_list (args[0], make_number (0), len, Qnil);
-      GCPRO1 (props);
+      /* If the format string has text properties, or any of the string
+        arguments has text properties, set up text properties of the
+        result string.  */
 
-      if (CONSP (props))
+      if (string_intervals (args[0]) || arg_intervals)
        {
-         ptrdiff_t bytepos = 0, position = 0, translated = 0;
-         ptrdiff_t argn = 1;
-         Lisp_Object list;
-
-         /* Adjust the bounds of each text property
-            to the proper start and end in the output string.  */
-
-         /* Put the positions in PROPS in increasing order, so that
-            we can do (effectively) one scan through the position
-            space of the format string.  */
-         props = Fnreverse (props);
-
-         /* BYTEPOS is the byte position in the format string,
-            POSITION is the untranslated char position in it,
-            TRANSLATED is the translated char position in BUF,
-            and ARGN is the number of the next arg we will come to.  */
-         for (list = props; CONSP (list); list = XCDR (list))
+         Lisp_Object len, new_len, props;
+         struct gcpro gcpro1;
+
+         /* Add text properties from the format string.  */
+         len = make_number (SCHARS (args[0]));
+         props = text_property_list (args[0], make_number (0), len, Qnil);
+         GCPRO1 (props);
+
+         if (CONSP (props))
            {
-             Lisp_Object item;
-             ptrdiff_t pos;
+             ptrdiff_t bytepos = 0, position = 0, translated = 0;
+             ptrdiff_t argn = 1;
+             Lisp_Object list;
+
+             /* Adjust the bounds of each text property
+                to the proper start and end in the output string.  */
+
+             /* Put the positions in PROPS in increasing order, so that
+                we can do (effectively) one scan through the position
+                space of the format string.  */
+             props = Fnreverse (props);
+
+             /* BYTEPOS is the byte position in the format string,
+                POSITION is the untranslated char position in it,
+                TRANSLATED is the translated char position in BUF,
+                and ARGN is the number of the next arg we will come to.  */
+             for (list = props; CONSP (list); list = XCDR (list))
+               {
+                 Lisp_Object item;
+                 ptrdiff_t pos;
 
-             item = XCAR (list);
+                 item = XCAR (list);
 
-             /* First adjust the property start position.  */
-             pos = XINT (XCAR (item));
+                 /* First adjust the property start position.  */
+                 pos = XINT (XCAR (item));
 
-             /* Advance BYTEPOS, POSITION, TRANSLATED and ARGN
-                up to this position.  */
-             for (; position < pos; bytepos++)
-               {
-                 if (! discarded[bytepos])
-                   position++, translated++;
-                 else if (discarded[bytepos] == 1)
+                 /* Advance BYTEPOS, POSITION, TRANSLATED and ARGN
+                    up to this position.  */
+                 for (; position < pos; bytepos++)
                    {
-                     position++;
-                     if (translated == info[argn].start)
+                     if (! discarded[bytepos])
+                       position++, translated++;
+                     else if (discarded[bytepos] == 1)
                        {
-                         translated += info[argn].end - info[argn].start;
-                         argn++;
+                         position++;
+                         if (translated == info[argn].start)
+                           {
+                             translated += info[argn].end - info[argn].start;
+                             argn++;
+                           }
                        }
                    }
-               }
 
-             XSETCAR (item, make_number (translated));
+                 XSETCAR (item, make_number (translated));
 
-             /* Likewise adjust the property end position.  */
-             pos = XINT (XCAR (XCDR (item)));
+                 /* Likewise adjust the property end position.  */
+                 pos = XINT (XCAR (XCDR (item)));
 
-             for (; position < pos; bytepos++)
-               {
-                 if (! discarded[bytepos])
-                   position++, translated++;
-                 else if (discarded[bytepos] == 1)
+                 for (; position < pos; bytepos++)
                    {
-                     position++;
-                     if (translated == info[argn].start)
+                     if (! discarded[bytepos])
+                       position++, translated++;
+                     else if (discarded[bytepos] == 1)
                        {
-                         translated += info[argn].end - info[argn].start;
-                         argn++;
+                         position++;
+                         if (translated == info[argn].start)
+                           {
+                             translated += info[argn].end - info[argn].start;
+                             argn++;
+                           }
                        }
                    }
+
+                 XSETCAR (XCDR (item), make_number (translated));
                }
 
-             XSETCAR (XCDR (item), make_number (translated));
+             add_text_properties_from_list (val, props, make_number (0));
            }
 
-         add_text_properties_from_list (val, props, make_number (0));
-       }
-
-      /* Add text properties from arguments.  */
-      if (arg_intervals)
-       for (n = 1; n < nargs; ++n)
-         if (info[n].intervals)
-           {
-             len = make_number (SCHARS (args[n]));
-             new_len = make_number (info[n].end - info[n].start);
-             props = text_property_list (args[n], make_number (0), len, Qnil);
-             props = extend_property_ranges (props, new_len);
-             /* If successive arguments have properties, be sure that
-                the value of `composition' property be the copy.  */
-             if (n > 1 && info[n - 1].end)
-               make_composition_value_copy (props);
-             add_text_properties_from_list (val, props,
-                                            make_number (info[n].start));
-           }
+         /* Add text properties from arguments.  */
+         if (arg_intervals)
+           for (n = 1; n < nargs; ++n)
+             if (info[n].intervals)
+               {
+                 len = make_number (SCHARS (args[n]));
+                 new_len = make_number (info[n].end - info[n].start);
+                 props = text_property_list (args[n], make_number (0),
+                                             len, Qnil);
+                 props = extend_property_ranges (props, new_len);
+                 /* If successive arguments have properties, be sure that
+                    the value of `composition' property be the copy.  */
+                 if (n > 1 && info[n - 1].end)
+                   make_composition_value_copy (props);
+                 add_text_properties_from_list (val, props,
+                                                make_number (info[n].start));
+               }
 
-      UNGCPRO;
+         UNGCPRO;
+       }
     }
 
   /* If we allocated BUF or INFO with malloc, free it too.  */
diff --git a/src/emacs.c b/src/emacs.c
index 6e35496..1392209 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -95,6 +95,10 @@ extern void moncontrol (int mode);
 #include <locale.h>
 #endif
 
+#if HAVE_WCHAR_H
+# include <wchar.h>
+#endif
+
 #ifdef HAVE_SETRLIMIT
 #include <sys/time.h>
 #include <sys/resource.h>
@@ -344,6 +348,19 @@ setlocale (int cat, char const *locale)
 }
 #endif
 
+/* True if the current system locale uses UTF-8 encoding.  */
+static bool
+using_utf8 (void)
+{
+#ifdef HAVE_WCHAR_H
+  wchar_t wc;
+  mbstate_t mbs = { 0 };
+  return mbrtowc (&wc, "\xc4\x80", 2, &mbs) == 2 && wc == 0x100;
+#else
+  return false;
+#endif
+}
+
 
 /* Report a fatal error due to signal SIG, output a backtrace of at
    most BACKTRACE_LIMIT lines, and exit.  */
@@ -924,6 +941,7 @@ main (int argc, char **argv)
      fixup_locale must wait until later, since it builds strings.  */
   if (do_initial_setlocale)
     setlocale (LC_ALL, "");
+  text_quoting_flag = using_utf8 ();
 
   inhibit_window_system = 0;
 
@@ -2154,17 +2172,23 @@ synchronize_locale (int category, Lisp_Object *plocale, 
Lisp_Object desired_loca
 {
   if (! EQ (*plocale, desired_locale))
     {
+      *plocale = desired_locale;
 #ifdef WINDOWSNT
       /* Changing categories like LC_TIME usually requires to specify
         an encoding suitable for the new locale, but MS-Windows's
         'setlocale' will only switch the encoding when LC_ALL is
-        specified.  So we ignore CATEGORY and use LC_ALL instead.  */
-      category = LC_ALL;
-#endif
-      *plocale = desired_locale;
+        specified.  So we ignore CATEGORY, use LC_ALL instead, and
+        then restore LC_NUMERIC to "C", so reading and printing
+        numbers is unaffected.  */
+      setlocale (LC_ALL, (STRINGP (desired_locale)
+                         ? SSDATA (desired_locale)
+                         : ""));
+      fixup_locale ();
+#else  /* !WINDOWSNT */
       setlocale (category, (STRINGP (desired_locale)
                            ? SSDATA (desired_locale)
                            : ""));
+#endif /* !WINDOWSNT */
     }
 }
 
@@ -2423,7 +2447,7 @@ Special values:
 Anything else (in Emacs 24.1, the possibilities are: aix, berkeley-unix,
 hpux, irix, usg-unix-v) indicates some sort of Unix system.  */);
   Vsystem_type = intern_c_string (SYSTEM_TYPE);
-  /* See configure.ac (and config.nt) for the possible SYSTEM_TYPEs.  */
+  /* See configure.ac for the possible SYSTEM_TYPEs.  */
 
   DEFVAR_LISP ("system-configuration", Vsystem_configuration,
               doc: /* Value is string indicating configuration Emacs was built 
for.  */);
diff --git a/src/image.c b/src/image.c
index 066db74..fb8c6e7 100644
--- a/src/image.c
+++ b/src/image.c
@@ -629,16 +629,19 @@ valid_image_p (Lisp_Object object)
 }
 
 
-/* Log error message with format string FORMAT and argument ARG.
+/* Log error message with format string FORMAT and trailing arguments.
    Signaling an error, e.g. when an image cannot be loaded, is not a
    good idea because this would interrupt redisplay, and the error
    message display would lead to another redisplay.  This function
    therefore simply displays a message.  */
 
 static void
-image_error (const char *format, Lisp_Object arg1, Lisp_Object arg2)
+image_error (const char *format, ...)
 {
-  add_to_log (format, arg1, arg2);
+  va_list ap;
+  va_start (ap, format);
+  vadd_to_log (format, ap);
+  va_end (ap);
 }
 
 
@@ -1954,7 +1957,7 @@ x_create_x_image_and_pixmap (struct frame *f, int width, 
int height, int depth,
                        depth > 16 ? 32 : depth > 8 ? 16 : 8, 0);
   if (*ximg == NULL)
     {
-      image_error ("Unable to allocate X image", Qnil, Qnil);
+      image_error ("Unable to allocate X image");
       return 0;
     }
 
@@ -1976,7 +1979,7 @@ x_create_x_image_and_pixmap (struct frame *f, int width, 
int height, int depth,
     {
       x_destroy_x_image (*ximg);
       *ximg = NULL;
-      image_error ("Unable to create X pixmap", Qnil, Qnil);
+      image_error ("Unable to create X pixmap");
       return 0;
     }
 
@@ -1997,7 +2000,7 @@ x_create_x_image_and_pixmap (struct frame *f, int width, 
int height, int depth,
   if (depth != 1 && depth != 4 && depth != 8
       && depth != 16 && depth != 24 && depth != 32)
     {
-      image_error ("Invalid image bit depth specified", Qnil, Qnil);
+      image_error ("Invalid image bit depth specified");
       return 0;
     }
 
@@ -2055,7 +2058,7 @@ x_create_x_image_and_pixmap (struct frame *f, int width, 
int height, int depth,
       Lisp_Object errcode;
       /* All system errors are < 10000, so the following is safe.  */
       XSETINT (errcode, err);
-      image_error ("Unable to create bitmap, error code %d", errcode, Qnil);
+      image_error ("Unable to create bitmap, error code %d", errcode);
       x_destroy_x_image (*ximg);
       *ximg = NULL;
       return 0;
@@ -2070,7 +2073,7 @@ x_create_x_image_and_pixmap (struct frame *f, int width, 
int height, int depth,
   if (*pixmap == 0)
     {
       *ximg = NULL;
-      image_error ("Unable to allocate NSImage for XPM pixmap", Qnil, Qnil);
+      image_error ("Unable to allocate NSImage for XPM pixmap");
       return 0;
     }
   *ximg = *pixmap;
@@ -2791,7 +2794,7 @@ xbm_read_bitmap_data (struct frame *f, unsigned char 
*contents, unsigned char *e
   if (!check_image_size (f, *width, *height))
     {
       if (!inhibit_image_error)
-       image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+       image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
       goto failure;
     }
   else if (data == NULL)
@@ -2936,13 +2939,14 @@ xbm_load_image (struct frame *f, struct image *img, 
unsigned char *contents,
       if (img->pixmap == NO_PIXMAP)
        {
          x_clear_image (f, img);
-         image_error ("Unable to create X pixmap for `%s'", img->spec, Qnil);
+         image_error ("Unable to create X pixmap for "uLSQM"%s"uRSQM,
+                      img->spec);
        }
       else
        success_p = 1;
     }
   else
-    image_error ("Error loading XBM image `%s'", img->spec, Qnil);
+    image_error ("Error loading XBM image "uLSQM"%s"uRSQM, img->spec);
 
   return success_p;
 }
@@ -2983,14 +2987,14 @@ xbm_load (struct frame *f, struct image *img)
       file = x_find_image_file (file_name);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file `%s'", file_name, Qnil);
+         image_error ("Cannot find image file "uLSQM"%s"uRSQM, file_name);
          return 0;
        }
 
       contents = slurp_file (SSDATA (file), &size);
       if (contents == NULL)
        {
-         image_error ("Error loading XBM image `%s'", img->spec, Qnil);
+         image_error ("Error loading XBM image "uLSQM"%s"uRSQM, img->spec);
          return 0;
        }
 
@@ -3025,8 +3029,8 @@ xbm_load (struct frame *f, struct image *img)
          eassert (img->width > 0 && img->height > 0);
          if (!check_image_size (f, img->width, img->height))
            {
-             image_error ("Invalid image size (see `max-image-size')",
-                          Qnil, Qnil);
+             image_error ("Invalid image size (see "
+                          uLSQM"max-image-size"uRSQM")");
              return 0;
            }
        }
@@ -3103,8 +3107,9 @@ xbm_load (struct frame *f, struct image *img)
            success_p = 1;
          else
            {
-             image_error ("Unable to create pixmap for XBM image `%s'",
-                          img->spec, Qnil);
+             image_error (("Unable to create pixmap for XBM image "
+                           uLSQM"%s"uRSQM),
+                          img->spec);
              x_clear_image (f, img);
            }
 
@@ -3626,7 +3631,8 @@ xpm_load (struct frame *f, struct image *img)
       Lisp_Object file = x_find_image_file (specified_file);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file `%s'", specified_file, Qnil);
+         image_error ("Cannot find image file "uLSQM"%s"uRSQM,
+                      specified_file);
 #ifdef ALLOC_XPM_COLORS
          xpm_free_color_cache ();
 #endif
@@ -3657,7 +3663,7 @@ xpm_load (struct frame *f, struct image *img)
       Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL);
       if (!STRINGP (buffer))
        {
-         image_error ("Invalid image data `%s'", buffer, Qnil);
+         image_error ("Invalid image data "uLSQM"%s"uRSQM, buffer);
 #ifdef ALLOC_XPM_COLORS
          xpm_free_color_cache ();
 #endif
@@ -3815,23 +3821,23 @@ xpm_load (struct frame *f, struct image *img)
       switch (rc)
        {
        case XpmOpenFailed:
-         image_error ("Error opening XPM file (%s)", img->spec, Qnil);
+         image_error ("Error opening XPM file (%s)", img->spec);
          break;
 
        case XpmFileInvalid:
-         image_error ("Invalid XPM file (%s)", img->spec, Qnil);
+         image_error ("Invalid XPM file (%s)", img->spec);
          break;
 
        case XpmNoMemory:
-         image_error ("Out of memory (%s)", img->spec, Qnil);
+         image_error ("Out of memory (%s)", img->spec);
          break;
 
        case XpmColorFailed:
-         image_error ("Color allocation error (%s)", img->spec, Qnil);
+         image_error ("Color allocation error (%s)", img->spec);
          break;
 
        default:
-         image_error ("Unknown error (%s)", img->spec, Qnil);
+         image_error ("Unknown error (%s)", img->spec);
          break;
        }
     }
@@ -4101,7 +4107,7 @@ xpm_load_image (struct frame *f,
 
   if (!check_image_size (f, width, height))
     {
-      image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
       goto failure;
     }
 
@@ -4112,7 +4118,7 @@ xpm_load_image (struct frame *f,
 #endif
       )
     {
-      image_error ("Image too large", Qnil, Qnil);
+      image_error ("Image too large");
       goto failure;
     }
 
@@ -4262,7 +4268,7 @@ xpm_load_image (struct frame *f,
   return 1;
 
  failure:
-  image_error ("Invalid XPM file (%s)", img->spec, Qnil);
+  image_error ("Invalid XPM file (%s)", img->spec);
   x_destroy_x_image (ximg);
   x_destroy_x_image (mask_img);
   x_clear_image (f, img);
@@ -4291,14 +4297,14 @@ xpm_load (struct frame *f,
       file = x_find_image_file (file_name);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file `%s'", file_name, Qnil);
+         image_error ("Cannot find image file "uLSQM"%s"uRSQM, file_name);
          return 0;
        }
 
       contents = slurp_file (SSDATA (file), &size);
       if (contents == NULL)
        {
-         image_error ("Error loading XPM image `%s'", img->spec, Qnil);
+         image_error ("Error loading XPM image "uLSQM"%s"uRSQM, img->spec);
          return 0;
        }
 
@@ -4312,7 +4318,7 @@ xpm_load (struct frame *f,
       data = image_spec_value (img->spec, QCdata, NULL);
       if (!STRINGP (data))
        {
-         image_error ("Invalid image data `%s'", data, Qnil);
+         image_error ("Invalid image data "uLSQM"%s"uRSQM, data);
          return 0;
        }
       success_p = xpm_load_image (f, img, SDATA (data),
@@ -4734,7 +4740,7 @@ XPutPixel (XImagePtr ximg, int x, int y, COLORREF color)
        *pixel = *pixel & ~(1 << x % 8);
     }
   else
-    image_error ("XPutPixel: palette image not supported", Qnil, Qnil);
+    image_error ("XPutPixel: palette image not supported");
 }
 
 #endif /* HAVE_NTGUI */
@@ -5266,14 +5272,15 @@ pbm_load (struct frame *f, struct image *img)
       file = x_find_image_file (specified_file);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file `%s'", specified_file, Qnil);
+         image_error ("Cannot find image file "uLSQM"%s"uRSQM,
+                      specified_file);
          return 0;
        }
 
       contents = slurp_file (SSDATA (file), &size);
       if (contents == NULL)
        {
-         image_error ("Error reading `%s'", file, Qnil);
+         image_error ("Error reading "uLSQM"%s"uRSQM, file);
          return 0;
        }
 
@@ -5286,7 +5293,7 @@ pbm_load (struct frame *f, struct image *img)
       data = image_spec_value (img->spec, QCdata, NULL);
       if (!STRINGP (data))
        {
-         image_error ("Invalid image data `%s'", data, Qnil);
+         image_error ("Invalid image data "uLSQM"%s"uRSQM, data);
          return 0;
        }
       p = SDATA (data);
@@ -5296,7 +5303,7 @@ pbm_load (struct frame *f, struct image *img)
   /* Check magic number.  */
   if (end - p < 2 || *p++ != 'P')
     {
-      image_error ("Not a PBM image: `%s'", img->spec, Qnil);
+      image_error ("Not a PBM image: "uLSQM"%s"uRSQM, img->spec);
     error:
       xfree (contents);
       img->pixmap = NO_PIXMAP;
@@ -5330,7 +5337,7 @@ pbm_load (struct frame *f, struct image *img)
       break;
 
     default:
-      image_error ("Not a PBM image: `%s'", img->spec, Qnil);
+      image_error ("Not a PBM image: "uLSQM"%s"uRSQM, img->spec);
       goto error;
     }
 
@@ -5349,14 +5356,14 @@ pbm_load (struct frame *f, struct image *img)
       max_color_idx = pbm_scan_number (&p, end);
       if (max_color_idx > 65535 || max_color_idx < 0)
        {
-         image_error ("Unsupported maximum PBM color value", Qnil, Qnil);
+         image_error ("Unsupported maximum PBM color value");
          goto error;
        }
     }
 
   if (!check_image_size (f, width, height))
     {
-      image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
       goto error;
     }
 
@@ -5429,8 +5436,9 @@ pbm_load (struct frame *f, struct image *img)
                        x_destroy_x_image (ximg);
 #endif
                        x_clear_image (f, img);
-                       image_error ("Invalid image size in image `%s'",
-                                    img->spec, Qnil);
+                       image_error (("Invalid image size in image "
+                                     uLSQM"%s"uRSQM),
+                                    img->spec);
                        goto error;
                      }
                    c = *p++;
@@ -5464,8 +5472,8 @@ pbm_load (struct frame *f, struct image *img)
          x_destroy_x_image (ximg);
 #endif
          x_clear_image (f, img);
-         image_error ("Invalid image size in image `%s'",
-                      img->spec, Qnil);
+         image_error ("Invalid image size in image "uLSQM"%s"uRSQM,
+                      img->spec);
          goto error;
        }
 
@@ -5508,8 +5516,8 @@ pbm_load (struct frame *f, struct image *img)
 #else
                x_destroy_x_image (ximg);
 #endif
-               image_error ("Invalid pixel value in image `%s'",
-                            img->spec, Qnil);
+               image_error ("Invalid pixel value in image "uLSQM"%s"uRSQM,
+                            img->spec);
                goto error;
              }
 
@@ -5800,7 +5808,7 @@ my_png_error (png_struct *png_ptr, const char *msg)
   eassert (png_ptr != NULL);
   /* Avoid compiler warning about deprecated direct access to
      png_ptr's fields in libpng versions 1.4.x.  */
-  image_error ("PNG error: %s", build_string (msg), Qnil);
+  image_error ("PNG error: %s", build_string (msg));
   PNG_LONGJMP (png_ptr);
 }
 
@@ -5809,7 +5817,7 @@ static void
 my_png_warning (png_struct *png_ptr, const char *msg)
 {
   eassert (png_ptr != NULL);
-  image_error ("PNG warning: %s", build_string (msg), Qnil);
+  image_error ("PNG warning: %s", build_string (msg));
 }
 
 /* Memory source for PNG decoding.  */
@@ -5904,7 +5912,8 @@ png_load_body (struct frame *f, struct image *img, struct 
png_load_context *c)
       file = x_find_image_file (specified_file);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file `%s'", specified_file, Qnil);
+         image_error ("Cannot find image file "uLSQM"%s"uRSQM,
+                      specified_file);
          return 0;
        }
 
@@ -5912,7 +5921,7 @@ png_load_body (struct frame *f, struct image *img, struct 
png_load_context *c)
       fp = emacs_fopen (SSDATA (file), "rb");
       if (!fp)
        {
-         image_error ("Cannot open image file `%s'", file, Qnil);
+         image_error ("Cannot open image file "uLSQM"%s"uRSQM, file);
          return 0;
        }
 
@@ -5921,7 +5930,7 @@ png_load_body (struct frame *f, struct image *img, struct 
png_load_context *c)
          || png_sig_cmp (sig, 0, sizeof sig))
        {
          fclose (fp);
-         image_error ("Not a PNG file: `%s'", file, Qnil);
+         image_error ("Not a PNG file: "uLSQM"%s"uRSQM, file);
          return 0;
        }
     }
@@ -5929,7 +5938,7 @@ png_load_body (struct frame *f, struct image *img, struct 
png_load_context *c)
     {
       if (!STRINGP (specified_data))
        {
-         image_error ("Invalid image data `%s'", specified_data, Qnil);
+         image_error ("Invalid image data "uLSQM"%s"uRSQM, specified_data);
          return 0;
        }
 
@@ -5942,7 +5951,7 @@ png_load_body (struct frame *f, struct image *img, struct 
png_load_context *c)
       if (tbr.len < sizeof sig
          || png_sig_cmp (tbr.bytes, 0, sizeof sig))
        {
-         image_error ("Not a PNG image: `%s'", img->spec, Qnil);
+         image_error ("Not a PNG image: "uLSQM"%s"uRSQM, img->spec);
          return 0;
        }
 
@@ -6010,7 +6019,7 @@ png_load_body (struct frame *f, struct image *img, struct 
png_load_context *c)
   if (! (width <= INT_MAX && height <= INT_MAX
         && check_image_size (f, width, height)))
     {
-      image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
       goto error;
     }
 
@@ -6668,20 +6677,21 @@ jpeg_load_body (struct frame *f, struct image *img,
       file = x_find_image_file (specified_file);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file `%s'", specified_file, Qnil);
+         image_error ("Cannot find image file "uLSQM"%s"uRSQM,
+                      specified_file);
          return 0;
        }
 
       fp = emacs_fopen (SSDATA (file), "rb");
       if (fp == NULL)
        {
-         image_error ("Cannot open `%s'", file, Qnil);
+         image_error ("Cannot open "uLSQM"%s"uRSQM, file);
          return 0;
        }
     }
   else if (!STRINGP (specified_data))
     {
-      image_error ("Invalid image data `%s'", specified_data, Qnil);
+      image_error ("Invalid image data "uLSQM"%s"uRSQM, specified_data);
       return 0;
     }
 
@@ -6697,13 +6707,14 @@ jpeg_load_body (struct frame *f, struct image *img,
          {
            char buf[JMSG_LENGTH_MAX];
            mgr->cinfo.err->format_message ((j_common_ptr) &mgr->cinfo, buf);
-           image_error ("Error reading JPEG image `%s': %s", img->spec,
-                        build_string (buf));
+           image_error ("Error reading JPEG image "uLSQM"%s"uRSQM": %s",
+                        img->spec, build_string (buf));
            break;
          }
 
        case MY_JPEG_INVALID_IMAGE_SIZE:
-         image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+         image_error ("Invalid image size (see "
+                      uLSQM"max-image-size"uRSQM")");
          break;
 
        case MY_JPEG_CANNOT_CREATE_X:
@@ -7183,7 +7194,8 @@ tiff_load (struct frame *f, struct image *img)
       file = x_find_image_file (specified_file);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file `%s'", specified_file, Qnil);
+         image_error ("Cannot find image file "uLSQM"%s"uRSQM,
+                      specified_file);
          return 0;
        }
 # ifdef WINDOWSNT
@@ -7194,7 +7206,7 @@ tiff_load (struct frame *f, struct image *img)
       tiff = TIFFOpen (SSDATA (file), "r");
       if (tiff == NULL)
        {
-         image_error ("Cannot open `%s'", file, Qnil);
+         image_error ("Cannot open "uLSQM"%s"uRSQM, file);
          return 0;
        }
     }
@@ -7202,7 +7214,7 @@ tiff_load (struct frame *f, struct image *img)
     {
       if (!STRINGP (specified_data))
        {
-         image_error ("Invalid image data `%s'", specified_data, Qnil);
+         image_error ("Invalid image data "uLSQM"%s"uRSQM, specified_data);
          return 0;
        }
 
@@ -7222,7 +7234,8 @@ tiff_load (struct frame *f, struct image *img)
 
       if (!tiff)
        {
-         image_error ("Cannot open memory source for `%s'", img->spec, Qnil);
+         image_error ("Cannot open memory source for "uLSQM"%s"uRSQM,
+                      img->spec);
          return 0;
        }
     }
@@ -7234,8 +7247,9 @@ tiff_load (struct frame *f, struct image *img)
       if (! (TYPE_MINIMUM (tdir_t) <= ino && ino <= TYPE_MAXIMUM (tdir_t)
             && TIFFSetDirectory (tiff, ino)))
        {
-         image_error ("Invalid image number `%s' in image `%s'",
-                      image, img->spec);
+         image_error
+           ("Invalid image number "uLSQM"%s"uRSQM" in image "uLSQM"%s"uRSQM,
+            image, img->spec);
          TIFFClose (tiff);
          return 0;
        }
@@ -7248,7 +7262,7 @@ tiff_load (struct frame *f, struct image *img)
 
   if (!check_image_size (f, width, height))
     {
-      image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
       TIFFClose (tiff);
       return 0;
     }
@@ -7278,7 +7292,7 @@ tiff_load (struct frame *f, struct image *img)
   TIFFClose (tiff);
   if (!rc)
     {
-      image_error ("Error reading TIFF image `%s'", img->spec, Qnil);
+      image_error ("Error reading TIFF image "uLSQM"%s"uRSQM, img->spec);
       xfree (buf);
       return 0;
     }
@@ -7615,7 +7629,8 @@ gif_load (struct frame *f, struct image *img)
       file = x_find_image_file (specified_file);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file `%s'", specified_file, Qnil);
+         image_error ("Cannot find image file "uLSQM"%s"uRSQM,
+                      specified_file);
          return 0;
        }
 #ifdef WINDOWSNT
@@ -7627,14 +7642,14 @@ gif_load (struct frame *f, struct image *img)
       gif = DGifOpenFileName (SSDATA (file));
       if (gif == NULL)
        {
-         image_error ("Cannot open `%s'", file, Qnil);
+         image_error ("Cannot open "uLSQM"%s"uRSQM, file);
          return 0;
        }
 #else
       gif = DGifOpenFileName (SSDATA (file), &gif_err);
       if (gif == NULL)
        {
-         image_error ("Cannot open `%s': %s",
+         image_error ("Cannot open "uLSQM"%s"uRSQM": %s",
                       file, build_string (GifErrorString (gif_err)));
          return 0;
        }
@@ -7644,7 +7659,7 @@ gif_load (struct frame *f, struct image *img)
     {
       if (!STRINGP (specified_data))
        {
-         image_error ("Invalid image data `%s'", specified_data, Qnil);
+         image_error ("Invalid image data "uLSQM"%s"uRSQM, specified_data);
          return 0;
        }
 
@@ -7658,14 +7673,14 @@ gif_load (struct frame *f, struct image *img)
       gif = DGifOpen (&memsrc, gif_read_from_memory);
       if (!gif)
        {
-         image_error ("Cannot open memory source `%s'", img->spec, Qnil);
+         image_error ("Cannot open memory source "uLSQM"%s"uRSQM, img->spec);
          return 0;
        }
 #else
       gif = DGifOpen (&memsrc, gif_read_from_memory, &gif_err);
       if (!gif)
        {
-         image_error ("Cannot open memory source `%s': %s",
+         image_error ("Cannot open memory source "uLSQM"%s"uRSQM": %s",
                       img->spec, build_string (GifErrorString (gif_err)));
          return 0;
        }
@@ -7675,7 +7690,7 @@ gif_load (struct frame *f, struct image *img)
   /* Before reading entire contents, check the declared image size. */
   if (!check_image_size (f, gif->SWidth, gif->SHeight))
     {
-      image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
       gif_close (gif, NULL);
       return 0;
     }
@@ -7684,7 +7699,7 @@ gif_load (struct frame *f, struct image *img)
   rc = DGifSlurp (gif);
   if (rc == GIF_ERROR || gif->ImageCount <= 0)
     {
-      image_error ("Error reading `%s'", img->spec, Qnil);
+      image_error ("Error reading "uLSQM"%s"uRSQM, img->spec);
       gif_close (gif, NULL);
       return 0;
     }
@@ -7695,8 +7710,9 @@ gif_load (struct frame *f, struct image *img)
     idx = INTEGERP (image_number) ? XFASTINT (image_number) : 0;
     if (idx < 0 || idx >= gif->ImageCount)
       {
-       image_error ("Invalid image number `%s' in image `%s'",
-                    image_number, img->spec);
+       image_error
+         ("Invalid image number "uLSQM"%s"uRSQM" in image "uLSQM"%s"uRSQM,
+          image_number, img->spec);
        gif_close (gif, NULL);
        return 0;
       }
@@ -7714,7 +7730,7 @@ gif_load (struct frame *f, struct image *img)
 
   if (!check_image_size (f, width, height))
     {
-      image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
       gif_close (gif, NULL);
       return 0;
     }
@@ -7732,7 +7748,7 @@ gif_load (struct frame *f, struct image *img)
             && 0 <= subimg_top && subimg_top <= height - subimg_height
             && 0 <= subimg_left && subimg_left <= width - subimg_width))
        {
-         image_error ("Subimage does not fit in image", Qnil, Qnil);
+         image_error ("Subimage does not fit in image");
          gif_close (gif, NULL);
          return 0;
        }
@@ -7968,10 +7984,10 @@ gif_load (struct frame *f, struct image *img)
       char *error_text = GifErrorString (gif_err);
 
       if (error_text)
-       image_error ("Error closing `%s': %s",
+       image_error ("Error closing "uLSQM"%s"uRSQM": %s",
                     img->spec, build_string (error_text));
 #else
-      image_error ("Error closing `%s'", img->spec, Qnil);
+      image_error ("Error closing "uLSQM"%s"uRSQM, img->spec);
 #endif
     }
 
@@ -8220,9 +8236,7 @@ imagemagick_error (MagickWand *wand)
   ExceptionType severity;
 
   description = MagickGetException (wand, &severity);
-  image_error ("ImageMagick error: %s",
-              build_string (description),
-              Qnil);
+  image_error ("ImageMagick error: %s", build_string (description));
   MagickRelinquishMemory (description);
 }
 
@@ -8383,8 +8397,7 @@ imagemagick_compute_animated_image (MagickWand 
*super_wand, int ino)
          DestroyMagickWand (composite_wand);
          DestroyMagickWand (sub_wand);
          cache->wand = NULL;
-         image_error ("Imagemagick pixel iterator creation failed",
-                      Qnil, Qnil);
+         image_error ("Imagemagick pixel iterator creation failed");
          return NULL;
        }
 
@@ -8395,8 +8408,7 @@ imagemagick_compute_animated_image (MagickWand 
*super_wand, int ino)
          DestroyMagickWand (sub_wand);
          DestroyPixelIterator (source_iterator);
          cache->wand = NULL;
-         image_error ("Imagemagick pixel iterator creation failed",
-                      Qnil, Qnil);
+         image_error ("Imagemagick pixel iterator creation failed");
          return NULL;
        }
 
@@ -8516,8 +8528,9 @@ imagemagick_load_image (struct frame *f, struct image 
*img,
 
   if (ino < 0 || ino >= MagickGetNumberImages (image_wand))
     {
-      image_error ("Invalid image number `%s' in image `%s'",
-                  image, img->spec);
+      image_error
+       ("Invalid image number "uLSQM"%s"uRSQM" in image "uLSQM"%s"uRSQM,
+        image, img->spec);
       DestroyMagickWand (image_wand);
       return 0;
     }
@@ -8571,7 +8584,7 @@ imagemagick_load_image (struct frame *f, struct image 
*img,
       status = MagickScaleImage (image_wand, desired_width, desired_height);
       if (status == MagickFalse)
        {
-         image_error ("Imagemagick scale failed", Qnil, Qnil);
+         image_error ("Imagemagick scale failed");
          imagemagick_error (image_wand);
          goto imagemagick_error;
        }
@@ -8621,7 +8634,7 @@ imagemagick_load_image (struct frame *f, struct image 
*img,
       status = MagickRotateImage (image_wand, bg_wand, rotation);
       if (status == MagickFalse)
         {
-          image_error ("Imagemagick image rotate failed", Qnil, Qnil);
+          image_error ("Imagemagick image rotate failed");
          imagemagick_error (image_wand);
           goto imagemagick_error;
         }
@@ -8651,7 +8664,7 @@ imagemagick_load_image (struct frame *f, struct image 
*img,
   if (! (image_width <= INT_MAX && image_height <= INT_MAX
         && check_image_size (f, image_width, image_height)))
     {
-      image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
       goto imagemagick_error;
     }
 
@@ -8678,7 +8691,7 @@ imagemagick_load_image (struct frame *f, struct image 
*img,
 #ifdef COLOR_TABLE_SUPPORT
          free_color_table ();
 #endif
-         image_error ("Imagemagick X bitmap allocation failure", Qnil, Qnil);
+         image_error ("Imagemagick X bitmap allocation failure");
          goto imagemagick_error;
        }
 
@@ -8718,7 +8731,7 @@ imagemagick_load_image (struct frame *f, struct image 
*img,
 #ifdef COLOR_TABLE_SUPPORT
          free_color_table ();
 #endif
-          image_error ("Imagemagick X bitmap allocation failure", Qnil, Qnil);
+          image_error ("Imagemagick X bitmap allocation failure");
           goto imagemagick_error;
         }
 
@@ -8734,8 +8747,7 @@ imagemagick_load_image (struct frame *f, struct image 
*img,
          free_color_table ();
 #endif
          x_destroy_x_image (ximg);
-          image_error ("Imagemagick pixel iterator creation failed",
-                       Qnil, Qnil);
+          image_error ("Imagemagick pixel iterator creation failed");
           goto imagemagick_error;
         }
 
@@ -8787,7 +8799,7 @@ imagemagick_load_image (struct frame *f, struct image 
*img,
 
   MagickWandTerminus ();
   /* TODO more cleanup.  */
-  image_error ("Error parsing IMAGEMAGICK image `%s'", img->spec, Qnil);
+  image_error ("Error parsing IMAGEMAGICK image "uLSQM"%s"uRSQM, img->spec);
   return 0;
 }
 
@@ -8811,7 +8823,7 @@ imagemagick_load (struct frame *f, struct image *img)
       file = x_find_image_file (file_name);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file `%s'", file_name, Qnil);
+         image_error ("Cannot find image file "uLSQM"%s"uRSQM, file_name);
          return 0;
        }
 #ifdef WINDOWSNT
@@ -8828,7 +8840,7 @@ imagemagick_load (struct frame *f, struct image *img)
       data = image_spec_value (img->spec, QCdata, NULL);
       if (!STRINGP (data))
        {
-         image_error ("Invalid image data `%s'", data, Qnil);
+         image_error ("Invalid image data "uLSQM"%s"uRSQM, data);
          return 0;
        }
       success_p = imagemagick_load_image (f, img, SDATA (data),
@@ -9092,7 +9104,7 @@ svg_load (struct frame *f, struct image *img)
       file = x_find_image_file (file_name);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file `%s'", file_name, Qnil);
+         image_error ("Cannot find image file "uLSQM"%s"uRSQM, file_name);
          return 0;
        }
 
@@ -9100,7 +9112,7 @@ svg_load (struct frame *f, struct image *img)
       contents = slurp_file (SSDATA (file), &size);
       if (contents == NULL)
        {
-         image_error ("Error loading SVG image `%s'", img->spec, Qnil);
+         image_error ("Error loading SVG image "uLSQM"%s"uRSQM, img->spec);
          return 0;
        }
       /* If the file was slurped into memory properly, parse it.  */
@@ -9116,7 +9128,7 @@ svg_load (struct frame *f, struct image *img)
       data = image_spec_value (img->spec, QCdata, NULL);
       if (!STRINGP (data))
        {
-         image_error ("Invalid image data `%s'", data, Qnil);
+         image_error ("Invalid image data "uLSQM"%s"uRSQM, data);
          return 0;
        }
       original_filename = BVAR (current_buffer, filename);
@@ -9183,7 +9195,7 @@ svg_load_image (struct frame *f,         /* Pointer to 
emacs frame structure.  *
   rsvg_handle_get_dimensions (rsvg_handle, &dimension_data);
   if (! check_image_size (f, dimension_data.width, dimension_data.height))
     {
-      image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
       goto rsvg_error;
     }
 
@@ -9315,7 +9327,7 @@ svg_load_image (struct frame *f,         /* Pointer to 
emacs frame structure.  *
   g_object_unref (rsvg_handle);
   /* FIXME: Use error->message so the user knows what is the actual
      problem with the image.  */
-  image_error ("Error parsing SVG image `%s'", img->spec, Qnil);
+  image_error ("Error parsing SVG image "uLSQM"%s"uRSQM, img->spec);
   g_error_free (err);
   return 0;
 }
@@ -9468,7 +9480,7 @@ gs_load (struct frame *f, struct image *img)
   if (! (in_width <= INT_MAX && in_height <= INT_MAX
         && check_image_size (f, in_width, in_height)))
     {
-      image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
       return 0;
     }
   img->width = in_width;
@@ -9489,7 +9501,7 @@ gs_load (struct frame *f, struct image *img)
 
   if (!img->pixmap)
     {
-      image_error ("Unable to create pixmap for `%s'", img->spec, Qnil);
+      image_error ("Unable to create pixmap for "uLSQM"%s"uRSQM, img->spec);
       return 0;
     }
 
@@ -9601,8 +9613,9 @@ x_kill_gs_process (Pixmap pixmap, struct frame *f)
 #endif
        }
       else
-       image_error ("Cannot get X image of `%s'; colors will not be freed",
-                    img->spec, Qnil);
+       image_error (("Cannot get X image of "uLSQM"%s"uRSQM";"
+                     " colors will not be freed"),
+                    img->spec);
 
       unblock_input ();
     }
diff --git a/src/keyboard.c b/src/keyboard.c
index 5f86675..a577105 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -583,7 +583,7 @@ echo_now (void)
   if (!current_kboard->immediate_echo)
     {
       ptrdiff_t i;
-      current_kboard->immediate_echo = 1;
+      current_kboard->immediate_echo = true;
 
       for (i = 0; i < this_command_key_count; i++)
        {
@@ -611,10 +611,10 @@ echo_now (void)
       echo_dash ();
     }
 
-  echoing = 1;
+  echoing = true;
   /* FIXME: Use call (Qmessage) so it can be advised (e.g. emacspeak).  */
   message3_nolog (KVAR (current_kboard, echo_string));
-  echoing = 0;
+  echoing = false;
 
   /* Record in what buffer we echoed, and from which kboard.  */
   echo_message_buffer = echo_area_buffer[0];
@@ -629,7 +629,7 @@ echo_now (void)
 void
 cancel_echoing (void)
 {
-  current_kboard->immediate_echo = 0;
+  current_kboard->immediate_echo = false;
   current_kboard->echo_after_prompt = -1;
   kset_echo_string (current_kboard, Qnil);
   ok_to_echo_at_next_pause = NULL;
@@ -819,11 +819,11 @@ any_kboard_state ()
     {
       current_kboard->kbd_queue
        = nconc2 (Vunread_command_events, current_kboard->kbd_queue);
-      current_kboard->kbd_queue_has_data = 1;
+      current_kboard->kbd_queue_has_data = true;
     }
   Vunread_command_events = Qnil;
 #endif
-  single_kboard = 0;
+  single_kboard = false;
 }
 
 /* Switch to the single-kboard state, making current_kboard
@@ -832,7 +832,7 @@ any_kboard_state ()
 void
 single_kboard_state ()
 {
-  single_kboard = 1;
+  single_kboard = true;
 }
 #endif
 
@@ -843,7 +843,7 @@ void
 not_single_kboard_state (KBOARD *kboard)
 {
   if (kboard == current_kboard)
-    single_kboard = 0;
+    single_kboard = false;
 }
 
 /* Maintain a stack of kboards, so other parts of Emacs
@@ -875,13 +875,13 @@ pop_kboard (void)
 {
   struct terminal *t;
   struct kboard_stack *p = kboard_stack;
-  bool found = 0;
+  bool found = false;
   for (t = terminal_list; t; t = t->next_terminal)
     {
       if (t->kboard == p->kboard)
         {
           current_kboard = p->kboard;
-          found = 1;
+          found = true;
           break;
         }
     }
@@ -889,7 +889,7 @@ pop_kboard (void)
     {
       /* The terminal we remembered has been deleted.  */
       current_kboard = FRAME_KBOARD (SELECTED_FRAME ());
-      single_kboard = 0;
+      single_kboard = false;
     }
   kboard_stack = p->next;
   xfree (p);
@@ -929,7 +929,7 @@ temporarily_switch_to_single_kboard (struct frame *f)
     }
   else if (f != NULL)
     current_kboard = FRAME_KBOARD (f);
-  single_kboard = 1;
+  single_kboard = true;
   record_unwind_protect_int (restore_kboard_configuration, was_locked);
 }
 
@@ -1092,7 +1092,11 @@ command_loop (void)
   /* At least on GNU/Linux, saving signal mask is important here.  */
   if (sigsetjmp (return_to_command_loop, 1) != 0)
     {
-      /* Comes here from handle_sigsegv, see sysdep.c.  */
+      /* Comes here from handle_sigsegv (see sysdep.c) and
+        stack_overflow_handler (see w32fns.c).  */
+#ifdef WINDOWSNT
+      w32_reset_stack_overflow_guard ();
+#endif
       init_eval ();
       Vinternal__top_level_message = recover_top_level_message;
     }
@@ -1298,11 +1302,11 @@ command_loop_1 (void)
   kset_prefix_arg (current_kboard, Qnil);
   kset_last_prefix_arg (current_kboard, Qnil);
   Vdeactivate_mark = Qnil;
-  waiting_for_input = 0;
+  waiting_for_input = false;
   cancel_echoing ();
 
   this_command_key_count = 0;
-  this_command_key_count_reset = 0;
+  this_command_key_count_reset = false;
   this_single_command_key_start = 0;
 
   if (NILP (Vmemory_full))
@@ -1420,7 +1424,7 @@ command_loop_1 (void)
        {
          cancel_echoing ();
          this_command_key_count = 0;
-         this_command_key_count_reset = 0;
+         this_command_key_count_reset = false;
          this_single_command_key_start = 0;
          goto finalize;
        }
@@ -1562,7 +1566,7 @@ command_loop_1 (void)
            kset_last_repeatable_command (current_kboard, Vreal_this_command);
          cancel_echoing ();
          this_command_key_count = 0;
-         this_command_key_count_reset = 0;
+         this_command_key_count_reset = false;
          this_single_command_key_start = 0;
        }
 
@@ -1679,7 +1683,8 @@ adjust_point_for_property (ptrdiff_t last_pt, bool 
modified)
      suppress the point adjustment for automatic composition so that a
      user can keep inserting another character at point or keep
      deleting characters around point.  */
-  bool check_composition = ! modified, check_display = 1, check_invisible = 1;
+  bool check_composition = ! modified;
+  bool check_display = true, check_invisible = true;
   ptrdiff_t orig_pt = PT;
 
   eassert (XBUFFER (XWINDOW (selected_window)->contents) == current_buffer);
@@ -1694,9 +1699,9 @@ adjust_point_for_property (ptrdiff_t last_pt, bool 
modified)
          && (beg = composition_adjust_point (last_pt, PT)) != PT)
        {
          SET_PT (beg);
-         check_display = check_invisible = 1;
+         check_display = check_invisible = true;
        }
-      check_composition = 0;
+      check_composition = false;
       if (check_display
          && PT > BEGV && PT < ZV
          && !NILP (val = get_char_property_and_overlay
@@ -1716,13 +1721,13 @@ adjust_point_for_property (ptrdiff_t last_pt, bool 
modified)
                     ? max (beg - 1, BEGV)
                     : beg)
                  : end);
-         check_composition = check_invisible = 1;
+         check_composition = check_invisible = true;
        }
-      check_display = 0;
+      check_display = false;
       if (check_invisible && PT > BEGV && PT < ZV)
        {
          int inv;
-         bool ellipsis = 0;
+         bool ellipsis = false;
          beg = end = PT;
 
          /* Find boundaries `beg' and `end' of the invisible area, if any.  */
@@ -1788,7 +1793,7 @@ adjust_point_for_property (ptrdiff_t last_pt, bool 
modified)
                         was already in the range: we don't get to choose
                         which end of the range we have to go to.  */
                      : (PT < last_pt ? beg : end));
-             check_composition = check_display = 1;
+             check_composition = check_display = true;
            }
 #if 0 /* This assertion isn't correct, because SET_PT may end up setting
         the point to something other than its argument, due to
@@ -1801,9 +1806,9 @@ adjust_point_for_property (ptrdiff_t last_pt, bool 
modified)
          if (!modified && !ellipsis && beg < end)
            {
              if (last_pt == beg && PT == end && end < ZV)
-               (check_composition = check_display = 1, SET_PT (end + 1));
+               (check_composition = check_display = true, SET_PT (end + 1));
              else if (last_pt == end && PT == beg && beg > BEGV)
-               (check_composition = check_display = 1, SET_PT (beg - 1));
+               (check_composition = check_display = true, SET_PT (beg - 1));
              else if (PT == ((PT < last_pt) ? beg : end))
                /* We've already moved as far as we can.  Trying to go
                   to the other end would mean moving backwards and thus
@@ -1816,11 +1821,11 @@ adjust_point_for_property (ptrdiff_t last_pt, bool 
modified)
                                  (make_number (PT == beg ? end : beg),
                                   Qinvisible, Qnil)),
                           !TEXT_PROP_MEANS_INVISIBLE (val)))
-               (check_composition = check_display = 1,
+               (check_composition = check_display = true,
                 SET_PT (PT == beg ? end : beg));
            }
        }
-      check_invisible = 0;
+      check_invisible = false;
     }
 }
 
@@ -1848,11 +1853,11 @@ safe_run_hooks_error (Lisp_Object error, ptrdiff_t 
nargs, Lisp_Object *args)
   if (SYMBOLP (hook))
     {
       Lisp_Object val;
-      bool found = 0;
+      bool found = false;
       Lisp_Object newval = Qnil;
       for (val = find_symbol_value (hook); CONSP (val); val = XCDR (val))
        if (EQ (fun, XCAR (val)))
-         found = 1;
+         found = true;
        else
          newval = Fcons (XCAR (val), newval);
       if (found)
@@ -1864,7 +1869,7 @@ safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, 
Lisp_Object *args)
                  : Fdefault_value (hook));
           CONSP (val); val = XCDR (val))
        if (EQ (fun, XCAR (val)))
-         found = 1;
+         found = true;
        else
          newval = Fcons (XCAR (val), newval);
       if (found)
@@ -1929,7 +1934,7 @@ static void
 poll_for_input (struct atimer *timer)
 {
   if (poll_suppress_count == 0)
-    pending_signals = 1;
+    pending_signals = true;
 }
 
 #endif /* POLL_FOR_INPUT */
@@ -2133,7 +2138,7 @@ show_help_echo (Lisp_Object help, Lisp_Object window, 
Lisp_Object object,
       struct frame *f = NILP (do_mouse_tracking) ? NULL : some_mouse_moved ();
       help = call1 (Qmouse_fixup_help_message, help);
       if (f)
-       f->mouse_moved = 1;
+       f->mouse_moved = true;
     }
 
   if (STRINGP (help) || NILP (help))
@@ -2164,11 +2169,11 @@ read_char_help_form_unwind (void)
 
 #define STOP_POLLING                                   \
 do { if (! polling_stopped_here) stop_polling ();      \
-       polling_stopped_here = 1; } while (0)
+       polling_stopped_here = true; } while (0)
 
 #define RESUME_POLLING                                 \
 do { if (polling_stopped_here) start_polling ();       \
-       polling_stopped_here = 0; } while (0)
+       polling_stopped_here = false; } while (0)
 
 static Lisp_Object
 read_event_from_main_queue (struct timespec *end_time,
@@ -2209,7 +2214,7 @@ read_event_from_main_queue (struct timespec *end_time,
         kset_kbd_queue (kb, list1 (c));
       else
         XSETCDR (last, list1 (c));
-      kb->kbd_queue_has_data = 1;
+      kb->kbd_queue_has_data = true;
       c = Qnil;
       if (single_kboard)
         goto start;
@@ -2383,9 +2388,9 @@ read_char (int commandflag, Lisp_Object map,
   Lisp_Object tem, save;
   volatile Lisp_Object previous_echo_area_message;
   volatile Lisp_Object also_record;
-  volatile bool reread;
+  volatile bool reread, recorded;
   struct gcpro gcpro1, gcpro2;
-  bool volatile polling_stopped_here = 0;
+  bool volatile polling_stopped_here = false;
   struct kboard *orig_kboard = current_kboard;
 
   also_record = Qnil;
@@ -2401,6 +2406,8 @@ read_char (int commandflag, Lisp_Object map,
 
  retry:
 
+  recorded = false;
+
   if (CONSP (Vunread_post_input_method_events))
     {
       c = XCAR (Vunread_post_input_method_events);
@@ -2423,7 +2430,7 @@ read_char (int commandflag, Lisp_Object map,
 
   if (CONSP (Vunread_command_events))
     {
-      bool was_disabled = 0;
+      bool was_disabled = false;
 
       c = XCAR (Vunread_command_events);
       Vunread_command_events = XCDR (Vunread_command_events);
@@ -2442,7 +2449,7 @@ read_char (int commandflag, Lisp_Object map,
          && EQ (XCDR (c), Qdisabled)
          && (SYMBOLP (XCAR (c)) || INTEGERP (XCAR (c))))
        {
-         was_disabled = 1;
+         was_disabled = true;
          c = XCAR (c);
        }
 
@@ -2452,7 +2459,7 @@ read_char (int commandflag, Lisp_Object map,
          /* Also check was_disabled so last-nonmenu-event won't return
             a bad value when submenus are involved.  (Bug#447)  */
          && (EQ (c, Qtool_bar) || EQ (c, Qmenu_bar) || was_disabled))
-       *used_mouse_menu = 1;
+       *used_mouse_menu = true;
 
       goto reread_for_input_method;
     }
@@ -2472,7 +2479,7 @@ read_char (int commandflag, Lisp_Object map,
       goto reread_for_input_method;
     }
 
-  this_command_key_count_reset = 0;
+  this_command_key_count_reset = false;
 
   if (!NILP (Vexecuting_kbd_macro))
     {
@@ -2654,7 +2661,7 @@ read_char (int commandflag, Lisp_Object map,
              kset_kbd_queue (kb, list1 (c));
            else
              XSETCDR (last, list1 (c));
-           kb->kbd_queue_has_data = 1;
+           kb->kbd_queue_has_data = true;
            current_kboard = kb;
            /* This is going to exit from read_char
               so we had better get rid of this frame's stuff.  */
@@ -2830,7 +2837,7 @@ read_char (int commandflag, Lisp_Object map,
          kset_kbd_queue (current_kboard,
                          XCDR (KVAR (current_kboard, kbd_queue)));
          if (NILP (KVAR (current_kboard, kbd_queue)))
-           current_kboard->kbd_queue_has_data = 0;
+           current_kboard->kbd_queue_has_data = false;
          input_pending = readable_events (0);
          if (EVENT_HAS_PARAMETERS (c)
              && EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qswitch_frame))
@@ -2990,6 +2997,7 @@ read_char (int commandflag, Lisp_Object map,
   /* Store these characters into recent_keys, the dribble file if any,
      and the keyboard macro being defined, if any.  */
   record_char (c);
+  recorded = true;
   if (! NILP (also_record))
     record_char (also_record);
 
@@ -3067,7 +3075,7 @@ read_char (int commandflag, Lisp_Object map,
 
       /* Clear out this_command_keys.  */
       this_command_key_count = 0;
-      this_command_key_count_reset = 0;
+      this_command_key_count_reset = false;
       this_single_command_key_start = 0;
 
       /* Now wipe the echo area.  */
@@ -3125,6 +3133,14 @@ read_char (int commandflag, Lisp_Object map,
       Vunread_post_input_method_events
        = nconc2 (XCDR (tem), Vunread_post_input_method_events);
     }
+  /* When we consume events from the various unread-*-events lists, we
+     bypass the code that records input, so record these events now if
+     they were not recorded already.  */
+  if (!recorded)
+    {
+      record_char (c);
+      recorded = true;
+    }
 
  reread_first:
 
@@ -3575,7 +3591,7 @@ kbd_buffer_store_buffered_event (union 
buffered_input_event *event,
              kset_kbd_queue
                (kb, list2 (make_lispy_switch_frame (event->ie.frame_or_window),
                            make_number (c)));
-             kb->kbd_queue_has_data = 1;
+             kb->kbd_queue_has_data = true;
              union buffered_input_event *sp;
              for (sp = kbd_fetch_ptr; sp != kbd_store_ptr; sp++)
                {
@@ -3669,7 +3685,7 @@ kbd_buffer_store_buffered_event (union 
buffered_input_event *event,
         do it now.  */
       if (immediate_quit && NILP (Vinhibit_quit))
        {
-         immediate_quit = 0;
+         immediate_quit = false;
          QUIT;
        }
     }
@@ -3987,7 +4003,7 @@ kbd_buffer_get_event (KBOARD **kbp,
             obj = list1 (intern ("ns-unput-working-text"));
          kbd_fetch_ptr = event + 1;
           if (used_mouse_menu)
-            *used_mouse_menu = 1;
+            *used_mouse_menu = true;
         }
 #endif
 
@@ -4182,13 +4198,13 @@ kbd_buffer_get_event (KBOARD **kbp,
                  && !EQ (event->ie.frame_or_window, event->ie.arg)
                  && (event->kind == MENU_BAR_EVENT
                      || event->kind == TOOL_BAR_EVENT))
-               *used_mouse_menu = 1;
+               *used_mouse_menu = true;
 #endif
 #ifdef HAVE_NS
              /* Certain system events are non-key events.  */
              if (used_mouse_menu
                   && event->kind == NS_NONKEY_EVENT)
-               *used_mouse_menu = 1;
+               *used_mouse_menu = true;
 #endif
 
              /* Wipe out this event, to catch bugs.  */
@@ -6226,6 +6242,10 @@ parse_modifiers_uncached (Lisp_Object symbol, ptrdiff_t 
*modifier_end)
        case 't':
          MULTI_LETTER_MOD (triple_modifier, "triple", 6);
          break;
+
+       case 'u':
+         MULTI_LETTER_MOD (up_modifier, "up", 2);
+         break;
 #undef MULTI_LETTER_MOD
 
        }
@@ -6273,16 +6293,19 @@ apply_modifiers_uncached (int modifiers, char *base, 
int base_len, int base_len_
   /* Since BASE could contain nulls, we can't use intern here; we have
      to use Fintern, which expects a genuine Lisp_String, and keeps a
      reference to it.  */
-  char new_mods[sizeof "A-C-H-M-S-s-down-drag-double-triple-"];
+  char new_mods[sizeof "A-C-H-M-S-s-up-down-drag-double-triple-"];
   int mod_len;
 
   {
     char *p = new_mods;
 
-    /* Only the event queue may use the `up' modifier; it should always
-       be turned into a click or drag event before presented to lisp code.  */
-    if (modifiers & up_modifier)
-      emacs_abort ();
+    /* Mouse events should not exhibit the `up' modifier once they
+       leave the event queue only accessible to C code; `up' will
+       always be turned into a click or drag event before being
+       presented to lisp code.  But since lisp events can be
+       synthesized bypassing the event queue and pushed into
+       `unread-command-events' or its companions, it's better to just
+       deal with unexpected modifier combinations. */
 
     if (modifiers & alt_modifier)   { *p++ = 'A'; *p++ = '-'; }
     if (modifiers & ctrl_modifier)  { *p++ = 'C'; *p++ = '-'; }
@@ -6292,6 +6315,7 @@ apply_modifiers_uncached (int modifiers, char *base, int 
base_len, int base_len_
     if (modifiers & super_modifier) { *p++ = 's'; *p++ = '-'; }
     if (modifiers & double_modifier) p = stpcpy (p, "double-");
     if (modifiers & triple_modifier) p = stpcpy (p, "triple-");
+    if (modifiers & up_modifier) p = stpcpy (p, "up-");
     if (modifiers & down_modifier) p = stpcpy (p, "down-");
     if (modifiers & drag_modifier) p = stpcpy (p, "drag-");
     /* The click modifier is denoted by the absence of other modifiers.  */
@@ -6411,8 +6435,7 @@ DEFUN ("internal-event-symbol-parse-modifiers", 
Fevent_symbol_parse_modifiers,
    BASE must be unmodified.
 
    This is like apply_modifiers_uncached, but uses BASE's
-   Qmodifier_cache property, if present.  It also builds
-   Qevent_symbol_elements properties, since it has that info anyway.
+   Qmodifier_cache property, if present.
 
    apply_modifiers copies the value of BASE's Qevent_kind property to
    the modified symbol.  */
@@ -6758,6 +6781,10 @@ parse_solitary_modifier (Lisp_Object symbol)
       MULTI_LETTER_MOD (triple_modifier, "triple", 6);
       break;
 
+    case 'u':
+      MULTI_LETTER_MOD (up_modifier, "up", 2);
+      break;
+
 #undef SINGLE_LETTER_MOD
 #undef MULTI_LETTER_MOD
     }
@@ -6870,7 +6897,7 @@ int
 gobble_input (void)
 {
   int nread = 0;
-  bool err = 0;
+  bool err = false;
   struct terminal *t;
 
   /* Store pending user signal events, if any.  */
@@ -6889,7 +6916,7 @@ gobble_input (void)
 
          if (input_blocked_p ())
            {
-             pending_signals = 1;
+             pending_signals = true;
              break;
            }
 
@@ -6902,7 +6929,7 @@ gobble_input (void)
 
           if (nr == -1)          /* Not OK to read input now.  */
             {
-              err = 1;
+              err = true;
             }
           else if (nr == -2)          /* Non-transient error.  */
             {
@@ -7162,7 +7189,7 @@ handle_async_input (void)
 void
 process_pending_signals (void)
 {
-  pending_signals = 0;
+  pending_signals = false;
   handle_async_input ();
   do_pending_atimers ();
 }
@@ -7214,7 +7241,7 @@ totally_unblock_input (void)
 void
 handle_input_available_signal (int sig)
 {
-  pending_signals = 1;
+  pending_signals = true;
 
   if (input_available_clear_time)
     *input_available_clear_time = make_timespec (0, 0);
@@ -7285,8 +7312,8 @@ handle_user_signal (int sig)
            && strcmp (special_event_name, p->name) == 0)
           {
             /* Enter the debugger in many ways.  */
-            debug_on_next_call = 1;
-            debug_on_quit = 1;
+            debug_on_next_call = true;
+            debug_on_quit = true;
             Vquit_flag = Qt;
             Vinhibit_quit = Qnil;
 
@@ -7333,7 +7360,7 @@ store_user_signal_events (void)
 {
   struct user_signal_info *p;
   struct input_event buf;
-  bool buf_initialized = 0;
+  bool buf_initialized = false;
 
   for (p = user_signals; p; p = p->next)
     if (p->npending > 0)
@@ -7343,7 +7370,7 @@ store_user_signal_events (void)
            memset (&buf, 0, sizeof buf);
            buf.kind = USER_SIGNAL_EVENT;
            buf.frame_or_window = selected_frame;
-           buf_initialized = 1;
+           buf_initialized = true;
          }
 
        do
@@ -8175,7 +8202,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
   Lisp_Object filter = Qnil;
   Lisp_Object caption;
   int i;
-  bool have_label = 0;
+  bool have_label = false;
 
   /* Definition looks like `(menu-item CAPTION BINDING PROPS...)'.
      Rule out items that aren't lists, don't start with
@@ -8284,7 +8311,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
           /* `:label LABEL-STRING'.  */
           set_prop (TOOL_BAR_ITEM_LABEL,
                    STRINGP (value) ? value : build_string (bad_label));
-          have_label = 1;
+          have_label = true;
         }
       else if (EQ (ikey, QCfilter))
        /* ':filter FORM'.  */
@@ -8450,7 +8477,7 @@ read_char_x_menu_prompt (Lisp_Object map,
                         Lisp_Object prev_event, bool *used_mouse_menu)
 {
   if (used_mouse_menu)
-    *used_mouse_menu = 0;
+    *used_mouse_menu = false;
 
   /* Use local over global Menu maps.  */
 
@@ -8499,7 +8526,7 @@ read_char_x_menu_prompt (Lisp_Object map,
       else if (NILP (value))
        value = Qt;
       if (used_mouse_menu)
-       *used_mouse_menu = 1;
+       *used_mouse_menu = true;
       return value;
     }
   return Qnil ;
@@ -8514,7 +8541,7 @@ read_char_minibuf_menu_prompt (int commandflag,
   /* FIXME: Use the minibuffer's frame width.  */
   ptrdiff_t width = FRAME_COLS (SELECTED_FRAME ()) - 4;
   ptrdiff_t idx = -1;
-  bool nobindings = 1;
+  bool nobindings = true;
   Lisp_Object rest, vector;
   Lisp_Object prompt_strings = Qnil;
 
@@ -8543,7 +8570,7 @@ read_char_minibuf_menu_prompt (int commandflag,
   /* Present the documented bindings, a line at a time.  */
   while (1)
     {
-      bool notfirst = 0;
+      bool notfirst = false;
       Lisp_Object menu_strings = prompt_strings;
       ptrdiff_t i = nlength;
       Lisp_Object obj;
@@ -8654,8 +8681,8 @@ read_char_minibuf_menu_prompt (int commandflag,
                          PUSH_C_STR (", ", menu_strings);
                          i += 2;
                        }
-                     notfirst = 1;
-                     nobindings = 0;
+                     notfirst = true;
+                     nobindings = false;
 
                      /* If the char to type doesn't match the string's
                         first char, explicitly show what char to type.  */
@@ -8971,7 +8998,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, 
Lisp_Object prompt,
   /* True if we are trying to map a key by changing an upper-case
      letter to lower case, or a shifted function key to an unshifted
      one.  */
-  bool shift_translated = 0;
+  bool shift_translated = false;
 
   /* If we receive a `switch-frame' or `select-window' event in the middle of
      a key sequence, we put it off for later.
@@ -8982,7 +9009,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, 
Lisp_Object prompt,
   int original_uppercase_position = -1;
 
   /* Gets around Microsoft compiler limitations.  */
-  bool dummyflag = 0;
+  bool dummyflag = false;
 
   struct buffer *starting_buffer;
 
@@ -9072,7 +9099,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, 
Lisp_Object prompt,
         : (/* indec.start < t || fkey.start < t || */ keytran.start < t))
     {
       Lisp_Object key;
-      bool used_mouse_menu = 0;
+      bool used_mouse_menu = false;
 
       /* Where the last real key started.  If we need to throw away a
          key that has expanded into more than one element of keybuf
@@ -9169,12 +9196,12 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, 
Lisp_Object prompt,
                   return.  Any better way to fix this? -- cyd  */
                || (interrupted_kboard != current_kboard))
              {
-               bool found = 0;
+               bool found = false;
                struct kboard *k;
 
                for (k = all_kboards; k; k = k->next_kboard)
                  if (k == interrupted_kboard)
-                   found = 1;
+                   found = true;
 
                if (!found)
                  {
@@ -9235,7 +9262,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, 
Lisp_Object prompt,
              t = 0;
              /* The Microsoft C compiler can't handle the goto that
                 would go here.  */
-             dummyflag = 1;
+             dummyflag = true;
              break;
            }
 
@@ -9471,14 +9498,16 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, 
Lisp_Object prompt,
                   Drags reduce to clicks.
                   Double-clicks reduce to clicks.
                   Triple-clicks reduce to double-clicks, then to clicks.
-                  Down-clicks are eliminated.
+                  Up/Down-clicks are eliminated.
                   Double-downs reduce to downs, then are eliminated.
                   Triple-downs reduce to double-downs, then to downs,
                     then are eliminated.  */
-             if (modifiers & (down_modifier | drag_modifier
+             if (modifiers & (up_modifier | down_modifier
+                              | drag_modifier
                               | double_modifier | triple_modifier))
                {
-                 while (modifiers & (down_modifier | drag_modifier
+                 while (modifiers & (up_modifier | down_modifier
+                                     | drag_modifier
                                      | double_modifier | triple_modifier))
                    {
                      Lisp_Object new_head, new_click;
@@ -9490,7 +9519,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, 
Lisp_Object prompt,
                        modifiers &= ~drag_modifier;
                      else
                        {
-                         /* Dispose of this `down' event by simply jumping
+                         /* Dispose of this `up/down' event by simply jumping
                             back to replay_key, to get another event.
 
                             Note that if this event came from mock input,
@@ -9723,7 +9752,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, 
Lisp_Object prompt,
             might get translated through function-key-map.  */
          keybuf[t - 1] = new_key;
          mock_input = max (t, mock_input);
-         shift_translated = 1;
+         shift_translated = true;
 
          goto replay_sequence;
        }
@@ -9734,7 +9763,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, 
Lisp_Object prompt,
              read_key_sequence_cmd = Vprefix_help_command;
              /* The Microsoft C compiler can't handle the goto that
                 would go here.  */
-             dummyflag = 1;
+             dummyflag = true;
              break;
            }
 
@@ -9776,7 +9805,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, 
Lisp_Object prompt,
                 input-decode-map doesn't need to go through it again.  */
              fkey.start = fkey.end = 0;
              keytran.start = keytran.end = 0;
-             shift_translated = 1;
+             shift_translated = true;
 
              goto replay_sequence;
            }
@@ -9802,7 +9831,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, 
Lisp_Object prompt,
       && t - 1 == original_uppercase_position)
     {
       keybuf[t - 1] = original_uppercase;
-      shift_translated = 0;
+      shift_translated = false;
     }
 
   if (shift_translated)
@@ -9855,7 +9884,7 @@ read_key_sequence_vs (Lisp_Object prompt, Lisp_Object 
continue_echo,
   if (NILP (continue_echo))
     {
       this_command_key_count = 0;
-      this_command_key_count_reset = 0;
+      this_command_key_count_reset = false;
       this_single_command_key_start = 0;
     }
 
@@ -9990,7 +10019,7 @@ detect_input_pending_run_timers (bool do_display)
 void
 clear_input_pending (void)
 {
-  input_pending = 0;
+  input_pending = false;
 }
 
 /* Return true if there are pending requeued events.
@@ -10134,7 +10163,7 @@ these events the first time.  */)
 
   /* Cause whatever we put into unread-command-events
      to echo as if it were being freshly read from the keyboard.  */
-  this_command_key_count_reset = 1;
+  this_command_key_count_reset = true;
 
   return Qnil;
 }
@@ -10149,7 +10178,7 @@ KEEP-RECORD is non-nil.  */)
   int i;
 
   this_command_key_count = 0;
-  this_command_key_count_reset = 0;
+  this_command_key_count_reset = false;
 
   if (NILP (keep_record))
     {
@@ -10223,7 +10252,7 @@ Also end any kbd macro being defined.  */)
   discard_tty_input ();
 
   kbd_fetch_ptr =  kbd_store_ptr;
-  input_pending = 0;
+  input_pending = false;
 
   return Qnil;
 }
@@ -10321,7 +10350,7 @@ stuff_buffered_input (Lisp_Object stuffstring)
       clear_event (kbd_fetch_ptr);
     }
 
-  input_pending = 0;
+  input_pending = false;
 #endif /* SIGTSTP */
 }
 
@@ -10331,7 +10360,7 @@ set_waiting_for_input (struct timespec *time_to_clear)
   input_available_clear_time = time_to_clear;
 
   /* Tell handle_interrupt to throw back to read_char,  */
-  waiting_for_input = 1;
+  waiting_for_input = true;
 
   /* If handle_interrupt was called before and buffered a C-g,
      make it run again now, to avoid timing error.  */
@@ -10343,7 +10372,7 @@ void
 clear_waiting_for_input (void)
 {
   /* Tell handle_interrupt not to throw back to read_char,  */
-  waiting_for_input = 0;
+  waiting_for_input = false;
   input_available_clear_time = 0;
 }
 
@@ -10504,7 +10533,7 @@ handle_interrupt (bool in_signal_handler)
          struct gl_state_s saved;
          struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
 
-         immediate_quit = 0;
+         immediate_quit = false;
          pthread_sigmask (SIG_SETMASK, &empty_mask, 0);
          saved = gl_state;
          GCPRO4 (saved.object, saved.global_code,
@@ -10519,7 +10548,7 @@ handle_interrupt (bool in_signal_handler)
          force_quit_count = count;
          if (count == 3)
             {
-              immediate_quit = 1;
+              immediate_quit = true;
               Vinhibit_quit = Qnil;
             }
           Vquit_flag = Qt;
@@ -10553,7 +10582,7 @@ quit_throw_to_read_char (bool from_signal)
 
   /* Prevent another signal from doing this before we finish.  */
   clear_waiting_for_input ();
-  input_pending = 0;
+  input_pending = false;
 
   Vunread_command_events = Qnil;
 
@@ -10581,13 +10610,13 @@ See also `current-input-mode'.  */)
     {
       /* When using X, don't give the user a real choice,
         because we haven't implemented the mechanisms to support it.  */
-      new_interrupt_input = 1;
+      new_interrupt_input = true;
     }
   else
 #endif /* HAVE_X_WINDOWS */
     new_interrupt_input = !NILP (interrupt);
 #else /* not USABLE_SIGIO */
-  new_interrupt_input = 0;
+  new_interrupt_input = false;
 #endif /* not USABLE_SIGIO */
 
   if (new_interrupt_input != interrupt_input)
@@ -10879,8 +10908,8 @@ init_kboard (KBOARD *kb, Lisp_Object type)
   kset_prefix_arg (kb, Qnil);
   kset_last_prefix_arg (kb, Qnil);
   kset_kbd_queue (kb, Qnil);
-  kb->kbd_queue_has_data = 0;
-  kb->immediate_echo = 0;
+  kb->kbd_queue_has_data = false;
+  kb->immediate_echo = false;
   kset_echo_string (kb, Qnil);
   kb->echo_after_prompt = -1;
   kb->kbd_macro_buffer = 0;
@@ -10940,7 +10969,7 @@ delete_kboard (KBOARD *kb)
       && FRAME_LIVE_P (XFRAME (selected_frame)))
     {
       current_kboard = FRAME_KBOARD (XFRAME (selected_frame));
-      single_kboard = 0;
+      single_kboard = false;
       if (current_kboard == kb)
        emacs_abort ();
     }
@@ -10954,7 +10983,7 @@ init_keyboard (void)
 {
   /* This is correct before outermost invocation of the editor loop.  */
   command_loop_level = -1;
-  immediate_quit = 0;
+  immediate_quit = false;
   quit_char = Ctl ('g');
   Vunread_command_events = Qnil;
   timer_idleness_start_time = invalid_timespec ();
@@ -10963,9 +10992,9 @@ init_keyboard (void)
   kbd_fetch_ptr = kbd_buffer;
   kbd_store_ptr = kbd_buffer;
   do_mouse_tracking = Qnil;
-  input_pending = 0;
+  input_pending = false;
   interrupt_input_blocked = 0;
-  pending_signals = 0;
+  pending_signals = false;
 
   /* This means that command_loop_1 won't try to select anything the first
      time through.  */
@@ -11517,7 +11546,7 @@ See Info node `(elisp)Multiple Terminals'.  */);
   DEFVAR_BOOL ("cannot-suspend", cannot_suspend,
               doc: /* Non-nil means to always spawn a subshell instead of 
suspending.
 \(Even if the operating system has support for stopping a process.\)  */);
-  cannot_suspend = 0;
+  cannot_suspend = false;
 
   DEFVAR_BOOL ("menu-prompting", menu_prompting,
               doc: /* Non-nil means prompt with menus when appropriate.
@@ -11527,7 +11556,7 @@ The menu is displayed on the screen
 if X menus were enabled at configuration
 time and the previous event was a mouse click prefix key.
 Otherwise, menu prompting uses the echo area.  */);
-  menu_prompting = 1;
+  menu_prompting = true;
 
   DEFVAR_LISP ("menu-prompt-more-char", menu_prompt_more_char,
               doc: /* Character to see next line of menu prompt.
diff --git a/src/keyboard.h b/src/keyboard.h
index b843e8d..3e4c475 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -170,7 +170,7 @@ struct kboard
        kbd_queue_has_data is 0.  When we push back an incomplete
        command, then this flag is 0, meaning we don't want to try
        reading from this KBOARD again until more input arrives.  */
-    char kbd_queue_has_data;
+    bool_bf kbd_queue_has_data;
 
     /* True means echo each character as typed.  */
     bool_bf immediate_echo : 1;
diff --git a/src/lisp.h b/src/lisp.h
index 02109d7..d3dcaec 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3667,7 +3667,8 @@ extern Lisp_Object sit_for (Lisp_Object, bool, int);
 /* Defined in xdisp.c.  */
 extern bool noninteractive_need_newline;
 extern Lisp_Object echo_area_buffer[2];
-extern void add_to_log (const char *, Lisp_Object, Lisp_Object);
+extern void add_to_log (char const *, ...);
+extern void vadd_to_log (char const *, va_list);
 extern void check_message_stack (void);
 extern void setup_echo_area_for_printing (bool);
 extern bool push_message (void);
@@ -4299,6 +4300,25 @@ extern void set_initial_environment (void);
 extern void syms_of_callproc (void);
 
 /* Defined in doc.c.  */
+enum
+  {
+    /* Named constants for the UTF-8 encodings of U+2018 LEFT SINGLE
+       QUOTATION MARK and U+2019 RIGHT SINGLE QUOTATION MARK.  */
+    uLSQM0 = 0xE2, uLSQM1 = 0x80, uLSQM2 = 0x98,
+    uRSQM0 = 0xE2, uRSQM1 = 0x80, uRSQM2 = 0x99
+  };
+enum text_quoting_style
+  {
+    /* Use curved single quotes ‘like this’.  */
+    CURVE_QUOTING_STYLE,
+
+    /* Use grave accent and apostrophe  `like this'.  */
+    GRAVE_QUOTING_STYLE,
+
+    /* Use apostrophes 'like this'.  */
+    STRAIGHT_QUOTING_STYLE
+  };
+extern enum text_quoting_style text_quoting_style (void);
 extern Lisp_Object read_doc_string (Lisp_Object);
 extern Lisp_Object get_doc_string (Lisp_Object, bool, bool);
 extern void syms_of_doc (void);
diff --git a/src/lread.c b/src/lread.c
index 11c8d00..ebd594c 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -947,7 +947,8 @@ load_warn_old_style_backquotes (Lisp_Object file)
 {
   if (!NILP (Vold_style_backquotes))
     {
-      AUTO_STRING (format, "Loading `%s': old-style backquotes detected!");
+      Lisp_Object format = build_string ("Loading "uLSQM"%s"uRSQM
+                                        ": old-style backquotes detected!");
       CALLN (Fmessage, format, file);
     }
 }
@@ -1885,7 +1886,7 @@ readevalloop (Lisp_Object readcharfun,
 
       /* Ignore whitespace here, so we can detect eof.  */
       if (c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\r'
-         || c == 0xa0)  /* NBSP */
+         || c == NO_BREAK_SPACE)
        goto read_next;
 
       if (!NILP (Vpurify_flag) && c == '(')
@@ -2793,7 +2794,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool 
first_in_list)
          uninterned_symbol = 1;
          c = READCHAR;
          if (!(c > 040
-               && c != 0xa0    /* NBSP */
+               && c != NO_BREAK_SPACE
                && (c >= 0200
                    || strchr ("\"';()[]#`,", c) == NULL)))
            {
@@ -3127,7 +3128,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool 
first_in_list)
     default:
     default_label:
       if (c <= 040) goto retry;
-      if (c == 0xa0) /* NBSP */
+      if (c == NO_BREAK_SPACE)
        goto retry;
 
     read_symbol:
@@ -3167,7 +3168,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool 
first_in_list)
              c = READCHAR;
            }
          while (c > 040
-                && c != 0xa0 /* NBSP */
+                && c != NO_BREAK_SPACE
                 && (c >= 0200
                     || strchr ("\"';()[]#`,", c) == NULL));
 
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
deleted file mode 100644
index 795b55a..0000000
--- a/src/makefile.w32-in
+++ /dev/null
@@ -1,1725 +0,0 @@
-# -*- Makefile -*- for GNU Emacs on the Microsoft Windows API.
-# Copyright (C) 2000-2015 Free Software Foundation, Inc.
-
-# This file is part of GNU Emacs.
-
-# GNU Emacs is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# GNU Emacs is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-
-ALL = emacs
-
-.PHONY: $(ALL)
-
-# Set EMACSLOADPATH correctly (in case already defined in environment).
-EMACSLOADPATH=$(CURDIR)/../lisp
-
-# Size in MBs of the static heap in temacs.exe.
-HEAPSIZE = $(EMACS_HEAPSIZE)
-
-LOCAL_FLAGS     = -Demacs=1 -I../lib -I../nt/inc $(EMACS_EXTRA_C_FLAGS)
-
-SRC             = .
-EMACS           = $(BLD)/emacs.exe
-TEMACS          = $(BLD)/temacs.exe
-TEMACS_TMP      = $(BLD)/temacs.bin
-TLIB0           = $(BLD)/temacs0.$(A)
-TLIB1           = $(BLD)/temacs1.$(A)
-TLIB2           = $(BLD)/temacs2.$(A)
-TOBJ            = $(BLD)/firstfile.$(O)
-TRES           = $(BLD)/emacs.res
-TLASTLIB       = $(BLD)/lastfile.$(A)
-GNULIB         = ../lib/$(BLD)/libgnu.$(A)
-
-DOC            = $(OBJDIR)/etc/DOC
-
-FULL_LINK_FLAGS = $(LINK_FLAGS) $(TEMACS_EXTRA_LINK)
-
-#
-# Split up the objects into two sets so that we don't run out of
-# command line space when we link them into a library.
-#
-# Put emacs.$(O) in a separate lib, since we need to have firstfile.$(O)
-# as the "main" object file when linking.
-#
-OBJ0 =  $(BLD)/emacs.$(O)
-
-OBJ1 =  $(BLD)/alloc.$(O)              \
-       $(BLD)/atimer.$(O)              \
-       $(BLD)/buffer.$(O)              \
-       $(BLD)/bytecode.$(O)            \
-       $(BLD)/callint.$(O)             \
-       $(BLD)/callproc.$(O)            \
-       $(BLD)/casefiddle.$(O)          \
-       $(BLD)/cmds.$(O)                \
-       $(BLD)/data.$(O)                \
-       $(BLD)/dired.$(O)               \
-       $(BLD)/dispnew.$(O)             \
-       $(BLD)/doc.$(O)                 \
-       $(BLD)/doprnt.$(O)              \
-       $(BLD)/editfns.$(O)             \
-       $(BLD)/eval.$(O)                \
-       $(BLD)/fileio.$(O)              \
-       $(BLD)/filelock.$(O)            \
-       $(BLD)/fns.$(O)                 \
-       $(BLD)/indent.$(O)              \
-       $(BLD)/insdel.$(O)              \
-       $(BLD)/keyboard.$(O)            \
-       $(BLD)/keymap.$(O)              \
-       $(BLD)/lread.$(O)               \
-       $(BLD)/macros.$(O)              \
-       $(BLD)/marker.$(O)              \
-       $(BLD)/minibuf.$(O)             \
-       $(BLD)/w32.$(O)                 \
-       $(BLD)/w32heap.$(O)             \
-       $(BLD)/w32inevt.$(O)            \
-       $(BLD)/w32proc.$(O)             \
-       $(BLD)/w32console.$(O)          \
-       $(BLD)/print.$(O)               \
-       $(BLD)/process.$(O)             \
-       $(BLD)/regex.$(O)               \
-       $(BLD)/scroll.$(O)              \
-       $(BLD)/search.$(O)              \
-       $(BLD)/sound.$(O)               \
-       $(BLD)/syntax.$(O)
-
-OBJ2 =  $(BLD)/sysdep.$(O)             \
-       $(BLD)/term.$(O)                \
-       $(BLD)/tparam.$(O)              \
-       $(BLD)/undo.$(O)                \
-       $(BLD)/unexw32.$(O)             \
-       $(BLD)/window.$(O)              \
-       $(BLD)/xdisp.$(O)               \
-       $(BLD)/casetab.$(O)             \
-       $(BLD)/floatfns.$(O)            \
-       $(BLD)/frame.$(O)               \
-       $(BLD)/gmalloc.$(O)             \
-       $(BLD)/gnutls.$(O)              \
-       $(BLD)/intervals.$(O)           \
-       $(BLD)/composite.$(O)           \
-       $(BLD)/ralloc.$(O)              \
-       $(BLD)/textprop.$(O)            \
-       $(BLD)/vm-limit.$(O)            \
-       $(BLD)/region-cache.$(O)        \
-       $(BLD)/bidi.$(O)                \
-       $(BLD)/charset.$(O)             \
-       $(BLD)/character.$(O)           \
-       $(BLD)/chartab.$(O)             \
-       $(BLD)/coding.$(O)              \
-       $(BLD)/category.$(O)            \
-       $(BLD)/ccl.$(O)                 \
-       $(BLD)/font.$(O)                \
-       $(BLD)/fontset.$(O)             \
-       $(BLD)/fringe.$(O)              \
-       $(BLD)/image.$(O)               \
-       $(BLD)/terminal.$(O)            \
-       $(BLD)/menu.$(O)                \
-       $(BLD)/xml.$(O)                 \
-       $(BLD)/profiler.$(O)            \
-       $(BLD)/w32term.$(O)             \
-       $(BLD)/w32xfns.$(O)             \
-       $(BLD)/w32fns.$(O)              \
-       $(BLD)/xfaces.$(O)              \
-       $(BLD)/w32select.$(O)           \
-       $(BLD)/w32menu.$(O)             \
-       $(BLD)/w32reg.$(O)              \
-       $(BLD)/w32font.$(O)             \
-       $(BLD)/w32notify.$(O)           \
-       $(BLD)/w32uniscribe.$(O)
-
-LIBS =  $(TLIB0)       \
-       $(TLIB1)        \
-       $(TLIB2)        \
-       $(TLASTLIB)     \
-       $(GNULIB)       \
-       $(WINMM)        \
-       $(ADVAPI32)     \
-       $(GDI32)        \
-       $(COMDLG32)     \
-       $(USER32)       \
-       $(MPR)          \
-       $(SHELL32)      \
-       $(WINSPOOL)     \
-       $(OLE32)        \
-       $(COMCTL32)     \
-       $(UNISCRIBE)    \
-       $(USER_LIBS)    \
-       $(libc)
-
-#
-# Build the executable and dump it.
-#
-all:            $(ALL)
-
-#
-# The dumped executable
-#
-emacs:          stamp_BLD $(EMACS)
-$(EMACS):       $(DOC) $(TEMACS)
-       "$(THISDIR)/$(BLD)/temacs.exe" -batch -l loadup dump
-       -"$(THISDIR)/$(BLD)/emacs.exe" -batch -f list-load-path-shadows
-
-#
-# The undumped executable
-# Note the extra post-link step to insert a static preload heap section.
-# If preload runs out of memory, increase the last argument to addsection
-# (it is the preload heap size in MB).
-#
-temacs:         stamp_BLD $(TEMACS)
-$(TEMACS):      $(TLIB0) $(TLIB1) $(TLIB2) $(TLASTLIB) $(TOBJ) $(TRES) \
-                 ../nt/$(BLD)/addsection.exe $(GNULIB)
-       $(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) 
$(LIBS)
-       "$(THISDIR)/../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP 
$(HEAPSIZE)
-
-# These omit firstfile.${O}, but there's no documentation in there
-# anyways.
-buildobj.h: $(SRC)/makefile.w32-in
-       $(MAKE) $(MFLAGS) make-buildobj-$(SHELLTYPE)
-
-# Cannot have blanks between the backslash and the redirection
-# characters, because CMD's `echo' will put them in buildobj.h.
-make-buildobj-CMD:
-       echo #define BUILDOBJ ^"\> buildobj.h
-       echo $(OBJ0)            \>> buildobj.h
-       echo $(OBJ1)            \>> buildobj.h
-       echo $(OBJ2)            \>> buildobj.h
-       echo ^">> buildobj.h
-
-# "
-# The above line is here to countermand the single quote
-# on the last "echo" command above, wrt font-lock.
-make-buildobj-SH:
-       echo '#define BUILDOBJ $(DQUOTE)\'  > buildobj.h
-       echo $(OBJ0)                   '\' >> buildobj.h
-       echo $(OBJ1)                   '\' >> buildobj.h
-       echo $(OBJ2)                   '\' >> buildobj.h
-       echo '$(DQUOTE)'                   >> buildobj.h
-
-GLOBAL_SOURCES =   dosfns.c msdos.c \
-       xterm.c xfns.c xmenu.c xselect.c xrdb.c xsmfns.c fringe.c image.c \
-       fontset.c menu.c dbusbind.c \
-       w32.c w32console.c w32fns.c w32heap.c w32inevt.c cygw32.c \
-       w32menu.c w32proc.c w32reg.c w32select.c w32term.c w32xfns.c \
-       font.c w32font.c w32uniscribe.c w32notify.c \
-       dispnew.c frame.c scroll.c xdisp.c window.c bidi.c \
-       charset.c coding.c category.c ccl.c character.c chartab.c \
-       cm.c term.c terminal.c xfaces.c \
-       emacs.c keyboard.c macros.c keymap.c sysdep.c \
-       buffer.c filelock.c insdel.c marker.c \
-       minibuf.c fileio.c dired.c \
-       cmds.c casetab.c casefiddle.c indent.c search.c regex.c undo.c \
-       alloc.c data.c doc.c editfns.c callint.c \
-       eval.c floatfns.c fns.c print.c lread.c \
-       syntax.c bytecode.c \
-       process.c callproc.c unexw32.c \
-       region-cache.c sound.c atimer.c \
-       doprnt.c intervals.c textprop.c composite.c \
-       gnutls.c xml.c profiler.c
-SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
-       xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o dbusbind.o
-obj = $(GLOBAL_SOURCES:.c=.o)
-
-globals.h: gl-stamp
-       @cmd $(SWITCHCHAR)c rem true
-
-gl-stamp: ../lib-src/$(BLD)/make-docfile.exe $(GLOBAL_SOURCES)
-       - $(DEL) gl-tmp
-       "$(THISDIR)/../lib-src/$(BLD)/make-docfile" -d . -g 
$(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp
-       fc.exe $(SWITCHCHAR)b gl-tmp globals.h >nul 2>&1 || $(CP) gl-tmp 
globals.h
-       - $(DEL) gl-tmp
-       echo timestamp > $@
-
-bootstrap: bootstrap-emacs
-
-#
-# Build a temacs with a sufficiently large PURESIZE to load the
-# Lisp files from loadup.el in source form.
-#
-# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
-#          this can break with GNU Make 3.81 and later if sh.exe is used.
-bootstrap-temacs-CMD:
-       $(MAKE) $(MFLAGS) $(XMFLAGS) temacs CFLAGS=$(ARGQUOTE)$(ESC_CFLAGS) 
-DPURESIZE=$(EMACS_PURESIZE)$(ARGQUOTE)
-
-bootstrap-temacs-SH:
-       $(MAKE) $(MFLAGS) $(XMFLAGS) temacs CFLAGS=$(ARGQUOTE)$(CFLAGS) 
-DPURESIZE=$(EMACS_PURESIZE)$(ARGQUOTE)
-
-bootstrap-temacs:
-       $(MAKE) $(MFLAGS) bootstrap-temacs-$(SHELLTYPE)
-
-#
-# Dump an Emacs executable named bootstrap-emacs containing the
-# files from loadup.el in source form.
-#
-bootstrap-emacs: bootstrap-temacs
-       "$(THISDIR)/$(BLD)/temacs.exe" -batch -l loadup bootstrap
-       - mkdir "../bin"
-       $(CP) $(EMACS) ../bin
-
-#
-# Force recompile of files that depend on PURESIZE
-#
-bootstrap-clean:
-       - $(DEL) $(BLD)/alloc.$(O)
-       - $(DEL) $(BLD)/data.$(O)
-       - $(DEL) $(BLD)/intervals.$(O)
-       - $(DEL) $(BLD)/keyboard.$(O)
-       - $(DEL) $(BLD)/keymap.$(O)
-
-#
-# The resource file.  NT 3.10 requires the use of cvtres; even though
-# it is not necessary on later versions, it is still ok to use it.
-#
-$(TRES): ../nt/emacs.rc stamp_BLD
-       $(RC) $(RC_INCLUDE)../nt $(RC_OUT)$@ ../nt/emacs.rc
-
-#
-# Build the library.  Split up the build into two phases...otherwise we
-# run out of command line space.
-#
-$(TLIB0):       $(OBJ0)
-       - $(DEL) $@
-       $(AR) $(AR_OUT)$@ $(ALL_DEPS)
-$(TLIB1):       $(OBJ1)
-       - $(DEL) $@
-       $(AR) $(AR_OUT)$@ $(ALL_DEPS)
-$(TLIB2):      $(OBJ2)
-       - $(DEL) $@
-       $(AR) $(AR_OUT)$@ $(ALL_DEPS)
-
-#
-# Place lastfile.$(O) in its own library so that it can be loaded after
-# the source libraries but before any system libraries.  Doing so defines
-# the end of Emacs' data section portably across compilers and systems.
-#
-$(TLASTLIB):   $(BLD)/lastfile.$(O)
-       - $(DEL) $@
-       $(AR) $(AR_OUT)$@ $(ALL_DEPS)
-
-#
-# Assuming INSTALL_DIR is defined, build and install emacs in it.
-#
-install:        $(ALL)
-       - mkdir "$(INSTALL_DIR)/bin"
-       $(CP) $(EMACS) $(INSTALL_DIR)/bin
-
-#
-# Maintenance
-#
-# We used to delete *~, s/*~, m/*~ here, but that might inadvertently
-# remove precious files if it happens to match their short 8+3 aliases.
-clean:
-       - $(DEL) "s/*.h~" "m/*.h~"
-       - $(DEL) $(COMPILER_TEMP_FILES)
-       - $(DEL_TREE) $(OBJDIR)
-       - $(DEL) stamp_BLD gl-stamp globals.h
-       - $(DEL) buildobj.h
-
-distclean:     cleanall
-       - $(DEL) config.h epaths.h Makefile
-
-maintainer-clean: distclean
-       - $(DEL) TAGS
-
-cleanall:      clean
-       - $(DEL_TREE) obj
-       - $(DEL_TREE) obj-spd
-       - $(DEL_TREE) oo
-       - $(DEL_TREE) oo-spd
-
-## Arrange to make a tags table TAGS-LISP for ../lisp,
-## plus TAGS for the C files, which includes ../lisp/TAGS by reference.
-##
-## This works only with GNU Make.
-
-TAGS: $(OBJ0) $(OBJ1) $(OBJ2) $(CURDIR)/../nt/inc/ms-w32.h
-       $(MAKE) $(MFLAGS) TAGS-$(MAKETYPE)
-
-TAGS-LISP: $(OBJ0) $(OBJ1) $(OBJ2)
-       $(MAKE) $(MFLAGS) TAGS-LISP-$(MAKETYPE)
-
-TAGS-gmake:
-       ../lib-src/$(BLD)/etags.exe --include=TAGS-LISP --include=../nt/TAGS \
-         address@hidden/nt/emacs-src.tags \
-         $(OBJ0_c)
-       ../lib-src/$(BLD)/etags.exe -a address@hidden/nt/emacs-src.tags \
-         $(OBJ1_c)
-       ../lib-src/$(BLD)/etags.exe -a address@hidden/nt/emacs-src.tags \
-         $(OBJ2_c) \
-         $(CURDIR)/*.h $(CURDIR)/../nt/inc/ms-w32.h
-
-TAGS-nmake:
-       echo This target is not supported with NMake
-       exit -1
-
-frc:
-TAGS-LISP-gmake: frc
-       $(MAKE) $(MFLAGS) -C ../lisp TAGS-LISP DEST=../src
-
-TAGS-LISP-nmake:
-       echo This target is not supported with NMake
-       exit -1
-
-../nt/TAGS: frc
-       $(MAKE) $(MFLAGS) nt-TAGS-$(MAKETYPE)
-
-nt-TAGS-gmake:
-       $(MAKE) $(MFLAGS) -C ../nt TAGS
-
-nt-TAGS-nmake:
-       echo This target is not supported with NMake
-       exit -1
-
-full-tags: TAGS TAGS-LISP ../nt/TAGS
-.PHONY: full-tags
-
-### DEPENDENCIES ###
-
-EMACS_ROOT = ..
-GNU_LIB = $(EMACS_ROOT)/lib
-NT_INC = $(EMACS_ROOT)/nt/inc
-
-ACL_H         = $(GNU_LIB)/acl.h \
-                $(NT_INC)/sys/stat.h \
-                $(NT_INC)/stdbool.h
-SYSTIME_H      = $(SRC)/systime.h \
-                $(NT_INC)/sys/time.h \
-                $(GNU_LIB)/timespec.h
-ATIMER_H       = $(SRC)/atimer.h \
-                $(NT_INC)/stdbool.h \
-                $(SYSTIME_H)
-BUFFER_H       = $(SRC)/buffer.h \
-                $(SYSTIME_H)
-C_CTYPE_H      = $(GNU_LIB)/c-ctype.h \
-                $(NT_INC)/stdbool.h
-CAREADLINKAT_H = $(GNU_LIB)/careadlinkat.h \
-                $(NT_INC)/unistd.h
-CHARACTER_H    = $(SRC)/character.h \
-                $(GNU_LIB)/verify.h
-CCL_H          = $(SRC)/ccl.h \
-                $(CHARACTER_H)
-CHARSET_H      = $(SRC)/charset.h \
-                $(GNU_LIB)/verify.h
-CODING_H       = $(SRC)/coding.h \
-                $(SRC)/composite.h
-MS_W32_H       = $(NT_INC)/ms-w32.h \
-                $(NT_INC)/sys/stat.h
-CONF_POST_H    = $(SRC)/conf_post.h \
-                $(MS_W32_H)
-CONFIG_H       = $(SRC)/config.h \
-                $(CONF_POST_H)
-W32GUI_H       = $(SRC)/w32gui.h \
-                $(SYSTIME_H)
-DISPEXTERN_H   = $(SRC)/dispextern.h \
-                $(GNU_LIB)/c-strcase.h \
-                $(SYSTIME_H) \
-                $(W32GUI_H)
-FILEMODE_H     = $(GNU_LIB)/filemode.h \
-                $(NT_INC)/sys/stat.h
-FRAME_H        = $(SRC)/frame.h \
-                $(DISPEXTERN_H)
-FONT_H         = $(SRC)/font.h \
-                $(CCL_H) \
-                $(FRAME_H)
-FTOASTR_H      = $(GNU_LIB)/ftoastr.h \
-                $(GNU_LIB)/intprops.h
-GRP_H          = $(NT_INC)/grp.h \
-                $(NT_INC)/pwd.h
-INTERVALS_H    = $(SRC)/intervals.h \
-                $(SRC)/composite.h \
-                $(DISPEXTERN_H)
-INTTYPES_H     = $(NT_INC)/inttypes.h \
-                $(NT_INC)/stdint.h
-KEYBOARD_H     = $(SRC)/keyboard.h \
-                $(CODING_H) \
-                $(SYSTIME_H)
-LANGINFO_H     = $(NT_INC)/langinfo.h \
-                $(NT_INC)/nl_types.h
-LISP_H         = $(SRC)/lisp.h \
-                $(SRC)/globals.h \
-                $(GNU_LIB)/intprops.h \
-                $(INTTYPES_H) \
-                $(NT_INC)/stdalign.h \
-                $(NT_INC)/stdbool.h
-MD5_H          = $(GNU_LIB)/md5.h \
-                $(NT_INC)/stdint.h
-MENU_H         = $(SRC)/menu.h \
-                $(SYSTIME_H)
-PROCESS_H      = $(SRC)/process.h \
-                $(SRC)/gnutls.h \
-                $(NT_INC)/unistd.h
-SHA1_H         = $(GNU_LIB)/sha1.h \
-                $(NT_INC)/stdint.h
-SHA256_H       = $(GNU_LIB)/sha256.h \
-                $(NT_INC)/stdint.h
-U64_H          = $(GNU_LIB)/u64.h \
-                $(NT_INC)/stdint.h
-SHA512_H       = $(GNU_LIB)/sha512.h \
-                $(U64_H)
-SIG2STR_H      = $(GNU_LIB)/sig2str.h \
-                $(GNU_LIB)/intprops.h
-SOCKET_H       = $(NT_INC)/sys/socket.h \
-                $(SRC)/w32.h
-STAT_TIME_H    = $(GNU_LIB)/stat-time.h \
-                $(NT_INC)/sys/stat.h
-SYSSIGNAL_H    = $(SRC)/syssignal.h \
-                $(NT_INC)/stdbool.h
-SYSTTY_H       = $(SRC)/systty.h \
-                $(NT_INC)/sys/ioctl.h \
-                $(NT_INC)/unistd.h
-SYSWAIT_H      = $(SRC)/syswait.h \
-                $(NT_INC)/stdbool.h \
-                $(NT_INC)/sys/wait.h
-TERMHOOKS_H    = $(SRC)/termhooks.h \
-                $(SYSTIME_H)
-W32FONT_H      = $(SRC)/w32font.h \
-                $(FONT_H)
-W32TERM_H      = $(SRC)/w32term.h \
-                $(ATIMER_H) \
-                $(FRAME_H) \
-                $(W32GUI_H)
-WINDOW_H       = $(SRC)/window.h \
-                $(DISPEXTERN_H)
-
-$(BLD)/alloc.$(O) : \
-       $(SRC)/alloc.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/puresize.h \
-       $(SRC)/w32.h \
-       $(SRC)/w32heap.h \
-       $(NT_INC)/unistd.h \
-       $(GNU_LIB)/verify.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(PROCESS_H) \
-       $(TERMHOOKS_H) \
-       $(WINDOW_H)
-
-$(BLD)/atimer.$(O) : \
-       $(SRC)/atimer.c \
-       $(SRC)/blockinput.h \
-       $(NT_INC)/unistd.h \
-       $(ATIMER_H) \
-       $(CONFIG_H) \
-       $(LISP_H) \
-       $(SYSSIGNAL_H) \
-       $(SYSTIME_H)
-
-$(BLD)/bidi.$(O) : \
-       $(SRC)/bidi.c \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(LISP_H)
-
-$(BLD)/buffer.$(O) : \
-       $(SRC)/buffer.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/commands.h \
-       $(SRC)/indent.h \
-       $(SRC)/keymap.h \
-       $(SRC)/region-cache.h \
-       $(NT_INC)/sys/param.h \
-       $(NT_INC)/sys/stat.h \
-       $(NT_INC)/unistd.h \
-       $(GNU_LIB)/verify.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(WINDOW_H)
-
-$(BLD)/bytecode.$(O) : \
-       $(SRC)/bytecode.c \
-       $(SRC)/syntax.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(LISP_H) \
-       $(WINDOW_H)
-
-$(BLD)/callint.$(O) : \
-       $(SRC)/callint.c \
-       $(SRC)/commands.h \
-       $(SRC)/keymap.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(WINDOW_H)
-
-$(BLD)/callproc.$(O) : \
-       $(SRC)/callproc.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/commands.h \
-       $(SRC)/composite.h \
-       $(SRC)/epaths.h \
-       $(SRC)/w32.h \
-       $(NT_INC)/sys/file.h \
-       $(NT_INC)/unistd.h \
-       $(BUFFER_H) \
-       $(CCL_H) \
-       $(CHARACTER_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(FRAME_H) \
-       $(LISP_H) \
-       $(PROCESS_H) \
-       $(SYSSIGNAL_H) \
-       $(SYSTTY_H) \
-       $(SYSWAIT_H) \
-       $(TERMHOOKS_H)
-
-$(BLD)/casefiddle.$(O) : \
-       $(SRC)/casefiddle.c \
-       $(SRC)/commands.h \
-       $(SRC)/composite.h \
-       $(SRC)/keymap.h \
-       $(SRC)/syntax.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/casetab.$(O) : \
-       $(SRC)/casetab.c \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/category.$(O) : \
-       $(SRC)/category.c \
-       $(SRC)/category.h \
-       $(SRC)/keymap.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/ccl.$(O) : \
-       $(SRC)/ccl.c \
-       $(CCL_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/character.$(O) : \
-       $(SRC)/character.c \
-       $(SRC)/composite.h \
-       $(SRC)/disptab.h \
-       $(GNU_LIB)/intprops.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/charset.$(O) : \
-       $(SRC)/charset.c \
-       $(SRC)/disptab.h \
-       $(NT_INC)/unistd.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(C_CTYPE_H) \
-       $(LISP_H)
-
-$(BLD)/chartab.$(O) : \
-       $(SRC)/chartab.c \
-       $(CCL_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/cmds.$(O) : \
-       $(SRC)/cmds.c \
-       $(SRC)/commands.h \
-       $(SRC)/keymap.h \
-       $(SRC)/syntax.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(WINDOW_H)
-
-$(BLD)/coding.$(O) : \
-       $(SRC)/coding.c \
-       $(SRC)/composite.h \
-       $(BUFFER_H) \
-       $(CCL_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(FRAME_H) \
-       $(LISP_H) \
-       $(TERMHOOKS_H) \
-       $(WINDOW_H)
-
-$(BLD)/composite.$(O) : \
-       $(SRC)/composite.c \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FONT_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(LISP_H) \
-       $(TERMHOOKS_H) \
-       $(WINDOW_H)
-
-$(BLD)/data.$(O) : \
-       $(SRC)/data.c \
-       $(SRC)/keymap.h \
-       $(SRC)/puresize.h \
-       $(GNU_LIB)/intprops.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(FONT_H) \
-       $(FRAME_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(SYSSIGNAL_H) \
-       $(TERMHOOKS_H)
-
-$(BLD)/dired.$(O) : \
-       $(SRC)/dired.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/commands.h \
-       $(SRC)/regex.h \
-       $(NT_INC)/dirent.h \
-       $(NT_INC)/pwd.h \
-       $(NT_INC)/sys/stat.h \
-       $(NT_INC)/unistd.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(FILEMODE_H) \
-       $(GRP_H) \
-       $(LISP_H) \
-       $(STAT_TIME_H) \
-       $(SYSTIME_H)
-
-$(BLD)/dispnew.$(O) : \
-       $(SRC)/dispnew.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/cm.h \
-       $(SRC)/commands.h \
-       $(SRC)/disptab.h \
-       $(SRC)/indent.h \
-       $(SRC)/termchar.h \
-       $(SRC)/w32.h \
-       $(NT_INC)/unistd.h \
-       $(GNU_LIB)/fpending.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(PROCESS_H) \
-       $(SYSSIGNAL_H) \
-       $(SYSTIME_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/doc.$(O) : \
-       $(SRC)/doc.c \
-       $(SRC)/buildobj.h \
-       $(SRC)/keymap.h \
-       $(NT_INC)/sys/file.h \
-       $(NT_INC)/unistd.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(C_CTYPE_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H)
-
-$(BLD)/doprnt.$(O) : \
-       $(SRC)/doprnt.c \
-       $(NT_INC)/unistd.h \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/editfns.$(O) : \
-       $(SRC)/editfns.c \
-       $(SRC)/blockinput.h \
-       $(NT_INC)/pwd.h \
-       $(NT_INC)/unistd.h \
-       $(GNU_LIB)/intprops.h \
-       $(GNU_LIB)/strftime.h \
-       $(GNU_LIB)/verify.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(FRAME_H) \
-       $(GRP_H) \
-       $(INTERVALS_H) \
-       $(LISP_H) \
-       $(SYSTIME_H) \
-       $(WINDOW_H)
-
-$(BLD)/emacs.$(O) : \
-       $(SRC)/emacs.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/commands.h \
-       $(SRC)/gnutls.h \
-       $(SRC)/keymap.h \
-       $(SRC)/unexec.h \
-       $(SRC)/w32.h \
-       $(SRC)/w32common.h \
-       $(SRC)/w32heap.h \
-       $(SRC)/w32select.h \
-       $(NT_INC)/sys/file.h \
-       $(NT_INC)/unistd.h \
-       $(GNU_LIB)/close-stream.h \
-       $(ATIMER_H) \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(PROCESS_H) \
-       $(SYSSIGNAL_H) \
-       $(SYSTTY_H) \
-       $(TERMHOOKS_H) \
-       $(W32FONT_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/eval.$(O) : \
-       $(SRC)/eval.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/commands.h \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H)
-
-$(BLD)/fileio.$(O) : \
-       $(SRC)/fileio.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/commands.h \
-       $(SRC)/w32.h \
-       $(NT_INC)/pwd.h \
-       $(NT_INC)/sys/acl.h \
-       $(NT_INC)/sys/file.h \
-       $(NT_INC)/sys/stat.h \
-       $(NT_INC)/unistd.h \
-       $(GNU_LIB)/allocator.h \
-       $(ACL_H) \
-       $(BUFFER_H) \
-       $(CAREADLINKAT_H) \
-       $(CHARACTER_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(C_CTYPE_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(LISP_H) \
-       $(STAT_TIME_H) \
-       $(SYSTIME_H) \
-       $(WINDOW_H)
-
-$(BLD)/filelock.$(O) : \
-       $(SRC)/filelock.c \
-       $(SRC)/w32.h \
-       $(NT_INC)/pwd.h \
-       $(NT_INC)/sys/file.h \
-       $(NT_INC)/sys/stat.h \
-       $(NT_INC)/unistd.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(C_CTYPE_H) \
-       $(LISP_H) \
-       $(SYSTIME_H)
-
-$(BLD)/firstfile.$(O) : \
-       $(SRC)/firstfile.c \
-       $(CONFIG_H)
-
-$(BLD)/floatfns.$(O) : \
-       $(SRC)/floatfns.c \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/fns.$(O) : \
-       $(SRC)/fns.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/commands.h \
-       $(SRC)/keymap.h \
-       $(NT_INC)/unistd.h \
-       $(GNU_LIB)/intprops.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LANGINFO_H) \
-       $(LISP_H) \
-       $(MD5_H) \
-       $(SHA1_H) \
-       $(SHA256_H) \
-       $(SHA512_H) \
-       $(WINDOW_H)
-
-$(BLD)/font.$(O) : \
-       $(SRC)/font.c \
-       $(SRC)/composite.h \
-       $(SRC)/fontset.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CONFIG_H) \
-       $(C_CTYPE_H) \
-       $(DISPEXTERN_H) \
-       $(FONT_H) \
-       $(FRAME_H) \
-       $(LISP_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/fontset.$(O) : \
-       $(SRC)/fontset.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/fontset.h \
-       $(BUFFER_H) \
-       $(CCL_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FONT_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/frame.$(O) : \
-       $(SRC)/frame.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/commands.h \
-       $(SRC)/fontset.h \
-       $(SRC)/termchar.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(C_CTYPE_H) \
-       $(DISPEXTERN_H) \
-       $(FONT_H) \
-       $(FRAME_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/fringe.$(O) : \
-       $(SRC)/fringe.c \
-       $(SRC)/blockinput.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(LISP_H) \
-       $(TERMHOOKS_H) \
-       $(WINDOW_H)
-
-$(BLD)/gmalloc.$(O) : \
-       $(SRC)/gmalloc.c \
-       $(SRC)/w32heap.h \
-       $(NT_INC)/stdint.h \
-       $(NT_INC)/unistd.h \
-       $(CONFIG_H)
-
-$(BLD)/gnutls.$(O) : \
-       $(SRC)/gnutls.c \
-       $(SRC)/w32.h \
-       $(CONFIG_H) \
-       $(LISP_H) \
-       $(PROCESS_H)
-
-$(BLD)/xml.$(O) : \
-       $(SRC)/xml.c \
-       $(SRC)/w32.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/profiler.$(O) : \
-       $(SRC)/profiler.c \
-       $(CONFIG_H) \
-       $(LISP_H) \
-       $(SYSSIGNAL_H) \
-       $(SYSTIME_H)
-
-$(BLD)/image.$(O) : \
-       $(SRC)/image.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/epaths.h \
-       $(SRC)/w32.h \
-       $(NT_INC)/unistd.h \
-       $(CHARACTER_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(C_CTYPE_H) \
-       $(DISPEXTERN_H) \
-       $(FONT_H) \
-       $(FRAME_H) \
-       $(LISP_H) \
-       $(SYSTIME_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/indent.$(O) : \
-       $(SRC)/indent.c \
-       $(SRC)/category.h \
-       $(SRC)/composite.h \
-       $(SRC)/disptab.h \
-       $(SRC)/indent.h \
-       $(SRC)/region-cache.h \
-       $(SRC)/termchar.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(WINDOW_H)
-
-$(BLD)/insdel.$(O) : \
-       $(SRC)/insdel.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/region-cache.h \
-       $(GNU_LIB)/intprops.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(INTERVALS_H) \
-       $(LISP_H) \
-       $(WINDOW_H)
-
-$(BLD)/intervals.$(O) : \
-       $(SRC)/intervals.c \
-       $(SRC)/keymap.h \
-       $(SRC)/puresize.h \
-       $(GNU_LIB)/intprops.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H)
-
-$(BLD)/keyboard.$(O) : \
-       $(SRC)/keyboard.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/commands.h \
-       $(SRC)/disptab.h \
-       $(SRC)/keymap.h \
-       $(SRC)/macros.h \
-       $(SRC)/puresize.h \
-       $(SRC)/syntax.h \
-       $(SRC)/termchar.h \
-       $(SRC)/termopts.h \
-       $(NT_INC)/sys/ioctl.h \
-       $(NT_INC)/unistd.h \
-       $(ATIMER_H) \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(PROCESS_H) \
-       $(SYSSIGNAL_H) \
-       $(SYSTIME_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/keymap.$(O) : \
-       $(SRC)/keymap.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/commands.h \
-       $(SRC)/keymap.h \
-       $(SRC)/puresize.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CONFIG_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(TERMHOOKS_H) \
-       $(WINDOW_H)
-
-$(BLD)/lastfile.$(O) : \
-       $(SRC)/lastfile.c \
-       $(CONFIG_H)
-
-$(BLD)/lread.$(O) : \
-       $(SRC)/lread.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/commands.h \
-       $(SRC)/epaths.h \
-       $(NT_INC)/sys/file.h \
-       $(NT_INC)/sys/stat.h \
-       $(NT_INC)/unistd.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(STAT_TIME_H) \
-       $(TERMHOOKS_H)
-
-$(BLD)/macros.$(O) : \
-       $(SRC)/macros.c \
-       $(SRC)/commands.h \
-       $(SRC)/macros.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(WINDOW_H)
-
-$(BLD)/marker.$(O) : \
-       $(SRC)/marker.c \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/menu.$(O) : \
-       $(SRC)/menu.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/keymap.h \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(MENU_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/minibuf.$(O) : \
-       $(SRC)/minibuf.c \
-       $(SRC)/commands.h \
-       $(SRC)/keymap.h \
-       $(SRC)/syntax.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(TERMHOOKS_H) \
-       $(WINDOW_H)
-
-$(BLD)/w32.$(O) : \
-       $(SRC)/w32.c \
-       $(SRC)/w32.h \
-       $(SRC)/w32common.h \
-       $(SRC)/w32heap.h \
-       $(SRC)/w32select.h \
-       $(NT_INC)/dirent.h \
-       $(NT_INC)/pwd.h \
-       $(NT_INC)/sys/acl.h \
-       $(NT_INC)/sys/file.h \
-       $(NT_INC)/sys/time.h \
-       $(GNU_LIB)/allocator.h \
-       $(CAREADLINKAT_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(GRP_H) \
-       $(LISP_H) \
-       $(PROCESS_H) \
-       $(SOCKET_H) \
-       $(SYSTIME_H)
-
-$(BLD)/w32heap.$(O) : \
-       $(SRC)/w32heap.c \
-       $(SRC)/w32common.h \
-       $(SRC)/w32heap.h \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/w32inevt.$(O) : \
-       $(SRC)/w32inevt.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/termchar.h \
-       $(SRC)/w32heap.h \
-       $(SRC)/w32inevt.h \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/w32proc.$(O) : \
-       $(SRC)/w32proc.c \
-       $(SRC)/w32.h \
-       $(SRC)/w32common.h \
-       $(SRC)/w32heap.h \
-       $(NT_INC)/nl_types.h \
-       $(NT_INC)/sys/file.h \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(LANGINFO_H) \
-       $(LISP_H) \
-       $(PROCESS_H) \
-       $(SYSSIGNAL_H) \
-       $(SYSTIME_H) \
-       $(SYSWAIT_H) \
-       $(W32TERM_H)
-
-$(BLD)/w32console.$(O) : \
-       $(SRC)/w32console.c \
-       $(SRC)/disptab.h \
-       $(SRC)/termchar.h \
-       $(SRC)/w32common.h \
-       $(SRC)/w32inevt.h \
-       $(CHARACTER_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(LISP_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/print.$(O) : \
-       $(SRC)/print.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/termchar.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FONT_H) \
-       $(FRAME_H) \
-       $(FTOASTR_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(PROCESS_H) \
-       $(TERMHOOKS_H) \
-       $(WINDOW_H)
-
-$(BLD)/process.$(O) : \
-       $(SRC)/process.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/commands.h \
-       $(SRC)/composite.h \
-       $(SRC)/gnutls.h \
-       $(SRC)/sysselect.h \
-       $(SRC)/termopts.h \
-       $(NT_INC)/arpa/inet.h \
-       $(NT_INC)/netdb.h \
-       $(NT_INC)/netinet/in.h \
-       $(NT_INC)/sys/file.h \
-       $(NT_INC)/sys/ioctl.h \
-       $(NT_INC)/sys/stat.h \
-       $(NT_INC)/unistd.h \
-       $(ATIMER_H) \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(C_CTYPE_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(PROCESS_H) \
-       $(SIG2STR_H) \
-       $(SOCKET_H) \
-       $(SYSSIGNAL_H) \
-       $(SYSTIME_H) \
-       $(SYSTTY_H) \
-       $(SYSWAIT_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/ralloc.$(O) : \
-       $(SRC)/ralloc.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/getpagesize.h \
-       $(NT_INC)/unistd.h \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/regex.$(O) : \
-       $(SRC)/regex.c \
-       $(SRC)/category.h \
-       $(SRC)/regex.h \
-       $(SRC)/syntax.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/region-cache.$(O) : \
-       $(SRC)/region-cache.c \
-       $(SRC)/region-cache.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/scroll.$(O) : \
-       $(SRC)/scroll.c \
-       $(SRC)/termchar.h \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(TERMHOOKS_H) \
-       $(WINDOW_H)
-
-$(BLD)/search.$(O) : \
-       $(SRC)/search.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/category.h \
-       $(SRC)/commands.h \
-       $(SRC)/regex.h \
-       $(SRC)/region-cache.h \
-       $(SRC)/syntax.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CONFIG_H) \
-       $(INTERVALS_H) \
-       $(LISP_H)
-
-$(BLD)/sound.$(O) : \
-       $(SRC)/sound.c \
-       $(NT_INC)/unistd.h \
-       $(ATIMER_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(LISP_H) \
-       $(SYSSIGNAL_H)
-
-$(BLD)/syntax.$(O) : \
-       $(SRC)/syntax.c \
-       $(SRC)/category.h \
-       $(SRC)/commands.h \
-       $(SRC)/keymap.h \
-       $(SRC)/regex.h \
-       $(SRC)/syntax.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(INTERVALS_H) \
-       $(LISP_H)
-
-$(BLD)/sysdep.$(O) : \
-       $(SRC)/sysdep.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/cm.h \
-       $(SRC)/sysselect.h \
-       $(SRC)/termchar.h \
-       $(SRC)/termopts.h \
-       $(NT_INC)/netdb.h \
-       $(NT_INC)/pwd.h \
-       $(NT_INC)/sys/file.h \
-       $(NT_INC)/sys/param.h \
-       $(NT_INC)/sys/stat.h \
-       $(NT_INC)/unistd.h \
-       $(GNU_LIB)/execinfo.h \
-       $(GNU_LIB)/utimens.h \
-       $(CONFIG_H) \
-       $(C_CTYPE_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(GRP_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(PROCESS_H) \
-       $(SOCKET_H) \
-       $(SYSSIGNAL_H) \
-       $(SYSTIME_H) \
-       $(SYSTTY_H) \
-       $(SYSWAIT_H) \
-       $(TERMHOOKS_H) \
-       $(WINDOW_H)
-
-$(BLD)/term.$(O) : \
-       $(SRC)/term.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/cm.h \
-       $(SRC)/composite.h \
-       $(SRC)/disptab.h \
-       $(SRC)/keymap.h \
-       $(SRC)/termchar.h \
-       $(SRC)/tparam.h \
-       $(NT_INC)/sys/file.h \
-       $(NT_INC)/sys/time.h \
-       $(NT_INC)/unistd.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(SYSSIGNAL_H) \
-       $(SYSTTY_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/terminal.$(O) : \
-       $(SRC)/terminal.c \
-       $(SRC)/termchar.h \
-       $(CHARSET_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(FRAME_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(TERMHOOKS_H)
-
-$(BLD)/textprop.$(O) : \
-       $(SRC)/textprop.c \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(INTERVALS_H) \
-       $(LISP_H) \
-       $(WINDOW_H)
-
-$(BLD)/tparam.$(O) : \
-       $(SRC)/tparam.c \
-       $(SRC)/tparam.h \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/undo.$(O) : \
-       $(SRC)/undo.c \
-       $(SRC)/commands.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(LISP_H) \
-       $(WINDOW_H)
-
-$(BLD)/unexw32.$(O) : \
-       $(SRC)/unexw32.c \
-       $(SRC)/unexec.h \
-       $(SRC)/w32.h \
-       $(SRC)/w32common.h \
-       $(SRC)/w32heap.h \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/vm-limit.$(O) : \
-       $(SRC)/vm-limit.c \
-       $(SRC)/w32heap.h \
-       $(NT_INC)/unistd.h \
-       $(CONFIG_H) \
-       $(LISP_H)
-
-$(BLD)/window.$(O) : \
-       $(SRC)/window.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/commands.h \
-       $(SRC)/disptab.h \
-       $(SRC)/indent.h \
-       $(SRC)/keymap.h \
-       $(SRC)/termchar.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/xdisp.$(O) : \
-       $(SRC)/xdisp.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/commands.h \
-       $(SRC)/disptab.h \
-       $(SRC)/fontset.h \
-       $(SRC)/indent.h \
-       $(SRC)/keymap.h \
-       $(SRC)/macros.h \
-       $(SRC)/region-cache.h \
-       $(SRC)/termchar.h \
-       $(SRC)/termopts.h \
-       $(ATIMER_H) \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FONT_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(PROCESS_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/xfaces.$(O) : \
-       $(SRC)/xfaces.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/fontset.h \
-       $(SRC)/termchar.h \
-       $(NT_INC)/sys/stat.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CONFIG_H) \
-       $(C_CTYPE_H) \
-       $(DISPEXTERN_H) \
-       $(FONT_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/w32fns.$(O) : \
-       $(SRC)/w32fns.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/epaths.h \
-       $(SRC)/fontset.h \
-       $(SRC)/w32.h \
-       $(SRC)/w32common.h \
-       $(SRC)/w32heap.h \
-       $(NT_INC)/unistd.h \
-       $(BUFFER_H) \
-       $(CCL_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FONT_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(SYSTIME_H) \
-       $(TERMHOOKS_H) \
-       $(W32FONT_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/w32menu.$(O) : \
-       $(SRC)/w32menu.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/keymap.h \
-       $(SRC)/w32common.h \
-       $(BUFFER_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FRAME_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(MENU_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/w32term.$(O) : \
-       $(SRC)/w32term.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/disptab.h \
-       $(SRC)/fontset.h \
-       $(SRC)/keymap.h \
-       $(SRC)/termchar.h \
-       $(SRC)/termopts.h \
-       $(SRC)/w32heap.h \
-       $(NT_INC)/sys/stat.h \
-       $(ATIMER_H) \
-       $(BUFFER_H) \
-       $(CCL_H) \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FONT_H) \
-       $(FRAME_H) \
-       $(INTERVALS_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(PROCESS_H) \
-       $(SYSTIME_H) \
-       $(SYSTTY_H) \
-       $(TERMHOOKS_H) \
-       $(W32FONT_H) \
-       $(W32TERM_H) \
-       $(WINDOW_H)
-
-$(BLD)/w32select.$(O) : \
-       $(SRC)/w32select.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/composite.h \
-       $(SRC)/w32common.h \
-       $(CHARSET_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(W32TERM_H)
-
-$(BLD)/w32reg.$(O) : \
-       $(SRC)/w32reg.c \
-       $(SRC)/blockinput.h \
-       $(CONFIG_H) \
-       $(LISP_H) \
-       $(W32TERM_H)
-
-$(BLD)/w32xfns.$(O) : \
-       $(SRC)/w32xfns.c \
-       $(SRC)/blockinput.h \
-       $(SRC)/fontset.h \
-       $(CHARSET_H) \
-       $(CONFIG_H) \
-       $(FRAME_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(W32TERM_H)
-
-$(BLD)/w32font.$(O) : \
-       $(SRC)/w32font.c \
-       $(SRC)/fontset.h \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FONT_H) \
-       $(FRAME_H) \
-       $(LISP_H) \
-       $(W32FONT_H) \
-       $(W32TERM_H)
-
-$(BLD)/w32uniscribe.$(O) : \
-       $(SRC)/w32uniscribe.c \
-       $(SRC)/composite.h \
-       $(SRC)/fontset.h \
-       $(CHARACTER_H) \
-       $(CHARSET_H) \
-       $(CONFIG_H) \
-       $(DISPEXTERN_H) \
-       $(FONT_H) \
-       $(FRAME_H) \
-       $(LISP_H) \
-       $(W32FONT_H) \
-       $(W32TERM_H)
-
-$(BLD)/w32notify.$(O) : \
-       $(SRC)/w32notify.c \
-       $(SRC)/w32.h \
-       $(SRC)/w32common.h \
-       $(CODING_H) \
-       $(CONFIG_H) \
-       $(FRAME_H) \
-       $(KEYBOARD_H) \
-       $(LISP_H) \
-       $(TERMHOOKS_H) \
-       $(W32TERM_H)
-
-# Each object file depends on stamp_BLD, because in parallel builds we must
-# make sure $(BLD) exists before starting compilations.
-#
-$(OBJ0) $(OBJ1) $(OBJ2) $(BLD)/lastfile.$(O) $(BLD)/firstfile.$(O): stamp_BLD
diff --git a/src/nsimage.m b/src/nsimage.m
index 9302cd2..13e8504 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -102,7 +102,7 @@ ns_load_image (struct frame *f, struct image *img,
 
   if (eImg == nil)
     {
-      add_to_log ("Unable to load image %s", img->spec, Qnil);
+      add_to_log ("Unable to load image %s", img->spec);
       return 0;
     }
 
diff --git a/src/regex.c b/src/regex.c
index 38c5e35..dcf2864 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -1544,9 +1544,9 @@ do {                                                      
                \
   DEBUG_PRINT ("  Push frame index: %zd\n", fail_stack.frame);         \
   PUSH_FAILURE_INT (fail_stack.frame);                                 \
                                                                        \
-  DEBUG_PRINT ("  Push string %p: `", string_place);                   \
+  DEBUG_PRINT ("  Push string %p: \"", string_place);                  \
   DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, size2);\
-  DEBUG_PRINT ("'\n");                                                 \
+  DEBUG_PRINT ("\"\n");                                                        
\
   PUSH_FAILURE_POINTER (string_place);                                 \
                                                                        \
   DEBUG_PRINT ("  Push pattern %p: ", pattern);                                
\
@@ -1598,9 +1598,9 @@ do {                                                      
                \
      on_failure_keep_string_jump opcode, and we want to throw away the \
      saved NULL, thus retaining our current position in the string.  */        
\
   str = POP_FAILURE_POINTER ();                                                
\
-  DEBUG_PRINT ("  Popping string %p: `", str);                         \
+  DEBUG_PRINT ("  Popping string %p: \"", str);                                
\
   DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2);     \
-  DEBUG_PRINT ("'\n");                                                 \
+  DEBUG_PRINT ("\"\n");                                                        
\
                                                                        \
   fail_stack.frame = POP_FAILURE_INT ();                               \
   DEBUG_PRINT ("  Popping  frame index: %zd\n", fail_stack.frame);     \
@@ -5127,9 +5127,9 @@ re_match_2_internal (struct re_pattern_buffer *bufp, 
const_re_char *string1,
 
   DEBUG_PRINT ("The compiled pattern is: ");
   DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend);
-  DEBUG_PRINT ("The string to match is: `");
+  DEBUG_PRINT ("The string to match is: \"");
   DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
-  DEBUG_PRINT ("'\n");
+  DEBUG_PRINT ("\"\n");
 
   /* This loops over pattern commands.  It exits by returning from the
      function if the match is complete, or it drops through if the match
@@ -5435,7 +5435,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, 
const_re_char *string1,
                    && buf_ch == '\000'))
              goto fail;
 
-           DEBUG_PRINT ("  Matched `%d'.\n", *d);
+           DEBUG_PRINT ("  Matched \"%d\".\n", *d);
            d += buf_charlen;
          }
          break;
diff --git a/src/regex.h b/src/regex.h
index 3dfecf0..c89ca46 100644
--- a/src/regex.h
+++ b/src/regex.h
@@ -603,7 +603,9 @@ typedef wchar_t re_wchar_t;
 # define re_wctype_to_bit(cc) 0
 #else
 # define CHAR_CLASS_MAX_LENGTH  9 /* Namely, `multibyte'.  */
-# define btowc(c) c
+# ifndef emacs
+#  define btowc(c) c
+# endif
 
 /* Character classes.  */
 typedef enum { RECC_ERROR = 0,
diff --git a/src/syntax.c b/src/syntax.c
index 0d8b08c..d543a5f 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1333,7 +1333,10 @@ DEFUN ("internal-describe-syntax-value", 
Finternal_describe_syntax_value,
     insert_string (" (nestable)");
 
   if (prefix)
-    insert_string (",\n\t  is a prefix character for `backward-prefix-chars'");
+    insert1 (CALLN (Fformat,
+                   (build_string
+                    (",\n\t  is a prefix character for "
+                     uLSQM"backward-prefix-chars"uRSQM))));
 
   return syntax;
 }
diff --git a/src/sysdep.c b/src/sysdep.c
index df3e573..25f111a 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1612,7 +1612,7 @@ handle_arith_signal (int sig)
   xsignal0 (Qarith_error);
 }
 
-#ifdef HAVE_STACK_OVERFLOW_HANDLING
+#if defined HAVE_STACK_OVERFLOW_HANDLING && !defined WINDOWSNT
 
 /* Alternate stack used by SIGSEGV handler below.  */
 
@@ -1708,7 +1708,7 @@ init_sigsegv (void)
   return sigaction (SIGSEGV, &sa, NULL) < 0 ? 0 : 1;
 }
 
-#else /* not HAVE_STACK_OVERFLOW_HANDLING */
+#else /* not HAVE_STACK_OVERFLOW_HANDLING or WINDOWSNT */
 
 static bool
 init_sigsegv (void)
@@ -1716,7 +1716,7 @@ init_sigsegv (void)
   return 0;
 }
 
-#endif /* HAVE_STACK_OVERFLOW_HANDLING */
+#endif /* HAVE_STACK_OVERFLOW_HANDLING && !WINDOWSNT */
 
 static void
 deliver_arith_signal (int sig)
diff --git a/src/w32fns.c b/src/w32fns.c
index ad93bd4..2cb99c9 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -2941,7 +2941,11 @@ get_wm_chars (HWND aWnd, int *buf, int buflen, int 
ignore_ctrl, int ctrl,
    environments!) should  have different values.  Moreover, switching to a
    non-Emacs window with the same language environment, and using (dead)keys
    there would change the value stored in the kernel, but not this value.  */
-static int after_deadkey = 0;
+/* A layout may emit deadkey=0.  It looks like this would reset the state
+   of the kernel's finite automaton (equivalent to emiting 0-length string,
+   which is otherwise impossible in the dead-key map of a layout).
+   Be ready to treat the case when this delivers WM_(SYS)DEADCHAR. */
+static int after_deadkey = -1;
 
 int
 deliver_wm_chars (int do_translate, HWND hwnd, UINT msg, UINT wParam,
@@ -2951,7 +2955,7 @@ deliver_wm_chars (int do_translate, HWND hwnd, UINT msg, 
UINT wParam,
      points to a keypress.
      (However, the "old style" TranslateMessage() would deliver at most 16 of
      them.)  Be on a safe side, and prepare to treat many more.  */
-  int ctrl_cnt, buf[1024], count, is_dead, after_dead = (after_deadkey != -1);
+  int ctrl_cnt, buf[1024], count, is_dead, after_dead = (after_deadkey > 0);
 
   /* Since the keypress processing logic of Windows has a lot of state, it
      is important to call TranslateMessage() for every keyup/keydown, AND
@@ -3131,7 +3135,7 @@ deliver_wm_chars (int do_translate, HWND hwnd, UINT msg, 
UINT wParam,
            }
          else if (wmsg.dwModifiers & (alt_modifier | meta_modifier)
                   || (console_modifiers
-                      & (RIGHT_WIN_PRESSED | RIGHT_WIN_PRESSED
+                      & (LEFT_WIN_PRESSED | RIGHT_WIN_PRESSED
                          | APPS_PRESSED | SCROLLLOCK_ON)))
            {
              /* Pure Alt (or combination of Alt, Win, APPS, scrolllock.  */
@@ -9239,18 +9243,71 @@ static DWORD except_code;
 static PVOID except_addr;
 
 #ifndef CYGWIN
+
+/* Stack overflow recovery.  */
+
+/* Re-establish the guard page at stack limit.  This is needed because
+   when a stack overflow is detected, Windows removes the guard bit
+   from the guard page, so if we don't re-establish that protection,
+   the next stack overflow will cause a crash.  */
+void
+w32_reset_stack_overflow_guard (void)
+{
+  /* MinGW headers don't declare this (should be in malloc.h).  */
+  _CRTIMP int __cdecl _resetstkoflw (void);
+
+  /* We ignore the return value.  If _resetstkoflw fails, the next
+     stack overflow will crash the program.  */
+  (void)_resetstkoflw ();
+}
+
+static void
+stack_overflow_handler (void)
+{
+  /* Hard GC error may lead to stack overflow caused by
+     too nested calls to mark_object.  No way to survive.  */
+  if (gc_in_progress)
+    terminate_due_to_signal (SIGSEGV, 40);
+#ifdef _WIN64
+  /* See ms-w32.h: MinGW64's longjmp crashes if invoked in this context.  */
+  __builtin_longjmp (return_to_command_loop, 1);
+#else
+  sys_longjmp (return_to_command_loop, 1);
+#endif
+}
+
 /* This handler records the exception code and the address where it
    was triggered so that this info could be included in the backtrace.
    Without that, the backtrace in some cases has no information
    whatsoever about the offending code, and looks as if the top-level
-   exception handler in the MinGW startup code di the one that
-   crashed.  */
+   exception handler in the MinGW startup code was the one that
+   crashed.  We also recover from stack overflow, by calling our stack
+   overflow handler that jumps back to top level.  */
 static LONG CALLBACK
 my_exception_handler (EXCEPTION_POINTERS * exception_data)
 {
   except_code = exception_data->ExceptionRecord->ExceptionCode;
   except_addr = exception_data->ExceptionRecord->ExceptionAddress;
 
+  /* If this is a stack overflow exception, attempt to recover.  */
+  if (exception_data->ExceptionRecord->ExceptionCode == 
EXCEPTION_STACK_OVERFLOW
+      && exception_data->ExceptionRecord->NumberParameters == 2
+      /* We can only longjmp to top level from the main thread.  */
+      && GetCurrentThreadId () == dwMainThreadId)
+    {
+      /* Call stack_overflow_handler ().  */
+#ifdef _WIN64
+      exception_data->ContextRecord->Rip = (DWORD_PTR) &stack_overflow_handler;
+#else
+      exception_data->ContextRecord->Eip = (DWORD_PTR) &stack_overflow_handler;
+#endif
+      /* Zero this out, so the stale address of the stack overflow
+        exception we handled is not displayed in some future
+        unrelated crash.  */
+      except_addr = 0;
+      return EXCEPTION_CONTINUE_EXECUTION;
+    }
+
   if (prev_exception_handler)
     return prev_exception_handler (exception_data);
   return EXCEPTION_EXECUTE_HANDLER;
@@ -9448,6 +9505,10 @@ globals_of_w32fns (void)
   InitCommonControls ();
 
   syms_of_w32uniscribe ();
+
+  /* Needed for recovery from C stack overflows in batch mode.  */
+  if (noninteractive)
+    dwMainThreadId = GetCurrentThreadId ();
 }
 
 #ifdef NTGUI_UNICODE
diff --git a/src/xdisp.c b/src/xdisp.c
index e45cb87..6d747eb 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4187,13 +4187,13 @@ handle_invisible_prop (struct it *it)
 
   if (STRINGP (it->string))
     {
-      Lisp_Object end_charpos, limit, charpos;
+      Lisp_Object end_charpos, limit;
 
       /* Get the value of the invisible text property at the
         current position.  Value will be nil if there is no such
         property.  */
-      charpos = make_number (IT_STRING_CHARPOS (*it));
-      prop = Fget_text_property (charpos, Qinvisible, it->string);
+      end_charpos = make_number (IT_STRING_CHARPOS (*it));
+      prop = Fget_text_property (end_charpos, Qinvisible, it->string);
       invis = TEXT_PROP_MEANS_INVISIBLE (prop);
 
       if (invis != 0 && IT_STRING_CHARPOS (*it) < it->end_charpos)
@@ -4211,8 +4211,12 @@ handle_invisible_prop (struct it *it)
          XSETINT (limit, len);
          do
            {
-             end_charpos = Fnext_single_property_change (charpos, Qinvisible,
-                                                         it->string, limit);
+             end_charpos
+               = Fnext_single_property_change (end_charpos, Qinvisible,
+                                               it->string, limit);
+             /* Since LIMIT is always an integer, so should be the
+                value returned by Fnext_single_property_change.  */
+             eassert (INTEGERP (end_charpos));
              if (INTEGERP (end_charpos))
                {
                  endpos = XFASTINT (end_charpos);
@@ -4221,6 +4225,8 @@ handle_invisible_prop (struct it *it)
                  if (invis == 2)
                    display_ellipsis_p = true;
                }
+             else /* Should never happen; but if it does, exit the loop.  */
+               endpos = len;
            }
          while (invis != 0 && endpos < len);
 
@@ -4256,7 +4262,7 @@ handle_invisible_prop (struct it *it)
                }
              else
                {
-                 IT_STRING_CHARPOS (*it) = XFASTINT (end_charpos);
+                 IT_STRING_CHARPOS (*it) = endpos;
                  compute_string_pos (&it->current.string_pos, old, it->string);
                }
            }
@@ -5966,6 +5972,7 @@ pop_it (struct it *it)
 {
   struct iterator_stack_entry *p;
   bool from_display_prop = it->from_disp_prop_p;
+  ptrdiff_t prev_pos = IT_CHARPOS (*it);
 
   eassert (it->sp > 0);
   --it->sp;
@@ -6054,6 +6061,11 @@ pop_it (struct it *it)
                   && IT_STRING_BYTEPOS (*it) == it->bidi_it.bytepos)
               || (CONSP (it->object) && it->method == GET_FROM_STRETCH));
     }
+  /* If we move the iterator over text covered by a display property
+     to a new buffer position, any info about previously seen overlays
+     is no longer valid.  */
+  if (from_display_prop && it->sp == 0 && CHARPOS (it->position) != prev_pos)
+    it->ignore_overlay_strings_at_pos_p = false;
 }
 
 
@@ -6878,9 +6890,10 @@ get_next_display_element (struct it *it)
             non-ASCII spaces and hyphens specially.  */
          if (! ASCII_CHAR_P (c) && ! NILP (Vnobreak_char_display))
            {
-             if (c == 0xA0)
+             if (c == NO_BREAK_SPACE)
                nonascii_space_p = true;
-             else if (c == 0xAD || c == 0x2010 || c == 0x2011)
+             else if (c == SOFT_HYPHEN || c == HYPHEN
+                      || c == NON_BREAKING_HYPHEN)
                nonascii_hyphen_p = true;
            }
 
@@ -9784,27 +9797,50 @@ include the height of both, if present, in the return 
value.  */)
                               Messages
  ***********************************************************************/
 
+/* Return the number of arguments the format string FORMAT needs.  */
+
+static ptrdiff_t
+format_nargs (char const *format)
+{
+  ptrdiff_t nargs = 0;
+  for (char const *p = format; (p = strchr (p, '%')); p++)
+    if (p[1] == '%')
+      p++;
+    else
+      nargs++;
+  return nargs;
+}
 
-/* Add a message with format string FORMAT and arguments ARG1 and ARG2
+/* Add a message with format string FORMAT and formatted arguments
    to *Messages*.  */
 
 void
-add_to_log (const char *format, Lisp_Object arg1, Lisp_Object arg2)
+add_to_log (const char *format, ...)
 {
-  Lisp_Object msg, fmt;
-  char *buffer;
-  ptrdiff_t len;
-  struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
-  USE_SAFE_ALLOCA;
-
-  fmt = msg = Qnil;
-  GCPRO4 (fmt, msg, arg1, arg2);
+  va_list ap;
+  va_start (ap, format);
+  vadd_to_log (format, ap);
+  va_end (ap);
+}
 
-  fmt = build_string (format);
-  msg = CALLN (Fformat, fmt, arg1, arg2);
+void
+vadd_to_log (char const *format, va_list ap)
+{
+  ptrdiff_t nargs = 1 + format_nargs (format);
+  Lisp_Object args[10];
+  eassert (nargs <= ARRAYELTS (args));
+  args[0] = build_string (format);
+  for (ptrdiff_t i = 1; i <= nargs; i++)
+    args[i] = va_arg (ap, Lisp_Object);
+  Lisp_Object msg = Qnil;
+  struct gcpro gcpro1, gcpro2;
+  GCPRO2 (args, msg);
+  gcpro1.nvars = nargs;
+  msg = Fformat (nargs, args);
 
-  len = SBYTES (msg) + 1;
-  buffer = SAFE_ALLOCA (len);
+  ptrdiff_t len = SBYTES (msg) + 1;
+  USE_SAFE_ALLOCA;
+  char *buffer = SAFE_ALLOCA (len);
   memcpy (buffer, SDATA (msg), len);
 
   message_dolog (buffer, len - 1, true, false);
@@ -10239,9 +10275,9 @@ message_with_string (const char *m, Lisp_Object string, 
bool log)
 /* Dump an informative message to the minibuf.  If M is 0, clear out
    any existing message, and let the mini-buffer text show through.
 
-   The message must be safe ASCII only.  If strings may contain escape
-   sequences or non-ASCII characters, convert them to Lisp strings and
-   use Fmessage.  */
+   The message must be safe ASCII and the format must not contain ` or
+   '.  If your message and format do not fit into this category,
+   convert your arguments to Lisp objects and use Fmessage instead.  */
 
 static void ATTRIBUTE_FORMAT_PRINTF (1, 0)
 vmessage (const char *m, va_list ap)
@@ -19216,7 +19252,7 @@ append_space_for_newline (struct it *it, bool 
default_face_p)
             funny, and height of empty lines will be incorrect.  */
          g = it->glyph_row->glyphs[TEXT_AREA] + n;
          struct font *font = face->font ? face->font : FRAME_FONT (it->f);
-         if (n == 0 || it->glyph_row->height < font->pixel_size)
+         if (n == 0)
            {
              Lisp_Object height, total_height;
              int extra_line_spacing = it->extra_line_spacing;
diff --git a/src/xfaces.c b/src/xfaces.c
index f0b6d39..d519578 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -797,7 +797,7 @@ load_pixmap (struct frame *f, Lisp_Object name)
 
   if (bitmap_id < 0)
     {
-      add_to_log ("Invalid or undefined bitmap `%s'", name, Qnil);
+      add_to_log ("Invalid or undefined bitmap "uLSQM"%s"uRSQM, name);
       bitmap_id = 0;
     }
   else
@@ -1099,7 +1099,7 @@ load_color2 (struct frame *f, struct face *face, 
Lisp_Object name,
      to the values in an existing cell. */
   if (!defined_color (f, SSDATA (name), color, true))
     {
-      add_to_log ("Unable to load color \"%s\"", name, Qnil);
+      add_to_log ("Unable to load color \"%s\"", name);
 
       switch (target_index)
        {
@@ -2247,7 +2247,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, 
Lisp_Object *to,
          else
            {
              if (err_msgs)
-               add_to_log ("Invalid face color", color_name, Qnil);
+               add_to_log ("Invalid face color %S", color_name);
              ok = false;
            }
        }
@@ -2452,7 +2452,7 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, 
Lisp_Object *to,
       /* FACE_REF ought to be a face name.  */
       ok = merge_named_face (f, face_ref, to, named_merge_points);
       if (!ok && err_msgs)
-       add_to_log ("Invalid face reference: %s", face_ref, Qnil);
+       add_to_log ("Invalid face reference: %s", face_ref);
     }
 
   return ok;
diff --git a/src/xselect.c b/src/xselect.c
index bd2d65e..b54ddd8 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2147,8 +2147,10 @@ x_clipboard_manager_save (Lisp_Object frame)
 static Lisp_Object
 x_clipboard_manager_error_1 (Lisp_Object err)
 {
-  AUTO_STRING (format, "X clipboard manager error: %s\n\
-If the problem persists, set `x-select-enable-clipboard-manager' to nil.");
+  Lisp_Object format
+    = build_string ("X clipboard manager error: %s\n"
+                   "If the problem persists, set "
+                   uLSQM"x-select-enable-clipboard-manager"uRSQM" to nil.");
   CALLN (Fmessage, format, CAR (CDR (err)));
   return Qnil;
 }
diff --git a/src/xsettings.c b/src/xsettings.c
index 028487b..f6a8bfd 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -537,10 +537,10 @@ parse_settings (unsigned char *prop,
               else
                 settings->seen &= ~SEEN_RGBA;
             }
-          else if (strcmp (name, "Xft/DPI") == 0)
+          else if (strcmp (name, "Xft/DPI") == 0 && ival != (CARD32) -1)
             {
               settings->seen |= SEEN_DPI;
-              settings->dpi = (double)ival/1024.0;
+              settings->dpi = ival / 1024.0;
             }
           else if (strcmp (name, "Xft/lcdfilter") == 0)
             {
diff --git a/test/automated/elisp-mode-tests.el 
b/test/automated/elisp-mode-tests.el
index 2581de4..64b3f66 100644
--- a/test/automated/elisp-mode-tests.el
+++ b/test/automated/elisp-mode-tests.el
@@ -3,6 +3,7 @@
 ;; Copyright (C) 2015 Free Software Foundation, Inc.
 
 ;; Author: Dmitry Gutov <address@hidden>
+;; Author: Stephen Leake <address@hidden>
 
 ;; This file is part of GNU Emacs.
 
@@ -113,26 +114,420 @@
       (should (member "backup-buffer" comps))
       (should-not (member "backup-inhibited" comps)))))
 
-;;; Navigation
+;;; xref
 
-(ert-deftest elisp-xref-finds-both-function-and-variable ()
-  ;; "system-name" is both: a variable and a function
-  (let ((defs (elisp-xref-find 'definitions "system-name")))
-    (should (= (length defs) 2))
-    (should (string= (xref-item-summary (nth 0 defs))
-                     "(defun system-name)"))
-    (should (string= (xref-item-summary (nth 1 defs))
-                     "(defvar system-name)")))
+(defun xref-elisp-test-descr-to-target (xref)
+  "Return an appropriate `looking-at' match string for XREF."
+  (let* ((loc (xref-item-location xref))
+        (type (or (xref-elisp-location-type loc)
+                 'defun)))
+
+    (cl-case type
+      (defalias
+       ;; summary: "(defalias xref)"
+       ;; target : "(defalias 'xref)"
+       (concat "(defalias '" (substring (xref-item-summary xref) 10 -1)))
+
+      (defun
+       (let ((summary (xref-item-summary xref))
+            (file (xref-elisp-location-file loc)))
+        (cond
+         ((string= "c" (file-name-extension file))
+          ;; summary: "(defun buffer-live-p)"
+          ;; target : "DEFUN (buffer-live-p"
+          (concat
+           (upcase (substring summary 1 6))
+           " (\""
+           (substring summary 7 -1)
+           "\""))
+
+         (t
+          (substring summary 0 -1))
+         )))
+
+      (defvar
+       (let ((summary (xref-item-summary xref))
+            (file (xref-elisp-location-file loc)))
+        (cond
+         ((string= "c" (file-name-extension file))
+          ;; summary: "(defvar system-name)"
+          ;; target : "DEFVAR_LISP ("system-name", "
+           ;; summary: "(defvar abbrev-mode)"
+           ;; target : DEFVAR_PER_BUFFER ("abbrev-mode"
+          (concat
+           (upcase (substring summary 1 7))
+            (if (bufferp (variable-binding-locus (xref-elisp-location-symbol 
loc)))
+                "_PER_BUFFER (\""
+              "_LISP (\"")
+           (substring summary 8 -1)
+           "\""))
+
+         (t
+          (substring summary 0 -1))
+         )))
+
+      (feature
+       ;; summary: "(feature xref)"
+       ;; target : "(provide 'xref)"
+       (concat "(provide '" (substring (xref-item-summary xref) 9 -1)))
+
+      (otherwise
+       (substring (xref-item-summary xref) 0 -1))
+      )))
+
+
+(defun xref-elisp-test-run (xrefs expected-xrefs)
+  (should (= (length xrefs) (length expected-xrefs)))
+  (while xrefs
+    (let ((xref (pop xrefs))
+          (expected (pop expected-xrefs)))
+
+      (should (equal xref
+                     (or (when (consp expected) (car expected)) expected)))
+
+      (xref--goto-location (xref-item-location xref))
+      (should (looking-at (or (when (consp expected) (cdr expected))
+                              (xref-elisp-test-descr-to-target expected)))))
+    ))
+
+(defmacro xref-elisp-deftest (name computed-xrefs expected-xrefs)
+  "Define an ert test for an xref-elisp feature.
+COMPUTED-XREFS and EXPECTED-XREFS are lists of xrefs, except if
+an element of EXPECTED-XREFS is a cons (XREF . TARGET), TARGET is
+matched to the found location; otherwise, match
+to (xref-elisp-test-descr-to-target xref)."
+  (declare (indent defun)
+           (debug (symbolp "name")))
+  `(ert-deftest ,(intern (concat "xref-elisp-test-" (symbol-name name))) ()
+     (xref-elisp-test-run ,computed-xrefs ,expected-xrefs)
+     ))
+
+;; When tests are run from the Makefile, 'default-directory' is $HOME,
+;; so we must provide this dir to expand-file-name in the expected
+;; results. This also allows running these tests from other
+;; directories.
+(defconst emacs-test-dir (file-name-directory (or load-file-name 
(buffer-file-name))))
+
+;; alphabetical by test name
+
+;; FIXME: autoload
+
+;; FIXME: defalias-defun-c cmpl-prefix-entry-head
+;; FIXME: defalias-defvar-el allout-mode-map
+
+(xref-elisp-deftest find-defs-constructor
+  (elisp--xref-find-definitions 'xref-make-elisp-location)
+  ;; 'xref-make-elisp-location' is just a name for the default
+  ;; constructor created by the cl-defstruct, so the location is the
+  ;; cl-defstruct location.
+  (list
+   (cons
+    (xref-make "(cl-defstruct (xref-elisp-location (:constructor 
xref-make-elisp-location)))"
+               (xref-make-elisp-location
+                'xref-elisp-location 'define-type
+                (expand-file-name "../../lisp/progmodes/elisp-mode.el" 
emacs-test-dir)))
+    ;; It's not worth adding another special case to 
`xref-elisp-test-descr-to-target' for this
+    "(cl-defstruct (xref-elisp-location")
+   ))
+
+(xref-elisp-deftest find-defs-defalias-defun-el
+  (elisp--xref-find-definitions 'Buffer-menu-sort)
+  (list
+   (xref-make "(defalias Buffer-menu-sort)"
+             (xref-make-elisp-location
+              'Buffer-menu-sort 'defalias
+              (expand-file-name "../../lisp/buff-menu.elc" emacs-test-dir)))
+   (xref-make "(defun tabulated-list-sort)"
+             (xref-make-elisp-location
+              'tabulated-list-sort nil
+              (expand-file-name "../../lisp/emacs-lisp/tabulated-list.el" 
emacs-test-dir)))
+   ))
+
+;; FIXME: defconst
+
+;; FIXME: eieio defclass
+
+;; Possible ways of defining the default method implementation for a
+;; generic function. We declare these here, so we know we cover all
+;; cases, and we don't rely on other code not changing.
+;;
+;; When the generic and default method are declared in the same place,
+;; elisp--xref-find-definitions only returns one.
+
+(cl-defstruct (xref-elisp-root-type)
+  slot-1)
+
+(cl-defgeneric xref-elisp-generic-no-methods ()
+  "doc string no-methods"
+  ;; No default implementation, no methods, but fboundp is true for
+  ;; this symbol; it calls cl-no-applicable-method
+  )
+
+(cl-defmethod xref-elisp-generic-no-default ((this xref-elisp-root-type))
+  "doc string no-default xref-elisp-root-type"
+  "non-default for no-default")
+
+;; defgeneric after defmethod in file to ensure the fallback search
+;; method of just looking for the function name will fail.
+(cl-defgeneric xref-elisp-generic-no-default ()
+  "doc string no-default generic"
+  ;; No default implementation; this function calls the cl-generic
+  ;; dispatching code.
+  )
+
+(cl-defgeneric xref-elisp-generic-co-located-default ()
+  "doc string co-located-default generic"
+  "co-located default")
+
+(cl-defmethod xref-elisp-generic-co-located-default ((this 
xref-elisp-root-type))
+  "doc string co-located-default xref-elisp-root-type"
+  "non-default for co-located-default")
+
+(cl-defgeneric xref-elisp-generic-separate-default ()
+  "doc string separate-default generic"
+  ;; default implementation provided separately
+  )
+
+(cl-defmethod xref-elisp-generic-separate-default ()
+  "doc string separate-default default"
+  "separate default")
+
+(cl-defmethod xref-elisp-generic-separate-default ((this xref-elisp-root-type))
+  "doc string separate-default xref-elisp-root-type"
+  "non-default for separate-default")
+
+(cl-defmethod xref-elisp-generic-implicit-generic ()
+  "doc string implicit-generic default"
+  "default for implicit generic")
+
+(cl-defmethod xref-elisp-generic-implicit-generic ((this xref-elisp-root-type))
+  "doc string implicit-generic xref-elisp-root-type"
+  "non-default for implicit generic")
+
+
+(xref-elisp-deftest find-defs-defgeneric-no-methods
+  (elisp--xref-find-definitions 'xref-elisp-generic-no-methods)
+  (list
+   (xref-make "(cl-defgeneric xref-elisp-generic-no-methods)"
+             (xref-make-elisp-location
+              'xref-elisp-generic-no-methods 'cl-defgeneric
+              (expand-file-name "elisp-mode-tests.el" emacs-test-dir)))
+   ))
+
+(xref-elisp-deftest find-defs-defgeneric-no-default
+  (elisp--xref-find-definitions 'xref-elisp-generic-no-default)
+  (list
+   (xref-make "(cl-defgeneric xref-elisp-generic-no-default)"
+             (xref-make-elisp-location
+              'xref-elisp-generic-no-default 'cl-defgeneric
+              (expand-file-name "elisp-mode-tests.el" emacs-test-dir)))
+   (xref-make "(cl-defmethod xref-elisp-generic-no-default ((this 
xref-elisp-root-type)))"
+             (xref-make-elisp-location
+              '(xref-elisp-generic-no-default xref-elisp-root-type) 
'cl-defmethod
+              (expand-file-name "elisp-mode-tests.el" emacs-test-dir)))
+   ))
+
+(xref-elisp-deftest find-defs-defgeneric-co-located-default
+  (elisp--xref-find-definitions 'xref-elisp-generic-co-located-default)
+  (list
+   (xref-make "(cl-defgeneric xref-elisp-generic-co-located-default)"
+             (xref-make-elisp-location
+              'xref-elisp-generic-co-located-default 'cl-defgeneric
+              (expand-file-name "elisp-mode-tests.el" emacs-test-dir)))
+   (xref-make "(cl-defmethod xref-elisp-generic-co-located-default ((this 
xref-elisp-root-type)))"
+             (xref-make-elisp-location
+              '(xref-elisp-generic-co-located-default xref-elisp-root-type) 
'cl-defmethod
+              (expand-file-name "elisp-mode-tests.el" emacs-test-dir)))
+   ))
+
+(xref-elisp-deftest find-defs-defgeneric-separate-default
+  (elisp--xref-find-definitions 'xref-elisp-generic-separate-default)
+  (list
+   (xref-make "(cl-defgeneric xref-elisp-generic-separate-default)"
+             (xref-make-elisp-location
+              'xref-elisp-generic-separate-default 'cl-defgeneric
+              (expand-file-name "elisp-mode-tests.el" emacs-test-dir)))
+   (xref-make "(cl-defmethod xref-elisp-generic-separate-default ())"
+              (xref-make-elisp-location
+               '(xref-elisp-generic-separate-default) 'cl-defmethod
+               (expand-file-name "elisp-mode-tests.el" emacs-test-dir)))
+
+   (xref-make "(cl-defmethod xref-elisp-generic-separate-default ((this 
xref-elisp-root-type)))"
+             (xref-make-elisp-location
+              '(xref-elisp-generic-separate-default xref-elisp-root-type) 
'cl-defmethod
+              (expand-file-name "elisp-mode-tests.el" emacs-test-dir)))
+   ))
+
+(xref-elisp-deftest find-defs-defgeneric-implicit-generic
+  (elisp--xref-find-definitions 'xref-elisp-generic-implicit-generic)
+  (list
+   (xref-make "(cl-defmethod xref-elisp-generic-implicit-generic ())"
+             (xref-make-elisp-location
+              '(xref-elisp-generic-implicit-generic) 'cl-defmethod
+              (expand-file-name "elisp-mode-tests.el" emacs-test-dir)))
+   (xref-make "(cl-defmethod xref-elisp-generic-implicit-generic ((this 
xref-elisp-root-type)))"
+             (xref-make-elisp-location
+              '(xref-elisp-generic-implicit-generic xref-elisp-root-type) 
'cl-defmethod
+              (expand-file-name "elisp-mode-tests.el" emacs-test-dir)))
+   ))
+
+;; Test that we handle more than one method
+
+;; When run from the Makefile, etags is not loaded at compile time,
+;; but it is by the time this test is run.  interactively; don't fail
+;; for that.
+(require 'etags)
+(xref-elisp-deftest find-defs-defgeneric-el
+  (elisp--xref-find-definitions 'xref-location-marker)
+  (list
+   (xref-make "(cl-defgeneric xref-location-marker)"
+             (xref-make-elisp-location
+              'xref-location-marker 'cl-defgeneric
+              (expand-file-name "../../lisp/progmodes/xref.el" 
emacs-test-dir)))
+   (xref-make "(cl-defmethod xref-location-marker ((l xref-elisp-location)))"
+             (xref-make-elisp-location
+              '(xref-location-marker xref-elisp-location) 'cl-defmethod
+              (expand-file-name "../../lisp/progmodes/elisp-mode.el" 
emacs-test-dir)))
+   (xref-make "(cl-defmethod xref-location-marker ((l xref-file-location)))"
+             (xref-make-elisp-location
+              '(xref-location-marker xref-file-location) 'cl-defmethod
+              (expand-file-name "../../lisp/progmodes/xref.el" 
emacs-test-dir)))
+   (xref-make "(cl-defmethod xref-location-marker ((l xref-buffer-location)))"
+             (xref-make-elisp-location
+              '(xref-location-marker xref-buffer-location) 'cl-defmethod
+              (expand-file-name "../../lisp/progmodes/xref.el" 
emacs-test-dir)))
+   (xref-make "(cl-defmethod xref-location-marker ((l xref-bogus-location)))"
+             (xref-make-elisp-location
+              '(xref-location-marker xref-bogus-location) 'cl-defmethod
+              (expand-file-name "../../lisp/progmodes/xref.el" 
emacs-test-dir)))
+   (xref-make "(cl-defmethod xref-location-marker ((l xref-etags-location)))"
+              (xref-make-elisp-location
+               '(xref-location-marker xref-etags-location) 'cl-defmethod
+               (expand-file-name "../../lisp/progmodes/etags.el" 
emacs-test-dir)))
+   ))
+
+(xref-elisp-deftest find-defs-defgeneric-eval
+  (elisp--xref-find-definitions (eval '(cl-defgeneric 
stephe-leake-cl-defgeneric ())))
+  nil)
+
+(xref-elisp-deftest find-defs-defun-el
+  (elisp--xref-find-definitions 'xref-find-definitions)
+  (list
+   (xref-make "(defun xref-find-definitions)"
+             (xref-make-elisp-location
+              'xref-find-definitions nil
+              (expand-file-name "../../lisp/progmodes/xref.el" 
emacs-test-dir)))))
+
+(xref-elisp-deftest find-defs-defun-eval
+  (elisp--xref-find-definitions (eval '(defun stephe-leake-defun ())))
+  nil)
+
+(xref-elisp-deftest find-defs-defun-c
+  (elisp--xref-find-definitions 'buffer-live-p)
+  (list
+   (xref-make "(defun buffer-live-p)"
+             (xref-make-elisp-location 'buffer-live-p nil "src/buffer.c"))))
+
+;; FIXME: deftype
+
+(xref-elisp-deftest find-defs-defun-c-defvar-c
+  (elisp-xref-find 'definitions "system-name")
+  (list
+   (xref-make "(defvar system-name)"
+             (xref-make-elisp-location 'system-name 'defvar "src/editfns.c"))
+   (xref-make "(defun system-name)"
+              (xref-make-elisp-location 'system-name nil "src/editfns.c")))
+  )
+
+(xref-elisp-deftest find-defs-defun-el-defvar-c
+  (elisp-xref-find 'definitions "abbrev-mode")
   ;; It's a minor mode, but the variable is defined in buffer.c
-  (let ((defs (elisp-xref-find 'definitions "abbrev-mode")))
-    (should (= (length defs) 2))))
-
-(ert-deftest elisp-xref-finds-only-function-for-minor-mode ()
-  ;; Both variable and function are defined in the same place.
-  (let ((defs (elisp-xref-find 'definitions "visible-mode")))
-    (should (= (length defs) 1))
-    (should (string= (xref-item-summary (nth 0 defs))
-                     "(defun visible-mode)"))))
+  (list
+   (xref-make "(defvar abbrev-mode)"
+             (xref-make-elisp-location 'abbrev-mode 'defvar "src/buffer.c"))
+   (cons
+    (xref-make "(defun abbrev-mode)"
+               (xref-make-elisp-location
+                'abbrev-mode nil
+                (expand-file-name "../../lisp/abbrev.el" emacs-test-dir)))
+    "(define-minor-mode abbrev-mode"))
+  )
+
+;; Source for both variable and defun is "(define-minor-mode
+;; compilation-minor-mode". There is no way to tell that directly from
+;; the symbol, but we can use (memq sym minor-mode-list) to detect
+;; that the symbol is a minor mode. See `elisp--xref-find-definitions'
+;; for more comments.
+;;
+;; IMPROVEME: return defvar instead of defun if source near starting
+;; point indicates the user is searching for a variable, not a
+;; function.
+(require 'compile) ;; not loaded by default at test time
+(xref-elisp-deftest find-defs-defun-defvar-el
+  (elisp--xref-find-definitions 'compilation-minor-mode)
+  (list
+   (cons
+    (xref-make "(defun compilation-minor-mode)"
+               (xref-make-elisp-location
+                'compilation-minor-mode nil
+                (expand-file-name "../../lisp/progmodes/compile.el" 
emacs-test-dir)))
+    "(define-minor-mode compilation-minor-mode")
+   ))
+
+(xref-elisp-deftest find-defs-defvar-el
+  (elisp--xref-find-definitions 'xref--marker-ring)
+  (list
+   (xref-make "(defvar xref--marker-ring)"
+             (xref-make-elisp-location
+              'xref--marker-ring 'defvar
+              (expand-file-name "../../lisp/progmodes/xref.el" 
emacs-test-dir)))
+    ))
+
+(xref-elisp-deftest find-defs-defvar-c
+  (elisp--xref-find-definitions 'default-directory)
+  (list
+   (cons
+    (xref-make "(defvar default-directory)"
+               (xref-make-elisp-location 'default-directory 'defvar 
"src/buffer.c"))
+    ;; IMPROVEME: we might be able to compute this target
+    "DEFVAR_PER_BUFFER (\"default-directory\"")))
+
+(xref-elisp-deftest find-defs-defvar-eval
+  (elisp--xref-find-definitions (eval '(defvar stephe-leake-defvar nil)))
+  nil)
+
+(xref-elisp-deftest find-defs-face-el
+  (elisp--xref-find-definitions 'font-lock-keyword-face)
+  ;; 'font-lock-keyword-face is both a face and a var
+  (list
+   (xref-make "(defvar font-lock-keyword-face)"
+             (xref-make-elisp-location
+              'font-lock-keyword-face 'defvar
+              (expand-file-name "../../lisp/font-lock.el" emacs-test-dir)))
+   (xref-make "(defface font-lock-keyword-face)"
+             (xref-make-elisp-location
+              'font-lock-keyword-face 'defface
+              (expand-file-name "../../lisp/font-lock.el" emacs-test-dir)))
+   ))
+
+(xref-elisp-deftest find-defs-face-eval
+  (elisp--xref-find-definitions (eval '(defface stephe-leake-defface nil "")))
+  nil)
+
+(xref-elisp-deftest find-defs-feature-el
+  (elisp--xref-find-definitions 'xref)
+  (list
+   (cons
+    (xref-make "(feature xref)"
+             (xref-make-elisp-location
+              'xref 'feature
+              (expand-file-name "../../lisp/progmodes/xref.el" 
emacs-test-dir)))
+    ";;; Code:")
+   ))
+
+(xref-elisp-deftest find-defs-feature-eval
+  (elisp--xref-find-definitions (eval '(provide 'stephe-leake-feature)))
+  nil)
 
 (provide 'elisp-mode-tests)
 ;;; elisp-mode-tests.el ends here
diff --git a/test/automated/ert-tests.el b/test/automated/ert-tests.el
index fcfc7ee..5382c40 100644
--- a/test/automated/ert-tests.el
+++ b/test/automated/ert-tests.el
@@ -345,6 +345,10 @@ This macro is used to test if macroexpansion in `should' 
works."
         (should (equal actual-condition expected-condition)))))))
 
 (ert-deftest ert-test-deftest ()
+  ;; FIXME: These tests don't look very good.  What is their intent, i.e. what
+  ;; are they really testing?  The precise generated code shouldn't matter, so
+  ;; we should either test the behavior of the code, or else try to express the
+  ;; kind of efficiency guarantees we're looking for.
   (should (equal (macroexpand '(ert-deftest abc () "foo" :tags '(bar)))
                 '(progn
                    (ert-set-test 'abc
diff --git a/test/automated/seq-tests.el b/test/automated/seq-tests.el
index 3643ce5..74c0700 100644
--- a/test/automated/seq-tests.el
+++ b/test/automated/seq-tests.el
@@ -187,7 +187,12 @@ Evaluate BODY for each created sequence.
   (should-not   (seq-subseq '(1 2 3) 3))
   (should       (seq-subseq '(1 2 3) -3))
   (should-error (seq-subseq '(1 2 3) 1 4))
-  (should       (seq-subseq '(1 2 3) 1 3)))
+  (should       (seq-subseq '(1 2 3) 1 3))
+  (should-error (seq-subseq '() -1))
+  (should-error (seq-subseq [] -1))
+  (should-error (seq-subseq "" -1))
+  (should-not (seq-subseq '() 0))
+  (should-error(seq-subseq '() 0 -1)))
 
 (ert-deftest test-seq-concatenate ()
   (with-test-sequences (seq '(2 4 6))
diff --git a/test/redisplay-testsuite.el b/test/redisplay-testsuite.el
index 357ab08..332eeb1 100644
--- a/test/redisplay-testsuite.el
+++ b/test/redisplay-testsuite.el
@@ -251,6 +251,45 @@ static unsigned char x_bits[] = {0xff, 0x81, 0xbd, 0xa5, 
0xa5, 0xbd, 0x81, 0xff
          (str "ABC"))
       (put-text-property 1 2 'invisible 'test-redisplay--ellipsis-invis str)
       (overlay-put ov 'display str)))
+  ;; Overlay string over invisible text and non-default face.
+  (insert "\n  Expected: ..." (propertize "ABC" 'face 'highlight) "XYZ")
+  (insert "\n    Result: ")
+  (insert (propertize "foo" 'invisible 'test-redisplay--ellipsis-invis))
+  (let ((ov (make-overlay (point) (point))))
+    (overlay-put ov 'invisible t)
+    (overlay-put ov 'window (selected-window))
+    (overlay-put ov 'after-string
+                 (propertize "ABC" 'face 'highlight)))
+  (insert "XYZ\n")
+  ;; Overlay strings with partial `invisibility' property and with a
+  ;; display property on the before-string.
+  (insert "\n  Expected: ..."
+          (propertize "DEF" 'display '(image :type xpm :file "close.xpm"))
+          (propertize "ABC" 'face 'highlight) "XYZ")
+  (insert "\n    Result: ")
+  (insert (propertize "foo" 'invisible 'test-redisplay--ellipsis-invis))
+  (let ((ov (make-overlay (point) (point))))
+    (overlay-put ov 'invisible t)
+    (overlay-put ov 'window (selected-window))
+    (overlay-put ov 'after-string
+                 (propertize "ABC" 'face 'highlight))
+    (overlay-put ov 'before-string
+                 (propertize "DEF"
+                             'display '(image :type xpm :file "close.xpm"))))
+  (insert "XYZ\n")
+
+  ;; Overlay string with 2 adjacent and different invisible
+  ;; properties.  This caused an infloop before Emacs 25.
+  (insert "\n  Expected: ABC")
+  (insert "\n    Result: ")
+  (let ((opoint (point)))
+    (insert "ABC\n")
+    (let ((ov (make-overlay (1+ opoint) (+ 2 opoint)))
+          (str (concat (propertize "X"
+                                   'invisible 'test-redisplay--simple-invis)
+                       (propertize "Y"
+                                   'invisible 
'test-redisplay--simple-invis2))))
+      (overlay-put ov 'after-string str)))
 
   (insert "\n"))
 
@@ -264,6 +303,7 @@ static unsigned char x_bits[] = {0xff, 0x81, 0xbd, 0xa5, 
0xa5, 0xbd, 0x81, 0xff
     (erase-buffer)
     (setq buffer-invisibility-spec
          '(test-redisplay--simple-invis
+            test-redisplay--simple-invis2
            (test-redisplay--ellipsis-invis . t)))
     (test-redisplay-1)
     (test-redisplay-2)



reply via email to

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