emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master f3be002 3/3: resolve ChangeLog merge conflict


From: Stephen Leake
Subject: [Emacs-diffs] master f3be002 3/3: resolve ChangeLog merge conflict
Date: Wed, 24 Dec 2014 13:46:44 +0000

branch: master
commit f3be0025481f15717198befe557208614e513e92
Merge: b4161ac 882370e
Author: Stephen Leake <address@hidden>
Commit: Stephen Leake <address@hidden>

    resolve ChangeLog merge conflict
---
 ChangeLog                      |    8 +
 doc/lispref/ChangeLog          |    5 +
 doc/lispref/internals.texi     |    3 +-
 lib/stdalign.in.h              |    5 +-
 lib/utimens.c                  |    2 -
 lisp/ChangeLog                 |   78 ++++++
 lisp/cedet/ChangeLog           |   88 ++++---
 lisp/cedet/ede/generic.el      |    2 +-
 lisp/cedet/semantic/db-el.el   |    4 +-
 lisp/cedet/semantic/db.el      |    4 +-
 lisp/cedet/srecode/srt-mode.el |    4 +-
 lisp/completion.el             |  228 +++++++----------
 lisp/eshell/esh-ext.el         |    5 +
 lisp/let-alist.el              |   71 ++++--
 lisp/net/nsm.el                |    1 -
 lisp/net/tramp-sh.el           |   11 +-
 lisp/progmodes/cc-engine.el    |   58 ++++-
 lisp/progmodes/cc-fonts.el     |   62 +++---
 lisp/progmodes/cc-langs.el     |    2 +-
 lisp/progmodes/js.el           |   27 ++-
 lisp/progmodes/ruby-mode.el    |   17 +-
 lisp/shell.el                  |    9 +-
 lisp/textmodes/ispell.el       |    6 +-
 m4/stdalign.m4                 |    8 +-
 src/ChangeLog                  |   78 ++++++
 src/buffer.c                   |    5 -
 src/charset.c                  |    7 +-
 src/charset.h                  |    3 +-
 src/composite.h                |    2 +-
 src/conf_post.h                |    4 +-
 src/fontset.c                  |    7 +-
 src/frame.h                    |    4 +-
 src/nsselect.m                 |    3 +-
 src/nsterm.m                   |    8 +-
 src/termhooks.h                |    8 +-
 src/unexaix.c                  |   27 +--
 src/unexcoff.c                 |   27 +--
 src/unexelf.c                  |   12 +-
 src/unexmacosx.c               |    2 +-
 src/w32term.c                  |   11 +-
 src/w32term.h                  |    4 +-
 src/xterm.c                    |  532 +++++++++++++++++++++-------------------
 src/xterm.h                    |    4 +-
 test/ChangeLog                 |    1 +
 test/automated/let-alist.el    |   28 ++-
 test/indent/js.js              |    5 +
 46 files changed, 869 insertions(+), 621 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a380abd..d62ccf1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,14 @@
 
        * CONTRIBUTE: add Savannah url, cleanup announcing freeze.
 
+2014-12-23  Paul Eggert  <address@hidden>
+
+       Merge from gnulib
+       2014-12-20 utimens: remove unnecessary assert
+       2014-12-16 stdalign: port better to HP compilers
+       2014-12-16 stdalign: work around Apple GCC 4.0 bug
+       * lib/stdalign.in.h, lib/utimens.c, m4/stdalign.m4: Update from gnulib.
+
 2014-12-19  Stephen Leake  <address@hidden>
 
        Move user-level information from CONTRIBUTE to doc/emacs/trouble.texi
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 5b37506..3621c56 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-22  Paul Eggert  <address@hidden>
+
+       Remove obsolete references to pre-C99 builds
+       * internals.texi (C Integer Types): Don't mention pre-C99 compilers.
+
 2014-12-19  Martin Rudalics  <address@hidden>
 
        * windows.texi (Resizing Windows): Describe new argument of
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index db6ed41..092ec00 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -1684,8 +1684,7 @@ using @code{int}.  Although it is also OK to use 
@code{int}, @code{0}
 and @code{1}, this older style is gradually being phased out.  When
 using @code{bool}, respect the limitations of the replacement
 implementation of @code{bool}, as documented in the source file
address@hidden/stdbool.in.h}, so that Emacs remains portable to pre-C99
-platforms.  In particular, boolean bitfields should be of type
address@hidden/stdbool.in.h}.  In particular, boolean bitfields should be of 
type
 @code{bool_bf}, not @code{bool}, so that they work correctly even when
 compiling Objective C with standard GCC.
 
diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h
index dcaab55..413936d 100644
--- a/lib/stdalign.in.h
+++ b/lib/stdalign.in.h
@@ -95,7 +95,10 @@
 #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
 # if defined __cplusplus && 201103 <= __cplusplus
 #  define _Alignas(a) alignas (a)
-# elif (__GNUC__ || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__ \
+# elif ((defined __APPLE__ && defined __MACH__                  \
+         ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__)                 \
+         : __GNUC__)                                            \
+        || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__        \
         || __ICC || 0x5110 <= __SUNPRO_C)
 #  define _Alignas(a) __attribute__ ((__aligned__ (a)))
 # elif 1300 <= _MSC_VER
diff --git a/lib/utimens.c b/lib/utimens.c
index dd3ec66..0444103 100644
--- a/lib/utimens.c
+++ b/lib/utimens.c
@@ -24,7 +24,6 @@
 #define _GL_UTIMENS_INLINE _GL_EXTERN_INLINE
 #include "utimens.h"
 
-#include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <stdbool.h>
@@ -87,7 +86,6 @@ validate_timespec (struct timespec timespec[2])
 {
   int result = 0;
   int utime_omit_count = 0;
-  assert (timespec);
   if ((timespec[0].tv_nsec != UTIME_NOW
        && timespec[0].tv_nsec != UTIME_OMIT
        && ! (0 <= timespec[0].tv_nsec
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b50d584..0882a51 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,81 @@
+2014-12-24  Michael Albinus  <address@hidden>
+
+       * eshell/esh-ext.el (eshell-find-interpreter): Expand relative
+       remote file names.  (Bug#18782)
+
+2014-12-23  Sam Steingold  <address@hidden>
+
+       * shell.el (shell-display-buffer-actions): New user option.
+       (shell): Pass it to `pop-to-buffer' instead of hard-coding
+       `pop-to-buffer-same-window'.
+
+2014-12-23  Stefan Monnier  <address@hidden>
+
+       * progmodes/js.el (js--syntax-propertize-regexp-syntax-table): New var.
+       (js-syntax-propertize-regexp): Use it to recognize "slash in
+       a character class" (bug#19397).
+
+2014-12-22  Stefan Monnier  <address@hidden>
+
+       * completion.el: Use post-self-insert-hook (bug#19400).
+       (completion-separator-self-insert-command)
+       (completion-separator-self-insert-autofilling): Remove.
+       (completion-separator-chars): New var.
+       (completion-c-mode-hook, completion-setup-fortran-mode): Use it instead
+       of changing the keymap.
+       (completion--post-self-insert): New function.
+       (dynamic-completion-mode): Use it instead of rebinding keys.
+       (cmpl--completion-string): Rename from completion-string.
+       (add-completion-to-head, delete-completion): Let-bind it explicitly.
+
+2014-12-22  Bozhidar Batsov  <address@hidden>
+
+       * progmodes/ruby-mode.el (ruby--string-region): Simplify code
+       by leveraging `syntax-ppss'.
+
+2014-12-22  Artur Malabarba  <address@hidden>
+
+       * let-alist.el (let-alist): Use `make-symbol' instead of `gensym'.
+
+2014-12-20  Michael Albinus  <address@hidden>
+
+       * net/tramp-sh.el (tramp-histfile-override): Add :version.
+
+2014-12-20  Teodor Zlatanov  <address@hidden>
+
+       * net/tramp-sh.el (tramp-histfile-override): Clarify docstring.
+
+2014-12-19  Artur Malabarba  <address@hidden>
+
+       * let-alist.el (let-alist): Enable access to deeper alists by
+       using dots inside the dotted symbols.
+
+2014-12-19  Alan Mackenzie  <address@hidden>
+
+       Make C++11 uniform init syntax work.  New keywords "final" and 
"override"
+
+       * progmodes/cc-engine.el (c-back-over-member-initializer-braces):
+       New function.
+       (c-guess-basic-syntax): Set `containing-sex' and `lim' using the
+       new function.
+
+       * progmodes/cc-fonts.el (c-font-lock-declarations): Check more
+       carefully for "are we at a declarator?" using
+       c-back-over-member-initializers.
+
+       * progmodes/cc-langs.el (c-type-modifier-kwds): include "final"
+       and "override" in the C++ value.
+
+2014-12-19  Martin Rudalics  <address@hidden>
+
+       * textmodes/ispell.el (ispell-command-loop): Don't use
+       `next-window'.
+
+2014-12-21  Lars Ingebrigtsen  <address@hidden>
+
+       * net/nsm.el (nsm-save-host): Don't save the host name twice
+       (bug#19269).
+
 2014-12-18  Sam Steingold  <address@hidden>
 
        Keyboard interface (C-f10) to `mouse-buffer-menu' (C-down-mouse-1).
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index 46296d3..a43e94c 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,9 +1,21 @@
+2014-12-22  Stefan Monnier  <address@hidden>
+
+       * srecode/srt-mode.el (srecode-macro-help): Use eieio-class-children.
+
+       * semantic/db.el (semanticdb-cache-get): Prefer eieio-object-class over
+       eieio--object-class.
+
+       * semantic/db-el.el (semanticdb-elisp-sym->tag): Prefer find-class over
+       class-v.
+
+       * ede/generic.el (ede-find-target): Prefer \` and \' to ^ and $.
+
 2014-12-14  Dmitry Gutov  <address@hidden>
 
        * semantic.el (semantic-analyze-completion-at-point-function)
        (semantic-analyze-notc-completion-at-point-function)
-       (semantic-analyze-nolongprefix-completion-at-point-function): Do
-       nothing if the current buffer is not using Semantic (bug#19077).
+       (semantic-analyze-nolongprefix-completion-at-point-function):
+       Do nothing if the current buffer is not using Semantic (bug#19077).
 
 2014-12-08  Matt Curtis  <address@hidden>  (tiny change)
 
@@ -14,11 +26,11 @@
 
        * semantic.el (semantic-mode): Add/remove 3
        completion-at-point-functions.
-       (semantic-completion-at-point-function): Removed.
+       (semantic-completion-at-point-function): Remove.
        (semantic-analyze-completion-at-point-function)
        (semantic-analyze-notc-completion-at-point-function)
-       (semantic-analyze-nolongprefix-completion-at-point-function): New
-       completion at point functions.
+       (semantic-analyze-nolongprefix-completion-at-point-function):
+       New completion at point functions.
 
        * semantic/doc.el (semantic-doc-snarf-comment-for-tag): Fix case
        when comment-end is empty string.
@@ -62,18 +74,18 @@
        assignee now must be of class variable.
 
        * semantic/analyze/complete.el
-       (semantic-analyze-possible-completions-default): Add
-       'no-longprefix' flag.  When used, the prefix and prefixtypes are
+       (semantic-analyze-possible-completions-default):
+       Add 'no-longprefix' flag.  When used, the prefix and prefixtypes are
        shortened to just the last symbol.
 
        * semantic/bovine/c.el (semantic-c-do-lex-if): Catch errors from
        'hideif', and push to the parser warning stack.
        (semantic-lex-cpp-define): When a comment is at the end of a
-       macro, do not subtract an extra 1 from the found position.  Fixes
-       bug with: #define foo (a)/**/ adding an extra ')' to the stream.
+       macro, do not subtract an extra 1 from the found position.
+       Fixes bug with: #define foo (a)/**/ adding an extra ')' to the stream.
 
-       * semantic/bovine/scm.el (semantic-lex-scheme-symbol): Allow
-       symbols to be one char long.
+       * semantic/bovine/scm.el (semantic-lex-scheme-symbol):
+       Allow symbols to be one char long.
 
        * semantic/bovine/grammar.el
        (bovine-grammar-calculate-source-on-path): New.
@@ -89,8 +101,8 @@
        (ede-check-project-query-fcn): New variable
        (ede-check-project-directory): Use above when querying the user.
        Added to support unit testing of this security measure.
-       (ede-initialize-state-current-buffer): Use
-       `ede-directory-project-cons' instead of the -detect- fcn to take
+       (ede-initialize-state-current-buffer):
+       Use `ede-directory-project-cons' instead of the -detect- fcn to take
        advantage of the cache.  Pass found project into
        `ede-load-project-file'.
        (ede-load-project-file): Add new input DETECTIN.
@@ -103,18 +115,18 @@
        (ede-global-list-sanity-check): New Testing fcn.
        (ede-parent-project): Replace old code with call to faster
        `ede-find-subproject-for-directory'.
-       (ede-load-project-file): Use
-       `ede-directory-get-toplevel-open-project' instead of above
-       deleted.  Rename "pfc" to "autoloader".  Use
-       `ede-directory-project-cons' to detect a project.  Delete no
+       (ede-load-project-file):
+       Use `ede-directory-get-toplevel-open-project' instead of above
+       deleted.  Rename "pfc" to "autoloader".
+       Use `ede-directory-project-cons' to detect a project.  Delete no
        project found case where we search up the tree.
 
-       * ede/auto.el (ede-project-autoload): Fix doc typo.  Add
-       `:root-only' slot.
+       * ede/auto.el (ede-project-autoload): Fix doc typo.
+       Add `:root-only' slot.
        (ede-auto-load-project): Doc update: warn to not use.
-       (ede-dir-to-projectfile): Deleted.
-       (ede-project-autoload-dirmatch): Add subdir-only slot.  Make
-       configdatastash unbound by default.
+       (ede-dir-to-projectfile): Delete.
+       (ede-project-autoload-dirmatch): Add subdir-only slot.
+       Make configdatastash unbound by default.
        (ede-do-dirmatch): If subdir-only is true, then don't allow exact
        matches.  Account for configdatastash as unbound.  Assume value of
        nil means no tool installed.  Make sure loaded path matches from
@@ -122,7 +134,7 @@
        (ede-project-class-files): Note that makefile and automake are not
        root only.
        (ede-auto-detect-in-dir): New (for use with `ede/detect.el').
-       (ede-project-dirmatch-p): Deleted.
+       (ede-project-dirmatch-p): Delete.
        (ede-project-root-directory): Remove body, return nil.
        (ede-project-autoload): :proj-root-dirmatch can be null & doc fix.
        (ede-auto-detect-in-dir): If there is no :proj-file, check for a
@@ -140,8 +152,8 @@
        (ede-generic-config): Remove slots: c-include-path,
        c-preprocessor-table, c-preprocessor-files, classpath,
        build-command, debug-command, run command.  Inherit from
-       ede-extra-config-build, ede-extra-config-program.  Make
-       run-command :value match :custom so only strings are accepted.
+       ede-extra-config-build, ede-extra-config-program.
+       Make run-command :value match :custom so only strings are accepted.
        Add some more :group slot specifiers.
        (ede-generic-project): Add mixins `ede-project-with-config-c' and
        `ede-project-with-config-java'. Inherit from
@@ -153,15 +165,15 @@
        (ede-generic-target-c-cpp): Add mixin `ede-target-with-config-c'.
        (ede-generic-target-java): Add mixin `ede-target-with-config-java'.
        (ede-preprocessor-map, ede-system-include-path)
-       (edejava-classpath): Deleted, moved to config.el.
+       (edejava-classpath): Delete, moved to config.el.
        (project-compile-project, project-compile-target)
-       (project-debug-target, project-run-target): Deleted.
+       (project-debug-target, project-run-target): Delete.
        (ede-generic-get-configuration, ede-generic-setup-configuration)
        (ede-commit-project, project-rescan)
        (ede-generic-project::ede-customize)
        (ede-generic-target::ede-customize)
        (ede-generic-config::eieio-done-customizing)
-       (ede-generic-config::ede-commit): Deleted.  Subsumed by new
+       (ede-generic-config::ede-commit): Delete.  Subsumed by new
        baseclass.
        (ede-preprocessor-map, ede-system-include-path)
        (project-debug-target, project-run-target): Call new
@@ -170,7 +182,7 @@
 
        * ede/files.el (ede-find-project-root)
        (ede-files-find-existing)
-       (ede-directory-get-toplevel-open-project-new): Deleted.
+       (ede-directory-get-toplevel-open-project-new): Delete.
        (ede-project-root-directory): Use `ede-project-root' first.
        (ede-project-directory-remove-hash)
        (ede--directory-project-from-hash)
@@ -186,20 +198,20 @@
        projects.  When doing directory name matching, save the 'short'
        version of an answer (non-exact match) and eventually select the
        shortest answer at the end.  Expand the filename of tested
-       projects.  Better support for when inodes are disabled.  Add
-       'exact' option so that it will return a project that is an exact
+       projects.  Better support for when inodes are disabled.
+       Add 'exact' option so that it will return a project that is an exact
        match.
        (ede-find-subproject-for-directory): Small optimization to run
        `file-truename' less often.
        (ede-directory-project-p): Move content, then use
-       `ede-directory-project-cons'.  Use
-       `ede-detect-directory-for-project', replacing old detection loop.
+       `ede-directory-project-cons'.
+       Use `ede-detect-directory-for-project', replacing old detection loop.
        (ede-directory-project-cons): New, from above.
-       (ede-toplevel-project): Toss old scanning code.  Use
-       `ede-detect-directory-for-project' instead.
+       (ede-toplevel-project): Toss old scanning code.
+       Use `ede-detect-directory-for-project' instead.
        (ede-directory-get-toplevel-open-project-new): New.
 
-       * ede/linux.el (ede-linux-project-root): Deleted.
+       * ede/linux.el (ede-linux-project-root): Delete.
        (ede-project-autoload): Remove dirmatch entry - it is no longer
        needed.
 
@@ -220,7 +232,7 @@
        * ede/linux.el (ede-linux-load): Do not add to global list here.
        Don't check for existing anymore.
        (project-rescan): New.
-       (ede-linux-project-list, ede-linux-file-existing): Deleted.
+       (ede-linux-project-list, ede-linux-file-existing): Delete.
        (ede-linux-project-root): Delete body.  Need symbol for autoloads
        for now.
        (ede-linux-project): No longer instance tracker.
@@ -242,7 +254,7 @@
          (ede-cpp-root-file-existing)
        (ede-cpp-root-project-file-for-dir)
        (ede-cpp-root-count, ede-cpp-root-project-root, ede-cpp-root-load)
-       (ede-project-autoload cpp-root): Deleted.
+       (ede-project-autoload cpp-root): Delete.
        (ede-project-root-directory): Return :directory instead of
        calculating from :file.
        (project-rescan): New.
diff --git a/lisp/cedet/ede/generic.el b/lisp/cedet/ede/generic.el
index f0314cb..6d45353 100644
--- a/lisp/cedet/ede/generic.el
+++ b/lisp/cedet/ede/generic.el
@@ -232,7 +232,7 @@ If one doesn't exist, create a new one for this directory."
        (let* ((classsym (intern (car C)))
               (extreg (oref classsym extension)))
          (when (and (not (string= extreg ""))
-                    (string-match (concat "^" extreg "$") ext))
+                    (string-match (concat "\\`\\(?:" extreg "\\)\\'") ext))
            (setq cls classsym)))))
     (when (not cls) (setq cls 'ede-generic-target-misc))
     ;; find a pre-existing matching target
diff --git a/lisp/cedet/semantic/db-el.el b/lisp/cedet/semantic/db-el.el
index 7ff1538..f37aa07 100644
--- a/lisp/cedet/semantic/db-el.el
+++ b/lisp/cedet/semantic/db-el.el
@@ -223,7 +223,9 @@ TOKTYPE is a hint to the type of tag desired."
            (symbol-name sym)
            "class"
            (semantic-elisp-desymbolify
-            (eieio--class-public-a (class-v semanticdb-project-database))) ;; 
slots
+             ;; FIXME: This only gives the instance slots and ignores the
+             ;; class-allocated slots.
+            (eieio--class-public-a (find-class semanticdb-project-database))) 
;; slots ;FIXME: eieio--
            (semantic-elisp-desymbolify (eieio-class-parents sym)) ;; parents
            ))
          ((not toktype)
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el
index 13e2d1b..0732f22 100644
--- a/lisp/cedet/semantic/db.el
+++ b/lisp/cedet/semantic/db.el
@@ -481,7 +481,7 @@ other than :table."
   (let ((cache (oref table cache))
        (obj nil))
     (while (and (not obj) cache)
-      (if (eq (eieio--object-class (car cache)) desired-class)
+      (if (eq (eieio-object-class (car cache)) desired-class)
          (setq obj (car cache)))
       (setq cache (cdr cache)))
     (if obj
@@ -532,7 +532,7 @@ other than :table."
   (let ((cache (oref db cache))
        (obj nil))
     (while (and (not obj) cache)
-      (if (eq (eieio--object-class (car cache)) desired-class)
+      (if (eq (eieio-object-class (car cache)) desired-class)
          (setq obj (car cache)))
       (setq cache (cdr cache)))
     (if obj
diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el
index 48a4865..dfc1df8 100644
--- a/lisp/cedet/srecode/srt-mode.el
+++ b/lisp/cedet/srecode/srt-mode.el
@@ -233,7 +233,7 @@ we can tell font lock about them.")
   "Provide help for working with macros in a template."
   (interactive)
   (let* ((root 'srecode-template-inserter)
-        (chl (eieio--class-children (class-v root)))
+        (chl (eieio-class-children root))
         (ess (srecode-template-get-escape-start))
         (ees (srecode-template-get-escape-end))
         )
@@ -249,7 +249,7 @@ we can tell font lock about them.")
               (showexample t)
               )
          (setq chl (cdr chl))
-         (setq chl (append (eieio--class-children (class-v C)) chl))
+         (setq chl (append (eieio-class-children C) chl))
 
          (catch 'skip
            (when (eq C 'srecode-template-inserter-section-end)
diff --git a/lisp/completion.el b/lisp/completion.el
index d2d94e7..c2a2005 100644
--- a/lisp/completion.el
+++ b/lisp/completion.el
@@ -373,7 +373,7 @@ Used to decide whether to save completions.")
 
 (defvar cmpl-preceding-syntax)
 
-(defvar completion-string)
+(defvar cmpl--completion-string)
 
 ;;---------------------------------------------------------------------------
 ;; Low level tools
@@ -1082,7 +1082,7 @@ Must be called after `find-exact-completion'."
             (cmpl-db-debug-p
              ;; not found, error if debug mode
              (error "Completion entry exists but not on prefix list - %s"
-                    completion-string))
+                    cmpl--completion-string))
             (inside-locate-completion-entry
              ;; recursive error: really scrod
              (locate-completion-db-error))
@@ -1149,73 +1149,75 @@ COMPLETION-STRING must be longer than 
`completion-prefix-min-length'.
 Updates the saved string with the supplied string.
 This must be very fast.
 Returns the completion entry."
-  ;; Handle pending acceptance
-  (if completion-to-accept (accept-completion))
-  ;; test if already in database
-  (if (setq cmpl-db-entry (find-exact-completion completion-string))
-      ;; found
-      (let* ((prefix-entry (find-cmpl-prefix-entry
-                            (substring cmpl-db-downcase-string 0
-                                       completion-prefix-min-length)))
-            (splice-ptr (locate-completion-entry cmpl-db-entry prefix-entry))
-            (cmpl-ptr (cdr splice-ptr)))
-       ;; update entry
-       (set-completion-string cmpl-db-entry completion-string)
-       ;; move to head (if necessary)
-       (cond (splice-ptr
-              ;; These should all execute atomically but it is not fatal if
-              ;; they don't.
-              ;; splice it out
-              (or (setcdr splice-ptr (cdr cmpl-ptr))
-                  ;; fix up tail if necessary
-                  (set-cmpl-prefix-entry-tail prefix-entry splice-ptr))
-              ;; splice in at head
-              (setcdr cmpl-ptr (cmpl-prefix-entry-head prefix-entry))
-              (set-cmpl-prefix-entry-head prefix-entry cmpl-ptr)))
-       cmpl-db-entry)
-    ;; not there
-    (let (;; create an entry
-         (entry (list (make-completion completion-string)))
-         ;; setup the prefix
-         (prefix-entry (find-cmpl-prefix-entry
-                         (substring cmpl-db-downcase-string 0
-                                    completion-prefix-min-length))))
-      (cond (prefix-entry
-            ;; Splice in at head
-            (setcdr entry (cmpl-prefix-entry-head prefix-entry))
-            (set-cmpl-prefix-entry-head prefix-entry entry))
-           (t
-            ;; Start new prefix entry
-            (set cmpl-db-prefix-symbol (make-cmpl-prefix-entry entry))))
-      ;; Add it to the symbol
-      (set cmpl-db-symbol (car entry)))))
+  (let ((cmpl--completion-string completion-string))
+    ;; Handle pending acceptance
+    (if completion-to-accept (accept-completion))
+    ;; test if already in database
+    (if (setq cmpl-db-entry (find-exact-completion completion-string))
+        ;; found
+        (let* ((prefix-entry (find-cmpl-prefix-entry
+                              (substring cmpl-db-downcase-string 0
+                                         completion-prefix-min-length)))
+               (splice-ptr (locate-completion-entry cmpl-db-entry 
prefix-entry))
+               (cmpl-ptr (cdr splice-ptr)))
+          ;; update entry
+          (set-completion-string cmpl-db-entry completion-string)
+          ;; move to head (if necessary)
+          (cond (splice-ptr
+                 ;; These should all execute atomically but it is not fatal if
+                 ;; they don't.
+                 ;; splice it out
+                 (or (setcdr splice-ptr (cdr cmpl-ptr))
+                     ;; fix up tail if necessary
+                     (set-cmpl-prefix-entry-tail prefix-entry splice-ptr))
+                 ;; splice in at head
+                 (setcdr cmpl-ptr (cmpl-prefix-entry-head prefix-entry))
+                 (set-cmpl-prefix-entry-head prefix-entry cmpl-ptr)))
+          cmpl-db-entry)
+      ;; not there
+      (let ( ;; create an entry
+            (entry (list (make-completion completion-string)))
+            ;; setup the prefix
+            (prefix-entry (find-cmpl-prefix-entry
+                           (substring cmpl-db-downcase-string 0
+                                      completion-prefix-min-length))))
+        (cond (prefix-entry
+               ;; Splice in at head
+               (setcdr entry (cmpl-prefix-entry-head prefix-entry))
+               (set-cmpl-prefix-entry-head prefix-entry entry))
+              (t
+               ;; Start new prefix entry
+               (set cmpl-db-prefix-symbol (make-cmpl-prefix-entry entry))))
+        ;; Add it to the symbol
+        (set cmpl-db-symbol (car entry))))))
 
 (defun delete-completion (completion-string)
   "Delete the completion from the database.
 String must be longer than `completion-prefix-min-length'."
   ;; Handle pending acceptance
-  (if completion-to-accept (accept-completion))
-  (if (setq cmpl-db-entry (find-exact-completion completion-string))
-      ;; found
-      (let* ((prefix-entry (find-cmpl-prefix-entry
-                            (substring cmpl-db-downcase-string 0
-                                       completion-prefix-min-length)))
-            (splice-ptr (locate-completion-entry cmpl-db-entry prefix-entry)))
-        ;; delete symbol reference
-        (set cmpl-db-symbol nil)
-        ;; remove from prefix list
-        (cond (splice-ptr
-               ;; not at head
-               (or (setcdr splice-ptr (cdr (cdr splice-ptr)))
-                   ;; fix up tail if necessary
-                   (set-cmpl-prefix-entry-tail prefix-entry splice-ptr)))
-              (t
-               ;; at head
-               (or (set-cmpl-prefix-entry-head
+  (let ((cmpl--completion-string completion-string))
+    (if completion-to-accept (accept-completion))
+    (if (setq cmpl-db-entry (find-exact-completion completion-string))
+        ;; found
+        (let* ((prefix-entry (find-cmpl-prefix-entry
+                              (substring cmpl-db-downcase-string 0
+                                         completion-prefix-min-length)))
+               (splice-ptr (locate-completion-entry cmpl-db-entry 
prefix-entry)))
+          ;; delete symbol reference
+          (set cmpl-db-symbol nil)
+          ;; remove from prefix list
+          (cond (splice-ptr
+                 ;; not at head
+                 (or (setcdr splice-ptr (cdr (cdr splice-ptr)))
+                     ;; fix up tail if necessary
+                     (set-cmpl-prefix-entry-tail prefix-entry splice-ptr)))
+                (t
+                 ;; at head
+                 (or (set-cmpl-prefix-entry-head
                      prefix-entry (cdr (cmpl-prefix-entry-head prefix-entry)))
-                   ;; List is now empty
-                   (set cmpl-db-prefix-symbol nil)))))
-      (error "Unknown completion `%s'" completion-string)))
+                     ;; List is now empty
+                     (set cmpl-db-prefix-symbol nil)))))
+      (error "Unknown completion `%s'" completion-string))))
 
 ;; Tests --
 ;;  - Add and Find -
@@ -1311,7 +1313,7 @@ are specified."
   (delete-completion string))
 
 (defun accept-completion ()
-  "Accepts the pending completion in `completion-to-accept'.
+  "Accept the pending completion in `completion-to-accept'.
 This bumps num-uses.  Called by `add-completion-to-head' and
 `completion-search-reset'."
   (let ((string completion-to-accept)
@@ -2156,26 +2158,27 @@ Patched to remove the most recent completion."
 ;; to work)
 
 ;; All common separators (eg. space "(" ")" """) characters go through a
-;; function to add new words to the list of words to complete from:
-;;  COMPLETION-SEPARATOR-SELF-INSERT-COMMAND (arg).
+;; function to add new words to the list of words to complete from.
 ;; If the character before this was an alpha-numeric then this adds the
 ;; symbol before point to the completion list (using ADD-COMPLETION).
 
-(defun completion-separator-self-insert-command (arg)
-  (interactive "p")
-  (if (command-remapping 'self-insert-command)
-      (funcall (command-remapping 'self-insert-command) arg)
-    (use-completion-before-separator)
-    (self-insert-command arg)))
-
-(defun completion-separator-self-insert-autofilling (arg)
-  (interactive "p")
-  (if (command-remapping 'self-insert-command)
-      (funcall (command-remapping 'self-insert-command) arg)
-    (use-completion-before-separator)
-    (self-insert-command arg)
-    (and auto-fill-function
-        (funcall auto-fill-function))))
+(defvar completion-separator-chars
+  (append " !%^&()=`|{}[];\\'#,?"
+          ;; We include period and colon even though they are symbol
+          ;; chars because :
+          ;;  - in text we want to pick up the last word in a sentence.
+          ;;  - in C pointer refs. we want to pick up the first symbol
+          ;;  - it won't make a difference for lisp mode (package names
+          ;;    are short)
+          ".:" nil))
+
+(defun completion--post-self-insert ()
+  (when (memq last-command-event completion-separator-chars)
+    (let ((after-pos (electric--after-char-pos)))
+      (when after-pos
+        (save-excursion
+          (goto-char (1- after-pos))
+          (use-completion-before-separator))))))
 
 ;;-----------------------------------------------
 ;; Wrapping Macro
@@ -2244,9 +2247,8 @@ TYPE is the type of the wrapper to be added.  Can be 
:before or :under."
 (completion-def-wrapper 'electric-c-semi :separator)
 (defun completion-c-mode-hook ()
   (setq completion-syntax-table completion-c-syntax-table)
-  (local-set-key "+" 'completion-separator-self-insert-command)
-  (local-set-key "*" 'completion-separator-self-insert-command)
-  (local-set-key "/" 'completion-separator-self-insert-command))
+  (setq-local completion-separator-chars
+              (append "+*/" completion-separator-chars)))
 
 ;; FORTRAN mode diffs. (these are defined when fortran is called)
 
@@ -2259,10 +2261,8 @@ TYPE is the type of the wrapper to be added.  Can be 
:before or :under."
 
 (defun completion-setup-fortran-mode ()
   (setq completion-syntax-table completion-fortran-syntax-table)
-  (local-set-key "+" 'completion-separator-self-insert-command)
-  (local-set-key "-" 'completion-separator-self-insert-command)
-  (local-set-key "*" 'completion-separator-self-insert-command)
-  (local-set-key "/" 'completion-separator-self-insert-command))
+  (setq-local completion-separator-chars
+              (append "+-*/" completion-separator-chars)))
 
 ;; Enable completion mode.
 
@@ -2281,15 +2281,16 @@ if ARG is omitted or nil."
   ;; This is always good, not specific to dynamic-completion-mode.
   (define-key function-key-map [C-return] [?\C-\r])
 
-  (dolist (x '((find-file-hook         . completion-find-file-hook)
-               (pre-command-hook       . completion-before-command)
+  (dolist (x `((find-file-hook         . ,#'completion-find-file-hook)
+               (pre-command-hook       . ,#'completion-before-command)
                ;; Save completions when killing Emacs.
-               (kill-emacs-hook                . kill-emacs-save-completions)
+               (kill-emacs-hook                . 
,#'kill-emacs-save-completions)
+               (post-self-insert-hook  . ,#'completion--post-self-insert)
 
                ;; Install the appropriate mode tables.
-               (lisp-mode-hook         . completion-lisp-mode-hook)
-               (c-mode-hook            . completion-c-mode-hook)
-               (fortran-mode-hook      . completion-setup-fortran-mode)))
+               (lisp-mode-hook         . ,#'completion-lisp-mode-hook)
+               (c-mode-hook            . ,#'completion-c-mode-hook)
+               (fortran-mode-hook      . ,#'completion-setup-fortran-mode)))
     (if dynamic-completion-mode
         (add-hook (car x) (cdr x))
       (remove-hook (car x) (cdr x))))
@@ -2315,44 +2316,7 @@ if ARG is omitted or nil."
                ;; cumb
 
                ;; Patches to standard keymaps insert completions
-               ([remap kill-region] . completion-kill-region)
-
-               ;; Separators
-               ;; We've used the completion syntax table given  as a guide.
-               ;;
-               ;; Global separator chars.
-               ;;  We left out <tab> because there are too many special
-               ;; cases for it.  Also, in normal coding it's rarely typed
-               ;; after a word.
-               (" " . completion-separator-self-insert-autofilling)
-               ("!" . completion-separator-self-insert-command)
-               ("%" . completion-separator-self-insert-command)
-               ("^" . completion-separator-self-insert-command)
-               ("&" . completion-separator-self-insert-command)
-               ("(" . completion-separator-self-insert-command)
-               (")" . completion-separator-self-insert-command)
-               ("=" . completion-separator-self-insert-command)
-               ("`" . completion-separator-self-insert-command)
-               ("|" . completion-separator-self-insert-command)
-               ("{" . completion-separator-self-insert-command)
-               ("}" . completion-separator-self-insert-command)
-               ("[" . completion-separator-self-insert-command)
-               ("]" . completion-separator-self-insert-command)
-               (";" . completion-separator-self-insert-command)
-               ("\"".  completion-separator-self-insert-command)
-               ("'" . completion-separator-self-insert-command)
-               ("#" . completion-separator-self-insert-command)
-               ("," . completion-separator-self-insert-command)
-               ("?" . completion-separator-self-insert-command)
-
-               ;; We include period and colon even though they are symbol
-               ;; chars because :
-               ;;  - in text we want to pick up the last word in a sentence.
-               ;;  - in C pointer refs. we want to pick up the first symbol
-               ;;  - it won't make a difference for lisp mode (package names
-               ;;    are short)
-               ("." . completion-separator-self-insert-command)
-               (":" . completion-separator-self-insert-command)))
+               ([remap kill-region] . completion-kill-region)))
       (push (cons (car binding) (lookup-key global-map (car binding)))
             completion-saved-bindings)
       (global-set-key (car binding) (cdr binding)))
diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el
index 2654bf2..d7fea47 100644
--- a/lisp/eshell/esh-ext.el
+++ b/lisp/eshell/esh-ext.el
@@ -296,6 +296,11 @@ line of the form #!<interp>."
       (let ((fullname (if (file-name-directory file) file
                        (eshell-search-path file)))
            (suffixes eshell-binary-suffixes))
+       (if (and fullname
+                (not (file-remote-p fullname))
+                (file-remote-p default-directory))
+           (setq fullname (expand-file-name
+                           (concat "./" fullname) default-directory)))
        (if (and fullname (not (or eshell-force-execution
                                   (file-executable-p fullname))))
            (while suffixes
diff --git a/lisp/let-alist.el b/lisp/let-alist.el
index 813b841..7271e39 100644
--- a/lisp/let-alist.el
+++ b/lisp/let-alist.el
@@ -4,7 +4,7 @@
 
 ;; Author: Artur Malabarba <address@hidden>
 ;; Maintainer: Artur Malabarba <address@hidden>
-;; Version: 1.0.1
+;; Version: 1.0.3
 ;; Keywords: extensions lisp
 ;; Prefix: let-alist
 ;; Separator: -
@@ -39,21 +39,25 @@
 ;;   (let-alist alist
 ;;     (if (and .title .body)
 ;;         .body
-;;       .site))
+;;       .site
+;;       .site.contents))
 ;;
-;; expands to
+;; essentially expands to
 ;;
 ;;   (let ((.title (cdr (assq 'title alist)))
-;;         (.body (cdr (assq 'body alist)))
-;;         (.site (cdr (assq 'site alist))))
+;;         (.body  (cdr (assq 'body alist)))
+;;         (.site  (cdr (assq 'site alist)))
+;;         (.site.contents (cdr (assq 'contents (cdr (assq 'site alist))))))
 ;;     (if (and .title .body)
 ;;         .body
-;;       .site))
+;;       .site
+;;       .site.contents))
+;;
+;; If you nest `let-alist' invocations, the inner one can't access
+;; the variables of the outer one. You can, however, access alists
+;; inside the original alist by using dots inside the symbol, as
+;; displayed in the example above by the `.site.contents'.
 ;;
-;; Note that only one level is supported.  If you nest `let-alist'
-;; invocations, the inner one can't access the variables of the outer
-;; one.
-
 ;;; Code:
 
 
@@ -72,6 +76,31 @@ symbol, and each cdr is the same symbol without the `.'."
    (t (apply #'append
         (mapcar #'let-alist--deep-dot-search data)))))
 
+(defun let-alist--access-sexp (symbol variable)
+  "Return a sexp used to acess SYMBOL inside VARIABLE."
+  (let* ((clean (let-alist--remove-dot symbol))
+         (name (symbol-name clean)))
+    (if (string-match "\\`\\." name)
+        clean
+      (let-alist--list-to-sexp
+       (mapcar #'intern (nreverse (split-string name "\\.")))
+       variable))))
+
+(defun let-alist--list-to-sexp (list var)
+  "Turn symbols LIST into recursive calls to `cdr' `assq' on VAR."
+  `(cdr (assq ',(car list)
+              ,(if (cdr list) (let-alist--list-to-sexp (cdr list) var)
+                 var))))
+
+(defun let-alist--remove-dot (symbol)
+  "Return SYMBOL, sans an initial dot."
+  (let ((name (symbol-name symbol)))
+    (if (string-match "\\`\\." name)
+        (intern (replace-match "" nil nil name))
+      symbol)))
+
+
+;;; The actual macro.
 ;;;###autoload
 (defmacro let-alist (alist &rest body)
   "Let-bind dotted symbols to their cdrs in ALIST and execute BODY.
@@ -83,20 +112,28 @@ For instance, the following code
   (let-alist alist
     (if (and .title .body)
         .body
-      .site))
+      .site
+      .site.contents))
 
-expands to
+essentially expands to
 
   (let ((.title (cdr (assq 'title alist)))
-        (.body (cdr (assq 'body alist)))
-        (.site (cdr (assq 'site alist))))
+        (.body  (cdr (assq 'body alist)))
+        (.site  (cdr (assq 'site alist)))
+        (.site.contents (cdr (assq 'contents (cdr (assq 'site alist))))))
     (if (and .title .body)
         .body
-      .site))"
+      .site
+      .site.contents))
+
+If you nest `let-alist' invocations, the inner one can't access
+the variables of the outer one. You can, however, access alists
+inside the original alist by using dots inside the symbol, as
+displayed in the example above."
   (declare (indent 1) (debug t))
-  (let ((var (gensym "let-alist")))
+  (let ((var (make-symbol "alist")))
     `(let ((,var ,alist))
-       (let ,(mapcar (lambda (x) `(,(car x) (cdr (assq ',(cdr x) ,var))))
+       (let ,(mapcar (lambda (x) `(,(car x) ,(let-alist--access-sexp (car x) 
var)))
                (delete-dups (let-alist--deep-dot-search body)))
          ,@body))))
 
diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el
index 2306894..eb700d7 100644
--- a/lisp/net/nsm.el
+++ b/lisp/net/nsm.el
@@ -340,7 +340,6 @@ unencrypted."
     ;; of the certificate/unencrypted connection.
     (cond
      ((eq what 'conditions)
-      (nconc saved (list :host (format "%s:%s" host port)))
       (cond
        ((not status)
        (nconc saved '(:conditions (:unencrypted))))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index c639af3..ba7b7d9 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -66,9 +66,16 @@ files conditionalize this setup based on the TERM 
environment variable."
 
 ;;;###tramp-autoload
 (defcustom tramp-histfile-override "/dev/null"
-  "Whether the HISTFILE should be overridden to something.  Set
-to nil to disable the override."
+  "When invoking a shell, override the HISTFILE with this value.
+By default, the HISTFILE is set to the \"/dev/null\" value, which
+is special on Unix systems and indicates the shell history should
+not be logged (this avoids clutter due to Tramp commands).
+
+If you set this variable to nil, however, the *override* is
+disabled, so the history will go to the default storage
+location, e.g. \"$HOME/.sh_history\"."
   :group 'tramp
+  :version "25.1"
   :type '(choice (const :tag "Do not override HISTFILE" nil)
                  (const :tag "Empty the history (/dev/null)" "/dev/null")
                  (string :tag "Redirect to a file")))
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index a24cb3d..9a6e975 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -6588,6 +6588,36 @@ comment at the start of cc-engine.el for more info."
      (prog1 (car ,ps)
        (setq ,ps (cdr ,ps)))))
 
+(defun c-back-over-member-initializer-braces ()
+  ;; Point is just after a closing brace/parenthesis.  Try to parse this as a
+  ;; C++ member initializer list, going back to just after the introducing ":"
+  ;; and returning t.  Otherwise return nil, leaving point unchanged.
+  (let ((here (point)) res)
+    (setq res
+       (catch 'done
+         (when (not (c-go-list-backward))
+           (throw 'done nil))
+         (c-backward-syntactic-ws)
+         (when (not (c-simple-skip-symbol-backward))
+           (throw 'done nil))
+         (c-backward-syntactic-ws)
+
+         (while (eq (char-before) ?,)
+           (backward-char)
+           (c-backward-syntactic-ws)
+           (when (not (memq (char-before) '(?\) ?})))
+             (throw 'done nil))
+           (when (not (c-go-list-backward))
+             (throw 'done nil))
+           (c-backward-syntactic-ws)
+           (when (not (c-simple-skip-symbol-backward))
+             (throw 'done nil))
+           (c-backward-syntactic-ws))
+
+         (eq (char-before) ?:)))
+    (or res (goto-char here))
+    res))
+
 (defun c-back-over-member-initializers ()
   ;; Test whether we are in a C++ member initializer list, and if so, go back
   ;; to the introducing ":", returning the position of the opening paren of
@@ -9588,22 +9618,26 @@ comment at the start of cc-engine.el for more info."
                                       (c-keyword-sym (match-string 1)))))
 
       ;; Init some position variables.
-      (if c-state-cache
+      (if paren-state
          (progn
            (setq containing-sexp (car paren-state)
                  paren-state (cdr paren-state))
            (if (consp containing-sexp)
-               (progn
-                 (setq lim (cdr containing-sexp))
-                 (if (cdr c-state-cache)
-                     ;; Ignore balanced paren.  The next entry
-                     ;; can't be another one.
-                     (setq containing-sexp (car (cdr c-state-cache))
-                           paren-state (cdr paren-state))
-                   ;; If there is no surrounding open paren then
-                   ;; put the last balanced pair back on paren-state.
-                   (setq paren-state (cons containing-sexp paren-state)
-                         containing-sexp nil)))
+             (save-excursion
+               (goto-char (cdr containing-sexp))
+               (if (and (c-major-mode-is 'c++-mode)
+                        (c-back-over-member-initializer-braces))
+                     (c-syntactic-skip-backward "^}" nil t))
+               (setq lim (point))
+               (if paren-state
+                   ;; Ignore balanced paren.    The next entry
+                   ;; can't be another one.
+                   (setq containing-sexp (car paren-state)
+                         paren-state (cdr paren-state))
+                 ;; If there is no surrounding open paren then
+                 ;; put the last balanced pair back on paren-state.
+                 (setq paren-state (cons containing-sexp paren-state)
+                       containing-sexp nil)))
              (setq lim (1+ containing-sexp))))
        (setq lim (point-min)))
 
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 448e764..d39376a 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -1464,36 +1464,38 @@ casts and declarations are fontified.  Used on level 2 
and higher."
                    c-recognize-knr-p) ; Strictly speaking, bogus, but it
                                       ; speeds up lisp.h tremendously.
                (save-excursion
-                 (unless (or (eobp)
-                             (looking-at "\\s(\\|\\s)"))
-                   (forward-char))
-                 (setq bod-res (car (c-beginning-of-decl-1 decl-search-lim)))
-                 (if (and (eq bod-res 'same)
-                          (save-excursion
-                            (c-backward-syntactic-ws)
-                            (eq (char-before) ?\})))
-                     (c-beginning-of-decl-1 decl-search-lim))
-
-                 ;; We're now putatively at the declaration.
-                 (setq paren-state (c-parse-state))
-                 ;; At top level or inside a "{"?
-                 (if (or (not (setq encl-pos
-                                    (c-most-enclosing-brace paren-state)))
-                         (eq (char-after encl-pos) ?\{))
-                     (progn
-                       (when (looking-at c-typedef-key) ; "typedef"
-                         (setq is-typedef t)
-                         (goto-char (match-end 0))
-                         (c-forward-syntactic-ws))
-                       ;; At a real declaration?
-                       (if (memq (c-forward-type t) '(t known found decltype))
-                           (progn
-                             (c-font-lock-declarators (point-max) t is-typedef)
-                             nil)
-                         ;; False alarm.  Return t to go on to the next check.
-                         (goto-char start-pos)
-                         t))
-                   t))))))
+                 (if (c-back-over-member-initializers)
+                    t                  ; Can't be at a declarator
+                   (unless (or (eobp)
+                               (looking-at "\\s(\\|\\s)"))
+                     (forward-char))
+                   (setq bod-res (car (c-beginning-of-decl-1 decl-search-lim)))
+                   (if (and (eq bod-res 'same)
+                            (save-excursion
+                              (c-backward-syntactic-ws)
+                              (eq (char-before) ?\})))
+                       (c-beginning-of-decl-1 decl-search-lim))
+
+                   ;; We're now putatively at the declaration.
+                   (setq paren-state (c-parse-state))
+                   ;; At top level or inside a "{"?
+                   (if (or (not (setq encl-pos
+                                      (c-most-enclosing-brace paren-state)))
+                           (eq (char-after encl-pos) ?\{))
+                       (progn
+                         (when (looking-at c-typedef-key) ; "typedef"
+                           (setq is-typedef t)
+                           (goto-char (match-end 0))
+                           (c-forward-syntactic-ws))
+                         ;; At a real declaration?
+                         (if (memq (c-forward-type t) '(t known found 
decltype))
+                             (progn
+                               (c-font-lock-declarators (point-max) t 
is-typedef)
+                               nil)
+                           ;; False alarm.  Return t to go on to the next 
check.
+                           (goto-char start-pos)
+                           t))
+                     t)))))))
 
          ;; It was a false alarm.  Check if we're in a label (or other
          ;; construct with `:' except bitfield) instead.
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index b93cc78..31298d7 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -1741,7 +1741,7 @@ but they don't build a type of themselves.  Unlike the 
keywords on
 not the type face."
   t    nil
   c    '("const" "restrict" "volatile")
-  c++  '("const" "constexpr" "noexcept" "volatile" "throw")
+  c++  '("const" "constexpr" "noexcept" "volatile" "throw" "final" "override")
   objc '("const" "volatile"))
 
 (c-lang-defconst c-opt-type-modifier-key
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index c2c45aa..45074d3 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1637,12 +1637,29 @@ This performs fontification according to 
`js--class-styles'."
                                    js--font-lock-keywords-3)
   "Font lock keywords for `js-mode'.  See `font-lock-keywords'.")
 
+(defconst js--syntax-propertize-regexp-syntax-table
+  (let ((st (make-char-table 'syntax-table (string-to-syntax "."))))
+    (modify-syntax-entry ?\[ "(]" st)
+    (modify-syntax-entry ?\] ")[" st)
+    (modify-syntax-entry ?\\ "\\" st)
+    st))
+
 (defun js-syntax-propertize-regexp (end)
-  (when (eq (nth 3 (syntax-ppss)) ?/)
-    ;; A /.../ regexp.
-    (when (re-search-forward "\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*/" end 'move)
-      (put-text-property (1- (point)) (point)
-                         'syntax-table (string-to-syntax "\"/")))))
+  (let ((ppss (syntax-ppss)))
+    (when (eq (nth 3 ppss) ?/)
+      ;; A /.../ regexp.
+      (while
+          (when (re-search-forward "\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*/"
+                                   end 'move)
+            (if (nth 1 (with-syntax-table
+                           js--syntax-propertize-regexp-syntax-table
+                         (let ((parse-sexp-lookup-properties nil))
+                           (parse-partial-sexp (nth 8 ppss) (point)))))
+                ;; A / within a character class is not the end of a regexp.
+                t
+              (put-text-property (1- (point)) (point)
+                                 'syntax-table (string-to-syntax "\"/"))
+              nil))))))
 
 (defun js-syntax-propertize (start end)
   ;; Javascript allows immediate regular expression objects, written /.../.
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 225f1f6..bf0884f 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1768,17 +1768,12 @@ If the result is do-end block, it will always be 
multiline."
 
 (defun ruby--string-region ()
   "Return region for string at point."
-  (let ((orig-point (point)) (regex 
"'\\(\\(\\\\'\\)\\|[^']\\)*'\\|\"\\(\\(\\\\\"\\)\\|[^\"]\\)*\"") beg end)
-    (save-excursion
-      (goto-char (line-beginning-position))
-      (while (and (re-search-forward regex (line-end-position) t) (not (and 
beg end)))
-        (let ((match-beg (match-beginning 0)) (match-end (match-end 0)))
-          (when (and
-                 (> orig-point match-beg)
-                 (< orig-point match-end))
-            (setq beg match-beg)
-            (setq end match-end))))
-      (and beg end (list beg end)))))
+  (let ((state (syntax-ppss)))
+    (when (memq (nth 3 state) '(?' ?\"))
+      (save-excursion
+        (goto-char (nth 8 state))
+        (forward-sexp)
+        (list (nth 8 state) (point))))))
 
 (defun ruby-string-at-point-p ()
   "Check if cursor is at a string or not."
diff --git a/lisp/shell.el b/lisp/shell.el
index 506f944..480d04a 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -308,6 +308,13 @@ for Shell mode only."
                 (const :tag "on" t))
   :group 'shell)
 
+(defcustom shell-display-buffer-actions display-buffer-base-action
+  "The `display-buffer' actions for the `*shell*' buffer."
+  :type display-buffer--action-custom-type
+  :risky t
+  :version "25.1"
+  :group 'shell)
+
 (defvar shell-dirstack nil
   "List of directories saved by pushd in this buffer's shell.
 Thus, this does not include the shell's current directory.")
@@ -718,7 +725,7 @@ Otherwise, one argument `-i' is passed to the shell.
 
   ;; The buffer's window must be correctly set when we call comint (so
   ;; that comint sets the COLUMNS env var properly).
-  (pop-to-buffer-same-window buffer)
+  (pop-to-buffer buffer shell-display-buffer-actions)
   (unless (comint-check-proc buffer)
     (let* ((prog (or explicit-shell-file-name
                     (getenv "ESHELL") shell-file-name))
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index ea2eaba..ab2c83b 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2265,8 +2265,9 @@ Global `ispell-quit' set to start location to continue 
spell session."
        (sit-for 0))
 
     ;; Display choices for misspelled word.
+    (setq textwin (selected-window))
     (ispell-show-choices)
-    (select-window (setq textwin (next-window)))
+    (select-window textwin)
 
     ;; highlight word, protecting current buffer status
     (unwind-protect
@@ -2408,8 +2409,9 @@ Global `ispell-quit' set to start location to continue 
spell session."
                                      count (ispell-int-char (1+ count))))
                              (setq count (ispell-int-char
                                           (- count ?0 skipped))))
+                           (setq textwin (selected-window))
                            (ispell-show-choices)
-                           (select-window (next-window)))))
+                           (select-window textwin))))
                    (and (eq 'block ispell-highlight-p)
                         (ispell-highlight-spelling-error start end nil
                                                          'block))
diff --git a/m4/stdalign.m4 b/m4/stdalign.m4
index 9efafe5..f60257f 100644
--- a/m4/stdalign.m4
+++ b/m4/stdalign.m4
@@ -32,8 +32,12 @@ AC_DEFUN([gl_STDALIGN_H],
             /* Test _Alignas only on platforms where gnulib can help.  */
             #if \
                 ((defined __cplusplus && 201103 <= __cplusplus) \
-                 || __GNUC__ || __IBMC__ || __IBMCPP__ || __ICC \
-                 || 0x5110 <= __SUNPRO_C || 1300 <= _MSC_VER)
+                 || (defined __APPLE__ && defined __MACH__ \
+                     ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+                     : __GNUC__) \
+                 || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__ \
+                 || __ICC || 0x5110 <= __SUNPRO_C \
+                 || 1300 <= _MSC_VER)
               struct alignas_test { char c; char alignas (8) alignas_8; };
               char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
                                 ? 1 : -1];
diff --git a/src/ChangeLog b/src/ChangeLog
index 5bab023..b90471e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,80 @@
+2014-12-23  Didier Verna  <address@hidden> (tiny change).
+
+       * nsselect.m (Fns_selection_owner_p): Return a Lisp boolean, not a
+       C one (Bug#19396).
+
+2014-12-22  Jan Djärv  <address@hidden>
+
+       * xterm.c (x_bitmap_icon): Partly revert change from 2014-03-21 which
+       breaks icon setting for Gtk+ except for initial frame (Bug#19403).
+
+2014-12-22  Paul Eggert  <address@hidden>
+
+       Use bool for boolean in xterm.c
+       * frame.h, nsterm.m, w32term.c, w32term.h, xterm.c:
+       (x_set_window_size, x_bitmap_icon):
+       * nsterm.m (ns_frame_raise_lower, x_new_font):
+       * termhooks.h (struct terminal.toggle_invisible_pointer_hook)
+       (struct terminal.frame_raise_lower_hook):
+       * w32term.c (w32_frame_raise_lower):
+       * xterm.c, xterm.h (x_text_icon):
+       * xterm.c (x_update_window_begin, x_update_window_end)
+       (x_update_end, x_after_update_window_line)
+       (x_set_glyph_string_gc, x_draw_glyph_string_background)
+       (x_draw_glyph_string_foreground)
+       (x_draw_composite_glyph_string_foreground)
+       (x_alloc_lighter_color, x_draw_relief_rect)
+       (x_draw_glyph_string_box, x_draw_image_relief)
+       (x_draw_image_glyph_string, x_draw_stretch_glyph_string)
+       (x_draw_underwave, x_draw_glyph_string, x_show_hourglass)
+       (x_hide_hourglass):
+       (XFillRectangle) [HAVE_GTK3]:
+       (XTtoggle_invisible_pointer, frame_highlight, frame_unhighlight)
+       (x_focus_changed, x_find_modifier_meanings, note_mouse_movement)
+       (XTmouse_position, xt_action_hook, xt_horizontal_action_hook)
+       (x_send_scroll_bar_event, xm_scroll_callback)
+       (xg_scroll_callback, xaw_jump_callback, xaw_scroll_callback)
+       (x_create_toolkit_scroll_bar)
+       (x_create_horizontal_toolkit_scroll_bar)
+       (x_set_toolkit_horizontal_scroll_bar_thumb, x_scroll_bar_create)
+       (x_scroll_bar_set_handle, XTset_vertical_scroll_bar)
+       (XTset_horizontal_scroll_bar, x_scroll_bar_expose)
+       (x_scroll_bar_handle_click, x_scroll_bar_note_movement)
+       (x_scroll_bar_report_motion)
+       (x_horizontal_scroll_bar_report_motion, x_net_wm_state)
+       (handle_one_xevent, XTread_socket, x_draw_bar_cursor)
+       (x_draw_window_cursor, x_clear_errors)
+       (x_trace_wire, x_new_font, x_set_offset, wm_supports)
+       (set_wm_state, x_set_sticky, get_current_wm_state)
+       (do_ewmh_fullscreen, x_handle_net_wm_state)
+       (x_check_expected_move, x_sync_with_move, x_wait_for_event)
+       (x_set_window_size_1, XTframe_raise_lower)
+       (x_make_frame_visible, x_iconify_frame)
+       (x_timeout_atimer_activated_flag, same_x_server, x_display_ok)
+       (x_term_init, x_process_timeouts, x_activate_timeout_atimer)
+       (x_delete_terminal, x_initialize, syms_of_xterm):
+       Use bool for boolean.
+
+2014-12-20  Paul Eggert  <address@hidden>
+
+       * composite.h (struct composition.width): Now int
+       instead of unsigned short, as we prefer signed integers.
+
+       Let charset tick grow past USHRT_MAX
+       * charset.c, charset.h (charset_ordered_list_tick):
+       Now EMACS_UINT, not unsigned short.
+       * fontset.c (reorder_font_vector): Allow the tick to grow to the
+       maximum representable Emacs integer value before wrapping it around.
+
+       Simplify unexec file mode setting
+       * unexaix.c, unexcoff.c, unexelf.c, unexmacosx.c:
+       Don't include <sys/stat.h> when no longer needed.
+       (unexec): Create file with correct mode in the first place,
+       rather than overwriting the mode later and fiddling with the
+       global umask in the mean time.  Avoid bogus usage like
+       'umask (777)', which should have been 'umask (0777)'.
+       (mark_x): Remove. All callers removed.
+
 2014-12-19  Paul Eggert  <address@hidden>
 
        Minor cleanups for Lisp objects and symbols
@@ -14,6 +91,7 @@
        * nsmenu.m (syms_of_nsmenu):
        * nsselect.m (syms_of_nsselect):
        Prefer DEFSYM to defining by hand.
+       * buffer.c (syms_of_buffer): Omit unneeded staticpros.
        * data.c: Fix too-long line.
        * lisp.h (DECLARE_GDB_SYM): New macro.
        (DEFINE_GDB_SYMBOL_BEGIN): Use it.
diff --git a/src/buffer.c b/src/buffer.c
index ba3245f..b57d968 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5395,13 +5395,8 @@ syms_of_buffer (void)
   last_overlay_modification_hooks
     = Fmake_vector (make_number (10), Qnil);
 
-  staticpro (&Qfundamental_mode);
-  staticpro (&Qmode_class);
   staticpro (&QSFundamental);
   staticpro (&Vbuffer_alist);
-  staticpro (&Qprotected_field);
-  staticpro (&Qpermanent_local);
-  staticpro (&Qkill_buffer_hook);
 
   DEFSYM (Qchoice, "choice");
   DEFSYM (Qleft, "left");
diff --git a/src/charset.c b/src/charset.c
index 171a00f..7fcb153 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -101,10 +101,9 @@ Lisp_Object Vcharset_ordered_list;
    charsets.  */
 Lisp_Object Vcharset_non_preferred_head;
 
-/* Incremented everytime we change Vcharset_ordered_list.  This is
-   unsigned short so that it fits in Lisp_Int and never matches
-   -1.  */
-unsigned short charset_ordered_list_tick;
+/* Incremented every time we change the priority of charsets.
+   Wraps around.  */
+EMACS_UINT charset_ordered_list_tick;
 
 /* List of iso-2022 charsets.  */
 Lisp_Object Viso_2022_charset_list;
diff --git a/src/charset.h b/src/charset.h
index 4176ce5..6c6c3e6 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -253,8 +253,7 @@ extern struct charset *charset_table;
 extern Lisp_Object Vcharset_ordered_list;
 extern Lisp_Object Vcharset_non_preferred_head;
 
-/* Incremented everytime we change the priority of charsets.  */
-extern unsigned short charset_ordered_list_tick;
+extern EMACS_UINT charset_ordered_list_tick;
 
 extern Lisp_Object Viso_2022_charset_list;
 extern Lisp_Object Vemacs_mule_charset_list;
diff --git a/src/composite.h b/src/composite.h
index f01ae32..1080eb0 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -156,7 +156,7 @@ struct composition {
   /* How many columns the overall glyphs occupy on the screen.  This
      gives an approximate value for column calculation in
      Fcurrent_column, and etc.  */
-  unsigned short width;
+  int width;
 
   /* Method of the composition.  */
   enum composition_method method;
diff --git a/src/conf_post.h b/src/conf_post.h
index 8667e25..90f4c6e 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -309,8 +309,8 @@ extern void _DebPrint (const char *fmt, ...);
    Other .c files should not define INLINE.
 
    C99 compilers compile functions like 'incr' as C99-style extern
-   inline functions.  Pre-C99 GCCs do something similar with
-   GNU-specific keywords.  Pre-C99 non-GCC compilers use static
+   inline functions.  Buggy GCC implementations do something similar with
+   GNU-specific keywords.  Buggy non-GCC compilers use static
    functions, which bloats the code but is good enough.  */
 
 #ifndef INLINE
diff --git a/src/fontset.c b/src/fontset.c
index d08d68f..ac50be1 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -389,7 +389,7 @@ reorder_font_vector (Lisp_Object font_group, struct font 
*font)
   Lisp_Object vec, font_object;
   int size;
   int i;
-  bool score_changed = 0;
+  bool score_changed = false;
 
   if (font)
     XSETFONT (font_object, font);
@@ -444,14 +444,15 @@ reorder_font_vector (Lisp_Object font_group, struct font 
*font)
       if (RFONT_DEF_SCORE (rfont_def) != score)
        {
          RFONT_DEF_SET_SCORE (rfont_def, score);
-         score_changed = 1;
+         score_changed = true;
        }
     }
 
   if (score_changed)
     qsort (XVECTOR (vec)->contents, size, word_size,
           fontset_compare_rfontdef);
-  XSETCAR (font_group, make_number (charset_ordered_list_tick));
+  EMACS_INT low_tick_bits = charset_ordered_list_tick & MOST_POSITIVE_FIXNUM;
+  XSETCAR (font_group, make_number (low_tick_bits));
 }
 
 /* Return a font-group (actually a cons (-1 . FONT-GROUP-VECTOR)) for
diff --git a/src/frame.h b/src/frame.h
index 3fd1a6a..1aa8804 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1435,7 +1435,7 @@ extern Lisp_Object display_x_get_resource (Display_Info *,
                                           Lisp_Object subclass);
 
 extern void set_frame_menubar (struct frame *f, bool first_time, bool deep_p);
-extern void x_set_window_size (struct frame *f, int change_grav,
+extern void x_set_window_size (struct frame *f, bool change_gravity,
                               int width, int height, bool pixelwise);
 extern Lisp_Object x_get_focus_frame (struct frame *);
 extern void frame_set_mouse_pixel_position (struct frame *f, int pix_x, int 
pix_y);
@@ -1462,7 +1462,7 @@ extern void x_focus_frame (struct frame *);
 
 #ifndef HAVE_NS
 
-extern int x_bitmap_icon (struct frame *, Lisp_Object);
+extern bool x_bitmap_icon (struct frame *, Lisp_Object);
 
 /* Set F's bitmap icon, if specified among F's parameters.  */
 
diff --git a/src/nsselect.m b/src/nsselect.m
index 3b33a97..8863bd2 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -438,7 +438,8 @@ On Nextstep, TERMINAL is unused.  */)
   if (EQ (selection, Qnil)) selection = QPRIMARY;
   if (EQ (selection, Qt)) selection = QSECONDARY;
   return ns_get_pb_change_count (selection)
-    == ns_get_our_change_count_for (selection);
+    == ns_get_our_change_count_for (selection)
+    ? Qt : Qnil;
 }
 
 
diff --git a/src/nsterm.m b/src/nsterm.m
index f012528..7f4b8b2 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1082,7 +1082,7 @@ ns_lower_frame (struct frame *f)
 
 
 static void
-ns_frame_raise_lower (struct frame *f, int raise)
+ns_frame_raise_lower (struct frame *f, bool raise)
 /* --------------------------------------------------------------------------
      External (hook)
    -------------------------------------------------------------------------- 
*/
@@ -1322,7 +1322,7 @@ x_set_offset (struct frame *f, int xoff, int yoff, int 
change_grav)
 
 void
 x_set_window_size (struct frame *f,
-                   int change_grav,
+                   bool change_gravity,
                    int width,
                    int height,
                    bool pixelwise)
@@ -7622,8 +7622,8 @@ x_new_font (struct frame *f, Lisp_Object font_object, int 
fontset)
 
   /* Now make the frame display the given font.  */
   if (FRAME_NS_WINDOW (f) != 0 && ! [view isFullscreen])
-    x_set_window_size (f, 0, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
-                       FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 1);
+    x_set_window_size (f, false, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
+                       FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), true);
 
   return font_object;
 }
diff --git a/src/termhooks.h b/src/termhooks.h
index 9cab853..137e77a 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -451,7 +451,7 @@ struct terminal
   void (*delete_glyphs_hook) (struct frame *, int);
 
   void (*ring_bell_hook) (struct frame *f);
-  void (*toggle_invisible_pointer_hook) (struct frame *f, int invisible);
+  void (*toggle_invisible_pointer_hook) (struct frame *f, bool invisible);
 
   void (*reset_terminal_modes_hook) (struct terminal *);
   void (*set_terminal_modes_hook) (struct terminal *);
@@ -496,10 +496,10 @@ struct terminal
      support overlapping frames, so there's no need to raise or lower
      anything.
 
-     If RAISE_FLAG is non-zero, F is brought to the front, before all other
-     windows.  If RAISE_FLAG is zero, F is sent to the back, behind all other
+     If RAISE_FLAG, F is brought to the front, before all other
+     windows.  If !RAISE_FLAG, F is sent to the back, behind all other
      windows.  */
-  void (*frame_raise_lower_hook) (struct frame *f, int raise_flag);
+  void (*frame_raise_lower_hook) (struct frame *f, bool raise_flag);
 
   /* If the value of the frame parameter changed, this hook is called.
      For example, if going from fullscreen to not fullscreen this hook
diff --git a/src/unexaix.c b/src/unexaix.c
index c97d5ca..fd36e4a 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -55,7 +55,6 @@ what you give them.   Help stamp out software-hoarding!  */
 #include <inttypes.h>
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/stat.h>
 #include <errno.h>
 #include <unistd.h>
 #include <fcntl.h>
@@ -134,7 +133,7 @@ unexec (const char *new_name, const char *a_name)
     {
       PERROR (a_name);
     }
-  if ((new = emacs_open (new_name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0)
+  if ((new = emacs_open (new_name, O_WRONLY | O_CREAT | O_TRUNC, 0777)) < 0)
     {
       PERROR (new_name);
     }
@@ -152,7 +151,6 @@ unexec (const char *new_name, const char *a_name)
   emacs_close (new);
   if (a_out >= 0)
     emacs_close (a_out);
-  mark_x (new_name);
 }
 
 /* ****************************************************************
@@ -466,29 +464,6 @@ copy_sym (int new, int a_out, const char *a_name, const 
char *new_name)
   return 0;
 }
 
-/* ****************************************************************
- * mark_x
- *
- * After successfully building the new a.out, mark it executable
- */
-static void
-mark_x (const char *name)
-{
-  struct stat sbuf;
-  int um;
-  int new = 0;  /* for PERROR */
-
-  um = umask (777);
-  umask (um);
-  if (stat (name, &sbuf) == -1)
-    {
-      PERROR (name);
-    }
-  sbuf.st_mode |= 0111 & ~um;
-  if (chmod (name, sbuf.st_mode) == -1)
-    PERROR (name);
-}
-
 static int
 adjust_lnnoptrs (int writedesc, int readdesc, const char *new_name)
 {
diff --git a/src/unexcoff.c b/src/unexcoff.c
index 0e47bdd..292c38f 100644
--- a/src/unexcoff.c
+++ b/src/unexcoff.c
@@ -97,7 +97,6 @@ struct aouthdr
 #include <sys/types.h>
 #endif /* makedev */
 #include <stdio.h>
-#include <sys/stat.h>
 #include <errno.h>
 
 #include <sys/file.h>
@@ -439,29 +438,6 @@ copy_sym (int new, int a_out, const char *a_name, const 
char *new_name)
   return 0;
 }
 
-/* ****************************************************************
- * mark_x
- *
- * After successfully building the new a.out, mark it executable
- */
-static void
-mark_x (const char *name)
-{
-  struct stat sbuf;
-  int um;
-  int new = 0;  /* for PERROR */
-
-  um = umask (777);
-  umask (um);
-  if (stat (name, &sbuf) == -1)
-    {
-      PERROR (name);
-    }
-  sbuf.st_mode |= 0111 & ~um;
-  if (chmod (name, sbuf.st_mode) == -1)
-    PERROR (name);
-}
-
 
 /*
  *     If the COFF file contains a symbol table and a line number section,
@@ -542,7 +518,7 @@ unexec (const char *new_name, const char *a_name)
     {
       PERROR (a_name);
     }
-  if ((new = emacs_open (new_name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0)
+  if ((new = emacs_open (new_name, O_WRONLY | O_CREAT | O_TRUNC, 0777)) < 0)
     {
       PERROR (new_name);
     }
@@ -560,7 +536,6 @@ unexec (const char *new_name, const char *a_name)
   emacs_close (new);
   if (a_out >= 0)
     emacs_close (a_out);
-  mark_x (new_name);
 }
 
 #endif /* not CANNOT_DUMP */
diff --git a/src/unexelf.c b/src/unexelf.c
index 0983f8f..34478e0 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -665,7 +665,6 @@ unexec (const char *new_name, const char *old_name)
 #endif
   struct stat stat_buf;
   off_t old_file_size;
-  int mask;
 
   /* Open the old file, allocate a buffer of the right size, and read
      in the file contents.  */
@@ -799,7 +798,7 @@ unexec (const char *new_name, const char *old_name)
      the image of the new file.  Set pointers to various interesting
      objects.  */
 
-  new_file = emacs_open (new_name, O_RDWR | O_CREAT, 0666);
+  new_file = emacs_open (new_name, O_RDWR | O_CREAT, 0777);
   if (new_file < 0)
     fatal ("Can't creat (%s): %s", new_name, strerror (errno));
 
@@ -1319,13 +1318,4 @@ temacs:
 
   if (emacs_close (new_file) != 0)
     fatal ("Can't close (%s): %s", new_name, strerror (errno));
-
-  if (stat (new_name, &stat_buf) != 0)
-    fatal ("Can't stat (%s): %s", new_name, strerror (errno));
-
-  mask = umask (777);
-  umask (mask);
-  stat_buf.st_mode |= 0111 & ~mask;
-  if (chmod (new_name, stat_buf.st_mode) != 0)
-    fatal ("Can't chmod (%s): %s", new_name, strerror (errno));
 }
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 2e1ac88..89971bb 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -1267,7 +1267,7 @@ unexec (const char *outfile, const char *infile)
       unexec_error ("cannot open input file `%s'", infile);
     }
 
-  outfd = emacs_open (outfile, O_WRONLY | O_TRUNC | O_CREAT, 0755);
+  outfd = emacs_open (outfile, O_WRONLY | O_TRUNC | O_CREAT, 0777);
   if (outfd < 0)
     {
       emacs_close (infd);
diff --git a/src/w32term.c b/src/w32term.c
index 94b332b..fb8648c 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -185,7 +185,7 @@ void x_lower_frame (struct frame *);
 void x_scroll_bar_clear (struct frame *);
 void x_wm_set_size_hint (struct frame *, long, bool);
 void x_raise_frame (struct frame *);
-void x_set_window_size (struct frame *, int, int, int, bool);
+void x_set_window_size (struct frame *, bool, int, int, bool);
 void x_wm_set_window_state (struct frame *, int);
 void x_wm_set_icon_pixmap (struct frame *, int);
 static void w32_initialize (void);
@@ -5716,7 +5716,7 @@ w32_draw_window_cursor (struct window *w, struct 
glyph_row *glyph_row,
 
 /* Icons.  */
 
-int
+bool
 x_bitmap_icon (struct frame *f, Lisp_Object icon)
 {
   HANDLE main_icon;
@@ -6096,12 +6096,13 @@ w32fullscreen_hook (struct frame *f)
 }
 
 /* Call this to change the size of frame F's x-window.
-   If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity
+   If CHANGE_GRAVITY, change to top-left-corner window gravity
    for this size change and subsequent size changes.
    Otherwise we leave the window gravity unchanged.  */
 
 void
-x_set_window_size (struct frame *f, int change_gravity, int width, int height, 
bool pixelwise)
+x_set_window_size (struct frame *f, bool change_gravity,
+                  int width, int height, bool pixelwise)
 {
   int pixelwidth, pixelheight;
   RECT rect;
@@ -6331,7 +6332,7 @@ x_lower_frame (struct frame *f)
 }
 
 static void
-w32_frame_raise_lower (struct frame *f, int raise_flag)
+w32_frame_raise_lower (struct frame *f, bool raise_flag)
 {
   if (! FRAME_W32_P (f))
     return;
diff --git a/src/w32term.h b/src/w32term.h
index fb37550..f02d7ce 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -240,7 +240,7 @@ extern struct w32_display_info *w32_term_init (Lisp_Object,
                                               char *, char *);
 extern int w32_defined_color (struct frame *f, const char *color,
                               XColor *color_def, int alloc);
-extern void x_set_window_size (struct frame *f, int change_grav,
+extern void x_set_window_size (struct frame *f, bool change_gravity,
                               int width, int height, bool pixelwise);
 extern int x_display_pixel_height (struct w32_display_info *);
 extern int x_display_pixel_width (struct w32_display_info *);
@@ -257,7 +257,7 @@ extern void x_set_internal_border_width (struct frame *f,
                                         Lisp_Object value,
                                         Lisp_Object oldval);
 extern void x_activate_menubar (struct frame *);
-extern int x_bitmap_icon (struct frame *, Lisp_Object);
+extern bool x_bitmap_icon (struct frame *, Lisp_Object);
 extern void initialize_frame_menubar (struct frame *);
 extern void x_free_frame_resources (struct frame *);
 extern void x_real_positions (struct frame *, int *, int *);
diff --git a/src/xterm.c b/src/xterm.c
index 1ccc38c..0640208 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -220,7 +220,7 @@ enum xembed_message
   };
 
 static bool x_alloc_nearest_color_1 (Display *, Colormap, XColor *);
-static void x_set_window_size_1 (struct frame *, int, int, int, bool);
+static void x_set_window_size_1 (struct frame *, bool, int, int, bool);
 static void x_raise_frame (struct frame *);
 static void x_lower_frame (struct frame *);
 static const XColor *x_color_cells (Display *, int *);
@@ -255,10 +255,10 @@ static void x_horizontal_scroll_bar_report_motion (struct 
frame **, Lisp_Object
                                                   enum scroll_bar_part *,
                                                   Lisp_Object *, Lisp_Object *,
                                                   Time *);
-static int x_handle_net_wm_state (struct frame *, const XPropertyEvent *);
+static bool x_handle_net_wm_state (struct frame *, const XPropertyEvent *);
 static void x_check_fullscreen (struct frame *);
 static void x_check_expected_move (struct frame *, int, int);
-static void x_sync_with_move (struct frame *, int, int, int);
+static void x_sync_with_move (struct frame *, int, int, bool);
 static int handle_one_xevent (struct x_display_info *,
                              const XEvent *, int *,
                              struct input_event *);
@@ -272,7 +272,7 @@ static void x_wm_set_window_state (struct frame *, int);
 static void x_wm_set_icon_pixmap (struct frame *, ptrdiff_t);
 static void x_initialize (void);
 
-static int get_current_wm_state (struct frame *, Window, int *, int *);
+static bool get_current_wm_state (struct frame *, Window, int *, bool *);
 
 /* Flush display of frame F.  */
 
@@ -305,7 +305,7 @@ x_flush (struct frame *f)
                              Debugging
  ***********************************************************************/
 
-#if 0
+#if false
 
 /* This is a function useful for recording debugging information about
    the sequence of occurrences in this file.  */
@@ -331,7 +331,7 @@ record_event (char *locus, int type)
   event_record_index++;
 }
 
-#endif /* 0 */
+#endif
 
 
 
@@ -479,7 +479,7 @@ x_update_window_begin (struct window *w)
   if (f == hlinfo->mouse_face_mouse_frame)
     {
       /* Don't do highlighting for mouse motion during the update.  */
-      hlinfo->mouse_face_defer = 1;
+      hlinfo->mouse_face_defer = true;
 
       /* If F needs to be redrawn, simply forget about any prior mouse
         highlighting.  */
@@ -583,11 +583,11 @@ x_update_window_end (struct window *w, bool cursor_on_p,
       block_input ();
 
       if (cursor_on_p)
-       display_and_set_cursor (w, 1,
+       display_and_set_cursor (w, true,
                                w->output_cursor.hpos, w->output_cursor.vpos,
                                w->output_cursor.x, w->output_cursor.y);
 
-      if (draw_window_fringes (w, 1))
+      if (draw_window_fringes (w, true))
        {
          if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
            x_draw_right_divider (w);
@@ -618,7 +618,7 @@ static void
 x_update_end (struct frame *f)
 {
   /* Mouse highlight may be displayed again.  */
-  MOUSE_HL_INFO (f)->mouse_face_defer = 0;
+  MOUSE_HL_INFO (f)->mouse_face_defer = false;
 
 #ifndef XFlush
   block_input ();
@@ -675,7 +675,7 @@ x_after_update_window_line (struct window *w, struct 
glyph_row *desired_row)
   eassert (w);
 
   if (!desired_row->mode_line_p && !w->pseudo_window_p)
-    desired_row->redraw_fringe_bitmaps_p = 1;
+    desired_row->redraw_fringe_bitmaps_p = true;
 
 #ifdef USE_X_TOOLKIT
   /* When a window has disappeared, make sure that no rest of
@@ -817,10 +817,10 @@ static void x_draw_image_foreground_1 (struct 
glyph_string *, Pixmap);
 static void x_clear_glyph_string_rect (struct glyph_string *, int,
                                        int, int, int);
 static void x_draw_relief_rect (struct frame *, int, int, int, int,
-                                int, int, int, int, int, int,
+                                int, bool, bool, bool, bool, bool,
                                 XRectangle *);
 static void x_draw_box_rect (struct glyph_string *, int, int, int, int,
-                             int, int, int, XRectangle *);
+                             int, bool, bool, XRectangle *);
 static void x_scroll_bar_clear (struct frame *);
 
 #ifdef GLYPH_DEBUG
@@ -962,7 +962,7 @@ x_set_glyph_string_gc (struct glyph_string *s)
   else if (s->hl == DRAW_CURSOR)
     {
       x_set_cursor_gc (s);
-      s->stippled_p = 0;
+      s->stippled_p = false;
     }
   else if (s->hl == DRAW_MOUSE_FACE)
     {
@@ -1094,7 +1094,7 @@ x_draw_glyph_string_background (struct glyph_string *s, 
bool force_p)
                          s->background_width,
                          s->height - 2 * box_line_width);
          XSetFillStyle (s->display, s->gc, FillSolid);
-         s->background_filled_p = 1;
+         s->background_filled_p = true;
        }
       else if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width
               || s->font_not_found_p
@@ -1104,7 +1104,7 @@ x_draw_glyph_string_background (struct glyph_string *s, 
bool force_p)
          x_clear_glyph_string_rect (s, s->x, s->y + box_line_width,
                                     s->background_width,
                                     s->height - 2 * box_line_width);
-         s->background_filled_p = 1;
+         s->background_filled_p = true;
        }
     }
 }
@@ -1150,11 +1150,11 @@ x_draw_glyph_string_foreground (struct glyph_string *s)
       y = s->ybase - boff;
       if (s->for_overlaps
          || (s->background_filled_p && s->hl != DRAW_CURSOR))
-       font->driver->draw (s, 0, s->nchars, x, y, 0);
+       font->driver->draw (s, 0, s->nchars, x, y, false);
       else
-       font->driver->draw (s, 0, s->nchars, x, y, 1);
+       font->driver->draw (s, 0, s->nchars, x, y, true);
       if (s->face->overstrike)
-       font->driver->draw (s, 0, s->nchars, x + 1, y, 0);
+       font->driver->draw (s, 0, s->nchars, x + 1, y, false);
     }
 }
 
@@ -1199,9 +1199,9 @@ x_draw_composite_glyph_string_foreground (struct 
glyph_string *s)
            int xx = x + s->cmp->offsets[j * 2];
            int yy = y - s->cmp->offsets[j * 2 + 1];
 
-           font->driver->draw (s, j, j + 1, xx, yy, 0);
+           font->driver->draw (s, j, j + 1, xx, yy, false);
            if (s->face->overstrike)
-             font->driver->draw (s, j, j + 1, xx + 1, yy, 0);
+             font->driver->draw (s, j, j + 1, xx + 1, yy, false);
          }
     }
   else
@@ -1222,17 +1222,18 @@ x_draw_composite_glyph_string_foreground (struct 
glyph_string *s)
 
              if (j < i)
                {
-                 font->driver->draw (s, j, i, x, y, 0);
+                 font->driver->draw (s, j, i, x, y, false);
                  if (s->face->overstrike)
-                   font->driver->draw (s, j, i, x + 1, y, 0);
+                   font->driver->draw (s, j, i, x + 1, y, false);
                  x += width;
                }
              xoff = LGLYPH_XOFF (glyph);
              yoff = LGLYPH_YOFF (glyph);
              wadjust = LGLYPH_WADJUST (glyph);
-             font->driver->draw (s, i, i + 1, x + xoff, y + yoff, 0);
+             font->driver->draw (s, i, i + 1, x + xoff, y + yoff, false);
              if (s->face->overstrike)
-               font->driver->draw (s, i, i + 1, x + xoff + 1, y + yoff, 0);
+               font->driver->draw (s, i, i + 1, x + xoff + 1, y + yoff,
+                                   false);
              x += wadjust;
              j = i + 1;
              width = 0;
@@ -1240,9 +1241,9 @@ x_draw_composite_glyph_string_foreground (struct 
glyph_string *s)
        }
       if (j < i)
        {
-         font->driver->draw (s, j, i, x, y, 0);
+         font->driver->draw (s, j, i, x, y, false);
          if (s->face->overstrike)
-           font->driver->draw (s, j, i, x + 1, y, 0);
+           font->driver->draw (s, j, i, x + 1, y, false);
        }
     }
 }
@@ -1310,11 +1311,11 @@ x_draw_glyphless_glyph_string_foreground (struct 
glyph_string *s)
          s->font->driver->draw (s, 0, upper_len,
                                 x + glyph->slice.glyphless.upper_xoff,
                                 s->ybase + glyph->slice.glyphless.upper_yoff,
-                                0);
+                                false);
          s->font->driver->draw (s, upper_len, len,
                                 x + glyph->slice.glyphless.lower_xoff,
                                 s->ybase + glyph->slice.glyphless.lower_yoff,
-                                0);
+                                false);
        }
       if (glyph->u.glyphless.method != GLYPHLESS_DISPLAY_THIN_SPACE)
        XDrawRectangle (s->display, s->window, s->gc,
@@ -1781,7 +1782,7 @@ x_alloc_lighter_color (struct frame *f, Display *display, 
Colormap cmap,
          success_p = x_alloc_nearest_color (f, cmap, &new);
        }
       else
-       success_p = 1;
+       success_p = true;
       *pixel = new.pixel;
     }
 
@@ -1876,16 +1877,17 @@ x_setup_relief_colors (struct glyph_string *s)
 
 /* Draw a relief on frame F inside the rectangle given by LEFT_X,
    TOP_Y, RIGHT_X, and BOTTOM_Y.  WIDTH is the thickness of the relief
-   to draw, it must be >= 0.  RAISED_P non-zero means draw a raised
-   relief.  LEFT_P non-zero means draw a relief on the left side of
-   the rectangle.  RIGHT_P non-zero means draw a relief on the right
+   to draw, it must be >= 0.  RAISED_P means draw a raised
+   relief.  LEFT_P means draw a relief on the left side of
+   the rectangle.  RIGHT_P means draw a relief on the right
    side of the rectangle.  CLIP_RECT is the clipping rectangle to use
    when drawing.  */
 
 static void
 x_draw_relief_rect (struct frame *f,
-                   int left_x, int top_y, int right_x, int bottom_y, int width,
-                   int raised_p, int top_p, int bot_p, int left_p, int right_p,
+                   int left_x, int top_y, int right_x, int bottom_y,
+                   int width, bool raised_p, bool top_p, bool bot_p,
+                   bool left_p, bool right_p,
                    XRectangle *clip_rect)
 {
   Display *dpy = FRAME_X_DISPLAY (f);
@@ -1909,8 +1911,8 @@ x_draw_relief_rect (struct frame *f,
     {
       if (width == 1)
        XDrawLine (dpy, window, gc,
-                  left_x  + (left_p  ? 1 : 0), top_y,
-                  right_x + (right_p ? 0 : 1), top_y);
+                  left_x + left_p, top_y,
+                  right_x + !right_p, top_y);
 
       for (i = 1; i < width; ++i)
        XDrawLine (dpy, window, gc,
@@ -1945,8 +1947,8 @@ x_draw_relief_rect (struct frame *f,
       /* Outermost top line.  */
       if (top_p)
        XDrawLine (dpy, window, gc,
-                  left_x  + (left_p  ? 1 : 0), top_y,
-                  right_x + (right_p ? 0 : 1), top_y);
+                  left_x  + left_p, top_y,
+                  right_x + !right_p, top_y);
 
       /* Outermost left line.  */
       if (left_p)
@@ -1957,8 +1959,8 @@ x_draw_relief_rect (struct frame *f,
   if (bot_p)
     {
       XDrawLine (dpy, window, gc,
-                left_x  + (left_p  ? 1 : 0), bottom_y,
-                right_x + (right_p ? 0 : 1), bottom_y);
+                left_x + left_p, bottom_y,
+                right_x + !right_p, bottom_y);
       for (i = 1; i < width; ++i)
        XDrawLine (dpy, window, gc,
                   left_x  + i * left_p, bottom_y - i,
@@ -1982,15 +1984,15 @@ x_draw_relief_rect (struct frame *f,
 
 /* Draw a box on frame F inside the rectangle given by LEFT_X, TOP_Y,
    RIGHT_X, and BOTTOM_Y.  WIDTH is the thickness of the lines to
-   draw, it must be >= 0.  LEFT_P non-zero means draw a line on the
-   left side of the rectangle.  RIGHT_P non-zero means draw a line
+   draw, it must be >= 0.  LEFT_P means draw a line on the
+   left side of the rectangle.  RIGHT_P means draw a line
    on the right side of the rectangle.  CLIP_RECT is the clipping
    rectangle to use when drawing.  */
 
 static void
 x_draw_box_rect (struct glyph_string *s,
                 int left_x, int top_y, int right_x, int bottom_y, int width,
-                int left_p, int right_p, XRectangle *clip_rect)
+                bool left_p, bool right_p, XRectangle *clip_rect)
 {
   XGCValues xgcv;
 
@@ -2026,8 +2028,8 @@ x_draw_box_rect (struct glyph_string *s,
 static void
 x_draw_glyph_string_box (struct glyph_string *s)
 {
-  int width, left_x, right_x, top_y, bottom_y, last_x, raised_p;
-  int left_p, right_p;
+  int width, left_x, right_x, top_y, bottom_y, last_x;
+  bool raised_p, left_p, right_p;
   struct glyph *last_glyph;
   XRectangle clip_rect;
 
@@ -2067,7 +2069,8 @@ x_draw_glyph_string_box (struct glyph_string *s)
     {
       x_setup_relief_colors (s);
       x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y,
-                         width, raised_p, 1, 1, left_p, right_p, &clip_rect);
+                         width, raised_p, true, true, left_p, right_p,
+                         &clip_rect);
     }
 }
 
@@ -2166,7 +2169,8 @@ x_draw_image_foreground (struct glyph_string *s)
 static void
 x_draw_image_relief (struct glyph_string *s)
 {
-  int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p;
+  int x1, y1, thick;
+  bool raised_p, top_p, bot_p, left_p, right_p;
   int extra_x, extra_y;
   XRectangle r;
   int x = s->x;
@@ -2215,16 +2219,16 @@ x_draw_image_relief (struct glyph_string *s)
        extra_x = extra_y = XINT (Vtool_bar_button_margin);
     }
 
-  top_p = bot_p = left_p = right_p = 0;
+  top_p = bot_p = left_p = right_p = false;
 
   if (s->slice.x == 0)
-    x -= thick + extra_x, left_p = 1;
+    x -= thick + extra_x, left_p = true;
   if (s->slice.y == 0)
-    y -= thick + extra_y, top_p = 1;
+    y -= thick + extra_y, top_p = true;
   if (s->slice.x + s->slice.width == s->img->width)
-    x1 += thick + extra_x, right_p = 1;
+    x1 += thick + extra_x, right_p = true;
   if (s->slice.y + s->slice.height == s->img->height)
-    y1 += thick + extra_y, bot_p = 1;
+    y1 += thick + extra_y, bot_p = true;
 
   x_setup_relief_colors (s);
   get_glyph_string_clip_rect (s, &r);
@@ -2422,7 +2426,7 @@ x_draw_image_glyph_string (struct glyph_string *s)
          x_draw_glyph_string_bg_rect (s, x, y, width, height);
        }
 
-      s->background_filled_p = 1;
+      s->background_filled_p = true;
     }
 
   /* Draw the foreground.  */
@@ -2546,7 +2550,7 @@ x_draw_stretch_glyph_string (struct glyph_string *s)
        x_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height);
     }
 
-  s->background_filled_p = 1;
+  s->background_filled_p = true;
 }
 
 /*
@@ -2564,7 +2568,8 @@ static void
 x_draw_underwave (struct glyph_string *s)
 {
   int wave_height = 3, wave_length = 2;
-  int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax;
+  int dx, dy, x0, y0, width, x1, y1, x2, y2, xmax;
+  bool odd;
   XRectangle wave_clip, string_clip, final_clip;
 
   dx = wave_length;
@@ -2591,7 +2596,7 @@ x_draw_underwave (struct glyph_string *s)
 
   x1 = x0 - (x0 % dx);
   x2 = x1 + dx;
-  odd = (x1/dx) % 2;
+  odd = (x1 / dx) & 1;
   y1 = y2 = y0;
 
   if (odd)
@@ -2620,7 +2625,7 @@ x_draw_underwave (struct glyph_string *s)
 static void
 x_draw_glyph_string (struct glyph_string *s)
 {
-  bool relief_drawn_p = 0;
+  bool relief_drawn_p = false;
 
   /* If S draws into the background of its successors, draw the
      background of the successors first so that S can draw into it.
@@ -2640,7 +2645,7 @@ x_draw_glyph_string (struct glyph_string *s)
            if (next->first_glyph->type == STRETCH_GLYPH)
              x_draw_stretch_glyph_string (next);
            else
-             x_draw_glyph_string_background (next, 1);
+             x_draw_glyph_string_background (next, true);
            next->num_clips = 0;
          }
     }
@@ -2657,10 +2662,10 @@ x_draw_glyph_string (struct glyph_string *s)
 
     {
       x_set_glyph_string_clipping (s);
-      x_draw_glyph_string_background (s, 1);
+      x_draw_glyph_string_background (s, true);
       x_draw_glyph_string_box (s);
       x_set_glyph_string_clipping (s);
-      relief_drawn_p = 1;
+      relief_drawn_p = true;
     }
   else if (!s->clip_head /* draw_glyphs didn't specify a clip mask. */
           && !s->clip_tail
@@ -2685,26 +2690,26 @@ x_draw_glyph_string (struct glyph_string *s)
 
     case CHAR_GLYPH:
       if (s->for_overlaps)
-       s->background_filled_p = 1;
+       s->background_filled_p = true;
       else
-       x_draw_glyph_string_background (s, 0);
+       x_draw_glyph_string_background (s, false);
       x_draw_glyph_string_foreground (s);
       break;
 
     case COMPOSITE_GLYPH:
       if (s->for_overlaps || (s->cmp_from > 0
                              && ! s->first_glyph->u.cmp.automatic))
-       s->background_filled_p = 1;
+       s->background_filled_p = true;
       else
-       x_draw_glyph_string_background (s, 1);
+       x_draw_glyph_string_background (s, true);
       x_draw_composite_glyph_string_foreground (s);
       break;
 
     case GLYPHLESS_GLYPH:
       if (s->for_overlaps)
-       s->background_filled_p = 1;
+       s->background_filled_p = true;
       else
-       x_draw_glyph_string_background (s, 1);
+       x_draw_glyph_string_background (s, true);
       x_draw_glyphless_glyph_string_foreground (s);
       break;
 
@@ -2971,7 +2976,7 @@ x_show_hourglass (struct frame *f)
       if (FRAME_OUTER_WINDOW (f))
 #endif
        {
-         x->hourglass_p = 1;
+         x->hourglass_p = true;
 
          if (!x->hourglass_window)
            {
@@ -3009,7 +3014,7 @@ x_hide_hourglass (struct frame *f)
       /* Sync here because XTread_socket looks at the
         hourglass_p flag that is reset to zero below.  */
       XSync (FRAME_X_DISPLAY (f), False);
-      x->hourglass_p = 0;
+      x->hourglass_p = false;
     }
 }
 
@@ -3034,7 +3039,7 @@ XTflash (struct frame *f)
       cairo_rectangle (cr, x, y, w, h);        \
       cairo_fill (cr);                         \
     }                                          \
-    while (0)
+    while (false)
 #else /* ! HAVE_GTK3 */
     GdkGCValues vals;
     GdkGC *gc;
@@ -3157,7 +3162,7 @@ XTflash (struct frame *f)
 
 
 static void
-XTtoggle_invisible_pointer (struct frame *f, int invisible)
+XTtoggle_invisible_pointer (struct frame *f, bool invisible)
 {
   block_input ();
   FRAME_DISPLAY_INFO (f)->toggle_visible_pointer (f, invisible);
@@ -3277,7 +3282,7 @@ frame_highlight (struct frame *f)
                    f->output_data.x->border_pixel);
   x_uncatch_errors ();
   unblock_input ();
-  x_update_cursor (f, 1);
+  x_update_cursor (f, true);
   x_set_frame_alpha (f);
 }
 
@@ -3295,7 +3300,7 @@ frame_unhighlight (struct frame *f)
                          f->output_data.x->border_tile);
   x_uncatch_errors ();
   unblock_input ();
-  x_update_cursor (f, 1);
+  x_update_cursor (f, true);
   x_set_frame_alpha (f);
 }
 
@@ -3380,7 +3385,7 @@ x_focus_changed (int type, int state, struct 
x_display_info *dpyinfo, struct fra
         XUnsetICFocus (FRAME_XIC (frame));
 #endif
       if (frame->pointer_invisible)
-        XTtoggle_invisible_pointer (frame, 0);
+        XTtoggle_invisible_pointer (frame, false);
     }
 }
 
@@ -3693,11 +3698,11 @@ x_find_modifier_meanings (struct x_display_info 
*dpyinfo)
      Alt keysyms are on.  */
   {
     int row, col;      /* The row and column in the modifier table.  */
-    int found_alt_or_meta;
+    bool found_alt_or_meta;
 
     for (row = 3; row < 8; row++)
     {
-      found_alt_or_meta = 0;
+      found_alt_or_meta = false;
       for (col = 0; col < mods->max_keypermod; col++)
        {
          KeyCode code = mods->modifiermap[(row * mods->max_keypermod) + col];
@@ -3718,13 +3723,13 @@ x_find_modifier_meanings (struct x_display_info 
*dpyinfo)
                  {
                  case XK_Meta_L:
                  case XK_Meta_R:
-                   found_alt_or_meta = 1;
+                   found_alt_or_meta = true;
                    dpyinfo->meta_mod_mask |= (1 << row);
                    break;
 
                  case XK_Alt_L:
                  case XK_Alt_R:
-                   found_alt_or_meta = 1;
+                   found_alt_or_meta = true;
                    dpyinfo->alt_mod_mask |= (1 << row);
                    break;
 
@@ -3903,14 +3908,14 @@ construct_mouse_click (struct input_event *result,
    the mainstream emacs code by setting mouse_moved.  If not, ask for
    another motion event, so we can check again the next time it moves.  */
 
-static int
+static bool
 note_mouse_movement (struct frame *frame, const XMotionEvent *event)
 {
   XRectangle *r;
   struct x_display_info *dpyinfo;
 
   if (!FRAME_X_OUTPUT (frame))
-    return 0;
+    return false;
 
   dpyinfo = FRAME_DISPLAY_INFO (frame);
   dpyinfo->last_mouse_movement_time = event->time;
@@ -3920,11 +3925,11 @@ note_mouse_movement (struct frame *frame, const 
XMotionEvent *event)
 
   if (event->window != FRAME_X_WINDOW (frame))
     {
-      frame->mouse_moved = 1;
+      frame->mouse_moved = true;
       dpyinfo->last_mouse_scroll_bar = NULL;
       note_mouse_highlight (frame, -1, -1);
       dpyinfo->last_mouse_glyph_frame = NULL;
-      return 1;
+      return true;
     }
 
 
@@ -3934,16 +3939,16 @@ note_mouse_movement (struct frame *frame, const 
XMotionEvent *event)
       || event->x < r->x || event->x >= r->x + r->width
       || event->y < r->y || event->y >= r->y + r->height)
     {
-      frame->mouse_moved = 1;
+      frame->mouse_moved = true;
       dpyinfo->last_mouse_scroll_bar = NULL;
       note_mouse_highlight (frame, event->x, event->y);
       /* Remember which glyph we're now on.  */
       remember_mouse_glyph (frame, event->x, event->y, r);
       dpyinfo->last_mouse_glyph_frame = frame;
-      return 1;
+      return true;
     }
 
-  return 0;
+  return false;
 }
 
 /* Return the current position of the mouse.
@@ -3999,7 +4004,7 @@ XTmouse_position (struct frame **fp, int insist, 
Lisp_Object *bar_window,
       FOR_EACH_FRAME (tail, frame)
        if (FRAME_X_P (XFRAME (frame))
             && FRAME_X_DISPLAY (XFRAME (frame)) == FRAME_X_DISPLAY (*fp))
-         XFRAME (frame)->mouse_moved = 0;
+         XFRAME (frame)->mouse_moved = false;
 
       dpyinfo->last_mouse_scroll_bar = NULL;
 
@@ -4060,7 +4065,7 @@ XTmouse_position (struct frame **fp, int insist, 
Lisp_Object *bar_window,
          }
        else
          {
-           while (1)
+           while (true)
              {
                XTranslateCoordinates (FRAME_X_DISPLAY (*fp),
 
@@ -4284,7 +4289,7 @@ static void
 xt_action_hook (Widget widget, XtPointer client_data, String action_name,
                XEvent *event, String *params, Cardinal *num_params)
 {
-  int scroll_bar_p;
+  bool scroll_bar_p;
   const char *end_action;
 
 #ifdef USE_MOTIF
@@ -4303,7 +4308,7 @@ xt_action_hook (Widget widget, XtPointer client_data, 
String action_name,
       struct scroll_bar *bar;
 
       x_send_scroll_bar_event (window_being_scrolled,
-                              scroll_bar_end_scroll, 0, 0, 0);
+                              scroll_bar_end_scroll, 0, 0, false);
       w = XWINDOW (window_being_scrolled);
       bar = XSCROLL_BAR (w->vertical_scroll_bar);
 
@@ -4318,7 +4323,7 @@ xt_action_hook (Widget widget, XtPointer client_data, 
String action_name,
       bar->last_seen_part = scroll_bar_nowhere;
 #endif
       /* Xt timeouts no longer needed.  */
-      toolkit_scroll_bar_interaction = 0;
+      toolkit_scroll_bar_interaction = false;
     }
 }
 
@@ -4327,7 +4332,7 @@ static void
 xt_horizontal_action_hook (Widget widget, XtPointer client_data, String 
action_name,
                           XEvent *event, String *params, Cardinal *num_params)
 {
-  int scroll_bar_p;
+  bool scroll_bar_p;
   const char *end_action;
 
 #ifdef USE_MOTIF
@@ -4346,7 +4351,7 @@ xt_horizontal_action_hook (Widget widget, XtPointer 
client_data, String action_n
       struct scroll_bar *bar;
 
       x_send_scroll_bar_event (window_being_scrolled,
-                              scroll_bar_end_scroll, 0, 0, 1);
+                              scroll_bar_end_scroll, 0, 0, true);
       w = XWINDOW (window_being_scrolled);
       bar = XSCROLL_BAR (w->horizontal_scroll_bar);
 
@@ -4361,7 +4366,7 @@ xt_horizontal_action_hook (Widget widget, XtPointer 
client_data, String action_n
       bar->last_seen_part = scroll_bar_nowhere;
 #endif
       /* Xt timeouts no longer needed.  */
-      toolkit_scroll_bar_interaction = 0;
+      toolkit_scroll_bar_interaction = false;
     }
 }
 #endif /* not USE_GTK */
@@ -4408,7 +4413,7 @@ x_send_scroll_bar_event (Lisp_Object window, enum 
scroll_bar_part part,
 
   /* Make Xt timeouts work while the scroll bar is active.  */
 #ifdef USE_X_TOOLKIT
-  toolkit_scroll_bar_interaction = 1;
+  toolkit_scroll_bar_interaction = true;
   x_activate_timeout_atimer ();
 #endif
 
@@ -4507,7 +4512,8 @@ xm_scroll_callback (Widget widget, XtPointer client_data, 
XtPointer call_data)
   struct scroll_bar *bar = client_data;
   XmScrollBarCallbackStruct *cs = call_data;
   enum scroll_bar_part part = scroll_bar_nowhere;
-  int horizontal = bar->horizontal, whole = 0, portion = 0;
+  bool horizontal = bar->horizontal;
+  int whole = 0, portion = 0;
 
   switch (cs->reason)
     {
@@ -4574,7 +4580,8 @@ xm_scroll_callback (Widget widget, XtPointer client_data, 
XtPointer call_data)
   if (part != scroll_bar_nowhere)
     {
       window_being_scrolled = bar->window;
-      x_send_scroll_bar_event (bar->window, part, portion, whole, 
bar->horizontal);
+      x_send_scroll_bar_event (bar->window, part, portion, whole,
+                              bar->horizontal);
     }
 }
 
@@ -4647,7 +4654,8 @@ xg_scroll_callback (GtkRange     *range,
   if (part != scroll_bar_nowhere)
     {
       window_being_scrolled = bar->window;
-      x_send_scroll_bar_event (bar->window, part, portion, whole, 
bar->horizontal);
+      x_send_scroll_bar_event (bar->window, part, portion, whole,
+                              bar->horizontal);
     }
 
   return FALSE;
@@ -4689,7 +4697,7 @@ xaw_jump_callback (Widget widget, XtPointer client_data, 
XtPointer call_data)
   float shown;
   int whole, portion, height, width;
   enum scroll_bar_part part;
-  int horizontal = bar->horizontal;
+  bool horizontal = bar->horizontal;
 
 
   if (horizontal)
@@ -4777,7 +4785,8 @@ xaw_scroll_callback (Widget widget, XtPointer 
client_data, XtPointer call_data)
       window_being_scrolled = bar->window;
       bar->dragging = -1;
       bar->last_seen_part = part;
-      x_send_scroll_bar_event (bar->window, part, position, width, 
bar->horizontal);
+      x_send_scroll_bar_event (bar->window, part, position, width,
+                              bar->horizontal);
     }
   else
     {
@@ -4800,7 +4809,8 @@ xaw_scroll_callback (Widget widget, XtPointer 
client_data, XtPointer call_data)
       window_being_scrolled = bar->window;
       bar->dragging = -1;
       bar->last_seen_part = part;
-      x_send_scroll_bar_event (bar->window, part, position, height, 
bar->horizontal);
+      x_send_scroll_bar_event (bar->window, part, position, height,
+                              bar->horizontal);
     }
 }
 
@@ -5033,7 +5043,7 @@ x_create_toolkit_scroll_bar (struct frame *f, struct 
scroll_bar *bar)
   xwindow = XtWindow (widget);
   bar->x_window = xwindow;
   bar->whole = 1;
-  bar->horizontal = 0;
+  bar->horizontal = false;
 
   unblock_input ();
 }
@@ -5233,7 +5243,7 @@ x_create_horizontal_toolkit_scroll_bar (struct frame *f, 
struct scroll_bar *bar)
   xwindow = XtWindow (widget);
   bar->x_window = xwindow;
   bar->whole = 1;
-  bar->horizontal = 1;
+  bar->horizontal = true;
 
   unblock_input ();
 }
@@ -5408,7 +5418,7 @@ x_set_toolkit_horizontal_scroll_bar_thumb (struct 
scroll_bar *bar, int portion,
                   XtNheight, &height,
                   NULL);
 
-#if 0
+#if false
     /* Massage the top+shown values.  */
     if (bar->dragging == -1 || bar->last_seen_part == scroll_bar_down_arrow)
       top = max (0, min (1, top));
@@ -5431,7 +5441,7 @@ x_set_toolkit_horizontal_scroll_bar_thumb (struct 
scroll_bar *bar, int portion,
        work, check that 'NARROWPROTO' is defined in src/config.h.
        If this is not so, most likely you need to fix configure.  */
     XawScrollbarSetThumb (widget, top, shown);
-#if 0
+#if false
     if (top != old_top || shown != old_shown)
       {
        if (bar->dragging == -1)
@@ -5467,7 +5477,8 @@ x_set_toolkit_horizontal_scroll_bar_thumb (struct 
scroll_bar *bar, int portion,
    scroll bar. */
 
 static struct scroll_bar *
-x_scroll_bar_create (struct window *w, int top, int left, int width, int 
height, bool horizontal)
+x_scroll_bar_create (struct window *w, int top, int left,
+                    int width, int height, bool horizontal)
 {
   struct frame *f = XFRAME (w->frame);
   struct scroll_bar *bar
@@ -5570,7 +5581,7 @@ x_scroll_bar_create (struct window *w, int top, int left, 
int width, int height,
 /* Draw BAR's handle in the proper position.
 
    If the handle is already drawn from START to END, don't bother
-   redrawing it, unless REBUILD is non-zero; in that case, always
+   redrawing it, unless REBUILD; in that case, always
    redraw it.  (REBUILD is handy for drawing the handle after expose
    events.)
 
@@ -5581,7 +5592,8 @@ x_scroll_bar_create (struct window *w, int top, int left, 
int width, int height,
    to move to the very end of the buffer.  */
 
 static void
-x_scroll_bar_set_handle (struct scroll_bar *bar, int start, int end, int 
rebuild)
+x_scroll_bar_set_handle (struct scroll_bar *bar, int start, int end,
+                        bool rebuild)
 {
   bool dragging = bar->dragging != -1;
   Window w = bar->x_window;
@@ -5731,7 +5743,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, 
int whole, int positio
          unblock_input ();
        }
 
-      bar = x_scroll_bar_create (w, top, left, width, max (height, 1), 0);
+      bar = x_scroll_bar_create (w, top, left, width, max (height, 1), false);
     }
   else
     {
@@ -5805,12 +5817,12 @@ XTset_vertical_scroll_bar (struct window *w, int 
portion, int whole, int positio
       int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, height);
 
       if (whole == 0)
-       x_scroll_bar_set_handle (bar, 0, top_range, 0);
+       x_scroll_bar_set_handle (bar, 0, top_range, false);
       else
        {
          int start = ((double) position * top_range) / whole;
          int end = ((double) (position + portion) * top_range) / whole;
-         x_scroll_bar_set_handle (bar, start, end, 0);
+         x_scroll_bar_set_handle (bar, start, end, false);
        }
     }
 #endif /* not USE_TOOLKIT_SCROLL_BARS */
@@ -5851,7 +5863,7 @@ XTset_horizontal_scroll_bar (struct window *w, int 
portion, int whole, int posit
          unblock_input ();
        }
 
-      bar = x_scroll_bar_create (w, top, left, width, height, 1);
+      bar = x_scroll_bar_create (w, top, left, width, height, true);
     }
   else
     {
@@ -5937,12 +5949,12 @@ XTset_horizontal_scroll_bar (struct window *w, int 
portion, int whole, int posit
       int left_range = HORIZONTAL_SCROLL_BAR_LEFT_RANGE (f, width);
 
       if (whole == 0)
-       x_scroll_bar_set_handle (bar, 0, left_range, 0);
+       x_scroll_bar_set_handle (bar, 0, left_range, false);
       else
        {
          int start = ((double) position * left_range) / whole;
          int end = ((double) (position + portion) * left_range) / whole;
-         x_scroll_bar_set_handle (bar, start, end, 0);
+         x_scroll_bar_set_handle (bar, start, end, false);
        }
     }
 #endif /* not USE_TOOLKIT_SCROLL_BARS */
@@ -6116,7 +6128,7 @@ x_scroll_bar_expose (struct scroll_bar *bar, const XEvent 
*event)
 
   block_input ();
 
-  x_scroll_bar_set_handle (bar, bar->start, bar->end, 1);
+  x_scroll_bar_set_handle (bar, bar->start, bar->end, true);
 
   /* Switch to scroll bar foreground color.  */
   if (f->output_data.x->scroll_bar_foreground_pixel != -1)
@@ -6190,7 +6202,7 @@ x_scroll_bar_handle_click (struct scroll_bar *bar,
          int new_start = - bar->dragging;
          int new_end = new_start + bar->end - bar->start;
 
-         x_scroll_bar_set_handle (bar, new_start, new_end, 0);
+         x_scroll_bar_set_handle (bar, new_start, new_end, false);
          bar->dragging = -1;
        }
 #endif
@@ -6221,7 +6233,7 @@ x_scroll_bar_handle_click (struct scroll_bar *bar,
          int new_start = y - bar->dragging;
          int new_end = new_start + bar->end - bar->start;
 
-         x_scroll_bar_set_handle (bar, new_start, new_end, 0);
+         x_scroll_bar_set_handle (bar, new_start, new_end, false);
          bar->dragging = -1;
        }
 #endif
@@ -6247,7 +6259,7 @@ x_scroll_bar_note_movement (struct scroll_bar *bar,
 
   dpyinfo->last_mouse_movement_time = event->time;
   dpyinfo->last_mouse_scroll_bar = bar;
-  f->mouse_moved = 1;
+  f->mouse_moved = true;
 
   /* If we're dragging the bar, display it.  */
   if (bar->dragging != -1)
@@ -6259,7 +6271,7 @@ x_scroll_bar_note_movement (struct scroll_bar *bar,
        {
          int new_end = new_start + bar->end - bar->start;
 
-         x_scroll_bar_set_handle (bar, new_start, new_end, 0);
+         x_scroll_bar_set_handle (bar, new_start, new_end, false);
        }
     }
 }
@@ -6326,7 +6338,7 @@ x_scroll_bar_report_motion (struct frame **fp, 
Lisp_Object *bar_window,
       XSETINT (*x, win_y);
       XSETINT (*y, top_range);
 
-      f->mouse_moved = 0;
+      f->mouse_moved = false;
       dpyinfo->last_mouse_scroll_bar = NULL;
       *timestamp = dpyinfo->last_mouse_movement_time;
     }
@@ -6395,7 +6407,7 @@ x_horizontal_scroll_bar_report_motion (struct frame **fp, 
Lisp_Object *bar_windo
       XSETINT (*y, win_x);
       XSETINT (*x, left_range);
 
-      f->mouse_moved = 0;
+      f->mouse_moved = false;
       dpyinfo->last_mouse_scroll_bar = NULL;
       *timestamp = dpyinfo->last_mouse_movement_time;
     }
@@ -6551,9 +6563,9 @@ x_net_wm_state (struct frame *f, Window window)
 {
   int value = FULLSCREEN_NONE;
   Lisp_Object lval = Qnil;
-  int sticky = 0;
+  bool sticky = false;
 
-  (void)get_current_wm_state (f, window, &value, &sticky);
+  get_current_wm_state (f, window, &value, &sticky);
 
   switch (value)
     {
@@ -6636,7 +6648,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                 if (f && FRAME_XIC (f))
                   XSetICFocus (FRAME_XIC (f));
 #endif
-#if 0 /* Emacs sets WM hints whose `input' field is `true'.  This
+#if false
+      /* Emacs sets WM hints whose `input' field is `true'.  This
         instructs the WM to set the input focus automatically for
         Emacs with a call to XSetInputFocus.  Setting WM_TAKE_FOCUS
         tells the WM to send us a ClientMessage WM_TAKE_FOCUS after
@@ -6669,7 +6682,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                     x_uncatch_errors ();
                   }
                 /* Not certain about handling scroll bars here */
-#endif /* 0 */
+#endif
                goto done;
               }
 
@@ -6850,22 +6863,22 @@ handle_one_xevent (struct x_display_info *dpyinfo,
       f = x_top_window_to_frame (dpyinfo, event->xproperty.window);
       if (f && event->xproperty.atom == dpyinfo->Xatom_net_wm_state)
        {
-          int not_hidden = x_handle_net_wm_state (f, &event->xproperty);
+          bool not_hidden = x_handle_net_wm_state (f, &event->xproperty);
          if (not_hidden && FRAME_ICONIFIED_P (f))
            {
              /* Gnome shell does not iconify us when C-z is pressed.
                 It hides the frame.  So if our state says we aren't
                 hidden anymore, treat it as deiconified.  */
              SET_FRAME_VISIBLE (f, 1);
-             SET_FRAME_ICONIFIED (f, 0);
-             f->output_data.x->has_been_visible = 1;
+             SET_FRAME_ICONIFIED (f, false);
+             f->output_data.x->has_been_visible = true;
              inev.ie.kind = DEICONIFY_EVENT;
              XSETFRAME (inev.ie.frame_or_window, f);
            }
          else if (! not_hidden && ! FRAME_ICONIFIED_P (f))
            {
              SET_FRAME_VISIBLE (f, 0);
-             SET_FRAME_ICONIFIED (f, 1);
+             SET_FRAME_ICONIFIED (f, true);
              inev.ie.kind = ICONIFY_EVENT;
              XSETFRAME (inev.ie.frame_or_window, f);
            }
@@ -6897,8 +6910,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
           if (!FRAME_VISIBLE_P (f))
             {
               SET_FRAME_VISIBLE (f, 1);
-              SET_FRAME_ICONIFIED (f, 0);
-              f->output_data.x->has_been_visible = 1;
+              SET_FRAME_ICONIFIED (f, false);
+              f->output_data.x->has_been_visible = true;
               SET_FRAME_GARBAGED (f);
             }
           else
@@ -6993,7 +7006,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
              and that way, we know the window is not iconified now.  */
           if (visible || FRAME_ICONIFIED_P (f))
             {
-              SET_FRAME_ICONIFIED (f, 1);
+              SET_FRAME_ICONIFIED (f, true);
               inev.ie.kind = ICONIFY_EVENT;
               XSETFRAME (inev.ie.frame_or_window, f);
             }
@@ -7020,8 +7033,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
             x_check_fullscreen (f);
 
           SET_FRAME_VISIBLE (f, 1);
-          SET_FRAME_ICONIFIED (f, 0);
-          f->output_data.x->has_been_visible = 1;
+          SET_FRAME_ICONIFIED (f, false);
+          f->output_data.x->has_been_visible = true;
 
           if (iconified)
             {
@@ -7060,7 +7073,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
              || !EQ (f->tool_bar_window, hlinfo->mouse_face_window)))
         {
           clear_mouse_face (hlinfo);
-          hlinfo->mouse_face_hidden = 1;
+          hlinfo->mouse_face_hidden = true;
         }
 #endif
 
@@ -7321,8 +7334,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                   which depends on which X*LookupString function
                   we used just above and the locale.  */
                setup_coding_system (coding_system, &coding);
-               coding.src_multibyte = 0;
-               coding.dst_multibyte = 1;
+               coding.src_multibyte = false;
+               coding.dst_multibyte = true;
                /* The input is converted to events, thus we can't
                   handle composition.  Anyway, there's no XIM that
                   gives us composition information.  */
@@ -7454,7 +7467,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
         if (hlinfo->mouse_face_hidden)
           {
-            hlinfo->mouse_face_hidden = 0;
+            hlinfo->mouse_face_hidden = false;
             clear_mouse_face (hlinfo);
           }
 
@@ -7471,7 +7484,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
              {
                static Lisp_Object last_mouse_window;
                Lisp_Object window = window_from_coordinates
-                 (f, event->xmotion.x, event->xmotion.y, 0, 0);
+                 (f, event->xmotion.x, event->xmotion.y, 0, false);
 
                /* Window will be selected only when it is not selected now and
                   last mouse movement event was not in it.  Minibuffer window
@@ -7552,7 +7565,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
               || event->xconfigure.width != FRAME_PIXEL_WIDTH (f)
               || event->xconfigure.height != FRAME_PIXEL_HEIGHT (f))
             {
-              change_frame_size (f, width, height, 0, 1, 0, 1);
+              change_frame_size (f, width, height, false, true, false, true);
              x_clear_under_internal_border (f);
              SET_FRAME_GARBAGED (f);
               cancel_mouse_face (f);
@@ -7581,7 +7594,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
       {
         /* If we decide we want to generate an event to be seen
            by the rest of Emacs, we put it here.  */
-        bool tool_bar_p = 0;
+        bool tool_bar_p = false;
 
        memset (&compose_status, 0, sizeof (compose_status));
        dpyinfo->last_mouse_glyph_frame = NULL;
@@ -7605,7 +7618,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                 int x = event->xbutton.x;
                 int y = event->xbutton.y;
 
-                window = window_from_coordinates (f, x, y, 0, 1);
+                window = window_from_coordinates (f, x, y, 0, true);
                 tool_bar_p = EQ (window, f->tool_bar_window);
 
                 if (tool_bar_p && event->xbutton.button < 4)
@@ -7674,7 +7687,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
           any subsequent mouse-movement Emacs events should reflect
           only motion after the ButtonPress/Release.  */
        if (f != 0)
-         f->mouse_moved = 0;
+         f->mouse_moved = false;
 
 #if defined (USE_X_TOOLKIT) || defined (USE_GTK)
         f = x_menubar_window_to_frame (dpyinfo, event);
@@ -7766,7 +7779,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
       if (do_help > 0)
        {
-         any_help_event_p = 1;
+         any_help_event_p = true;
          gen_help_event (help_echo_string, frame, help_echo_window,
                          help_echo_object, help_echo_pos);
        }
@@ -7813,7 +7826,7 @@ static int
 XTread_socket (struct terminal *terminal, struct input_event *hold_quit)
 {
   int count = 0;
-  int event_found = 0;
+  bool event_found = false;
   struct x_display_info *dpyinfo = terminal->display_info.x;
 
   block_input ();
@@ -7838,7 +7851,7 @@ XTread_socket (struct terminal *terminal, struct 
input_event *hold_quit)
       if (x_filter_event (dpyinfo, &event))
         continue;
 #endif
-      event_found = 1;
+      event_found = true;
 
       count += handle_one_xevent (dpyinfo, &event, &finish, hold_quit);
 
@@ -8038,7 +8051,7 @@ x_draw_bar_cursor (struct window *w, struct glyph_row 
*row, int width, enum text
        xgcv.background = xgcv.foreground = face->foreground;
       else
        xgcv.background = xgcv.foreground = f->output_data.x->cursor_pixel;
-      xgcv.graphics_exposures = 0;
+      xgcv.graphics_exposures = False;
 
       if (gc)
        XChangeGC (dpy, gc, mask, &xgcv);
@@ -8134,14 +8147,14 @@ x_draw_window_cursor (struct window *w, struct 
glyph_row *glyph_row, int x,
   if (on_p)
     {
       w->phys_cursor_type = cursor_type;
-      w->phys_cursor_on_p = 1;
+      w->phys_cursor_on_p = true;
 
       if (glyph_row->exact_window_width_line_p
          && (glyph_row->reversed_p
              ? (w->phys_cursor.hpos < 0)
              : (w->phys_cursor.hpos >= glyph_row->used[TEXT_AREA])))
        {
-         glyph_row->cursor_in_fringe_p = 1;
+         glyph_row->cursor_in_fringe_p = true;
          draw_fringe_bitmap (w, glyph_row, glyph_row->reversed_p);
        }
       else
@@ -8188,13 +8201,13 @@ x_draw_window_cursor (struct window *w, struct 
glyph_row *glyph_row, int x,
 
 /* Make the x-window of frame F use the gnu icon bitmap.  */
 
-int
+bool
 x_bitmap_icon (struct frame *f, Lisp_Object file)
 {
   ptrdiff_t bitmap_id;
 
   if (FRAME_X_WINDOW (f) == 0)
-    return 1;
+    return true;
 
   /* Free up our existing icon bitmap and mask if any.  */
   if (f->output_data.x->icon_bitmap > 0)
@@ -8207,7 +8220,7 @@ x_bitmap_icon (struct frame *f, Lisp_Object file)
       /* Use gtk_window_set_icon_from_file () if available,
         It's not restricted to bitmaps */
       if (xg_set_icon (f, file))
-       return 0;
+       return false;
 #endif /* USE_GTK */
       bitmap_id = x_create_bitmap_from_file (f, file);
       x_create_bitmap_mask (f, bitmap_id);
@@ -8221,12 +8234,11 @@ x_bitmap_icon (struct frame *f, Lisp_Object file)
 
 #ifdef USE_GTK
 
-         if (FRAME_DISPLAY_INFO (f)->icon_bitmap_id == -2
-              || xg_set_icon (f, xg_default_icon_file)
+          if (xg_set_icon (f, xg_default_icon_file)
               || xg_set_icon_from_xpm_data (f, gnu_xpm_bits))
             {
               FRAME_DISPLAY_INFO (f)->icon_bitmap_id = -2;
-              return 0;
+              return false;
             }
 
 #elif defined (HAVE_XPM) && defined (HAVE_X_WINDOWS)
@@ -8243,7 +8255,7 @@ x_bitmap_icon (struct frame *f, Lisp_Object file)
              rc = x_create_bitmap_from_data (f, (char *) gnu_xbm_bits,
                                              gnu_xbm_width, gnu_xbm_height);
              if (rc == -1)
-               return 1;
+               return true;
 
              FRAME_DISPLAY_INFO (f)->icon_bitmap_id = rc;
              x_create_bitmap_mask (f, FRAME_DISPLAY_INFO (f)->icon_bitmap_id);
@@ -8262,18 +8274,18 @@ x_bitmap_icon (struct frame *f, Lisp_Object file)
   x_wm_set_icon_pixmap (f, bitmap_id);
   f->output_data.x->icon_bitmap = bitmap_id;
 
-  return 0;
+  return false;
 }
 
 
 /* Make the x-window of frame F use a rectangle with text.
    Use ICON_NAME as the text.  */
 
-int
+bool
 x_text_icon (struct frame *f, const char *icon_name)
 {
   if (FRAME_X_WINDOW (f) == 0)
-    return 1;
+    return true;
 
   {
     XTextProperty text;
@@ -8289,7 +8301,7 @@ x_text_icon (struct frame *f, const char *icon_name)
   f->output_data.x->icon_bitmap = 0;
   x_wm_set_icon_pixmap (f, 0);
 
-  return 0;
+  return false;
 }
 
 #define X_ERROR_MESSAGE_SIZE 200
@@ -8407,7 +8419,8 @@ x_clear_errors (Display *dpy)
   x_error_message->string[0] = 0;
 }
 
-#if 0 /* See comment in unwind_to_catch why calling this is a bad
+#if false
+      /* See comment in unwind_to_catch why calling this is a bad
        * idea.  --lorentey   */
 /* Close off all unclosed x_catch_errors calls.  */
 
@@ -8419,13 +8432,13 @@ x_fully_uncatch_errors (void)
 }
 #endif
 
-#if 0
+#if false
 static unsigned int x_wire_count;
 x_trace_wire (void)
 {
   fprintf (stderr, "Lib call: %d\n", ++x_wire_count);
 }
-#endif /* ! 0 */
+#endif
 
 
 /************************************************************************
@@ -8664,7 +8677,7 @@ x_new_font (struct frame *f, Lisp_Object font_object, int 
fontset)
       if (NILP (tip_frame) || XFRAME (tip_frame) != f)
          adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
                             FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3,
-                            0, Qfont);
+                            false, Qfont);
     }
 
 #ifdef HAVE_X_I18N
@@ -8954,7 +8967,7 @@ x_set_offset (struct frame *f, register int xoff, 
register int yoff, int change_
   x_calc_absolute_position (f);
 
   block_input ();
-  x_wm_set_size_hint (f, 0, 0);
+  x_wm_set_size_hint (f, 0, false);
 
   modified_left = f->left_pos;
   modified_top = f->top_pos;
@@ -8972,8 +8985,7 @@ x_set_offset (struct frame *f, register int xoff, 
register int yoff, int change_
                modified_left, modified_top);
 
   x_sync_with_move (f, f->left_pos, f->top_pos,
-                    FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN
-                    ? 1 : 0);
+                    FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN);
 
   /* change_gravity is non-zero when this function is called from Lisp to
      programmatically move a frame.  In that case, we call
@@ -8985,32 +8997,33 @@ x_set_offset (struct frame *f, register int xoff, 
register int yoff, int change_
      either the window manager type (A/B) is unknown or it is Type A but we
      need to compute the top/left offset adjustment for this frame.  */
 
-  if (change_gravity != 0 &&
-      (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN
-       || (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A
-           && (FRAME_X_OUTPUT (f)->move_offset_left == 0
-               && FRAME_X_OUTPUT (f)->move_offset_top == 0))))
+  if (change_gravity != 0
+      && (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN
+         || (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A
+             && (FRAME_X_OUTPUT (f)->move_offset_left == 0
+                 && FRAME_X_OUTPUT (f)->move_offset_top == 0))))
     x_check_expected_move (f, modified_left, modified_top);
 
   unblock_input ();
 }
 
-/* Return non-zero if _NET_SUPPORTING_WM_CHECK window exists and _NET_SUPPORTED
+/* Return true if _NET_SUPPORTING_WM_CHECK window exists and _NET_SUPPORTED
    on the root window for frame F contains ATOMNAME.
    This is how a WM check shall be done according to the Window Manager
    Specification/Extended Window Manager Hints at
    http://freedesktop.org/wiki/Specifications/wm-spec.  */
 
-static int
+static bool
 wm_supports (struct frame *f, Atom want_atom)
 {
   Atom actual_type;
   unsigned long actual_size, bytes_remaining;
   int i, rc, actual_format;
+  bool ret;
   Window wmcheck_window;
   struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
   Window target_window = dpyinfo->root_window;
-  long max_len = 65536;
+  int max_len = 65536;
   Display *dpy = FRAME_X_DISPLAY (f);
   unsigned char *tmp_data = NULL;
   Atom target_type = XA_WINDOW;
@@ -9029,7 +9042,7 @@ wm_supports (struct frame *f, Atom want_atom)
       if (tmp_data) XFree (tmp_data);
       x_uncatch_errors ();
       unblock_input ();
-      return 0;
+      return false;
     }
 
   wmcheck_window = *(Window *) tmp_data;
@@ -9042,7 +9055,7 @@ wm_supports (struct frame *f, Atom want_atom)
     {
       x_uncatch_errors ();
       unblock_input ();
-      return 0;
+      return false;
     }
 
   if (dpyinfo->net_supported_window != wmcheck_window)
@@ -9067,7 +9080,7 @@ wm_supports (struct frame *f, Atom want_atom)
           if (tmp_data) XFree (tmp_data);
           x_uncatch_errors ();
           unblock_input ();
-          return 0;
+          return false;
         }
 
       dpyinfo->net_supported_atoms = (Atom *)tmp_data;
@@ -9075,19 +9088,19 @@ wm_supports (struct frame *f, Atom want_atom)
       dpyinfo->net_supported_window = wmcheck_window;
     }
 
-  rc = 0;
+  ret = false;
 
-  for (i = 0; rc == 0 && i < dpyinfo->nr_net_supported_atoms; ++i)
-    rc = dpyinfo->net_supported_atoms[i] == want_atom;
+  for (i = 0; !ret && i < dpyinfo->nr_net_supported_atoms; ++i)
+    ret = dpyinfo->net_supported_atoms[i] == want_atom;
 
   x_uncatch_errors ();
   unblock_input ();
 
-  return rc;
+  return ret;
 }
 
 static void
-set_wm_state (Lisp_Object frame, int add, Atom atom, Atom value)
+set_wm_state (Lisp_Object frame, bool add, Atom atom, Atom value)
 {
   struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (XFRAME (frame));
 
@@ -9096,7 +9109,7 @@ set_wm_state (Lisp_Object frame, int add, Atom atom, Atom 
value)
                        make_number (32),
                        /* 1 = add, 0 = remove */
                        Fcons
-                       (make_number (add ? 1 : 0),
+                       (make_number (add),
                         Fcons
                         (make_fixnum_or_float (atom),
                          (value != 0
@@ -9112,32 +9125,33 @@ x_set_sticky (struct frame *f, Lisp_Object new_value, 
Lisp_Object old_value)
 
   XSETFRAME (frame, f);
 
-  set_wm_state (frame, NILP (new_value) ? 0 : 1,
+  set_wm_state (frame, !NILP (new_value),
                 dpyinfo->Xatom_net_wm_state_sticky, None);
 }
 
 /* Return the current _NET_WM_STATE.
    SIZE_STATE is set to one of the FULLSCREEN_* values.
-   STICKY is set to 1 if the sticky state is set, 0 if not.
+   Set *STICKY to the sticky state.
 
-   Return non-zero if we are not hidden, zero if we are.  */
+   Return true iff we are not hidden.  */
 
-static int
+static bool
 get_current_wm_state (struct frame *f,
                       Window window,
                       int *size_state,
-                      int *sticky)
+                      bool *sticky)
 {
   Atom actual_type;
   unsigned long actual_size, bytes_remaining;
-  int i, rc, actual_format, is_hidden = 0;
+  int i, rc, actual_format;
+  bool is_hidden = false;
   struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
   long max_len = 65536;
   Display *dpy = FRAME_X_DISPLAY (f);
   unsigned char *tmp_data = NULL;
   Atom target_type = XA_ATOM;
 
-  *sticky = 0;
+  *sticky = false;
   *size_state = FULLSCREEN_NONE;
 
   block_input ();
@@ -9161,9 +9175,7 @@ get_current_wm_state (struct frame *f,
     {
       Atom a = ((Atom*)tmp_data)[i];
       if (a == dpyinfo->Xatom_net_wm_state_hidden)
-        {
-          is_hidden = 1;
-        }
+       is_hidden = true;
       else if (a == dpyinfo->Xatom_net_wm_state_maximized_horz)
         {
           if (*size_state == FULLSCREEN_HEIGHT)
@@ -9181,7 +9193,7 @@ get_current_wm_state (struct frame *f,
       else if (a == dpyinfo->Xatom_net_wm_state_fullscreen)
         *size_state = FULLSCREEN_BOTH;
       else if (a == dpyinfo->Xatom_net_wm_state_sticky)
-        *sticky = 1;
+        *sticky = true;
     }
 
   if (tmp_data) XFree (tmp_data);
@@ -9191,14 +9203,15 @@ get_current_wm_state (struct frame *f,
 
 /* Do fullscreen as specified in extended window manager hints */
 
-static int
+static bool
 do_ewmh_fullscreen (struct frame *f)
 {
   struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
-  int have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state);
-  int cur, dummy;
+  bool have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state);
+  int cur;
+  bool dummy;
 
-  (void)get_current_wm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy);
+  get_current_wm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy);
 
   /* Some window managers don't say they support _NET_WM_STATE, but they do say
      they support _NET_WM_STATE_FULLSCREEN.  Try that also.  */
@@ -9219,37 +9232,45 @@ do_ewmh_fullscreen (struct frame *f)
         case FULLSCREEN_BOTH:
           if (cur == FULLSCREEN_WIDTH || cur == FULLSCREEN_MAXIMIZED
               || cur == FULLSCREEN_HEIGHT)
-            set_wm_state (frame, 0, dpyinfo->Xatom_net_wm_state_maximized_horz,
+            set_wm_state (frame, false,
+                         dpyinfo->Xatom_net_wm_state_maximized_horz,
                           dpyinfo->Xatom_net_wm_state_maximized_vert);
-          set_wm_state (frame, 1, dpyinfo->Xatom_net_wm_state_fullscreen, 
None);
+          set_wm_state (frame, true,
+                       dpyinfo->Xatom_net_wm_state_fullscreen, None);
           break;
         case FULLSCREEN_WIDTH:
           if (cur == FULLSCREEN_BOTH || cur == FULLSCREEN_HEIGHT
               || cur == FULLSCREEN_MAXIMIZED)
-            set_wm_state (frame, 0, dpyinfo->Xatom_net_wm_state_fullscreen,
+            set_wm_state (frame, false, dpyinfo->Xatom_net_wm_state_fullscreen,
                           dpyinfo->Xatom_net_wm_state_maximized_vert);
           if (cur != FULLSCREEN_MAXIMIZED)
-            set_wm_state (frame, 1, 
dpyinfo->Xatom_net_wm_state_maximized_horz, None);
+            set_wm_state (frame, true,
+                         dpyinfo->Xatom_net_wm_state_maximized_horz, None);
           break;
         case FULLSCREEN_HEIGHT:
           if (cur == FULLSCREEN_BOTH || cur == FULLSCREEN_WIDTH
               || cur == FULLSCREEN_MAXIMIZED)
-            set_wm_state (frame, 0, dpyinfo->Xatom_net_wm_state_fullscreen,
+            set_wm_state (frame, false, dpyinfo->Xatom_net_wm_state_fullscreen,
                           dpyinfo->Xatom_net_wm_state_maximized_horz);
           if (cur != FULLSCREEN_MAXIMIZED)
-            set_wm_state (frame, 1, 
dpyinfo->Xatom_net_wm_state_maximized_vert, None);
+            set_wm_state (frame, true,
+                         dpyinfo->Xatom_net_wm_state_maximized_vert, None);
           break;
         case FULLSCREEN_MAXIMIZED:
           if (cur == FULLSCREEN_BOTH)
-            set_wm_state (frame, 0, dpyinfo->Xatom_net_wm_state_fullscreen, 
None);
-          set_wm_state (frame, 1, dpyinfo->Xatom_net_wm_state_maximized_horz,
+            set_wm_state (frame, false, dpyinfo->Xatom_net_wm_state_fullscreen,
+                         None);
+          set_wm_state (frame, true,
+                       dpyinfo->Xatom_net_wm_state_maximized_horz,
                         dpyinfo->Xatom_net_wm_state_maximized_vert);
           break;
         case FULLSCREEN_NONE:
           if (cur == FULLSCREEN_BOTH)
-            set_wm_state (frame, 0, dpyinfo->Xatom_net_wm_state_fullscreen, 
None);
+            set_wm_state (frame, false, dpyinfo->Xatom_net_wm_state_fullscreen,
+                         None);
           else
-            set_wm_state (frame, 0, dpyinfo->Xatom_net_wm_state_maximized_horz,
+            set_wm_state (frame, false,
+                         dpyinfo->Xatom_net_wm_state_maximized_horz,
                           dpyinfo->Xatom_net_wm_state_maximized_vert);
         }
 
@@ -9273,13 +9294,13 @@ XTfullscreen_hook (struct frame *f)
 }
 
 
-static int
+static bool
 x_handle_net_wm_state (struct frame *f, const XPropertyEvent *event)
 {
   int value = FULLSCREEN_NONE;
   Lisp_Object lval;
-  int sticky = 0;
-  int not_hidden = get_current_wm_state (f, event->window, &value, &sticky);
+  bool sticky = false;
+  bool not_hidden = get_current_wm_state (f, event->window, &value, &sticky);
 
   lval = Qnil;
   switch (value)
@@ -9381,7 +9402,7 @@ x_check_expected_move (struct frame *f, int 
expected_left, int expected_top)
       XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
                    adjusted_left, adjusted_top);
 
-      x_sync_with_move (f, expected_left, expected_top, 0);
+      x_sync_with_move (f, expected_left, expected_top, false);
     }
   else
     /* It's a "Type B" window manager.  We don't have to adjust the
@@ -9398,7 +9419,7 @@ x_check_expected_move (struct frame *f, int 
expected_left, int expected_top)
    of an exact comparison.  */
 
 static void
-x_sync_with_move (struct frame *f, int left, int top, int fuzzy)
+x_sync_with_move (struct frame *f, int left, int top, bool fuzzy)
 {
   int count = 0;
 
@@ -9429,7 +9450,7 @@ x_sync_with_move (struct frame *f, int left, int top, int 
fuzzy)
   /* As a last resort, just wait 0.5 seconds and hope that XGetGeometry
      will then return up-to-date position info. */
 
-  wait_reading_process_output (0, 500000000, 0, 0, Qnil, NULL, 0);
+  wait_reading_process_output (0, 500000000, 0, false, Qnil, NULL, 0);
 }
 
 
@@ -9452,7 +9473,7 @@ x_wait_for_event (struct frame *f, int eventtype)
 
   while (f->wait_event_type)
     {
-      pending_signals = 1;
+      pending_signals = true;
       totally_unblock_input ();
       /* XTread_socket is called after unblock.  */
       block_input ();
@@ -9475,12 +9496,13 @@ x_wait_for_event (struct frame *f, int eventtype)
 
 
 /* Change the size of frame F's X window to WIDTH/HEIGHT in the case F
-   doesn't have a widget.  If CHANGE_GRAVITY is 1, we change to
+   doesn't have a widget.  If CHANGE_GRAVITY, change to
    top-left-corner window gravity for this size change and subsequent
-   size changes.  Otherwise we leave the window gravity unchanged.  */
+   size changes.  Otherwise leave the window gravity unchanged.  */
 
 static void
-x_set_window_size_1 (struct frame *f, int change_gravity, int width, int 
height, bool pixelwise)
+x_set_window_size_1 (struct frame *f, bool change_gravity,
+                    int width, int height, bool pixelwise)
 {
   int pixelwidth, pixelheight;
 
@@ -9492,7 +9514,7 @@ x_set_window_size_1 (struct frame *f, int change_gravity, 
int width, int height,
                  : FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height)));
 
   if (change_gravity) f->win_gravity = NorthWestGravity;
-  x_wm_set_size_hint (f, 0, 0);
+  x_wm_set_size_hint (f, 0, false);
   XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
                 pixelwidth, pixelheight + FRAME_MENUBAR_HEIGHT (f));
 
@@ -9514,7 +9536,7 @@ x_set_window_size_1 (struct frame *f, int change_gravity, 
int width, int height,
      wouldn't be reported in the frame parameters until some random
      point in the future when the ConfigureNotify event arrives.
 
-     We pass 1 for DELAY since we can't run Lisp code inside of
+     Pass true for DELAY since we can't run Lisp code inside of
      a BLOCK_INPUT.  */
 
   /* But the ConfigureNotify may in fact never arrive, and then this is
@@ -9524,25 +9546,26 @@ x_set_window_size_1 (struct frame *f, int 
change_gravity, int width, int height,
     x_wait_for_event (f, ConfigureNotify);
   else
     {
-      change_frame_size (f, pixelwidth, pixelheight, 0, 1, 0, 1);
+      change_frame_size (f, pixelwidth, pixelheight, false, true, false, true);
       x_sync (f);
     }
 }
 
 
 /* Call this to change the size of frame F's x-window.
-   If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity
+   If CHANGE_GRAVITY, change to top-left-corner window gravity
    for this size change and subsequent size changes.
    Otherwise we leave the window gravity unchanged.  */
 
 void
-x_set_window_size (struct frame *f, int change_gravity, int width, int height, 
bool pixelwise)
+x_set_window_size (struct frame *f, bool change_gravity,
+                  int width, int height, bool pixelwise)
 {
   block_input ();
 
   /* The following breaks our calculations.  If it's really needed,
      think of something else.  */
-#if 0
+#if false
   if (NILP (tip_frame) || XFRAME (tip_frame) != f)
     {
       int text_width, text_height;
@@ -9563,7 +9586,7 @@ x_set_window_size (struct frame *f, int change_gravity, 
int width, int height, b
       text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, FRAME_PIXEL_WIDTH (f));
       text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, pixelh);
 
-      change_frame_size (f, text_width, text_height, 0, 1, 0, 1);
+      change_frame_size (f, text_width, text_height, false, true, false, true);
     }
 #endif
 
@@ -9594,7 +9617,7 @@ x_set_window_size (struct frame *f, int change_gravity, 
int width, int height, b
 
   unblock_input ();
 
-  do_pending_window_change (0);
+  do_pending_window_change (false);
 }
 
 /* Move the mouse to position pixel PIX_X, PIX_Y relative to frame F.  */
@@ -9669,7 +9692,7 @@ x_ewmh_activate_frame (struct frame *f)
 }
 
 static void
-XTframe_raise_lower (struct frame *f, int raise_flag)
+XTframe_raise_lower (struct frame *f, bool raise_flag)
 {
   if (raise_flag)
     x_raise_frame (f);
@@ -9751,7 +9774,7 @@ x_make_frame_visible (struct frame *f)
          && ! f->output_data.x->asked_for_visible)
        x_set_offset (f, f->left_pos, f->top_pos, 0);
 
-      f->output_data.x->asked_for_visible = 1;
+      f->output_data.x->asked_for_visible = true;
 
       if (! EQ (Vx_no_window_manager, Qt))
        x_wm_set_window_state (f, NormalState);
@@ -9786,7 +9809,7 @@ x_make_frame_visible (struct frame *f)
     /* This must be before UNBLOCK_INPUT
        since events that arrive in response to the actions above
        will set it when they are handled.  */
-    int previously_visible = f->output_data.x->has_been_visible;
+    bool previously_visible = f->output_data.x->has_been_visible;
 
     original_left = f->left_pos;
     original_top = f->top_pos;
@@ -9901,7 +9924,7 @@ x_make_frame_invisible (struct frame *f)
      program-specified, so that when the window is mapped again, it will be
      placed at the same location, without forcing the user to position it
      by hand again (they have already done that once for this window.)  */
-  x_wm_set_size_hint (f, 0, 1);
+  x_wm_set_size_hint (f, 0, true);
 
 #ifdef USE_GTK
   if (FRAME_GTK_OUTER_WIDGET (f))
@@ -9928,7 +9951,7 @@ x_make_frame_invisible (struct frame *f)
      FRAME_SAMPLE_VISIBILITY set this.  So do it by hand,
      and synchronize with the server to make sure we agree.  */
   SET_FRAME_VISIBLE (f, 0);
-  SET_FRAME_ICONIFIED (f, 0);
+  SET_FRAME_ICONIFIED (f, false);
 
   x_sync (f);
 
@@ -9963,7 +9986,7 @@ x_iconify_frame (struct frame *f)
 
       gtk_window_iconify (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
       SET_FRAME_VISIBLE (f, 0);
-      SET_FRAME_ICONIFIED (f, 1);
+      SET_FRAME_ICONIFIED (f, true);
       unblock_input ();
       return;
     }
@@ -9981,7 +10004,7 @@ x_iconify_frame (struct frame *f)
         that an invisible frame was changed to an icon,
         so we have to record it here.  */
       SET_FRAME_VISIBLE (f, 0);
-      SET_FRAME_ICONIFIED (f, 1);
+      SET_FRAME_ICONIFIED (f, true);
       unblock_input ();
       return;
     }
@@ -9994,7 +10017,7 @@ x_iconify_frame (struct frame *f)
   if (!result)
     error ("Can't notify window manager of iconification");
 
-  SET_FRAME_ICONIFIED (f, 1);
+  SET_FRAME_ICONIFIED (f, true);
   SET_FRAME_VISIBLE (f, 0);
 
   block_input ();
@@ -10044,7 +10067,7 @@ x_iconify_frame (struct frame *f)
       XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
     }
 
-  SET_FRAME_ICONIFIED (f, 1);
+  SET_FRAME_ICONIFIED (f, true);
   SET_FRAME_VISIBLE (f, 0);
 
   XFlush (FRAME_X_DISPLAY (f));
@@ -10466,7 +10489,7 @@ static XrmOptionDescRec emacs_options[] = {
 
 /* Whether atimer for Xt timeouts is activated or not.  */
 
-static int x_timeout_atimer_activated_flag;
+static bool x_timeout_atimer_activated_flag;
 
 #endif /* USE_X_TOOLKIT */
 
@@ -10474,10 +10497,10 @@ static int x_initialized;
 
 /* Test whether two display-name strings agree up to the dot that separates
    the screen number from the server number.  */
-static int
+static bool
 same_x_server (const char *name1, const char *name2)
 {
-  int seen_colon = 0;
+  bool seen_colon = false;
   const char *system_name = SSDATA (Vsystem_name);
   ptrdiff_t system_name_length = SBYTES (Vsystem_name);
   ptrdiff_t length_until_period = 0;
@@ -10509,9 +10532,9 @@ same_x_server (const char *name1, const char *name2)
   for (; *name1 != '\0' && *name1 == *name2; name1++, name2++)
     {
       if (*name1 == ':')
-       seen_colon = 1;
+       seen_colon = true;
       if (seen_colon && *name1 == '.')
-       return 1;
+       return true;
     }
   return (seen_colon
          && (*name1 == '.' || *name1 == '\0')
@@ -10543,14 +10566,17 @@ get_bits_and_offset (unsigned long mask, int *bits, 
int *offset)
   *bits = nr;
 }
 
-/* Return 1 if display DISPLAY is available for use, 0 otherwise.
+/* Return true iff display DISPLAY is available for use.
    But don't permanently open it, just test its availability.  */
 
 bool
 x_display_ok (const char *display)
 {
   Display *dpy = XOpenDisplay (display);
-  return dpy ? (XCloseDisplay (dpy), 1) : 0;
+  if (!dpy)
+    return false;
+  XCloseDisplay (dpy);
+  return true;
 }
 
 #ifdef USE_GTK
@@ -10775,12 +10801,12 @@ x_term_init (Lisp_Object display_name, char 
*xrm_option, char *resource_name)
        argv[argc++] = "-xrm";
        argv[argc++] = xrm_option;
       }
-    turn_on_atimers (0);
+    turn_on_atimers (false);
     dpy = XtOpenDisplay (Xt_app_con, SSDATA (display_name),
                         resource_name, EMACS_CLASS,
                         emacs_options, XtNumber (emacs_options),
                         &argc, argv);
-    turn_on_atimers (1);
+    turn_on_atimers (true);
 
 #ifdef HAVE_X11XTR6
     /* I think this is to compensate for XtSetLanguageProc.  */
@@ -10863,9 +10889,9 @@ x_term_init (Lisp_Object display_name, char 
*xrm_option, char *resource_name)
   /* Set the name of the terminal. */
   terminal->name = xlispstrdup (display_name);
 
-#if 0
+#if false
   XSetAfterFunction (x_current_display, x_trace_wire);
-#endif /* ! 0 */
+#endif
 
   lim = min (PTRDIFF_MAX, SIZE_MAX) - sizeof "@";
   if (lim - SBYTES (Vinvocation_name) < SBYTES (Vsystem_name))
@@ -11231,7 +11257,7 @@ static void
 x_process_timeouts (struct atimer *timer)
 {
   block_input ();
-  x_timeout_atimer_activated_flag = 0;
+  x_timeout_atimer_activated_flag = false;
   if (toolkit_scroll_bar_interaction || popup_activated ())
     {
       while (XtAppPending (Xt_app_con) & XtIMTimer)
@@ -11258,7 +11284,7 @@ x_activate_timeout_atimer (void)
     {
       struct timespec interval = make_timespec (0, 100 * 1000 * 1000);
       start_atimer (ATIMER_RELATIVE, interval, x_process_timeouts, 0);
-      x_timeout_atimer_activated_flag = 1;
+      x_timeout_atimer_activated_flag = true;
     }
   unblock_input ();
 }
@@ -11338,7 +11364,7 @@ x_delete_terminal (struct terminal *terminal)
         don't destroy the database here in order to avoid the crash
         in the above situations for now, though that may cause memory
         leaks in other situations.  */
-#if 0
+#if false
 #ifdef HAVE_XRMSETDATABASE
       XrmSetDatabase (dpyinfo->display, NULL);
 #else
@@ -11430,7 +11456,7 @@ x_initialize (void)
   baud_rate = 19200;
 
   x_noop_count = 0;
-  any_help_event_p = 0;
+  any_help_event_p = false;
   ignore_next_mouse_click_timeout = 0;
 
 #ifdef USE_GTK
@@ -11502,7 +11528,7 @@ UNDERLINE_POSITION font properties, for example 7x13 on 
XFree prior
 to 4.1, set this to nil.  You can also use `underline-minimum-offset'
 to override the font's UNDERLINE_POSITION for small font display
 sizes.  */);
-  x_use_underline_position_properties = 1;
+  x_use_underline_position_properties = true;
 
   DEFVAR_BOOL ("x-underline-at-descent-line",
               x_underline_at_descent_line,
@@ -11510,7 +11536,7 @@ sizes.  */);
 A value of nil means to draw the underline according to the value of the
 variable `x-use-underline-position-properties', which is usually at the
 baseline level.  The default value is nil.  */);
-  x_underline_at_descent_line = 0;
+  x_underline_at_descent_line = false;
 
   DEFVAR_BOOL ("x-mouse-click-focus-ignore-position",
               x_mouse_click_focus_ignore_position,
@@ -11520,7 +11546,7 @@ click on a frame to select it (give it focus).  In that 
case, a value
 of nil, means that the selected window and cursor position changes to
 reflect the mouse click position, while a non-nil value means that the
 selected window or cursor position is preserved.  */);
-  x_mouse_click_focus_ignore_position = 0;
+  x_mouse_click_focus_ignore_position = false;
 
   DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars,
     doc: /* Which toolkit scroll bars Emacs uses, if any.
diff --git a/src/xterm.h b/src/xterm.h
index 23dd436..31c3261 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -834,7 +834,7 @@ struct scroll_bar
   int whole;
 #endif
 
-  /* 1 if the scroll bar is horizontal.  */
+  /* True if the scroll bar is horizontal.  */
   bool horizontal;
 };
 
@@ -979,7 +979,7 @@ XrmDatabase x_load_resources (Display *, const char *, 
const char *,
 
 /* Defined in xterm.c */
 
-extern int x_text_icon (struct frame *, const char *);
+extern bool x_text_icon (struct frame *, const char *);
 extern void x_catch_errors (Display *);
 extern void x_check_errors (Display *, const char *)
   ATTRIBUTE_FORMAT_PRINTF (2, 0);
diff --git a/test/ChangeLog b/test/ChangeLog
index 80d2a40..7d23b3e 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,6 +1,7 @@
 2014-12-19  Artur Malabarba  <address@hidden>
 
        * automated/let-alist.el: require `cl-lib'
+       New tests for accessing alists inside alists.
 
 2014-12-18  Artur Malabarba  <address@hidden>
 
diff --git a/test/automated/let-alist.el b/test/automated/let-alist.el
index a700a47..c43e6a0 100644
--- a/test/automated/let-alist.el
+++ b/test/automated/let-alist.el
@@ -30,10 +30,22 @@
                    (.test-two (cdr (assq 'test-two symbol))))
                (list .test-one .test-two
                      .test-two .test-two)))
-          (cl-letf (((symbol-function #'gensym) (lambda (x) 'symbol)))
+          (cl-letf (((symbol-function #'make-symbol) (lambda (x) 'symbol)))
             (macroexpand
              '(let-alist data (list .test-one .test-two
-                                    .test-two .test-two)))))))
+                                    .test-two .test-two))))))
+  (should
+   (equal
+    (let ((.external "ext")
+          (.external.too "et"))
+      (let-alist '((test-two . 0)
+                   (test-three . 1)
+                   (sublist . ((foo . 2)
+                               (bar . 3))))
+        (list .test-one .test-two .test-three
+              .sublist.foo .sublist.bar
+              ..external ..external.too)))
+    (list nil 0 1 2 3 "ext" "et"))))
 
 (defvar let-alist--test-counter 0
   "Used to count number of times a function is called.")
@@ -49,5 +61,17 @@
         (list .test-one .test-two .test-two .test-three .cl-incf))
       '(nil 1 1 2 nil)))))
 
+(ert-deftest let-alist-remove-dot ()
+  "Remove firt dot from symbol."
+  (should (equal (let-alist--remove-dot 'hi) 'hi))
+  (should (equal (let-alist--remove-dot '.hi) 'hi))
+  (should (equal (let-alist--remove-dot '..hi) '.hi)))
+
+(ert-deftest let-alist-list-to-sexp ()
+  "Check that multiple dots are handled correctly."
+  (should (= 1 (eval (let-alist--list-to-sexp '(a b c d) ''((d (c (b (a . 
1)))))))))
+  (should (equal (let-alist--access-sexp '.foo.bar.baz 'var)
+                 '(cdr (assq 'baz (cdr (assq 'bar (cdr (assq 'foo var))))))))
+  (should (equal (let-alist--access-sexp '..foo.bar.baz 'var) '.foo.bar.baz)))
 
 ;;; let-alist.el ends here
diff --git a/test/indent/js.js b/test/indent/js.js
index 1924094..2d458e1 100644
--- a/test/indent/js.js
+++ b/test/indent/js.js
@@ -7,6 +7,11 @@ let c = 1,
 var e = 100500,
     + 1;
 
+function test ()
+{
+     return /[/]/.test ('/')     // (bug#19397)
+}
+
 var f = bar('/protocols/')
 baz();
 



reply via email to

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