Merge from emacs-24; up to 2012-04-24T08:35:02Z!lekktu@gmail.com
authorGlenn Morris <rgm@gnu.org>
Sun, 27 May 2012 01:06:44 +0000 (18:06 -0700)
committerGlenn Morris <rgm@gnu.org>
Sun, 27 May 2012 01:06:44 +0000 (18:06 -0700)
32 files changed:
1  2 
doc/lispref/ChangeLog
doc/lispref/commands.texi
doc/lispref/compile.texi
doc/lispref/debugging.texi
doc/lispref/display.texi
doc/lispref/files.texi
doc/lispref/frames.texi
doc/lispref/functions.texi
doc/lispref/help.texi
doc/lispref/markers.texi
doc/lispref/minibuf.texi
doc/lispref/modes.texi
doc/lispref/os.texi
doc/lispref/package.texi
doc/lispref/processes.texi
doc/lispref/text.texi
doc/lispref/variables.texi
doc/lispref/windows.texi
doc/misc/ChangeLog
lisp/ChangeLog
lisp/gnus/ChangeLog
lisp/mail/sendmail.el
lisp/org/ChangeLog
nt/ChangeLog
nt/configure.bat
src/ChangeLog
src/callproc.c
src/lisp.h
src/msdos.c
src/ralloc.c
src/search.c
src/xdisp.c

diff --combined doc/lispref/ChangeLog
@@@ -1,27 -1,75 +1,85 @@@
 -2012-05-15  Chong Yidong  <cyd@gnu.org>
++2012-05-27  Chong Yidong  <cyd@gnu.org>
 -      * functions.texi (Obsolete Functions): Fix doc for
 -      set-advertised-calling-convention.
++      * functions.texi (Obsolete Functions):
++      Fix doc for set-advertised-calling-convention.
+       * modes.texi (Mode Help): Fix describe-mode.
+       * display.texi (Face Functions): Fix define-obsolete-face-alias.
+       * variables.texi (Variable Aliases): Fix make-obsolete-variable.
 -2012-05-15  Martin Rudalics  <rudalics@gmx.at>
++2012-05-27  Martin Rudalics  <rudalics@gmx.at>
 -      * commands.texi (Recursive Editing): recursive-edit is a
 -      command.
++      * commands.texi (Recursive Editing): recursive-edit is a command.
+       * compile.texi (Docs and Compilation):
+       byte-compile-dynamic-docstrings is an option.
+       * debugging.texi (Invoking the Debugger): debug is a command.
+       * display.texi (Progress): progress-reporter-update and
+       progress-reporter-force-update have VALUE argument optional.
+       (Animated Images): Use non-@code{nil} instead of non-nil.
 -      * files.texi (Format Conversion Round-Trip): Use non-@code{nil}
 -      instead of non-nil.
++      * files.texi (Format Conversion Round-Trip):
++      Use non-@code{nil} instead of non-nil.
+       * frames.texi (Creating Frames): make-frame is a command.
+       (Input Focus): select-frame is a command.
+       (Pointer Shape): void-text-area-pointer is an option.
 -      * help.texi (Describing Characters): read-kbd-macro is a
 -      command.
++      * help.texi (Describing Characters): read-kbd-macro is a command.
+       (Help Functions): describe-prefix-bindings is a command.
+       * markers.texi (Creating Markers): Both arguments of copy-marker
+       are optional.
+       * minibuf.texi (Reading File Names): Use @kbd instead of @code.
+       * modes.texi (Mode Line Variables): mode-line-remote and
+       mode-line-client are not options.
+       (Imenu): imenu-add-to-menubar is a command.
 -      (SMIE Indentation Helpers): Use non-@code{nil} instead of
 -      non-nil.
++      (SMIE Indentation Helpers): Use non-@code{nil} instead of non-nil.
+       * os.texi (Sound Output): play-sound-file is a command.
 -      * package.texi (Package Archives): Use @key{RET} instead of
 -      @kbd{RET}.
++      * package.texi (Package Archives): Use @key{RET} instead of @kbd{RET}.
 -      * processes.texi (Signals to Processes): Use @key{RET} instead
 -      of @code{RET}.
++      * processes.texi (Signals to Processes):
++      Use @key{RET} instead of @code{RET}.
+       (Signals to Processes): signal-process is a command.
 -      * text.texi (Clickable Text): Use @key{RET} instead of
 -      @kbd{RET}.
++      * text.texi (Clickable Text): Use @key{RET} instead of @kbd{RET}.
+       (Base 64): base64-encode-string is not a command while
+       base64-decode-region is.
+       * windows.texi (Switching Buffers): pop-to-buffer is a command.
 -2012-05-08  Glenn Morris  <rgm@gnu.org>
 +2012-05-12  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (MKDIR_P): New, set by configure.
 +      (mkinfodir): Use $MKDIR_P.
 +
 +2012-05-10  Glenn Morris  <rgm@gnu.org>
 +
 +      * loading.texi (Loading Non-ASCII): Replace the obsolete "unibyte: t"
 +      with "coding: raw-text".
 +      Concept of multibyte sessions no longer exists.
 +
 +      * files.texi (File Locks): Mention create-lockfiles option.
 +
 +2012-05-09  Glenn Morris  <rgm@gnu.org>
 +
 +      * vol1.texi, vol2.texi: Remove files.
 +      * elisp.texi: Add VOL1,2 conditionals equivalent to vol1,2.texi
 +      * two-volume.make: Use elisp.texi as input rather than vol1,2.texi.
  
        * Makefile.in (clean, mostlyclean): Add some more vol1/2 items.
  
        * two-volume.make (emacsdir): New.
        (tex): Add directory with emacsver.texi to TEXINPUTS.
  
 -2012-05-05  Glenn Morris  <rgm@gnu.org>
 -
        * minibuf.texi (Minibuffer History, Basic Completion):
        Tweak page breaks.
  
        (Sequencing, Conditionals, Signaling Errors, Handling Errors):
        Tweak page breaks.
  
 -2012-05-04  Glenn Morris  <rgm@gnu.org>
 +2012-05-08  Glenn Morris  <rgm@gnu.org>
  
 -      * lists.texi (List-related Predicates, List Variables):
 -      Tweak page-breaks.
 -      (Sets And Lists): Convert inforef to xref.
 +      * two.el: Remove; unused since creation of two-volume.make.
  
 -      * text.texi (Auto Filling): Don't mention Emacs 19.
 +      * vol1.texi, vol2.texi: No need to keep menus in these files.
  
 -      * commands.texi (Event Input Misc): Don't mention unread-command-char.
 -      * numbers.texi (Predicates on Numbers): Don't mention Emacs 18.
 +2012-05-05  Glenn Morris  <rgm@gnu.org>
  
        * objects.texi (Process Type, Overlay Type): Tweak page-breaks.
  
        (Lisp History): Convert inforef to xref.
        (Lisp History, Printing Notation, Version Info): Improve page-breaks.
  
 +      * text.texi (Auto Filling): Don't mention Emacs 19.
 +
 +      * commands.texi (Event Input Misc): Don't mention unread-command-char.
 +      * numbers.texi (Predicates on Numbers): Don't mention Emacs 18.
 +
        * elisp.texi (DATE): Forgot to change the month in 2012-04-21 change.
  
 -2012-05-01  Glenn Morris  <rgm@gnu.org>
 +      * lists.texi (List-related Predicates, List Variables):
 +      Tweak page-breaks.
 +      (Sets And Lists): Convert inforef to xref.
 +
 +2012-05-04  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (INFO_EXT, INFO_OPTS): New, set by configure.
 +      (info, infoclean): Use $INFO_EXT.
 +      ($(infodir)/elisp$(INFO_EXT)): Use $INFO_EXT and $INFO_OPT.
 +      * makefile.w32-in (INFO_EXT, INFO_OPTS): New.
 +      (info, maintainer-clean): Use $INFO_EXT.
 +      ($(infodir)/elisp$(INFO_EXT)): Use $INFO_EXT and $INFO_OPT.
 +
 +2012-05-04  Chong Yidong  <cyd@gnu.org>
 +
 +      * os.texi (Timers): Use defopt for timer-max-repeats.
 +
 +2012-05-03  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * os.texi (Time of Day): Do not limit current-time-string
 +      to years 1000..9999.
 +
 +2012-05-02  Chong Yidong  <cyd@gnu.org>
 +
 +      * display.texi (Font Lookup):
 +      * frames.texi (Pointer Shape):
 +      * processes.texi (Subprocess Creation): Use defopt for options.
 +
 +2012-05-02  Glenn Morris  <rgm@gnu.org>
  
        * elisp.texi (@copying):
        * intro.texi (Introduction): Only print VERSION in the TeX version.
  
 -2012-04-29  Chong Yidong  <cyd@gnu.org>
 +2012-05-02  Chong Yidong  <cyd@gnu.org>
  
        * text.texi (Change Hooks): Minor fix for after-change-functions.
  
 -2012-04-28  Glenn Morris  <rgm@gnu.org>
 +2012-05-02  Glenn Morris  <rgm@gnu.org>
  
        * package.texi (Packaging Basics):
        * loading.texi (Autoload):
        * files.texi (Magic File Names):
        Reword to remove/reduce some overly long/short lines.
  
 -2012-04-26  Glenn Morris  <rgm@gnu.org>
 +2012-04-27  Glenn Morris  <rgm@gnu.org>
  
        * elisp.texi, vol1.texi, vol2.texi: Some fixes for detailed menu.
        * modes.texi (Major Modes, Auto-Indentation):
        * buffers.texi (Buffers): Some fixes for menu descriptions.
  
 -2012-04-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 -
 +2012-04-27  Stefan Monnier  <monnier@iro.umontreal.ca>
        * functions.texi (Simple Lambda, Argument List):
        * eval.texi (Function Indirection): Avoid deprecated form.
  
 -2012-04-26  Glenn Morris  <rgm@gnu.org>
 +2012-04-27  Glenn Morris  <rgm@gnu.org>
  
        * book-spine.texi, elisp.texi, vol1.texi, vol2.texi:
        Add "et al." to authors.
        * symbols.texi, syntax.texi, text.texi, tips.texi, variables.texi:
        Use Texinfo recommended convention for quotes+punctuation.
  
 -2012-04-23  Chong Yidong  <cyd@gnu.org>
 +2012-04-27  Chong Yidong  <cyd@gnu.org>
  
        * keymaps.texi (Scanning Keymaps): Fix description of NO-REMAP arg
        to where-is-internal (Bug#10872).
  
 -2012-04-21  Glenn Morris  <rgm@gnu.org>
 +2012-04-27  Glenn Morris  <rgm@gnu.org>
  
        * macros.texi (Indenting Macros): Fix typo.
  
        * minibuf.texi (Intro to Minibuffers):
        Tweak discussion of resizing minibuffer window.
  
 +2012-04-26  Glenn Morris  <rgm@gnu.org>
 +
 +      * elisp-covers.texi, front-cover-1.texi: Remove files.
 +
 +      * tindex.pl: Remove file.
 +
 +      * makefile.w32-in (srcs):
 +      * Makefile.in (srcs): Remove back.texi (which is unused).
 +
 +2012-04-24  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * os.texi (Notifications): Extend possible notification hints.
 +      Add notifications-get-capabilities.
 +
  2012-04-20  Chong Yidong  <cyd@gnu.org>
  
        * processes.texi (Asynchronous Processes): Mention nil argument to
        * elisp.texi, vol1.texi, vol2.texi, minibuf.texi (Completion):
        Update "High-Level Completion" description.
  
 -2012-04-19  Glenn Morris  <rgm@gnu.org>
 -
        * minibuf.texi (Minibuffers):
        * elisp.texi, vol1.texi, vol2.texi: Fix minibuffer subsection order.
  
        (Minibuffer Misc): Mention minibuffer-message-timeout, and
        minibuffer-inactive-mode.
  
 -2012-04-18  Glenn Morris  <rgm@gnu.org>
 -
        * processes.texi (Serial Ports, Byte Packing, Bindat Spec)
        (Bindat Functions): Copyedits.
  
 -2012-04-18  Christopher Schmidt  <christopher@ch.ristopher.com>
 +2012-04-20  Christopher Schmidt  <christopher@ch.ristopher.com>
  
        * files.texi (Saving Buffers): Document `visit and `visit-save'
        values of require-final-newline.
  
 -2012-04-18  Glenn Morris  <rgm@gnu.org>
 +2012-04-20  Glenn Morris  <rgm@gnu.org>
  
        * processes.texi (Output from Processes, Filter Functions):
        Mention waiting-for-user-input-p.
        (Network): Add encrypted network overview paragraph.
        Cross-reference the Emacs-GnuTLS manual.  Use @acronym.
  
 -2012-04-17  Chong Yidong  <cyd@gnu.org>
 +2012-04-20  Chong Yidong  <cyd@gnu.org>
  
        * help.texi (Keys in Documentation): Mention :advertised-binding.
  
        * keymaps.texi (Menu Bar): Move most of the :advertised-binding
        description to help.texi.
  
 -2012-04-16  Glenn Morris  <rgm@gnu.org>
 +2012-04-20  Glenn Morris  <rgm@gnu.org>
  
        * processes.texi (Process Information, Input to Processes)
        (Signals to Processes, Output from Processes, Process Buffers)
        (Process Information): Fix typo.
        (Bindat Spec): Use Texinfo-recommended form of quote+punctuation.
  
 -2012-04-14  Glenn Morris  <rgm@gnu.org>
 +2012-04-15  Glenn Morris  <rgm@gnu.org>
  
        * anti.texi (Antinews): Copyedits.  Don't @dfn anything here.
        open-network-stream does exist in Emacs 23, but is simpler.
  
 -2012-04-13  Chong Yidong  <cyd@gnu.org>
 +2012-04-15  Chong Yidong  <cyd@gnu.org>
  
        * customize.texi (Custom Themes): Also document load-theme etc.
  
 -2012-04-12  Chong Yidong  <cyd@gnu.org>
 +2012-04-14  Chong Yidong  <cyd@gnu.org>
  
        * customize.texi (Applying Customizations):
        (Custom Themes): New nodes.
        * modes.texi (Defining Minor Modes, Defining Minor Modes):
        * os.texi (Startup Summary): Copyedits.
  
 -2012-04-12  Glenn Morris  <rgm@gnu.org>
 +2012-04-14  Glenn Morris  <rgm@gnu.org>
  
        * loading.texi (Loading Non-ASCII): "unibyte:" can also be at the end.
  
 -2012-04-10  Glenn Morris  <rgm@gnu.org>
 -
        * strings.texi (Case Tables):
        * objects.texi (General Escape Syntax):
        * keymaps.texi (Key Sequences): Use @acronym with "ASCII".
  
        * compile.texi (Compiler Errors): Add missing space in buffer name.
  
 -2012-04-08  Chong Yidong  <cyd@gnu.org>
 +2012-04-14  Chong Yidong  <cyd@gnu.org>
  
        * processes.texi (Query Before Exit): Remove obsolete function
        process-kill-without-query (Bug#11190).
  
 -2012-04-08  Glenn Morris  <rgm@gnu.org>
 +2012-04-14  Glenn Morris  <rgm@gnu.org>
  
        * files.texi, frames.texi, loading.texi, os.texi, processes.texi:
        Use @env for environment variables.
  
 -2012-04-07  Glenn Morris  <rgm@gnu.org>
 -
        * Makefile.in: Replace non-portable use of $< in ordinary rules.
  
 +2012-04-12  Jari Aalto  <jari.aalto@cante.net>
 +
 +      * processes.texi (Synchronous Processes): Mention
 +      `default-directory' (bug#7515).
 +
 +2012-04-09  Chong Yidong  <cyd@gnu.org>
 +
 +      * customize.texi (Variable Definitions): Remove user-variable-p.
 +
 +      * commands.texi (Interactive Codes):
 +      * help.texi (Accessing Documentation):
 +      * minibuf.texi (High-Level Completion): Callers changed.
 +
  2012-04-06  Chong Yidong  <cyd@gnu.org>
  
        * minibuf.texi (Programmed Completion): Document metadata method.
  ;; coding: utf-8
  ;; End:
  
 -  Copyright (C) 1998-2012  Free Software Foundation, Inc.
 +  Copyright (C) 1998-2012 Free Software Foundation, Inc.
  
    This file is part of GNU Emacs.
  
@@@ -2,6 -2,7 +2,6 @@@
  @c This is part of the GNU Emacs Lisp Reference Manual.
  @c Copyright (C) 1990-1995, 1998-1999, 2001-2012 Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/commands
  @node Command Loop, Keymaps, Minibuffers, Top
  @chapter Command Loop
  @cindex editor command loop
@@@ -481,7 -482,7 +481,7 @@@ discarded, @samp{U} provides @code{nil
  
  @item v
  A variable declared to be a user option (i.e., satisfying the
 -predicate @code{user-variable-p}).  This reads the variable using
 +predicate @code{custom-variable-p}).  This reads the variable using
  @code{read-variable}.  @xref{Definition of read-variable}.  Existing,
  Completion, Prompt.
  
@@@ -3210,7 -3211,7 +3210,7 @@@ a recursive edit but also provides the 
    Recursive editing levels are also used when you type @kbd{C-r} in
  @code{query-replace} or use @kbd{C-x q} (@code{kbd-macro-query}).
  
- @defun recursive-edit
+ @deffn Command recursive-edit
  @cindex suspend evaluation
  This function invokes the editor command loop.  It is called
  automatically by the initialization of Emacs, to let the user begin
@@@ -3237,7 -3238,7 +3237,7 @@@ then type @kbd{C-M-c} to exit and conti
  (simple-rec)
       @result{} nil
  @end example
- @end defun
+ @end deffn
  
  @deffn Command exit-recursive-edit
  This function exits from the innermost recursive edit (including
diff --combined doc/lispref/compile.texi
@@@ -2,6 -2,7 +2,6 @@@
  @c This is part of the GNU Emacs Lisp Reference Manual.
  @c Copyright (C) 1990-1994, 2001-2012 Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/compile
  @node Byte Compilation, Advising Functions, Loading, Top
  @chapter Byte Compilation
  @cindex byte compilation
@@@ -290,10 -291,10 +290,10 @@@ is by adding this string to the file's 
  -*-byte-compile-dynamic-docstrings: nil;-*-
  @end example
  
- @defvar byte-compile-dynamic-docstrings
+ @defopt byte-compile-dynamic-docstrings
  If this is non-@code{nil}, the byte compiler generates compiled files
  that are set up for dynamic loading of documentation strings.
- @end defvar
+ @end defopt
  
  @node Dynamic Loading
  @section Dynamic Loading of Individual Functions
@@@ -2,6 -2,7 +2,6 @@@
  @c This is part of the GNU Emacs Lisp Reference Manual.
  @c Copyright (C) 1990-1994, 1998-1999, 2001-2012 Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/debugging
  @node Debugging, Read and Print, Advising Functions, Top
  @chapter Debugging Lisp Programs
  
@@@ -447,7 -448,7 +447,7 @@@ erroneously show up in this list
    Here we describe in full detail the function @code{debug} that is used
  to invoke the debugger.
  
- @defun debug &rest debugger-args
+ @deffn Command debug &rest debugger-args
  This function enters the debugger.  It switches buffers to a buffer
  named @file{*Backtrace*} (or @file{*Backtrace*<2>} if it is the second
  recursive entry to the debugger, etc.), and fills it with information
@@@ -534,7 -535,7 +534,7 @@@ are printed on the top line of the buff
  display messages---for example, to remind yourself of the conditions
  under which @code{debug} is called.
  @end table
- @end defun
+ @end deffn
  
  @node Internals of Debugger
  @subsection Internals of the Debugger
diff --combined doc/lispref/display.texi
@@@ -2,6 -2,7 +2,6 @@@
  @c This is part of the GNU Emacs Lisp Reference Manual.
  @c Copyright (C) 1990-1995, 1998-2012 Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/display
  @node Display, System Interface, Processes, Top
  @chapter Emacs Display
  
@@@ -413,7 -414,7 +413,7 @@@ This function calls @code{progress-repo
  message is printed immediately.
  @end defun
  
- @defun progress-reporter-update reporter value
+ @defun progress-reporter-update reporter &optional value
  This function does the main work of reporting progress of your
  operation.  It displays the message of @var{reporter}, followed by
  progress percentage determined by @var{value}.  If percentage is zero,
@@@ -434,7 -435,7 +434,7 @@@ try to reduce the number of calls to it
  likely negate your effort.
  @end defun
  
- @defun progress-reporter-force-update reporter value &optional new-message
+ @defun progress-reporter-force-update reporter &optional value new-message
  This function is similar to @code{progress-reporter-update} except
  that it prints a message in the echo area unconditionally.
  
@@@ -2662,11 -2663,13 +2662,13 @@@ makes @code{modeline} an alias for the 
  (put 'modeline 'face-alias 'mode-line)
  @end example
  
- @defun define-obsolete-face-alias obsolete-face current-face &optional when
- This function defines a face alias and marks it as obsolete, indicating
- that it may be removed in future.  The optional string @var{when}
- indicates when the face was made obsolete (for example, a release number).
- @end defun
+ @defmac define-obsolete-face-alias obsolete-face current-face when
+ This macro defines @code{obsolete-face} as an alias for
+ @var{current-face}, and also marks it as obsolete, indicating that it
+ may be removed in future.  @var{when} should be a string indicating
+ when @code{obsolete-face} was made obsolete (usually a version number
+ string).
+ @end defmac
  
  @node Auto Faces
  @subsection Automatic Face Assignment
@@@ -2923,13 -2926,13 +2925,13 @@@ The last three elements give additiona
  encoding of the font.
  @end defun
  
 -@defvar font-list-limit
 +@defopt font-list-limit
  This variable specifies maximum number of fonts to consider in font
 -matching.  The function @code{x-family-fonts} will not return more than
 -that many fonts, and font selection will consider only that many fonts
 -when searching a matching font for face attributes.  The default is
 -currently 100.
 -@end defvar
 +matching.  The function @code{x-family-fonts} will not return more
 +than that many fonts, and font selection will consider only that many
 +fonts when searching a matching font for face attributes.  The default
 +is 100.
 +@end defopt
  
  @node Fontsets
  @subsection Fontsets
@@@ -4904,7 -4907,7 +4906,7 @@@ create animation.  Currently, Emacs onl
  The following functions related to animated images are available.
  
  @defun image-animated-p image
- This function returns non-nil if @var{image} can be animated.
+ This function returns non-@code{nil} if @var{image} can be animated.
  The actual return value is a cons @code{(@var{nimages} . @var{delay})}, 
  where @var{nimages} is the number of frames and @var{delay} is the
  delay in seconds between them.
diff --combined doc/lispref/files.texi
@@@ -3,6 -3,7 +3,6 @@@
  @c Copyright (C) 1990-1995, 1998-1999, 2001-2012
  @c   Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/files
  @node Files, Backups and Auto-Saving, Documentation, Top
  @comment  node-name,  next,  previous,  up
  @chapter Files
@@@ -726,12 -727,7 +726,12 @@@ system does not support locking
  
    File locking is not supported on some systems.  On systems that do not
  support it, the functions @code{lock-buffer}, @code{unlock-buffer} and
 -@code{file-locked-p} do nothing and return @code{nil}.
 +@code{file-locked-p} do nothing and return @code{nil}.  It is also
 +possible to disable locking, by setting the variable @code{create-lockfiles}.
 +
 +@defopt create-lockfiles
 +If this variable is @code{nil}, Emacs does not lock files.
 +@end defopt
  
  @defun ask-user-about-lock file other-user
  This function is called when the user tries to modify @var{file}, but it
@@@ -3133,10 -3129,10 +3133,10 @@@ in the order of appearance in the list
  This command writes the current buffer contents into the file @var{file}
  in a format based on @var{format}, which is a list of format names.  It
  constructs the actual format starting from @var{format}, then appending
- any elements from the value of @code{buffer-file-format} with a non-nil
- @var{preserve} flag (see above), if they are not already present in
- @var{format}.  It then updates @code{buffer-file-format} with this
- format, making it the default for future saves.  Except for the
+ any elements from the value of @code{buffer-file-format} with a
+ non-@code{nil} @var{preserve} flag (see above), if they are not already
+ present in @var{format}.  It then updates @code{buffer-file-format} with
this format, making it the default for future saves.  Except for the
  @var{format} argument, this command is similar to @code{write-file}.  In
  particular, @var{confirm} has the same meaning and interactive treatment
  as the corresponding argument to @code{write-file}.  @xref{Definition of
diff --combined doc/lispref/frames.texi
@@@ -2,6 -2,7 +2,6 @@@
  @c This is part of the GNU Emacs Lisp Reference Manual.
  @c Copyright (C) 1990-1995, 1998-1999, 2001-2012 Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/frames
  @node Frames, Positions, Windows, Top
  @chapter Frames
  @cindex frame
@@@ -108,7 -109,7 +108,7 @@@ for @code{framep} above
  
  To create a new frame, call the function @code{make-frame}.
  
- @defun make-frame &optional alist
+ @deffn Command make-frame &optional alist
  This function creates and returns a new frame, displaying the current
  buffer.
  
@@@ -134,7 -135,7 +134,7 @@@ This function itself does not make the 
  @xref{Input Focus}.  The previously selected frame remains selected.
  On graphical terminals, however, the windowing system may select the
  new frame for its own reasons.
- @end defun
+ @end deffn
  
  @defvar before-make-frame-hook
  A normal hook run by @code{make-frame} before it creates the frame.
@@@ -1395,7 -1396,7 +1395,7 @@@ same meaning as for @code{select-frame
  of this function is not significant.
  @end defun
  
- @defun select-frame frame &optional norecord
+ @deffn Command select-frame frame &optional norecord
  This function selects frame @var{frame}, temporarily disregarding the
  focus of the X server if any.  The selection of @var{frame} lasts until
  the next time the user does something to select a different frame, or
@@@ -1418,7 -1419,7 +1418,7 @@@ been deleted
  In general, you should never use @code{select-frame} in a way that
  could switch to a different terminal without switching back when
  you're done.
- @end defun
+ @end deffn
  
  Emacs cooperates with the window system by arranging to select frames as
  the server and window manager request.  It does so by generating a
@@@ -3,6 -3,7 +3,6 @@@
  @c Copyright (C) 1990-1995, 1998-1999, 2001-2012
  @c   Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/functions
  @node Functions, Macros, Variables, Top
  @chapter Functions
  
@@@ -1178,12 -1179,14 +1178,14 @@@ equivalent to the following
  In addition, you can mark a certain a particular calling convention
  for a function as obsolete:
  
- @defun set-advertised-calling-convention function signature
+ @defun set-advertised-calling-convention function signature when
  This function specifies the argument list @var{signature} as the
  correct way to call @var{function}.  This causes the Emacs byte
  compiler to issue a warning whenever it comes across an Emacs Lisp
  program that calls @var{function} any other way (however, it will
- still allow the code to be byte compiled).
+ still allow the code to be byte compiled).  @var{when} should be a
+ string indicating when the variable was first made obsolete (usually a
+ version number string).
  
  For instance, in old versions of Emacs the @code{sit-for} function
  accepted three arguments, like this
@@@ -1198,7 -1201,7 +1200,7 @@@ this
  
  @example
  (set-advertised-calling-convention
-   'sit-for '(seconds &optional nodisp))
+   'sit-for '(seconds &optional nodisp) "22.1")
  @end example
  @end defun
  
diff --combined doc/lispref/help.texi
@@@ -3,6 -3,7 +3,6 @@@
  @c Copyright (C) 1990-1995, 1998-1999, 2001-2012
  @c   Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/help
  @node Documentation, Files, Modes, Top
  @chapter Documentation
  @cindex documentation strings
@@@ -217,7 -218,7 +217,7 @@@ in the `*Help*' buffer.
  @group
                  (princ
                   (format "%s\t%s\n%s\n\n" s
 -                   (if (user-variable-p s)
 +                   (if (custom-variable-p s)
                         "Option " "Variable")
  @end group
  @group
@@@ -511,7 -512,7 +511,7 @@@ for Meta
  @end smallexample
  @end defun
  
- @defun read-kbd-macro string &optional need-vector
+ @deffn Command read-kbd-macro string &optional need-vector
  This function is used mainly for operating on keyboard macros, but it
  can also be used as a rough inverse for @code{key-description}.  You
  call it with a string containing key descriptions, separated by spaces;
@@@ -519,7 -520,7 +519,7 @@@ it returns a string or vector containin
  (This may or may not be a single valid key sequence, depending on what
  events you use; @pxref{Key Sequences}.)  If @var{need-vector} is
  non-@code{nil}, the return value is always a vector.
- @end defun
+ @end deffn
  
  @node Help Functions
  @section Help Functions
@@@ -626,12 -627,12 +626,12 @@@ character, and the help character has n
  variable's default value is @code{describe-prefix-bindings}.
  @end defvar
  
- @defun describe-prefix-bindings
+ @deffn Command describe-prefix-bindings
  This function calls @code{describe-bindings} to display a list of all
  the subcommands of the prefix key of the most recent key sequence.  The
  prefix described consists of all but the last event of that key
  sequence.  (The last event is, presumably, the help character.)
- @end defun
+ @end deffn
  
    The following two functions are meant for modes that want to provide
  help without relinquishing control, such as the ``electric'' modes.
diff --combined doc/lispref/markers.texi
@@@ -2,6 -2,7 +2,6 @@@
  @c This is part of the GNU Emacs Lisp Reference Manual.
  @c Copyright (C) 1990-1995, 1998-1999, 2001-2012 Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/markers
  @node Markers, Text, Positions, Top
  @chapter Markers
  @cindex markers
@@@ -205,7 -206,7 +205,7 @@@ chapter
  @end example
  @end defun
  
- @defun copy-marker marker-or-integer &optional insertion-type
+ @defun copy-marker &optional marker-or-integer insertion-type
  If passed a marker as its argument, @code{copy-marker} returns a
  new marker that points to the same place and the same buffer as does
  @var{marker-or-integer}.  If passed an integer as its argument,
diff --combined doc/lispref/minibuf.texi
@@@ -3,6 -3,7 +3,6 @@@
  @c Copyright (C) 1990-1995, 1998-1999, 2001-2012
  @c   Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/minibuf
  @node Minibuffers, Command Loop, Read and Print, Top
  @chapter Minibuffers
  @cindex arguments, reading
@@@ -1282,11 -1283,10 +1282,11 @@@ complete in the set of extant Lisp symb
  
  @defun read-variable prompt &optional default
  @anchor{Definition of read-variable}
 -This function reads the name of a user variable and returns it as a
 -symbol.  Its arguments have the same form as those of @code{read-command}.
 -In general, this function is similar to @code{read-command}, but uses
 -the predicate @code{user-variable-p} instead of @code{commandp}.
 +This function reads the name of a customizable variable and returns it
 +as a symbol.  Its arguments have the same form as those of
 +@code{read-command}.  It behaves just like @code{read-command}, except
 +that it uses the predicate @code{custom-variable-p} instead of
 +@code{commandp}.
  @end defun
  
  @deffn Command read-color &optional prompt convert allow-empty display
@@@ -1404,7 -1404,7 +1404,7 @@@ returns the pre-inserted contents of th
  If the user types @key{RET} in an empty minibuffer, this function
  returns an empty string, regardless of the value of
  @var{require-match}.  This is, for instance, how the user can make the
- current buffer visit no file using @code{M-x set-visited-file-name}.
+ current buffer visit no file using @kbd{M-x set-visited-file-name}.
  
  If @var{predicate} is non-@code{nil}, it specifies a function of one
  argument that decides which file names are acceptable completion
diff --combined doc/lispref/modes.texi
@@@ -2,6 -2,7 +2,6 @@@
  @c This is part of the GNU Emacs Lisp Reference Manual.
  @c Copyright (C) 1990-1995, 1998-1999, 2001-2012 Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/modes
  @node Modes, Documentation, Keymaps, Top
  @chapter Major and Minor Modes
  @cindex mode
@@@ -734,13 -735,15 +734,15 @@@ modes.  It is normally bound to @kbd{C-
  variable @code{major-mode} (@pxref{Major Modes}), which is why every
  major mode command needs to set that variable.
  
- @deffn Command describe-mode
- This function displays the documentation of the current major mode.
- The @code{describe-mode} function calls the @code{documentation}
- function using the value of @code{major-mode} as an argument.  Thus, it
- displays the documentation string of the major mode command.
- (@xref{Accessing Documentation}.)
+ @deffn Command describe-mode &optional buffer
+ This command displays the documentation of the current buffer's major
+ mode and minor modes.  It uses the @code{documentation} function to
+ retrieve the documentation strings of the major and minor mode
+ commands (@pxref{Accessing Documentation}).
+ If called from Lisp with a non-nil @var{buffer} argument, this
+ function displays the documentation for that buffer's major and minor
+ modes, rather than those of the current buffer.
  @end deffn
  
  @node Derived Modes
@@@ -1990,14 -1993,14 +1992,14 @@@ default value also displays the recursi
  on the process status, and whether narrowing is in effect.
  @end defopt
  
- @defopt mode-line-remote
+ @defvar mode-line-remote
  This variable is used to show whether @code{default-directory} for the
  current buffer is remote.
- @end defopt
+ @end defvar
  
- @defopt mode-line-client
+ @defvar mode-line-client
  This variable is used to identify @code{emacsclient} frames.
- @end defopt
+ @end defvar
  
    The following three variables are used in @code{mode-line-modes}:
  
@@@ -2315,10 -2318,10 +2317,10 @@@ definitions, or other named portions o
  choose one of them and move point to it.  Major modes can add a menu
  bar item to use Imenu using @code{imenu-add-to-menubar}.
  
- @defun imenu-add-to-menubar name
+ @deffn Command imenu-add-to-menubar name
  This function defines a local menu bar item named @var{name}
  to run Imenu.
- @end defun
+ @end deffn
  
    The user-level commands for using Imenu are described in the Emacs
  Manual (@pxref{Imenu,, Imenu, emacs, the Emacs Manual}).  This section
@@@ -3860,9 -3863,9 +3862,9 @@@ Return non-@code{nil} if the current to
  @end defun
  
  @defun smie-rule-sibling-p
- Return non-nil if the current token's parent is actually a sibling.
- This is the case for example when the parent of a @code{","} is just the
- previous @code{","}.
+ Return non-@code{nil} if the current token's parent is actually a
+ sibling.  This is the case for example when the parent of a @code{","}
is just the previous @code{","}.
  @end defun
  
  @defun smie-rule-parent &optional offset
diff --combined doc/lispref/os.texi
@@@ -3,6 -3,7 +3,6 @@@
  @c Copyright (C) 1990-1995, 1998-1999, 2001-2012
  @c   Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/os
  @node System Interface, Packaging, Display, Top
  @chapter Operating System Interface
  
@@@ -1196,14 -1197,11 +1196,14 @@@ sections
  
  @defun current-time-string &optional time-value
  This function returns the current time and date as a human-readable
 -string.  The format of the string is unvarying; the number of
 -characters used for each part is always the same, so you can reliably
 -use @code{substring} to extract pieces of it.  You should count
 +string.  The format does not vary for the initial part of the string,
 +which contains the day of week, month, day of month, and time of day
 +in that order: the number of characters used for these fields is
 +always the same, so you can reliably
 +use @code{substring} to extract them.  You should count
  characters from the beginning of the string rather than from the end,
 -as additional information may some day be added at the end.
 +as the year might not have exactly four digits, and additional
 +information may some day be added at the end.
  
  The argument @var{time-value}, if given, specifies a time to format
  (represented as a list of integers), instead of the current time.
@@@ -1735,11 -1733,11 +1735,11 @@@ between them).  If you want a timer to 
  seconds after the last invocation, don't use the @var{repeat} argument.
  Instead, the timer function should explicitly reschedule the timer.
  
 -@defvar timer-max-repeats
 +@defopt timer-max-repeats
  This variable's value specifies the maximum number of times to repeat
  calling a timer function in a row, when many previously scheduled
  calls were unavoidably delayed.
 -@end defvar
 +@end defopt
  
  @defmac with-timeout (seconds timeout-forms@dots{}) body@dots{}
  Execute @var{body}, but give up after @var{seconds} seconds.  If
@@@ -2108,10 -2106,10 +2108,10 @@@ calls the functions in the list @code{p
  Each function is called with one argument, @var{sound}.
  @end defun
  
- @defun play-sound-file file &optional volume device
+ @deffn Command play-sound-file file &optional volume device
  This function is an alternative interface to playing a sound @var{file}
  specifying an optional @var{volume} and @var{device}.
- @end defun
+ @end deffn
  
  @defvar play-sound-functions
  A list of functions to be called before playing a sound.  Each function
@@@ -2274,7 -2272,7 +2274,7 @@@ The notification title
  @item :body @var{text}
  The notification body text.  Depending on the implementation of the
  notification server, the text could contain HTML markups, like
 -@samp{"<b>bold text</b>"}, or hyperlinks.
 +@samp{"<b>bold text</b>"}, hyperlinks, or images.
  
  @item :app-name @var{name}
  The name of the application sending the notification.  The default is
@@@ -2304,10 -2302,6 +2304,10 @@@ the notification never expires.  Defaul
  @item :urgency @var{urgency}
  The urgency level.  It can be @code{low}, @code{normal}, or @code{critical}.
  
 +@item :action-items
 +When this keyword is given, the @var{title} string of the actions is
 +interpreted as icon name.
 +
  @item :category @var{category}
  The type of notification this is, a string.
  
@@@ -2338,17 -2332,6 +2338,17 @@@ example would be @samp{"message-new-ins
  Causes the server to suppress playing any sounds, if it has that
  ability.
  
 +@item :resident
 +When set the server will not automatically remove the notification
 +when an action has been invoked. The notification will remain resident
 +in the server until it is explicitly removed by the user or by the
 +sender. This hint is likely only useful when the server has the
 +@code{:persistence} capability.
 +
 +@item :transient
 +When set the server will treat the notification as transient and
 +by-pass the server's persistence capability, if it should exist.
 +
  @item :x @var{position}
  @itemx :y @var{position}
  Specifies the X, Y location on the screen that the
@@@ -2373,9 -2356,6 +2373,9 @@@ by the user.  The function receive the 
  @end itemize
  @end table
  
 +Which parameters are accepted by the notification server can be
 +checked via @code{notifications-get-capabilities}.
 +
  This function returns a notification id, an integer, which can be used
  to manipulate the notification item with
  @code{notifications-close-notification} or the @code{:replaces-id}
@@@ -2416,46 -2396,6 +2416,46 @@@ A message window opens on the desktop
  This function closes a notification with identifier @var{id}.
  @end defun
  
 +@defun notifications-get-capabilities
 +Returns the capabilities of the notification server, a list of strings.
 +The following capabilities can be expected:
 +
 +@table @code
 +@item :actions
 +The server will provide the specified actions to the user.
 +
 +@item :body
 +Supports body text.
 +
 +@item :body-hyperlinks
 +The server supports hyperlinks in the notifications.
 +
 +@item :body-images
 +The server supports images in the notifications.
 +
 +@item :body-markup
 +Supports markup in the body text.
 +
 +@item :icon-multi
 +The server will render an animation of all the frames in a given image
 +array.
 +
 +@item :icon-static
 +Supports display of exactly 1 frame of any given image array.  This
 +value is mutually exclusive with @code{:icon-multi}.
 +
 +@item :persistence
 +The server supports persistence of notifications.
 +
 +@item :sound
 +The server supports sounds on notifications.
 +@end table
 +
 +Further vendor-specific caps start with @code{:x-vendor}, like
 +@code{:x-gnome-foo-cap}.
 +@end defun
 +
 +
  @node Dynamic Libraries
  @section Dynamically Loaded Libraries
  @cindex dynamic libraries
diff --combined doc/lispref/package.texi
@@@ -1,7 -1,8 +1,7 @@@
  @c -*-texinfo-*-
  @c This is part of the GNU Emacs Lisp Reference Manual.
 -@c Copyright (C) 2010-2012  Free Software Foundation, Inc.
 +@c Copyright (C) 2010-2012 Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/package
  @node Packaging, Antinews, System Interface, Top
  @chapter Preparing Lisp code for distribution
  @cindex package
@@@ -294,8 -295,8 +294,8 @@@ How to accomplish this is beyond the sc
  
    A convenient way to set up and update a package archive is via the
  @code{package-x} library.  This is included with Emacs, but not loaded
- by default; type @kbd{M-x load-library @kbd{RET} package-x @kbd{RET}}
to load it, or add @code{(require 'package-x)} to your init file.
+ by default; type @kbd{M-x load-library @key{RET} package-x @key{RET}} to
+ load it, or add @code{(require 'package-x)} to your init file.
  @xref{Lisp Libraries,, Lisp Libraries, emacs, The GNU Emacs Manual}.
  Once loaded, you can make use of the following:
  
@@@ -3,6 -3,7 +3,6 @@@
  @c Copyright (C) 1990-1995, 1998-1999, 2001-2012
  @c   Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/processes
  @node Processes, Display, Abbrevs, Top
  @chapter Processes
  @cindex child process
@@@ -96,12 -97,12 +96,12 @@@ Expansion}).  @code{nil} in this list r
    Executing a program can also try adding suffixes to the specified
  name:
  
 -@defvar exec-suffixes
 +@defopt exec-suffixes
  This variable is a list of suffixes (strings) to try adding to the
  specified program file name.  The list should include @code{""} if you
  want the name to be tried exactly as specified.  The default value is
  system-dependent.
 -@end defvar
 +@end defopt
  
    @strong{Please note:} The argument @var{program} contains only the
  name of the program; it may not contain any command-line arguments.  You
@@@ -275,9 -276,6 +275,9 @@@ system, much like text written into a f
  @defun call-process program &optional infile destination display &rest args
  This function calls @var{program} and waits for it to finish.
  
 +The current working directory of the subprocess is
 +@code{default-directory}.
 +
  The standard input for the new process comes from file @var{infile} if
  @var{infile} is not @code{nil}, and from the null device otherwise.
  The argument @var{destination} says where to put the process output.
@@@ -1073,7 -1071,7 +1073,7 @@@ job-control shells won't work when a pi
  @defun interrupt-process &optional process current-group
  This function interrupts the process @var{process} by sending the
  signal @code{SIGINT}.  Outside of Emacs, typing the ``interrupt
- character'' (normally @kbd{C-c} on some systems, and @code{DEL} on
+ character'' (normally @kbd{C-c} on some systems, and @key{DEL} on
  others) sends this signal.  When the argument @var{current-group} is
  non-@code{nil}, you can think of this function as ``typing @kbd{C-c}''
  on the terminal by which Emacs talks to the subprocess.
@@@ -1112,7 -1110,7 +1112,7 @@@ it the signal @code{SIGCONT}.  This pre
  stopped previously.
  @end defun
  
- @defun signal-process process signal
+ @deffn Command signal-process process signal
  This function sends a signal to process @var{process}.  The argument
  @var{signal} specifies which signal to send; it should be an integer,
  or a symbol whose name is a signal.
  The @var{process} argument can be a system process @acronym{ID} (an
  integer); that allows you to send signals to processes that are not
  children of Emacs.  @xref{System Processes}.
- @end defun
+ @end deffn
  
  @node Output from Processes
  @section Receiving Output from Processes
diff --combined doc/lispref/text.texi
@@@ -1,7 -1,8 +1,7 @@@
  @c -*-texinfo-*-
  @c This is part of the GNU Emacs Lisp Reference Manual.
 -@c Copyright (C) 1990-1995, 1998-2012  Free Software Foundation, Inc.
 +@c Copyright (C) 1990-1995, 1998-2012 Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/text
  @node Text, Non-ASCII Characters, Markers, Top
  @chapter Text
  @cindex text
@@@ -3530,7 -3531,7 +3530,7 @@@ properties.  For simplicity, we will re
  @dfn{link}.
  
    Implementing a link involves three separate steps: (1) indicating
- clickability when the mouse moves over the link; (2) making @kbd{RET}
+ clickability when the mouse moves over the link; (2) making @key{RET}
  or @kbd{Mouse-2} on that link do something; and (3) setting up a
  @code{follow-link} condition so that the link obeys
  @code{mouse-1-click-follows-link}.
@@@ -4068,7 -4069,7 +4068,7 @@@ text, to avoid overlong lines.  However
  the output is just one long line.
  @end deffn
  
- @deffn Command base64-encode-string string &optional no-line-break
+ @defun base64-encode-string string &optional no-line-break
  This function converts the string @var{string} into base 64 code.  It
  returns a string containing the encoded text.  As for
  @code{base64-encode-region}, an error is signaled if a character in the
@@@ -4078,15 -4079,15 +4078,15 @@@ Normally, this function inserts newlin
  text, to avoid overlong lines.  However, if the optional argument
  @var{no-line-break} is non-@code{nil}, these newlines are not added, so
  the result string is just one long line.
- @end deffn
+ @end defun
  
- @defun base64-decode-region beg end
+ @deffn Command base64-decode-region beg end
  This function converts the region from @var{beg} to @var{end} from base
  64 code into the corresponding decoded text.  It returns the length of
  the decoded text.
  
  The decoding functions ignore newline characters in the encoded text.
- @end defun
+ @end deffn
  
  @defun base64-decode-string string
  This function converts the string @var{string} from base 64 code into
@@@ -2,6 -2,7 +2,6 @@@
  @c This is part of the GNU Emacs Lisp Reference Manual.
  @c Copyright (C) 1990-1995, 1998-2012 Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/variables
  @node Variables, Functions, Control Structures, Top
  @chapter Variables
  @cindex variable
@@@ -1852,16 -1853,19 +1852,19 @@@ variable with a new name.  @code{make-o
  the old name is obsolete and therefore that it may be removed at some
  stage in the future.
  
- @defun make-obsolete-variable obsolete-name current-name &optional when
+ @defun make-obsolete-variable obsolete-name current-name when &optional access-type
  This function makes the byte compiler warn that the variable
- @var{obsolete-name} is obsolete.  If @var{current-name} is a symbol, it is
- the variable's new name; then the warning message says to use
- @var{current-name} instead of @var{obsolete-name}.  If @var{current-name}
- is a string, this is the message and there is no replacement variable.
- If provided, @var{when} should be a string indicating when the
- variable was first made obsolete---for example, a date or a release
- number.
+ @var{obsolete-name} is obsolete.  If @var{current-name} is a symbol,
+ it is the variable's new name; then the warning message says to use
+ @var{current-name} instead of @var{obsolete-name}.  If
+ @var{current-name} is a string, this is the message and there is no
+ replacement variable.  @var{when} should be a string indicating when
+ the variable was first made obsolete (usually a version number
+ string).
+ The optional argument @var{access-type}, if non-@code{nil}, should
+ should specify the kind of access that will trigger obsolescence
+ warnings; it can be either @code{get} or @code{set}.
  @end defun
  
    You can make two variables synonyms and declare one obsolete at the
diff --combined doc/lispref/windows.texi
@@@ -3,6 -3,7 +3,6 @@@
  @c Copyright (C) 1990-1995, 1998-1999, 2001-2012
  @c   Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
 -@setfilename ../../info/windows
  @node Windows, Frames, Buffers, Top
  @chapter Windows
  
@@@ -1558,7 -1559,7 +1558,7 @@@ displaying the buffer.  Hence, all the 
  @code{display-buffer} will affect it as well.  @xref{Choosing Window},
  for the documentation of @code{display-buffer}.
  
- @defun pop-to-buffer buffer-or-name &optional action norecord
+ @deffn Command pop-to-buffer buffer-or-name &optional action norecord
  This function makes @var{buffer-or-name} the current buffer and
  displays it in some window, preferably not the window previously
  selected.  It then selects the displaying window.  If that window is
@@@ -1581,7 -1582,7 +1581,7 @@@ displayed in the selected window
  
  Like @code{switch-to-buffer}, this function updates the buffer list
  unless @var{norecord} is non-@code{nil}.
- @end defun
+ @end deffn
  
  @node Choosing Window
  @section Choosing a Window for Display
diff --combined doc/misc/ChangeLog
 -2012-05-16  Bastien Guerry  <bzg@gnu.org>
++2012-05-27  Bastien Guerry  <bzg@gnu.org>
+       * org.texi (Durations and time values): Fix typo.
 -2012-05-12  Andreas Schwab  <schwab@linux-m68k.org>
 +2012-05-19  Jay Belanger  <jay.p.belanger@gmail.com>
 +
-       * doc/misc/calc.texi
-       (Basic Operations on Units, Customizing Calc):
++      * doc/misc/calc.texi (Basic Operations on Units, Customizing Calc):
 +      Mention `calc-ensure-consistent-units'.
 +
 +2012-05-14  Andreas Schwab  <schwab@linux-m68k.org>
  
        * cc-mode.texi: Avoid space before macro in 4th argument of cross
        reference commands.  (Bug#11461)
  
        * Makefile.in (gnus.dvi): Use $@ instead of $*.dvi.
  
 +2012-05-12  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (mostlyclean): Add more TeX intermediates.
 +
 +      * Makefile.in: Make it look more like the other doc Makefiles.
 +      Use explicit $srcdir in all dependencies.
 +      Remove cd $srcdir from rules.
 +      (VPATH): Remove.
 +      (infodir): Set to an absolute path.
 +      (INFO_TARGETS): Use short names.
 +      (mkinfodir): infodir is now absolute.
 +      (echo-info, maintainer-clean): Update for new format of INFO_TARGETS.
 +
 +      * Makefile.in (info.info): Rename from info, to avoid duplication.
 +      (.SUFFIXES): Disable implicit rules.
 +
 +      * Makefile.in (MKDIR_P): New, set by configure.
 +      (mkinfodir): Use $MKDIR_P.
 +
 +2012-05-07  Glenn Morris  <rgm@gnu.org>
 +
 +      * forms.texi (Long Example): Update for changed location of files.
 +
 +2012-05-04  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (INFO_EXT, INFO_OPTS): New, set by configure.
 +      (INFO_TARGETS): Use $INFO_EXT.
 +      Make all rules generating info files use $INFO_EXT, $INFO_OPT, and -o.
 +      * makefile.w32-in (INFO_EXT, INFO_OPTS): New.
 +      (INFO_TARGETS): Use $INFO_EXT.
 +      Make all rules generating info files use $INFO_EXT, $INFO_OPT, and -o.
 +
  2012-05-02  Glenn Morris  <rgm@gnu.org>
  
 +      * Makefile.in (echo-info): New phony target, used by top-level.
 +
        * viper.texi: Make direntry shorter (also it is no longer "newest").
  
        * emacs-gnutls.texi, ert.texi, org.texi:
        Fix dircategory, direntry to match info/dir.
  
 -2012-04-28  Glenn Morris  <rgm@gnu.org>
 -
        * faq.texi: Convert @inforefs to @xrefs.
        Fix some malformed cross-references.
        (File-name conventions): Shorten section name to avoid overfull line.
        (How to add fonts): Use smallexample to avoid overfull lines.
  
 -2012-04-26  Ippei Furuhashi  <top.tuna+orgmode@gmail.com>  (tiny change)
 +2012-05-01  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * auth.texi (Help for users): Update for .gpg file being second.
 +
 +2012-04-27  Ippei Furuhashi  <top.tuna+orgmode@gmail.com>  (tiny change)
  
        * org.texi (Agenda commands): Fix two typos: give corresponding
        function names, according to `org-agenda-view-mode-dispatch'.
  
 -2012-04-21  Glenn Morris  <rgm@gnu.org>
 +2012-04-27  Glenn Morris  <rgm@gnu.org>
  
        * faq.texi (Major packages and programs): Remove section.
        There is no point listing 6 packages (cf etc/MORE.STUFF).
        (Finding Emacs and related packages): Move "Spell-checkers" here.
  
 +2012-04-22  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * dbus.texi (Version): New node.
 +      (Properties and Annotations): Mention the object manager
 +      interface.  Describe dbus-get-all-managed-objects.
 +      (Type Conversion): Floating point numbers are allowed, if an
 +      anteger does not fit Emacs's integer range.
 +      (Synchronous Methods): Remove obsolete dbus-call-method-non-blocking.
 +      (Asynchronous Methods): Fix description of
 +      dbus-call-method-asynchronously.
 +      (Receiving Method Calls): Fix some minor errors.  Add
 +      dbus-interface-emacs.
 +      (Signals): Describe unicast signals and the new match rules.
 +      (Alternative Buses): Add the PRIVATE optional argument to
 +      dbus-init-bus.  Describe its new return value.  Add dbus-setenv.
 +
  2012-04-20  Glenn Morris  <rgm@gnu.org>
  
        * faq.texi (New in Emacs 24): New section.
        (Packages that do not come with Emacs): Mention M-x list-packages.
  
 -2012-04-13  Glenn Morris  <rgm@gnu.org>
 -
 -      * Makefile.in: Replace non-portable use of $< in emacs-gnutls rules.
 -
 -2012-04-12  Eli Zaretskii  <eliz@gnu.org>
 -
 -      * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, clean): Add emacs-gnutls.
 -      ($(infodir)/emacs-gnutls, emacs-gnutls.dvi): New targets.
 -
 -2012-04-12  Teodor Zlatanov  <tzz@lifelogs.com>
 -
 -      * emacs-gnutls.texi: Add documentation for the GnuTLS integration.
 -      * Makefile.in: Add emacs-gnutls.texi to build.
 -
 -2012-04-11  Alan Mackenzie  <acm@muc.de>
 +2012-04-14  Alan Mackenzie  <acm@muc.de>
  
        * cc-mode.texi (c-offsets-alist): Correct a typo.
  
 -2012-04-11  Jérémie Courrèges-Anglas  <jca@wxcvbn.org>  (tiny change)
 +2012-04-14  Jérémie Courrèges-Anglas  <jca@wxcvbn.org>  (tiny change)
  
        * org.texi (Deadlines and scheduling): Fix the example: the
        DEADLINE item should come right after the headline.  We enforce
        this convention, so it is a bug not to illustrate it correctly in
        the manual.
  
 -2012-04-11  Ippei FURUHASHI  <top.tuna+orgmode@gmail.com>  (tiny change)
 +2012-04-14  Ippei FURUHASHI  <top.tuna+orgmode@gmail.com>  (tiny change)
  
        * org.texi (Agenda commands): Fix documentation bug by swapping
        the equivalent keybindings to `org-agenda-next-line' with the ones
        to `org-agenda-previous-line'.
  
 -2012-04-07  Glenn Morris  <rgm@gnu.org>
 +2012-04-14  Glenn Morris  <rgm@gnu.org>
  
        * Makefile.in: Replace non-portable use of $< in ordinary rules.
  
 +2012-04-09  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, clean): Add
 +      emacs-gnutls.
 +      ($(infodir)/emacs-gnutls, emacs-gnutls.dvi): New targets.
 +
 +2012-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * Makefile.in: Add emacs-gnutls.texi to build.
 +
 +      * emacs-gnutls.texi: Add documentation for the GnuTLS integration.
 +
  2012-04-05  Teodor Zlatanov  <tzz@lifelogs.com>
  
        * auth.texi (Secret Service API): Edit further and give examples.
        * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for
        release 8.3.
        (Preface): Updated support information.
 -      (From Bill Wohler): Reset text to original version. As a
 +      (From Bill Wohler): Reset text to original version.  As a
        historical quote, the tense should be correct in the time that it
        was written.
  
  
  2011-08-15  Suvayu Ali  <fatkasuvayu+linux@gmail.com>  (tiny change)
  
 -      * org.texi (Images in LaTeX export): rewrite.
 +      * org.texi (Images in LaTeX export): Rewrite.
  
  2011-08-15  Bastien Guerry  <bzg@gnu.org>
  
 -      * org.texi (Using the mapping API): mention 'region as a possible
 +      * org.texi (Using the mapping API): Mention 'region as a possible
        scope for `org-map-entries'.
  
  2011-08-15  Carsten Dominik  <carsten.dominik@gmail.com>
  
  2011-08-15  Bastien Guerry  <bzg@gnu.org>
  
 -      * org.texi (Template expansion): order template sequences in the
 +      * org.texi (Template expansion): Order template sequences in the
        proper order.
  
  2011-08-15  Eric Schulte  <schulte.eric@gmail.com>
  
  2011-08-15  Achim Gratz  <stromeko@nexgo.de>
  
 -      * org.texi: document that both CLOCK_INTO_DRAWER and
 +      * org.texi: Document that both CLOCK_INTO_DRAWER and
        LOG_INTO_DRAWER can be used to override the contents of variable
        org-clock-into-drawer (or if unset, org-log-into-drawer).
  
 -      * org.texi: replace @xref->@pxref.
 +      * org.texi: Replace @xref->@pxref.
  
  2011-08-15  Eric Schulte  <schulte.eric@gmail.com>
  
  
  2011-08-15  Eric Schulte  <schulte.eric@gmail.com>
  
 -      * org.texi (Structure of code blocks): explicitly state that the
 +      * org.texi (Structure of code blocks): Explicitly state that the
        behavior of multiple blocks of the same name is undefined
  
  2011-08-15  Christian Egli  <christian.egli@sbszh.ch>
  
  2011-08-15  Bastien Guerry  <bzg@gnu.org>
  
 -      * org.texi (LaTeX and PDF export): add a note about a limitation
 +      * org.texi (LaTeX and PDF export): Add a note about a limitation
        of the LaTeX export: the org file has to be properly structured.
  
  2011-08-15  Bastien Guerry  <bzg@gnu.org>
  
  2010-11-11  Eric Schulte  <schulte.eric@gmail.com>
  
 -      * org.texi: multi-line header arguments :PROPERTIES: :ID:
 +      * org.texi: Multi-line header arguments :PROPERTIES: :ID:
        b77c8857-6c76-4ea9-8a61-ddc2648d96c4 :END:.
  
  2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
  ;; coding: utf-8
  ;; End:
  
 -  Copyright (C) 1993-1999, 2001-2012  Free Software Foundation, Inc.
 +  Copyright (C) 1993-1999, 2001-2012 Free Software Foundation, Inc.
  
    This file is part of GNU Emacs.
  
diff --combined lisp/ChangeLog
 -2012-05-18  Eli Zaretskii  <eliz@gnu.org>
++2012-05-27  Eli Zaretskii  <eliz@gnu.org>
+       * mail/sendmail.el (mail-yank-region): Recognize
+       rmail-yank-current-message in addition to insert-buffer.  Fixes
+       mail-mode's "C-c C-r" that otherwise does nothing when invoked in
+       a *mail* buffer created through rmail-start-mail with sendmail as
+       mail-user-agent.
++2012-05-27  Chong Yidong  <cyd@gnu.org>
++
++      * net/gnutls.el (gnutls-min-prime-bits): Improve docstring.
++      Default to 256 (Bug#11267).
++
++      * help.el (describe-mode): Doc fix.
++
 +2012-05-26  Glenn Morris  <rgm@gnu.org>
 +
 +      * w32-fns.el (w32-init-info): Remove.
 +      * paths.el (Info-default-directory-list): Add w32-init-info equivalent.
 +
 +      * info.el (info-initialize): For self-contained NS builds, put the
 +      included info/ directory at the front.  (Bug#2791)
 +
 +      * paths.el (Info-default-directory-list): Make it a defcustom,
 +      mainly so that we can use custom-initialize-delay.
 +
 +2012-05-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * subr.el (buffer-has-markers-at): Mark obsolete.
 +
 +      * subr.el (lambda): Use declare.
 +
 +      * emacs-lisp/lisp-mode.el (lambda):
 +      * emacs-lisp/edebug.el (lambda): Move properties to its definition.
 +
 +2012-05-26  Aaron S. Hawley  <aaron.s.hawley@gmail.com>
 +
 +      * thingatpt.el (forward-same-syntax): Handle no ARG case.  (Bug#11560)
 +
 +2012-05-26  Glenn Morris  <rgm@gnu.org>
 +
 +      * progmodes/cc-mode.el (auto-mode-alist): Fix typo.
 +
 +2012-05-25  Glenn Morris  <rgm@gnu.org>
 +
 +      * paths.el: Remove no-byte-compile.
 +      * loadup.el: No need to load paths.el uncompiled.
 +
 +      * image.el (imagemagick-types-inhibit): Doc fix.
 +
 +      * version.el: Remove no-byte-compile and associated formatting.
 +      * loadup.el: No need to load version.el uncompiled.  AFAICS, this
 +      is ancient code from when there was an "inc-vers.el".
 +
 +2012-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * progmodes/gdb-mi.el: Minor style changes.
 +      (gdb-enable-debug, gdb-speedbar-auto-raise, gdb-many-windows):
 +      Turn into minor modes.
 +      (gdb--if-arrow): Rename from gdb-if-arrow, make it hygienic.
 +      (gdb-mouse-until, gdb-mouse-jump): Adjust uses accordingly.
 +      (gdb-shell): Remove unneeded let-binding.
 +      (gdb-get-many-fields): Eliminate O(n²) behavior.
 +
 +2012-05-25  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * cus-start.el <vertical-centering-font-regexp>: Avoid warning on
 +      platforms that don't link in fontset.c.
 +
 +2012-05-25  Juri Linkov  <juri@jurta.org>
 +
 +      Use the same diff color scheme as in modern VCSes (bug#10181).
 +
 +      * vc/diff-mode.el (diff-header, diff-file-header): Remove "green"
 +      to avoid confusion with `diff-added' that now uses green colors.
 +      (diff-removed): Use shades of red.
 +      (diff-added): Use shades of green.
 +      (diff-changed): Leave just the yellow color.
 +      (diff-use-changed-face): New variable.
 +      (diff-font-lock-keywords): Use `diff-use-changed-face' to decide
 +      how to highlight context diff changes.
 +      (diff-refine-change): Use shades of yellow.
 +      (diff-refine-removed): New face that uses shades of red.
 +      (diff-refine-added): New face that uses shades of green.
 +      (diff-refine-hunk): Use `diff-refine-change', `diff-refine-added',
 +      `diff-refine-removed' in the call to `smerge-refine-subst'
 +      depending on the value of `diff-use-changed-face'.
 +
 +      * vc/smerge-mode.el (smerge-mine): Use shades of red.
 +      (smerge-other): Use shades of green.
 +      (smerge-base): Use shades of yellow.
 +      (smerge-refined-change): Empty face.
 +      (smerge-refined-removed): New face that uses shades of red.
 +      (smerge-refined-added): New face that uses shades of green.
 +      (smerge-refine-subst): Rename arg `props' to `props-c'.  Add new
 +      args `props-r' and `props-a', and use them.  Doc fix.
 +      (smerge-refine): Evaluate `smerge-use-changed-face' and depending
 +      on its value use different faces `smerge-refined-change',
 +      `smerge-refined-removed', `smerge-refined-added' in the call to
 +      `smerge-refine-subst'.
 +
 +      * vc/ediff-init.el (ediff-current-diff-A, ediff-fine-diff-A):
 +      Add face condition `min-colors 88' with shades of red.
 +      (ediff-current-diff-B, ediff-fine-diff-B): Add face condition
 +      `min-colors 88' with shades of green.
 +      (ediff-current-diff-C, ediff-fine-diff-C): Add face condition
 +      `min-colors 88' with shades of yellow.
 +
 +2012-05-24  Glenn Morris  <rgm@gnu.org>
 +
 +      * paths.el (prune-directory-list, remote-shell-program): Move to...
 +      * files.el (prune-directory-list, remote-shell-program): ...here.
 +      For the latter, delay initialization, prefer ssh, just search PATH.
 +
 +      * paths.el (term-file-prefix): Move to faces.el (the only user).
 +      * faces.el (term-file-prefix): Move here, make it a defcustom.
 +
 +      * paths.el (news-directory, news-path, news-inews-program):
 +      Move to gnus/nnspool.el.
 +
 +      * paths.el (gnus-default-nntp-server): Remove (gnus.el defines it).
 +
 +      * paths.el (rmail-file-name, rmail-spool-directory): Move from here...
 +      * mail/rmail.el (rmail-file-name, rmail-spool-directory): ... to here.
 +      Make the latter a defcustom, with a delayed initialization.
 +
 +      * paths.el (gnus-nntp-service, gnus-local-organization): Remove.
 +      These were deleted from Gnus itself late 2010.
 +
 +2012-05-22  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * progmodes/which-func.el (which-func-ff-hook):
 +      Check against user-error, not error.
 +
 +      * emacs-lisp/edebug.el (top): Do not load or set up loading of
 +      cl-specs.el, which no longer exists.
 +
 +2012-05-22  Glenn Morris  <rgm@gnu.org>
 +
 +      * info.el (info-emacs-bug): New command.
 +      * menu-bar.el (menu-bar-help-menu): Add "How to Report a Bug" to Help.
 +      * mail/emacsbug.el (report-emacs-bug): Replace with info-emacs-bug.
 +
 +2012-05-21  Glenn Morris  <rgm@gnu.org>
 +
 +      * makefile.w32-in (update-subdirs-SH):
 +      * Makefile.in (update-subdirs): Update for moved update-subdirs.
 +
 +2012-05-21  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * hi-lock.el (hi-lock-face-defaults): Move obsolete before definition.
 +
 +      * progmodes/compile.el (compilation-error-regexp-alist-alist):
 +      Simplify Maven regexp, and make sure the file can't start with a space
 +      (bug#11517).
 +
 +2012-05-21  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (setwins, setwins_almost, setwins_for_subdirs):
 +      Scrap superfluous subshells.
 +
 +2012-05-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * emacs-lisp/bytecomp.el (byte-compile-root-dir): New var.
 +      (byte-compile-warning-prefix, batch-byte-compile-file): Use it.
 +
 +2012-05-19  Jay Belanger  <jay.p.belanger@gmail.com>
 +
 +      * calc/calc.el (calc-ensure-consistent-units): New variable.
 +
 +      * calc/calc-units.el (math-consistent-units-p)
 +      (math-check-unit-consistency): New functions.
 +      (calc-quick-units, calc-convert-units):
 +      Use `math-check-unit-consistency' when `calc-ensure-consistent-units'
 +      is non-nil.
 +      (calc-extract-units): Fix typo.
 +
 +2012-05-18  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * vc/vc-bzr.el (vc-bzr-state-heuristic): Save match-data around sha1.
 +
 +      * textmodes/flyspell.el: Commenting style, plus code simplifications.
 +      (flyspell-default-deplacement-commands): Don't spell check after
 +      repeated window/frame switches (e.g. triggered by mouse-movement).
 +      (flyspell-delay-commands, flyspell-deplacement-commands): Use mapc.
 +      (flyspell-debug-signal-word-checked): Simplify and fit in 80 cols.
 +      (flyspell-casechars-cache, flyspell-ispell-casechars-cache)
 +      (flyspell-not-casechars-cache, flyspell-ispell-not-casechars-cache):
 +      Remove unused vars.
 +      (flyspell-get-casechars, flyspell-get-not-casechars):
 +      Simplify; Don't bother removing a ] just to add it back.
 +      * textmodes/ispell.el (ispell-program-name): Use executable-find.
 +
 +2012-05-18  Rüdiger Sonderfeld <ruediger@c-plusplus.de>
 +
 +      * calc/calc-lang.el (math-C-parse-bess, math-C-parse-fma):
 +      New functions.
 +      (math-function-table): Add support for more C functions.
 +
 +2012-05-18  Agustín Martín Domingo  <agustin.martin@hispalinux.es>
 +
 +      * flyspell.el (flyspell-check-pre-word-p, flyspell-check-word-p)
 +      (flyspell-debug-signal-word-checked): Protect delay handling for
 +      otherchars against empty otherchars.
 +
 +2012-05-18  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * emacs-lisp/lisp-mode.el (doc-string-elt): Move those properties to
 +      their respective macro declarations.
 +      * skeleton.el (define-skeleton):
 +      * progmodes/compile.el (define-compilation-mode):
 +      * ibuf-macs.el (define-ibuffer-sorter, define-ibuffer-op)
 +      (define-ibuffer-filter):
 +      * emacs-lisp/generic.el (define-generic-mode):
 +      * emacs-lisp/easy-mmode.el (define-minor-mode)
 +      (define-globalized-minor-mode):
 +      * emacs-lisp/cl-macs.el (defun*, defmacro*, defstruct, deftype):
 +      * emacs-lisp/byte-run.el (defsubst):
 +      * custom.el (deftheme): Add doc-string metadata.
 +
 +2012-05-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * emacs-lisp/cl-macs.el, emacs-lisp/cl.el: Move indent info.
 +
 +2012-05-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * emacs-lisp/pcase.el (pcase--u1): Avoid ((lambda ...) ...).
 +
 +      * emacs-lisp/cl.el: Add edebug specs from cl-specs.el.
 +      * emacs-lisp/cl-macs.el: Idem.
 +      * emacs-lisp/cl-specs.el: Remove.
 +
 +2012-05-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      Minor renaming of internal CL functions and variables.
 +      * emacs-lisp/cl-seq.el (cl--adjoin): Rename from cl-adjoin.
 +      (cl--position): Rename from cl-position.
 +      (cl--delete-duplicates): Rename from cl-delete-duplicates.
 +      * emacs-lisp/cl.el (cl--gensym-counter): Rename from *gensym-counter*.
 +      (cl--random-state): Rename from *random-state*.
 +
  2012-05-17  Stefan Monnier  <monnier@iro.umontreal.ca>
  
 -      * emacs-lisp/cl-macs.el (cl-transform-lambda): Don't add spurious
 -      parens around the arg list (bug#11499).  Silly backport.
 +      * emacs-lisp/cl-macs.el (cl-transform-lambda): Don't add spurious
 +      parens around the arg list (bug#11499).
 +
 +2012-05-17  Juri Linkov  <juri@jurta.org>
 +
 +      * isearch.el (word-search-regexp, word-search-backward)
 +      (word-search-forward, word-search-backward-lax)
 +      (word-search-forward-lax): Move functions from search.c
 +      (bug#10145, bug#11381).
 +
 +2012-05-16  Agustín Martín Domingo  <agustin.martin@hispalinux.es>
 +
 +      * flyspell.el (flyspell-check-pre-word-p, flyspell-check-word-p)
 +      (flyspell-debug-signal-word-checked): Delay for otherchars as for
 +      normal word components.
 +
 +2012-05-16  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * minibuffer.el (completion--sifn-requote): Fix last change.
 +      (minibuffer-local-must-match-filename-map):
 +      Move define-obsolete-variable-alias before its var.
 +
 +2012-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * emacs-lisp/pcase.el (pcase-let*, pcase-let): Fix edebug spec.
 +
 +      * minibuffer.el (completion--sifn-requote): Handle sifn's truncation
 +      behavior.
 +      (completion--string-equal-p): New function.
 +      (completion--twq-all): Use it to get better assertion failure data.
 +
 +      Only handle ".." and '..' quoting in shell-mode (bug#11466).
 +      * shell.el (shell--unquote&requote-argument, shell--unquote-argument)
 +      (shell--requote-argument): New functions.
 +      (shell-completion-vars): Use them.
 +      (shell--parse-pcomplete-arguments): Rename from
 +      shell-parse-pcomplete-arguments.
 +      * comint.el (comint-word): Obey comint-file-name-quote-list.  Simplify.
 +      (comint--unquote&requote-argument): Don't handle ".." and '..' quoting.
 +      Obey comint-file-name-quote-list.
 +
 +      * emacs-lisp/smie.el (smie-indent--bolp-1): New function.
 +      (smie-indent-keyword): Use it.
 +
 +2012-05-14  Stefan Merten  <smerten@oekonux.de>
 +
 +      * textmodes/rst.el (rst-re-alist): Fix loading (bug#11462).
 +
 +2012-05-14  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * net/rlogin.el (rlogin-mode-map): Fix last change.
 +
 +2012-05-14  Jason L. Wright  <jason.wright@inl.gov>  (tiny change)
 +
 +      * mail/smtpmail.el (smtpmail-send-command): Send the command and
 +      the following \r\n using a single `process-send-string', since the
 +      Lotus SMTP server refuses to accept any commands if they are sent
 +      with two `process-send-string's (Bug#11444).
 +
 +2012-05-14  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * shell.el (shell-parse-pcomplete-arguments):
 +      Obey pcomplete-arg-quote-list inside double-quoted args (Bug#11348).
 +
 +2012-05-14  Wolfgang Jenkner  <wjenkner@inode.at>
 +
 +      * image-mode.el: Fit to width/height for rotated images (Bug#11431).
 +      (image-transform-scale, image-transform-right-angle-fudge): New vars.
 +      (image-transform-width, image-transform-fit-width): New functions.
 +      (image-transform-properties): Use them.
 +      (image-transform-check-size): New function.
 +      (image-toggle-display-image): Use it (for testing).
 +      (image-transform-set-rotation): Reduce angle mod 360.
 +      Delete obsolete comment.
 +
 +2012-05-14  Wolfgang Jenkner  <wjenkner@inode.at>
 +
 +      * image-mode.el: Fix scaling (bug#11399).
 +      (image-transform-resize): Doc fix.
 +      (image-transform-properties): Default scale is 1 and height should
 +      be an integer.
 +
 +2012-05-13  Johan BockgÃ¥rd  <bojohan@gnu.org>
 +
 +      * emacs-lisp/smie.el (smie-next-sexp): Use accessor `op-forw' rather
 +      than hard-coding `car', to fix misbehavior when moving forward.
 +
 +2012-05-13  Chong Yidong  <cyd@gnu.org>
 +
 +      * emacs-lisp/tabulated-list.el (tabulated-list-format)
 +      (tabulated-list-entries, tabulated-list-padding)
 +      (tabulated-list-sort-key): Make permanent-local.
 +
 +      * ebuff-menu.el: Adapt to Buffer Menu changes (Bug#11455).
 +      (electric-buffer-list): Put electric buffer menu
 +      command descriptions in this docstring, instead of the docstring
 +      of electric-buffer-menu-mode.  Code cleanups.
 +      (electric-buffer-menu-mode): Use define-derived-mode.  Rename from
 +      Electric-buffer-menu-mode.
 +      (electric-buffer-update-highlight): Minor code cleanup.
 +
 +2012-05-13  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * net/dbus.el (dbus-call-method): Restore events not from D-Bus.
 +      (Bug#11447)
 +
 +2012-05-13  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      Move define-obsolete-variable-alias before the var's definition.
 +      * vc/log-edit.el (vc-comment-ring, vc-comment-ring-index):
 +      * tooltip.el (tooltip-hook):
 +      * textmodes/reftex-toc.el (reftex-toc-map):
 +      * textmodes/reftex-sel.el (reftex-select-label-map)
 +      (reftex-select-bib-map):
 +      * textmodes/reftex-index.el (reftex-index-map)
 +      (reftex-index-phrases-map):
 +      * speedbar.el (speedbar-syntax-table, speedbar-key-map):
 +      * progmodes/meta-mode.el (meta-mode-map):
 +      * novice.el (disabled-command-hook):
 +      * loadhist.el (unload-hook-features-list):
 +      * frame.el (blink-cursor):
 +      * files.el (find-file-not-found-hooks, write-file-hooks)
 +      (write-contents-hooks):
 +      * emulation/tpu-edt.el (GOLD-map):
 +      * emacs-lock.el (emacs-lock-from-exiting):
 +      * emacs-lisp/generic.el (generic-font-lock-defaults):
 +      * emacs-lisp/chart.el (chart-map):
 +      * dos-fns.el (register-name-alist):
 +      * dired-x.el (dired-omit-files-p):
 +      * desktop.el (desktop-enable):
 +      * cus-edit.el (custom-mode-hook):
 +      * buff-menu.el (buffer-menu-mode-hook):
 +      * bookmark.el (bookmark-read-annotation-text-func)
 +      (bookmark-exit-hooks):
 +      * allout.el (allout-mode-deactivate-hook)
 +      (allout-exposure-change-hook, allout-structure-added-hook)
 +      (allout-structure-deleted-hook, allout-structure-shifted-hook):
 +      * dirtrack.el (dirtrack-toggle, dirtrackp, dirtrack-debug-toggle)
 +      (dirtrack-debug): Move call to define-obsolete-variable-alias so it
 +      comes before the corresponding variable's definition.
 +
 +2012-05-12  Chong Yidong  <cyd@gnu.org>
 +
 +      * buff-menu.el (Buffer-menu-buffer+size-width): Doc fix (Bug#11454).
 +      (Buffer-menu-mouse-select): Restore function (Bug#11459).
 +      (Buffer-menu-mode-map): Bind it.
 +      (Buffer-menu--pretty-name): Add a mouse-face property.
 +
 +2012-05-11  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * progmodes/prolog.el: Use SMIE.  Cleanup regexp setup.
 +      (prolog-upper-case-string, prolog-lower-case-string)
 +      (prolog-atom-char-regexp, prolog-atom-regexp): Initialize in defconst.
 +      (prolog-use-smie, prolog-smie-grammar): New vars.
 +      (prolog-smie-forward-token, prolog-smie-backward-token)
 +      (prolog-smie-rules): New funs.
 +      (prolog-comment-indent): Remove.
 +      (prolog-mode-variables): Use default comment indentation instead.
 +      Setup SMIE.
 +      (prolog-build-case-strings, prolog-set-atom-regexps): Remove.
 +      (prolog-mode): Don't call them any more.
 +      (prolog-electric-colon, prolog-electric-dash)
 +      (prolog-edit-menu-insert-move): Use indent-according-to-mode.
 +
 +      * dabbrev.el (dabbrev-expand): Make "no expansion found" a user-error.
 +
 +      * minibuffer.el (completion--twq-all): Again, allow case differences.
 +
 +      * term.el: Move keymap initialization code to be more idiomatic.
 +      (term-signals-menu, term-mode-map, term-raw-map, term-raw-escape-map)
 +      (term-terminal-menu): Move initialization into declaration.
 +      (term-escape-char): Let the user set it in her .emacs.
 +
 +      * progmodes/sh-script.el: Use post-self-insert-hook&electric-pair-mode.
 +      Provide SMIE-based indentation (not enabled by default yet).
 +      (sh-mode-map): Don't bind electric keys.
 +      Use electric-pair-mode instead of skeleton-pair.
 +      (sh-assignment-regexp): Fit within 80 columns.
 +      (sh-indent-supported): Specify actual shell name instead of boolean.
 +      (sh--maybe-here-document): New fun, from sh-maybe-here-document.
 +      (sh-maybe-here-document): Use it.  Make obsolete.
 +      (sh-electric-here-document-mode) New minor mode.
 +      (sh-mode): Use it.  Don't set sh-indent-supported-here here.
 +      (sh-smie-sh-grammar, sh-smie--sh-operators, sh-smie--sh-operators-re)
 +      (sh-smie--sh-operators-back-re, sh-indent-after-continuation)
 +      (sh-smie-rc-grammar, sh-use-smie): New vars.
 +      (sh-smie--keyword-p, sh-smie--newline-semi-p, sh-smie--sh-keyword-p)
 +      (sh-smie-sh-forward-token, sh-smie--looking-back-at-continuation-p)
 +      (sh-smie-sh-backward-token, sh-smie--continuation-start-indent)
 +      (sh-smie-sh-rules, sh-smie-rc-rules, sh-smie--sh-keyword-in-p)
 +      (sh-smie--rc-after-special-arg-p, sh-smie-rc-backward-token)
 +      (sh-smie-sh-rules, sh-smie--rc-newline-semi-p): New functions.
 +      (sh-set-shell): Use smie-setup if requested.
 +
 +      * term.el (term-set-escape-char): Properly set term-escape-char.
 +      See http://stackoverflow.com/questions/10524656.
 +
 +2012-05-10  Chong Yidong  <cyd@gnu.org>
 +
 +      * ffap.el (ffap-url-unwrap-local): Make it work right (Bug#9131).
 +      Use url-generic-parse-url, and handle host names and Windows
 +      filenames properly.
 +      (ffap-url-unwrap-remote): Use url-generic-parse-url.
 +      (ffap-url-unwrap-remote): Accept list values, specifying a list of
 +      URL schemes to work on.
 +      (ffap--toggle-read-only): New function.
 +      (ffap-read-only, ffap-read-only-other-window)
 +      (ffap-read-only-other-frame): Use it.
 +      (ffap-fixup-url): Don't check ffap-ftp-regexp, since it is not
 +      necessary for ffap-url-unwrap-remote.
 +
 +2012-05-10  Dave Abrahams  <dave@boostpro.com>
 +
 +      * cus-start.el (create-lockfiles): Add it.
 +
 +2012-05-09  Chong Yidong  <cyd@gnu.org>
 +
 +      * net/browse-url.el (browse-url-url-encode-chars): Use upper-case.
 +      (browse-url-encode-url): Encode spaces and quotes (Bug#6300).
 +
 +2012-05-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * shell.el (shell-completion-vars): Fix last change (bug#11348).
 +
 +2012-05-09  Chong Yidong  <cyd@gnu.org>
 +
 +      * ansi-color.el (ansi-color-process-output): Check for validity of
 +      comint-last-output-start before using it.  This avoids a bad
 +      interaction with gdb-mi's input/output buffer.
 +
 +2012-05-09  Glenn Morris  <rgm@gnu.org>
 +
 +      * files.el (dir-locals-read-from-file):
 +      Mention dir-locals in any error message.
 +
 +2012-05-09  Chong Yidong  <cyd@gnu.org>
 +
 +      * emacs-lisp/package.el (package-built-in-p): Handle the `emacs'
 +      package (Bug#11410).
 +
 +      * emacs-lisp/package.el (package-buffer-info): Avoid putting local
 +      variables into description.
 +
 +2012-05-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * shell.el (shell-completion-vars): Set pcomplete-arg-quote-list like
 +      shell-delimiter-argument-list (bug#11348).
 +      (shell-parse-pcomplete-arguments): Obey pcomplete-arg-quote-list.
 +
 +2012-05-09  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * textmodes/rst.el: Silence byte-compiler warnings.
 +      (rst-re-alist, rst-reset-section-caches): Move around.
 +      (rst-re): Use `characterp', not `char-valid-p'.
 +      (font-lock-beg, font-lock-end): Declare.
 +
 +      * progmodes/idlw-shell.el (specs): Remove reference to deleted
 +      variable `idlwave-shell-activate-alt-keybindings' and simplify.
 +
 +      * eshell/esh-cmd.el (eshell-debug-command): Fix typo in previous change.
 +
 +2012-05-08  Glenn Morris  <rgm@gnu.org>
 +
 +      * files.el (auto-mode-alist): Treat ".make" like ".mk".
 +
 +2012-05-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * vc/log-edit.el: Add GNU coding standards highlighting.
 +      (log-edit-font-lock-gnu-style)
 +      (log-edit-font-lock-gnu-keywords): New vars.
 +      (log-edit-font-lock-keywords): New fun.
 +      (log-edit-mode): Don't fold case in font-lock.
 +      (log-edit-font-lock-keywords): Do not assume case-folding.
 +
 +      * imenu.el: Misc cleanup.  Make docstrings out of comments.
 +      Use lexical-binding.
 +      (imenu--index-alist, imenu--last-menubar-index-alist)
 +      (imenu-menubar-modified-tick): Use defvar-local.
 +      (imenu--split-menu): Remove unused var.
 +      (imenu--cleanup-seen): Declare as global.
 +      (imenu--cleanup): Use dolist.
 +
 +      * subr.el (defvar-local): Add debug spec and doc-string position.
 +
 +2012-05-08  Glenn Morris  <rgm@gnu.org>
 +
 +      * lisp/language/burmese.el, language/cham.el, language/czech.el:
 +      * language/english.el, language/georgian.el, language/greek.el:
 +      * language/japanese.el, language/khmer.el, language/korean.el:
 +      * language/lao.el, language/misc-lang.el, language/romanian.el:
 +      * language/sinhala.el, language/slovak.el, language/tai-viet.el:
 +      * language/thai.el, language/utf-8-lang.el:
 +      Remove no-byte-compile setting.
 +
 +      * play/zone.el (zone-pgm-stress): Don't pollute kill-ring.  (Bug#11388)
 +
 +2012-05-08  Aaron S. Hawley  <aaron.s.hawley@gmail.com>
 +
 +      * progmodes/make-mode.el (makefile-browse):
 +      Remove unnecessary interactive.  (Bug#11324)
 +
 +2012-05-07  Glenn Morris  <rgm@gnu.org>
 +
 +      * forms-d2.el, forms-pass.el: Move to ../etc/forms directory.
 +
 +      * international/mule.el (find-auto-coding): Make "unibyte: t" obsolete.
 +
 +2012-05-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * loadup.el: Preload newcomment.el.
 +      * newcomment.el: Move autoload-only code to toplevel.
 +
 +      * buff-menu.el (list-buffers--refresh): Mark `size' as right-align.
 +      * emacs-lisp/tabulated-list.el (tabulated-list-init-header):
 +      Handle new :right-align column property.
 +      (tabulated-list-print-col): Idem, plus use `display' text-property to
 +      try and preserve alignment for variable pitch fonts.
 +
 +2012-05-07  Chong Yidong  <cyd@gnu.org>
 +
 +      * emacs-lisp/tabulated-list.el: Add no-header-line alternative.
 +      (tabulated-list-use-header-line): New var.
 +      (tabulated-list-init-header): Use it.
 +      (tabulated-list-print-fake-header): New function.
 +      (tabulated-list-print): Use it.
 +      (tabulated-list-sort-button-map): Add non-header-line commands.
 +      (tabulated-list-init-header): Add column name property to basic
 +      labels as well.
 +      (tabulated-list-col-sort): Handle non-header-line button case.
 +      (tabulated-list--sort-by-column-name): Fix a corner case.
 +
 +      * buff-menu.el (list-buffers--refresh):
 +      Handle Buffer-menu-use-header-line.
 +
 +2012-05-06  Chong Yidong  <cyd@gnu.org>
 +
 +      * buff-menu.el: Convert to Tabulated List mode.
 +      (Buffer-menu-buffer+size-width): Make obsolete.
 +      (Buffer-menu-name-width, Buffer-menu-size-width): New variables.
 +      (Buffer-menu-mode-map): Inherit from tabulated-list-mode-map.
 +      (Buffer-menu-mode): Derive from tabulated-list-mode.  Move command
 +      documentation into docstring of buffer-menu.
 +      (Buffer-menu-toggle-files-only): Add an informative message.
 +      (Buffer-menu-sort): Convert to alias for tabulated-list-sort.
 +      (Buffer-menu-buffer, Buffer-menu-beginning, Buffer-menu-mark)
 +      (Buffer-menu-unmark, Buffer-menu-backup-unmark)
 +      (Buffer-menu-delete, Buffer-menu-save, Buffer-menu-not-modified)
 +      (Buffer-menu-execute, Buffer-menu-select)
 +      (Buffer-menu-marked-buffers, Buffer-menu-toggle-read-only)
 +      (Buffer-menu-bury): Use Tabulated List machinery.
 +      (Buffer-menu-mouse-select, Buffer-menu-sort-by-column)
 +      (Buffer-menu-sort-button-map, Buffer-menu-make-sort-button):
 +      Delete.
 +      (list-buffers--refresh): New function.
 +      (list-buffers-noselect): Use it.
 +      (tabulated-list-entry-size->, Buffer-menu--pretty-name)
 +      (Buffer-menu--pretty-file-name): New helper functions.
 +
 +      * loadup.el: Preload tabulated-list.
 +
 +      * emacs-lisp/tabulated-list.el (tabulated-list-sort): Rename from
 +      tabulated-list-sort-column.
 +      (tabulated-list-init-header): Add the initial aligning space even
 +      if tabulated-list-padding is zero.
 +
 +2012-05-06  Christopher Schmidt  <christopher@ch.ristopher.com>
 +
 +      * emacs-lisp/cl-macs.el (cl-expr-contains): Handle cons cells
 +      whose cdr is not a cons cell correctly (bug#11038).
 +
 +2012-05-06  Chong Yidong  <cyd@gnu.org>
 +
 +      * emacs-lisp/tabulated-list.el (tabulated-list-format):
 +      Accept additional plist in column descriptors.
 +      (tabulated-list-init-header): Obey it.
 +      (tabulated-list-get-entry): New function.
 +      (tabulated-list-put-tag): Use it.  Use string-width instead of
 +      length.
 +      (tabulated-list--column-number): New function.
 +      (tabulated-list-print): Use it.
 +      (tabulated-list-print-col): New function.
 +      Set `tabulated-list-column-name' property on each column's text.
 +      (tabulated-list-print-entry): Use it.
 +      (tabulated-list-delete-entry, tabulated-list-set-col):
 +      New functions.
 +      (tabulated-list-sort-column): New command (Bug#11337).
 +
 +      * buff-menu.el (list-buffers): Move C-x C-b binding from
 +      buff-menu.el to bindings.el.
 +
 +      * ebuff-menu.el (Electric-buffer-menu-undefined): Use the
 +      :advertised-binding feature.
 +
 +2012-05-06  Troels Nielsen  <bn.troels@gmail.com>  (tiny change)
 +
 +      * progmodes/compile.el (compilation-internal-error-properties):
 +      Calculate start position correctly when end-col is set but
 +      end-line is not (Bug#11382).
 +
 +2012-05-06  Wolfgang Jenkner  <wjenkner@inode.at>
 +
 +      * man.el (Man-unindent): Use text-property-default-nonsticky to
 +      prevent untabify from inheriting face properties (Bug#11408).
 +
 +2012-05-05  Glenn Morris  <rgm@gnu.org>
 +
 +      * calendar/cal-html.el: Optionally include holidays in the output.
 +      Suggested by Ed Reingold <reingold@emr.cs.iit.edu>.
 +      (cal-html-holidays): New option.
 +      (cal-html-css-default): Add holiday entry.
 +      (holiday-in-range): Autoload it.
 +      (cal-html-htmlify-entry): Add optional class argument.
 +      (cal-html-htmlify-list): Add optional holidays argument.
 +      (cal-html-insert-agenda-days): Include holidays in the output.
 +      (cal-html-one-month): Maybe include holidays.
 +
 +      * calendar/holidays.el (holiday-in-range):
 +      Move here from cal-tex-list-holidays.
 +      * calendar/cal-tex.el (cal-tex-list-holidays):
 +      Make it an obsolete alias for holiday-in-range.  Update all callers.
 +
 +2012-05-05  Chong Yidong  <cyd@gnu.org>
 +
 +      * select.el (xselect--encode-string): Always use utf-8 for TEXT on
 +      Nextstep.
 +
 +2012-05-05  Ransom Williams  <auvergnerw@gmail.com>  (tiny change)
 +
 +      * files.el (file-auto-mode-skip): New var.
 +      (set-auto-mode-1): Use it.
 +
 +2012-05-05  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * repeat.el: Use lexical-binding.
 +      (repeat-last-self-insert, repeat-num-input-keys-at-self-insert)
 +      (repeat-undo-count): Remove.
 +      (repeat):
 +      * progmodes/octave-mod.el (octave-abbrev-start):
 +      * progmodes/f90.el (f90-abbrev-start):
 +      * face-remap.el (text-scale-adjust):
 +      * kmacro.el (kmacro-call-macro): Use set-temporary-overlay-map.
 +
 +      * emacs-lisp/pcase.el (pcase--let*): New function.
 +      (pcase--expand, pcase-codegen, pcase--q1): Use it to reduce nesting
 +      a bit more.
 +      (pcase--split-pred): Be more clever about ruling out overlap between
 +      a predicate and some constant pattern.
 +      (pcase--q1): Use `null' instead of (eq foo nil).
 +
 +      * subr.el (setq-local, defvar-local): New macros.
 +      (kbd): Redefine as an alias.
 +      (with-selected-window): Leave unrelated frames alone.
 +      (set-temporary-overlay-map): New function.
 +
 +2012-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * subr.el (user-error): New function.
 +      * window.el (switch-to-buffer):
 +      * vc/smerge-mode.el (smerge-resolve-function, smerge-resolve)
 +      (smerge-match-conflict):
 +      * simple.el (previous-matching-history-element)
 +      (next-matching-history-element, goto-history-element, undo-more)
 +      (undo-start):
 +      * progmodes/etags.el (visit-tags-table-buffer, find-tag-tag)
 +      (find-tag-noselect, find-tag-in-order, etags-goto-tag-location)
 +      (next-file, tags-loop-scan, list-tags, complete-tag):
 +      * progmodes/compile.el (compilation-loop):
 +      * mouse.el (mouse-minibuffer-check):
 +      * man.el (Man-bgproc-sentinel, Man-goto-page):
 +      * info.el (Info-find-node-2, Info-extract-pointer, Info-history-back)
 +      (Info-history-forward, Info-follow-reference, Info-menu)
 +      (Info-extract-menu-item, Info-extract-menu-counting)
 +      (Info-forward-node, Info-backward-node, Info-next-menu-item)
 +      (Info-last-menu-item, Info-next-preorder, Info-last-preorder)
 +      (Info-next-reference, Info-prev-reference, Info-index)
 +      (Info-index-next, Info-follow-nearest-node)
 +      (Info-copy-current-node-name):
 +      * imenu.el (imenu--make-index-alist)
 +      (imenu-default-create-index-function, imenu-add-to-menubar):
 +      * files.el (basic-save-buffer, recover-file):
 +      * emacs-lisp/easy-mmode.el (easy-mmode-define-navigation):
 +      * emacs-lisp/checkdoc.el (checkdoc-continue, checkdoc-comments)
 +      (checkdoc-message-text, checkdoc-defun):
 +      * dabbrev.el (dabbrev-completion, dabbrev--abbrev-at-point):
 +      * cus-edit.el (customize-changed-options, customize-rogue)
 +      (customize-saved, custom-variable-set, custom-variable-mark-to-save)
 +      (custom-variable-mark-to-reset-standard)
 +      (custom-variable-reset-backup, custom-face-mark-to-reset-standard)
 +      (custom-file):
 +      * completion.el (check-completion-length):
 +      * comint.el (comint-search-arg)
 +      (comint-previous-matching-input-string-position)
 +      (comint-previous-matching-input)
 +      (comint-replace-by-expanded-history-before-point, comint-send-input)
 +      (comint-copy-old-input, comint-backward-matching-input)
 +      (comint-goto-process-mark, comint-set-process-mark):
 +      * calendar/calendar.el (calendar-cursor-to-date): Use it.
 +      * bindings.el (debug-ignored-errors): Remove regexps, add `user-error'.
 +
 +2012-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * dabbrev.el (dabbrev--ignore-case-p): New function.
 +      (dabbrev-completion, dabbrev-expand, dabbrev--substitute-expansion):
 +      Use it.
 +
 +      * files.el (automount-dir-prefix): Mark as obsolete.
 +
 +2012-05-04  Glenn Morris  <rgm@gnu.org>
 +
 +      * patcomp.el, play/bruce.el: Move to obsolete/.
 +
 +2012-05-04  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fix minor Y10k bugs.
 +      * arc-mode.el (archive-unixdate):
 +      * autoinsert.el (auto-insert-alist):
 +      * calc/calc-forms.el (math-this-year):
 +      * emacs-lisp/copyright.el (copyright-current-year)
 +      (copyright-update-year, copyright):
 +      * tar-mode.el (tar-clip-time-string):
 +      * time.el (display-time-update):
 +      Don't assume years have 4 digits.
 +
 +2012-05-04  Chong Yidong  <cyd@gnu.org>
 +
 +      * dos-w32.el (file-name-buffer-file-type-alist)
 +      (direct-print-region-use-command-dot-com):
 +      * ffap.el (ffap-menu-regexp):
 +      * find-file.el (ff-special-constructs):
 +      * follow.el (follow-debug):
 +      * forms.el (forms--debug):
 +      * iswitchb.el (iswitchb-all-frames):
 +      * ido.el (ido-all-frames):
 +      * emacs-lisp/timer.el (timer-max-repeats):
 +      * mail/feedmail.el (feedmail-mail-send-hook)
 +      (feedmail-mail-send-hook-queued):
 +      * mail/footnote.el (footnote-signature-separator):
 +      * mail/mailabbrev.el (mail-alias-separator-string)
 +      (mail-abbrev-mode-regexp):
 +      * mail/rmail.el (rmail-speedbar-match-folder-regexp):
 +      * progmodes/idlwave.el (idlwave-libinfo-file)
 +      (idlwave-default-completion-case-is-down)
 +      (idlwave-library-routines): Convert defvars to defcustoms.
 +
 +      * mail/rmail.el (rmail-decode-mime-charset):
 +      * progmodes/idlw-shell.el (idlwave-shell-print-expression-function)
 +      (idlwave-shell-fix-inserted-breaks)
 +      (idlwave-shell-activate-alt-keybindings)
 +      (idlwave-shell-use-breakpoint-glyph):
 +      * facemenu.el (facemenu-unlisted-faces): Delete obsolete vars.
 +
 +2012-05-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * minibuffer.el (completion--twq-all): Beware completion-ignore-case.
 +
 +2012-05-03  Wilson Snyder  <wsnyder@wsnyder.org>
 +
 +      * progmodes/verilog-mode.el (font-lock-keywords):
 +      Fix mis-highligting auto.  Reported by Craig Barner.
 +      (verilog-auto, verilog-auto-undef): Add AUTOUNDEF to remove
 +      defines from global name space. Reported by Dan Dever.
 +      (verilog-auto-reset, verilog-auto-reset-widths)
 +      (verilog-auto-tieoff): Support using unbased numbers for
 +      AUTORESET and AUTOTIEOFF.
 +      (verilog-submit-bug-report): Update variable list.
 +      (verilog-read-auto-params): Fix AUTOINPUT regexps containing
 +      parenthesis from not matching. Reported by Michael Rytting.
 +      (verilog-auto-template-lint): Fix hash error when linting modules
 +      with no used templates.
 +      (verilog-warn, verilog-warn-error)
 +      (verilog-warn-fatal): When non-interactive report multiple
 +      warnings before exiting.  Suggested by Brad Dobbie.
 +      (verilog-auto-template-lint, verilog-auto-template-warn-unused)
 +      (verilog-read-auto-template): Add `verilog-auto-template-warn-unused'
 +      to report unused template errors.  Reported by Brad Dobbie.
 +      (verilog-read-decls): Fix AUTOWIRE etc on supply0, supply1 type
 +      nets, bug438. Reported by Vns Blore.
 +      (verilog-auto-inout-module, verilog-auto-reg)
 +      (verilog-read-decls, verilog-read-sub-decls-sig)
 +      (verilog-signals-edit-wire-reg, verilog-signals-with):
 +      Fix passing of Verilog data types in ANSI input/output ports
 +      such as "output logic" into the AUTOs. Special case "wire" and
 +      "reg" for backwards compatibility presuming Verilog 2001.
 +      (verilog-auto-ascii-enum): Add "auto enum" as alias.
 +      (verilog-preprocess): Fix replication of preprocess output.
 +      Reported by Brad Dobbie.
 +      (verilog-auto-inst-interfaced-ports):
 +      Create verilog-auto-inst-interfaced-ports, bug429.
 +      Reported by Julian Gorfajn.
 +      (verilog-after-save-font-hook)
 +      (verilog-before-save-font-hook): New variable.
 +      (verilog-modi-cache-results, verilog-save-font-mod-hooked)
 +      (verilog-save-font-mods): Wrap disabling fontification, reported
 +      by David Rogoff.
 +      (verilog-do-indent, verilog-pretty-declarations-auto)
 +      (verilog-sk-def-reg): Fix obeying `verilog-auto-lineup', bug305.
 +      Reported by Pierre-David Pfister.
 +      (verilog-set-auto-endcomments): Fix endtask auto comments outside
 +      of class declarations, bug292.  Reported by Kevin Heilman.
 +      (verilog-read-decls): Fix 'parameter type' not appearing in
 +      AUTOINSTPARAM, bug340.  Reported by Jonathan Greenlaw.
 +      (verilog-auto-logic): Fix when AUTOLOGIC present to properly do
 +      AUTOINPUTs, bug411. Reported by Jonathan Greenlaw.
 +      (verilog-read-auto-lisp): Avoid syntax-ppss warning on AUTOLISP.
 +      Reported by David Kravitz.
 +
 +2012-05-03  Michael McNamara  <mac@mail.brushroad.com>
 +
 +      * progmodes/verilog-mode.el (verilog-pretty-expr): Don't line up
 +      assignment with tests in ifs and for loops.
 +      (verilog-extended-complete-re, verilog-complete-reg): Change so
 +      that DPI inport functions don't look like fuction declarations.
 +      (verilog-pretty-expr): Don't line up assignment
 +      operations to the test and increment in if and for loops
 +      (verilog-extended-complete-re, verilog-complete-reg): Change so
 +      that DPI inport functions don't look like fuction declarations
 +
 +2012-05-03  Kenichi Handa  <handa@m17n.org>
 +
 +      * mail/rmailmm.el (rmail-show-mime): Catch an error caused by text
 +      decoding, and show a warning message without signalling an error
 +      (Bug#11282).
 +
 +2012-05-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * emacs-lisp/bytecomp.el
 +      (byte-compile-file-form-custom-declare-variable): Compile all elements,
 +      since cconv.el might have introduced :fun-body, internal-make-closure,
 +      and friends for bytecomp to handle (bug#11391).
 +      * custom.el (defcustom): Avoid ((λ ..) ..).
 +
 +2012-05-02  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * subr.el (read-passwd): Better clean after ourselves (bug#11392).
 +
 +2012-05-02  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * notifications.el (dbus-debug):
 +      * term/linux.el (gpm-mouse-enable):
 +      * term/screen.el (xterm-register-default-colors): Declare.
 +
 +2012-05-02  Chong Yidong  <cyd@gnu.org>
 +
 +      * cus-start.el (gc-cons-percentage, exec-suffixes)
 +      (dos-display-scancodes, dos-hyper-key, dos-super-key)
 +      (dos-keypad-mode, debug-on-signal, vertical-centering-font-regexp)
 +      (make-cursor-line-fully-visible, void-text-area-pointer)
 +      (font-list-limit): Add customization data.
 +
 +      * allout.el (allout-exposure-change-functions)
 +      (allout-structure-added-functions)
 +      (allout-structure-deleted-functions)
 +      (allout-structure-shifted-functions): Rename abnormal hooks from
 +      *-hook, and convert to defcustoms.
 +      (allout-after-copy-or-kill-hook, allout-post-undo-hook):
 +      Convert to defcustoms.
 +      (allout-mode-hook, allout-mode-deactivate-hook): Doc fix.
 +
 +      * allout-widgets.el: Hook callers changed.
 +
 +2012-05-02  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * mail/rmail.el (rmail-yank-current-message): Use the encoding of
 +      the yanked message in preference to the default value of
 +      buffer-file-coding-system.
 +
 +2012-05-02  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * window.el (display-buffer--action-function-custom-type):
 +      Fix entry.
 +
 +2012-05-02  Alan Mackenzie  <acm@muc.de>
 +
 +      * progmodes/cc-defs.el (c-version): Update to 5.32.3.
 +
 +2012-05-01  Glenn Morris  <rgm@gnu.org>
 +
 +      * cus-start.el (suggest-key-bindings): Remove, now it is in Lisp.
 +
 +      * eshell/esh-cmd.el (eshell-debug-command): Doc fix.  Add :set.
 +
 +      * cus-edit.el (custom-variable-documentation): Simplify with format.
 +
 +2012-05-01  Aaron S. Hawley  <aaron.s.hawley@gmail.com>
 +            Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * simple.el (suggest-key-bindings, execute-extended-command):
 +      Move from keyboard.c.
 +
 +2012-05-01  Chong Yidong  <cyd@gnu.org>
 +
 +      * follow.el: Eliminate advice.
 +      (set-process-filter, process-filter, sit-for): Advice deleted.
 +      (follow-mode-off-hook): Obsolete hook removed.
 +      (follow-avoid-tail-recenter-p, follow-process-filter-alist):
 +      Vars deleted.
 +      (follow-auto): Use a :set function.
 +      (follow-mode): Rewritten.  Don't advise process filters.
 +      (follow-switch-to-current-buffer-all, follow-scroll-up)
 +      (follow-scroll-down): Assume follow-mode is bound.
 +      (follow-comint-scroll-to-bottom)
 +      (follow-align-compilation-windows): New functions.
 +      (follow--window-sorter): New function.
 +      (follow-all-followers): Use it to explicitly sort windows by their
 +      positions; don't make assumptions about next-window order.
 +      (follow-windows-start-end, follow-delete-other-windows-and-split)
 +      (follow-calc-win-start): Doc fix.
 +      (follow-windows-aligned-p, follow-select-if-visible): Don't call
 +      vertical-motion unnecessarily.
 +      (follow-adjust-window): New function.
 +      (follow-post-command-hook): Use it.
 +      (follow-call-set-process-filter, follow-call-process-filter)
 +      (follow-intercept-process-output, follow-tidy-process-filter-alist)
 +      (follow-stop-intercept-process-output, follow-generic-filter):
 +      Functions deleted.
 +      (follow-scroll-bar-toolkit-scroll, follow-scroll-bar-drag)
 +      (follow-scroll-bar-scroll-up, follow-scroll-bar-scroll-down):
 +      New functions, replacing advice on scroll-bar-* commands.
 +      (follow-mwheel-scroll): New function (Bug#4112).
 +
 +      * comint.el (comint-adjust-point): New function.
 +      (comint-postoutput-scroll-to-bottom): Use it.
 +      Call follow-comint-scroll-to-bottom for Follow mode buffers.
 +
 +2012-05-01  Glenn Morris  <rgm@gnu.org>
 +
 +      * term/AT386.el, term/apollo.el, term/bobcat.el, term/cygwin.el:
 +      * term/iris-ansi.el, term/linux.el, term/lk201.el, term/news.el:
 +      * term/screen.el, term/vt102.el, term/vt125.el, term/vt200.el:
 +      * term/vt201.el, term/vt220.el, term/vt240.el, term/vt300.el:
 +      * term/vt320.el, term/vt400.el, term/vt420.el, term/wyse50.el:
 +      Remove no-byte-compile setting.
 +
 +2012-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * minibuffer.el (completion-table-with-quoting): Fix compatibility
 +      all-completions code to not return a number in the last cdr.
 +
 +2012-04-30  Leo Liu  <sdl.web@gmail.com>
 +
 +      * ibuf-ext.el (ibuffer-diff-buffer-with-file-1): Avoid buffer
 +      read-only error.
 +
 +2012-04-29  Chong Yidong  <cyd@gnu.org>
 +
 +      * follow.el (follow-calc-win-end): Rewrite to handle partial
 +      screen lines correctly (Bug#8390).
 +      (follow-avoid-tail-recenter): Minor cleanup.
 +
 +2012-04-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      Avoid the obsolete `assoc' package.
 +      * speedbar.el (speedbar-refresh): Avoid adelete.
 +      (speedbar-file-lists): Simplify and avoid aput.
 +      * man.el (Man--sections, Man--refpages): New vars, replacing
 +      Man-sections-alist and Man-refpages-alist.
 +      (Man-build-section-alist, Man-build-references-alist):
 +      Use them; avoid aput.
 +      (Man--last-section, Man--last-refpage): New vars.
 +      (Man-follow-manual-reference): Use them.
 +      Use the `default' arg of completing-read.
 +      (Man-goto-section): Idem.  Move prompt to the `interactive' spec.
 +
 +2012-04-27  Chong Yidong  <cyd@gnu.org>
 +
 +      * vc/diff.el (diff-sentinel): Go to bob (Bug#10259).
 +
 +      * startup.el (x-apply-session-resources): New function.
 +
 +      * term/ns-win.el (ns-initialize-window-system):
 +      * term/w32-win.el (w32-initialize-window-system):
 +      * term/x-win.el (x-initialize-window-system): Use it to properly
 +      set menu-bar-mode and other vars from X resources, even if the
 +      initial frame is not a window-system frame (Bug#2299).
 +
 +      * subr.el (read-key): Avoid running filter function when setting
 +      up temporary tool bar entries (Bug#9922).
 +
 +2012-04-27  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * vc/vc-git.el (vc-git-state): Fix regexp matching diff output.
 +      (Bug#11344)
 +
 +2012-04-27  Chong Yidong  <cyd@gnu.org>
 +
 +      * select.el (xselect--encode-string): New function, split from
 +      xselect-convert-to-string.
 +      (xselect-convert-to-string): Use it.
 +      (xselect-convert-to-filename, xselect-convert-to-os)
 +      (xselect-convert-to-host, xselect-convert-to-user): Ensure that
 +      returned strings are properly encoded (Bug#11315).
 +
 +2012-04-27  Chong Yidong  <cyd@gnu.org>
 +
 +      * simple.el (delete-active-region): Move to killing custom group.
 +
 +2012-04-27  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * progmodes/which-func.el (which-func-current): Quote %
 +      characters for mode-line processing.
 +
 +2012-04-27  Chong Yidong  <cyd@gnu.org>
 +
 +      * xml.el (xml-parse-region, xml-parse-tag): Avoid errors due to
 +      reaching eob (Bug#11286).
 +
 +2012-04-27  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * progmodes/gdb-mi.el (gdb-control-level): New variable.
 +      (gdb): Make it buffer-local and init to zero.
 +      (gdb-control-commands-regexp): New variable.
 +      (gdb-send): Don't wrap in "-interpreter-exec console" if
 +      gdb-control-level is positive.  Increment gdb-control-level
 +      whenever the command matches gdb-control-commands-regexp, and
 +      decrement it each time the command is "end".  (Bug#11279)
 +
 +2012-04-27  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * window.el (adjust-window-trailing-edge, enlarge-window)
 +      (shrink-window, window-resize):
 +      * mouse.el (mouse-drag-line): Fix resizing of minibuffer
 +      windows (Bug#11276).
 +
 +2012-04-27  Chong Yidong  <cyd@gnu.org>
 +
 +      * progmodes/pascal.el (pascal--extra-indent): Rename from ind, to
 +      fix "missing prefix" warning.  All callers changed.
 +
 +2012-04-27  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * emacs-lisp/assoc.el: Move to obsolete/.
 +
 +2012-04-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * emacs-lisp/assoc.el (aget): Fix dynamic-scoping issue (bug#11352).
 +
 +      * term/ns-win.el (ns-define-service):
 +      * progmodes/pascal.el (pascal-goto-defun):
 +      * progmodes/js.el (js--read-tab):
 +      * progmodes/etags.el (tags-lazy-completion-table):
 +      * emacs-lisp/syntax.el (syntax-propertize-via-font-lock):
 +      * emacs-lisp/ewoc.el (ewoc--wrap):
 +      * emacs-lisp/assoc.el (aput, adelete, amake):
 +      * doc-view.el (doc-view-convert-current-doc):
 +      * vc/diff.el (diff-no-select): Replace lexical-let by lexical-binding.
 +
 +2012-04-26  Chong Yidong  <cyd@gnu.org>
 +
 +      * image.el (image-type-from-buffer): Only return supported image
 +      type (Bug#9045).
 +
 +      * vc/diff-mode.el (diff-beginning-of-hunk): Return a meaningful
 +      value, for symmetry with diff-end-of-hunk.
 +      (diff-split-hunk, diff-find-source-location)
 +      (diff-ignore-whitespace-hunk, diff-refine-hunk): Use it.
 +      (diff-bounds-of-hunk, diff-bounds-of-file): New functions.
 +      (diff-restrict-view, diff-hunk-kill, diff-file-kill): Use them to
 +      compute the relevant hunk or file properly (Bug#6005).
 +      (diff-file-junk-re): Add bzr's "modified file" tag (Bug#6041).
 +
 +2012-04-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * vc/vc-mtn.el:
 +      * vc/vc-hg.el:
 +      * vc/vc-git.el:
 +      * vc/vc-dir.el:
 +      * vc/vc-cvs.el:
 +      * vc/vc-bzr.el:
 +      * vc/vc-arch.el:
 +      * vc/vc.el: Replace lexical-let by lexical-binding.
 +      * minibuffer.el (lazy-completion-table): Avoid ((λ ...) ...).
 +      * emacs-lisp/cl-macs.el (lexical-let): Fix use in lexical-binding.
 +      * emacs-lisp/cconv.el (cconv-analyse-form): Warn use of ((λ ...) ...).
 +
 +2012-04-26  Chong Yidong  <cyd@gnu.org>
 +
 +      * vc/diff-mode.el (diff-undo): New command (Bug#5302).
 +      (diff-mode-shared-map): Bind it to / and [remap undo].
 +
 +      * vc/ediff-wind.el (ediff-setup-windows-default): New function.
 +      (ediff-window-setup-function): Use it as the default, to set up
 +      windows based on whether the current frame is graphical (Bug#2138).
 +      (ediff-choose-window-setup-function-automatically): Make obsolete.
 +
 +      * vc/ediff-init.el: Always define ediff-pixel-width/height.
 +
 +2012-04-25  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * ffap.el: Remove old code for obsolete package.
 +      (ffap-complete-as-file-p): Remove.
 +
 +      Use completion-table-with-quoting for comint and pcomplete.
 +      * comint.el (comint--unquote&requote-argument)
 +      (comint--unquote-argument, comint--requote-argument): New functions.
 +      (comint--unquote&expand-filename, comint-unquote-filename): Obsolete.
 +      (comint-quote-filename): Use regexp-opt-charset.
 +      (comint--common-suffix, comint--common-quoted-suffix)
 +      (comint--table-subvert): Remove.
 +      (comint-unquote-function, comint-requote-function): New vars.
 +      (comint--complete-file-name-data): Use them with
 +      completion-table-with-quoting.
 +      * pcmpl-unix.el (pcomplete/scp): Use completion-table-subvert.
 +      * pcomplete.el (pcomplete-arg-quote-list)
 +      (pcomplete-quote-arg-hook, pcomplete-quote-argument): Obsolete.
 +      (pcomplete-unquote-argument-function): Default to non-nil.
 +      (pcomplete-unquote-argument): Simplify.
 +      (pcomplete--common-quoted-suffix): Remove.
 +      (pcomplete-requote-argument-function): New var.
 +      (pcomplete--common-suffix): New function.
 +      (pcomplete-completions-at-point): Use completion-table-with-quoting
 +      and completion-table-subvert.
 +
 +      * minibuffer.el: Use completion-table-with-quoting for read-file-name.
 +      (minibuffer--double-dollars): Preserve properties.
 +      (completion--sifn-requote): New function.
 +      (completion--file-name-table): Rewrite using it and c-t-with-quoting.
 +
 +      * minibuffer.el: Add support for completion of quoted/escaped data.
 +      (completion-table-with-quoting, completion-table-subvert): New funs.
 +      (completion--twq-try, completion--twq-all): New functions.
 +      (completion--nth-completion): New function.
 +      (completion-try-completion, completion-all-completions): Use it.
 +
 +2012-04-25  Leo Liu  <sdl.web@gmail.com>
 +
 +      * progmodes/python.el (python-pdbtrack-get-source-buffer):
 +      Use compilation-message if available to find real filename.
 +
 +2012-04-25  Chong Yidong  <cyd@gnu.org>
 +
 +      * vc/diff-mode.el (diff-setup-whitespace): New function.
 +      (diff-mode): Use it.
 +
 +      * vc/diff.el (diff-sentinel):
 +      * vc/vc.el (vc-diff-finish): Call diff-setup-whitespace to assign
 +      Whitespace mode variables based on diff style (Bug#8612).
 +
 +2012-04-25  Leo Liu  <sdl.web@gmail.com>
 +
 +      * progmodes/python.el (python-send-region): Add suffix .py to the
 +      temp file.
 +
 +      * files.el (auto-mode-alist): Use javascript-mode instead.
 +
 +2012-04-25  Alex Harsanyi  <AlexHarsanyi@gmail.com>
 +
 +      Sync with soap-client repository.  Support SOAP simpleType (Bug#10331).
 +
 +      * soap-client.el (soap-resolve-references-for-sequence-type)
 +      (soap-resolve-references-for-array-type): Hack to prevent self
 +      references, see Bug#9.
 +      (soap-parse-envelope): Report the contents of the 'detail' node
 +      when receiving a fault reply.
 +      (soap-parse-envelope): Report the contents of the entire 'detail' node.
 +
 +      * soap-inspect.el (soap-sample-value-for-simple-type)
 +      (soap-inspect-simple-type): New function.
 +
 +      * soap-client.el (soap-simple-type): New struct.
 +      (soap-default-xsd-types, soap-default-soapenc-types)
 +      (soap-decode-basic-type, soap-encode-basic-type):
 +      support unsignedInt and double basic types.
 +      (soap-resolve-references-for-simple-type)
 +      (soap-parse-simple-type, soap-encode-simple-type): New function.
 +      (soap-parse-schema): Parse xsd:simpleType declarations.
 +
 +      * soap-client.el (soap-default-xsd-types)
 +      (soap-default-soapenc-types): Add integer, byte and anyURI types.
 +      (soap-parse-complex-type-complex-content): Use `soap-wk2l' to find
 +      the local name of "soapenc:Array".
 +      (soap-decode-basic-type, soap-encode-basic-type): Support encoding
 +      decoding integer, byte and anyURI xsd types.
 +
 +2012-04-25  Chong Yidong  <cyd@gnu.org>
 +
 +      * cus-edit.el (custom-buffer-create-internal): Update header text.
 +
 +2012-04-25  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * progmodes/gdb-mi.el (gdb-init-1): Condition Windows-specific
 +      settings on 'system-type', not on 'window-system'.  On MS-Windows,
 +      set interactive-mode on in GDB.
 +
 +2012-04-24  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * progmodes/ruby-mode.el: Simplify last change, and cleanup code.
 +      (ruby-syntax-propertize-regexp): Remove.
 +      (ruby-syntax-propertize-function): Split regexp into chunks.
 +      Match following code directly.
 +
 +2012-04-24  Dmitry Gutov  <dgutov@yandex.ru>
 +
 +      * progmodes/ruby-mode.el: Handle Cucumber defs (bug#6286).
 +      (ruby-syntax-propertize-regexp): New function.
 +      (ruby-syntax-propertize-function): Use it to handle regexp not preceded
 +      by a special keyword.
 +
 +      * progmodes/ruby-mode.el: Handle general delimited literals (bug#6286).
 +      (ruby-syntax-general-delimiters-goto-beg)
 +      (ruby-syntax-propertize-general-delimiters): New functions.
 +      (ruby-syntax-propertize-function): Use them to handle GDL.
 +      (ruby-font-lock-keywords): Move old handling of GDL...
 +      (ruby-font-lock-syntactic-keywords): .. to here.
 +      (ruby-calculate-indent): Adjust indentation for GDL.
 +
 +2012-04-24  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * notifications.el (top): Remove unneeded declarations.
 +      (notifications-specification-version): Change to "1.2".
 +      (notifications-interface, notifications-notify-method)
 +      (notifications-close-notification-method): Fix docstring.
 +      (notifications-get-capabilities-method): New defconst.
 +      (notifications-notify): Add :action-items, :resident and
 +      :transient hints.  Change "image_data" to "image-data" and
 +      "image_path" to "image-path".
 +      (notifications-get-capabilities): New defun.
 +
 +2012-04-24  Leo Liu  <sdl.web@gmail.com>
 +
 +      * progmodes/python.el: Move hideshow setup to the end.
 +
 +2012-04-24  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * window.el (handle-select-window): Clear echo area since this is
 +      no more done by read_char (Bug#11304).
 +
 +2012-04-24  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * ibuffer.el (ibuffer-mode-map): Bind `/ m' to filter-used-mode
 +      and `/ M' to filter-derived-mode.
 +      * ibuf-ext.el (ibuffer-list-buffer-modes): Simplify; avoid add-to-list.
 +      (ibuffer-filter-by-mode, ibuffer-filter-by-used-mode)
 +      (ibuffer-mark-by-mode): Use default rather than initial-input.
 +      (ibuffer-filter-by-derived-mode): Autoload and require-match.
 +
 +2012-04-24  Ivan Andrus  <darthandrus@gmail.com>  (tiny change)
 +
 +      * ibuf-ext.el (ibuffer-list-buffer-modes): Add `include-parents' arg.
 +      (ibuffer-filter-by-derived-mode): New filter.
 +      * ibuffer.el (ibuffer-mode-map): Bind to `/ w'.
 +
 +2012-04-23  Andreas Politz  <politza@fh-trier.de>
 +
 +      * subr.el (accept-change-group): Fix arg usage (Bug#6095).
 +
 +2012-04-23  Chong Yidong  <cyd@gnu.org>
 +
 +      * cus-edit.el (customize-apropos, customize-apropos-options):
 +      Disable matching of non-option variables (Bug#11176).
 +      (customize-option, customize-option-other-window)
 +      (customize-changed-options): Doc fix.
 +      (customize-apropos-options, customize-apropos-faces)
 +      (customize-apropos-groups): Use apropos-read-pattern (Bug#11124).
 +
 +      * apropos.el (apropos-read-pattern): Make prompt less cryptic.
 +      Fix word list splitting (Bug#11132).
 +      (apropos-symbol, apropos-keybinding, apropos-label)
 +      (apropos-property, apropos-function-button)
 +      (apropos-variable-button, apropos-misc-button): New faces.
 +      (apropos-symbol-face, apropos-keybinding-face)
 +      (apropos-label-face, apropos-property-face, apropos-match-face):
 +      Variables removed (Bug#8396).
 +      (apropos-library-button, apropos-format-plist, apropos-print)
 +      (apropos-print-doc, apropos-describe-plist): Callers changed.
 +
 +2012-04-23  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * net/xesam.el (xesam-mode-map): Use let-bound map in
 +      initialization.  (Bug#11292)
 +
 +2012-04-23  Agustín Martín Domingo  <agustin.martin@hispalinux.es>
 +
 +      Preserve ispell session localwords when switching back to
 +      original buffer.
 +
 +      * ispell.el (ispell-buffer-session-localwords): New buffer-local
 +      variable to hold buffer session localwords.
 +      (ispell-kill-ispell): add option 'clear to delete session
 +      localwords.
 +      (ispell-command-loop, ispell-change-dictionary)
 +      (ispell-buffer-local-words): Preserve session localwords when
 +      needed.
 +
 +      * flyspell.el (flyspell-process-localwords, flyspell-do-correct):
 +      Preserve session localwords when needed.
 +
 +2012-04-23  Agustín Martín Domingo  <agustin.martin@hispalinux.es>
 +
 +      * ispell.el (ispell-insert-word) Remove unneeded function using
 +      obsolete `translation-table-for-input'.
 +      (ispell-word, ispell-process-line, ispell-complete-word):
 +      Use plain `insert' instead of removed `ispell-insert-word'.
 +
 +2012-04-22  Chong Yidong  <cyd@gnu.org>
 +
 +      * cus-edit.el (custom-variable-menu)
 +      (custom-variable-reset-saved, custom-face-menu)
 +      (custom-face-reset-saved): If there is no saved value, make the
 +      "reset-saved" operation bring back the default (Bug#9509).
 +      (custom-face-state): Properly detect themed faces.
 +
 +      * faces.el (face-spec-set): Stop supporting deprecated form of
 +      third arg.
 +
 +2012-04-22  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      Move functions from C to Lisp.  Make non-blocking method calls
 +      the default.  Implement further D-Bus standard interfaces.
 +
 +      * net/dbus.el (dbus-message-internal): Declare function.
 +      Remove unneeded function declarations.
 +      (defvar dbus-message-type-invalid, dbus-message-type-method-call)
 +      (dbus-message-type-method-return, dbus-message-type-error)
 +      (dbus-message-type-signal): Declare variables.  Remove local
 +      definitions.
 +      (dbus-interface-dbus, dbus-interface-peer)
 +      (dbus-interface-introspectable, dbus-interface-properties)
 +      (dbus-path-emacs, dbus-interface-emacs, dbus-return-values-table):
 +      Adapt docstring.
 +      (dbus-interface-objectmanager): New defconst.
 +      (dbus-call-method, dbus-call-method-asynchronously)
 +      (dbus-send-signal, dbus-method-return-internal)
 +      (dbus-method-error-internal, dbus-register-service)
 +      (dbus-register-signal, dbus-register-method): New defuns, moved
 +      from dbusbind.c
 +      (dbus-call-method-handler, dbus-setenv)
 +      (dbus-get-all-managed-objects, dbus-managed-objects-handler):
 +      New defuns.
 +      (dbus-call-method-non-blocking): Make it an obsolete function.
 +      (dbus-unregister-object, dbus-unregister-service)
 +      (dbus-handle-event, dbus-register-property)
 +      (dbus-property-handler): Obey the new structure of
 +      `bus-registered-objects'.
 +      (dbus-introspect): Use `dbus-call-method'.  Use a timeout.
 +      (dbus-get-property, dbus-set-property, dbus-get-all-properties):
 +      Use `dbus-call-method'.
 +
 +2012-04-22  Chong Yidong  <cyd@gnu.org>
 +
 +      * cus-edit.el (custom-commands, custom-reset-menu)
 +      (Custom-reset-standard): Tweak labels.
 +      (custom-reset-button-menu): Change default to t.
 +      (custom-buffer-create-internal): For the custom-reset-button-menu
 +      case, put the revert button first.
 +      (custom-group-subtitle): New face.
 +      (custom-group-value-create): Align docstring to a specific column.
 +
 +      * wid-edit.el (widget-documentation-link-add): Don't handle
 +      indentation in this function.
 +      (widget-documentation-string-indent-to): New function.
 +      (widget-documentation-string-value-create): Use it.
 +
 +      * autorevert.el (auto-revert):
 +      * epg-config.el (epg):
 +      * ibuffer.el (ibuffer):
 +      * mpc.el (mpc):
 +      * ses.el (ses):
 +      * eshell/eshell.el (eshell):
 +      * net/ange-ftp.el (ange-ftp):
 +      * progmodes/ebnf2ps.el (postscript):
 +      * progmodes/flymake.el (flymake):
 +      * progmodes/prolog.el (prolog):
 +      * progmodes/verilog-mode.el (verilog-mode):
 +      * progmodes/which-func.el (which-func):
 +      * term/xterm.el (xterm):
 +      * textmodes/picture.el (picture):
 +      * textmodes/tildify.el (tildify):
 +      * vc/ediff.el (ediff): Tweak defgroups to improve presentation in
 +      customization buffers.
 +
 +2012-04-22  Alan Mackenzie  <acm@muc.de>
 +
 +      * progmodes/cc-engine.el (c-append-lower-brace-pair-to-state-cache):
 +      Adding a ) can hide the resulting (..) from searches.  Fix it.
 +      Bound the backward search to the position of the existing (.
 +
 +2012-04-21  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * progmodes/verilog-mode.el (verilog-mode): Check whether
 +      which-func-modes is t before adding verilog-mode.
 +      Reported by Andy Moreton <andrewjmoreton@gmail.com>.
 +
 +2012-04-21  Leo Liu  <sdl.web@gmail.com>
 +
 +      * net/rcirc.el (rcirc): Avoid error when process-contact returns t.
 +
 +2012-04-21  Michael Vehrs  <Michael.Burschik@gmx.de>
 +
 +      * woman.el: Add support for "T{ T}" tbl syntax, and fix the
 +      filling of the last column of a table (Bug#5635).
 +      (woman-find-next-control-line): New arg, specifying an additional
 +      regexp component for the control line.
 +      (woman2-roff-buffer): Use it.
 +      (woman-break-table): New function.
 +      (woman2-TS): Use it.
 +
 +2012-04-21  Chong Yidong  <cyd@gnu.org>
 +
 +      * woman.el (woman-set-buffer-display-table, woman-decode-region)
 +      (woman-horizontal-escapes, woman-negative-vertical-space)
 +      (woman-tab-to-tab-stop, woman2-fc, woman2-TS)
 +      (WoMan-warn-ignored): Use ?\s instead of ?\ .
 +
 +2012-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * minibuffer.el (completion-file-name-table): Complete user names.
 +
 +2012-04-20  Leo Liu  <sdl.web@gmail.com>
 +
 +      * font-lock.el (lisp-font-lock-keywords-2): Add pcase, pcase-let
 +      and pcase-let*.
 +
 +2012-04-20  Chong Yidong  <cyd@gnu.org>
 +
 +      * server.el (server-execute): Respect initial-buffer-choice if it
 +      is a string and there are no files to open (Bug#2825).
 +      (server-create-window-system-frame, server-create-tty-frame):
 +      Don't switch buffers here.
 +      (server-process-filter): Only try to open a window system frame if
 +      compiled with graphical support (Bug#8314).
 +
 +2012-04-20  Dan Nicolaescu  <dann@gnu.org>
 +
 +      * battery.el (battery-echo-area-format): Display remaining time
 +      for sysfs backend too (Bug#11269).
 +      (battery-linux-sysfs): Fix conditional for the charge.
 +
 +2012-04-20  Chong Yidong  <cyd@gnu.org>
 +
 +      * progmodes/gdb-mi.el (gdb): Revert previous change.
 +      (gdb-inferior-io--init-proc): New function.
 +      (gdb-init-1): Use it.
 +      (gdb-inferior-io-sentinel): New sentinel for the gdb-inferior pty,
 +      responsible for allocating a new pty and hooking it to gdb when
 +      the old pty gets an EIO due to process exit.
 +      (gdb-delchar-or-quit): New command.  Bind it in gdb-mi buffers.
 +      (gdb-tooltip-print): Don't use obsolete tooltip-use-echo-area.
 +      (gdb-inferior-io--maybe-delete-pty): Move into gdb-reset.
 +
 +2012-04-20  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * window.el (window-min-size, window-sizable, window-min-delta)
 +      (window-max-delta, window--resizable, window-resizable)
 +      (window-total-size, window-full-height-p, window-full-width-p)
 +      (window-in-direction, window--resize-mini-window, window-resize)
 +      (window--resize-child-windows-normal)
 +      (window--resize-child-windows, window--resize-siblings)
 +      (window--resize-this-window, adjust-window-trailing-edge)
 +      (enlarge-window, shrink-window): Doc fixes.
 +
 +2012-04-20  Chong Yidong  <cyd@gnu.org>
 +
 +      * progmodes/gdb-mi.el (gdb-inferior-io--maybe-delete-pty):
 +      New function to call delete-process on the gdb-inferior buffer's pty.
 +      (gdb-reset): Use it, instead of relying on kill-buffer to kill the
 +      pty process (Bug#11273).
 +      (gdb-update): New arg to suppress talking to the gdb process.
 +      (gdb-done-or-error): Use it.
 +      (gdb-stopped-functions): Rename from gdb-stopped-hooks.
 +      (gdb): Call gdb-inferior-io--maybe-delete-pty as a workaround for
 +      sentinel not being called.
 +
 +      * comint.el (make-comint-in-buffer, comint-exec): Doc fix.
 +
 +      * progmodes/grep.el (grep, rgrep): Doc fix (Bug#11268).
 +
 +2012-04-20  Glenn Morris  <rgm@gnu.org>
 +
 +      * net/network-stream.el (open-network-stream): Doc fix.
 +
 +2012-04-20  Chong Yidong  <cyd@gnu.org>
 +
 +      * emacs-lisp/tabulated-list.el (tabulated-list-print): Fix typos.
 +
 +2012-04-20  Alan Mackenzie  <acm@muc.de>
 +
 +      Ensure searching for keywords is case sensitive.
 +
 +      * progmodes/cc-cmds.el (c-electric-brace, c-electric-lt-gt)
 +      (c-electric-paren, c-beginning-of-defun, c-end-of-defun)
 +      (c-defun-name, c-mark-function, c-cpp-define-name)
 +      (c-comment-indent, c-scan-conditionals, c-indent-defun)
 +      (c-context-line-break): Bind case-fold-search to nil.
 +
 +      * progmodes/cc-mode.el (c-font-lock-fontify-region):
 +      Bind case-fold-search to nil.
 +
 +2012-04-20  Chong Yidong  <cyd@gnu.org>
 +
 +      * mail/sendmail.el (mail-bury): Call return action with the right
 +      Rmail buffer (Bug#11242).
 +
 +      * server.el (server-process-filter): Handle corner case where both
 +      tty and nowait options are present (Bug#11102).
 +
 +2012-04-20  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * version.el (emacs-bzr-version, emacs-bzr-get-version): Doc fixes.
 +      (top level): Put into the executable the ident-style '$Id:' tag on
 +      windows-nt as well.
 +
 +2012-04-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * electric.el (electric-indent-post-self-insert-function): Check that
 +      electric-indent-mode is enabled in current buffer.
 +
 +2012-04-19  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * imenu.el (imenu-progress-message): Restore; it is "used" in
 +      erc/erc-imenu.el and net/snmp-mode.el.
 +
 +2012-04-19  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * avoid.el (mouse-avoidance-mode): Mark unused arg.
 +      (mouse-avoidance-nudge-mouse): Remove unused binding.
 +
 +      * bs.el (bs-toggle-readonly): Call `toggle-read-only' interactively.
 +
 +      * descr-text.el (describe-char):
 +      * progmodes/python.el (python-describe-symbol):
 +      Don't call `toggle-read-only', set `buffer-read-only'.
 +
 +      * imenu.el (imenu-default-goto-function): Mark unused args.
 +      (imenu-progress-message): Remove obsolete macro; all callers changed.
 +
 +      * subr.el (keymap-canonicalize): Remove unused binding.
 +      (read-passwd): Mark unused arg.
 +
 +      * tutorial.el (tutorial--display-changes): Remove unused binding.
 +      (tutorial--save-tutorial-to): Remove unused variable.
 +
 +      * emacs-lisp/package.el (define-package, package-menu-mark-delete)
 +      (package-menu-mark-install, package-menu-mark-unmark): Mark unused args.
 +      (package-generate-autoloads, package-menu--generate)
 +      (package-menu--find-upgrades): Remove unused bindings.
 +
 +      * emulation/cua-rect.el (cua-restrict-regexp-rectangle)
 +      (cua-restrict-prefix-rectangle): Doc fixes.  Remove unused bindings.
 +      (cua--mouse-ignore, cua--delete-rectangle, cua--extract-rectangle)
 +      (cua--indent-rectangle, cua-open-rectangle, cua-close-rectangle)
 +      (cua-blank-rectangle, cua-string-rectangle, cua-replace-in-rectangle)
 +      (cua-incr-rectangle, cua-sequence-rectangle, cua--convert-rectangle-as)
 +      (cua--rectangle-aux-replace, cua--left-fill-rectangle)
 +      (cua-scroll-rectangle-up, cua-scroll-rectangle-down)
 +      (cua-delete-char-rectangle): Mark unused args.
 +      (cua-align-rectangle): Remove unused binding.
 +
 +      * mail/rmail.el (compilation--message->loc)
 +      (epa--find-coding-system-for-mime-charset): Declare.
 +
 +      * net/dbus.el (dbus-register-service): Declare.
 +      (dbus-name-owner-changed-handler): Remove unused binding.
 +
 +      * nxml/nxml-mode.el (nxml-electric-slash, nxml-in-mixed-content-p)
 +      (nxml-compute-indent-from-matching-start-tag): Remove unused variables.
 +      (nxml-scan-backward-within): Mark unused arg.
 +      (nxml-dynamic-markup-word): Remove unused binding.
 +
 +      * mouse.el (mouse-menu-major-mode-map):
 +      * emacs-lisp/authors.el (authors-scan-change-log)
 +      (authors-add-to-author-list):
 +      * emacs-lisp/avl-tree.el (avl-tree--enter-balance):
 +      * emacs-lisp/smie.el (smie-auto-fill):
 +      * mail/sendmail.el (mail-bury):
 +      * mail/unrmail.el (unrmail):
 +      * net/tls.el (open-tls-stream):
 +      * textmodes/picture.el (picture-mouse-set-point):
 +      Remove unused bindings.
 +
 +2012-04-19  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * net/tramp.el (tramp-action-password): Let-bind
 +      `enable-recursive-minibuffers' to t.
 +
 +2012-04-18  Sam Steingold  <sds@gnu.org>
 +
 +      * progmodes/gud.el (gud-key-prefix): Use :type 'key-sequence
 +      instead of 'string to accommodate values like [f11].
 +      Always use `vconcat' instead of `concat' on it, like in `gud-def'.
 +      * progmodes/gdb-mi.el: Likewise.
 +
 +2012-04-18  Leo Liu  <sdl.web@gmail.com>
 +
 +      * abbrev.el (edit-abbrevs): Move point to the abbrev table of
 +      current buffer.
 +      (prepare-abbrev-list-buffer): Enter edit-abbrevs-mode only if
 +      LOCAL is nil.
 +
 +2012-04-18  Chong Yidong  <cyd@gnu.org>
 +
 +      * simple.el (line-move): Use forward-line if in batch mode
 +      (Bug#11053).
 +
 +2012-04-18  Christopher Schmidt  <christopher@ch.ristopher.com>
 +
 +      * files.el (after-find-file): Do not try to add a final newline if
 +      the buffer is read-only (Bug#11156).
 +
 +2012-04-17  Richard Stallman  <rms@gnu.org>
 +
 +      * mail/rmail.el (rmail-start-mail):
 +      Pass (rmail-mail-return...) for the return-action.
 +      Pass (rmail-yank-current-message...) for the yank-action.
 +      (rmail-yank-current-message): New function.
 +      (rmail-mail): Pass the Rmail buffer, not view buffer, for replybuffer.
 +      (rmail-reply): Likewise.
 +      (rmail-forward): Pass the Rmail buffer, not nil, for replybuffer.
 +
 +      * mail/sendmail.el (mail-bury): Choose the first rmail-mode
 +      buffer, not the last.  Reject temp buffers.  Use the rmail-mode
 +      buffer, not newbuf.
 +
 +2012-04-17  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * server.el (server-ensure-safe-dir): Simplify.
 +
 +2012-04-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * emacs-lisp/smie.el: Provide smarter auto-filling.
 +      (smie-auto-fill): New function.
 +      (smie-setup): Use it.
 +
 +      * newcomment.el (comment-choose-indent): Obey comment-inline-offset.
 +
 +2012-04-17  Philipp Haselwarter  <philipp.haselwarter@gmx.de>  (tiny change)
 +
 +      * newcomment.el (comment-inline-offset): New custom var (bug#11090).
 +      (comment-indent): Use it.
 +
 +2012-04-17  Vincent Belaïche  <vincentb1@users.sourceforge.net>
 +
 +      * ses.el: The overall change is to add cell renaming, that is
 +      setting fancy names for cell symbols other than name matching
 +      "\\`[A-Z]+[0-9]+\\'" regexp .
 +      (ses-localvars): Add ses--renamed-cell-symb-list.
 +      (ses-create-cell-variable): New defun.
 +      (ses-destroy-cell-variable-range): Respect ses--numrows, ses--numcols.
 +      (ses-relocate-formula): Relocate formulas only for cells the
 +      symbols of which are not renamed, i.e. symbols whose names do not
 +      match regexp "\\`[A-Z]+[0-9]+\\'".
 +      (ses-relocate-all): Relocate values only for cells the symbols of
 +      which are not renamed.
 +      (ses-load): Create cells variables as the (ses-cell ...) are read,
 +      in order to check row col consistency with cell symbol name only
 +      for cells that are not renamed.
 +      (ses-replace-name-in-formula): New defun.
 +      (ses-rename-cell): New defun.
 +
 +2012-04-17  Peter Oliver  <bzr@mavit.org.uk>  (tiny change)
  
 -2012-05-16  Chong Yidong  <cyd@gnu.org>
 +      * progmodes/perl-mode.el (perl-indent-parens-as-block):
 +      New option (bug#11118).
 +      (perl-calculate-indent): Respect it.
  
 -      * net/gnutls.el (gnutls-min-prime-bits): Improve docstring.
 +2012-04-17  Glenn Morris  <rgm@gnu.org>
  
 -2012-05-15  Chong Yidong  <cyd@gnu.org>
 +      * dired-aux.el (dired-mark-read-string): Doc fix.
  
 -      * help.el (describe-mode): Doc fix.
 +2012-04-17  Dmitry Antipov  <dmantipov@yandex.ru>
  
 -      * net/gnutls.el (gnutls-min-prime-bits): Default to 256 (Bug#11267).
 +      * dired-aux.el (dired-mark-read-string): Offer optional completion.
 +      (dired-do-chxxx): Complete chown, chgrp over users, groups.  (Bug#7900)
  
 -2012-05-06  Troels Nielsen  <bn.troels@gmail.com>  (tiny change)
 +2012-04-17  Glenn Morris  <rgm@gnu.org>
  
 -      * progmodes/compile.el (compilation-internal-error-properties):
 -      Calculate start position correctly when end-col is set but
 -      end-line is not (Bug#11382).
 +      * mouse.el (mouse-drag-track):
 +      * speedbar.el (speedbar-frame-mode):
 +      Use auto-hscroll-mode rather than the alias automatic-hscrolling.
  
 -2012-05-11  Stefan Monnier  <monnier@iro.umontreal.ca>
 +2012-04-16  Leo Liu  <sdl.web@gmail.com>
  
 -      * net/rlogin.el (rlogin-mode-map): Fix last change.
 +      * progmodes/python.el: Trivial cleanup.
  
 -2012-05-09  Jason L. Wright  <jason.wright@inl.gov>  (tiny change)
 +2012-04-16  Glenn Morris  <rgm@gnu.org>
  
 -      * mail/smtpmail.el (smtpmail-send-command): Send the command and
 -      the following \r\n using a single `process-send-string', since the
 -      Lotus SMTP server refuses to accept any commands if they are sent
 -      with two `process-send-string's (bug#11444).
 +      * vc/vc.el (vc-string-prefix-p):
 +      * vc/pcvs-util.el (cvs-string-prefix-p):
 +      * textmodes/tex-mode.el (latex-string-prefix-p, tex-string-prefix-p):
 +      * mpc.el (mpc-string-prefix-p):
 +      Make all of these into obsolete aliases for string-prefix-p.
 +      Update callers.
 +      * vc/pcvs.el, vc/vc-dispatcher.el, vc/vc-dir.el: Update callers.
  
 -2012-05-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 +      * textmodes/two-column.el: Move custom options to the start.
 +      (frame-width): Remove compat definition.
 +      (2C-associate-buffer, 2C-dissociate):
 +      Use with-current-buffer rather than save-excursion.
 +      (2C-dissociate): Force a mode-line update.
 +      (2C-autoscroll): Use ignore-errors.
  
 -      * shell.el (shell-parse-pcomplete-arguments): Obey
 -      pcomplete-arg-quote-list inside double-quoted args as well (bug#11348).
 +      * emacs-lisp/eieio-opt.el (describe-class, describe-generic):
 +      Autoload trivia.
  
 -2012-05-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 +      * emacs-lisp/cl-extra.el (*random-state*):
 +      Remove unnecessary declaration.
  
 -      * shell.el (shell-completion-vars): Fix last change (bug#11348).
 +      * calendar/cal-tex.el (cal-tex-end-document): Trivial clarification.
  
 -2012-05-07  Chong Yidong  <cyd@gnu.org>
 +      * play/cookie1.el (cookie-snarf):
 +      Give an explicit error if input file cannot be read.
  
 -      * ansi-color.el (ansi-color-process-output): Check for validity of
 -      comint-last-output-start before using it.  This avoids a bad
 -      interaction with gdb-mi's input/output buffer.
 +      * play/yow.el (yow-file): Use expand-file-name rather than concat.
  
 -2012-05-06  Glenn Morris  <rgm@gnu.org>
 +      * progmodes/perl-mode.el (c-macro-expand):
 +      Remove unnecessary autoload (it is in loaddefs.el).
  
 -      * files.el (dir-locals-read-from-file):
 -      Mention dir-locals in any error message.
 +      * textmodes/picture.el (picture-desired-column)
 +      (picture-update-desired-column): Convert comments to doc-strings.
 +      (picture-substitute): Remove function.
 +      (picture-mode-map): Initialize in the defvar.
  
 -2012-05-06  Chong Yidong  <cyd@gnu.org>
 +      * woman.el: Remove eval-after-load for tar-mode.
 +      * tar-mode.el (tar-mode-map): Add woman binding and menu entry.
 +      (woman-tar-extract-file): Autoload it.
  
 -      * emacs-lisp/package.el (package-built-in-p): Handle the `emacs'
 -      package (Bug#11410).
 +      * frame.el (automatic-hscrolling): Make this alias obsolete.
  
 -2012-05-05  Chong Yidong  <cyd@gnu.org>
 +2012-04-12  Agustín Martín Domingo  <agustin.martin@hispalinux.es>
  
 -      * emacs-lisp/package.el (package-buffer-info): Avoid putting local
 -      variables into description.
 +      * ispell.el (ispell-set-spellchecker-params): Post-process
 +      `ispell-dictionary-alist' to use [:alpha:] and utf-8 if possible.
 +      (ispell-dictionary-base-alist): Revert to original XEmacs
 +      friendly version for default.  [:alpha:] will be added in
 +      `ispell-set-spellchecker-params' if needed
  
 -2012-05-05  Stefan Monnier  <monnier@iro.umontreal.ca>
 +2012-04-16  Chong Yidong  <cyd@gnu.org>
  
 -      * shell.el (shell-completion-vars): Set pcomplete-arg-quote-list like
 -      shell-delimiter-argument-list (bug#11348).
 -      (shell-parse-pcomplete-arguments): Obey pcomplete-arg-quote-list.
 +      * image.el (imagemagick--extension-regexp): New variable.
 +      (imagemagick-register-types): Use it.
 +      (imagemagick-types-inhibit): Add :set function.  Allow new value
 +      of t to inhibit all types.
  
 -2012-05-04  Chong Yidong  <cyd@gnu.org>
 +      * emacs-lisp/regexp-opt.el (regexp-opt-charset): Avoid cl macros,
 +      so we can preload it.
  
 -      * select.el (xselect--encode-string): Always use utf-8 for TEXT on
 -      Nextstep.
 +      * loadup.el (fboundp): Preload regexp-opt, needed by
 +      imagemagick-register-types.
  
 -2012-05-03  Kenichi Handa  <handa@m17n.org>
 +2012-04-15  Chong Yidong  <cyd@gnu.org>
  
 -      * mail/rmailmm.el (rmail-show-mime): Catch an error caused by text
 -      decoding, and show a warning message without signalling an error
 -      (Bug#11282).
 +      * frame.el (scrolling): Remove nearly unused customization group.
  
 -2012-04-30  Eli Zaretskii  <eliz@gnu.org>
 +      * scroll-all.el (scroll-all-mode): Move to windows group.
  
 -      * mail/rmail.el (rmail-yank-current-message): Use the encoding of
 -      the yanked message in preference to the default value of
 -      buffer-file-coding-system.
 +2012-04-15  Chong Yidong  <cyd@gnu.org>
  
 -2012-04-30  Martin Rudalics  <rudalics@gmx.at>
 +      * bindings.el (goto-map): Bind goto-char to M-g c (Bug#11240).
  
 -      * window.el (display-buffer--action-function-custom-type):
 -      Fix entry.
 +2012-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
  
 -2012-04-27  Alan Mackenzie  <acm@muc.de>
 +      Avoid the use of ((lambda ...) ...) in lexical-binding code.
 +      * emacs-lisp/easy-mmode.el (define-minor-mode): Use funcall (bug#11241).
  
 -      * progmodes/cc-defs.el (c-version): Update to 5.32.3.
 +2012-04-15  Glenn Morris  <rgm@gnu.org>
  
 -2012-04-27  Chong Yidong  <cyd@gnu.org>
 +      * simple.el (process-file-side-effects): Doc fix.
  
 -      * subr.el (read-key): Avoid running filter function when setting
 -      up temporary tool bar entries (Bug#9922).
 +2012-04-15  Glenn Morris  <rgm@gnu.org>
  
 -2012-04-26  Andreas Schwab  <schwab@linux-m68k.org>
 +      * international/mule-cmds.el (set-language-environment): Doc fix.
  
 -      * vc/vc-git.el (vc-git-state): Fix regexp matching diff output.
 -      (Bug#11344)
 +2012-04-14  Juanma Barranquero  <lekktu@gmail.com>
  
 -2012-04-24  Chong Yidong  <cyd@gnu.org>
 +      * server.el (server-auth-key, server-generate-key): Doc fixes.
 +      (server-get-auth-key): Doc fix.  Use `string-match-p'.
 +      (server-start): Reflow docstring.
  
 -      * select.el (xselect--encode-string): New function, split from
 -      xselect-convert-to-string.
 -      (xselect-convert-to-string): Use it.
 -      (xselect-convert-to-filename, xselect-convert-to-os)
 -      (xselect-convert-to-host, xselect-convert-to-user): Ensure that
 -      returned strings are properly encoded (Bug#11315).
 +2012-04-14  Lars Ingebrigtsen  <larsi@gnus.org>
  
 -2012-04-22  Chong Yidong  <cyd@gnu.org>
 +      * server.el (server-generate-key): `called-interactively-p'
 +      requires a parameter.
  
 -      * simple.el (delete-active-region): Move to killing custom group.
 +2012-04-14  Michal Nazarewicz  <mina86@mina86.com>
  
 -2012-04-21  Andreas Schwab  <schwab@linux-m68k.org>
 +      * server.el (server-auth-key): New variable.
 +      (server-generate-key, server-get-auth-key): New function.
 +      (server-start): Use the new variable and functions to allow
 +      setting a permanent server key (bug#9423).
  
 -      * progmodes/which-func.el (which-func-current): Quote %
 -      characters for mode-line processing.
 +2012-04-14  Leo Liu  <sdl.web@gmail.com>
  
 -2012-04-21  Chong Yidong  <cyd@gnu.org>
 +      * vc/diff-mode.el (diff-file-prev/next): Fix typo.
  
 -      * xml.el (xml-parse-region, xml-parse-tag): Avoid errors due to
 -      reaching eob (Bug#11286).
 +2012-04-14  Paul Eggert  <eggert@cs.ucla.edu>
  
 -2012-04-20  Richard Stallman  <rms@gnu.org>
 +      Spelling fixes.
 +      * hexl.el (hexl-rulerize): Rename from hexl-rulerise, since
 +      Emacs uses American spelling.
  
 -      Fix logic for returning to and yanking from Rmail buffer.
 +2012-04-14  Juanma Barranquero  <lekktu@gmail.com>
  
 -      * mail/rmail.el (rmail-start-mail):
 -      Pass (rmail-mail-return...) for the return-action.
 -      Pass (rmail-yank-current-message...) for the yank-action.
 -      (rmail-yank-current-message): New function.
 -      (rmail-mail): Pass the Rmail buffer, not view buffer, for replybuffer.
 -      (rmail-reply): Likewise.
 -      (rmail-forward): Pass the Rmail buffer, not nil, for replybuffer.
 +      * emacs-lock.el (emacs-lock-locked-buffer-functions): New hook.
 +      (emacs-lock--exit-locked-buffer): Return the locked buffer.  Doc fix.
 +      (emacs-lock--kill-emacs-hook, emacs-lock--kill-emacs-query-functions)
 +      (emacs-lock--kill-buffer-query-functions): Run new hook.  (Bug#11017)
  
 -      * mail/sendmail.el (mail-bury): Choose the first rmail-mode
 -      buffer, not the last.  Reject temp buffers.  Use the rmail-mode
 -      buffer, not newbuf.
 +2012-04-14  Stefan Monnier  <monnier@iro.umontreal.ca>
  
 -2012-04-20  Eli Zaretskii  <eliz@gnu.org>
 +      * progmodes/which-func.el (which-func-modes): Change default.
  
 -      * progmodes/gdb-mi.el (gdb-control-level): New variable.
 -      (gdb): Make it buffer-local and init to zero.
 -      (gdb-control-commands-regexp): New variable.
 -      (gdb-send): Don't wrap in "-interpreter-exec console" if
 -      gdb-control-level is positive.  Increment gdb-control-level
 -      whenever the command matches gdb-control-commands-regexp, and
 -      decrement it each time the command is "end".  (Bug#11279)
 +2012-04-14  Kim F. Storm  <storm@cua.dk>
  
 -2012-04-20  Martin Rudalics  <rudalics@gmx.at>
 +      * emulation/cua-base.el (cua-exchange-point-and-mark): Just call
 +      exchange-point-and-mark if cua-enable-cua-keys is nil (Bug#11191).
  
 -      * window.el (adjust-window-trailing-edge, enlarge-window)
 -      (shrink-window, window-resize):
 -      * mouse.el (mouse-drag-line): Fix resizing of minibuffer
 -      windows (Bug#11276).
 +2012-04-14  Chong Yidong  <cyd@gnu.org>
  
 -2012-04-20  Dan Nicolaescu  <dann@gnu.org>
 +      * custom.el (custom-theme-set-variables): Doc fix.
  
 -      * battery.el (battery-echo-area-format): Display remaining time
 -      for sysfs backend too (Bug#11269).
 -      (battery-linux-sysfs): Fix conditional for the charge.
 +2012-04-14  Glenn Morris  <rgm@gnu.org>
  
 -2012-04-20  Chong Yidong  <cyd@gnu.org>
 +      * international/mule.el (set-auto-coding-for-load): Doc fix.
  
 -      * progmodes/gdb-mi.el (gdb): Revert 2012-04-19 change.
 -      (gdb-inferior-io--init-proc): New function.
 -      (gdb-init-1): Use it.
 -      (gdb-inferior-io-sentinel): New sentinel for the gdb-inferior pty,
 -      responsible for allocating a new pty and hooking it to gdb when
 -      the old pty gets an EIO due to process exit.
 -      (gdb-delchar-or-quit): New command.  Bind it in gdb-mi buffers.
 -      (gdb-tooltip-print): Don't use obsolete tooltip-use-echo-area.
 -      (gdb-inferior-io--maybe-delete-pty): Move into gdb-reset.
 +2012-04-14  Alan Mackenzie  <acm@muc.de>
  
 -2012-04-20  Eli Zaretskii  <eliz@gnu.org>
 +      * progmodes/cc-menus.el (cc-imenu-objc-generic-expression): Make
 +      imenu work again for Objective C Mode.  Correct the *-index values,
 +      these having been disturbed by a previous change in 2011-08.
  
 -      * window.el (window-min-size, window-sizable, window-min-delta)
 -      (window-max-delta, window--resizable, window-resizable)
 -      (window-total-size, window-full-height-p, window-full-width-p)
 -      (window-in-direction, window--resize-mini-window, window-resize)
 -      (window--resize-child-windows-normal)
 -      (window--resize-child-windows, window--resize-siblings)
 -      (window--resize-this-window, adjust-window-trailing-edge)
 -      (enlarge-window, shrink-window): Doc fixes.
 +      * progmodes/cc-engine.el (c-before-change-check-<>-operators):
 +      Correct two search limits.
  
 -2012-04-19  Chong Yidong  <cyd@gnu.org>
 +2012-04-14  Stefan Monnier  <monnier@iro.umontreal.ca>
  
 -      * progmodes/gdb-mi.el (gdb-inferior-io--maybe-delete-pty):
 -      New function to call delete-process on the gdb-inferior buffer's pty.
 -      (gdb-reset): Use it, instead of relying on kill-buffer to kill the
 -      pty process (Bug#11273).
 -      (gdb-update): New arg to suppress talking to the gdb process.
 -      (gdb-done-or-error): Use it.
 -      (gdb-stopped-functions): Rename from gdb-stopped-hooks.
 -      (gdb): Call gdb-inferior-io--maybe-delete-pty as a workaround for
 -      sentinel not being called.
 +      * startup.el (command-line-1): Inhibit splash from daemon (bug#10996).
  
 -      * comint.el (make-comint-in-buffer, comint-exec): Doc fix.
 +2012-04-14  Andreas Schwab  <schwab@linux-m68k.org>
  
 -2012-04-18  Chong Yidong  <cyd@gnu.org>
 +      * international/characters.el: Fix sorting.
  
 -      * progmodes/grep.el (grep, rgrep): Doc fix (Bug#11268).
 +2012-04-14  Eli Zaretskii  <eliz@gnu.org>
  
 -2012-04-18  Glenn Morris  <rgm@gnu.org>
 +      * international/characters.el: Add more missing Latin case pairs.
  
 -      * net/network-stream.el (open-network-stream): Doc fix.
 +2012-04-14  Glenn Morris  <rgm@gnu.org>
  
 -2012-04-17  Chong Yidong  <cyd@gnu.org>
 +      * files.el (dir-locals-set-class-variables): Doc fix.
  
 -      * emacs-lisp/tabulated-list.el (tabulated-list-print): Fix typos.
 +2012-04-14  Eli Zaretskii  <eliz@gnu.org>
  
 -2012-04-16  Alan Mackenzie  <acm@muc.de>
 +      * international/characters.el: Add set-case-syntax-pair call for
 +      LATIN CAPITAL LETTER Y WITH DIAERESIS RET and its lower-case
 +      counterpart.  (Bug#11209)
  
 -      Ensure searching for keywords is case sensitive.
 +      * simple.el (shell-command-on-region): Doc fix.  (Bug#11208)
  
 -      * progmodes/cc-cmds.el (c-electric-brace, c-electric-lt-gt)
 -      (c-electric-paren, c-beginning-of-defun, c-end-of-defun)
 -      (c-defun-name, c-mark-function, c-cpp-define-name)
 -      (c-comment-indent, c-scan-conditionals, c-indent-defun)
 -      (c-context-line-break): bind case-fold-search to nil.
 +2012-04-14  Glenn Morris  <rgm@gnu.org>
  
 -      * progmodes/cc-mode.el (c-font-lock-fontify-region):
 -      bind case-fold-search to nil.
 +      * calendar/holidays.el (calendar-check-holidays): Doc fix.
  
 -2012-04-16  Chong Yidong  <cyd@gnu.org>
 +2012-04-14  Eli Zaretskii  <eliz@gnu.org>
  
 -      * mail/sendmail.el (mail-bury): Call return action with the right
 -      Rmail buffer (Bug#11242).
 +      * textmodes/ispell.el (ispell-dictionary-base-alist):
 +      Add data for Hebrew.
  
 -2012-04-15  Chong Yidong  <cyd@gnu.org>
 +2012-04-14  Chong Yidong  <cyd@gnu.org>
  
 -      * server.el (server-process-filter): Handle corner case where both
 -      tty and nowait options are present (Bug#11102).
 +      * net/rcirc.el (rcirc-cmd-quit):
 +      Revert 2012-03-18 change (Bug#11192).
  
 -2012-04-15  Glenn Morris  <rgm@gnu.org>
 +2012-04-14  Glenn Morris  <rgm@gnu.org>
  
 -      * simple.el (process-file-side-effects): Doc fix.
 +      * pcmpl-rpm.el (pcomplete/rpm): Handle -qf.
  
 -2012-04-14  Glenn Morris  <rgm@gnu.org>
 +2012-04-14  Eli Zaretskii  <eliz@gnu.org>
  
 -      * international/mule-cmds.el (set-language-environment): Doc fix.
 +      * minibuffer.el (completion-in-region-mode-map):
 +      Bind completion-help-at-point to M-? rather than ?.  (Bug#11182)
  
 -2012-04-14  Stefan Monnier  <monnier@iro.umontreal.ca>
 +2012-04-13  Vivek Dasmohapatra  <vivek@etla.org>
  
 -      Avoid the use of ((lambda ...) ...) in lexical-binding code.
 -      * emacs-lisp/easy-mmode.el (define-minor-mode):Use funcall (bug#11241).
 +      * hexl.el (hexl-insert-char): Make display sizes other than 16 work.
  
 -2012-04-13  Kim F. Storm  <storm@cua.dk>
 +2012-04-13  Masatake YAMATO  <yamato@redhat.com>
  
 -      * emulation/cua-base.el (cua-exchange-point-and-mark): Just call
 -      exchange-point-and-mark if cua-enable-cua-keys is nil (Bug#11191).
 +      * minibuffer.el (minibuffer-local-filename-syntax): New variable
 +      to allow `C-M-f' and `C-M-b' to move to the nearest path
 +      separator (bug#9511).
  
 -2012-04-12  Chong Yidong  <cyd@gnu.org>
 +2012-04-13  Lars Ingebrigtsen  <larsi@gnus.org>
  
 -      * custom.el (custom-theme-set-variables): Doc fix.
 +      * avoid.el: Require cl when compiling.  And also move the
 +      `provide' to the end.
 +
 +2012-04-13  Thierry Volpiatto  <thierry.volpiatto@gmail.com>
 +
 +      * avoid.el (mouse-avoidance-banish-position): New variable.
 +      (mouse-avoidance-banish-destination): Use it (bug#10165).
 +
 +2012-04-13  Leo Liu  <sdl.web@gmail.com>
 +
 +      * progmodes/which-func.el (which-func-modes): Add objc-mode.
 +
 +2012-04-13  Ken Brown  <kbrown@cornell.edu>
 +
 +      * net/browse-url.el (browse-url-file-url): Remove Cygwin hack;
 +      this is no longer needed now that cygstart understands file:// URLs.
 +      (browse-url-filename-alist): For the same reason, don't modify
 +      file:// URLs on Cygwin.
 +
 +2012-04-13  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * emulation/cua-base.el (cua--pre-command-handler-1): Don't activate
 +      the region on shift if the binding is already shifted (bug#11221).
  
  2012-04-12  Glenn Morris  <rgm@gnu.org>
  
 -      * international/mule.el (set-auto-coding-for-load): Doc fix.
 +      * mail/mailpost.el: Move to obsolete/.
 +
 +2012-04-12  Drew Adams  <drew.adams@oracle.com>
 +
 +      * imenu.el (imenu--generic-function): Ignore invisible definitions
 +      (bug#10123).
 +
 +2012-04-12  Vivek Dasmohapatra  <vivek@etla.org>
 +
 +      * hexl.el (hexl-bits): New variable.
 +      (hexl-options): Mention the variable in the doc string.
 +      (hexl-rulerise, hexl-line-displen): New functions.
 +      (hexl-mode): Mention the new variable.
 +      (hexl-mode, hexl-current-address, hexl-current-address):
 +      Use the displen.
 +      (hexl-ascii-start-column): New function.
 +      (hexl-address-to-marker, hexl-beginning-of-line, hexl-options)
 +      (hexl-insert-char, hexl-mode-ruler): Use the displen (bug#4941).
 +
 +2012-04-12  Agustín Martín Domingo  <agustin.martin@hispalinux.es>
 +
 +      * textmodes/flyspell.el (flyspell-large-region): For hunspell, use
 +      '("-i" ENCODING), in 2 separate command-line arguments, to specify
 +      the encoding, as expected by hunspell.
 +
 +2012-04-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * battery.el (battery--linux-sysfs-regexp): New const.
 +      (battery-status-function): Use it.  Remove yeeloong special case.
 +      (battery-yeeloong-sysfs): Remove.
 +      (battery-echo-area-format): Remove yeeloong special case.
  
  2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
  
        * imenu.el (imenu-add-to-menubar): `current-local-map' can be nil.
 -      Reported by Noah Friedman.  Backport from trunk.
 +      Reported by Noah Friedman.
  
 -2012-04-11  Alan Mackenzie  <acm@muc.de>
 +      * subr.el (read-passwd): Use read-string.
  
 -      * progmodes/cc-menus.el (cc-imenu-objc-generic-expression):
 -      Make imenu work again for Objective C Mode.  Correct the *-index
 -      values, these having been disturbed by a previous change in 2011-08.
 +2012-04-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
  
 -      * progmodes/cc-engine.el (c-before-change-check-<>-operators):
 -      Correct two search limits.
 +      * vcursor.el (vcursor-move): Increase the priority of the overlay
 +      (bug#9663).
 +
 +2012-04-11  Deniz Dogan  <deniz.a.m.dogan@gmail.com>
 +
 +      * net/rcirc.el (rcirc-kill-channel-buffers): New variable.
 +      (rcirc-kill-buffer-hook): Use it to kill channel buffers (bug#5128).
 +
 +2012-04-11  William Stevenson  <yhvh2000@gmail.com>
 +
 +      * textmodes/artist.el (artist-mode): Convert artist-mode to use
 +      define-minor-mode (bug#10760).
 +
 +2012-04-11  Wolfgang Jenkner  <wjenkner@inode.at>  (tiny change)
 +
 +      * progmodes/grep.el (rgrep): Tweak the find command line so
 +      that directories matching `grep-find-ignored-files' won't be
 +      pruned (bug#10351).
 +
 +2012-04-11  Chong Yidong  <cyd@gnu.org>
 +
 +      * startup.el (command-line): Remove support for long-obsolete
 +      variable font-lock-face-attributes.
 +
 +2012-04-11  Glenn Morris  <rgm@gnu.org>
 +
 +      * vc/vc-bzr.el (vc-bzr-status): Avoid condition-case-unless-debug.
 +
 +2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * window.el (window--state-get-1): Obey window-point-insertion-type.
 +
 +2012-04-11  Lennart Borgman  <lennart.borgman@gmail.com>
 +
 +      * emacs-lisp/lisp.el (narrow-to-defun): `beginning-of-defun' goes
 +      to previous function when point is on the first character of a
 +      function.  Take care of that in `narrow-to-defun' (bug#6157).
 +
 +2012-04-11  Glenn Morris  <rgm@gnu.org>
 +
 +      * vc/vc-bzr.el (vc-bzr-status): Handle all errors,
 +      not just file-errors.
 +
 +      * vc/vc-bzr.el (vc-bzr-sha1-program, sha1-program): Remove.
 +      (vc-bzr-sha1): Use internal sha1.
 +
 +2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * progmodes/flymake.el (flymake-mode): Beware read-only dirs (bug#8954).
 +
 +2012-04-10  Sébastien Gross  <seb@chezwam.org>  (tiny change)
 +
 +      * progmodes/hideshow.el (hs-hide-all): Don't infloop on comments
 +      that start in the middle of the line (bug#10496).
 +
 +2012-04-10  Dan Nicolaescu  <dann@gnu.org>
 +
 +      * battery.el (battery-linux-proc-acpi): Only one battery is
 +      discharged at a time, but that seems to confuse battery.el when
 +      computing `rate-type' for the battery not being discharged
 +      (bug#10332).
  
  2012-04-10  Stefan Monnier  <monnier@iro.umontreal.ca>
  
 -      * startup.el (command-line-1): Inhibit splash from daemon (bug#10996).
 +      * emacs-lisp/autoload.el (autoload-make-program): Remove, unused.
  
 -2012-04-10  Andreas Schwab  <schwab@linux-m68k.org>
 +      * international/quail.el: Use dolist and simplify.
 +      (quail-define-package, quail-update-keyboard-layout)
 +      (quail-define-rules): Use dolist.
 +      (quail-insert-kbd-layout, quail-get-translation): CSE.
  
 -      * international/characters.el: Fix sorting.
 +      * tmm.el: Use dolist, remove left over hook.
 +      (tmm-prompt, tmm-define-keys, tmm-shortcut, tmm-get-keybind):
 +      Use dolist.
 +      (calendar-load-hook): Don't mess with it.
  
 -2012-04-10  Eli Zaretskii  <eliz@gnu.org>
 +      * vc/vc-annotate.el (vc-annotate-show-diff-revision-at-line-internal):
 +      Use derived-mode-p.  Run the diff asynchronously.
  
 -      * international/characters.el: Add more missing Latin case pairs.
 +2012-04-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * obsolete/mouse-sel.el: Add an Obsolete-since header.
  
 -2012-04-10  Andreas Schwab  <schwab@linux-m68k.org>
 +2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
  
 -      * international/characters.el: Recover lost case pairs.
 +      * misc.el: Display absolute path of loaded DLLs (bug#10424).
 +      (list-dynamic-libraries--loaded): New function.
 +      (list-dynamic-libraries--refresh): Use it.
 +
 +2012-04-10  Nathan Weizenbaum  <nweiz@google.com>
 +
 +      * progmodes/python.el (python-fill-paragraph):
 +      Make python-fill-region in a multiline string work when font-lock is
 +      disabled (bug#7018).
 +
 +2012-04-10  Laimonas VÄ—bra  <laimonas.vebra@gmail.com>  (tiny change)
 +
 +      * language/european.el (cp775): Add oem/legacy (en)coding on
 +      DOS/MS Windows for the Baltic languages.  There are still plenty
 +      of texts written in this encoding/codepage (bug#6519).
  
  2012-04-10  Glenn Morris  <rgm@gnu.org>
  
 -      * files.el (dir-locals-set-class-variables): Doc fix.
 +      * cus-start.el (eol-mnemonic-unix, eol-mnemonic-dos, eol-mnemonic-mac):
 +      Add :standard values, reducing "rogue" customs in emacs -Q a bit more.
  
 -2012-04-09  Eli Zaretskii  <eliz@gnu.org>
 +2012-04-10  Florian Adamsky  <florian@adamsky.it>  (tiny change)
  
 -      * international/characters.el: Add set-case-syntax-pair call for
 -      LATIN CAPITAL LETTER Y WITH DIAERESIS RET and its lower-case
 -      counterpart.  (Bug#11209)
 +      * recentf.el (recentf-dialog-mode-map): Add two keybindings for
 +      next-line "n" and previous-line "p" in order to make recentf more
 +      consistent with ibuffer, dired or org-mode (bug#9387).
  
 -      * simple.el (shell-command-on-region): Doc fix.  (Bug#11208)
 +2012-04-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * image.el (put-image): Return the overlay created instead of the
 +      optional input string (bug#7834).  Note that this may break code
 +      that is (for some reason or other) depending on `put-image'
 +      returning the string.
 +
 +      * mouse-sel.el (mouse-sel-mode): Mark as obsolete (bug#6174).
 +
 +      * simple.el (zap-to-char): Allow zapping using input methods
 +      (bug#1580).
 +
 +      * textmodes/fill.el (fill-region): Leave point and mark where they
 +      were before filling (bug#5399).
  
  2012-04-09  Glenn Morris  <rgm@gnu.org>
  
 -      * calendar/holidays.el (calendar-check-holidays): Doc fix.
 +      * version.el (emacs-bzr-get-version):
 +      Handle lightweight checkouts of local branches.
 +
 +2012-04-09  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * international/characters.el: Recover lost case pairs.  (Bug#11209)
 +
 +2012-04-09  Chong Yidong  <cyd@gnu.org>
 +
 +      * custom.el (custom-variable-p): Return nil for non-symbol
 +      arguments instead of signaling an error.
 +      (user-variable-p): Obsolete alias for custom-variable-p.
 +
 +      * apropos.el (apropos-variable):
 +      * files-x.el (read-file-local-variable):
 +      * simple.el (set-variable):
 +      * woman.el (woman-mini-help):
 +      * emacs-lisp/byte-opt.el (side-effect-free-fns): Callers changed.
 +
 +2012-04-09  Glenn Morris  <rgm@gnu.org>
 +
 +      * startup.el (normal-top-level): Don't look for leim-list.el
 +      in places where it will not be found.  (Bug#910)
 +
 +      * international/mule-cmds.el (set-default-coding-systems):
 +      * files.el (normal-mode):
 +      Remove guarded calls to ucs-set-table-for-input.  (Bug#9821)
 +      This function was removed with ucs-tables.el in 2008.
  
  2012-04-08  Eli Zaretskii  <eliz@gnu.org>
  
 -      * textmodes/ispell.el (ispell-dictionary-base-alist): Add data for
 -      Hebrew.
 +      * textmodes/ispell.el (ispell-check-version): For hunspell, set
 +      ispell-encoding8-command to "-i", without a trailing space.
 +      (ispell-start-process): For hunspell, use '("-i" ENCODING), in 2
 +      separate command-line arguments, to specify the encoding, since
 +      that's how hunspell expects it.
  
 -2012-04-08  Chong Yidong  <cyd@gnu.org>
 +2012-04-08  Glenn Morris  <rgm@gnu.org>
  
 -      * net/rcirc.el (rcirc-cmd-quit): Revert 2012-03-18 change
 -      (Bug#11192).
 +      * loadup.el: Load bindings before cus-start.
 +      This reduces somewhat the number of "rogue" settings in emacs -Q.
  
  2012-04-07  Glenn Morris  <rgm@gnu.org>
  
 -      * pcmpl-rpm.el (pcomplete/rpm): Handle -qf.
 +      * version.el (emacs-bzr-get-version): New function.
 +      (emacs-bzr-version): New variable.
 +      * loadup.el (emacs-bzr-version): Set it.  (Bug#8054)
 +      * mail/emacsbug.el (report-emacs-bug): Include bzr version.
  
  2012-04-07  Eli Zaretskii  <eliz@gnu.org>
  
 -      * minibuffer.el (completion-in-region-mode-map):
 -      Bind completion-help-at-point to M-? rather than ?.  (Bug#11182)
 +      * international/uni-bidi.el, international/uni-category.el:
 +      * international/uni-combining.el, international/uni-decimal.el:
 +      * international/uni-decomposition.el, international/uni-digit.el:
 +      * international/uni-lowercase.el, international/uni-mirrored.el:
 +      * international/uni-name.el, international/uni-numeric.el:
 +      * international/uni-titlecase.el, international/uni-uppercase.el:
 +      Update for Unicode 6.1.
 +
 +2012-04-07  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * term/w32-win.el (dynamic-library-alist): Add libxml2 DLLs.
  
  2012-04-05  Lars Magne Ingebrigtsen  <larsi@gnus.org>
  
  
  2012-03-30  Agustín Martín Domingo  <agustin.martin@hispalinux.es>
  
 -      * ispell.el (ispell-get-extended-character-mode): Disable
 -      extended-char-mode for hunspell. hunspell does not support it and
 -      treats ~word as ordinary words in pipe mode.
 +      * ispell.el (ispell-get-extended-character-mode):
 +      Disable extended-char-mode for hunspell.  hunspell does not support it
 +      and treats ~word as ordinary words in pipe mode.
  
  2012-03-30  Glenn Morris  <rgm@gnu.org>
  
        (hfy-face-to-css-default): Same as the earlier `hfy-face-to-css'.
        (hfy-face-to-css): Re-defined to be a variable.
        (hfy-compile-stylesheet): Modify.  Allow stylesheet to be built
 -      over multiple runs. This is made possible by having the caller let
 +      over multiple runs.  This is made possible by having the caller let
        bind a special variable `hfy-user-sheet-assoc'.
        (htmlfontify-string): New defun.
        (hfy-compile-face-map): Make sure that the last char in the
  
  2012-03-09  Michael Albinus  <michael.albinus@gmx.de>
  
 -      * net/dbus.el: (dbus-property-handler): Return empty array if
 +      * net/dbus.el (dbus-property-handler): Return empty array if
        there are no properties.
  
  2012-03-09  Leo Liu  <sdl.web@gmail.com>
        * term/x-win.el (x-initialize-window-system): Reduce default for
        x-selection-timeout to 5 seconds (Bug#8869).
  
 -2012-02-24  Thierry Volpiatto  <thierry.volpiatto@gmail.com>
 -
 -      * files.el (file-subdir-of-p): Fix typo.
 -
  2012-02-24  Thierry Volpiatto  <thierry.volpiatto@gmail.com>
  
        * files.el (files-equal-p, file-subdir-of-p): New functions.
  2012-02-12  Alan Mackenzie  <acm@muc.de>
  
        Fix infinite loop with long macros.
 -      * cc-engine.el (c-state-safe-place): Handle macros properly.
 +      * progmodes/cc-engine.el (c-state-safe-place): Handle macros properly.
  
  2012-02-12  Chong Yidong  <cyd@gnu.org>
  
  
  2012-02-06  Lars Ingebrigtsen  <larsi@gnus.org>
  
 -      * progmodes/cc-mode.el
 -      (c-standard-font-lock-fontify-region-function): Set the default at
 -      load time, too, so that `font-lock-fontify-buffer' can be called
 -      without setting up the entire mode first.  This fixes a bug in
 -      `mm-inline-text' with C MIME parts.
 +      * progmodes/cc-mode.el (c-standard-font-lock-fontify-region-function):
 +      Set the default at load time, too, so that `font-lock-fontify-buffer'
 +      can be called without setting up the entire mode first.  This fixes
 +      a bug in `mm-inline-text' with C MIME parts.
  
  2012-02-06  Chong Yidong  <cyd@gnu.org>
  
        insecure exception for current topic.  Also note that auto-saves
        are handled differently.
  
 -      (allout-auto-save-temporarily-disabled), (allout-just-did-undo):
 +      (allout-auto-save-temporarily-disabledallout-just-did-undo):
        State variables for tracking auto-save inhibition situation.
  
        (allout-write-contents-hook-handler): Rename from
        (newsticker--plainview-tool-bar-map): Move tool-bar icons to
        etc/images/newsticker.
  
 -      * net/newst-backend.el (newsticker--do-run-auto-mark-filter),
 -      (newsticker--process-auto-mark-filter-match): Tell user about
 +      * net/newst-backend.el (newsticker--do-run-auto-mark-filter)
 +      (newsticker--process-auto-mark-filter-match): Tell user about
        auto-marking.
  
  2011-05-13  Didier Verna  <didier@xemacs.org>
diff --combined lisp/gnus/ChangeLog
@@@ -1,77 -1,19 +1,82 @@@
 -2012-05-21  Katsumi Yamaoka  <yamaoka@jpl.org>
++2012-05-27  Katsumi Yamaoka  <yamaoka@jpl.org>
+       * gnus-msg.el (gnus-msg-mail): Ensure that gnus-newsgroup-name is
+       a string so that Gcc works (bug#11514).
 -2012-04-21  Andreas Schwab  <schwab@linux-m68k.org>
 +2012-05-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * legacy-gnus-agent.el (gnus-agent-unhook-expire-days):
 +      * gnus-demon.el (gnus-demon-init): Don't bother with type-of.
 +
 +2012-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * gnus-win.el (gnus-configure-frame): Don't signal an error when
 +      jumping to *Server* from a dedicated *Group* window.
 +      (gnus-configure-frame): CSE.
 +
 +      * gnus-registry.el: Minor style cleanup.
 +      (gnus-registry--set/remove-mark): New function, extracted from
 +      gnus-registry-install-shortcuts.
 +      (gnus-registry-install-shortcuts): Use it.
 +
 +2012-05-25  Katsumi Yamaoka  <yamaoka@jpl.org>
 +
 +      * nnspool.el (news-path): Use eval-and-compile.
 +
 +2012-05-24  Glenn Morris  <rgm@gnu.org>
 +
 +      * nnspool.el (news-directory, news-path, news-inews-program):
 +      Move here from paths.el.  Don't see a need for these to be autoloaded.
 +
 +      * gnus.el (gnus-default-nntp-server): Make it a defcustom.
 +      Merge in doc from paths.el version.  Don't see any need for this to be
 +      autoloaded, or for the warning about users not setting it.
 +
 +2012-05-04  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fix minor Y10k bug.
 +      * nnweb.el (nnweb-google-parse-1): Don't assume years have 4 digits.
 +
 +2012-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * nnimap.el (nnimap-open-connection-1): Don't leave an "opening..."
 +      message once it's actually open.
 +
 +2012-04-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * auth-source.el (auth-source--aput-1, auth-source--aput)
 +      (auth-source--aget): New functions and macros.
 +      Use them instead of aput/aget.
 +
 +2012-04-27  Andreas Schwab  <schwab@linux-m68k.org>
  
        * gnus.el (debbugs-gnu): Don't override existing autoload definition.
  
 -2012-04-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +2012-04-26  Daiki Ueno  <ueno@unixuser.org>
 +
 +      * plstore.el (plstore-called-interactively-p): New compat macro copied
 +      from message.el.
 +      (plstore-mode): Use it.
 +
 +2012-04-26  Daiki Ueno  <ueno@unixuser.org>
 +
 +      * plstore.el: Revive the editing feature.
 +      (plstore-mode): New mode to edit plstore file.
 +      (plstore-mode-toggle-display, plstore-mode-original)
 +      (plstore-mode-decoded): New command.
 +      (plstore--encode, plstore--decode, plstore--write-contents-functions)
 +      (plstore--insert-buffer, plstore--make): New function.
 +      (plstore-open, plstore-save): Simplify by using them.
 +
 +2012-04-16  Glenn Morris  <rgm@gnu.org>
 +
 +      * nndraft.el (nndraft-request-list): Fix declaration.
 +
 +2012-04-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
  
        * gnus-msg.el (gnus-inews-insert-gcc): Don't do the alist stuff when we
        don't have a current group.
  
 -2012-04-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 -
        * gnus-msg.el (gnus-inews-insert-gcc): Protect against when we don't
        have a group name.
  
  
  See ChangeLog.2 for earlier changes.
  
 -  Copyright (C) 2004-2012  Free Software Foundation, Inc.
 +  Copyright (C) 2004-2012 Free Software Foundation, Inc.
  
    This file is part of GNU Emacs.
  
diff --combined lisp/mail/sendmail.el
@@@ -856,7 -856,8 +856,7 @@@ Prefix arg means don't delete this wind
  (defun mail-bury (&optional arg)
    "Bury this mail buffer."
    (let ((newbuf (other-buffer (current-buffer)))
 -      (return-action mail-return-action)
 -      some-rmail)
 +      (return-action mail-return-action))
      (bury-buffer (current-buffer))
      ;; If there is an Rmail buffer, return to it nicely
      ;; even if this message was not started by an Rmail command.
@@@ -991,7 -992,7 +991,7 @@@ This function uses `mail-envelope-from'
  
  ;;;###autoload
  (defvar sendmail-coding-system nil
 -  "*Coding system for encoding the outgoing mail.
 +  "Coding system for encoding the outgoing mail.
  This has higher priority than the default `buffer-file-coding-system'
  and `default-sendmail-coding-system',
  but lower priority than the local value of `buffer-file-coding-system'.
@@@ -1678,7 -1679,8 +1678,8 @@@ Just \\[universal-argument] as argumen
  and don't delete any header fields."
    (interactive "P")
    (and (consp mail-reply-action)
-        (eq (car mail-reply-action) 'insert-buffer)
+        (memq (car mail-reply-action)
+            '(rmail-yank-current-message insert-buffer))
         (with-current-buffer (nth 1 mail-reply-action)
         (or (mark t)
             (error "No mark set: %S" (current-buffer))))
diff --combined lisp/org/ChangeLog
 -2012-05-25 Mark Shoulson <mark@kli.org>  (tiny change)
++2012-05-27 Mark Shoulson <mark@kli.org>  (tiny change)
 -      * org.el (org-fontify-entities): Fix bug: The entities \sup[123]
 -      and \there4 were not "prettified" when org-pretty-entities was
 -      enabled.
++      * org.el (org-fontify-entities): Fix bug: The entities \sup[123] and
++      \there4 were not "prettified" when org-pretty-entities was enabled.
 -2012-05-25  Nicolas Goaziou  <n.goaziou@gmail.com>
++2012-05-27  Nicolas Goaziou  <n.goaziou@gmail.com>
 -      * org.el (org-font-lock-add-priority-faces): Restrict priorities
 -      fontification to headlines and inlinetasks.
++      * org.el (org-font-lock-add-priority-faces):
++      Restrict priorities fontification to headlines and inlinetasks.
 -2012-05-25  Jambunathan K  <kjambunathan@gmail.com>
 -
 -      * org-odt.el (org-odt-init-outfile): Fix previous commit.  Make
 -      sure that nxml-mode is loaded before let-binding
 -      `nxml-auto-insert-xml-declaration-flag'.
 -
 -2012-05-25  Jambunathan K  <kjambunathan@gmail.com>
++2012-05-27  Jambunathan K  <kjambunathan@gmail.com>
+       * org-odt.el (org-odt-init-outfile)
 -      (org-odt-write-manifest-file): Disable
 -      `nxml-auto-insert-xml-declaration-flag'.
++      (org-odt-write-manifest-file):
++      Disable `nxml-auto-insert-xml-declaration-flag'.
 -      * org-lparse.el (org-do-lparse): Don't trigger auto-mode
 -      processing.
++      * org-lparse.el (org-do-lparse): Don't trigger auto-mode processing.
 -2012-05-25  Bastien Guerry  <bzg@gnu.org>
++2012-05-27  Bastien Guerry  <bzg@gnu.org>
 -      * org.el (org-scan-tags): Fix bug when building the scanner
 -      regexp.
++      * org.el (org-scan-tags): Fix bug when building the scanner regexp.
 -2012-05-25  Eric Schulte  <eric.schulte@gmx.com>
++2012-05-27  Eric Schulte  <eric.schulte@gmx.com>
 -      * ob.el (org-babel-capitalize-examplize-region-markers): Controls
 -      the capitalization of begin and end example blocks.
 -      (org-babel-examplize-region): Optionally capitalize example block
 -      delimiters.
++      * ob.el (org-babel-capitalize-examplize-region-markers):
++      Controls the capitalization of begin and end example blocks.
++      (org-babel-examplize-region):
++      Optionally capitalize example block delimiters.
 -2012-05-25  Eric Schulte  <eric.schulte@gmx.com>
++      * ob-plantuml.el (org-babel-execute:plantuml):
++      Add a :java header argument to plantuml.
 -      * ob-plantuml.el (org-babel-execute:plantuml): Adding a :java
 -      header argument to plantuml.
 -
 -2012-05-25  Eric Schulte  <eric.schulte@gmx.com>
 -
 -      * org-exp-blocks.el (org-export-blocks-preprocess): Even when the
 -      body of a block is not indented the boundary markers should be
 -      indented to their original positions so things like list
++      * org-exp-blocks.el (org-export-blocks-preprocess):
++      Even when the body of a block is not indented the boundary markers
++      should be indented to their original positions so things like list
+       indentation still work.
 -2012-05-16  Eric Schulte  <eric.schulte@gmx.com>
++      * ob.el (org-babel-parse-src-block-match):
++      Save match data during indentation check.
 -      * ob.el (org-babel-parse-src-block-match): Save match data during
 -      indentation check.
 -
 -2012-05-16  Bastien Guerry  <bzg@gnu.org>
++2012-05-27  Bastien Guerry  <bzg@gnu.org>
+       * org.el (org-scan-tags): Correctly match TODO keywords.
 -2012-05-16  Nicolas Goaziou  <n.goaziou@gmail.com>
++2012-05-27  Nicolas Goaziou  <n.goaziou@gmail.com>
+       * org-list.el (org-list-struct): Fix white spaces.
 -      (org-list-swap-items, org-list-send-item): Fix visibility
 -      preservation.
 -
 -2012-05-16  Nicolas Goaziou  <n.goaziou@gmail.com>
++      (org-list-swap-items, org-list-send-item): Fix visibility preservation.
 -      * org-list.el (org-list-swap-items, org-list-send-item): Preserve
 -      visibility when moving items.
++      * org-list.el (org-list-swap-items, org-list-send-item):
++      Preserve visibility when moving items.
 -2012-05-16  Mark E. Shoulson  <mark@kli.org>  (tiny change)
++2012-05-27  Mark E. Shoulson  <mark@kli.org>  (tiny change)
 -      * org.el (org-fontify-entities): Hide {} when prettifying
 -      entities.
++      * org.el (org-fontify-entities): Hide {} when prettifying entities.
 -2012-05-16  Bastien Guerry  <bzg@gnu.org>
++2012-05-27  Bastien Guerry  <bzg@gnu.org>
+       * org.el (org-cycle-internal-global): Prevent the display of
+       messages when cycling from with a Gnus article buffer.
 -2012-05-16  Bastien Guerry  <bzg@gnu.org>
++      * org-table.el (org-table-time-seconds-to-string):
++      Fix bug about handling a negative duration value.
 -      * org-table.el (org-table-time-seconds-to-string): Fix bug about
 -      handling a negative duration value.
 -
 -2012-05-16  Nicolas Goaziou  <n.goaziou@gmail.com>
++2012-05-27  Nicolas Goaziou  <n.goaziou@gmail.com>
+       * org.el (org-link-expand-abbrev): Fix docstring.
 -2012-05-16  Nicolas Goaziou  <n.goaziou@gmail.com>
 -
+       * org.el (org-translate-link): Fix bug.
 -2012-05-16  Bastien Guerry  <bzg@gnu.org>
++2012-05-27  Bastien Guerry  <bzg@gnu.org>
 -      * org-agenda.el (org-agenda-bulk-mark-regexp): Fix bug when
 -      setting the number of marked entries.
++      * org-agenda.el (org-agenda-bulk-mark-regexp):
++      Fix bug when setting the number of marked entries.
 -2012-05-16  Bastien Guerry  <bzg@gnu.org>
 -
 -      * org-table.el (org-tbl-calc-modes): Rename from
 -      `org-table-modes'.
++      * org-table.el (org-tbl-calc-modes): Rename from `org-table-modes'.
+       (org-set-calc-mode, org-table-eval-formula): Use it.
 -2012-05-16  Eric Schulte  <eric.schulte@gmx.com>
++2012-05-27  Eric Schulte  <eric.schulte@gmx.com>
 -      * ob.el (org-babel-find-named-result): Fix bug finding empty named
 -      results.
++      * ob.el (org-babel-find-named-result):
++      Fix bug finding empty named results.
 -2012-05-16  Nicolas Goaziou  <n.goaziou@gmail.com>
++2012-05-27  Nicolas Goaziou  <n.goaziou@gmail.com>
 -      * org.el (org-set-regexps-and-options): Fix
 -      `org-planning-or-clock-line-re' regexp.  Indeed "\\>" will never
++      * org.el (org-set-regexps-and-options):
++      Fix `org-planning-or-clock-line-re' regexp.  Indeed "\\>" will never
+       match since time keywords must end with colons, which are not word
 -      constituent.
++      constituents.
++
++2012-05-27  Bastien Guerry  <bzg@gnu.org>
 -2012-05-16  Bastien Guerry  <bzg@gnu.org>
++      * org-ctags.el (org-ctags-new-topic-template):
++      Fix the option default value back again.
 -      * org-ctags.el (org-ctags-new-topic-template): Fix the option
 -      default value back again.
++2012-05-27  Eric Schulte  <eric.schulte@gmx.com>
 -2012-05-16  Eric Schulte  <eric.schulte@gmx.com>
++      * org-bibtex.el (org-bibtex-export-to-kill-ring):
++      Don't rely on kill-new to return a string.
 -      * org-bibtex.el (org-bibtex-export-to-kill-ring): Don't rely on
 -      kill-new to return a string.
++      * org-bibtex.el (org-bibtex-headline):
++      Remove call to bibtex-reformat which often hangs.
 -2012-05-16  Eric Schulte  <eric.schulte@gmx.com>
 +2012-04-27  Glenn Morris  <rgm@gnu.org>
  
 -      * org-bibtex.el (org-bibtex-headline): Remove call to
 -      bibtex-reformat which often hangs.
 +      * org-ctags.el (org-ctags-new-topic-template):
 +      Revert 2012-04-09 removal of * from defcustom value, not doc.
  
 -2012-04-26  Nicolas Goaziou  <n.goaziou@gmail.com>
 +2012-04-27  Nicolas Goaziou  <n.goaziou@gmail.com>
  
        * org-table.el (org-table-number-fraction): Fix typo.
  
 -2012-04-26  Eric Schulte  <eric.schulte@gmx.com>
 +2012-04-27  Eric Schulte  <eric.schulte@gmx.com>
  
        * ob-python.el (org-babel-execute:python): Ensure newline precedes
        automatically-added returns.
  
 -2012-04-26  Nicolas Goaziou  <n.goaziou@gmail.com>
 +2012-04-27  Nicolas Goaziou  <n.goaziou@gmail.com>
  
        * org-mouse.el (org-mode-hook): Do not move point when clicking on
        a footnote reference.
  
 -2012-04-26  Bastien Guerry  <bzg@gnu.org>
 +2012-04-27  Bastien Guerry  <bzg@gnu.org>
  
        * org-faces.el (org-date-selected): Fix docstring.
  
 -2012-04-26  Nicolas Goaziou  <n.goaziou@gmail.com>
 +2012-04-27  Nicolas Goaziou  <n.goaziou@gmail.com>
  
        * org-list.el (org-list-struct-indent): Follow
        `org-list-demote-modify-bullet' specifications for ordered
        * org.el (org-shiftmetaleft, org-shiftmetaright): Allow to operate
        on a region.
  
 -2012-04-26  Nicolas Goaziou  <n.goaziou@gmail.com>
 +2012-04-27  Nicolas Goaziou  <n.goaziou@gmail.com>
  
        * org-footnote.el (org-footnote-normalize): Fix positioning in
        HTML export without a footnote section.
  
 -2012-04-26  Madan Ramakrishnan  <madanr79@gmail.com>  (tiny change)
 +2012-04-27  Madan Ramakrishnan  <madanr79@gmail.com>  (tiny change)
  
        * org-agenda.el (org-agenda-bulk-mark): Truly make arg optional as
        advertised by the function.
  
 -2012-04-26  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
 +2012-04-27  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
  
        * org.el (org-read-date-display): Fix bug when displaying the
        overlay.
  
 -2012-04-26  Bastien Guerry  <bzg@gnu.org>
 +2012-04-27  Bastien Guerry  <bzg@gnu.org>
  
        * org.el (org-mode): Don't use `buffer-face-mode' by default.
  
 -2012-04-26  Bastien Guerry  <bzg@gnu.org>
 +2012-04-27  Bastien Guerry  <bzg@gnu.org>
  
        * org-faces.el (org-date-selected): New face.
  
 -2012-04-26  Jambunathan K  <kjambunathan@gmail.com>
 +2012-04-27  Jambunathan K  <kjambunathan@gmail.com>
  
        * org-odt.el (org-odt-format-org-link): Pay no heed to whether the
        internal links destined for headlines provide a description or
        not.  In fact, the `org-store-link' and `org-insert-link' create
        internal links which do have a description.
  
 -2012-04-26  Bastien Guerry  <bzg@gnu.org>
 +2012-04-27  Bastien Guerry  <bzg@gnu.org>
  
        * org-clock.el (org-program-exists): Fix docstring.
  
 -2012-04-11  Bastien Guerry  <bzg@gnu.org>
 +2012-04-14  Bastien Guerry  <bzg@gnu.org>
  
        * org.el (org-point-at-end-of-empty-headline): Only try to match
 -      Ì€org-todo-line-regexp' when the value is non-nil, e.g. in non-org
 +      `org-todo-line-regexp' when the value is non-nil, e.g. in non-org
        modes.
        (org-fontify-meta-lines-and-blocks-1): Prevent errors when trying
        to fontify beyond (point-max).
        (org-table-get-range): Fix bug: make sure references to $0 are
        correctly handled.
  
 -      * org-pcomplete.el (pcomplete/org-mode/file-option): Fix bug in
 -      `pcomplete/org-mode/file-option'.
 +      * org-pcomplete.el (pcomplete/org-mode/file-option):
 +      Fix bug in `pcomplete/org-mode/file-option'.
        (org-thing-at-point): Also match line options like LATEX_CLASS
        when pcompleting from LATEX_.
  
        * org-agenda.el (org-agenda-filter-make-matcher)
        (org-agenda-filter-apply): Allow filtering entries out by
        category.  Using `C-u <' from the agenda view will redisplay
 -      the agenda without entries from categories of the current
 -      line.
 +      the agenda without entries from categories of the current line.
  
 -2012-04-11  Eric Schulte  <eric.schulte@gmx.com>
 +2012-04-14  Eric Schulte  <eric.schulte@gmx.com>
  
 -      * ob-C.el (org-babel-C-ensure-main-wrap): Add an explicit return
 -      to automatically generated main methods.
 +      * ob-C.el (org-babel-C-ensure-main-wrap):
 +      Add an explicit return to automatically generated main methods.
  
 -2012-04-11  Matt Lundin  <mdl@imapmail.org>
 +2012-04-14  Matt Lundin  <mdl@imapmail.org>
  
 -      * org.el (org-after-todo-state-change-hook): Fix docstring to
 -      reflect name change of state to `org-state'.
 +      * org.el (org-after-todo-state-change-hook):
 +      Fix docstring to reflect name change of state to `org-state'.
  
 -2012-04-11  Mike Sperber  <sperber@deinprogramm.de>  (tiny change)
 +2012-04-14  Mike Sperber  <sperber@deinprogramm.de>  (tiny change)
  
 -      * org-footnote.el (org-footnote-normalize): Correctly pass keyword
 -      arguments to `org-export-preprocess-string'.
 +      * org-footnote.el (org-footnote-normalize):
 +      Correctly pass keyword arguments to `org-export-preprocess-string'.
  
  2012-04-03  Bastien Guerry  <bzg@gnu.org>
  
  ;; add-log-time-zone-rule: t
  ;; End:
  
 -      Copyright (C) 2008-2012  Free Software Foundation, Inc.
 +      Copyright (C) 2008-2012 Free Software Foundation, Inc.
  
    This file is part of GNU Emacs.
  
diff --combined nt/ChangeLog
@@@ -1,52 -1,13 +1,58 @@@
 -2012-05-18  Eli Zaretskii  <eliz@gnu.org>
++2012-05-27  Eli Zaretskii  <eliz@gnu.org>
+       * configure.bat: Ensure a space between %var% expansion and
+       redirection symbol '>', which breaks when %var% ends in a digit,
+       such as 1.
 -2012-04-11  Dani Moncayo  <dmoncayo@gmail.com>  (tiny change)
 +2012-05-22  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Remove src/m/*.
 +      * config.nt: Do not include "m/intel386.h"; file was removed.
 +      (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG):
 +      Move to src/lisp.h.
 +      (EMACS_INT_MAX): New macro.
 +
 +2012-05-19  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * config.nt (HAVE_GETDOMAINNAME, HAVE_XSETWMPROTOCOLS)
 +      (HAVE_GETSOCKOPT, HAVE_SETSOCKOPT): Remove; not needed.
 +
 +      * config.nt (HAVE_FTIME): Remove undef; not needed.
 +
 +2012-05-01  Glenn Morris  <rgm@gnu.org>
 +
 +      * config.nt (HAVE_LIBNCURSES): Remove undef; not needed.
 +
 +2012-04-14  Dani Moncayo  <dmoncayo@gmail.com>  (tiny change)
  
        * makefile.w32-in: Fix typo (Bug#10261).
  
 +2012-04-10  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * makefile.w32-in (emacs, misc, lispref, lispintro): New targets,
 +      each runs makeinfo in its own subdirectory of 'doc'.
 +      (info-gmake): Depend on these new targets.
 +
 +2012-04-07  Glenn Morris  <rgm@gnu.org>
 +
 +      * config.nt, makefile.w32-in, emacs.rc, emacsclient.rc:
 +      Bump version to 24.1.50.
 +
 +2012-04-07  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * configure.bat: Support building with libxml2.
 +
 +      * INSTALL:
 +      * README.W32: Add information about libxml2.
 +
 +2012-04-07  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * makefile.w32-in: Convert to Unix EOL format.
 +      (all): Don't depend on stamp_BLD and on maybe-bootstrap.
 +      (all-other-dirs-$(MAKETYPE)): Depend on maybe-bootstrap.
 +      (bootstrap-gmake): Invoke the "clean" and build targets in 2
 +      separate commands, so they run in that order even under "make -j".
 +
  2012-03-29  Eli Zaretskii  <eliz@gnu.org>
  
        * config.nt: Discourage from defining HAVE_GETCWD.
  2005-06-05  Eli Zaretskii  <eliz@gnu.org>
  
        * inc/sys/socket.h: Change arg 4 of sys_setsockopt to
 -      `const void *', for consistency with Posix.
 +      `const void *', for consistency with POSIX.
  
  2005-06-04  Eli Zaretskii  <eliz@gnu.org>
  
diff --combined nt/configure.bat
@@@ -131,7 -131,6 +131,7 @@@ if "%1" == "--without-jpeg" goto withou
  if "%1" == "--without-gif" goto withoutgif\r
  if "%1" == "--without-tiff" goto withouttiff\r
  if "%1" == "--without-gnutls" goto withoutgnutls\r
 +if "%1" == "--without-libxml2" goto withoutlibxml2\r
  if "%1" == "--without-xpm" goto withoutxpm\r
  if "%1" == "--with-svg" goto withsvg\r
  if "%1" == "--distfiles" goto distfiles\r
@@@ -157,7 -156,6 +157,7 @@@ echo.   --without-gif           do not 
  echo.   --without-tiff          do not use TIFF library even if it is installed\r
  echo.   --without-xpm           do not use XPM library even if it is installed\r
  echo.   --without-gnutls        do not use GnuTLS library even if it is installed\r
 +echo.   --without-libxml2       do not use libxml2 library even if it is installed\r
  echo.   --with-svg              use the RSVG library (experimental)\r
  echo.   --distfiles             path to files for make dist, e.g. libXpm.dll\r
  if "%use_extensions%" == "0" goto end\r
@@@ -319,14 -317,6 +319,14 @@@ goto agai
  \r
  rem ----------------------------------------------------------------------\r
  \r
 +:withoutlibxml2\r
 +set libxml2support=N\r
 +set HAVE_LIBXML2=\r
 +shift\r
 +goto again\r
 +\r
 +rem ----------------------------------------------------------------------\r
 +\r
  :withouttiff\r
  set tiffsupport=N\r
  set HAVE_TIFF=\r
@@@ -579,28 -569,6 +579,28 @@@ set HAVE_GNUTLS=
  :tlsDone\r
  rm -f junk.c junk.obj\r
  \r
 +if (%libxml2support%) == (N) goto xml2Done\r
 +\r
 +echo Checking for libxml2....\r
 +echo #include "libxml/HTMLparser.h" >junk.c\r
 +echo main(){} >>junk.c\r
 +echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
 +%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
 +if exist junk.obj goto havelibxml2\r
 +\r
 +echo ...libxml/HTMLparser.h not found, building without libxml2 support\r
 +echo The failed program was: >>config.log\r
 +type junk.c >>config.log\r
 +set HAVE_LIBXML2=\r
 +goto xml2Done\r
 +\r
 +:havelibxml2\r
 +echo ...libxml2 header available, building with libxml2 support\r
 +set HAVE_LIBXML2=1\r
 +\r
 +:xml2Done\r
 +rm -f junk.c junk.obj\r
 +\r
  if (%jpegsupport%) == (N) goto jpegDone\r
  \r
  echo Checking for jpeg-6b...\r
@@@ -757,25 -725,25 +757,25 @@@ rem   NB. Be very careful to not have 
  rem   except when there is a preceding digit, when a space is required.\r
  rem\r
  echo # Start of settings from configure.bat >config.settings\r
- echo COMPILER=%COMPILER%>>config.settings\r
- if not "(%mf%)" == "()" echo MCPU_FLAG=%mf%>>config.settings\r
- if not "(%dbginfo%)" == "()" echo DEBUG_INFO=%dbginfo%>>config.settings\r
+ echo COMPILER=%COMPILER% >>config.settings\r
+ if not "(%mf%)" == "()" echo MCPU_FLAG=%mf% >>config.settings\r
+ if not "(%dbginfo%)" == "()" echo DEBUG_INFO=%dbginfo% >>config.settings\r
  if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings\r
  if (%noopt%) == (Y) echo NOOPT=1 >>config.settings\r
  if (%enablechecking%) == (Y) echo ENABLECHECKS=1 >>config.settings\r
  if (%profile%) == (Y) echo PROFILE=1 >>config.settings\r
  if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings\r
- if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings\r
- if not "(%distfiles%)" == "()" echo DIST_FILES=%distfiles%>>config.settings\r
+ if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix% >>config.settings\r
+ if not "(%distfiles%)" == "()" echo DIST_FILES=%distfiles% >>config.settings\r
  rem We go thru docflags because usercflags could be "-DFOO=bar" -something\r
  rem and the if command cannot cope with this\r
  for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y\r
- if (%docflags%)==(Y) echo USER_CFLAGS=%usercflags%>>config.settings\r
- if (%docflags%)==(Y) echo ESC_USER_CFLAGS=%escusercflags%>>config.settings\r
+ if (%docflags%)==(Y) echo USER_CFLAGS=%usercflags% >>config.settings\r
+ if (%docflags%)==(Y) echo ESC_USER_CFLAGS=%escusercflags% >>config.settings\r
  for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y\r
- if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags%>>config.settings\r
+ if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags% >>config.settings\r
  for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y\r
- if (%doextralibs%)==(Y) echo USER_LIBS=%extrauserlibs%>>config.settings\r
+ if (%doextralibs%)==(Y) echo USER_LIBS=%extrauserlibs% >>config.settings\r
  echo # End of settings from configure.bat>>config.settings\r
  echo. >>config.settings\r
  \r
@@@ -784,12 -752,11 +784,12 @@@ echo. >>config.tm
  echo /* Start of settings from configure.bat.  */ >>config.tmp\r
  rem   We write USER_CFLAGS and USER_LDFLAGS starting with a space to simplify\r
  rem   processing of compiler options in w32.c:get_emacs_configuration_options\r
- if (%docflags%) == (Y) echo #define USER_CFLAGS " %escusercflags%">>config.tmp\r
- if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %escuserldflags%">>config.tmp\r
+ if (%docflags%) == (Y) echo #define USER_CFLAGS " %escusercflags%" >>config.tmp\r
+ if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %escuserldflags%" >>config.tmp\r
  if (%profile%) == (Y) echo #define PROFILING 1 >>config.tmp\r
  if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp\r
  if not "(%HAVE_GNUTLS%)" == "()" echo #define HAVE_GNUTLS 1 >>config.tmp\r
 +if not "(%HAVE_LIBXML2%)" == "()" echo #define HAVE_LIBXML2 1 >>config.tmp\r
  if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp\r
  if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>config.tmp\r
  if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>config.tmp\r
@@@ -929,7 -896,6 +929,7 @@@ set HAVE_DISTFILES
  set distFilesOk=\r
  set pngsupport=\r
  set tlssupport=\r
 +set libxml2support=\r
  set jpegsupport=\r
  set gifsupport=\r
  set tiffsupport=\r
diff --combined src/ChangeLog
 -2012-05-24  Ken Brown  <kbrown@cornell.edu>
++2012-05-27  Ken Brown  <kbrown@cornell.edu>
+       * callproc.c (Fcall_process): Restore a line that was accidentally
+       commented out in the 2011-02-13 change (bug#11547).
 -2012-05-23  Eli Zaretskii  <eliz@gnu.org>
++2012-05-27  Eli Zaretskii  <eliz@gnu.org>
+       * lisp.h [REL_ALLOC]: Add prototypes for external functions
+       defined on ralloc.c.
+       * buffer.c [REL_ALLOC]: Remove prototypes of
+       r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
+       they are now on lisp.h.
+       * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
+       * search.c (search_buffer): Use it to inhibit relocation of buffer
+       text while re_search_2 is doing its job, because re_search_2 is
+       passed C pointers to buffer text.  (Bug#11519)
 -2012-05-21  Eli Zaretskii  <eliz@gnu.org>
 -
+       * msdos.c (internal_terminal_init) <Vwindow_system_version>:
+       Update value to 24.
 -2012-05-19  Eli Zaretskii  <eliz@gnu.org>
 -
+       * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
+       state after an additional call to move_it_in_display_line_to, keep
+       the values of it->max_ascent and it->max_descent found for the
+       entire line.
+       (pos_visible_p): Revert the comparison against bottom_y to what it
+       was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
+       (Bug#11464)
 -2012-05-15  Eli Zaretskii  <eliz@gnu.org>
 +2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fix coding-related core dumps with gcc -ftrapv.
 +      The code was computing A - B, where A and B are pointers, and B is
 +      random garbage.  This can lead to core dumps on platforms that
 +      have special pointer registers, and it also leads to core dumps on
 +      x86-64 when compiled with gcc -ftrapv.  The fix is to compute
 +      A - B only when B is initialized properly.
 +      * coding.c (coding_set_source, coding_set_destination): Return void.
 +      (coding_change_source, coding_change_destinations): New functions,
 +      with the old behaviors of coding_set_source and coding_set_destination.
 +      All callers that need an offset changed to use these new functions.
 +
 +2012-05-26  Glenn Morris  <rgm@gnu.org>
 +
 +      * nsterm.m (ns_init_paths): Don't mess with INFOPATH.  (Bug#2791)
 +
 +2012-05-26  Eli Zaretskii  <eliz@gnu.org>
 +
 +      Extend mouse support on W32 text-mode console.
 +      * xdisp.c (draw_row_with_mouse_face): Call
 +      tty_draw_row_with_mouse_face for WINDOWSNT as well.
 +
 +      * w32console.c: Include window.h.
 +      (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face): New
 +      functions.
 +      (initialize_w32_display): Initialize mouse-highlight data.
 +
 +      * w32inevt.c: Include termchar.h and window.h.
 +      (do_mouse_event): Support mouse-autoselect-window.  When the mouse
 +      moves, call note_mouse_highlight.  If help_echo changed, call
 +      gen_help_event to produce help-echo message in the echo area.
 +      Call clear_mouse_face if mouse_face_hidden is set in the mouse
 +      highlight info.
 +
 +2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * lread.c (read1): Simplify slightly to avoid an overflow warning
 +      with GCC 4.7.0 on x86-64.
 +
 +2012-05-26  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * bidi.c (bidi_mirror_char): Revert last change: an int is
 +      definitely wide enough here.
 +
 +2012-05-25  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fix integer width and related bugs (Bug#9874).
 +      * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
 +      (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
 +      (string_bytes, check_sblock, allocate_string_data):
 +      (compact_small_strings, Fmake_bool_vector, make_string)
 +      (make_unibyte_string, make_multibyte_string)
 +      (make_string_from_bytes, make_specified_string)
 +      (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
 +      (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
 +      (mark_vectorlike):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (allocate_pseudovector):
 +      Use int, not EMACS_INT, where int is wide enough.
 +      (inhibit_garbage_collection, Fgarbage_collect):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
 +      int might not be wide enough.
 +      (bidi_cache_search, bidi_cache_find, bidi_init_it)
 +      (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
 +      (bidi_at_paragraph_end, bidi_find_paragraph_start)
 +      (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
 +      (bidi_level_of_next_char, bidi_move_to_visually_next):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
 +      (Fkill_buffer, Fset_buffer_major_mode)
 +      (advance_to_char_boundary, Fbuffer_swap_text)
 +      (Fset_buffer_multibyte, overlays_at, overlays_in)
 +      (overlay_touches_p, struct sortvec, record_overlay_string)
 +      (overlay_strings, recenter_overlay_lists)
 +      (adjust_overlays_for_insert, adjust_overlays_for_delete)
 +      (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
 +      (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
 +      (Foverlay_recenter, last_overlay_modification_hooks_used)
 +      (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (validate_region): Omit unnecessary test for b <= e,
 +      since that's guaranteed by the previous test.
 +      (adjust_overlays_for_delete): Avoid pos + length overflow.
 +      (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
 +      (report_overlay_modification):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
 +      Omit pointer cast, which isn't needed anyway, and doesn't work
 +      after the EMACS_INT -> ptrdiff_t change.
 +      (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
 +      * buffer.h: Adjust decls to match defn changes elsewhere.
 +      (struct buffer_text, struct buffer):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      Use EMACS_INT, not int, where int might not be wide enough.
 +      * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
 +      not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (exec_byte_code): Use tighter memory-full test, one that checks
 +      for alloca overflow.  Don't compute the address of the object just
 +      before an array, as that's not portable.  Use EMACS_INT, not
 +      ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
 +      * callint.c (Fcall_interactively):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      * callproc.c (call_process_kill, Fcall_process):
 +      Don't assume pid_t fits into an Emacs fixnum.
 +      (call_process_cleanup, Fcall_process, child_setup):
 +      Don't assume pid_t fits into int.
 +      (call_process_cleanup, Fcall_process, delete_temp_file)
 +      (Fcall_process_region):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (Fcall_process): Simplify handling of volatile integers.
 +      Use int, not EMACS_INT, where int will do.
 +      * casefiddle.c (casify_object, casify_region, operate_on_word)
 +      (Fupcase_word, Fdowncase_word, Fcapitalize_word):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (casify_object): Avoid integer overflow when overallocating buffer.
 +      * casetab.c (set_identity, shuffle): Prefer int to unsigned when
 +      either works.  Use lint_assume to convince GCC 4.6.1 that it's OK.
 +      * category.c (Fchar_category_set): Don't assume fixnum fits in int.
 +      * category.h (CATEGORYP): Don't assume arg is nonnegative.
 +      * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
 +      integers are now checked earlier.  All uses replaced with XINT.
 +      (ccl_driver):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      For CCL_MapSingle, check that content and value are in int range.
 +      (ccl_driver, Fregister_code_conversion_map):
 +      Check that Vcode_version_map_vector is a vector.
 +      (resolve_symbol_ccl_program): Check that vector header is in range.
 +      Always copy the vector, so that we can check its contents reliably
 +      now rather than having to recheck each instruction as it's being
 +      executed.  Check that vector words fit in 'int'.
 +      (ccl_get_compiled_code, Fregister_ccl_program)
 +      (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
 +      program indexes, to avoid needless 32-bit limit on 64-bit hosts.
 +      (Fccl_execute, Fccl_execute_on_string): Check that initial reg
 +      contents are in range.
 +      (Fccl_execute_on_string): Check that status is in range.
 +      * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
 +      * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
 +      Accept and return EMACS_INT, not int, because callers can pass values
 +      out of 'int' range.
 +      (c_string_width, strwidth, lisp_string_width, chars_in_text)
 +      (multibyte_chars_in_text, parse_str_as_multibyte)
 +      (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
 +      (str_as_unibyte, str_to_unibyte, string_count_byte8)
 +      (string_escape_byte8, Fget_byte):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
 +      avoid mishandling large integers.
 +      * character.h: Adjust decls to match defn changes elsewhere.
 +      * charset.c (load_charset_map_from_file, find_charsets_in_text)
 +      (Ffind_charset_region):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (load_charset_map_from_file): Redo idx calculation to avoid overflow.
 +      (load_charset_map_from_vector, Fdefine_charset_internal):
 +      Don't assume fixnum fits in int.
 +      (load_charset_map_from_vector, Fmap_charset_chars):
 +      Remove now-unnecessary CHECK_NATNUMs.
 +      (Fdefine_charset_internal): Check ranges here, more carefully.
 +      Don't rely on undefined behavior with signed left shift overflow.
 +      Don't assume unsigned int fits into fixnum, or that fixnum fits
 +      into unsigned int.  Don't require max_code to be a valid fixnum;
 +      that's not true for gb10830 4-byte on a 32-bit host.  Allow
 +      invalid_code to be a cons, for the same reason.  Require code_offset
 +      to be a character.  Avoid int overflow if max_char is close
 +      to INT_MAX.
 +      (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
 +      this is intended anyway and avoids some undefined behavior.
 +      (load_charset_map): Pass unsigned, not int, as 2nd arg of
 +      INDEX_TO_CODE_POINT, as that's what it expects.
 +      (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
 +      * charset.h (DECODE_CHAR): Return int, not unsigned;
 +      this is what was intended anyway, and it avoids undefined behavior.
 +      (CHARSET_OFFSET): Remove unused macro, instead of fixing its
 +      integer-overflow issues.
 +      (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
 +      Formerly, it returned EMACS_INT on 64-bit hosts in the common case
 +      where the argument is EMACS_INT, and this behavior is not intended.
 +      * chartab.c (Fmake_char_table, Fset_char_table_range)
 +      (uniprop_get_decoder, uniprop_get_encoder):
 +      Don't assume fixnum fits in int.
 +      * cmds.c (move_point): New function, that does the gist of
 +      Fforward_char and Fbackward_char, but does so while checking
 +      for integer overflow more accurately.
 +      (Fforward_char, Fbackward_char): Use it.
 +      (Fforward_line, Fend_of_line, internal_self_insert)
 +      (internal_self_insert):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      Fix a FIXME, by checking for integer overflow when calculating
 +      target_clm and actual_clm.
 +      * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
 +      (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
 +      (ASSURE_DESTINATION, coding_alloc_by_realloc)
 +      (coding_alloc_by_making_gap, alloc_destination)
 +      (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
 +      (encode_coding_utf_16, detect_coding_emacs_mule)
 +      (decode_coding_emacs_mule, encode_coding_emacs_mule)
 +      (detect_coding_iso_2022, decode_coding_iso_2022)
 +      (encode_invocation_designation, encode_designation_at_bol)
 +      (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
 +      (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
 +      (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
 +      (encode_coding_ccl, encode_coding_raw_text)
 +      (detect_coding_charset, decode_coding_charset)
 +      (encode_coding_charset, detect_eol, decode_eol, produce_chars)
 +      (produce_composition, produce_charset, produce_annotation)
 +      (decode_coding, handle_composition_annotation)
 +      (handle_charset_annotation, consume_chars, decode_coding_gap)
 +      (decode_coding_object, encode_coding_object, detect_coding_system)
 +      (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
 +      (code_convert_region, code_convert_string)
 +      (Fdefine_coding_system_internal)
 +      (coding_set_source, coding_set_destination):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
 +      (Fdefine_coding_system_internal):
 +      Don't assume fixnums fit in int.
 +      (decode_coding_gap, decode_coding_object, encode_coding_object)
 +      (Fread_coding_system, Fdetect_coding_region)
 +      (Funencodable_char_position, Fcheck_coding_systems_region)
 +      (get_translation, handle_composition_annotation, consume_chars):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (consume_chars): Rewrite to not calculate an address outside buffer.
 +      (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
 +      Don't access memory outside of the args array.
 +      (Fdefine_coding_system_internal): Check for charset-id overflow.
 +      (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
 +      result of ENCODE_CHAR.
 +      * coding.h: Adjust decls to match defn changes elsewhere.
 +      (struct coding_system):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      * composite.c (get_composition_id, find_composition)
 +      (run_composition_function, update_compositions)
 +      (compose_text, composition_gstring_put_cache)
 +      (composition_gstring_p, composition_gstring_width)
 +      (fill_gstring_header, fill_gstring_body, autocmp_chars)
 +      (composition_compute_stop_pos, composition_reseat_it)
 +      (composition_update_it, struct position_record)
 +      (find_automatic_composition, composition_adjust_point)
 +      (Fcomposition_get_gstring, Ffind_composition_internal):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (update_compositions):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      * composite.h: Adjust decls to match defn changes elsewhere.
 +      (struct composition):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
 +      Do not attempt to compute the address of the object just before a
 +      buffer; this is not portable.
 +      (Faref, Faset):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (Faset): Use int, not EMACS_INT, where int is wide enough.
 +      (Fstring_to_number): Don't assume fixnums fit in int.
 +      (Frem): Don't assume arg is nonnegative.
 +      * dbusbind.c (xd_append_arg): Check for integers out of range.
 +      (Fdbus_call_method): Don't overflow the timeout int.
 +      (extract_signed, extract_unsigned): New functions.
 +      (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
 +      (xd_get_connection_references): Return ptrdiff_t, not int.
 +      All uses changed.
 +      (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
 +      (xd_read_message_1):
 +      Use int, not unsigned, where the dbus API uses int.
 +      (Fdbus_message_internal): Don't overflow mtype.
 +      (syms_of_dbusbind): Allocate right-sized buffer for integers.
 +      * dired.c (directory_files_internal, file_name_completion, scmp)
 +      (file_name_completion_stat):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (file_name_completion): Don't overflow matchcount.
 +      (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
 +      * dispextern.h: Adjust decls to match defn changes elsewhere.
 +      (struct text_pos, struct glyph, struct bidi_saved_info)
 +      (struct bidi_string_data, struct bidi_it, struct composition_it)
 +      (struct it):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (struct display_pos, struct composition_it, struct it):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      * dispnew.c (increment_matrix_positions)
 +      (increment_row_positions, mode_line_string)
 +      (marginal_area_string):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (duration_to_sec_usec): New function, to check for overflow better.
 +      (Fsleep_for, sit_for): Use it.
 +      * doc.c (get_doc_string, store_function_docstring):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (get_doc_string, Fsnarf_documentation):
 +      Use int, not EMACS_INT, where int is wide enough.
 +      (get_doc_string):
 +      Use SAFE_ALLOCA, not alloca.
 +      Check for overflow when converting EMACS_INT to off_t.
 +      * doprnt.c (doprnt):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
 +      Don't assume uid_t fits into fixnum.
 +      (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
 +      (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
 +      (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
 +      (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
 +      (general_insert_function)
 +      (Finsert_char, make_buffer_string, make_buffer_string_both)
 +      (update_buffer_properties, Fbuffer_substring)
 +      (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
 +      (Fsubst_char_in_region, check_translation)
 +      (Ftranslate_region_internal, save_restriction_restore, Fformat)
 +      (transpose_markers, Ftranspose_regions):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (clip_to_bounds): Move to lisp.h as an inline function).
 +      (Fconstrain_to_field): Don't assume integers are nonnegative.
 +      (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
 +      (Fsubst_char_in_region, Fsave_restriction):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (Femacs_pid): Don't assume pid_t fits into fixnum.
 +      (lo_time): Use int, not EMACS_INT, when int suffices.
 +      (lisp_time_argument): Check for usec out of range.
 +      (Fencode_time): Don't assume fixnum fits in int.
 +      (Fuser_login_name, Fuser_full_name): Signal an error
 +      if a uid argument is out of range, rather than relying on
 +      undefined behavior.
 +      (Fformat_time_string): Remove now-unnecessary check.
 +      lisp_time_argument checks for out-of-range usec now.
 +      Use ptrdiff_t, not size_t, where ptrdiff_t will do.
 +      * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
 +      (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
 +      (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
 +      (init_cmdargs, Fdump_emacs):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
 +      the bottom (typically) 32 bits of the fixnum.
 +      * eval.c (specpdl_size, call_debugger):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (when_entered_debugger, Fbacktrace_debug):
 +      Don't assume fixnum can fit in int.
 +      (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
 +      the object just before a buffer; this is not portable.
 +      (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
 +      (grow_specpdl, unbind_to):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
 +      (grow_specpdl): Simplify allocation by using xpalloc.
 +      (Fprog1, Fprog2): Don't assume list length fits in int.  Simplify.
 +      * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
 +      (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
 +      (a_write, e_write):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (Fcopy_file, non_regular_nbytes, read_non_regular)
 +      (Finsert_file_contents):
 +      Use int, not EMACS_INT, where int is wide enough.
 +      (READ_BUF_SIZE): Verify that it fits in int.
 +      (Finsert_file_contents): Check that counts are in proper range,
 +      rather than assuming fixnums fit into ptrdiff_t etc.
 +      Don't assume fixnums fit into int.
 +      * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
 +      * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
 +      (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
 +      (string_char_to_byte, string_byte_to_char)
 +      (string_make_multibyte, string_to_multibyte)
 +      (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
 +      (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
 +      (substring_both, Fdelete, internal_equal, Ffillarray)
 +      (Fclear_string, mapcar1)
 +      (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
 +      (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
 +      (larger_vector, make_hash_table, maybe_resize_hash_table)
 +      (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
 +      (Fmaphash, secure_hash):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (concat): Check for string index and length overflow.
 +      (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
 +      (Frequire):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (larger_vector): New API (vec, incr_min, size_max) replaces old
 +      one (vec, new_size, init).  This catches size overflow.
 +      INIT was removed because it was always Qnil.
 +      All callers changed.
 +      (INDEX_SIZE_BOUND): New macro, which calculates more precisely
 +      the upper bound on a hash table index size.
 +      (make_hash_table, maybe_resize_hash_table): Use it.
 +      (secure_hash): Computer start_byte and end_byte only after
 +      they're known to be in ptrdiff_t range.
 +      * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
 +      (Ffont_get_glyphs, Ffont_at):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
 +      (Flist_fonts, Fopen_font):
 +      Don't assume fixnum can fit in int.
 +      (check_gstring): Don't assume index can fit in int.
 +      (font_match_p): Check that fixnum is a character, not a nonnegative
 +      fixnum, since the later code needs to stuff it into an int.
 +      (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
 +      (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
 +      conversion overflow issues.
 +      (Fopen_font): Check for integer out of  range.
 +      (Ffont_get_glyphs): Don't assume index can fit in int.
 +      * font.h: Adjust decls to match defn changes elsewhere.
 +      * fontset.c (reorder_font_vector): Redo score calculation to avoid
 +      integer overflow.
 +      (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
 +      printmax_t, where ptrdiff_t is wide enough.
 +      (Finternal_char_font):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
 +      (Fset_frame_height, Fset_frame_width, Fset_frame_size)
 +      (Fset_frame_position, x_set_frame_parameters)
 +      (x_set_line_spacing, x_set_border_width)
 +      (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
 +      Check that fixnums are in proper range for system types.
 +      (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (Fmodify_frame_parameters): Don't assume fixnum fits in int.
 +      Use SAFE_ALLOCA_LISP, not alloca.
 +      * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
 +      intptr_t is wide enough.
 +      * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
 +      (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
 +      (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
 +      Check for fixnum out of range.
 +      * ftfont.c (ftfont_list): Don't assume index fits in int.
 +      Check that fixnums are in proper range for system types.
 +      (ftfont_shape_by_flt):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
 +      Check that fixnums are in proper range for system types.
 +      * gnutls.h: Adjust decls to match defn changes elsewhere.
 +      * gtkutil.c (xg_dialog_run):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (update_frame_tool_bar):
 +      Check that fixnums are in proper range for system types.
 +      * image.c (parse_image_spec): Redo count calculation to avoid overflow.
 +      (lookup_image): Check that fixnums are in range for system types.
 +      * indent.c (last_known_column, last_known_column_point):
 +      (current_column_bol_cache):
 +      (skip_invisible, current_column, check_display_width):
 +      (check_display_width, scan_for_column, current_column_1)
 +      (Findent_to, Fcurrent_indentation, position_indentation)
 +      (indented_beyond_p, Fmove_to_column, compute_motion):
 +      (Fcompute_motion, Fvertical_motion):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (last_known_column_modified): Use EMACS_INT, not int.
 +      (check_display_width):
 +      (Fcompute_motion):
 +      Check that fixnums and floats are in proper range for system types.
 +      (compute_motion): Don't assume index or fixnum fits in int.
 +      (compute_motion, Fcompute_motion):
 +      Use int, not EMACS_INT, when it is wide enough.
 +      (vmotion): Omit local var start_hpos that is always 0; that way
 +      we don't need to worry about overflow in expressions involving it.
 +      * indent.h: Adjust decls to match defn changes elsewhere.
 +      (struct position):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      Use int, not EMACS_INT, where int is wide enough.
 +      Remove unused members ovstring_chars_done and tab_offset;
 +      all uses removed.
 +      * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
 +      (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
 +      (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
 +      (make_gap, copy_text, insert, insert_and_inherit)
 +      (insert_before_markers, insert_before_markers_and_inherit)
 +      (insert_1, count_combining_before, count_combining_after)
 +      (insert_1_both, insert_from_string)
 +      (insert_from_string_before_markers, insert_from_string_1)
 +      (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
 +      (adjust_after_replace, adjust_after_insert, replace_range)
 +      (replace_range_2, del_range, del_range_1, del_range_byte)
 +      (del_range_both, del_range_2, modify_region)
 +      (prepare_to_modify_buffer, signal_before_change)
 +      (signal_after_change, Fcombine_after_change_execute):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      * intervals.c (traverse_intervals, rotate_right, rotate_left)
 +      (balance_an_interval, split_interval_right, split_interval_left)
 +      (find_interval, next_interval, update_interval)
 +      (adjust_intervals_for_insertion, delete_node, delete_interval)
 +      (interval_deletion_adjustment, adjust_intervals_for_deletion)
 +      (static_offset_intervals, offset_intervals)
 +      (merge_interval_right, merge_interval_left, make_new_interval)
 +      (graft_intervals_into_buffer, temp_set_point_both)
 +      (temp_set_point, set_point, adjust_for_invis_intang)
 +      (set_point_both, move_if_not_intangible, get_property_and_range)
 +      (get_local_map, copy_intervals, copy_intervals_to_string)
 +      (compare_string_intervals, set_intervals_multibyte_1):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      * intervals.h: Adjust decls to match defn changes elsewhere.
 +      (struct interval):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      * keyboard.c (this_command_key_count, this_single_command_key_start)
 +      (before_command_key_count, before_command_echo_length, echo_now)
 +      (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
 +      (command_loop_1, safe_run_hooks, read_char, timer_check_2)
 +      (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
 +      (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (last_non_minibuf_size, last_point_position, echo_truncate)
 +      (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
 +      (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
 +      (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
 +      (stuff_buffered_input):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (last_auto_save, command_loop_1, read_char):
 +      Use EMACS_INT, not int, to avoid integer overflow.
 +      (record_char): Avoid overflow in total_keys computation.
 +      (parse_modifiers_uncached): Redo index calculation to avoid overflow.
 +      * keyboard.h: Adjust decls to match defn changes elsewhere.
 +      * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
 +      (Fkey_description, Fdescribe_vector, Flookup_key):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (click_position): New function, to check that positions are in range.
 +      (Fcurrent_active_maps):
 +      (describe_command):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (Faccessible_keymaps, Fkey_description):
 +      (preferred_sequence_p):
 +      Don't assume fixnum can fit into int.
 +      (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
 +      Check for integer overflow in size calculations.
 +      (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
 +      avoid mishandling large integers.
 +      * lisp.h: Adjust decls to match defn changes elsewhere.
 +      (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
 +      (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
 +      (struct Lisp_Marker):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (clip_to_bounds): Now an inline function, moved here from editfns.c.
 +      (GLYPH_CODE_P): Check for overflow in system types, subsuming the
 +      need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
 +      All callers changed.
 +      (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
 +      Assume the arg has valid form, since it always does.
 +      (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
 +      unsigned integer system type.
 +      (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
 +      (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
 +      (duration_to_sec_usec): New decl.
 +      * lread.c (read_from_string_index, read_from_string_index_byte)
 +      (read_from_string_limit, readchar, unreadchar, openp)
 +      (read_internal_start, read1, oblookup):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (Fload, readevalloop, Feval_buffer, Feval_region):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (openp): Check for out-of-range argument to 'access'.
 +      (read1): Use int, not EMACS_INT, where int is wide enough.
 +      Don't assume fixnum fits into int.
 +      Fix off-by-one error that can read outside a buffer.
 +      (read_filtered_event): Use duration_to_sec_usec
 +      to do proper overflow checking on durations.
 +      * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
 +      in size calculation.
 +      (Fexecute_kbd_macro):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      * marker.c (cached_charpos, cached_bytepos, CONSIDER)
 +      (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
 +      (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
 +      (set_marker_both, set_marker_restricted_both, marker_position)
 +      (marker_byte_position, Fbuffer_has_markers_at):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
 +      * menu.c (ensure_menu_items): Renamed from grow_menu_items.
 +      It now merely ensures that the menu is large enough, without
 +      necessarily growing it, as this avoids some integer overflow issues.
 +      All callers changed.
 +      (keymap_panes, parse_single_submenu, Fx_popup_menu):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
 +      Use SAFE_ALLOCA_LISP, not alloca.
 +      (find_and_return_menu_selection): Avoid unnecessary casts of pointers
 +      to EMACS_INT.  Check that fixnums are in proper range for system types.
 +      * minibuf.c (minibuf_prompt_width, string_to_object)
 +      (Fminibuffer_contents, Fminibuffer_contents_no_properties)
 +      (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (get_minibuffer, read_minibuf_unwind):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
 +      this simplifies overflow checking.  All callers changed.
 +      (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
 +      (Ftest_completion):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
 +      (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
 +      Check that fixnums are in proper range for system types.
 +      (Fx_create_frame, Fx_show_tip):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      * nsfont.m (ns_findfonts, nsfont_list_family):
 +      Don't assume fixnum fits in long.
 +      * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
 +      wide enough.
 +      * nsselect.m (ns_get_local_selection, clean_local_selection_data):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
 +      (PRINTDECLARE, PRINTPREPARE):
 +      (strout, print_string):
 +      (print, print_preprocess, print_check_string_charset_prop)
 +      (print_object):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (PRINTDECLARE):
 +      (temp_output_buffer_setup, Fprin1_to_string, print_object):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
 +      (printchar, strout): Use xpalloc to catch size calculation overflow.
 +      (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
 +      (print_error_message): Use SAFE_ALLOCA, not alloca.
 +      (print_object): Use int, not EMACS_INT, where int is wide enough.
 +      (print_depth, new_backquote_output, print_number_index):
 +      Use ptrdiff_t, not int, where int might not be wide enough.
 +      * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
 +      (Fset_process_window_size, Fformat_network_address)
 +      (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
 +      (sigchld_handler):
 +      Check that fixnums are in proper range for system types.
 +      (Fsignal_process): Simplify by avoiding a goto.
 +      Check for process-ids out of pid_t range rather than relying on
 +      undefined behavior.
 +      (process_tick, update_tick): Use EMACS_INT, not int.
 +      (Fformat_network_address, read_process_output, send_process)
 +      (Fprocess_send_region, status_notify):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
 +      (wait_reading_process_output, read_process_output, exec_sentinel):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
 +      (Faccept_process_output): Use duration_to_sec_usec to do proper
 +      overflow checking on durations.
 +      (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
 +      Don't assume pid_t fits in int.
 +      * process.h (struct Lisp_Process): Members tick and update_tick
 +      are now of type EMACS_INT, not int.
 +      * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
 +      configured --with-wide-int.
 +      * scroll.c (calculate_scrolling, calculate_direct_scrolling)
 +      (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
 +      * search.c (looking_at_1, string_match_1):
 +      (fast_string_match, fast_c_string_match_ignore_case)
 +      (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
 +      (scan_newline, find_before_next_newline, search_command)
 +      (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
 +      (set_search_regs, wordify):
 +      (Freplace_match):
 +      (Fmatch_data):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (string_match_1, search_buffer, set_search_regs):
 +      (Fmatch_data):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (wordify): Check for overflow in size calculation.
 +      (Freplace_match): Avoid potential buffer overflow in search_regs.start.
 +      (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
 +      Check that fixnums are in proper range for system types.
 +      * sound.c (struct sound_device)
 +      (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (Fplay_sound_internal):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      * syntax.c (struct lisp_parse_state, find_start_modiff)
 +      (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
 +      (Fparse_partial_sexp):
 +      Don't assume fixnums can fit in int.
 +      (struct lisp_parse_state, find_start_pos, find_start_value)
 +      (find_start_value_byte, find_start_begv)
 +      (update_syntax_table, char_quoted, dec_bytepos)
 +      (find_defun_start, prev_char_comend_first, back_comment):
 +      (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
 +      (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (Finternal_describe_syntax_value): Check that match_lisp is a
 +      character, not an integer, since the code stuffs it into int.
 +      (scan_words, scan_sexps_forward):
 +      Check that fixnums are in proper range for system types.
 +      (Fforward_word):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (scan_sexps_forward):
 +      Use CHARACTERP, not INTEGERP, since the value must fit into int.
 +      (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
 +      * syntax.h: Adjust decls to match defn changes elsewhere.
 +      (struct gl_state_s):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
 +      MOST_POSITIVE_FIXNUM.
 +      * sysdep.c (wait_for_termination_1, wait_for_termination)
 +      (interruptible_wait_for_termination, mkdir):
 +      Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
 +      (emacs_read, emacs_write):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
 +      and double all fit in int.
 +      * term.c (set_tty_color_mode):
 +      Check that fixnums are in proper range for system types.
 +      * termhooks.h (struct input_event):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      * textprop.c (validate_interval_range, interval_of)
 +      (Fadd_text_properties, set_text_properties_1)
 +      (Fremove_text_properties, Fremove_list_of_text_properties)
 +      (Ftext_property_any, Ftext_property_not_all)
 +      (copy_text_properties, text_property_list, extend_property_ranges)
 +      (verify_interval_modification):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (Fnext_single_char_property_change)
 +      (Fprevious_single_char_property_change):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (copy_text_properties):
 +      Check for integer overflow in index calculation.
 +      * undo.c (last_boundary_position, record_point, record_insert)
 +      (record_delete, record_marker_adjustment, record_change)
 +      (record_property_change):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
 +      (Fx_hide_tip, Fx_file_dialog):
 +      * w32menu.c (set_frame_menubar):
 +      Use ptrdiff_t, not int, for consistency with rest of code.
 +      * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
 +      (select_window, Fdelete_other_windows_internal)
 +      (window_scroll_pixel_based, window_scroll_line_based)
 +      (Frecenter, Fset_window_configuration):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (Fset_window_hscroll, run_window_configuration_change_hook)
 +      (set_window_buffer, temp_output_buffer_show, scroll_command)
 +      (Fscroll_other_window, Frecenter):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
 +      Don't assume fixnum fits in int.
 +      (Fset_window_scroll_bars):
 +      Check that fixnums are in proper range for system types.
 +      * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
 +      (string_pos, c_string_pos, number_of_chars, init_iterator)
 +      (in_ellipses_for_invisible_text_p, init_from_display_pos)
 +      (compute_stop_pos, next_overlay_change, compute_display_string_pos)
 +      (compute_display_string_end, handle_face_prop)
 +      (face_before_or_after_it_pos, handle_invisible_prop)
 +      (handle_display_prop, handle_display_spec, handle_single_display_spec)
 +      (display_prop_intangible_p, string_buffer_position_lim)
 +      (string_buffer_position, handle_composition_prop, load_overlay_strings)
 +      (get_overlay_strings_1, get_overlay_strings)
 +      (iterate_out_of_display_property, forward_to_next_line_start)
 +      (back_to_previous_visible_line_start, reseat, reseat_to_string)
 +      (get_next_display_element, set_iterator_to_next)
 +      (get_visually_first_element, compute_stop_pos_backwards)
 +      (handle_stop_backwards, next_element_from_buffer)
 +      (move_it_in_display_line_to, move_it_in_display_line)
 +      (move_it_to, move_it_vertically_backward, move_it_by_lines)
 +      (add_to_log, message_dolog, message_log_check_duplicate)
 +      (message2, message2_nolog, message3, message3_nolog
 +      (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
 +      (current_message_1, truncate_echo_area, truncate_message_1)
 +      (set_message, set_message_1, store_mode_line_noprop)
 +      (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
 +      (text_outside_line_unchanged_p, check_point_in_composition)
 +      (reconsider_clip_changes)
 +      (redisplay_internal, set_cursor_from_row, try_scrolling)
 +      (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
 +      (redisplay_window, find_last_unchanged_at_beg_row)
 +      (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
 +      (trailing_whitespace_p, find_row_edges, display_line)
 +      (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
 +      (display_mode_element, store_mode_line_string)
 +      (pint2str, pint2hrstr, decode_mode_spec)
 +      (display_count_lines, display_string, draw_glyphs)
 +      (x_produce_glyphs, x_insert_glyphs)
 +      (rows_from_pos_range, mouse_face_from_buffer_pos)
 +      (fast_find_string_pos, mouse_face_from_string_pos)
 +      (note_mode_line_or_margin_highlight, note_mouse_highlight):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (safe_call, init_from_display_pos, handle_fontified_prop)
 +      (handle_single_display_spec, load_overlay_strings)
 +      (with_echo_area_buffer, setup_echo_area_for_printing)
 +      (display_echo_area, echo_area_display)
 +      (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
 +      (update_tool_bar, hscroll_window_tree, redisplay_internal)
 +      (redisplay_window, dump_glyph_row, display_mode_line)
 +      (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
 +      (handle_display_spec, display_prop_string_p):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (handle_single_display_spec, build_desired_tool_bar_string)
 +      (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
 +      (get_specified_cursor_type):
 +      Check that fixnums are in proper range for system types.
 +      (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
 +      (Flookup_image_map):
 +      Don't assume fixnums fit in int.
 +      (compare_overlay_entries):
 +      Avoid mishandling comparisons due to subtraction overflow.
 +      (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
 +      (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
 +      (handle_tool_bar_click):
 +      Use int, not unsigned, since we prefer signed and the signedness
 +      doesn't matter here.
 +      (get_next_display_element, next_element_from_display_vector):
 +      Use int, not EMACS_INT, when int is wide enough.
 +      (start_hourglass): Use duration_to_sec_usec to do proper
 +      overflow checking on durations.
 +      * xfaces.c (Fbitmap_spec_p):
 +      Check that fixnums are in proper range for system types.
 +      (compare_fonts_by_sort_order):
 +      Avoid mishandling comparisons due to subtraction overflow.
 +      (Fx_family_fonts, realize_basic_faces):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (Fx_family_fonts):
 +      Don't assume fixnum fits in int.
 +      Use SAFE_ALLOCA_LISP, not alloca.
 +      (merge_face_heights): Remove unnecessary cast to EMACS_INT.
 +      (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
 +      (face_at_buffer_position, face_for_overlay_string)
 +      (face_at_string_position):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      (merge_faces): Use int, not EMACS_INT, where int is wide enough.
 +      * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
 +      (Fx_show_tip):
 +      Check that fixnums are in proper range for system types.
 +      (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
 +      (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (Fx_change_window_property): Don't assume fixnums fit in int.
 +      * xfont.c (xfont_chars_supported):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      * xmenu.c (Fx_popup_dialog, set_frame_menubar)
 +      (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      * xml.c (parse_region):
 +      * xrdb.c (magic_file_p):
 +      Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
 +      * xselect.c (TRACE1): Don't assume pid_t promotes to int.
 +      (x_get_local_selection, x_reply_selection_request)
 +      (x_handle_selection_request, wait_for_property_change):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      (selection_data_to_lisp_data): Use short, not EMACS_INT, where
 +      short is wide enough.
 +      (x_send_client_event): Don't assume fixnum fits in int.
 +      * xterm.c (x_x_to_emacs_modifiers):
 +      Don't assume EMACS_INT overflows nicely into int.
 +      (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
 +      may come from Lisp.
 +      (handle_one_xevent): NATNUMP can eval its arg twice.
 +      (x_connection_closed):
 +      Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
 +      * xterm.h: Adjust decls to match defn changes elsewhere.
 +      (struct scroll_bar): Use struct vectorlike_header
 +      rather than rolling our own approximation.
 +      (SCROLL_BAR_VEC_SIZE): Remove; not used.
 +
 +2012-05-25  Glenn Morris  <rgm@gnu.org>
 +
 +      * lisp.mk (lisp): Update for more files being compiled now.
 +
 +2012-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * lread.c: Remove `read_pure' which makes no difference.
 +      (read_pure): Remove var.
 +      (unreadpure): Remove function.
 +      (readevalloop): Don't call read_list with -1 flag.
 +      (read1, read_vector): Don't test read_pure any more.
 +      (read_list): Simplify.
 +
 +      * fileio.c, character.h: Minor style tweaks.
 +
 +2012-05-24  Dmitry Antipov  <dmantipov@yandex.ru>
 +
 +      * window.h (clip_changed): Remove useless declaration.
 +
 +2012-05-22  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
 +      (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
 +
 +2012-05-22  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Remove src/m/*.
 +      This directory predates autoconf and is no longer needed nowadays.
 +      Move its few remaining bits of functionality to where they're needed.
 +      * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
 +      * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
 +      * m/template.h: Remove.
 +      * Makefile.in (M_FILE): Remove.  All uses removed.
 +      * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
 +      * lisp.h (USE_LSB_TAG):
 +      * mem-limits.h (EXCEEDS_LISP_PTR):
 +      Use VAL_MAX, not VALBITS, in #if.
 +      * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
 +      (EMACS_UINT): Define unconditionally now.
 +      (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
 +      (BITS_PER_EMACS_INT): New constants, replacing
 +      what used to be in config.h, but not useful in #if.
 +      (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
 +      define them any more.
 +      (VAL_MAX): New macro.
 +      (VALMASK): Use it.
 +      * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
 +      BITS_PER_EMACS_INT, in #if.
 +      * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
 +      (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
 +      * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
 +      * s/ms-w32.h (DATA_START):
 +      Move here from removed file m/intel386.h.
 +      * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
 +      * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
 +
 +2012-05-21  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Assume C89 or later.
 +      * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
 +      * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
 +      (xrealloc):
 +      * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
 +      * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
 +      * textprop.c, tparam.c (NULL): Remove.
 +      * ralloc.c, vm-limit.c (POINTER): Assume void * works.
 +      * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
 +      * regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
 +      * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
 +      * xterm.c (input_signal_count): Assume volatile works.
 +
 +2012-05-21  Ken Brown  <kbrown@cornell.edu>
 +
 +      * xgselect.c (xg_select): Fix first argument in call to 'select'
 +      (bug#11508).
 +
 +2012-05-20  Ken Brown  <kbrown@cornell.edu>
 +
 +      * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
 +      [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
 +
 +2012-05-19  Ken Brown  <kbrown@cornell.edu>
 +
 +      * xfns.c (x_in_use): Remove `static' qualifier.
 +      * xterm.h (x_in_use): Declare.
 +      * xgselect.c: Include xterm.h.
 +      (xg_select): Test `x_in_use' instead of `inhibit_window_system'
 +      and `display_arg' (bug#9754).
 +
 +2012-05-19  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
 +
 +      * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
 +      * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
  
 -      * xdisp.c (pos_visible_p): Fix last change.  (Bug#11464)
 +2012-05-18  Eli Zaretskii  <eliz@gnu.org>
  
 -2012-05-13  Eli Zaretskii  <eliz@gnu.org>
 +      Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
 +
 +      * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
 +      (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
 +
 +      * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
 +      reference to image_cache->refcount.
 +      (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
 +
 +2012-05-17  Juri Linkov  <juri@jurta.org>
 +
 +      * search.c (Fword_search_regexp, Fword_search_backward)
 +      (Fword_search_forward, Fword_search_backward_lax)
 +      (Fword_search_forward_lax): Move functions to isearch.el
 +      (bug#10145, bug#11381).
 +
 +2012-05-16  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
 +
 +2012-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * lread.c (init_obarray): Declare Qt and Qnil as special.
 +
 +2012-05-14  Glenn Morris  <rgm@gnu.org>
 +
 +      * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
 +      Put "libexec" before "bin", for the sake of init_callproc_1.
 +
 +2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
 +
 +      * unexaix.c: Port to more-recent AIX compilers.
 +      (report_error, report_error_1, make_hdr, copy_sym)
 +      (mark_x, adjust_lnnoptrs, unrelocate_symbols):
 +      Make arguments const char *, not char *, to avoid violations of C
 +      standard and to fix some AIX warnings reported by Gilles Pion.
 +
 +2012-05-14  Eli Zaretskii  <eliz@gnu.org>
  
        * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
        already have overlays loaded.
        stopped at the last line of window, which happens to be scanned
        backwards by the bidi iteration.  (Bug#11464)
  
 -2012-05-11  Eli Zaretskii  <eliz@gnu.org>
 +2012-05-14  Eli Zaretskii  <eliz@gnu.org>
  
        * xdisp.c (handle_single_display_spec): Return 1 for left-margin
        and right-margin display specs even if the spec is invalid or we
        display spec.  This fixes display when the spec is invalid or we
        are on a TTY.
  
 -2012-05-09  Paul Eggert  <eggert@cs.ucla.edu>
 +2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
  
        * unexaix.c (make_hdr): Fix typo in prototype.
        This bug broke the build on AIX.  Problem reported by Gilles Pion.
  
 -2012-05-05  Eli Zaretskii  <eliz@gnu.org>
 +2012-05-14  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * keyboard.c (kbd_buffer_get_event): Read special events also in
 +      batch mode.  (Bug#11415)
 +
 +2012-05-12  Glenn Morris  <rgm@gnu.org>
 +
 +      * ns.mk: Update for ns_appbindir no longer having trailing "/".
 +
 +2012-05-12  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * lisp.mk (lisp): Add newcomment.elc.
 +
 +2012-05-12  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (MKDIR_P): New, set by configure.
 +      * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
 +
 +2012-05-11  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Remove unused function hourglass_started.
 +      * dispextern.h (hourglass_started):
 +      * w32fns.c (hourglass_started):
 +      * xdisp.c (hourglass_started): Remove.
 +
 +2012-05-10  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
 +      Update dependencies.
 +
 +2012-05-10  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * xgselect.c (xg_select): Put maxfds+1 into a var.
 +      This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
 +
 +      * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
 +
 +2012-05-10  Dave Abrahams  <dave@boostpro.com>
 +
 +      * filelock.c (syms_of_filelock): New boolean create-lockfiles.
 +      (lock_file): If create_lockfiles is 0, do nothing.  (Bug#11227)
 +
 +2012-05-09  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * dbusbind.c (xd_registered_buses): New internal Lisp object.
 +      Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
 +      (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
 +      Initialize xd_registered_buses.
 +
 +2012-05-09  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Untag more efficiently if USE_LSB_TAG.
 +      This is based on a proposal by YAMAMOTO Mitsuharu in
 +      <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
 +      For an admittedly artificial (nth 8000 longlist) benchmark on
 +      Fedora 15 x86-64, this yields a 25% CPU speedup.  Also, it shrinks
 +      Emacs's overall text size by 1%.
 +      * lisp.h (XUNTAG): New macro.
 +      (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
 +      (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
 +      (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
 +      * eval.c (Fautoload):
 +      * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
 +      * frame.h (XFRAME): Use XUNTAG.
 +
 +      Port recent dbusbind.c changes to 32-bit --with-wide-int.
 +      * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
 +      Remove unportable assumptions about print widths of types like
 +      dbus_uint32_t.
 +      (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
 +      intptr_t when converting between pointer and integer, to avoid GCC
 +      warnings about wrong width.
 +
 +2012-05-09  Eli Zaretskii  <eliz@gnu.org>
  
        * w32proc.c (new_child): Force Windows to reserve only 64KB of
        stack for each reader_thread, instead of defaulting to 8MB
        subprocesses on Windows 7, see the discussion in this thread:
        http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
  
 -2012-05-02  Jim Meyering  <meyering@redhat.com>
 +2012-05-07  Jérémy Compostella  <jeremy.compostella@gmail.com>
 +
 +      Fix up display of the *Minibuf-0* buffer in the mini window.
 +      * keyboard.c (read_char): Don't clear the echo area if there's no
 +      message to clear.
 +      * xdisp.c (redisplay_internal): Redisplay the mini window (with the
 +      contents of *Minibuf-0*) if there's no message displayed in its stead.
 +
 +2012-05-07  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
 +      batch mode.
 +
 +2012-05-06  Chong Yidong  <cyd@gnu.org>
 +
 +      * lisp.mk (lisp): Update.
 +
 +2012-05-05  Jim Meyering  <meyering@redhat.com>
  
        * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
  
 -2012-04-29  Eli Zaretskii  <eliz@gnu.org>
 +2012-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * data.c (PUT_ERROR): New macro.
 +      (syms_of_data): Use it.  Add new error type `user-error'.
 +      * undo.c (user_error): New function.
 +      (Fprimitive_undo): Use it.
 +      * print.c (print_error_message): Adjust print style for `user-error'.
 +      * keyboard.c (user_error): New function.
 +      (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
 +
 +2012-05-03  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Do not limit current-time-string to years 1000..9999.
 +      * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
 +      (Fcurrent_time_string): Support any year that is supported by the
 +      underlying localtime representation.  Don't use asctime, as it
 +      has undefined behavior for years outside the range -999..9999.
 +
 +2012-05-02  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fix race conditions involving setenv, gmtime, localtime, asctime.
 +      Without this fix, interrupts could mess up code that uses these
 +      nonreentrant functions, since setting TZ invalidates existing
 +      tm_zone or tzname values, and since most of these functions return
 +      pointers to static storage.
 +      * editfns.c (format_time_string, Fdecode_time, Fencode_time)
 +      (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
 +      Grow the critical sections to include not just invoking
 +      localtime/gmtime, but also accessing these functions' results
 +      including their tm_zone values if any, and any related TZ setting.
 +      (format_time_string): Last arg is now struct tm *, not struct tm **,
 +      so that the struct tm is saved in the critical section.
 +      All callers changed.  Simplify allocation of initial buffer, partly
 +      motivated by the fact that memory allocation needs to be outside
 +      the critical section.
 +
 +2012-05-02  Dmitry Antipov  <dmantipov@yandex.ru>
 +
 +      * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
 +      with RESET_INTERVAL.
 +
 +      * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
 +      Remove duplicated buffer name initialization.
 +
 +2012-05-02  Jim Meyering  <jim@meyering.net>
 +
 +      * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
 +
 +      * xfns.c (x_window): Use xstrdup (Bug#11375).
 +
 +2012-05-02  Eli Zaretskii  <eliz@gnu.org>
  
        * xdisp.c (pos_visible_p): If already at a newline from the
        display string before the 'while' loop, don't walk back the glyphs
        from it3.glyph_row.  Solves assertion violation when the display
        string begins with a newline (egg.el).  (Bug#11367)
  
 -2012-04-24  Chong Yidong  <cyd@gnu.org>
 +2012-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
 +      Move to simple.el.
 +
 +2012-05-01  Glenn Morris  <rgm@gnu.org>
 +
 +      * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
 +      s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
 +      and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
 +      All were removed before 23.1.
 +
 +      * dispnew.c: Remove HAVE_LIBNCURSES test;
 +      it is always true on relevant platforms.
 +
 +      * Makefile.in (LD_SWITCH_X_SITE_RPATH):
 +      Rename from LD_SWITCH_X_SITE_AUX_RPATH.
 +
 +      * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
 +
 +2012-04-30  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * .gdbinit (xpr): Remove checks for no longer existing misc types.
 +      (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
 +      Remove.
 +
 +2012-04-28  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Do not avoid creating empty evaporating overlays (Bug#9642).
 +      * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
 +      That is, do not delete an evaporating overlay if it becomes
 +      empty after its bounds are adjusted to fit within its buffer.
 +      This fix caused other problems, and I'm reverting it until we get
 +      to the bottom of them.
 +
 +2012-04-27  Chong Yidong  <cyd@gnu.org>
  
        * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
  
 -2012-04-23  Eli Zaretskii  <eliz@gnu.org>
 +2012-04-27  Eli Zaretskii  <eliz@gnu.org>
  
        * xdisp.c (pos_visible_p): If the window start position is beyond
        ZV, start the display from buffer beginning.  Prevents assertion
  
        * window.c (window_scroll_pixel_based): Likewise.
  
 -2012-04-23  Chong Yidong  <cyd@gnu.org>
 +2012-04-27  Chong Yidong  <cyd@gnu.org>
  
        * keymap.c (where_is_internal): Doc fix (Bug#10872).
  
 -2012-04-20  Glenn Morris  <rgm@gnu.org>
 +2012-04-27  Glenn Morris  <rgm@gnu.org>
  
        * fileio.c (Fcopy_file, Fset_file_selinux_context):
        Ignore ENOTSUP failures from setfilecon functions.  (Bug#11245)
  
 -2012-04-20  Eli Zaretskii  <eliz@gnu.org>
 +2012-04-27  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
 +      Don't overrun array limits of glyph row's used[] array.  (Bug#11288)
 +
 +2012-04-26  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
 +      display element, check also the underlying string or buffer
 +      character.  (Bug#11341)
 +
 +      * w32menu.c: Include w32heap.h.
 +      (add_menu_item): If the call to AppendMenuW (via
 +      unicode_append_menu) fails, disable Unicode menus only if we are
 +      running on Windows 9X/Me.
 +
 +2012-04-24  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
 +      (xgetint): Add missing shift for LSB tags.
 +
 +2012-04-24  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * keyboard.c (read_char): Don't wipe echo area for select window
 +      events: These might get delayed via `mouse-autoselect-window'
 +      (Bug#11304).
 +
 +2012-04-24  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * gnutls.c (init_gnutls_functions): Protect against (unlikely)
 +      manipulation of :loaded-from data.
 +
 +2012-04-23  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * gnutls.c (init_gnutls_functions): The value of :loaded-from is
 +      now a cons (bug#11311).
 +
 +2012-04-23  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Do not create empty overlays with the evaporate property (Bug#9642).
 +      * buffer.c (Fmove_overlay): Delete an evaporating overlay
 +      if it becomes empty after its bounds are adjusted to fit within
 +      its buffer.  Without this fix, in a nonempty buffer (let ((o
 +      (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
 +      yields an empty overlay that has the evaporate property, which is
 +      not supposed to happen.
 +
 +      Fix minor GTK3 problems found by static checking.
 +      * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
 +      (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
 +      (struct _EmacsFixedClass, emacs_fixed_get_type):
 +      Move decls here from emacsgtkfixed.h, since they needn't be public.
 +      (emacs_fixed_get_type): Now static.
 +      (emacs_fixed_class_init): Omit unused local.
 +      (emacs_fixed_child_type): Remove; unused.
 +      * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
 +      (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
 +      (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
 +      (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
 +      (EMACS_FIXED_GET_CLASS): Remove; unused.
 +      * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
 +
 +      * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
 +      Problem reported by Juanma Barranquero for Windows -Wunused-function.
 +
 +2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
 +      * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
 +      (__malloc_size_t, __malloc_ptrdiff_t):
 +      Remove.  All uses removed, replaced by the definiens if needed,
 +      since we can assume C89 or better now.
 +      Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
 +      (protect_malloc_state, align, get_contiguous_space)
 +      (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
 +      (malloc_atfork_handler_child, malloc_enable_thread)
 +      (malloc_initialize_1, __malloc_initialize, morecore_nolock)
 +      (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
 +      (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
 +      (special_realloc, _realloc_internal_nolock, _realloc_internal)
 +      (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
 +      (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
 +      Define using prototypes, not old style.
 +      (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
 +      Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
 +      (align): Don't assume that signed integer overflow wraps around.
 +      Omit unused local var.
 +      (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
 +      (_free_internal_nolock, memalign, mallochook, reallochook):
 +      Omit no-longer-needed casts.
 +      (valloc): Use getpagesize, not __getpagesize.
 +      (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
 +      (struct hdr): The 'magic' member is now size_t, not unsigned long.
 +
 +      * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
 +
 +2012-04-22  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      Move functions from C to Lisp.  Make non-blocking method calls
 +      the default.  Implement further D-Bus standard interfaces.
 +
 +      * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
 +      (QCdbus_request_name_allow_replacement)
 +      (QCdbus_request_name_replace_existing)
 +      (QCdbus_request_name_do_not_queue)
 +      (QCdbus_request_name_reply_primary_owner)
 +      (QCdbus_request_name_reply_in_queue)
 +      (QCdbus_request_name_reply_exists)
 +      (QCdbus_request_name_reply_already_owner): Move to dbus.el.
 +      (QCdbus_registered_serial, QCdbus_registered_method)
 +      (QCdbus_registered_signal): New Lisp objects.
 +      (XD_DEBUG_MESSAGE): Use sizeof.
 +      (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
 +      (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
 +      (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
 +      (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
 +      (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
 +      (xd_signature, xd_append_arg): Allow float for integer types.
 +      (xd_get_connection_references): New function.
 +      (xd_get_connection_address): Rename from xd_initialize.
 +      Return cached address.
 +      (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
 +      (xd_close_bus): Rename from Fdbus_close_bus.  Not needed on Lisp
 +      level.
 +      (Fdbus_init_bus): New optional arg PRIVATE.  Cache address.
 +      Return number of refcounts.
 +      (Fdbus_get_unique_name): Make stronger parameter check.
 +      (Fdbus_message_internal): New defun.
 +      (Fdbus_call_method, Fdbus_call_method_asynchronously)
 +      (Fdbus_method_return_internal, Fdbus_method_error_internal)
 +      (Fdbus_send_signal, Fdbus_register_service)
 +      (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
 +      (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
 +      (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
 +      (Vdbus_compiled_version, Vdbus_runtime_version)
 +      (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
 +      (Vdbus_message_type_method_return, Vdbus_message_type_error)
 +      (Vdbus_message_type_signal): New defvars.
 +      (Vdbus_registered_buses, Vdbus_registered_objects_table):
 +      Adapt docstring.
 +
 +2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
 +      * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
 +      Do not assume ptrdiff_t is the same width as 'int'.
 +
 +      * alloc.c: Handle unusual debugging option combinations.
 +      (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
 +      since the two debugging options are incompatible.
 +      (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
 +      is defined.
 +      (mem_init, mem_insert, mem_insert_fixup):
 +      Define if GC_MARK_STACK || GC_MALLOC_CHECK.
 +      (NEED_MEM_INSERT): Remove; no longer needed.
 +
 +2012-04-22  Leo Liu  <sdl.web@gmail.com>
 +
 +      * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
 +
 +2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * sysdep.c [__FreeBSD__]: Minor cleanups.
 +      (list_system_processes, system_process_attributes) [__FreeBSD__]:
 +      Use Emacs indenting style more consistently.  Avoid some casts.
 +      Use 'double' consistently rather than mixing 'float' and 'double'.
 +
 +2012-04-21  Eduard Wiebe  <usenet@pusto.de>
 +
 +      * sysdep.c (list_system_processes, system_process_attributes):
 +      Add implementation for FreeBSD (Bug#5243).
 +
 +2012-04-21  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * lisp.mk (lisp): Update.
 +
 +2012-04-20  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
 +      It is never used otherwise.
  
 -      * dispnew.c (swap_glyph_pointers, copy_row_except_pointers): Don't
 -      overrun array limits of glyph row's used[] array.  (Bug#11288)
 +2012-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * print.c (print_preprocess): Only check print_depth if print-circle
 +      is nil.
 +      (print_object): Check for cycles even when print-circle is nil and
 +      print-gensym is t, but only check print_depth if print-circle is nil.
  
  2012-04-20  Chong Yidong  <cyd@gnu.org>
  
        * process.c (wait_reading_process_output): If EIO occurs on a pty,
        set the status to "failed" and ensure that sentinel is run.
  
 -2012-04-18  Glenn Morris  <rgm@gnu.org>
 +2012-04-20  Glenn Morris  <rgm@gnu.org>
  
        * process.c (Fset_process_inherit_coding_system_flag)
        (Fset_process_query_on_exit_flag): Doc fix (mention return value).
        (Fmake_network_process, Fmake_serial_process): Doc fix.
  
 -2012-04-17  Eli Zaretskii  <eliz@gnu.org>
 +2012-04-20  Eli Zaretskii  <eliz@gnu.org>
  
        * xdisp.c (string_buffer_position_lim): Limit starting position to
        BEGV.
        (set_cursor_from_row): If called for a mode-line or header-line
        row, return zero immediately.
        (try_cursor_movement): If inside continuation line, don't back up
 -      farther than the first row after the header line, if any.  Don't
 -      consider the header-line row as "partially visible", even if
 +      farther than the first row after the header line, if any.
 +      Don't consider the header-line row as "partially visible", even if
        MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero.  (Bug#11261)
  
 -2012-04-13  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
 +2012-04-20  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
 +
 +      * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
 +      (bug#11238).
 +
 +2012-04-20  Teodor Zlatanov  <tzz@lifelogs.com>
 +2012-04-18  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      configure: new option --enable-gcc-warnings (Bug#11207)
 +      * Makefile.in (C_WARNINGS_SWITCH): Remove.
 +      (WARN_CFLAGS, WERROR_CFLAGS): New macros.
 +      (ALL_CFLAGS): Use new macros rather than old.
 +      * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
 +      * regex.c: Ignore -Wstrict-overflow.  If !emacs, also ignore
 +      -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
 +      -Wunused-result, -Wunused-variable.  This should go away once
 +      the Emacs and Gnulib regex code is merged.
 +      (xmalloc, xrealloc): Now static.
 +
 +2012-04-17  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * dired.c (Fsystem_groups): Remove unused local.
 +
 +2012-04-17  Glenn Morris  <rgm@gnu.org>
 +
 +      * dired.c (Fsystem_users): Doc fix.
 +
 +2012-04-17  Dmitry Antipov  <dmantipov@yandex.ru>
 +
 +      * dired.c (Fsystem_users, Fsystem_groups): New functions.  (Bug#7900)
 +      (syms_of_dired): Add them.
 +
 +2012-04-16  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fix minor alloc.c problems found by static checking.
 +      * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
 +      New extern decls, to avoid calling undeclared functions.
 +      (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
 +      && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
 +      GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
 +      (NEED_MEM_INSERT): New macro.
 +      (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
 +      Remove one incorrect comment and fix another.
 +
 +      Fix minor ralloc.c problems found by static checking.
 +      See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
 +      * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
 +      (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
 +      (r_alloc_sbrk): Now static.
 +
 +      Improve ralloc.c interface checking.
 +      See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
 +      * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
 +      (r_alloc_free) [REL_ALLOC]: Move decls from here ...
 +      * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
 +      [REL_ALLOC]: ... to here, to check interface.
 +      * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
 +      Remove decls.  This fixes an "It stinks!".
 +
 +      * alloc.c (which_symbols): Fix alignment issue / type clash.
 +
 +2012-04-15  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * lisp.h (struct Lisp_Symbol): Remove explicit padding.
 +      (struct Lisp_Misc_Any): Likewise.
 +      (struct Lisp_Free): Likewise.
 +      * alloc.c (union aligned_Lisp_Symbol): Define.
 +      (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
 +      aligned_Lisp_Symbol instead of struct Lisp_Symbol.
 +      (union aligned_Lisp_Misc): Define.
 +      (MARKER_BLOCK_SIZE, struct marker_block): Use union
 +      aligned_Lisp_Misc instead of union Lisp_Misc.
 +      (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
 +
 +2012-04-14  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
 +      * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
 +      * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
 +      * s/netbsd.h, s/sol2-6.h:
 +      Remove definition of GC_MARK_STACK, since the default now works.
 +      * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
 +      Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
 +      no longer the default.
 +      * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
 +
 +2012-04-14  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
 +
 +      * lread.c (lisp_file_lexically_bound_p):
 +      Fix hang at ";-*-\n" (bug#11238).
 +
 +2012-04-14  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
 +      "unchanged" if its end.pos is beyond ZV.  (Bug#11199)
 +
 +2012-04-14  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsterm.m (constrainFrameRect): Always constrain when there is only
 +      one screen (Bug#10962).
 +
 +2012-04-13  Ken Brown  <kbrown@cornell.edu>
  
 -      * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n" (bug#11238).
 +      * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
  
 -2012-04-10  Teodor Zlatanov  <tzz@lifelogs.com>
 +2012-04-13  Reuben Thomas  <rrt@sc3d.org>
 +
 +      * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
 +
 +2012-04-11  Daniel Colascione  <dancol@dancol.org>
 +
 +      * s/cygwin.h: The vfork the #define in cygwin.h was protecting
 +      against is gone.  It's better to use vfork now so that when Cygwin
 +      gains a new, working vfork, we use it automatically (bug#10398).
 +
 +2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * window.c (save_window_save): Obey window-point-insertion-type.
 +
 +2012-04-11  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
 +
 +2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * alloc.c (lisp_align_malloc): Remove unneeded prototype.
 +
 +2012-04-10  Jason S. Cornez  <jcornez@ravenpack.com>  (tiny change)
 +
 +      * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
 +      (force_quit_count): New var.
 +      (handle_interrupt): Use it.
 +
 +2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * w32.c (w32_delayed_load): Record the full path of the library
 +      being loaded (bug#10424).
 +
 +2012-04-09  Glenn Morris  <rgm@gnu.org>
 +
 +      * doc.c (Fsnarf_documentation): Check variables, functions are bound,
 +      not just in the obarray, before snarfing them.  (Bug#11036)
 +
 +      * Makefile.in ($(leimdir)/leim-list.el):
 +      Pass EMACS rather than BUILT_EMACS.
 +
 +2012-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
  
        * process.c (make_process):
        * process.h: Add integer `gnutls_handshakes_tried' member to
        `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
        attempts per process (connection).
  
 +2012-04-09  Chong Yidong  <cyd@gnu.org>
 +
 +      * eval.c (Fuser_variable_p, user_variable_p_eh)
 +      (lisp_indirect_variable): Functions deleted.
 +      (Fdefvar): Caller changed.
 +
 +      * callint.c (Finteractive, Fcall_interactively):
 +      * minibuf.c (Fread_variable): Callers changed.
 +
  2012-04-09  Eli Zaretskii  <eliz@gnu.org>
  
 -      * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
 -      "unchanged" if its end.pos is beyond ZV.  (Bug#11199)
 +      * xdisp.c (set_cursor_from_row): If the display string appears in
 +      the buffer at position that is closer to point than the position
 +      after the display string, display the cursor on the first glyph of
 +      the display string.  Fixes cursor display when a 'display' text
 +      property immediately follows invisible text.  (Bug#11094)
  
 -2012-04-09  Jan Djärv  <jan.h.d@swipnet.se>
 +2012-04-09  Paul Eggert  <eggert@cs.ucla.edu>
  
 -      * nsterm.m (constrainFrameRect): Always constrain when there is only
 -      one screen (Bug#10962).
 +      composite.c: use 'double' consistently
 +      * composite.c (get_composition_id): Use 'double' consistently
 +      instead of converting 'float' to 'double' and vice versa; this is
 +      easier to understand and avoids a GCC warning.
 +
 +2012-04-09  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in: Generate leim-list with bootstrap-emacs, in
 +      preparation for dumping it with emacs.  (Bug#4789)
 +      (leimdir): New variable.
 +      ($(leimdir)/leim-list.el): New rule.
 +      (emacs$(EXEEXT)): Depend on leim-list.el.
 +
 +      * buffer.c (Qucs_set_table_for_input): Remove.  (Bug#9821)
 +      (Fget_buffer_create): Don't call Qucs_set_table_for_input.
 +      (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
 +
 +2012-04-08  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
 +      proper alignment.
 +
 +2012-04-07  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * xml.c (init_libxml2_functions) [WINDOWSNT]:
 +      Remove unused local variable.
 +
 +2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
 +      * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
 +      (mark_memory): Mark Lisp_Objects only if pointers might hide in
 +      objects, as mark_maybe_pointer will catch them otherwise.
 +      (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
 +      * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
 +
 +2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fix typo that broke non-Windows builds.
 +      * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
 +
 +2012-04-07  Eli Zaretskii  <eliz@gnu.org>
 +
 +      Support building on MS-Windows with libxml2.
 +
 +      * makefile.w32-in (OBJ2): Add xml.$(O).
 +      (GLOBAL_SOURCES): Add xml.c.
 +      ($(BLD)/xml.$(O)): New dependency list.
 +
 +      * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
 +      (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
 +      (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
 +      [!WINDOWSNT]: New macros.
 +      (init_libxml2_functions, libxml2_loaded_p): New functions.
 +      (parse_region): Call fn_xmlCheckVersion instead of using the macro
 +      LIBXML_TEST_VERSION.  Call libxml2 functions via the fn_* macros.
 +      (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
 +      Calls xmlCleanupParser only if libxml2 was loaded (or statically
 +      linked in).
 +      (Flibxml_parse_html_region, Flibxml_parse_xml_region):
 +      Call init_libxml2_functions before calling libxml2 functions.
 +      (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
 +
 +      * emacs.c: Don't include libxml/parser.h.
 +      (shut_down_emacs): Call xml_cleanup_parser, instead of calling
 +      xmlCleanupParser directly.
 +
 +      * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
 +
 +2012-04-07  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * indent.c (Fvertical_motion): If there is a display string at
 +      point, use it.vpos to compute how many lines to backtrack after
 +      move_it_to point.  (Bug#11133)
  
  2012-04-06  Eli Zaretskii  <eliz@gnu.org>
  
        * xfns.c (unwind_create_frame): Fix comment.
        (Fx_create_frame, x_create_tip_frame):
        Move terminal->reference_count++ just before making the frame
 -      official. Move initialization of image_cache_refcount and
 +      official.  Move initialization of image_cache_refcount and
        dpyinfo_refcount before calling init_frame_faces (Bug#9943).
  
  2011-11-05  Eli Zaretskii  <eliz@gnu.org>
        * xfaces.c <Qunspecified>: Make extern again.
  
        * syntax.c: Include sys/types.h before including regex.h, as
 -      required by Posix.
 +      required by POSIX.
  
        * doc.c (get_doc_string): Improve the format passed to `error'.
  
@@@ -11306,7 -9777,7 +11337,7 @@@ See ChangeLog.11 for earlier changes
  ;; coding: utf-8
  ;; End:
  
 -  Copyright (C) 2011-2012  Free Software Foundation, Inc.
 +  Copyright (C) 2011-2012 Free Software Foundation, Inc.
  
    This file is part of GNU Emacs.
  
diff --combined src/callproc.c
@@@ -102,12 -102,8 +102,12 @@@ static Lisp_Object Fgetenv_internal (Li
  static Lisp_Object
  call_process_kill (Lisp_Object fdpid)
  {
 -  emacs_close (XFASTINT (Fcar (fdpid)));
 -  EMACS_KILLPG (XFASTINT (Fcdr (fdpid)), SIGKILL);
 +  int fd;
 +  pid_t pid;
 +  CONS_TO_INTEGER (Fcar (fdpid), int, fd);
 +  CONS_TO_INTEGER (Fcdr (fdpid), pid_t, pid);
 +  emacs_close (fd);
 +  EMACS_KILLPG (pid, SIGKILL);
    synch_process_alive = 0;
    return Qnil;
  }
@@@ -116,18 -112,18 +116,18 @@@ static Lisp_Objec
  call_process_cleanup (Lisp_Object arg)
  {
    Lisp_Object fdpid = Fcdr (arg);
 +  int fd;
  #if defined (MSDOS)
    Lisp_Object file;
 -  int fd;
  #else
 -  int pid;
 +  pid_t pid;
  #endif
  
    Fset_buffer (Fcar (arg));
 +  CONS_TO_INTEGER (Fcar (fdpid), int, fd);
  
  #if defined (MSDOS)
    /* for MSDOS fdpid is really (fd . tempfile)  */
 -  fd = XFASTINT (Fcar (fdpid));
    file = Fcdr (fdpid);
    /* FD is -1 and FILE is "" when we didn't actually create a
       temporary file in call-process.  */
    if (!(strcmp (SDATA (file), NULL_DEVICE) == 0 || SREF (file, 0) == '\0'))
      unlink (SDATA (file));
  #else /* not MSDOS */
 -  pid = XFASTINT (Fcdr (fdpid));
 +  CONS_TO_INTEGER (Fcdr (fdpid), pid_t, pid);
  
    if (call_process_exited)
      {
 -      emacs_close (XFASTINT (Fcar (fdpid)));
 +      emacs_close (fd);
        return Qnil;
      }
  
    if (EMACS_KILLPG (pid, SIGINT) == 0)
      {
 -      int count = SPECPDL_INDEX ();
 +      ptrdiff_t count = SPECPDL_INDEX ();
        record_unwind_protect (call_process_kill, fdpid);
        message1 ("Waiting for process to die...(type C-g again to kill it instantly)");
        immediate_quit = 1;
        message1 ("Waiting for process to die...done");
      }
    synch_process_alive = 0;
 -  emacs_close (XFASTINT (Fcar (fdpid)));
 +  emacs_close (fd);
  #endif /* not MSDOS */
    return Qnil;
  }
@@@ -191,16 -187,17 +191,16 @@@ If you quit, the process is killed wit
  usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)  */)
    (ptrdiff_t nargs, Lisp_Object *args)
  {
 -  Lisp_Object infile, buffer, current_dir, path;
 -  volatile int display_p_volatile;
 +  Lisp_Object infile, buffer, current_dir, path, cleanup_info_tail;
 +  int display_p;
    int fd[2];
    int filefd;
 -  register int pid;
  #define CALLPROC_BUFFER_SIZE_MIN (16 * 1024)
  #define CALLPROC_BUFFER_SIZE_MAX (4 * CALLPROC_BUFFER_SIZE_MIN)
    char buf[CALLPROC_BUFFER_SIZE_MAX];
    int bufsize = CALLPROC_BUFFER_SIZE_MIN;
 -  int count = SPECPDL_INDEX ();
 -  volatile USE_SAFE_ALLOCA;
 +  ptrdiff_t count = SPECPDL_INDEX ();
 +  USE_SAFE_ALLOCA;
  
    register const unsigned char **new_argv;
    /* File to use for stderr in the child.
  #ifdef MSDOS  /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
    char *outf, *tempfile = NULL;
    int outfilefd;
 +  int pid;
 +#else
 +  pid_t pid;
  #endif
    int fd_output = -1;
    struct coding_system process_coding; /* coding-system of process output */
      UNGCPRO;
    }
  
 -  display_p_volatile = INTERACTIVE && nargs >= 4 && !NILP (args[3]);
 +  display_p = INTERACTIVE && nargs >= 4 && !NILP (args[3]);
  
    filefd = emacs_open (SSDATA (infile), O_RDONLY, 0);
    if (filefd < 0)
        Lisp_Object volatile buffer_volatile = buffer;
        Lisp_Object volatile coding_systems_volatile = coding_systems;
        Lisp_Object volatile current_dir_volatile = current_dir;
 +      int volatile display_p_volatile = display_p;
        int volatile fd1_volatile = fd1;
        int volatile fd_error_volatile = fd_error;
        int volatile fd_output_volatile = fd_output;
        int volatile output_to_buffer_volatile = output_to_buffer;
 +      int volatile sa_must_free_volatile = sa_must_free;
 +      ptrdiff_t volatile sa_count_volatile = sa_count;
        unsigned char const **volatile new_argv_volatile = new_argv;
  
        pid = vfork ();
        buffer = buffer_volatile;
        coding_systems = coding_systems_volatile;
        current_dir = current_dir_volatile;
 +      display_p = display_p_volatile;
        fd1 = fd1_volatile;
        fd_error = fd_error_volatile;
        fd_output = fd_output_volatile;
        output_to_buffer = output_to_buffer_volatile;
 +      sa_must_free = sa_must_free_volatile;
 +      sa_count = sa_count_volatile;
        new_argv = new_argv_volatile;
      }
  
  
        /* GConf causes us to ignore SIGPIPE, make sure it is restored
           in the child.  */
-       //signal (SIGPIPE, SIG_DFL);
+       signal (SIGPIPE, SIG_DFL);
  #ifdef HAVE_WORKING_VFORK
        pthread_sigmask (SIG_SETMASK, &procmask, 0);
  #endif
  
  #if defined (MSDOS)
    /* MSDOS needs different cleanup information.  */
 -  record_unwind_protect (call_process_cleanup,
 -                       Fcons (Fcurrent_buffer (),
 -                              Fcons (make_number (fd[0]),
 -                                     build_string (tempfile ? tempfile : ""))));
 +  cleanup_info_tail = build_string (tempfile ? tempfile : "");
  #else
 +  cleanup_info_tail = INTEGER_TO_CONS (pid);
 +#endif /* not MSDOS */
    record_unwind_protect (call_process_cleanup,
                         Fcons (Fcurrent_buffer (),
 -                              Fcons (make_number (fd[0]), make_number (pid))));
 -#endif /* not MSDOS */
 -
 +                              Fcons (INTEGER_TO_CONS (fd[0]),
 +                                     cleanup_info_tail)));
  
    if (BUFFERP (buffer))
      Fset_buffer (buffer);
  
    if (output_to_buffer)
      {
 -      register EMACS_INT nread;
 +      register int nread;
        int first = 1;
        EMACS_INT total_read = 0;
        int carryover = 0;
 -      int display_p = display_p_volatile;
        int display_on_the_fly = display_p;
        struct coding_system saved_coding;
  
              else
                {                       /* We have to decode the input.  */
                  Lisp_Object curbuf;
 -                int count1 = SPECPDL_INDEX ();
 +                ptrdiff_t count1 = SPECPDL_INDEX ();
  
                  XSETBUFFER (curbuf, current_buffer);
                  /* We cannot allow after-change-functions be run
@@@ -934,7 -925,7 +934,7 @@@ static Lisp_Objec
  delete_temp_file (Lisp_Object name)
  {
    /* Suppress jka-compr handling, etc.  */
 -  int count = SPECPDL_INDEX ();
 +  ptrdiff_t count = SPECPDL_INDEX ();
    specbind (intern ("file-name-handler-alist"), Qnil);
    internal_delete_file (name);
    unbind_to (count, Qnil);
@@@ -971,7 -962,7 +971,7 @@@ usage: (call-process-region START END P
    struct gcpro gcpro1;
    Lisp_Object filename_string;
    register Lisp_Object start, end;
 -  int count = SPECPDL_INDEX ();
 +  ptrdiff_t count = SPECPDL_INDEX ();
    /* Qt denotes we have not yet called Ffind_operation_coding_system.  */
    Lisp_Object coding_systems;
    Lisp_Object val, *args2;
    val = complement_process_encoding_system (val);
  
    {
 -    int count1 = SPECPDL_INDEX ();
 +    ptrdiff_t count1 = SPECPDL_INDEX ();
  
      specbind (intern ("coding-system-for-write"), val);
      /* POSIX lets mk[s]temp use "."; don't invoke jka-compr if we
@@@ -1148,7 -1139,7 +1148,7 @@@ child_setup (int in, int out, int err, 
    HANDLE handles[3];
  #endif /* WINDOWSNT */
  
 -  int pid = getpid ();
 +  pid_t pid = getpid ();
  
    /* Close Emacs's descriptors that this process should not have.  */
    close_process_descs ();
@@@ -1646,16 -1637,16 +1646,16 @@@ syms_of_callproc (void
    staticpro (&Vtemp_file_name_pattern);
  
    DEFVAR_LISP ("shell-file-name", Vshell_file_name,
 -             doc: /* *File name to load inferior shells from.
 +             doc: /* File name to load inferior shells from.
  Initialized from the SHELL environment variable, or to a system-dependent
  default if SHELL is not set.  */);
  
    DEFVAR_LISP ("exec-path", Vexec_path,
 -             doc: /* *List of directories to search programs to run in subprocesses.
 +             doc: /* List of directories to search programs to run in subprocesses.
  Each element is a string (directory name) or nil (try default directory).  */);
  
    DEFVAR_LISP ("exec-suffixes", Vexec_suffixes,
 -             doc: /* *List of suffixes to try to find executable file names.
 +             doc: /* List of suffixes to try to find executable file names.
  Each element is a string.  */);
    Vexec_suffixes = Qnil;
  
diff --combined src/lisp.h
@@@ -41,36 -41,25 +41,36 @@@ extern void check_cons_list (void)
     Build with CFLAGS='-DWIDE_EMACS_INT' to try them out.  */
  /* #undef WIDE_EMACS_INT */
  
 -/* These are default choices for the types to use.  */
 +/* EMACS_INT - signed integer wide enough to hold an Emacs value
 +   EMACS_INT_MAX - maximum value of EMACS_INT; can be used in #if
 +   pI - printf length modifier for EMACS_INT
 +   EMACS_UINT - unsigned variant of EMACS_INT */
  #ifndef EMACS_INT
 -# if BITS_PER_LONG < BITS_PER_LONG_LONG && defined WIDE_EMACS_INT
 +# if LONG_MAX < LLONG_MAX && defined WIDE_EMACS_INT
  #  define EMACS_INT long long
 -#  define BITS_PER_EMACS_INT BITS_PER_LONG_LONG
 +#  define EMACS_INT_MAX LLONG_MAX
  #  define pI "ll"
 -# elif BITS_PER_INT < BITS_PER_LONG
 +# elif INT_MAX < LONG_MAX
  #  define EMACS_INT long
 -#  define BITS_PER_EMACS_INT BITS_PER_LONG
 +#  define EMACS_INT_MAX LONG_MAX
  #  define pI "l"
  # else
  #  define EMACS_INT int
 -#  define BITS_PER_EMACS_INT BITS_PER_INT
 +#  define EMACS_INT_MAX INT_MAX
  #  define pI ""
  # endif
  #endif
 -#ifndef EMACS_UINT
 -# define EMACS_UINT unsigned EMACS_INT
 -#endif
 +#define EMACS_UINT unsigned EMACS_INT
 +
 +/* Number of bits in some machine integer types.  */
 +enum
 +  {
 +    BITS_PER_CHAR      = CHAR_BIT,
 +    BITS_PER_SHORT     = CHAR_BIT * sizeof (short),
 +    BITS_PER_INT       = CHAR_BIT * sizeof (int),
 +    BITS_PER_LONG      = CHAR_BIT * sizeof (long int),
 +    BITS_PER_EMACS_INT = CHAR_BIT * sizeof (EMACS_INT)
 +  };
  
  /* printmax_t and uprintmax_t are types for printing large integers.
     These are the widest integers that are supported for printing.
@@@ -175,13 -164,13 +175,13 @@@ extern int suppress_checking EXTERNALLY
     variable VAR of type TYPE with the added requirement that it be
     TYPEBITS-aligned.  */
  
 -#ifndef GCTYPEBITS
  #define GCTYPEBITS 3
 -#endif
 -
 -#ifndef VALBITS
  #define VALBITS (BITS_PER_EMACS_INT - GCTYPEBITS)
 -#endif
 +
 +/* The maximum value that can be stored in a EMACS_INT, assuming all
 +   bits other than the type bits contribute to a nonnegative signed value.
 +   This can be used in #if, e.g., '#if VAL_MAX < UINTPTR_MAX' below.  */
 +#define VAL_MAX (EMACS_INT_MAX >> (GCTYPEBITS - 1))
  
  #ifndef NO_DECL_ALIGN
  # ifndef DECL_ALIGN
       || defined DARWIN_OS || defined __sun)
  /* We also need to be able to specify mult-of-8 alignment on static vars.  */
  # if defined DECL_ALIGN
 -/* On hosts where VALBITS is greater than the pointer width in bits,
 +/* On hosts where pointers-as-ints do not exceed VAL_MAX,
     USE_LSB_TAG is:
      a. unnecessary, because the top bits of an EMACS_INT are unused, and
      b. slower, because it typically requires extra masking.
     So, define USE_LSB_TAG only on hosts where it might be useful.  */
 -#  if UINTPTR_MAX >> VALBITS != 0
 +#  if VAL_MAX < UINTPTR_MAX
  #   define USE_LSB_TAG
  #  endif
  # endif
@@@ -406,13 -395,14 +406,13 @@@ typedef EMACS_INT Lisp_Object
  #define LISP_MAKE_RVALUE(o) (0+(o))
  #endif /* USE_LISP_UNION_TYPE */
  
 -/* In the size word of a vector, this bit means the vector has been marked.
 -   (Shift -1 left, not 1, to avoid provoking overflow diagnostics.)  */
 +/* In the size word of a vector, this bit means the vector has been marked.  */
  
 -#define ARRAY_MARK_FLAG ((EMACS_INT) -1 << (BITS_PER_EMACS_INT - 1))
 +#define ARRAY_MARK_FLAG PTRDIFF_MIN
  
  /* In the size word of a struct Lisp_Vector, this bit means it's really
     some other vector-like object.  */
 -#define PSEUDOVECTOR_FLAG ((EMACS_INT) 1 << (BITS_PER_EMACS_INT - 2))
 +#define PSEUDOVECTOR_FLAG (PTRDIFF_MAX - PTRDIFF_MAX / 2)
  
  /* In a pseudovector, the size field actually contains a word with one
     PSEUDOVECTOR_FLAG bit set, and exactly one of the following bits to
@@@ -485,11 -475,10 +485,11 @@@ enum pvec_typ
       (var) = (type) | (intptr_t) (ptr))
  
  #define XPNTR(a) ((intptr_t) ((a) & ~TYPEMASK))
 +#define XUNTAG(a, type) ((intptr_t) ((a) - (type)))
  
  #else  /* not USE_LSB_TAG */
  
 -#define VALMASK ((((EMACS_INT) 1) << VALBITS) - 1)
 +#define VALMASK VAL_MAX
  
  /* One need to override this if there must be high bits set in data space
     (doing the result of the below & ((1 << (GCTYPE + 1)) - 1) would work
@@@ -592,13 -581,6 +592,13 @@@ extern Lisp_Object make_number (EMACS_I
  # define XSETFASTINT(a, b) (XSETINT (a, b))
  #endif
  
 +/* Extract the pointer value of the Lisp object A, under the
 +   assumption that A's type is TYPE.  This is a fallback
 +   implementation if nothing faster is available.  */
 +#ifndef XUNTAG
 +# define XUNTAG(a, type) XPNTR (a)
 +#endif
 +
  #define EQ(x, y) (XHASH (x) == XHASH (y))
  
  /* Number of bits in a fixnum, including the sign bit.  */
  #define FIXNUM_OVERFLOW_P(i) \
    (! ((0 <= (i) || MOST_NEGATIVE_FIXNUM <= (i)) && (i) <= MOST_POSITIVE_FIXNUM))
  
 +static inline ptrdiff_t
 +clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper)
 +{
 +  return num < lower ? lower : num <= upper ? num : upper;
 +}
 +
  /* Extract a value or address from a Lisp_Object.  */
  
 -#define XCONS(a) (eassert (CONSP (a)), (struct Lisp_Cons *) XPNTR (a))
 -#define XVECTOR(a) (eassert (VECTORLIKEP (a)), (struct Lisp_Vector *) XPNTR (a))
 -#define XSTRING(a) (eassert (STRINGP (a)), (struct Lisp_String *) XPNTR (a))
 -#define XSYMBOL(a) (eassert (SYMBOLP (a)), (struct Lisp_Symbol *) XPNTR (a))
 -#define XFLOAT(a) (eassert (FLOATP (a)), (struct Lisp_Float *) XPNTR (a))
 +#define XCONS(a)   (eassert (CONSP (a)), \
 +                  (struct Lisp_Cons *) XUNTAG (a, Lisp_Cons))
 +#define XVECTOR(a) (eassert (VECTORLIKEP (a)), \
 +                  (struct Lisp_Vector *) XUNTAG (a, Lisp_Vectorlike))
 +#define XSTRING(a) (eassert (STRINGP (a)), \
 +                  (struct Lisp_String *) XUNTAG (a, Lisp_String))
 +#define XSYMBOL(a) (eassert (SYMBOLP (a)), \
 +                  (struct Lisp_Symbol *) XUNTAG (a, Lisp_Symbol))
 +#define XFLOAT(a)  (eassert (FLOATP (a)), \
 +                  (struct Lisp_Float *) XUNTAG (a, Lisp_Float))
  
  /* Misc types.  */
  
 -#define XMISC(a)   ((union Lisp_Misc *) XPNTR (a))
 +#define XMISC(a)      ((union Lisp_Misc *) XUNTAG (a, Lisp_Misc))
  #define XMISCANY(a)   (eassert (MISCP (a)), &(XMISC (a)->u_any))
  #define XMISCTYPE(a)   (XMISCANY (a)->type)
  #define XMARKER(a)    (eassert (MARKERP (a)), &(XMISC (a)->u_marker))
  
  /* Pseudovector types.  */
  
 -#define XPROCESS(a) (eassert (PROCESSP (a)), (struct Lisp_Process *) XPNTR (a))
 -#define XWINDOW(a) (eassert (WINDOWP (a)), (struct window *) XPNTR (a))
 -#define XTERMINAL(a) (eassert (TERMINALP (a)), (struct terminal *) XPNTR (a))
 -#define XSUBR(a) (eassert (SUBRP (a)), (struct Lisp_Subr *) XPNTR (a))
 -#define XBUFFER(a) (eassert (BUFFERP (a)), (struct buffer *) XPNTR (a))
 -#define XCHAR_TABLE(a) (eassert (CHAR_TABLE_P (a)), (struct Lisp_Char_Table *) XPNTR (a))
 -#define XSUB_CHAR_TABLE(a) (eassert (SUB_CHAR_TABLE_P (a)), (struct Lisp_Sub_Char_Table *) XPNTR (a))
 -#define XBOOL_VECTOR(a) (eassert (BOOL_VECTOR_P (a)), (struct Lisp_Bool_Vector *) XPNTR (a))
 +#define XPROCESS(a) (eassert (PROCESSP (a)), \
 +                   (struct Lisp_Process *) XUNTAG (a, Lisp_Vectorlike))
 +#define XWINDOW(a) (eassert (WINDOWP (a)), \
 +                  (struct window *) XUNTAG (a, Lisp_Vectorlike))
 +#define XTERMINAL(a) (eassert (TERMINALP (a)), \
 +                    (struct terminal *) XUNTAG (a, Lisp_Vectorlike))
 +#define XSUBR(a) (eassert (SUBRP (a)), \
 +                (struct Lisp_Subr *) XUNTAG (a, Lisp_Vectorlike))
 +#define XBUFFER(a) (eassert (BUFFERP (a)), \
 +                  (struct buffer *) XUNTAG (a, Lisp_Vectorlike))
 +#define XCHAR_TABLE(a) (eassert (CHAR_TABLE_P (a)), \
 +                      (struct Lisp_Char_Table *) XUNTAG (a, Lisp_Vectorlike))
 +#define XSUB_CHAR_TABLE(a) (eassert (SUB_CHAR_TABLE_P (a)), \
 +                          ((struct Lisp_Sub_Char_Table *) \
 +                           XUNTAG (a, Lisp_Vectorlike)))
 +#define XBOOL_VECTOR(a) (eassert (BOOL_VECTOR_P (a)), \
 +                       ((struct Lisp_Bool_Vector *) \
 +                        XUNTAG (a, Lisp_Vectorlike)))
  
  /* Construct a Lisp_Object from a value or address.  */
  
  /* The cast to struct vectorlike_header * avoids aliasing issues.  */
  #define XSETPSEUDOVECTOR(a, b, code) \
    XSETTYPED_PSEUDOVECTOR(a, b,       \
 -                       ((struct vectorlike_header *) XPNTR (a))->size, \
 +                       (((struct vectorlike_header *) \
 +                         XUNTAG (a, Lisp_Vectorlike)) \
 +                        ->size),                      \
                         code)
  #define XSETTYPED_PSEUDOVECTOR(a, b, size, code)                      \
    (XSETVECTOR (a, b),                                                 \
@@@ -852,7 -811,7 +852,7 @@@ struct Lisp_Con
  #ifdef GC_CHECK_STRING_BYTES
  
  struct Lisp_String;
 -extern EMACS_INT string_bytes (struct Lisp_String *);
 +extern ptrdiff_t string_bytes (struct Lisp_String *);
  #define STRING_BYTES(S) string_bytes ((S))
  
  #else /* not GC_CHECK_STRING_BYTES */
  
  struct Lisp_String
    {
 -    EMACS_INT size;
 -    EMACS_INT size_byte;
 +    ptrdiff_t size;
 +    ptrdiff_t size_byte;
      INTERVAL intervals;               /* text properties in this string */
      unsigned char *data;
    };
     <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8546>.  */
  struct vectorlike_header
    {
 -    EMACS_INT size;
 +    ptrdiff_t size;
  
      /* Pointer to the next vector-like object.  It is generally a buffer or a
         Lisp_Vector alias, so for convenience it is a union instead of a
@@@ -1109,7 -1068,7 +1109,7 @@@ struct Lisp_Bool_Vecto
  
  struct Lisp_Subr
    {
 -    EMACS_INT size;
 +    ptrdiff_t size;
      union {
        Lisp_Object (*a0) (void);
        Lisp_Object (*a1) (Lisp_Object);
@@@ -1296,7 -1255,7 +1296,7 @@@ struct Lisp_Hash_Tabl
       a special way (e.g. because of weakness).  */
  
    /* Number of key/value entries in the table.  */
 -  EMACS_INT count;
 +  ptrdiff_t count;
  
    /* Vector of keys and values.  The key of item I is found at index
       2 * I, the value is found at index 2 * I + 1.
  
  
  #define XHASH_TABLE(OBJ) \
 -     ((struct Lisp_Hash_Table *) XPNTR (OBJ))
 +     ((struct Lisp_Hash_Table *) XUNTAG (OBJ, Lisp_Vectorlike))
  
  #define XSET_HASH_TABLE(VAR, PTR) \
       (XSETPSEUDOVECTOR (VAR, PTR, PVEC_HASH_TABLE))
@@@ -1376,6 -1335,8 +1376,6 @@@ struct Lisp_Misc_Any            /* Supertype of a
    ENUM_BF (Lisp_Misc_Type) type : 16;         /* = Lisp_Misc_??? */
    unsigned gcmarkbit : 1;
    int spacer : 15;
 -  /* Make it as long as "Lisp_Free without padding".  */
 -  void *fill;
  };
  
  struct Lisp_Marker
       That would also allow to preserve it ordered.  */
    struct Lisp_Marker *next;
    /* This is the char position where the marker points.  */
 -  EMACS_INT charpos;
 +  ptrdiff_t charpos;
    /* This is the byte position.
       It's mostly used as a charpos<->bytepos cache (i.e. it's not directly
       used to implement the functionality of markers, but rather to (ab)use
       markers as a cache for char<->byte mappings).  */
 -  EMACS_INT bytepos;
 +  ptrdiff_t bytepos;
  };
  
  /* Forwarding pointer to an int variable.
@@@ -1567,6 -1528,13 +1567,6 @@@ struct Lisp_Fre
      unsigned gcmarkbit : 1;
      int spacer : 15;
      union Lisp_Misc *chain;
 -#ifdef USE_LSB_TAG
 -    /* Try to make sure that sizeof(Lisp_Misc) preserves TYPEBITS-alignment.
 -       This assumes that Lisp_Marker is the largest of the alternatives and
 -       that Lisp_Misc_Any has the same size as "Lisp_Free w/o padding".  */
 -    char padding[((((sizeof (struct Lisp_Marker) - 1) >> GCTYPEBITS) + 1)
 -                << GCTYPEBITS) - sizeof (struct Lisp_Misc_Any)];
 -#endif
    };
  
  /* To get the type field of a union Lisp_Misc, use XMISCTYPE.
  union Lisp_Misc
    {
      struct Lisp_Misc_Any u_any;          /* Supertype of all Misc types.  */
 -    struct Lisp_Free u_free;     /* Includes padding to force alignment.  */
 -    struct Lisp_Marker u_marker;                       /* 5 */
 -    struct Lisp_Overlay u_overlay;                     /* 5 */
 -    struct Lisp_Save_Value u_save_value;               /* 3 */
 +    struct Lisp_Free u_free;
 +    struct Lisp_Marker u_marker;
 +    struct Lisp_Overlay u_overlay;
 +    struct Lisp_Save_Value u_save_value;
    };
  
  union Lisp_Fwd
    {
 -    struct Lisp_Intfwd u_intfwd;                       /* 2 */
 -    struct Lisp_Boolfwd u_boolfwd;                     /* 2 */
 -    struct Lisp_Objfwd u_objfwd;                       /* 2 */
 -    struct Lisp_Buffer_Objfwd u_buffer_objfwd;                 /* 2 */
 -    struct Lisp_Kboard_Objfwd u_kboard_objfwd;                 /* 2 */
 +    struct Lisp_Intfwd u_intfwd;
 +    struct Lisp_Boolfwd u_boolfwd;
 +    struct Lisp_Objfwd u_objfwd;
 +    struct Lisp_Buffer_Objfwd u_buffer_objfwd;
 +    struct Lisp_Kboard_Objfwd u_kboard_objfwd;
    };
  \f
  /* Lisp floating point type */
@@@ -1675,24 -1643,18 +1675,24 @@@ typedef struct 
     encodes a char code in the lower CHARACTERBITS bits and a (very small)
     face-id in the upper bits, or it may be a cons (CHAR . FACE-ID).  */
  
 -#define GLYPH_CODE_CHAR(gc) \
 -  (CONSP (gc) ? XINT (XCAR (gc)) : INTEGERP (gc) ? (XINT (gc) & ((1 << CHARACTERBITS)-1)) : 0)
 +#define GLYPH_CODE_P(gc)                                              \
 +  (CONSP (gc)                                                         \
 +   ? (CHARACTERP (XCAR (gc))                                          \
 +      && RANGED_INTEGERP (0, XCDR (gc), MAX_FACE_ID))                 \
 +   : (RANGED_INTEGERP                                                 \
 +      (0, gc,                                                         \
 +       (MAX_FACE_ID < TYPE_MAXIMUM (EMACS_INT) >> CHARACTERBITS               \
 +      ? ((EMACS_INT) MAX_FACE_ID << CHARACTERBITS) | MAX_CHAR         \
 +      : TYPE_MAXIMUM (EMACS_INT)))))
  
 -#define GLYPH_CODE_FACE(gc) \
 -  (CONSP (gc) ? XINT (XCDR (gc)) : INTEGERP (gc) ? (XINT (gc) >> CHARACTERBITS) : DEFAULT_FACE_ID)
 +/* The following are valid only if GLYPH_CODE_P (gc).  */
  
 -/* Return 1 if glyph code from display vector contains valid character code.  */
 -#define GLYPH_CODE_CHAR_VALID_P(gc) CHAR_VALID_P (GLYPH_CODE_CHAR (gc))
 +#define GLYPH_CODE_CHAR(gc) \
 +  (CONSP (gc) ? XINT (XCAR (gc)) : XINT (gc) & ((1 << CHARACTERBITS) - 1))
  
 -#define GLYPH_CODE_P(gc) ((CONSP (gc) && INTEGERP (XCAR (gc)) && INTEGERP (XCDR (gc))) || INTEGERP (gc))
 +#define GLYPH_CODE_FACE(gc) \
 +  (CONSP (gc) ? XINT (XCDR (gc)) : XINT (gc) >> CHARACTERBITS)
  
 -/* Only called when GLYPH_CODE_P (gc) is true.  */
  #define SET_GLYPH_FROM_GLYPH_CODE(glyph, gc)                          \
    do                                                                  \
      {                                                                 \
@@@ -1752,9 -1714,7 +1752,9 @@@ typedef struct 
  #define RANGED_INTEGERP(lo, x, hi) \
    (INTEGERP (x) && (lo) <= XINT (x) && XINT (x) <= (hi))
  #define TYPE_RANGED_INTEGERP(type, x) \
 -  RANGED_INTEGERP (TYPE_MINIMUM (type), x, TYPE_MAXIMUM (type))
 +  (TYPE_SIGNED (type)                                                 \
 +   ? RANGED_INTEGERP (TYPE_MINIMUM (type), x, TYPE_MAXIMUM (type))    \
 +   : RANGED_INTEGERP (0, x, TYPE_MAXIMUM (type)))
  
  #define INTEGERP(x) (LISP_INT_TAG_P (XTYPE ((x))))
  #define SYMBOLP(x) (XTYPE ((x)) == Lisp_Symbol)
     code is CODE.  */
  #define TYPED_PSEUDOVECTORP(x, t, code)                               \
    (VECTORLIKEP (x)                                            \
 -   && (((((struct t *) XPNTR (x))->size                               \
 +   && (((((struct t *) XUNTAG (x, Lisp_Vectorlike))->size     \
         & (PSEUDOVECTOR_FLAG | (code))))                       \
         == (PSEUDOVECTOR_FLAG | (code))))
  
  #define CHECK_NATNUM(x) \
    CHECK_TYPE (NATNUMP (x), Qwholenump, x)
  
 +#define CHECK_RANGED_INTEGER(lo, x, hi)                                       \
 +  do {                                                                        \
 +    CHECK_NUMBER (x);                                                 \
 +    if (! ((lo) <= XINT (x) && XINT (x) <= (hi)))                     \
 +      args_out_of_range_3                                             \
 +      (x,                                                             \
 +       make_number ((lo) < 0 && (lo) < MOST_NEGATIVE_FIXNUM           \
 +                    ? MOST_NEGATIVE_FIXNUM                            \
 +                    : (lo)),                                          \
 +       make_number (min (hi, MOST_POSITIVE_FIXNUM)));                 \
 +  } while (0)
 +#define CHECK_TYPE_RANGED_INTEGER(type, x) \
 +  do {                                                                        \
 +    if (TYPE_SIGNED (type))                                           \
 +      CHECK_RANGED_INTEGER (TYPE_MINIMUM (type), x, TYPE_MAXIMUM (type)); \
 +    else                                                              \
 +      CHECK_RANGED_INTEGER (0, x, TYPE_MAXIMUM (type));                       \
 +  } while (0)
 +
  #define CHECK_MARKER(x) \
    CHECK_TYPE (MARKERP (x), Qmarkerp, x)
  
@@@ -2114,9 -2055,9 +2114,9 @@@ struct specbindin
  
  extern struct specbinding *specpdl;
  extern struct specbinding *specpdl_ptr;
 -extern EMACS_INT specpdl_size;
 +extern ptrdiff_t specpdl_size;
  
 -#define SPECPDL_INDEX()       ((int) (specpdl_ptr - specpdl))
 +#define SPECPDL_INDEX()       (specpdl_ptr - specpdl)
  
  /* Everything needed to describe an active condition case.  */
  struct handler
@@@ -2169,8 -2110,8 +2169,8 @@@ struct catchta
    jmp_buf jmp;
    struct backtrace *backlist;
    struct handler *handlerlist;
 -  int lisp_eval_depth;
 -  int pdlcount;
 +  EMACS_INT lisp_eval_depth;
 +  ptrdiff_t pdlcount;
    int poll_suppress_count;
    int interrupt_input_blocked;
    struct byte_stack *byte_stack;
@@@ -2278,7 -2219,7 +2278,7 @@@ struct gcpr
  #define GC_USE_GCPROS_CHECK_ZOMBIES   3
  
  #ifndef GC_MARK_STACK
 -#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE
 +#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
  #endif
  
  /* Whether we do the stack marking manually.  */
@@@ -2445,7 -2386,7 +2445,7 @@@ extern Lisp_Object Qerror, Qquit, Qargs
  extern Lisp_Object Qvoid_variable, Qvoid_function;
  extern Lisp_Object Qinvalid_read_syntax;
  extern Lisp_Object Qinvalid_function, Qwrong_number_of_arguments, Qno_catch;
 -extern Lisp_Object Qend_of_file, Qarith_error, Qmark_inactive;
 +extern Lisp_Object Quser_error, Qend_of_file, Qarith_error, Qmark_inactive;
  extern Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only;
  extern Lisp_Object Qtext_read_only;
  extern Lisp_Object Qinteractive_form;
@@@ -2576,8 -2517,8 +2576,8 @@@ EXFUN (Fread_coding_system, 2)
  EXFUN (Fread_non_nil_coding_system, 1);
  EXFUN (Ffind_operation_coding_system, MANY);
  EXFUN (Fdecode_coding_string, 4);
 -extern Lisp_Object detect_coding_system (const unsigned char *, EMACS_INT,
 -                                         EMACS_INT, int, int, Lisp_Object);
 +extern Lisp_Object detect_coding_system (const unsigned char *, ptrdiff_t,
 +                                         ptrdiff_t, int, int, Lisp_Object);
  extern void init_coding (void);
  extern void init_coding_once (void);
  extern void syms_of_coding (void);
  /* Defined in character.c */
  EXFUN (Fchar_width, 1);
  EXFUN (Fstring, MANY);
 -extern EMACS_INT chars_in_text (const unsigned char *, EMACS_INT);
 -extern EMACS_INT multibyte_chars_in_text (const unsigned char *, EMACS_INT);
 +extern ptrdiff_t chars_in_text (const unsigned char *, ptrdiff_t);
 +extern ptrdiff_t multibyte_chars_in_text (const unsigned char *, ptrdiff_t);
  extern int multibyte_char_to_unibyte (int);
  extern int multibyte_char_to_unibyte_safe (int);
  extern void init_character_once (void);
@@@ -2613,7 -2554,7 +2613,7 @@@ extern void syms_of_syntax (void)
  extern Lisp_Object QCrehash_size, QCrehash_threshold;
  enum { NEXT_ALMOST_PRIME_LIMIT = 11 };
  extern EMACS_INT next_almost_prime (EMACS_INT);
 -extern Lisp_Object larger_vector (Lisp_Object, EMACS_INT, Lisp_Object);
 +extern Lisp_Object larger_vector (Lisp_Object, ptrdiff_t, ptrdiff_t);
  extern void sweep_weak_hash_tables (void);
  extern Lisp_Object Qcursor_in_echo_area;
  extern Lisp_Object Qstring_lessp;
@@@ -2645,8 -2586,8 +2645,8 @@@ EXFUN (Fstring_as_multibyte, 1)
  EXFUN (Fstring_as_unibyte, 1);
  EXFUN (Fstring_to_multibyte, 1);
  EXFUN (Fsubstring, 3);
 -extern Lisp_Object substring_both (Lisp_Object, EMACS_INT, EMACS_INT,
 -                                 EMACS_INT, EMACS_INT);
 +extern Lisp_Object substring_both (Lisp_Object, ptrdiff_t, ptrdiff_t,
 +                                 ptrdiff_t, ptrdiff_t);
  EXFUN (Fnth, 2);
  EXFUN (Fnthcdr, 2);
  EXFUN (Fmemq, 2);
@@@ -2674,8 -2615,8 +2674,8 @@@ extern Lisp_Object nconc2 (Lisp_Object
  extern Lisp_Object assq_no_quit (Lisp_Object, Lisp_Object);
  extern Lisp_Object assoc_no_quit (Lisp_Object, Lisp_Object);
  extern void clear_string_char_byte_cache (void);
 -extern EMACS_INT string_char_to_byte (Lisp_Object, EMACS_INT);
 -extern EMACS_INT string_byte_to_char (Lisp_Object, EMACS_INT);
 +extern ptrdiff_t string_char_to_byte (Lisp_Object, ptrdiff_t);
 +extern ptrdiff_t string_byte_to_char (Lisp_Object, ptrdiff_t);
  extern Lisp_Object string_to_multibyte (Lisp_Object);
  extern Lisp_Object string_make_unibyte (Lisp_Object);
  EXFUN (Fcopy_alist, 1);
@@@ -2713,48 -2654,48 +2713,48 @@@ extern void init_image (void)
  
  /* Defined in insdel.c */
  extern Lisp_Object Qinhibit_modification_hooks;
 -extern void move_gap (EMACS_INT);
 -extern void move_gap_both (EMACS_INT, EMACS_INT);
 +extern void move_gap (ptrdiff_t);
 +extern void move_gap_both (ptrdiff_t, ptrdiff_t);
  extern void buffer_overflow (void) NO_RETURN;
 -extern void make_gap (EMACS_INT);
 -extern EMACS_INT copy_text (const unsigned char *, unsigned char *,
 -                          EMACS_INT, int, int);
 +extern void make_gap (ptrdiff_t);
 +extern ptrdiff_t copy_text (const unsigned char *, unsigned char *,
 +                          ptrdiff_t, int, int);
  extern int count_combining_before (const unsigned char *,
 -                                 EMACS_INT, EMACS_INT, EMACS_INT);
 +                                 ptrdiff_t, ptrdiff_t, ptrdiff_t);
  extern int count_combining_after (const unsigned char *,
 -                                EMACS_INT, EMACS_INT, EMACS_INT);
 -extern void insert (const char *, EMACS_INT);
 -extern void insert_and_inherit (const char *, EMACS_INT);
 -extern void insert_1 (const char *, EMACS_INT, int, int, int);
 -extern void insert_1_both (const char *, EMACS_INT, EMACS_INT,
 +                                ptrdiff_t, ptrdiff_t, ptrdiff_t);
 +extern void insert (const char *, ptrdiff_t);
 +extern void insert_and_inherit (const char *, ptrdiff_t);
 +extern void insert_1 (const char *, ptrdiff_t, int, int, int);
 +extern void insert_1_both (const char *, ptrdiff_t, ptrdiff_t,
                           int, int, int);
 -extern void insert_from_gap (EMACS_INT, EMACS_INT);
 -extern void insert_from_string (Lisp_Object, EMACS_INT, EMACS_INT,
 -                              EMACS_INT, EMACS_INT, int);
 -extern void insert_from_buffer (struct buffer *, EMACS_INT, EMACS_INT, int);
 +extern void insert_from_gap (ptrdiff_t, ptrdiff_t);
 +extern void insert_from_string (Lisp_Object, ptrdiff_t, ptrdiff_t,
 +                              ptrdiff_t, ptrdiff_t, int);
 +extern void insert_from_buffer (struct buffer *, ptrdiff_t, ptrdiff_t, int);
  extern void insert_char (int);
  extern void insert_string (const char *);
 -extern void insert_before_markers (const char *, EMACS_INT);
 -extern void insert_before_markers_and_inherit (const char *, EMACS_INT);
 -extern void insert_from_string_before_markers (Lisp_Object, EMACS_INT,
 -                                             EMACS_INT, EMACS_INT,
 -                                             EMACS_INT, int);
 -extern void del_range (EMACS_INT, EMACS_INT);
 -extern Lisp_Object del_range_1 (EMACS_INT, EMACS_INT, int, int);
 -extern void del_range_byte (EMACS_INT, EMACS_INT, int);
 -extern void del_range_both (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT, int);
 -extern Lisp_Object del_range_2 (EMACS_INT, EMACS_INT,
 -                              EMACS_INT, EMACS_INT, int);
 -extern void modify_region (struct buffer *, EMACS_INT, EMACS_INT, int);
 -extern void prepare_to_modify_buffer (EMACS_INT, EMACS_INT, EMACS_INT *);
 -extern void signal_after_change (EMACS_INT, EMACS_INT, EMACS_INT);
 -extern void adjust_after_insert (EMACS_INT, EMACS_INT, EMACS_INT,
 -                               EMACS_INT, EMACS_INT);
 -extern void adjust_markers_for_delete (EMACS_INT, EMACS_INT,
 -                                     EMACS_INT, EMACS_INT);
 -extern void replace_range (EMACS_INT, EMACS_INT, Lisp_Object, int, int, int);
 -extern void replace_range_2 (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT,
 -                           const char *, EMACS_INT, EMACS_INT, int);
 +extern void insert_before_markers (const char *, ptrdiff_t);
 +extern void insert_before_markers_and_inherit (const char *, ptrdiff_t);
 +extern void insert_from_string_before_markers (Lisp_Object, ptrdiff_t,
 +                                             ptrdiff_t, ptrdiff_t,
 +                                             ptrdiff_t, int);
 +extern void del_range (ptrdiff_t, ptrdiff_t);
 +extern Lisp_Object del_range_1 (ptrdiff_t, ptrdiff_t, int, int);
 +extern void del_range_byte (ptrdiff_t, ptrdiff_t, int);
 +extern void del_range_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, int);
 +extern Lisp_Object del_range_2 (ptrdiff_t, ptrdiff_t,
 +                              ptrdiff_t, ptrdiff_t, int);
 +extern void modify_region (struct buffer *, ptrdiff_t, ptrdiff_t, int);
 +extern void prepare_to_modify_buffer (ptrdiff_t, ptrdiff_t, ptrdiff_t *);
 +extern void signal_after_change (ptrdiff_t, ptrdiff_t, ptrdiff_t);
 +extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t,
 +                               ptrdiff_t, ptrdiff_t);
 +extern void adjust_markers_for_delete (ptrdiff_t, ptrdiff_t,
 +                                     ptrdiff_t, ptrdiff_t);
 +extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, int, int, int);
 +extern void replace_range_2 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
 +                           const char *, ptrdiff_t, ptrdiff_t, int);
  extern void syms_of_insdel (void);
  
  /* Defined in dispnew.c */
@@@ -2762,7 -2703,6 +2762,7 @@@ extern Lisp_Object selected_frame
  extern Lisp_Object Vwindow_system;
  EXFUN (Fding, 1);
  EXFUN (Fredraw_frame, 1);
 +void duration_to_sec_usec (double, int *, int *);
  EXFUN (Fsleep_for, 2);
  EXFUN (Fredisplay, 1);
  extern Lisp_Object sit_for (Lisp_Object, int, int);
@@@ -2784,7 -2724,7 +2784,7 @@@ extern Lisp_Object QCdata, QCfile
  extern Lisp_Object QCmap;
  extern Lisp_Object Qrisky_local_variable;
  extern struct frame *last_glyphless_glyph_frame;
 -extern unsigned last_glyphless_glyph_face_id;
 +extern int last_glyphless_glyph_face_id;
  extern int last_glyphless_glyph_merged_face_id;
  extern int noninteractive_need_newline;
  extern Lisp_Object echo_area_buffer[2];
@@@ -2800,15 -2740,15 +2800,15 @@@ extern void clear_message (int, int)
  extern void message (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2);
  extern void message1 (const char *);
  extern void message1_nolog (const char *);
 -extern void message2 (const char *, EMACS_INT, int);
 -extern void message2_nolog (const char *, EMACS_INT, int);
 -extern void message3 (Lisp_Object, EMACS_INT, int);
 -extern void message3_nolog (Lisp_Object, EMACS_INT, int);
 -extern void message_dolog (const char *, EMACS_INT, int, int);
 +extern void message2 (const char *, ptrdiff_t, int);
 +extern void message2_nolog (const char *, ptrdiff_t, int);
 +extern void message3 (Lisp_Object, ptrdiff_t, int);
 +extern void message3_nolog (Lisp_Object, ptrdiff_t, int);
 +extern void message_dolog (const char *, ptrdiff_t, int, int);
  extern void message_with_string (const char *, Lisp_Object, int);
  extern void message_log_maybe_newline (void);
  extern void update_echo_area (void);
 -extern void truncate_echo_area (EMACS_INT);
 +extern void truncate_echo_area (ptrdiff_t);
  extern void redisplay (void);
  extern void redisplay_preserve_echo_area (int);
  extern void prepare_menu_bars (void);
@@@ -2817,14 -2757,14 +2817,14 @@@ void set_frame_cursor_types (struct fra
  extern void syms_of_xdisp (void);
  extern void init_xdisp (void);
  extern Lisp_Object safe_eval (Lisp_Object);
 -extern int pos_visible_p (struct window *, EMACS_INT, int *,
 +extern int pos_visible_p (struct window *, ptrdiff_t, int *,
                            int *, int *, int *, int *, int *);
  
  /* Defined in xsettings.c */
  extern void syms_of_xsettings (void);
  
  /* Defined in vm-limit.c.  */
 -extern void memory_warnings (POINTER_TYPE *, void (*warnfun) (const char *));
 +extern void memory_warnings (void *, void (*warnfun) (const char *));
  
  /* Defined in alloc.c */
  extern void check_pure_size (void);
@@@ -2833,7 -2773,7 +2833,7 @@@ extern void reset_malloc_hooks (void)
  extern void uninterrupt_malloc (void);
  extern void malloc_warning (const char *);
  extern void memory_full (size_t) NO_RETURN;
 -extern void buffer_memory_full (EMACS_INT) NO_RETURN;
 +extern void buffer_memory_full (ptrdiff_t) NO_RETURN;
  extern int survives_gc_p (Lisp_Object);
  extern void mark_object (Lisp_Object);
  #if defined REL_ALLOC && !defined SYSTEM_MALLOC
@@@ -2858,26 -2798,26 +2858,26 @@@ EXFUN (Fmake_marker, 0)
  extern void string_overflow (void) NO_RETURN;
  EXFUN (Fmake_string, 2);
  extern Lisp_Object build_string (const char *);
 -extern Lisp_Object make_string (const char *, EMACS_INT);
 -extern Lisp_Object make_unibyte_string (const char *, EMACS_INT);
 -extern Lisp_Object make_multibyte_string (const char *, EMACS_INT, EMACS_INT);
 +extern Lisp_Object make_string (const char *, ptrdiff_t);
 +extern Lisp_Object make_unibyte_string (const char *, ptrdiff_t);
 +extern Lisp_Object make_multibyte_string (const char *, ptrdiff_t, ptrdiff_t);
  extern Lisp_Object make_event_array (int, Lisp_Object *);
  extern Lisp_Object make_uninit_string (EMACS_INT);
  extern Lisp_Object make_uninit_multibyte_string (EMACS_INT, EMACS_INT);
 -extern Lisp_Object make_string_from_bytes (const char *, EMACS_INT, EMACS_INT);
 +extern Lisp_Object make_string_from_bytes (const char *, ptrdiff_t, ptrdiff_t);
  extern Lisp_Object make_specified_string (const char *,
 -                                        EMACS_INT, EMACS_INT, int);
 +                                        ptrdiff_t, ptrdiff_t, int);
  EXFUN (Fpurecopy, 1);
 -extern Lisp_Object make_pure_string (const char *, EMACS_INT, EMACS_INT, int);
 +extern Lisp_Object make_pure_string (const char *, ptrdiff_t, ptrdiff_t, int);
  extern Lisp_Object make_pure_c_string (const char *data);
  extern Lisp_Object pure_cons (Lisp_Object, Lisp_Object);
 -extern Lisp_Object make_pure_vector (EMACS_INT);
 +extern Lisp_Object make_pure_vector (ptrdiff_t);
  EXFUN (Fgarbage_collect, 0);
  EXFUN (Fmake_byte_code, MANY);
  EXFUN (Fmake_bool_vector, 2);
  extern Lisp_Object Qchar_table_extra_slots;
  extern struct Lisp_Vector *allocate_vector (EMACS_INT);
 -extern struct Lisp_Vector *allocate_pseudovector (int memlen, int lisplen, EMACS_INT tag);
 +extern struct Lisp_Vector *allocate_pseudovector (int memlen, int lisplen, int tag);
  #define ALLOCATE_PSEUDOVECTOR(typ,field,tag)                          \
    ((typ*)                                                             \
     allocate_pseudovector                                              \
@@@ -2891,7 -2831,7 +2891,7 @@@ extern int gc_in_progress
  extern int abort_on_gc;
  extern Lisp_Object make_float (double);
  extern void display_malloc_warning (void);
 -extern int inhibit_garbage_collection (void);
 +extern ptrdiff_t inhibit_garbage_collection (void);
  extern Lisp_Object make_save_value (void *, ptrdiff_t);
  extern void free_marker (Lisp_Object);
  extern void free_cons (struct Lisp_Cons *);
@@@ -2901,14 -2841,6 +2901,14 @@@ extern void syms_of_alloc (void)
  extern struct buffer * allocate_buffer (void);
  extern int valid_lisp_object_p (Lisp_Object);
  
 +#ifdef REL_ALLOC
 +/* Defined in ralloc.c */
 +extern void *r_alloc (void **, size_t);
 +extern void r_alloc_free (void **);
 +extern void *r_re_alloc (void **, size_t);
 +extern void r_alloc_reset_variable (void **, void **);
 +#endif
 +
  /* Defined in chartab.c */
  EXFUN (Fmake_char_table, 2);
  EXFUN (Fset_char_table_parent, 2);
@@@ -2983,7 -2915,7 +2983,7 @@@ EXFUN (Fread_event, 3)
  extern Lisp_Object check_obarray (Lisp_Object);
  extern Lisp_Object intern (const char *);
  extern Lisp_Object intern_c_string (const char *);
 -extern Lisp_Object oblookup (Lisp_Object, const char *, EMACS_INT, EMACS_INT);
 +extern Lisp_Object oblookup (Lisp_Object, const char *, ptrdiff_t, ptrdiff_t);
  #define LOADHIST_ATTACH(x) \
    do {                                                                        \
      if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list); \
@@@ -3060,7 -2992,7 +3060,7 @@@ extern Lisp_Object internal_condition_c
  extern Lisp_Object internal_condition_case_n (Lisp_Object (*) (ptrdiff_t, Lisp_Object *), ptrdiff_t, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object));
  extern void specbind (Lisp_Object, Lisp_Object);
  extern void record_unwind_protect (Lisp_Object (*) (Lisp_Object), Lisp_Object);
 -extern Lisp_Object unbind_to (int, Lisp_Object);
 +extern Lisp_Object unbind_to (ptrdiff_t, Lisp_Object);
  extern void error (const char *, ...) NO_RETURN ATTRIBUTE_FORMAT_PRINTF (1, 2);
  extern void verror (const char *, va_list)
    NO_RETURN ATTRIBUTE_FORMAT_PRINTF (1, 0);
@@@ -3112,9 -3044,10 +3112,9 @@@ EXFUN (Fuser_login_name, 1)
  EXFUN (Fsystem_name, 0);
  EXFUN (Fcurrent_time, 0);
  EXFUN (Fget_internal_run_time, 0);
 -extern EMACS_INT clip_to_bounds (EMACS_INT, EMACS_INT, EMACS_INT);
 -extern Lisp_Object make_buffer_string (EMACS_INT, EMACS_INT, int);
 -extern Lisp_Object make_buffer_string_both (EMACS_INT, EMACS_INT, EMACS_INT,
 -                                          EMACS_INT, int);
 +extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, int);
 +extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t,
 +                                          ptrdiff_t, int);
  extern void init_editfns (void);
  const char *get_system_name (void);
  extern void syms_of_editfns (void);
@@@ -3128,12 -3061,12 +3128,12 @@@ extern void nsberror (Lisp_Object) NO_R
  EXFUN (Fset_buffer_multibyte, 1);
  EXFUN (Foverlay_start, 1);
  EXFUN (Foverlay_end, 1);
 -extern void adjust_overlays_for_insert (EMACS_INT, EMACS_INT);
 -extern void adjust_overlays_for_delete (EMACS_INT, EMACS_INT);
 -extern void fix_start_end_in_overlays (EMACS_INT, EMACS_INT);
 +extern void adjust_overlays_for_insert (ptrdiff_t, ptrdiff_t);
 +extern void adjust_overlays_for_delete (ptrdiff_t, ptrdiff_t);
 +extern void fix_start_end_in_overlays (ptrdiff_t, ptrdiff_t);
  extern void report_overlay_modification (Lisp_Object, Lisp_Object, int,
                                           Lisp_Object, Lisp_Object, Lisp_Object);
 -extern int overlay_touches_p (EMACS_INT);
 +extern int overlay_touches_p (ptrdiff_t);
  extern Lisp_Object Vbuffer_alist;
  EXFUN (Fget_buffer, 1);
  EXFUN (Fget_buffer_create, 1);
@@@ -3167,17 -3100,17 +3167,17 @@@ EXFUN (Fmarker_position, 1)
  EXFUN (Fmarker_buffer, 1);
  EXFUN (Fcopy_marker, 2);
  EXFUN (Fset_marker, 3);
 -extern EMACS_INT marker_position (Lisp_Object);
 -extern EMACS_INT marker_byte_position (Lisp_Object);
 +extern ptrdiff_t marker_position (Lisp_Object);
 +extern ptrdiff_t marker_byte_position (Lisp_Object);
  extern void clear_charpos_cache (struct buffer *);
 -extern EMACS_INT charpos_to_bytepos (EMACS_INT);
 -extern EMACS_INT buf_charpos_to_bytepos (struct buffer *, EMACS_INT);
 -extern EMACS_INT buf_bytepos_to_charpos (struct buffer *, EMACS_INT);
 +extern ptrdiff_t charpos_to_bytepos (ptrdiff_t);
 +extern ptrdiff_t buf_charpos_to_bytepos (struct buffer *, ptrdiff_t);
 +extern ptrdiff_t buf_bytepos_to_charpos (struct buffer *, ptrdiff_t);
  extern void unchain_marker (struct Lisp_Marker *marker);
  extern Lisp_Object set_marker_restricted (Lisp_Object, Lisp_Object, Lisp_Object);
 -extern Lisp_Object set_marker_both (Lisp_Object, Lisp_Object, EMACS_INT, EMACS_INT);
 +extern Lisp_Object set_marker_both (Lisp_Object, Lisp_Object, ptrdiff_t, ptrdiff_t);
  extern Lisp_Object set_marker_restricted_both (Lisp_Object, Lisp_Object,
 -                                               EMACS_INT, EMACS_INT);
 +                                               ptrdiff_t, ptrdiff_t);
  extern void syms_of_marker (void);
  
  /* Defined in fileio.c */
@@@ -3226,18 -3159,18 +3226,18 @@@ struct re_registers
  extern struct re_pattern_buffer *compile_pattern (Lisp_Object,
                                                  struct re_registers *,
                                                  Lisp_Object, int, int);
 -extern EMACS_INT fast_string_match (Lisp_Object, Lisp_Object);
 -extern EMACS_INT fast_c_string_match_ignore_case (Lisp_Object, const char *);
 -extern EMACS_INT fast_string_match_ignore_case (Lisp_Object, Lisp_Object);
 -extern EMACS_INT fast_looking_at (Lisp_Object, EMACS_INT, EMACS_INT,
 -                                  EMACS_INT, EMACS_INT, Lisp_Object);
 -extern EMACS_INT scan_buffer (int, EMACS_INT, EMACS_INT, EMACS_INT,
 -                            EMACS_INT *, int);
 -extern EMACS_INT scan_newline (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT,
 +extern ptrdiff_t fast_string_match (Lisp_Object, Lisp_Object);
 +extern ptrdiff_t fast_c_string_match_ignore_case (Lisp_Object, const char *);
 +extern ptrdiff_t fast_string_match_ignore_case (Lisp_Object, Lisp_Object);
 +extern ptrdiff_t fast_looking_at (Lisp_Object, ptrdiff_t, ptrdiff_t,
 +                                  ptrdiff_t, ptrdiff_t, Lisp_Object);
 +extern ptrdiff_t scan_buffer (int, ptrdiff_t, ptrdiff_t, ptrdiff_t,
 +                            ptrdiff_t *, int);
 +extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
                               EMACS_INT, int);
 -extern EMACS_INT find_next_newline (EMACS_INT, int);
 -extern EMACS_INT find_next_newline_no_quit (EMACS_INT, EMACS_INT);
 -extern EMACS_INT find_before_next_newline (EMACS_INT, EMACS_INT, EMACS_INT);
 +extern ptrdiff_t find_next_newline (ptrdiff_t, int);
 +extern ptrdiff_t find_next_newline_no_quit (ptrdiff_t, ptrdiff_t);
 +extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t);
  extern void syms_of_search (void);
  extern void clear_regexp_cache (void);
  
@@@ -3323,9 -3256,9 +3323,9 @@@ extern void keys_of_keyboard (void)
  EXFUN (Fvertical_motion, 2);
  EXFUN (Findent_to, 2);
  EXFUN (Fmove_to_column, 2);
 -extern EMACS_INT current_column (void);
 +extern ptrdiff_t current_column (void);
  extern void invalidate_current_column (void);
 -extern int indented_beyond_p (EMACS_INT, EMACS_INT, EMACS_INT);
 +extern int indented_beyond_p (ptrdiff_t, ptrdiff_t, EMACS_INT);
  extern void syms_of_indent (void);
  
  /* Defined in frame.c */
@@@ -3457,12 -3390,12 +3457,12 @@@ extern Lisp_Object Qapply
  extern Lisp_Object Qinhibit_read_only;
  EXFUN (Fundo_boundary, 0);
  extern void truncate_undo_list (struct buffer *);
 -extern void record_marker_adjustment (Lisp_Object, EMACS_INT);
 -extern void record_insert (EMACS_INT, EMACS_INT);
 -extern void record_delete (EMACS_INT, Lisp_Object);
 +extern void record_marker_adjustment (Lisp_Object, ptrdiff_t);
 +extern void record_insert (ptrdiff_t, ptrdiff_t);
 +extern void record_delete (ptrdiff_t, Lisp_Object);
  extern void record_first_change (void);
 -extern void record_change (EMACS_INT, EMACS_INT);
 -extern void record_property_change (EMACS_INT, EMACS_INT,
 +extern void record_change (ptrdiff_t, ptrdiff_t);
 +extern void record_property_change (ptrdiff_t, ptrdiff_t,
                                    Lisp_Object, Lisp_Object,
                                      Lisp_Object);
  extern void syms_of_undo (void);
@@@ -3508,8 -3441,8 +3508,8 @@@ extern void init_sys_modes (struct tty_
  extern void reset_sys_modes (struct tty_display_info *);
  extern void init_all_sys_modes (void);
  extern void reset_all_sys_modes (void);
 -extern void wait_for_termination (int);
 -extern void interruptible_wait_for_termination (int);
 +extern void wait_for_termination (pid_t);
 +extern void interruptible_wait_for_termination (pid_t);
  extern void flush_pending_output (int);
  extern void child_setup_tty (int);
  extern void setup_pty (int);
@@@ -3518,8 -3451,8 +3518,8 @@@ extern EMACS_INT get_random (void)
  extern void seed_random (long);
  extern int emacs_open (const char *, int, int);
  extern int emacs_close (int);
 -extern EMACS_INT emacs_read (int, char *, EMACS_INT);
 -extern EMACS_INT emacs_write (int, const char *, EMACS_INT);
 +extern ptrdiff_t emacs_read (int, char *, ptrdiff_t);
 +extern ptrdiff_t emacs_write (int, const char *, ptrdiff_t);
  enum { READLINK_BUFSIZE = 1024 };
  extern char *emacs_readlink (const char *, char [READLINK_BUFSIZE]);
  
@@@ -3616,7 -3549,6 +3616,7 @@@ EXFUN (Fmsdos_downcase_filename, 1)
  #ifdef HAVE_LIBXML2
  /* Defined in xml.c */
  extern void syms_of_xml (void);
 +extern void xml_cleanup_parser (void);
  #endif
  
  #ifdef HAVE_MENUS
@@@ -3633,6 -3565,15 +3633,15 @@@ void syms_of_dbusbind (void)
  /* Defined in msdos.c, w32.c */
  extern char *emacs_root_dir (void);
  #endif /* DOS_NT */
+ #ifdef REL_ALLOC
+ /* Defined in ralloc.c */
+ extern void r_alloc_reset_variable (POINTER_TYPE **, POINTER_TYPE **);
+ extern POINTER_TYPE *r_alloc (POINTER_TYPE **, size_t);
+ extern POINTER_TYPE *r_re_alloc (POINTER_TYPE **, size_t);
+ extern void r_alloc_free (POINTER_TYPE **ptr);
+ extern void r_alloc_inhibit_buffer_relocation (int);
+ #endif        /* REL_ALLOC */
  \f
  /* Nonzero means Emacs has already been initialized.
     Used during startup to detect startup of dumped Emacs.  */
@@@ -3640,9 -3581,9 +3649,9 @@@ extern int initialized
  
  extern int immediate_quit;        /* Nonzero means ^G can quit instantly */
  
 -extern POINTER_TYPE *xmalloc (size_t);
 -extern POINTER_TYPE *xrealloc (POINTER_TYPE *, size_t);
 -extern void xfree (POINTER_TYPE *);
 +extern void *xmalloc (size_t);
 +extern void *xrealloc (void *, size_t);
 +extern void xfree (void *);
  extern void *xnmalloc (ptrdiff_t, ptrdiff_t);
  extern void *xnrealloc (void *, ptrdiff_t, ptrdiff_t);
  extern void *xpalloc (void *, ptrdiff_t *, ptrdiff_t, ptrdiff_t, ptrdiff_t);
@@@ -3746,7 -3687,7 +3755,7 @@@ extern void init_system_name (void)
  extern Lisp_Object safe_alloca_unwind (Lisp_Object);
  
  #define USE_SAFE_ALLOCA                       \
 -  int sa_count = (int) SPECPDL_INDEX (), sa_must_free = 0
 +  ptrdiff_t sa_count = SPECPDL_INDEX (); int sa_must_free = 0
  
  /* SAFE_ALLOCA allocates a simple buffer.  */
  
diff --combined src/msdos.c
@@@ -1813,7 -1813,7 +1813,7 @@@ internal_terminal_init (void
        }
  
        Vinitial_window_system = Qpc;
-       Vwindow_system_version = make_number (23); /* RE Emacs version */
+       Vwindow_system_version = make_number (24); /* RE Emacs version */
        tty->terminal->type = output_msdos_raw;
  
        /* If Emacs was dumped on DOS/V machine, forget the stale VRAM
@@@ -4270,7 -4270,7 +4270,7 @@@ syms_of_msdos (void
    DEFSYM (Qreverse, "reverse");
  
    DEFVAR_LISP ("dos-unsupported-char-glyph", Vdos_unsupported_char_glyph,
 -             doc: /* *Glyph to display instead of chars not supported by current codepage.
 +             doc: /* Glyph to display instead of chars not supported by current codepage.
  This variable is used only by MS-DOS terminals.  */);
    Vdos_unsupported_char_glyph = make_number ('\177');
  
diff --combined src/ralloc.c
@@@ -31,6 -31,9 +31,6 @@@ along with GNU Emacs.  If not, see <htt
  
  #include <unistd.h>
  
 -typedef POINTER_TYPE *POINTER;
 -typedef size_t SIZE;
 -
  #ifdef DOUG_LEA_MALLOC
  #define M_TOP_PAD           -2
  extern int mallopt (int, int);
@@@ -44,6 -47,9 +44,6 @@@ extern size_t __malloc_extra_blocks
  
  #include <stddef.h>
  
 -typedef size_t SIZE;
 -typedef void *POINTER;
 -
  #include <unistd.h>
  #include <malloc.h>
  
@@@ -52,8 -58,6 +52,8 @@@
  
  #include "getpagesize.h"
  
 +typedef size_t SIZE;
 +typedef void *POINTER;
  #define NIL ((POINTER) 0)
  
  /* A flag to indicate whether we have initialized ralloc yet.  For
@@@ -91,8 -95,10 +91,8 @@@ static int extra_bytes
  /* Macros for rounding.  Note that rounding to any value is possible
     by changing the definition of PAGE.  */
  #define PAGE (getpagesize ())
 -#define ALIGNED(addr) (((unsigned long int) (addr) & (page_size - 1)) == 0)
  #define ROUNDUP(size) (((unsigned long int) (size) + page_size - 1) \
                       & ~(page_size - 1))
 -#define ROUND_TO_PAGE(addr) (addr & (~(page_size - 1)))
  
  #define MEM_ALIGN sizeof (double)
  #define MEM_ROUNDUP(addr) (((unsigned long int)(addr) + MEM_ALIGN - 1) \
@@@ -145,6 -151,7 +145,6 @@@ typedef struct hea
  } *heap_ptr;
  
  #define NIL_HEAP ((heap_ptr) 0)
 -#define HEAP_PTR_SIZE (sizeof (struct heap))
  
  /* This is the first heap object.
     If we need additional heap objects, each one resides at the beginning of
@@@ -359,6 -366,15 +359,6 @@@ relinquish (void
        }
      }
  }
 -
 -/* Return the total size in use by relocating allocator,
 -   above where malloc gets space.  */
 -
 -long
 -r_alloc_size_in_use (void)
 -{
 -  return (char *) break_value - (char *) virtual_break_value;
 -}
  \f
  /* The meat - allocating, freeing, and relocating blocs.  */
  
@@@ -732,7 -748,7 +732,7 @@@ free_bloc (bloc_ptr bloc
     __morecore hook values - in particular, __default_morecore in the
     GNU malloc package.  */
  
 -POINTER
 +static POINTER
  r_alloc_sbrk (long int size)
  {
    register bloc_ptr b;
@@@ -998,6 -1014,52 +998,6 @@@ r_re_alloc (POINTER *ptr, SIZE size
    return *ptr;
  }
  
 -/* Disable relocations, after making room for at least SIZE bytes
 -   of non-relocatable heap if possible.  The relocatable blocs are
 -   guaranteed to hold still until thawed, even if this means that
 -   malloc must return a null pointer.  */
 -
 -void
 -r_alloc_freeze (long int size)
 -{
 -  if (! r_alloc_initialized)
 -    r_alloc_init ();
 -
 -  /* If already frozen, we can't make any more room, so don't try.  */
 -  if (r_alloc_freeze_level > 0)
 -    size = 0;
 -  /* If we can't get the amount requested, half is better than nothing.  */
 -  while (size > 0 && r_alloc_sbrk (size) == 0)
 -    size /= 2;
 -  ++r_alloc_freeze_level;
 -  if (size > 0)
 -    r_alloc_sbrk (-size);
 -}
 -
 -void
 -r_alloc_thaw (void)
 -{
 -
 -  if (! r_alloc_initialized)
 -    r_alloc_init ();
 -
 -  if (--r_alloc_freeze_level < 0)
 -    abort ();
 -
 -  /* This frees all unused blocs.  It is not too inefficient, as the resize
 -     and memcpy is done only once.  Afterwards, all unreferenced blocs are
 -     already shrunk to zero size.  */
 -  if (!r_alloc_freeze_level)
 -    {
 -      bloc_ptr *b = &first_bloc;
 -      while (*b)
 -      if (!(*b)->variable)
 -        free_bloc (*b);
 -      else
 -        b = &(*b)->next;
 -    }
 -}
 -
  
  #if defined (emacs) && defined (DOUG_LEA_MALLOC)
  
@@@ -1139,6 -1201,12 +1139,12 @@@ r_alloc_reset_variable (POINTER *old, P
    bloc->variable = new;
  }
  
+ void
+ r_alloc_inhibit_buffer_relocation (int inhibit)
+ {
+   use_relocatable_buffers = !inhibit;
+ }
  \f
  /***********************************************************************
                            Initialization
diff --combined src/search.c
@@@ -90,16 -90,16 +90,16 @@@ static Lisp_Object Qinvalid_regexp
  /* Error condition used for failing searches.  */
  static Lisp_Object Qsearch_failed;
  
 -static void set_search_regs (EMACS_INT, EMACS_INT);
 +static void set_search_regs (ptrdiff_t, ptrdiff_t);
  static void save_search_regs (void);
 -static EMACS_INT simple_search (EMACS_INT, unsigned char *, EMACS_INT,
 -                              EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT,
 -                                EMACS_INT, EMACS_INT);
 -static EMACS_INT boyer_moore (EMACS_INT, unsigned char *, EMACS_INT,
 -                              Lisp_Object, Lisp_Object, EMACS_INT,
 -                              EMACS_INT, int);
 -static EMACS_INT search_buffer (Lisp_Object, EMACS_INT, EMACS_INT,
 -                                EMACS_INT, EMACS_INT, EMACS_INT, int,
 +static EMACS_INT simple_search (EMACS_INT, unsigned char *, ptrdiff_t,
 +                              ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t,
 +                                ptrdiff_t, ptrdiff_t);
 +static EMACS_INT boyer_moore (EMACS_INT, unsigned char *, ptrdiff_t,
 +                              Lisp_Object, Lisp_Object, ptrdiff_t,
 +                              ptrdiff_t, int);
 +static EMACS_INT search_buffer (Lisp_Object, ptrdiff_t, ptrdiff_t,
 +                                ptrdiff_t, ptrdiff_t, EMACS_INT, int,
                                  Lisp_Object, Lisp_Object, int);
  static void matcher_overflow (void) NO_RETURN;
  
@@@ -272,8 -272,8 +272,8 @@@ looking_at_1 (Lisp_Object string, int p
  {
    Lisp_Object val;
    unsigned char *p1, *p2;
 -  EMACS_INT s1, s2;
 -  register EMACS_INT i;
 +  ptrdiff_t s1, s2;
 +  register ptrdiff_t i;
    struct re_pattern_buffer *bufp;
  
    if (running_asynch_code)
@@@ -368,10 -368,10 +368,10 @@@ data if you want to preserve them.  */
  static Lisp_Object
  string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, int posix)
  {
 -  EMACS_INT val;
 +  ptrdiff_t val;
    struct re_pattern_buffer *bufp;
 -  EMACS_INT pos, pos_byte;
 -  int i;
 +  EMACS_INT pos;
 +  ptrdiff_t pos_byte, i;
  
    if (running_asynch_code)
      save_search_regs ();
      pos = 0, pos_byte = 0;
    else
      {
 -      EMACS_INT len = SCHARS (string);
 +      ptrdiff_t len = SCHARS (string);
  
        CHECK_NUMBER (start);
        pos = XINT (start);
@@@ -468,10 -468,10 +468,10 @@@ matched by parenthesis constructs in th
     and return the index of the match, or negative on failure.
     This does not clobber the match data.  */
  
 -EMACS_INT
 +ptrdiff_t
  fast_string_match (Lisp_Object regexp, Lisp_Object string)
  {
 -  EMACS_INT val;
 +  ptrdiff_t val;
    struct re_pattern_buffer *bufp;
  
    bufp = compile_pattern (regexp, 0, Qnil,
     This does not clobber the match data.
     We assume that STRING contains single-byte characters.  */
  
 -EMACS_INT
 +ptrdiff_t
  fast_c_string_match_ignore_case (Lisp_Object regexp, const char *string)
  {
 -  EMACS_INT val;
 +  ptrdiff_t val;
    struct re_pattern_buffer *bufp;
    size_t len = strlen (string);
  
  
  /* Like fast_string_match but ignore case.  */
  
 -EMACS_INT
 +ptrdiff_t
  fast_string_match_ignore_case (Lisp_Object regexp, Lisp_Object string)
  {
 -  EMACS_INT val;
 +  ptrdiff_t val;
    struct re_pattern_buffer *bufp;
  
    bufp = compile_pattern (regexp, 0, Vascii_canon_table,
     indices into the string.  This function doesn't modify the match
     data.  */
  
 -EMACS_INT
 -fast_looking_at (Lisp_Object regexp, EMACS_INT pos, EMACS_INT pos_byte, EMACS_INT limit, EMACS_INT limit_byte, Lisp_Object string)
 +ptrdiff_t
 +fast_looking_at (Lisp_Object regexp, ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t limit, ptrdiff_t limit_byte, Lisp_Object string)
  {
    int multibyte;
    struct re_pattern_buffer *buf;
    unsigned char *p1, *p2;
 -  EMACS_INT s1, s2;
 -  EMACS_INT len;
 +  ptrdiff_t s1, s2;
 +  ptrdiff_t len;
  
    if (STRINGP (string))
      {
@@@ -641,9 -641,9 +641,9 @@@ newline_cache_on_off (struct buffer *bu
     If ALLOW_QUIT is non-zero, set immediate_quit.  That's good to do
     except when inside redisplay.  */
  
 -EMACS_INT
 -scan_buffer (register int target, EMACS_INT start, EMACS_INT end,
 -           EMACS_INT count, EMACS_INT *shortage, int allow_quit)
 +ptrdiff_t
 +scan_buffer (register int target, ptrdiff_t start, ptrdiff_t end,
 +           ptrdiff_t count, ptrdiff_t *shortage, int allow_quit)
  {
    struct region_cache *newline_cache;
    int direction;
             the position of the last character before the next such
             obstacle --- the last character the dumb search loop should
             examine.  */
 -      EMACS_INT ceiling_byte = CHAR_TO_BYTE (end) - 1;
 -      EMACS_INT start_byte = CHAR_TO_BYTE (start);
 -      EMACS_INT tem;
 +      ptrdiff_t ceiling_byte = CHAR_TO_BYTE (end) - 1;
 +      ptrdiff_t start_byte = CHAR_TO_BYTE (start);
 +      ptrdiff_t tem;
  
          /* If we're looking for a newline, consult the newline cache
             to see where we can avoid some scanning.  */
      while (start > end)
        {
          /* The last character to check before the next obstacle.  */
 -      EMACS_INT ceiling_byte = CHAR_TO_BYTE (end);
 -      EMACS_INT start_byte = CHAR_TO_BYTE (start);
 -      EMACS_INT tem;
 +      ptrdiff_t ceiling_byte = CHAR_TO_BYTE (end);
 +      ptrdiff_t start_byte = CHAR_TO_BYTE (start);
 +      ptrdiff_t tem;
  
          /* Consult the newline cache, if appropriate.  */
          if (target == '\n' && newline_cache)
     except in special cases.  */
  
  EMACS_INT
 -scan_newline (EMACS_INT start, EMACS_INT start_byte,
 -            EMACS_INT limit, EMACS_INT limit_byte,
 +scan_newline (ptrdiff_t start, ptrdiff_t start_byte,
 +            ptrdiff_t limit, ptrdiff_t limit_byte,
              register EMACS_INT count, int allow_quit)
  {
    int direction = ((count > 0) ? 1 : -1);
    register unsigned char *cursor;
    unsigned char *base;
  
 -  EMACS_INT ceiling;
 +  ptrdiff_t ceiling;
    register unsigned char *ceiling_addr;
  
    int old_immediate_quit = immediate_quit;
    return count * direction;
  }
  
 -EMACS_INT
 -find_next_newline_no_quit (EMACS_INT from, EMACS_INT cnt)
 +ptrdiff_t
 +find_next_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt)
  {
 -  return scan_buffer ('\n', from, 0, cnt, (EMACS_INT *) 0, 0);
 +  return scan_buffer ('\n', from, 0, cnt, (ptrdiff_t *) 0, 0);
  }
  
  /* Like find_next_newline, but returns position before the newline,
     not after, and only search up to TO.  This isn't just
     find_next_newline (...)-1, because you might hit TO.  */
  
 -EMACS_INT
 -find_before_next_newline (EMACS_INT from, EMACS_INT to, EMACS_INT cnt)
 +ptrdiff_t
 +find_before_next_newline (ptrdiff_t from, ptrdiff_t to, ptrdiff_t cnt)
  {
 -  EMACS_INT shortage;
 -  EMACS_INT pos = scan_buffer ('\n', from, to, cnt, &shortage, 1);
 +  ptrdiff_t shortage;
 +  ptrdiff_t pos = scan_buffer ('\n', from, to, cnt, &shortage, 1);
  
    if (shortage == 0)
      pos--;
@@@ -959,8 -959,7 +959,8 @@@ search_command (Lisp_Object string, Lis
                Lisp_Object count, int direction, int RE, int posix)
  {
    register EMACS_INT np;
 -  EMACS_INT lim, lim_byte;
 +  EMACS_INT lim;
 +  ptrdiff_t lim_byte;
    EMACS_INT n = direction;
  
    if (!NILP (count))
  static int
  trivial_regexp_p (Lisp_Object regexp)
  {
 -  EMACS_INT len = SBYTES (regexp);
 +  ptrdiff_t len = SBYTES (regexp);
    unsigned char *s = SDATA (regexp);
    while (--len >= 0)
      {
@@@ -1100,13 -1099,13 +1100,13 @@@ while (0
  static struct re_registers search_regs_1;
  
  static EMACS_INT
 -search_buffer (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte,
 -             EMACS_INT lim, EMACS_INT lim_byte, EMACS_INT n,
 +search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
 +             ptrdiff_t lim, ptrdiff_t lim_byte, EMACS_INT n,
               int RE, Lisp_Object trt, Lisp_Object inverse_trt, int posix)
  {
 -  EMACS_INT len = SCHARS (string);
 -  EMACS_INT len_byte = SBYTES (string);
 -  register int i;
 +  ptrdiff_t len = SCHARS (string);
 +  ptrdiff_t len_byte = SBYTES (string);
 +  register ptrdiff_t i;
  
    if (running_asynch_code)
      save_search_regs ();
    if (RE && !(trivial_regexp_p (string) && NILP (Vsearch_spaces_regexp)))
      {
        unsigned char *p1, *p2;
 -      EMACS_INT s1, s2;
 +      ptrdiff_t s1, s2;
        struct re_pattern_buffer *bufp;
  
        bufp = compile_pattern (string,
  
        while (n < 0)
        {
 -        EMACS_INT val;
 +        ptrdiff_t val;
+ #ifdef REL_ALLOC
+         /* re_search_2 below is passed C pointers to buffer text.
+            If some code called by it causes memory (re)allocation,
+            buffer text could be relocated on platforms that use
+            REL_ALLOC, which invalidates those C pointers.  So we
+            inhibit relocation of buffer text for as long as
+            re_search_2 runs.  */
+         r_alloc_inhibit_buffer_relocation (1);
+ #endif
          val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2,
                             pos_byte - BEGV_BYTE, lim_byte - pos_byte,
                             (NILP (Vinhibit_changing_match_data)
                              ? &search_regs : &search_regs_1),
                             /* Don't allow match past current point */
                             pos_byte - BEGV_BYTE);
+ #ifdef REL_ALLOC
+         r_alloc_inhibit_buffer_relocation (0);
+ #endif
          if (val == -2)
            {
              matcher_overflow ();
        }
        while (n > 0)
        {
 -        EMACS_INT val;
 +        ptrdiff_t val;
+ #ifdef REL_ALLOC
+         /* See commentary above for the reasons for inhibiting
+            buffer text relocation here.  */
+         r_alloc_inhibit_buffer_relocation (1);
+ #endif
          val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2,
                             pos_byte - BEGV_BYTE, lim_byte - pos_byte,
                             (NILP (Vinhibit_changing_match_data)
                              ? &search_regs : &search_regs_1),
                             lim_byte - BEGV_BYTE);
+ #ifdef REL_ALLOC
+         r_alloc_inhibit_buffer_relocation (0);
+ #endif
          if (val == -2)
            {
              matcher_overflow ();
    else                                /* non-RE case */
      {
        unsigned char *raw_pattern, *pat;
 -      EMACS_INT raw_pattern_size;
 -      EMACS_INT raw_pattern_size_byte;
 +      ptrdiff_t raw_pattern_size;
 +      ptrdiff_t raw_pattern_size_byte;
        unsigned char *patbuf;
        int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
        unsigned char *base_pat;
  
  static EMACS_INT
  simple_search (EMACS_INT n, unsigned char *pat,
 -             EMACS_INT len, EMACS_INT len_byte, Lisp_Object trt,
 -             EMACS_INT pos, EMACS_INT pos_byte,
 -             EMACS_INT lim, EMACS_INT lim_byte)
 +             ptrdiff_t len, ptrdiff_t len_byte, Lisp_Object trt,
 +             ptrdiff_t pos, ptrdiff_t pos_byte,
 +             ptrdiff_t lim, ptrdiff_t lim_byte)
  {
    int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
    int forward = n > 0;
    /* Number of buffer bytes matched.  Note that this may be different
       from len_byte in a multibyte buffer.  */
 -  EMACS_INT match_byte;
 +  ptrdiff_t match_byte;
  
    if (lim > pos && multibyte)
      while (n > 0)
        while (1)
          {
            /* Try matching at position POS.  */
 -          EMACS_INT this_pos = pos;
 -          EMACS_INT this_pos_byte = pos_byte;
 -          EMACS_INT this_len = len;
 +          ptrdiff_t this_pos = pos;
 +          ptrdiff_t this_pos_byte = pos_byte;
 +          ptrdiff_t this_len = len;
            unsigned char *p = pat;
            if (pos + len > lim || pos_byte + len_byte > lim_byte)
              goto stop;
        while (1)
          {
            /* Try matching at position POS.  */
 -          EMACS_INT this_pos = pos;
 -          EMACS_INT this_len = len;
 +          ptrdiff_t this_pos = pos;
 +          ptrdiff_t this_len = len;
            unsigned char *p = pat;
  
            if (pos + len > lim)
        while (1)
          {
            /* Try matching at position POS.  */
 -          EMACS_INT this_pos = pos;
 -          EMACS_INT this_pos_byte = pos_byte;
 -          EMACS_INT this_len = len;
 +          ptrdiff_t this_pos = pos;
 +          ptrdiff_t this_pos_byte = pos_byte;
 +          ptrdiff_t this_len = len;
            const unsigned char *p = pat + len_byte;
  
            if (this_pos - len < lim || (pos_byte - len_byte) < lim_byte)
        while (1)
          {
            /* Try matching at position POS.  */
 -          EMACS_INT this_pos = pos - len;
 -          EMACS_INT this_len = len;
 +          ptrdiff_t this_pos = pos - len;
 +          ptrdiff_t this_len = len;
            unsigned char *p = pat;
  
            if (this_pos < lim)
  
  static EMACS_INT
  boyer_moore (EMACS_INT n, unsigned char *base_pat,
 -           EMACS_INT len_byte,
 +           ptrdiff_t len_byte,
             Lisp_Object trt, Lisp_Object inverse_trt,
 -           EMACS_INT pos_byte, EMACS_INT lim_byte,
 +           ptrdiff_t pos_byte, ptrdiff_t lim_byte,
               int char_base)
  {
    int direction = ((n > 0) ? 1 : -1);
 -  register EMACS_INT dirlen;
 -  EMACS_INT limit;
 +  register ptrdiff_t dirlen;
 +  ptrdiff_t limit;
    int stride_for_teases = 0;
    int BM_tab[0400];
    register unsigned char *cursor, *p_limit;
 -  register EMACS_INT i;
 +  register ptrdiff_t i;
    register int j;
    unsigned char *pat, *pat_end;
    int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
       char if reverse) of pattern would align in a possible match.  */
    while (n != 0)
      {
 -      EMACS_INT tail_end;
 +      ptrdiff_t tail_end;
        unsigned char *tail_end_ptr;
  
        /* It's been reported that some (broken) compiler thinks that
              cursor += dirlen - i - direction; /* fix cursor */
              if (i + direction == 0)
                {
 -                EMACS_INT position, start, end;
 +                ptrdiff_t position, start, end;
  
                  cursor -= direction;
  
              pos_byte += dirlen - i - direction;
              if (i + direction == 0)
                {
 -                EMACS_INT position, start, end;
 +                ptrdiff_t position, start, end;
                  pos_byte -= direction;
  
                  position = pos_byte + ((direction > 0) ? 1 - len_byte : 0);
     Also clear out the match data for registers 1 and up.  */
  
  static void
 -set_search_regs (EMACS_INT beg_byte, EMACS_INT nbytes)
 +set_search_regs (ptrdiff_t beg_byte, ptrdiff_t nbytes)
  {
 -  int i;
 +  ptrdiff_t i;
  
    if (!NILP (Vinhibit_changing_match_data))
      return;
    XSETBUFFER (last_thing_searched, current_buffer);
  }
  \f
 -DEFUN ("word-search-regexp", Fword_search_regexp, Sword_search_regexp, 1, 2, 0,
 -       doc: /* Return a regexp which matches words, ignoring punctuation.
 -Given STRING, a string of words separated by word delimiters,
 -compute a regexp that matches those exact words separated by
 -arbitrary punctuation.  If LAX is non-nil, the end of the string
 -need not match a word boundary unless it ends in whitespace.
 -
 -Used in `word-search-forward', `word-search-backward',
 -`word-search-forward-lax', `word-search-backward-lax'.  */)
 -  (Lisp_Object string, Lisp_Object lax)
 -{
 -  register unsigned char *o;
 -  register EMACS_INT i, i_byte, len, punct_count = 0, word_count = 0;
 -  Lisp_Object val;
 -  int prev_c = 0;
 -  EMACS_INT adjust;
 -  int whitespace_at_end;
 -
 -  CHECK_STRING (string);
 -  len = SCHARS (string);
 -
 -  for (i = 0, i_byte = 0; i < len; )
 -    {
 -      int c;
 -
 -      FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c, string, i, i_byte);
 -
 -      if (SYNTAX (c) != Sword)
 -      {
 -        punct_count++;
 -        if (SYNTAX (prev_c) == Sword)
 -          word_count++;
 -      }
 -
 -      prev_c = c;
 -    }
 -
 -  if (SYNTAX (prev_c) == Sword)
 -    {
 -      word_count++;
 -      whitespace_at_end = 0;
 -    }
 -  else
 -    {
 -      whitespace_at_end = 1;
 -      if (!word_count)
 -      return empty_unibyte_string;
 -    }
 -
 -  adjust = - punct_count + 5 * (word_count - 1)
 -    + ((!NILP (lax) && !whitespace_at_end) ? 2 : 4);
 -  if (STRING_MULTIBYTE (string))
 -    val = make_uninit_multibyte_string (len + adjust,
 -                                      SBYTES (string)
 -                                      + adjust);
 -  else
 -    val = make_uninit_string (len + adjust);
 -
 -  o = SDATA (val);
 -  *o++ = '\\';
 -  *o++ = 'b';
 -  prev_c = 0;
 -
 -  for (i = 0, i_byte = 0; i < len; )
 -    {
 -      int c;
 -      EMACS_INT i_byte_orig = i_byte;
 -
 -      FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c, string, i, i_byte);
 -
 -      if (SYNTAX (c) == Sword)
 -      {
 -        memcpy (o, SDATA (string) + i_byte_orig, i_byte - i_byte_orig);
 -        o += i_byte - i_byte_orig;
 -      }
 -      else if (SYNTAX (prev_c) == Sword && --word_count)
 -      {
 -        *o++ = '\\';
 -        *o++ = 'W';
 -        *o++ = '\\';
 -        *o++ = 'W';
 -        *o++ = '*';
 -      }
 -
 -      prev_c = c;
 -    }
 -
 -  if (NILP (lax) || whitespace_at_end)
 -    {
 -      *o++ = '\\';
 -      *o++ = 'b';
 -    }
 -
 -  return val;
 -}
 -\f
  DEFUN ("search-backward", Fsearch_backward, Ssearch_backward, 1, 4,
         "MSearch backward: ",
         doc: /* Search backward from point for STRING.
@@@ -2121,6 -2238,86 +2143,6 @@@ See also the functions `match-beginning
    return search_command (string, bound, noerror, count, 1, 0, 0);
  }
  
 -DEFUN ("word-search-backward", Fword_search_backward, Sword_search_backward, 1, 4,
 -       "sWord search backward: ",
 -       doc: /* Search backward from point for STRING, ignoring differences in punctuation.
 -Set point to the beginning of the occurrence found, and return point.
 -An optional second argument bounds the search; it is a buffer position.
 -The match found must not extend before that position.
 -Optional third argument, if t, means if fail just return nil (no error).
 -  If not nil and not t, move to limit of search and return nil.
 -Optional fourth argument is repeat count--search for successive occurrences.
 -
 -Relies on the function `word-search-regexp' to convert a sequence
 -of words in STRING to a regexp used to search words without regard
 -to punctuation.  */)
 -  (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
 -{
 -  return search_command (Fword_search_regexp (string, Qnil), bound, noerror, count, -1, 1, 0);
 -}
 -
 -DEFUN ("word-search-forward", Fword_search_forward, Sword_search_forward, 1, 4,
 -       "sWord search: ",
 -       doc: /* Search forward from point for STRING, ignoring differences in punctuation.
 -Set point to the end of the occurrence found, and return point.
 -An optional second argument bounds the search; it is a buffer position.
 -The match found must not extend after that position.
 -Optional third argument, if t, means if fail just return nil (no error).
 -  If not nil and not t, move to limit of search and return nil.
 -Optional fourth argument is repeat count--search for successive occurrences.
 -
 -Relies on the function `word-search-regexp' to convert a sequence
 -of words in STRING to a regexp used to search words without regard
 -to punctuation.  */)
 -  (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
 -{
 -  return search_command (Fword_search_regexp (string, Qnil), bound, noerror, count, 1, 1, 0);
 -}
 -
 -DEFUN ("word-search-backward-lax", Fword_search_backward_lax, Sword_search_backward_lax, 1, 4,
 -       "sWord search backward: ",
 -       doc: /* Search backward from point for STRING, ignoring differences in punctuation.
 -Set point to the beginning of the occurrence found, and return point.
 -
 -Unlike `word-search-backward', the end of STRING need not match a word
 -boundary, unless STRING ends in whitespace.
 -
 -An optional second argument bounds the search; it is a buffer position.
 -The match found must not extend before that position.
 -Optional third argument, if t, means if fail just return nil (no error).
 -  If not nil and not t, move to limit of search and return nil.
 -Optional fourth argument is repeat count--search for successive occurrences.
 -
 -Relies on the function `word-search-regexp' to convert a sequence
 -of words in STRING to a regexp used to search words without regard
 -to punctuation.  */)
 -  (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
 -{
 -  return search_command (Fword_search_regexp (string, Qt), bound, noerror, count, -1, 1, 0);
 -}
 -
 -DEFUN ("word-search-forward-lax", Fword_search_forward_lax, Sword_search_forward_lax, 1, 4,
 -       "sWord search: ",
 -       doc: /* Search forward from point for STRING, ignoring differences in punctuation.
 -Set point to the end of the occurrence found, and return point.
 -
 -Unlike `word-search-forward', the end of STRING need not match a word
 -boundary, unless STRING ends in whitespace.
 -
 -An optional second argument bounds the search; it is a buffer position.
 -The match found must not extend after that position.
 -Optional third argument, if t, means if fail just return nil (no error).
 -  If not nil and not t, move to limit of search and return nil.
 -Optional fourth argument is repeat count--search for successive occurrences.
 -
 -Relies on the function `word-search-regexp' to convert a sequence
 -of words in STRING to a regexp used to search words without regard
 -to punctuation.  */)
 -  (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
 -{
 -  return search_command (Fword_search_regexp (string, Qt), bound, noerror, count, 1, 1, 0);
 -}
 -
  DEFUN ("re-search-backward", Fre_search_backward, Sre_search_backward, 1, 4,
         "sRE search backward: ",
         doc: /* Search backward from point for match for regular expression REGEXP.
@@@ -2246,14 -2443,14 +2268,14 @@@ since only regular expressions have dis
    (Lisp_Object newtext, Lisp_Object fixedcase, Lisp_Object literal, Lisp_Object string, Lisp_Object subexp)
  {
    enum { nochange, all_caps, cap_initial } case_action;
 -  register EMACS_INT pos, pos_byte;
 +  register ptrdiff_t pos, pos_byte;
    int some_multiletter_word;
    int some_lowercase;
    int some_uppercase;
    int some_nonuppercase_initial;
    register int c, prevc;
    ptrdiff_t sub;
 -  EMACS_INT opoint, newpoint;
 +  ptrdiff_t opoint, newpoint;
  
    CHECK_STRING (newtext);
  
    if (NILP (fixedcase))
      {
        /* Decide how to casify by examining the matched text. */
 -      EMACS_INT last;
 +      ptrdiff_t last;
  
        pos = search_regs.start[sub];
        last = search_regs.end[sub];
         if desired.  */
        if (NILP (literal))
        {
 -        EMACS_INT lastpos = 0;
 -        EMACS_INT lastpos_byte = 0;
 +        ptrdiff_t lastpos = 0;
 +        ptrdiff_t lastpos_byte = 0;
          /* We build up the substituted string in ACCUM.  */
          Lisp_Object accum;
          Lisp_Object middle;
 -        EMACS_INT length = SBYTES (newtext);
 +        ptrdiff_t length = SBYTES (newtext);
  
          accum = Qnil;
  
          for (pos_byte = 0, pos = 0; pos_byte < length;)
            {
 -            EMACS_INT substart = -1;
 -            EMACS_INT subend = 0;
 +            ptrdiff_t substart = -1;
 +            ptrdiff_t subend = 0;
              int delbackslash = 0;
  
              FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte);
                    }
                  else if (c >= '1' && c <= '9')
                    {
 -                    if (search_regs.start[c - '0'] >= 0
 -                        && c <= search_regs.num_regs + '0')
 +                    if (c - '0' < search_regs.num_regs
 +                        && 0 <= search_regs.start[c - '0'])
                        {
                          substart = search_regs.start[c - '0'];
                          subend = search_regs.end[c - '0'];
  
              if (c == '&')
                idx = sub;
 -            else if (c >= '1' && c <= '9' && c <= search_regs.num_regs + '0')
 +            else if (c >= '1' && c <= '9' && c - '0' < search_regs.num_regs)
                {
                  if (search_regs.start[c - '0'] >= 1)
                    idx = c - '0';
        {
          if (buf_multibyte)
            {
 -            EMACS_INT nchars =
 +            ptrdiff_t nchars =
                multibyte_chars_in_text (substed, substed_len);
  
              newtext = make_multibyte_string ((char *) substed, nchars,
  
    /* Adjust search data for this change.  */
    {
 -    EMACS_INT oldend = search_regs.end[sub];
 -    EMACS_INT oldstart = search_regs.start[sub];
 -    EMACS_INT change = newpoint - search_regs.end[sub];
 -    int i;
 +    ptrdiff_t oldend = search_regs.end[sub];
 +    ptrdiff_t oldstart = search_regs.start[sub];
 +    ptrdiff_t change = newpoint - search_regs.end[sub];
 +    ptrdiff_t i;
  
      for (i = 0; i < search_regs.num_regs; i++)
        {
@@@ -2724,7 -2921,7 +2746,7 @@@ Return value is undefined if the last s
  {
    Lisp_Object tail, prev;
    Lisp_Object *data;
 -  int i, len;
 +  ptrdiff_t i, len;
  
    if (!NILP (reseat))
      for (tail = reuse; CONSP (tail); tail = XCDR (tail))
    len = 0;
    for (i = 0; i < search_regs.num_regs; i++)
      {
 -      EMACS_INT start = search_regs.start[i];
 +      ptrdiff_t start = search_regs.start[i];
        if (start >= 0)
        {
          if (EQ (last_thing_searched, Qt)
@@@ -2836,13 -3033,11 +2858,13 @@@ If optional arg RESEAT is non-nil, mak
  
    /* Allocate registers if they don't already exist.  */
    {
 -    ptrdiff_t length = XFASTINT (Flength (list)) / 2;
 +    EMACS_INT length = XFASTINT (Flength (list)) / 2;
  
      if (length > search_regs.num_regs)
        {
        ptrdiff_t num_regs = search_regs.num_regs;
 +      if (PTRDIFF_MAX < length)
 +        memory_full (SIZE_MAX);
        search_regs.start =
          xpalloc (search_regs.start, &num_regs, length - num_regs,
                   min (PTRDIFF_MAX, UINT_MAX), sizeof (regoff_t));
          }
        else
          {
 -          EMACS_INT from;
 +          Lisp_Object from;
            Lisp_Object m;
  
            m = marker;
              }
  
            CHECK_NUMBER_COERCE_MARKER (marker);
 -          from = XINT (marker);
 +          from = marker;
  
            if (!NILP (reseat) && MARKERP (m))
              {
              XSETFASTINT (marker, 0);
  
            CHECK_NUMBER_COERCE_MARKER (marker);
 -          search_regs.start[i] = from;
 -          search_regs.end[i] = XINT (marker);
 +          if ((XINT (from) < 0
 +               ? TYPE_MINIMUM (regoff_t) <= XINT (from)
 +               : XINT (from) <= TYPE_MAXIMUM (regoff_t))
 +              && (XINT (marker) < 0
 +                  ? TYPE_MINIMUM (regoff_t) <= XINT (marker)
 +                  : XINT (marker) <= TYPE_MAXIMUM (regoff_t)))
 +            {
 +              search_regs.start[i] = XINT (from);
 +              search_regs.end[i] = XINT (marker);
 +            }
 +          else
 +            {
 +              search_regs.start[i] = -1;
 +            }
  
            if (!NILP (reseat) && MARKERP (m))
              {
@@@ -3091,6 -3274,11 +3113,6 @@@ is to bind it with `let' around a smal
    defsubr (&Sposix_string_match);
    defsubr (&Ssearch_forward);
    defsubr (&Ssearch_backward);
 -  defsubr (&Sword_search_regexp);
 -  defsubr (&Sword_search_forward);
 -  defsubr (&Sword_search_backward);
 -  defsubr (&Sword_search_forward_lax);
 -  defsubr (&Sword_search_backward_lax);
    defsubr (&Sre_search_forward);
    defsubr (&Sre_search_backward);
    defsubr (&Sposix_search_forward);
diff --combined src/xdisp.c
@@@ -383,21 -383,11 +383,21 @@@ static Lisp_Object Qline_height
  #define IT_OVERFLOW_NEWLINE_INTO_FRINGE(it) 0
  #endif /* HAVE_WINDOW_SYSTEM */
  
 -/* Test if the display element loaded in IT is a space or tab
 -   character.  This is used to determine word wrapping.  */
 -
 -#define IT_DISPLAYING_WHITESPACE(it)                          \
 -  (it->what == IT_CHARACTER && (it->c == ' ' || it->c == '\t'))
 +/* Test if the display element loaded in IT, or the underlying buffer
 +   or string character, is a space or a TAB character.  This is used
 +   to determine where word wrapping can occur.  */
 +
 +#define IT_DISPLAYING_WHITESPACE(it)                                  \
 +  ((it->what == IT_CHARACTER && (it->c == ' ' || it->c == '\t'))      \
 +   || ((STRINGP (it->string)                                          \
 +      && (SREF (it->string, IT_STRING_BYTEPOS (*it)) == ' '           \
 +          || SREF (it->string, IT_STRING_BYTEPOS (*it)) == '\t'))     \
 +       || (it->s                                                      \
 +         && (it->s[IT_BYTEPOS (*it)] == ' '                           \
 +             || it->s[IT_BYTEPOS (*it)] == '\t'))                     \
 +       || (IT_BYTEPOS (*it) < ZV_BYTE                                 \
 +         && (*BYTE_POS_ADDR (IT_BYTEPOS (*it)) == ' '                 \
 +             || *BYTE_POS_ADDR (IT_BYTEPOS (*it)) == '\t'))))         \
  
  /* Name of the face used to highlight trailing whitespace.  */
  
@@@ -758,7 -748,7 +758,7 @@@ static Lisp_Object Qinhibit_free_realiz
  Lisp_Object help_echo_string;
  Lisp_Object help_echo_window;
  Lisp_Object help_echo_object;
 -EMACS_INT help_echo_pos;
 +ptrdiff_t help_echo_pos;
  
  /* Temporary variable for XTread_socket.  */
  
@@@ -805,33 -795,33 +805,33 @@@ static Lisp_Object get_it_property (str
  
  static void handle_line_prefix (struct it *);
  
 -static void pint2str (char *, int, EMACS_INT);
 -static void pint2hrstr (char *, int, EMACS_INT);
 +static void pint2str (char *, int, ptrdiff_t);
 +static void pint2hrstr (char *, int, ptrdiff_t);
  static struct text_pos run_window_scroll_functions (Lisp_Object,
                                                      struct text_pos);
  static void reconsider_clip_changes (struct window *, struct buffer *);
  static int text_outside_line_unchanged_p (struct window *,
 -                                        EMACS_INT, EMACS_INT);
 +                                        ptrdiff_t, ptrdiff_t);
  static void store_mode_line_noprop_char (char);
  static int store_mode_line_noprop (const char *, int, int);
  static void handle_stop (struct it *);
 -static void handle_stop_backwards (struct it *, EMACS_INT);
 +static void handle_stop_backwards (struct it *, ptrdiff_t);
  static void vmessage (const char *, va_list) ATTRIBUTE_FORMAT_PRINTF (1, 0);
  static void ensure_echo_area_buffers (void);
  static Lisp_Object unwind_with_echo_area_buffer (Lisp_Object);
  static Lisp_Object with_echo_area_buffer_unwind_data (struct window *);
  static int with_echo_area_buffer (struct window *, int,
 -                                  int (*) (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT),
 -                                  EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
 +                                  int (*) (ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t),
 +                                  ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t);
  static void clear_garbaged_frames (void);
 -static int current_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
 +static int current_message_1 (ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t);
  static void pop_message (void);
 -static int truncate_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
 -static void set_message (const char *, Lisp_Object, EMACS_INT, int);
 -static int set_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
 +static int truncate_message_1 (ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t);
 +static void set_message (const char *, Lisp_Object, ptrdiff_t, int);
 +static int set_message_1 (ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t);
  static int display_echo_area (struct window *);
 -static int display_echo_area_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
 -static int resize_mini_window_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
 +static int display_echo_area_1 (ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t);
 +static int resize_mini_window_1 (ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t);
  static Lisp_Object unwind_redisplay (Lisp_Object);
  static int string_char_and_length (const unsigned char *, int *);
  static struct text_pos display_prop_end (struct it *, Lisp_Object,
@@@ -844,10 -834,10 +844,10 @@@ static struct glyph_row *get_overlay_ar
  static void extend_face_to_end_of_line (struct it *);
  static int append_space_for_newline (struct it *, int);
  static int cursor_row_fully_visible_p (struct window *, int, int);
 -static int try_scrolling (Lisp_Object, int, EMACS_INT, EMACS_INT, int, int);
 +static int try_scrolling (Lisp_Object, int, ptrdiff_t, ptrdiff_t, int, int);
  static int try_cursor_movement (Lisp_Object, struct text_pos, int *);
 -static int trailing_whitespace_p (EMACS_INT);
 -static intmax_t message_log_check_duplicate (EMACS_INT, EMACS_INT);
 +static int trailing_whitespace_p (ptrdiff_t);
 +static intmax_t message_log_check_duplicate (ptrdiff_t, ptrdiff_t);
  static void push_it (struct it *, struct text_pos *);
  static void iterate_out_of_display_property (struct it *);
  static void pop_it (struct it *);
@@@ -861,7 -851,7 +861,7 @@@ static Lisp_Object redisplay_window_err
  static Lisp_Object redisplay_window_0 (Lisp_Object);
  static Lisp_Object redisplay_window_1 (Lisp_Object);
  static int set_cursor_from_row (struct window *, struct glyph_row *,
 -                              struct glyph_matrix *, EMACS_INT, EMACS_INT,
 +                              struct glyph_matrix *, ptrdiff_t, ptrdiff_t,
                                int, int);
  static int update_menu_bar (struct frame *, int, int);
  static int try_window_reusing_current_matrix (struct window *);
@@@ -873,14 -863,14 +873,14 @@@ static int display_mode_element (struc
  static int store_mode_line_string (const char *, Lisp_Object, int, int, int, Lisp_Object);
  static const char *decode_mode_spec (struct window *, int, int, Lisp_Object *);
  static void display_menu_bar (struct window *);
 -static EMACS_INT display_count_lines (EMACS_INT, EMACS_INT, EMACS_INT,
 -                                    EMACS_INT *);
 +static ptrdiff_t display_count_lines (ptrdiff_t, ptrdiff_t, ptrdiff_t,
 +                                    ptrdiff_t *);
  static int display_string (const char *, Lisp_Object, Lisp_Object,
 -                           EMACS_INT, EMACS_INT, struct it *, int, int, int, int);
 +                           ptrdiff_t, ptrdiff_t, struct it *, int, int, int, int);
  static void compute_line_metrics (struct it *);
  static void run_redisplay_end_trigger_hook (struct it *);
 -static int get_overlay_strings (struct it *, EMACS_INT);
 -static int get_overlay_strings_1 (struct it *, EMACS_INT, int);
 +static int get_overlay_strings (struct it *, ptrdiff_t);
 +static int get_overlay_strings_1 (struct it *, ptrdiff_t, int);
  static void next_overlay_string (struct it *);
  static void reseat (struct it *, struct text_pos, int);
  static void reseat_1 (struct it *, struct text_pos, int);
@@@ -895,14 -885,14 +895,14 @@@ static int next_element_from_buffer (st
  static int next_element_from_composition (struct it *);
  static int next_element_from_image (struct it *);
  static int next_element_from_stretch (struct it *);
 -static void load_overlay_strings (struct it *, EMACS_INT);
 +static void load_overlay_strings (struct it *, ptrdiff_t);
  static int init_from_display_pos (struct it *, struct window *,
                                    struct display_pos *);
  static void reseat_to_string (struct it *, const char *,
 -                              Lisp_Object, EMACS_INT, EMACS_INT, int, int);
 +                              Lisp_Object, ptrdiff_t, ptrdiff_t, int, int);
  static int get_next_display_element (struct it *);
  static enum move_it_result
 -       move_it_in_display_line_to (struct it *, EMACS_INT, int,
 +       move_it_in_display_line_to (struct it *, ptrdiff_t, int,
                                   enum move_operation_enum);
  void move_it_vertically_backward (struct it *, int);
  static void init_to_row_start (struct it *, struct window *,
@@@ -912,20 -902,20 +912,20 @@@ static int init_to_row_end (struct it *
  static void back_to_previous_line_start (struct it *);
  static int forward_to_next_line_start (struct it *, int *, struct bidi_it *);
  static struct text_pos string_pos_nchars_ahead (struct text_pos,
 -                                                Lisp_Object, EMACS_INT);
 -static struct text_pos string_pos (EMACS_INT, Lisp_Object);
 -static struct text_pos c_string_pos (EMACS_INT, const char *, int);
 -static EMACS_INT number_of_chars (const char *, int);
 +                                                Lisp_Object, ptrdiff_t);
 +static struct text_pos string_pos (ptrdiff_t, Lisp_Object);
 +static struct text_pos c_string_pos (ptrdiff_t, const char *, int);
 +static ptrdiff_t number_of_chars (const char *, int);
  static void compute_stop_pos (struct it *);
  static void compute_string_pos (struct text_pos *, struct text_pos,
                                  Lisp_Object);
  static int face_before_or_after_it_pos (struct it *, int);
 -static EMACS_INT next_overlay_change (EMACS_INT);
 +static ptrdiff_t next_overlay_change (ptrdiff_t);
  static int handle_display_spec (struct it *, Lisp_Object, Lisp_Object,
 -                              Lisp_Object, struct text_pos *, EMACS_INT, int);
 +                              Lisp_Object, struct text_pos *, ptrdiff_t, int);
  static int handle_single_display_spec (struct it *, Lisp_Object,
                                         Lisp_Object, Lisp_Object,
 -                                       struct text_pos *, EMACS_INT, int, int);
 +                                       struct text_pos *, ptrdiff_t, int, int);
  static int underlying_face_id (struct it *);
  static int in_ellipses_for_invisible_text_p (struct display_pos *,
                                               struct window *);
@@@ -1257,7 -1247,7 +1257,7 @@@ string_from_display_spec (Lisp_Object s
     Set *ROWH and *VPOS to row's visible height and VPOS (row number).  */
  
  int
 -pos_visible_p (struct window *w, EMACS_INT charpos, int *x, int *y,
 +pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
               int *rtop, int *rbot, int *rowh, int *vpos)
  {
    struct it it;
@@@ -1603,7 -1593,7 +1603,7 @@@ string_char_and_length (const unsigned 
     in STRING, return the position NCHARS ahead (NCHARS >= 0).  */
  
  static struct text_pos
 -string_pos_nchars_ahead (struct text_pos pos, Lisp_Object string, EMACS_INT nchars)
 +string_pos_nchars_ahead (struct text_pos pos, Lisp_Object string, ptrdiff_t nchars)
  {
    xassert (STRINGP (string) && nchars >= 0);
  
     for character position CHARPOS in STRING.  */
  
  static inline struct text_pos
 -string_pos (EMACS_INT charpos, Lisp_Object string)
 +string_pos (ptrdiff_t charpos, Lisp_Object string)
  {
    struct text_pos pos;
    xassert (STRINGP (string));
     means recognize multibyte characters.  */
  
  static struct text_pos
 -c_string_pos (EMACS_INT charpos, const char *s, int multibyte_p)
 +c_string_pos (ptrdiff_t charpos, const char *s, int multibyte_p)
  {
    struct text_pos pos;
  
  /* Value is the number of characters in C string S.  MULTIBYTE_P
     non-zero means recognize multibyte characters.  */
  
 -static EMACS_INT
 +static ptrdiff_t
  number_of_chars (const char *s, int multibyte_p)
  {
 -  EMACS_INT nchars;
 +  ptrdiff_t nchars;
  
    if (multibyte_p)
      {
 -      EMACS_INT rest = strlen (s);
 +      ptrdiff_t rest = strlen (s);
        int len;
        const unsigned char *p = (const unsigned char *) s;
  
@@@ -2399,7 -2389,7 +2399,7 @@@ safe_call (ptrdiff_t nargs, Lisp_Objec
      val = Qnil;
    else
      {
 -      int count = SPECPDL_INDEX ();
 +      ptrdiff_t count = SPECPDL_INDEX ();
        struct gcpro gcpro1;
  
        GCPRO1 (args[0]);
@@@ -2549,7 -2539,7 +2549,7 @@@ check_window_end (struct window *w
  
  void
  init_iterator (struct it *it, struct window *w,
 -             EMACS_INT charpos, EMACS_INT bytepos,
 +             ptrdiff_t charpos, ptrdiff_t bytepos,
               struct glyph_row *row, enum face_id base_face_id)
  {
    int highlight_region_p;
       is invisible.  >0 means lines indented more than this value are
       invisible.  */
    it->selective = (INTEGERP (BVAR (current_buffer, selective_display))
 -                 ? XINT (BVAR (current_buffer, selective_display))
 +                 ? clip_to_bounds (-1, XINT (BVAR (current_buffer,
 +                                                   selective_display)),
 +                                   PTRDIFF_MAX)
                   : (!NILP (BVAR (current_buffer, selective_display))
                      ? -1 : 0));
    it->selective_display_ellipsis_p
              && WINDOWP (minibuf_selected_window)
              && w == XWINDOW (minibuf_selected_window))))
      {
 -      EMACS_INT markpos = marker_position (BVAR (current_buffer, mark));
 +      ptrdiff_t markpos = marker_position (BVAR (current_buffer, mark));
        it->region_beg_charpos = min (PT, markpos);
        it->region_end_charpos = max (PT, markpos);
      }
      it->redisplay_end_trigger_charpos
        = marker_position (w->redisplay_end_trigger);
    else if (INTEGERP (w->redisplay_end_trigger))
 -    it->redisplay_end_trigger_charpos = XINT (w->redisplay_end_trigger);
 +    it->redisplay_end_trigger_charpos =
 +      clip_to_bounds (PTRDIFF_MIN, XINT (w->redisplay_end_trigger), PTRDIFF_MAX);
  
    it->tab_width = SANE_TAB_WIDTH (current_buffer);
  
@@@ -2950,7 -2937,7 +2950,7 @@@ in_ellipses_for_invisible_text_p (struc
  {
    Lisp_Object prop, window;
    int ellipses_p = 0;
 -  EMACS_INT charpos = CHARPOS (pos->pos);
 +  ptrdiff_t charpos = CHARPOS (pos->pos);
  
    /* If POS specifies a position in a display vector, this might
       be for an ellipsis displayed for invisible text.  We won't
  static int
  init_from_display_pos (struct it *it, struct window *w, struct display_pos *pos)
  {
 -  EMACS_INT charpos = CHARPOS (pos->pos), bytepos = BYTEPOS (pos->pos);
 +  ptrdiff_t charpos = CHARPOS (pos->pos), bytepos = BYTEPOS (pos->pos);
    int i, overlay_strings_with_newlines = 0;
  
    /* If POS specifies a position in a display vector, this might
         pos->overlay_string_index is in IT->overlay_strings.  */
        if (pos->overlay_string_index >= OVERLAY_STRING_CHUNK_SIZE)
        {
 -        int n = pos->overlay_string_index / OVERLAY_STRING_CHUNK_SIZE;
 +        ptrdiff_t n = pos->overlay_string_index / OVERLAY_STRING_CHUNK_SIZE;
          it->current.overlay_string_index = 0;
          while (n--)
            {
@@@ -3237,7 -3224,7 +3237,7 @@@ compute_stop_pos (struct it *it
  {
    register INTERVAL iv, next_iv;
    Lisp_Object object, limit, position;
 -  EMACS_INT charpos, bytepos;
 +  ptrdiff_t charpos, bytepos;
  
    if (STRINGP (it->string))
      {
      }
    else
      {
 -      EMACS_INT pos;
 +      ptrdiff_t pos;
  
        /* If end_charpos is out of range for some reason, such as a
         misbehaving display function, rationalize it (Bug#5984).  */
  
    if (it->cmp_it.id < 0)
      {
 -      EMACS_INT stoppos = it->end_charpos;
 +      ptrdiff_t stoppos = it->end_charpos;
  
        if (it->bidi_p && it->bidi_it.scan_dir < 0)
        stoppos = -1;
     follows.  This is like `next-overlay-change' but doesn't use
     xmalloc.  */
  
 -static EMACS_INT
 -next_overlay_change (EMACS_INT pos)
 +static ptrdiff_t
 +next_overlay_change (ptrdiff_t pos)
  {
    ptrdiff_t i, noverlays;
 -  EMACS_INT endpos;
 +  ptrdiff_t endpos;
    Lisp_Object *overlays;
  
    /* Get all overlays at the given position.  */
    for (i = 0; i < noverlays; ++i)
      {
        Lisp_Object oend;
 -      EMACS_INT oendpos;
 +      ptrdiff_t oendpos;
  
        oend = OVERLAY_END (overlays[i]);
        oendpos = OVERLAY_POSITION (oend);
     strings, non-zero otherwise.  It is set to 2 if the display string
     uses any kind of `(space ...)' spec that will produce a stretch of
     white space in the text area.  */
 -EMACS_INT
 +ptrdiff_t
  compute_display_string_pos (struct text_pos *position,
                            struct bidi_string_data *string,
                            int frame_window_p, int *disp_prop)
      (string && STRINGP (string->lstring)) ? string->lstring : Qnil;
    Lisp_Object pos, spec, limpos;
    int string_p = (string && (STRINGP (string->lstring) || string->s));
 -  EMACS_INT eob = string_p ? string->schars : ZV;
 -  EMACS_INT begb = string_p ? 0 : BEGV;
 -  EMACS_INT bufpos, charpos = CHARPOS (*position);
 -  EMACS_INT lim =
 +  ptrdiff_t eob = string_p ? string->schars : ZV;
 +  ptrdiff_t begb = string_p ? 0 : BEGV;
 +  ptrdiff_t bufpos, charpos = CHARPOS (*position);
 +  ptrdiff_t lim =
      (charpos < eob - MAX_DISP_SCAN) ? charpos + MAX_DISP_SCAN : eob;
    struct text_pos tpos;
    int rv = 0;
     return -1.  A display string is either an overlay with `display'
     property whose value is a string or a `display' text property whose
     value is a string.  */
 -EMACS_INT
 -compute_display_string_end (EMACS_INT charpos, struct bidi_string_data *string)
 +ptrdiff_t
 +compute_display_string_end (ptrdiff_t charpos, struct bidi_string_data *string)
  {
    /* OBJECT = nil means current buffer.  */
    Lisp_Object object =
      (string && STRINGP (string->lstring)) ? string->lstring : Qnil;
    Lisp_Object pos = make_number (charpos);
 -  EMACS_INT eob =
 +  ptrdiff_t eob =
      (STRINGP (object) || (string && string->s)) ? string->schars : ZV;
  
    if (charpos >= eob || (string->s && !STRINGP (object)))
@@@ -3548,7 -3535,7 +3548,7 @@@ handle_fontified_prop (struct it *it
             no amount of fontifying will be able to change it.  */
          NILP (prop) && IT_CHARPOS (*it) < Z))
      {
 -      int count = SPECPDL_INDEX ();
 +      ptrdiff_t count = SPECPDL_INDEX ();
        Lisp_Object val;
        struct buffer *obuf = current_buffer;
        int begv = BEGV, zv = ZV;
@@@ -3645,7 -3632,7 +3645,7 @@@ static enum prop_handle
  handle_face_prop (struct it *it)
  {
    int new_face_id;
 -  EMACS_INT next_stop;
 +  ptrdiff_t next_stop;
  
    if (!STRINGP (it->string))
      {
    else
      {
        int base_face_id;
 -      EMACS_INT bufpos;
 +      ptrdiff_t bufpos;
        int i;
        Lisp_Object from_overlay
        = (it->current.overlay_string_index >= 0
@@@ -3806,7 -3793,7 +3806,7 @@@ static in
  face_before_or_after_it_pos (struct it *it, int before_p)
  {
    int face_id, limit;
 -  EMACS_INT next_check_charpos;
 +  ptrdiff_t next_check_charpos;
    struct it it_copy;
    void *it_copy_data = NULL;
  
  
    if (STRINGP (it->string))
      {
 -      EMACS_INT bufpos, charpos;
 +      ptrdiff_t bufpos, charpos;
        int base_face_id;
  
        /* No face change past the end of the string (for the case
@@@ -4027,7 -4014,7 +4027,7 @@@ handle_invisible_prop (struct it *it
        if (!NILP (prop)
          && IT_STRING_CHARPOS (*it) < it->end_charpos)
        {
 -        EMACS_INT endpos;
 +        ptrdiff_t endpos;
  
          handled = HANDLED_RECOMPUTE_PROPS;
  
              && (endpos = XFASTINT (end_charpos)) < XFASTINT (limit))
            {
              struct text_pos old;
 -            EMACS_INT oldpos;
 +            ptrdiff_t oldpos;
  
              old = it->current.string_pos;
              oldpos = CHARPOS (old);
    else
      {
        int invis_p;
 -      EMACS_INT newpos, next_stop, start_charpos, tem;
 +      ptrdiff_t newpos, next_stop, start_charpos, tem;
        Lisp_Object pos, prop, overlay;
  
        /* First of all, is there invisible text at this position?  */
          /* The position newpos is now either ZV or on visible text.  */
          if (it->bidi_p)
            {
 -            EMACS_INT bpos = CHAR_TO_BYTE (newpos);
 +            ptrdiff_t bpos = CHAR_TO_BYTE (newpos);
              int on_newline =
                bpos == ZV_BYTE || FETCH_BYTE (bpos) == '\n';
              int after_newline =
@@@ -4337,7 -4324,7 +4337,7 @@@ handle_display_prop (struct it *it
  {
    Lisp_Object propval, object, overlay;
    struct text_pos *position;
 -  EMACS_INT bufpos;
 +  ptrdiff_t bufpos;
    /* Nonzero if some property replaces the display of the text itself.  */
    int display_replaced_p = 0;
  
  static int
  handle_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
                     Lisp_Object overlay, struct text_pos *position,
 -                   EMACS_INT bufpos, int frame_window_p)
 +                   ptrdiff_t bufpos, int frame_window_p)
  {
    int replacing_p = 0;
    int rv;
      }
    else if (VECTORP (spec))
      {
 -      int i;
 +      ptrdiff_t i;
        for (i = 0; i < ASIZE (spec); ++i)
        if ((rv = handle_single_display_spec (it, AREF (spec, i), object,
                                              overlay, position, bufpos,
@@@ -4509,7 -4496,7 +4509,7 @@@ display_prop_end (struct it *it, Lisp_O
  static int
  handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
                            Lisp_Object overlay, struct text_pos *position,
 -                          EMACS_INT bufpos, int display_replaced_p,
 +                          ptrdiff_t bufpos, int display_replaced_p,
                            int frame_window_p)
  {
    Lisp_Object form;
  
    if (!NILP (form) && !EQ (form, Qt))
      {
 -      int count = SPECPDL_INDEX ();
 +      ptrdiff_t count = SPECPDL_INDEX ();
        struct gcpro gcpro1;
  
        /* Bind `object' to the object having the `display' property, a
                  && (EQ (XCAR (it->font_height), Qplus)
                      || EQ (XCAR (it->font_height), Qminus))
                  && CONSP (XCDR (it->font_height))
 -                && INTEGERP (XCAR (XCDR (it->font_height))))
 +                && RANGED_INTEGERP (0, XCAR (XCDR (it->font_height)), INT_MAX))
                {
                  /* `(+ N)' or `(- N)' where N is an integer.  */
                  int steps = XINT (XCAR (XCDR (it->font_height)));
                {
                  /* Evaluate IT->font_height with `height' bound to the
                     current specified height to get the new height.  */
 -                int count = SPECPDL_INDEX ();
 +                ptrdiff_t count = SPECPDL_INDEX ();
  
                  specbind (Qheight, face->lface[LFACE_HEIGHT_INDEX]);
                  value = safe_eval (it->font_height);
  
  int
  display_prop_intangible_p (Lisp_Object prop, Lisp_Object overlay,
 -                         EMACS_INT charpos, EMACS_INT bytepos)
 +                         ptrdiff_t charpos, ptrdiff_t bytepos)
  {
    int frame_window_p = FRAME_WINDOW_P (XFRAME (selected_frame));
    struct text_pos position;
@@@ -5035,7 -5022,7 +5035,7 @@@ display_prop_string_p (Lisp_Object prop
    else if (VECTORP (prop))
      {
        /* A vector of sub-properties.  */
 -      int i;
 +      ptrdiff_t i;
        for (i = 0; i < ASIZE (prop); ++i)
        if (single_display_spec_string_p (AREF (prop, i), string))
          return 1;
     This function may only use code that doesn't eval because it is
     called asynchronously from note_mouse_highlight.  */
  
 -static EMACS_INT
 +static ptrdiff_t
  string_buffer_position_lim (Lisp_Object string,
 -                          EMACS_INT from, EMACS_INT to, int back_p)
 +                          ptrdiff_t from, ptrdiff_t to, int back_p)
  {
    Lisp_Object limit, prop, pos;
    int found = 0;
     This function may only use code that doesn't eval because it is
     called asynchronously from note_mouse_highlight.  */
  
 -static EMACS_INT
 -string_buffer_position (Lisp_Object string, EMACS_INT around_charpos)
 +static ptrdiff_t
 +string_buffer_position (Lisp_Object string, ptrdiff_t around_charpos)
  {
    const int MAX_DISTANCE = 1000;
 -  EMACS_INT found = string_buffer_position_lim (string, around_charpos,
 +  ptrdiff_t found = string_buffer_position_lim (string, around_charpos,
                                                around_charpos + MAX_DISTANCE,
                                                0);
  
@@@ -5131,7 -5118,7 +5131,7 @@@ static enum prop_handle
  handle_composition_prop (struct it *it)
  {
    Lisp_Object prop, string;
 -  EMACS_INT pos, pos_byte, start, end;
 +  ptrdiff_t pos, pos_byte, start, end;
  
    if (STRINGP (it->string))
      {
@@@ -5197,7 -5184,7 +5197,7 @@@ struct overlay_entr
  {
    Lisp_Object overlay;
    Lisp_Object string;
 -  int priority;
 +  EMACS_INT priority;
    int after_string_p;
  };
  
@@@ -5329,17 -5316,12 +5329,17 @@@ compare_overlay_entries (const void *e1
        else
        result = entry1->after_string_p ? -1 : 1;
      }
 -  else if (entry1->after_string_p)
 -    /* After-strings sorted in order of decreasing priority.  */
 -    result = entry2->priority - entry1->priority;
 +  else if (entry1->priority != entry2->priority)
 +    {
 +      if (entry1->after_string_p)
 +      /* After-strings sorted in order of decreasing priority.  */
 +      result = entry2->priority < entry1->priority ? -1 : 1;
 +      else
 +      /* Before-strings sorted in order of increasing priority.  */
 +      result = entry1->priority < entry2->priority ? -1 : 1;
 +    }
    else
 -    /* Before-strings sorted in order of increasing priority.  */
 -    result = entry1->priority - entry2->priority;
 +    result = 0;
  
    return result;
  }
     compare_overlay_entries.  */
  
  static void
 -load_overlay_strings (struct it *it, EMACS_INT charpos)
 +load_overlay_strings (struct it *it, ptrdiff_t charpos)
  {
    Lisp_Object overlay, window, str, invisible;
    struct Lisp_Overlay *ov;
 -  EMACS_INT start, end;
 -  int size = 20;
 -  int n = 0, i, j, invis_p;
 +  ptrdiff_t start, end;
 +  ptrdiff_t size = 20;
 +  ptrdiff_t n = 0, i, j;
 +  int invis_p;
    struct overlay_entry *entries
      = (struct overlay_entry *) alloca (size * sizeof *entries);
 +  USE_SAFE_ALLOCA;
  
    if (charpos <= 0)
      charpos = IT_CHARPOS (*it);
                                                                        \
        if (n == size)                                                  \
        {                                                               \
 -        int new_size = 2 * size;                                      \
          struct overlay_entry *old = entries;                          \
 -        entries =                                                     \
 -            (struct overlay_entry *) alloca (new_size                 \
 -                                           * sizeof *entries);        \
 +        SAFE_NALLOCA (entries, 2, size);                              \
          memcpy (entries, old, size * sizeof *entries);                \
 -        size = new_size;                                              \
 +        size *= 2;                                                    \
        }                                                               \
                                                                        \
        entries[n].string = (STRING);                                   \
      }
  
    CHECK_IT (it);
 +  SAFE_FREE ();
  }
  
  
     least one overlay string was found.  */
  
  static int
 -get_overlay_strings_1 (struct it *it, EMACS_INT charpos, int compute_stop_p)
 +get_overlay_strings_1 (struct it *it, ptrdiff_t charpos, int compute_stop_p)
  {
    /* Get the first OVERLAY_STRING_CHUNK_SIZE overlay strings to
       process.  This fills IT->overlay_strings with strings, and sets
        /* Set up the bidi iterator for this overlay string.  */
        if (it->bidi_p)
        {
 -        EMACS_INT pos = (charpos > 0 ? charpos : IT_CHARPOS (*it));
 +        ptrdiff_t pos = (charpos > 0 ? charpos : IT_CHARPOS (*it));
  
          it->bidi_it.string.lstring = it->string;
          it->bidi_it.string.s = NULL;
  }
  
  static int
 -get_overlay_strings (struct it *it, EMACS_INT charpos)
 +get_overlay_strings (struct it *it, ptrdiff_t charpos)
  {
    it->string = Qnil;
    it->method = GET_FROM_BUFFER;
@@@ -5684,8 -5666,8 +5684,8 @@@ static voi
  iterate_out_of_display_property (struct it *it)
  {
    int buffer_p = !STRINGP (it->string);
 -  EMACS_INT eob = (buffer_p ? ZV : it->end_charpos);
 -  EMACS_INT bob = (buffer_p ? BEGV : 0);
 +  ptrdiff_t eob = (buffer_p ? ZV : it->end_charpos);
 +  ptrdiff_t bob = (buffer_p ? BEGV : 0);
  
    xassert (eob >= CHARPOS (it->position) && CHARPOS (it->position) >= bob);
  
@@@ -5847,7 -5829,7 +5847,7 @@@ static in
  forward_to_next_line_start (struct it *it, int *skipped_p,
                            struct bidi_it *bidi_it_prev)
  {
 -  EMACS_INT old_selective;
 +  ptrdiff_t old_selective;
    int newline_found_p, n;
    const int MAX_NEWLINE_DISTANCE = 500;
  
       short-cut.  */
    if (!newline_found_p)
      {
 -      EMACS_INT start = IT_CHARPOS (*it);
 -      EMACS_INT limit = find_next_newline_no_quit (start, 1);
 +      ptrdiff_t start = IT_CHARPOS (*it);
 +      ptrdiff_t limit = find_next_newline_no_quit (start, 1);
        Lisp_Object pos;
  
        xassert (!STRINGP (it->string));
@@@ -5988,8 -5970,8 +5988,8 @@@ back_to_previous_visible_line_start (st
        {
        struct it it2;
        void *it2data = NULL;
 -      EMACS_INT pos;
 -      EMACS_INT beg, end;
 +      ptrdiff_t pos;
 +      ptrdiff_t beg, end;
        Lisp_Object val, overlay;
  
        SAVE_IT (it2, *it, it2data);
@@@ -6142,7 -6124,7 +6142,7 @@@ reseat_at_next_visible_line_start (stru
  static void
  reseat (struct it *it, struct text_pos pos, int force_p)
  {
 -  EMACS_INT original_pos = IT_CHARPOS (*it);
 +  ptrdiff_t original_pos = IT_CHARPOS (*it);
  
    reseat_1 (it, pos, 0);
  
@@@ -6252,7 -6234,7 +6252,7 @@@ reseat_1 (struct it *it, struct text_po
  
  static void
  reseat_to_string (struct it *it, const char *s, Lisp_Object string,
 -                EMACS_INT charpos, EMACS_INT precision, int field_width,
 +                ptrdiff_t charpos, ptrdiff_t precision, int field_width,
                  int multibyte)
  {
    /* No region in strings.  */
      }
    if (s == NULL && it->multibyte_p)
      {
 -      EMACS_INT endpos = SCHARS (it->string);
 +      ptrdiff_t endpos = SCHARS (it->string);
        if (endpos > it->end_charpos)
        endpos = it->end_charpos;
        composition_compute_stop_pos (&it->cmp_it, charpos, -1, endpos,
@@@ -6478,11 -6460,11 +6478,11 @@@ lookup_glyphless_char_display (int c, s
     end of buffer (or C string) is reached.  */
  
  static struct frame *last_escape_glyph_frame = NULL;
 -static unsigned last_escape_glyph_face_id = (1 << FACE_ID_BITS);
 +static int last_escape_glyph_face_id = (1 << FACE_ID_BITS);
  static int last_escape_glyph_merged_face_id = 0;
  
  struct frame *last_glyphless_glyph_frame = NULL;
 -unsigned last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
 +int last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
  int last_glyphless_glyph_merged_face_id = 0;
  
  static int
@@@ -6614,7 -6596,7 +6614,7 @@@ get_next_display_element (struct it *it
              Lisp_Object gc;
              int ctl_len;
              int face_id;
 -            EMACS_INT lface_id = 0;
 +            int lface_id = 0;
              int escape_glyph;
  
              /* Handle control characters with ^.  */
                  g = '^';           /* default glyph for Control */
                  /* Set IT->ctl_chars[0] to the glyph for `^'.  */
                  if (it->dp
 -                    && (gc = DISP_CTRL_GLYPH (it->dp), GLYPH_CODE_P (gc))
 -                    && GLYPH_CODE_CHAR_VALID_P (gc))
 +                    && (gc = DISP_CTRL_GLYPH (it->dp), GLYPH_CODE_P (gc)))
                    {
                      g = GLYPH_CODE_CHAR (gc);
                      lface_id = GLYPH_CODE_FACE (gc);
              escape_glyph = '\\';
  
              if (it->dp
 -                && (gc = DISP_ESCAPE_GLYPH (it->dp), GLYPH_CODE_P (gc))
 -                && GLYPH_CODE_CHAR_VALID_P (gc))
 +                && (gc = DISP_ESCAPE_GLYPH (it->dp), GLYPH_CODE_P (gc)))
                {
                  escape_glyph = GLYPH_CODE_CHAR (gc);
                  lface_id = GLYPH_CODE_FACE (gc);
        }
        else
        {
 -        EMACS_INT pos = (it->s ? -1
 +        ptrdiff_t pos = (it->s ? -1
                     : STRINGP (it->string) ? IT_STRING_CHARPOS (*it)
                     : IT_CHARPOS (*it));
          int c;
                       && (it->current.overlay_string_index
                           == it->n_overlay_strings - 1))
                {
 -                EMACS_INT ignore;
 +                ptrdiff_t ignore;
                  int next_face_id;
                  struct text_pos pos = it->current.pos;
                  INC_TEXT_POS (pos, it->multibyte_p);
@@@ -6938,7 -6922,7 +6938,7 @@@ set_iterator_to_next (struct it *it, in
                {
                  /* No more grapheme clusters in this composition.
                     Find the next stop position.  */
 -                EMACS_INT stop = it->end_charpos;
 +                ptrdiff_t stop = it->end_charpos;
                  if (it->bidi_it.scan_dir < 0)
                    /* Now we are scanning backward and don't know
                       where to stop.  */
                {
                  /* No more grapheme clusters in this composition.
                     Find the next stop position.  */
 -                EMACS_INT stop = it->end_charpos;
 +                ptrdiff_t stop = it->end_charpos;
                  if (it->bidi_it.scan_dir < 0)
                    /* Now we are scanning backward and don't know
                       where to stop.  */
                {
                  /* As the scan direction was changed, we must
                     re-compute the stop position for composition.  */
 -                EMACS_INT stop = it->end_charpos;
 +                ptrdiff_t stop = it->end_charpos;
                  if (it->bidi_it.scan_dir < 0)
                    stop = -1;
                  composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
                it->cmp_it.from = it->cmp_it.to;
              else
                {
 -                EMACS_INT stop = it->end_charpos;
 +                ptrdiff_t stop = it->end_charpos;
                  if (it->bidi_it.scan_dir < 0)
                    stop = -1;
                  composition_compute_stop_pos (&it->cmp_it,
                it->cmp_it.to = it->cmp_it.from;
              else
                {
 -                EMACS_INT stop = it->end_charpos;
 +                ptrdiff_t stop = it->end_charpos;
                  if (it->bidi_it.scan_dir < 0)
                    stop = -1;
                  composition_compute_stop_pos (&it->cmp_it,
              IT_STRING_CHARPOS (*it) = it->bidi_it.charpos;
              if (prev_scan_dir != it->bidi_it.scan_dir)
                {
 -                EMACS_INT stop = it->end_charpos;
 +                ptrdiff_t stop = it->end_charpos;
  
                  if (it->bidi_it.scan_dir < 0)
                    stop = -1;
@@@ -7266,7 -7250,7 +7266,7 @@@ next_element_from_display_vector (struc
       That seemed totally bogus - so I changed it...  */
    gc = it->dpvec[it->current.dpvec_index];
  
 -  if (GLYPH_CODE_P (gc) && GLYPH_CODE_CHAR_VALID_P (gc))
 +  if (GLYPH_CODE_P (gc))
      {
        it->c = GLYPH_CODE_CHAR (gc);
        it->len = CHAR_BYTES (it->c);
        it->face_id = it->dpvec_face_id;
        else
        {
 -        EMACS_INT lface_id = GLYPH_CODE_FACE (gc);
 +        int lface_id = GLYPH_CODE_FACE (gc);
          if (lface_id > 0)
            it->face_id = merge_faces (it->f, Qt, lface_id,
                                       it->saved_face_id);
@@@ -7301,8 -7285,8 +7301,8 @@@ static voi
  get_visually_first_element (struct it *it)
  {
    int string_p = STRINGP (it->string) || it->s;
 -  EMACS_INT eob = (string_p ? it->bidi_it.string.schars : ZV);
 -  EMACS_INT bob = (string_p ? 0 : BEGV);
 +  ptrdiff_t eob = (string_p ? it->bidi_it.string.schars : ZV);
 +  ptrdiff_t bob = (string_p ? 0 : BEGV);
  
    if (STRINGP (it->string))
      {
      }
    else
      {
 -      EMACS_INT orig_bytepos = it->bidi_it.bytepos;
 +      ptrdiff_t orig_bytepos = it->bidi_it.bytepos;
  
        /* We need to prime the bidi iterator starting at the line's or
         string's beginning, before we will be able to produce the
  
    if (STRINGP (it->string) || !it->s)
      {
 -      EMACS_INT stop, charpos, bytepos;
 +      ptrdiff_t stop, charpos, bytepos;
  
        if (STRINGP (it->string))
        {
@@@ -7673,10 -7657,10 +7673,10 @@@ compute_stop_pos_backwards (struct it *
    struct text_pos pos;
    struct display_pos save_current = it->current;
    struct text_pos save_position = it->position;
 -  EMACS_INT charpos = IT_CHARPOS (*it);
 -  EMACS_INT where_we_are = charpos;
 -  EMACS_INT save_stop_pos = it->stop_charpos;
 -  EMACS_INT save_end_pos = it->end_charpos;
 +  ptrdiff_t charpos = IT_CHARPOS (*it);
 +  ptrdiff_t where_we_are = charpos;
 +  ptrdiff_t save_stop_pos = it->stop_charpos;
 +  ptrdiff_t save_end_pos = it->end_charpos;
  
    xassert (NILP (it->string) && !it->s);
    xassert (it->bidi_p);
     position.  */
  
  static void
 -handle_stop_backwards (struct it *it, EMACS_INT charpos)
 +handle_stop_backwards (struct it *it, ptrdiff_t charpos)
  {
    int bufp = !STRINGP (it->string);
 -  EMACS_INT where_we_are = (bufp ? IT_CHARPOS (*it) : IT_STRING_CHARPOS (*it));
 +  ptrdiff_t where_we_are = (bufp ? IT_CHARPOS (*it) : IT_STRING_CHARPOS (*it));
    struct display_pos save_current = it->current;
    struct text_pos save_position = it->position;
    struct text_pos pos1;
 -  EMACS_INT next_stop;
 +  ptrdiff_t next_stop;
  
    /* Scan in strict logical order.  */
    xassert (it->bidi_p);
@@@ -7865,7 -7849,7 +7865,7 @@@ next_element_from_buffer (struct it *it
        /* No face changes, overlays etc. in sight, so just return a
         character from current_buffer.  */
        unsigned char *p;
 -      EMACS_INT stop;
 +      ptrdiff_t stop;
  
        /* Maybe run the redisplay end trigger hook.  Performance note:
         This doesn't seem to cost measurable time.  */
@@@ -8054,7 -8038,7 +8054,7 @@@ next_element_from_composition (struct i
  
  static enum move_it_result
  move_it_in_display_line_to (struct it *it,
 -                          EMACS_INT to_charpos, int to_x,
 +                          ptrdiff_t to_charpos, int to_x,
                            enum move_operation_enum op)
  {
    enum move_it_result result = MOVE_UNDEFINED;
    void *ppos_data = NULL;
    int may_wrap = 0;
    enum it_method prev_method = it->method;
 -  EMACS_INT prev_pos = IT_CHARPOS (*it);
 +  ptrdiff_t prev_pos = IT_CHARPOS (*it);
    int saw_smaller_pos = prev_pos < to_charpos;
  
    /* Don't produce glyphs in produce_glyphs.  */
  /* For external use.  */
  void
  move_it_in_display_line (struct it *it,
 -                       EMACS_INT to_charpos, int to_x,
 +                       ptrdiff_t to_charpos, int to_x,
                         enum move_operation_enum op)
  {
    if (it->line_wrap == WORD_WRAP
     displayed to the right of TO_CHARPOS on the screen.  */
  
  void
 -move_it_to (struct it *it, EMACS_INT to_charpos, int to_x, int to_y, int to_vpos, int op)
 +move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos, int op)
  {
    enum move_it_result skip, skip2 = MOVE_X_REACHED;
    int line_height, line_start_x = 0, reached = 0;
                {
                  /* If TO_Y is in this line and TO_X was reached
                     above, we scanned too far.  We have to restore
-                    IT's settings to the ones before skipping.  */
+                    IT's settings to the ones before skipping.  But
+                    keep the more accurate values of max_ascent and
+                    max_descent we've found while skipping the rest
+                    of the line, for the sake of callers, such as
+                    pos_visible_p, that need to know the line
+                    height.  */
+                 int max_ascent = it->max_ascent;
+                 int max_descent = it->max_descent;
                  RESTORE_IT (it, &it_backup, backup_data);
+                 it->max_ascent = max_ascent;
+                 it->max_descent = max_descent;
                  reached = 6;
                }
              else
@@@ -8868,7 -8862,7 +8878,7 @@@ move_it_vertically_backward (struct it 
    int nlines, h;
    struct it it2, it3;
    void *it2data = NULL, *it3data = NULL;
 -  EMACS_INT start_pos;
 +  ptrdiff_t start_pos;
  
   move_further_back:
    xassert (dy >= 0);
          && IT_CHARPOS (*it) > BEGV
          && FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n')
        {
 -        EMACS_INT nl_pos =
 +        ptrdiff_t nl_pos =
            find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1);
  
          move_it_to (it, nl_pos, -1, -1, -1, MOVE_TO_POS);
@@@ -9060,7 -9054,7 +9070,7 @@@ move_it_past_eol (struct it *it
     truncate-lines nil.  */
  
  void
 -move_it_by_lines (struct it *it, int dvpos)
 +move_it_by_lines (struct it *it, ptrdiff_t dvpos)
  {
  
    /* The commented-out optimization uses vmotion on terminals.  This
      {
        struct it it2;
        void *it2data = NULL;
 -      EMACS_INT start_charpos, i;
 +      ptrdiff_t start_charpos, i;
  
        /* Start at the beginning of the screen line containing IT's
         position.  This may actually move vertically backwards,
@@@ -9195,7 -9189,7 +9205,7 @@@ add_to_log (const char *format, Lisp_Ob
    Lisp_Object args[3];
    Lisp_Object msg, fmt;
    char *buffer;
 -  EMACS_INT len;
 +  ptrdiff_t len;
    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
    USE_SAFE_ALLOCA;
  
@@@ -9244,7 -9238,7 +9254,7 @@@ message_log_maybe_newline (void
     so the buffer M must NOT point to a Lisp string.  */
  
  void
 -message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte)
 +message_dolog (const char *m, ptrdiff_t nbytes, int nlflag, int multibyte)
  {
    const unsigned char *msg = (const unsigned char *) m;
  
        struct buffer *oldbuf;
        Lisp_Object oldpoint, oldbegv, oldzv;
        int old_windows_or_buffers_changed = windows_or_buffers_changed;
 -      EMACS_INT point_at_end = 0;
 -      EMACS_INT zv_at_end = 0;
 +      ptrdiff_t point_at_end = 0;
 +      ptrdiff_t zv_at_end = 0;
        Lisp_Object old_deactivate_mark, tem;
        struct gcpro gcpro1;
  
        if (multibyte
          && NILP (BVAR (current_buffer, enable_multibyte_characters)))
        {
 -        EMACS_INT i;
 +        ptrdiff_t i;
          int c, char_bytes;
          char work[1];
  
        else if (! multibyte
               && ! NILP (BVAR (current_buffer, enable_multibyte_characters)))
        {
 -        EMACS_INT i;
 +        ptrdiff_t i;
          int c, char_bytes;
          unsigned char str[MAX_MULTIBYTE_LENGTH];
          /* Convert a single-byte string to multibyte
  
        if (nlflag)
        {
 -        EMACS_INT this_bol, this_bol_byte, prev_bol, prev_bol_byte;
 +        ptrdiff_t this_bol, this_bol_byte, prev_bol, prev_bol_byte;
          printmax_t dups;
          insert_1 ("\n", 1, 1, 0, 0);
  
     value N > 1 if we should also append " [N times]".  */
  
  static intmax_t
 -message_log_check_duplicate (EMACS_INT prev_bol_byte, EMACS_INT this_bol_byte)
 +message_log_check_duplicate (ptrdiff_t prev_bol_byte, ptrdiff_t this_bol_byte)
  {
 -  EMACS_INT i;
 -  EMACS_INT len = Z_BYTE - 1 - this_bol_byte;
 +  ptrdiff_t i;
 +  ptrdiff_t len = Z_BYTE - 1 - this_bol_byte;
    int seen_dots = 0;
    unsigned char *p1 = BUF_BYTE_ADDRESS (current_buffer, prev_bol_byte);
    unsigned char *p2 = BUF_BYTE_ADDRESS (current_buffer, this_bol_byte);
     This may GC, so the buffer M must NOT point to a Lisp string.  */
  
  void
 -message2 (const char *m, EMACS_INT nbytes, int multibyte)
 +message2 (const char *m, ptrdiff_t nbytes, int multibyte)
  {
    /* First flush out any partial line written with print.  */
    message_log_maybe_newline ();
  /* The non-logging counterpart of message2.  */
  
  void
 -message2_nolog (const char *m, EMACS_INT nbytes, int multibyte)
 +message2_nolog (const char *m, ptrdiff_t nbytes, int multibyte)
  {
    struct frame *sf = SELECTED_FRAME ();
    message_enable_multibyte = multibyte;
     This function cancels echoing.  */
  
  void
 -message3 (Lisp_Object m, EMACS_INT nbytes, int multibyte)
 +message3 (Lisp_Object m, ptrdiff_t nbytes, int multibyte)
  {
    struct gcpro gcpro1;
  
     and make this cancel echoing.  */
  
  void
 -message3_nolog (Lisp_Object m, EMACS_INT nbytes, int multibyte)
 +message3_nolog (Lisp_Object m, ptrdiff_t nbytes, int multibyte)
  {
    struct frame *sf = SELECTED_FRAME ();
    message_enable_multibyte = multibyte;
@@@ -9860,12 -9854,12 +9870,12 @@@ ensure_echo_area_buffers (void
  
  static int
  with_echo_area_buffer (struct window *w, int which,
 -                     int (*fn) (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT),
 -                     EMACS_INT a1, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4)
 +                     int (*fn) (ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t),
 +                     ptrdiff_t a1, Lisp_Object a2, ptrdiff_t a3, ptrdiff_t a4)
  {
    Lisp_Object buffer;
    int this_one, the_other, clear_buffer_p, rc;
 -  int count = SPECPDL_INDEX ();
 +  ptrdiff_t count = SPECPDL_INDEX ();
  
    /* If buffers aren't live, make new ones.  */
    ensure_echo_area_buffers ();
@@@ -10041,7 -10035,7 +10051,7 @@@ setup_echo_area_for_printing (int multi
  
        if (Z > BEG)
        {
 -        int count = SPECPDL_INDEX ();
 +        ptrdiff_t count = SPECPDL_INDEX ();
          specbind (Qinhibit_read_only, Qt);
          /* Note that undo recording is always disabled.  */
          del_range (BEG, Z);
  static int
  display_echo_area (struct window *w)
  {
 -  int i, no_message_p, window_height_changed_p, count;
 +  int i, no_message_p, window_height_changed_p;
  
    /* Temporarily disable garbage collections while displaying the echo
       area.  This is done because a GC can print a message itself.
       That message would modify the echo area buffer's contents while a
       redisplay of the buffer is going on, and seriously confuse
       redisplay.  */
 -  count = inhibit_garbage_collection ();
 +  ptrdiff_t count = inhibit_garbage_collection ();
  
    /* If there is no message, we must call display_echo_area_1
       nevertheless because it resizes the window.  But we will have to
     Value is non-zero if height of W was changed.  */
  
  static int
 -display_echo_area_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4)
 +display_echo_area_1 (ptrdiff_t a1, Lisp_Object a2, ptrdiff_t a3, ptrdiff_t a4)
  {
    intptr_t i1 = a1;
    struct window *w = (struct window *) i1;
@@@ -10194,7 -10188,7 +10204,7 @@@ resize_echo_area_exactly (void
     resize_mini_window returns.  */
  
  static int
 -resize_mini_window_1 (EMACS_INT a1, Lisp_Object exactly, EMACS_INT a3, EMACS_INT a4)
 +resize_mini_window_1 (ptrdiff_t a1, Lisp_Object exactly, ptrdiff_t a3, ptrdiff_t a4)
  {
    intptr_t i1 = a1;
    return resize_mini_window ((struct window *) i1, !NILP (exactly));
@@@ -10244,8 -10238,7 +10254,8 @@@ resize_mini_window (struct window *w, i
        struct it it;
        struct window *root = XWINDOW (FRAME_ROOT_WINDOW (f));
        int total_height = WINDOW_TOTAL_LINES (root) + WINDOW_TOTAL_LINES (w);
 -      int height, max_height;
 +      int height;
 +      EMACS_INT max_height;
        int unit = FRAME_LINE_HEIGHT (f);
        struct text_pos start;
        struct buffer *old_current_buffer = NULL;
@@@ -10374,7 -10367,7 +10384,7 @@@ current_message (void
  
  
  static int
 -current_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4)
 +current_message_1 (ptrdiff_t a1, Lisp_Object a2, ptrdiff_t a3, ptrdiff_t a4)
  {
    intptr_t i1 = a1;
    Lisp_Object *msg = (Lisp_Object *) i1;
@@@ -10453,7 -10446,7 +10463,7 @@@ check_message_stack (void
     time we display it---but don't redisplay it now.  */
  
  void
 -truncate_echo_area (EMACS_INT nchars)
 +truncate_echo_area (ptrdiff_t nchars)
  {
    if (nchars == 0)
      echo_area_buffer[0] = Qnil;
     message to at most NCHARS characters.  */
  
  static int
 -truncate_message_1 (EMACS_INT nchars, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4)
 +truncate_message_1 (ptrdiff_t nchars, Lisp_Object a2, ptrdiff_t a3, ptrdiff_t a4)
  {
    if (BEG + nchars < Z)
      del_range (BEG + nchars, Z);
  
  static void
  set_message (const char *s, Lisp_Object string,
 -           EMACS_INT nbytes, int multibyte_p)
 +           ptrdiff_t nbytes, int multibyte_p)
  {
    message_enable_multibyte
      = ((s && multibyte_p)
     current.  */
  
  static int
 -set_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT nbytes, EMACS_INT multibyte_p)
 +set_message_1 (ptrdiff_t a1, Lisp_Object a2, ptrdiff_t nbytes, ptrdiff_t multibyte_p)
  {
    intptr_t i1 = a1;
    const char *s = (const char *) i1;
  
    if (STRINGP (string))
      {
 -      EMACS_INT nchars;
 +      ptrdiff_t nchars;
  
        if (nbytes == 0)
        nbytes = SBYTES (string);
        if (multibyte_p && NILP (BVAR (current_buffer, enable_multibyte_characters)))
        {
          /* Convert from multi-byte to single-byte.  */
 -        EMACS_INT i;
 +        ptrdiff_t i;
          int c, n;
          char work[1];
  
               && !NILP (BVAR (current_buffer, enable_multibyte_characters)))
        {
          /* Convert from single-byte to multi-byte.  */
 -        EMACS_INT i;
 +        ptrdiff_t i;
          int c, n;
          unsigned char str[MAX_MULTIBYTE_LENGTH];
  
@@@ -10723,7 -10716,7 +10733,7 @@@ echo_area_display (int update_frame_p
              /* Must update other windows.  Likewise as in other
                 cases, don't let this update be interrupted by
                 pending input.  */
 -            int count = SPECPDL_INDEX ();
 +            ptrdiff_t count = SPECPDL_INDEX ();
              specbind (Qredisplay_dont_pause, Qt);
              windows_or_buffers_changed = 1;
              redisplay_internal ();
@@@ -10900,7 -10893,7 +10910,7 @@@ store_mode_line_noprop (const char *str
  {
    const unsigned char *str = (const unsigned char *) string;
    int n = 0;
 -  EMACS_INT dummy, nbytes;
 +  ptrdiff_t dummy, nbytes;
  
    /* Copy at most PRECISION chars from STR.  */
    nbytes = strlen (string);
@@@ -10945,7 -10938,7 +10955,7 @@@ x_consider_frame_title (Lisp_Object fra
        char *title;
        ptrdiff_t len;
        struct it it;
 -      int count = SPECPDL_INDEX ();
 +      ptrdiff_t count = SPECPDL_INDEX ();
  
        for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
        {
@@@ -11048,7 -11041,7 +11058,7 @@@ prepare_menu_bars (void
    if (all_windows)
      {
        Lisp_Object tail, frame;
 -      int count = SPECPDL_INDEX ();
 +      ptrdiff_t count = SPECPDL_INDEX ();
        /* 1 means that update_menu_bar has run its hooks
         so any further calls to update_menu_bar shouldn't do so again.  */
        int menu_bar_hooks_run = 0;
@@@ -11165,7 -11158,7 +11175,7 @@@ update_menu_bar (struct frame *f, int s
              != !NILP (w->region_showing)))
        {
          struct buffer *prev = current_buffer;
 -        int count = SPECPDL_INDEX ();
 +        ptrdiff_t count = SPECPDL_INDEX ();
  
          specbind (Qinhibit_menubar_update, Qt);
  
@@@ -11363,7 -11356,7 +11373,7 @@@ update_tool_bar (struct frame *f, int s
              != !NILP (w->region_showing)))
        {
          struct buffer *prev = current_buffer;
 -        int count = SPECPDL_INDEX ();
 +        ptrdiff_t count = SPECPDL_INDEX ();
          Lisp_Object frame, new_tool_bar;
            int new_n_tool_bar;
          struct gcpro gcpro1;
@@@ -11501,20 -11494,20 +11511,20 @@@ build_desired_tool_bar_string (struct f
                : DEFAULT_TOOL_BAR_BUTTON_RELIEF);
        hmargin = vmargin = relief;
  
 -      if (INTEGERP (Vtool_bar_button_margin)
 -        && XINT (Vtool_bar_button_margin) > 0)
 +      if (RANGED_INTEGERP (1, Vtool_bar_button_margin,
 +                         INT_MAX - max (hmargin, vmargin)))
        {
          hmargin += XFASTINT (Vtool_bar_button_margin);
          vmargin += XFASTINT (Vtool_bar_button_margin);
        }
        else if (CONSP (Vtool_bar_button_margin))
        {
 -        if (INTEGERP (XCAR (Vtool_bar_button_margin))
 -            && XINT (XCAR (Vtool_bar_button_margin)) > 0)
 +        if (RANGED_INTEGERP (1, XCAR (Vtool_bar_button_margin),
 +                             INT_MAX - hmargin))
            hmargin += XFASTINT (XCAR (Vtool_bar_button_margin));
  
 -        if (INTEGERP (XCDR (Vtool_bar_button_margin))
 -            && XINT (XCDR (Vtool_bar_button_margin)) > 0)
 +        if (RANGED_INTEGERP (1, XCDR (Vtool_bar_button_margin),
 +                             INT_MAX - vmargin))
            vmargin += XFASTINT (XCDR (Vtool_bar_button_margin));
        }
  
@@@ -11860,7 -11853,7 +11870,7 @@@ redisplay_tool_bar (struct frame *f
      {
        int border, rows, height, extra;
  
 -      if (INTEGERP (Vtool_bar_border))
 +      if (TYPE_RANGED_INTEGERP (int, Vtool_bar_border))
        border = XINT (Vtool_bar_border);
        else if (EQ (Vtool_bar_border, Qinternal_border_width))
        border = FRAME_INTERNAL_BORDER_WIDTH (f);
@@@ -12048,7 -12041,7 +12058,7 @@@ get_tool_bar_item (struct frame *f, in
  
  void
  handle_tool_bar_click (struct frame *f, int x, int y, int down_p,
 -                     unsigned int modifiers)
 +                     int modifiers)
  {
    Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
    struct window *w = XWINDOW (f->tool_bar_window);
@@@ -12227,7 -12220,7 +12237,7 @@@ hscroll_window_tree (Lisp_Object window
          hscroll_step_abs = 0;
        }
      }
 -  else if (INTEGERP (Vhscroll_step))
 +  else if (TYPE_RANGED_INTEGERP (int, Vhscroll_step))
      {
        hscroll_step_abs = XINT (Vhscroll_step);
        if (hscroll_step_abs < 0)
                              && (w->cursor.x >= text_area_width - h_margin))))))
            {
              struct it it;
 -            int hscroll;
 +            ptrdiff_t hscroll;
              struct buffer *saved_current_buffer;
 -            EMACS_INT pt;
 +            ptrdiff_t pt;
              int wanted_x;
  
              /* Find point in a display of infinite width.  */
@@@ -12408,12 -12401,12 +12418,12 @@@ static int debug_dvpos, debug_dy
  
  /* Delta in characters and bytes for try_window_id.  */
  
 -static EMACS_INT debug_delta, debug_delta_bytes;
 +static ptrdiff_t debug_delta, debug_delta_bytes;
  
  /* Values of window_end_pos and window_end_vpos at the end of
     try_window_id.  */
  
 -static EMACS_INT debug_end_vpos;
 +static ptrdiff_t debug_end_vpos;
  
  /* Append a string to W->desired_matrix->method.  FMT is a printf
     format string.  If trace_redisplay_p is non-zero also printf the
@@@ -12463,7 -12456,7 +12473,7 @@@ debug_method_add (struct window *w, cha
  
  static inline int
  text_outside_line_unchanged_p (struct window *w,
 -                             EMACS_INT start, EMACS_INT end)
 +                             ptrdiff_t start, ptrdiff_t end)
  {
    int unchanged_p = 1;
  
@@@ -12686,10 -12679,10 +12696,10 @@@ overlay_arrow_at_row (struct it *it, st
     position.  BUF and PT are the current point buffer and position.  */
  
  static int
 -check_point_in_composition (struct buffer *prev_buf, EMACS_INT prev_pt,
 -                          struct buffer *buf, EMACS_INT pt)
 +check_point_in_composition (struct buffer *prev_buf, ptrdiff_t prev_pt,
 +                          struct buffer *buf, ptrdiff_t pt)
  {
 -  EMACS_INT start, end;
 +  ptrdiff_t start, end;
    Lisp_Object prop;
    Lisp_Object buffer;
  
@@@ -12740,7 -12733,7 +12750,7 @@@ reconsider_clip_changes (struct window 
    if (!b->clip_changed
        && BUFFERP (w->buffer) && !NILP (w->window_end_valid))
      {
 -      EMACS_INT pt;
 +      ptrdiff_t pt;
  
        if (w == XWINDOW (selected_window))
        pt = PT;
@@@ -12809,7 -12802,7 +12819,7 @@@ redisplay_internal (void
    int must_finish = 0;
    struct text_pos tlbufpos, tlendpos;
    int number_of_visible_frames;
 -  int count, count1;
 +  ptrdiff_t count, count1;
    struct frame *sf;
    int polling_stopped_here = 0;
    Lisp_Object old_frame = selected_frame;
       frames.  Zero means, only selected_window is considered.  */
    int consider_all_windows_p;
  
 +  /* Non-zero means redisplay has to redisplay the miniwindow */
 +  int update_miniwindow_p = 0;
 +
    TRACE ((stderr, "redisplay_internal %d\n", redisplaying_p));
  
    /* No redisplay if running in batch mode or frame is not yet fully
          && !MINI_WINDOW_P (XWINDOW (selected_window))))
      {
        int window_height_changed_p = echo_area_display (0);
 +
 +      if (message_cleared_p)
 +      update_miniwindow_p = 1;
 +
        must_finish = 1;
  
        /* If we don't display the current message, don't clear the
  /* FIXME: this causes all frames to be updated, which seems unnecessary
     since only the current frame needs to be considered.  This function needs
     to be rewritten with two variables, consider_all_windows and
 -   consider_all_frames. */
 +   consider_all_frames.  */
        consider_all_windows_p = 1;
        ++windows_or_buffers_changed;
        ++update_mode_lines;
                {
                  struct glyph_row *row
                    = MATRIX_ROW (w->current_matrix, this_line_vpos + 1);
 -                EMACS_INT delta, delta_bytes;
 +                ptrdiff_t delta, delta_bytes;
  
                  /* We used to distinguish between two cases here,
                     conditioned by Z - CHARPOS (tlendpos) == ZV, for
         then we can't just move the cursor.  */
        else if (! (!NILP (Vtransient_mark_mode)
                  && !NILP (BVAR (current_buffer, mark_active)))
 -             && (EQ (selected_window, BVAR (current_buffer, last_selected_window))
 +             && (EQ (selected_window,
 +                     BVAR (current_buffer, last_selected_window))
                   || highlight_nonselected_windows)
               && NILP (w->region_showing)
               && NILP (Vshow_trailing_whitespace)
      }
    else if (FRAME_VISIBLE_P (sf) && !FRAME_OBSCURED_P (sf))
      {
 -      Lisp_Object mini_window;
 +      Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf);
        struct frame *mini_frame;
  
        displayed_buffer = XBUFFER (XWINDOW (selected_window)->buffer);
        internal_condition_case_1 (redisplay_window_1, selected_window,
                                 list_of_error,
                                 redisplay_window_error);
 +      if (update_miniwindow_p)
 +      internal_condition_case_1 (redisplay_window_1, mini_window,
 +                                 list_of_error,
 +                                 redisplay_window_error);
  
        /* Compare desired and current matrices, perform output.  */
  
@@@ -13787,18 -13768,18 +13797,18 @@@ redisplay_window_1 (Lisp_Object window
  static int
  set_cursor_from_row (struct window *w, struct glyph_row *row,
                     struct glyph_matrix *matrix,
 -                   EMACS_INT delta, EMACS_INT delta_bytes,
 +                   ptrdiff_t delta, ptrdiff_t delta_bytes,
                     int dy, int dvpos)
  {
    struct glyph *glyph = row->glyphs[TEXT_AREA];
    struct glyph *end = glyph + row->used[TEXT_AREA];
    struct glyph *cursor = NULL;
    /* The last known character position in row.  */
 -  EMACS_INT last_pos = MATRIX_ROW_START_CHARPOS (row) + delta;
 +  ptrdiff_t last_pos = MATRIX_ROW_START_CHARPOS (row) + delta;
    int x = row->x;
 -  EMACS_INT pt_old = PT - delta;
 -  EMACS_INT pos_before = MATRIX_ROW_START_CHARPOS (row) + delta;
 -  EMACS_INT pos_after = MATRIX_ROW_END_CHARPOS (row) + delta;
 +  ptrdiff_t pt_old = PT - delta;
 +  ptrdiff_t pos_before = MATRIX_ROW_START_CHARPOS (row) + delta;
 +  ptrdiff_t pos_after = MATRIX_ROW_END_CHARPOS (row) + delta;
    struct glyph *glyph_before = glyph - 1, *glyph_after = end;
    /* A glyph beyond the edge of TEXT_AREA which we should never
       touch.  */
    int string_seen = 0;
    /* Largest and smallest buffer positions seen so far during scan of
       glyph row.  */
 -  EMACS_INT bpos_max = pos_before;
 -  EMACS_INT bpos_min = pos_after;
 +  ptrdiff_t bpos_max = pos_before;
 +  ptrdiff_t bpos_min = pos_after;
    /* Last buffer position covered by an overlay string with an integer
       `cursor' property.  */
 -  EMACS_INT bpos_covered = 0;
 +  ptrdiff_t bpos_covered = 0;
    /* Non-zero means the display string on which to display the cursor
       comes from a text property, not from an overlay.  */
    int string_from_text_prop = 0;
        {
        if (BUFFERP (glyph->object))
          {
 -          EMACS_INT dpos = glyph->charpos - pt_old;
 +          ptrdiff_t dpos = glyph->charpos - pt_old;
  
            if (glyph->charpos > bpos_max)
              bpos_max = glyph->charpos;
        else if (STRINGP (glyph->object))
          {
            Lisp_Object chprop;
 -          EMACS_INT glyph_pos = glyph->charpos;
 +          ptrdiff_t glyph_pos = glyph->charpos;
  
            chprop = Fget_char_property (make_number (glyph_pos), Qcursor,
                                         glyph->object);
                   text is completely covered by display properties,
                   so that no glyph with valid buffer positions is
                   ever seen in the row.  */
 -              EMACS_INT prop_pos =
 +              ptrdiff_t prop_pos =
                  string_buffer_position_lim (glyph->object, pos_before,
                                              pos_after, 0);
  
        {
        if (BUFFERP (glyph->object))
          {
 -          EMACS_INT dpos = glyph->charpos - pt_old;
 +          ptrdiff_t dpos = glyph->charpos - pt_old;
  
            if (glyph->charpos > bpos_max)
              bpos_max = glyph->charpos;
        else if (STRINGP (glyph->object))
          {
            Lisp_Object chprop;
 -          EMACS_INT glyph_pos = glyph->charpos;
 +          ptrdiff_t glyph_pos = glyph->charpos;
  
            chprop = Fget_char_property (make_number (glyph_pos), Qcursor,
                                         glyph->object);
            if (!NILP (chprop))
              {
 -              EMACS_INT prop_pos =
 +              ptrdiff_t prop_pos =
                  string_buffer_position_lim (glyph->object, pos_before,
                                              pos_after, 0);
  
  
        if (row->ends_in_ellipsis_p && pos_after == last_pos)
        {
 -        EMACS_INT ellipsis_pos;
 +        ptrdiff_t ellipsis_pos;
  
          /* Scan back over the ellipsis glyphs.  */
          if (!row->reversed_p)
             positioned between POS_BEFORE and POS_AFTER in the
             buffer.  */
          struct glyph *start, *stop;
 -        EMACS_INT pos = pos_before;
 +        ptrdiff_t pos = pos_before;
  
          x = -1;
  
              if (STRINGP (glyph->object))
                {
                  Lisp_Object str;
 -                EMACS_INT tem;
 +                ptrdiff_t tem;
                  /* If the display property covers the newline, we
                     need to search for it one position farther.  */
 -                EMACS_INT lim = pos_after
 +                ptrdiff_t lim = pos_after
                    + (pos_after == MATRIX_ROW_END_CHARPOS (row) + delta);
  
                  string_from_text_prop = 0;
                      || pos <= tem)
                    {
                      /* If the string from which this glyph came is
 -                       found in the buffer at point, then we've
 -                       found the glyph we've been looking for.  If
 -                       it comes from an overlay (tem == 0), and it
 -                       has the `cursor' property on one of its
 +                       found in the buffer at point, or at position
 +                       that is closer to point than pos_after, then
 +                       we've found the glyph we've been looking for.
 +                       If it comes from an overlay (tem == 0), and
 +                       it has the `cursor' property on one of its
                         glyphs, record that glyph as a candidate for
                         displaying the cursor.  (As in the
                         unidirectional version, we will display the
                         cursor on the last candidate we find.)  */
 -                    if (tem == 0 || tem == pt_old)
 +                    if (tem == 0
 +                        || tem == pt_old
 +                        || (tem - pt_old > 0 && tem < pos_after))
                        {
                          /* The glyphs from this string could have
                             been reordered.  Find the one with the
                             be a character in the string with the
                             `cursor' property, which means display
                             cursor on that character's glyph.  */
 -                        EMACS_INT strpos = glyph->charpos;
 +                        ptrdiff_t strpos = glyph->charpos;
  
                          if (tem)
                            {
                               glyph += incr)
                            {
                              Lisp_Object cprop;
 -                            EMACS_INT gpos = glyph->charpos;
 +                            ptrdiff_t gpos = glyph->charpos;
  
                              cprop = Fget_char_property (make_number (gpos),
                                                          Qcursor,
                                }
                            }
  
 -                        if (tem == pt_old)
 +                        if (tem == pt_old
 +                            || (tem - pt_old > 0 && tem < pos_after))
                            goto compute_x;
                        }
                      if (tem)
  
  static int
  try_scrolling (Lisp_Object window, int just_this_one_p,
 -             EMACS_INT arg_scroll_conservatively, EMACS_INT scroll_step,
 +             ptrdiff_t arg_scroll_conservatively, ptrdiff_t scroll_step,
               int temp_scroll_step, int last_line_misfit)
  {
    struct window *w = XWINDOW (window);
@@@ -15142,7 -15119,7 +15152,7 @@@ try_cursor_movement (Lisp_Object window
                        MATRIX_ROW (w->current_matrix, w->cursor.vpos);
                      struct glyph *g =
                        candidate->glyphs[TEXT_AREA] + w->cursor.hpos;
 -                    EMACS_INT endpos = MATRIX_ROW_END_CHARPOS (candidate);
 +                    ptrdiff_t endpos = MATRIX_ROW_END_CHARPOS (candidate);
  
                      exact_match_p =
                        (BUFFERP (g->object) && g->charpos == PT)
@@@ -15202,7 -15179,7 +15212,7 @@@ stati
  void
  set_vertical_scroll_bar (struct window *w)
  {
 -  EMACS_INT start, end, whole;
 +  ptrdiff_t start, end, whole;
  
    /* Calculate the start and end positions for the current window.
       At some point, it would be nice to choose between scrollbars
@@@ -15262,11 -15239,11 +15272,11 @@@ redisplay_window (Lisp_Object window, i
       It indicates that the buffer contents and narrowing are unchanged.  */
    int buffer_unchanged_p = 0;
    int temp_scroll_step = 0;
 -  int count = SPECPDL_INDEX ();
 +  ptrdiff_t count = SPECPDL_INDEX ();
    int rc;
    int centering_position = -1;
    int last_line_misfit = 0;
 -  EMACS_INT beg_unchanged, end_unchanged;
 +  ptrdiff_t beg_unchanged, end_unchanged;
  
    SET_TEXT_POS (lpoint, PT, PT_BYTE);
    opoint = lpoint;
       window, set up appropriate value.  */
    if (!EQ (window, selected_window))
      {
 -      EMACS_INT new_pt = XMARKER (w->pointm)->charpos;
 -      EMACS_INT new_pt_byte = marker_byte_position (w->pointm);
 +      ptrdiff_t new_pt = XMARKER (w->pointm)->charpos;
 +      ptrdiff_t new_pt_byte = marker_byte_position (w->pointm);
        if (new_pt < BEGV)
        {
          new_pt = BEGV;
        scroll_margin > 0
        ? min (scroll_margin, WINDOW_TOTAL_LINES (w) / 4)
        : 0;
 -      EMACS_INT margin_pos = CHARPOS (startp);
 +      ptrdiff_t margin_pos = CHARPOS (startp);
        Lisp_Object aggressive;
        int scrolling_up;
  
@@@ -16679,7 -16656,7 +16689,7 @@@ try_window_reusing_current_matrix (stru
  
  static struct glyph_row *find_last_unchanged_at_beg_row (struct window *);
  static struct glyph_row *find_first_unchanged_at_end_row (struct window *,
 -                                                          EMACS_INT *, EMACS_INT *);
 +                                                          ptrdiff_t *, ptrdiff_t *);
  static struct glyph_row *
  find_last_row_displaying_text (struct glyph_matrix *, struct it *,
                                 struct glyph_row *);
@@@ -16727,7 -16704,7 +16737,7 @@@ find_last_row_displaying_text (struct g
  static struct glyph_row *
  find_last_unchanged_at_beg_row (struct window *w)
  {
 -  EMACS_INT first_changed_pos = BEG + BEG_UNCHANGED;
 +  ptrdiff_t first_changed_pos = BEG + BEG_UNCHANGED;
    struct glyph_row *row;
    struct glyph_row *row_found = NULL;
    int yb = window_text_bottom_y (w);
  
  static struct glyph_row *
  find_first_unchanged_at_end_row (struct window *w,
 -                               EMACS_INT *delta, EMACS_INT *delta_bytes)
 +                               ptrdiff_t *delta, ptrdiff_t *delta_bytes)
  {
    struct glyph_row *row;
    struct glyph_row *row_found = NULL;
         corresponds to window_end_pos.  This allows us to translate
         buffer positions in the current matrix to current buffer
         positions for characters not in changed text.  */
 -      EMACS_INT Z_old =
 +      ptrdiff_t Z_old =
        MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos);
 -      EMACS_INT Z_BYTE_old =
 +      ptrdiff_t Z_BYTE_old =
        MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos;
 -      EMACS_INT last_unchanged_pos, last_unchanged_pos_old;
 +      ptrdiff_t last_unchanged_pos, last_unchanged_pos_old;
        struct glyph_row *first_text_row
        = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
  
@@@ -16902,12 -16879,12 +16912,12 @@@ sync_frame_with_window_matrix_rows (str
     containing CHARPOS or null.  */
  
  struct glyph_row *
 -row_containing_pos (struct window *w, EMACS_INT charpos,
 +row_containing_pos (struct window *w, ptrdiff_t charpos,
                    struct glyph_row *start, struct glyph_row *end, int dy)
  {
    struct glyph_row *row = start;
    struct glyph_row *best_row = NULL;
 -  EMACS_INT mindif = BUF_ZV (XBUFFER (w->buffer)) + 1;
 +  ptrdiff_t mindif = BUF_ZV (XBUFFER (w->buffer)) + 1;
    int last_y;
  
    /* If we happen to start on a header-line, skip that.  */
@@@ -17021,14 -16998,14 +17031,14 @@@ try_window_id (struct window *w
    struct glyph_row *bottom_row;
    int bottom_vpos;
    struct it it;
 -  EMACS_INT delta = 0, delta_bytes = 0, stop_pos;
 +  ptrdiff_t delta = 0, delta_bytes = 0, stop_pos;
    int dvpos, dy;
    struct text_pos start_pos;
    struct run run;
    int first_unchanged_at_end_vpos = 0;
    struct glyph_row *last_text_row, *last_text_row_at_end;
    struct text_pos start;
 -  EMACS_INT first_changed_charpos, last_changed_charpos;
 +  ptrdiff_t first_changed_charpos, last_changed_charpos;
  
  #if GLYPH_DEBUG
    if (inhibit_try_window_id)
          || (last_changed_charpos < CHARPOS (start) - 1
              && FETCH_BYTE (BYTEPOS (start) - 1) == '\n')))
      {
 -      EMACS_INT Z_old, Z_delta, Z_BYTE_old, Z_delta_bytes;
 +      ptrdiff_t Z_old, Z_delta, Z_BYTE_old, Z_delta_bytes;
        struct glyph_row *r0;
  
        /* Compute how many chars/bytes have been added to or removed
@@@ -17899,7 -17876,7 +17909,7 @@@ dump_glyph_row (struct glyph_row *row, 
               row->visible_height,
               row->ascent,
               row->phys_ascent);
 -      fprintf (stderr, "%9d %5d\t%5d\n", row->start.overlay_string_index,
 +      fprintf (stderr, "%9"pD"d %5"pD"d\t%5d\n", row->start.overlay_string_index,
               row->end.overlay_string_index,
               row->continuation_lines_width);
        fprintf (stderr, "%9"pI"d %5"pI"d\n",
@@@ -17973,7 -17950,7 +17983,7 @@@ glyphs in short form, otherwise show gl
           w->cursor.x, w->cursor.y, w->cursor.hpos, w->cursor.vpos);
    fprintf (stderr, "=============================================\n");
    dump_glyph_matrix (w->current_matrix,
 -                   NILP (glyphs) ? 0 : XINT (glyphs));
 +                   TYPE_RANGED_INTEGERP (int, glyphs) ? XINT (glyphs) : 0);
    return Qnil;
  }
  
@@@ -17996,7 -17973,7 +18006,7 @@@ GLYPH > 1 or omitted means dump glyphs 
    (Lisp_Object row, Lisp_Object glyphs)
  {
    struct glyph_matrix *matrix;
 -  int vpos;
 +  EMACS_INT vpos;
  
    CHECK_NUMBER (row);
    matrix = XWINDOW (selected_window)->current_matrix;
    if (vpos >= 0 && vpos < matrix->nrows)
      dump_glyph_row (MATRIX_ROW (matrix, vpos),
                    vpos,
 -                  INTEGERP (glyphs) ? XINT (glyphs) : 2);
 +                  TYPE_RANGED_INTEGERP (int, glyphs) ? XINT (glyphs) : 2);
    return Qnil;
  }
  
@@@ -18018,13 -17995,13 +18028,13 @@@ GLYPH > 1 or omitted means dump glyphs 
  {
    struct frame *sf = SELECTED_FRAME ();
    struct glyph_matrix *m = XWINDOW (sf->tool_bar_window)->current_matrix;
 -  int vpos;
 +  EMACS_INT vpos;
  
    CHECK_NUMBER (row);
    vpos = XINT (row);
    if (vpos >= 0 && vpos < m->nrows)
      dump_glyph_row (MATRIX_ROW (m, vpos), vpos,
 -                  INTEGERP (glyphs) ? XINT (glyphs) : 2);
 +                  TYPE_RANGED_INTEGERP (int, glyphs) ? XINT (glyphs) : 2);
    return Qnil;
  }
  
@@@ -18549,9 -18526,9 +18559,9 @@@ extend_face_to_end_of_line (struct it *
     trailing whitespace.  */
  
  static int
 -trailing_whitespace_p (EMACS_INT charpos)
 +trailing_whitespace_p (ptrdiff_t charpos)
  {
 -  EMACS_INT bytepos = CHAR_TO_BYTE (charpos);
 +  ptrdiff_t bytepos = CHAR_TO_BYTE (charpos);
    int c = 0;
  
    while (bytepos < ZV_BYTE
@@@ -18693,7 -18670,7 +18703,7 @@@ cursor_row_p (struct glyph_row *row
  
                        for ( ; glyph >= beg && EQ (glyph->object, s); --glyph)
                          {
 -                          EMACS_INT gpos = glyph->charpos;
 +                          ptrdiff_t gpos = glyph->charpos;
  
                            if (!NILP (Fget_char_property (make_number (gpos),
                                                           Qcursor, s)))
@@@ -18890,8 -18867,8 +18900,8 @@@ unproduce_glyphs (struct it *it, int n
     and ROW->maxpos.  */
  static void
  find_row_edges (struct it *it, struct glyph_row *row,
 -              EMACS_INT min_pos, EMACS_INT min_bpos,
 -              EMACS_INT max_pos, EMACS_INT max_bpos)
 +              ptrdiff_t min_pos, ptrdiff_t min_bpos,
 +              ptrdiff_t max_pos, ptrdiff_t max_bpos)
  {
    /* FIXME: Revisit this when glyph ``spilling'' in continuation
       lines' rows is implemented for bidi-reordered rows.  */
@@@ -19058,11 -19035,11 +19068,11 @@@ display_line (struct it *it
    int wrap_row_ascent IF_LINT (= 0), wrap_row_height IF_LINT (= 0);
    int wrap_row_phys_ascent IF_LINT (= 0), wrap_row_phys_height IF_LINT (= 0);
    int wrap_row_extra_line_spacing IF_LINT (= 0);
 -  EMACS_INT wrap_row_min_pos IF_LINT (= 0), wrap_row_min_bpos IF_LINT (= 0);
 -  EMACS_INT wrap_row_max_pos IF_LINT (= 0), wrap_row_max_bpos IF_LINT (= 0);
 +  ptrdiff_t wrap_row_min_pos IF_LINT (= 0), wrap_row_min_bpos IF_LINT (= 0);
 +  ptrdiff_t wrap_row_max_pos IF_LINT (= 0), wrap_row_max_bpos IF_LINT (= 0);
    int cvpos;
 -  EMACS_INT min_pos = ZV + 1, max_pos = 0;
 -  EMACS_INT min_bpos IF_LINT (= 0), max_bpos IF_LINT (= 0);
 +  ptrdiff_t min_pos = ZV + 1, max_pos = 0;
 +  ptrdiff_t min_bpos IF_LINT (= 0), max_bpos IF_LINT (= 0);
  
    /* We always start displaying at hpos zero even if hscrolled.  */
    xassert (it->hpos == 0 && it->current_x == 0);
      {                                                         \
        int composition_p = !STRINGP ((IT)->string)             \
        && ((IT)->what == IT_COMPOSITION);                      \
 -      EMACS_INT current_pos =                                 \
 +      ptrdiff_t current_pos =                                 \
        composition_p ? (IT)->cmp_it.charpos                    \
                      : IT_CHARPOS (*(IT));                     \
 -      EMACS_INT current_bpos =                                        \
 +      ptrdiff_t current_bpos =                                        \
        composition_p ? CHAR_TO_BYTE (current_pos)              \
                      : IT_BYTEPOS (*(IT));                     \
        if (current_pos < min_pos)                              \
@@@ -19786,8 -19763,8 +19796,8 @@@ See also `bidi-paragraph-direction'.  *
         use current_matrix if it is up to date, but this seems fast
         enough as it is.  */
        struct bidi_it itb;
 -      EMACS_INT pos = BUF_PT (buf);
 -      EMACS_INT bytepos = BUF_PT_BYTE (buf);
 +      ptrdiff_t pos = BUF_PT (buf);
 +      ptrdiff_t bytepos = BUF_PT_BYTE (buf);
        int c;
        void *itb_data = bidi_shelve_cache ();
  
@@@ -20075,7 -20052,7 +20085,7 @@@ display_mode_line (struct window *w, en
  {
    struct it it;
    struct face *face;
 -  int count = SPECPDL_INDEX ();
 +  ptrdiff_t count = SPECPDL_INDEX ();
  
    init_iterator (&it, w, -1, -1, NULL, face_id);
    /* Don't extend on a previously drawn mode-line.
@@@ -20211,7 -20188,7 +20221,7 @@@ display_mode_element (struct it *it, in
        {
        /* A string: output it and check for %-constructs within it.  */
        unsigned char c;
 -      EMACS_INT offset = 0;
 +      ptrdiff_t offset = 0;
  
        if (SCHARS (elt) > 0
            && (!NILP (props) || risky))
               && (mode_line_target != MODE_LINE_DISPLAY
                   || it->current_x < it->last_visible_x))
          {
 -          EMACS_INT last_offset = offset;
 +          ptrdiff_t last_offset = offset;
  
            /* Advance to end of string or next format specifier.  */
            while ((c = SREF (elt, offset++)) != '\0' && c != '%')
  
            if (offset - 1 != last_offset)
              {
 -              EMACS_INT nchars, nbytes;
 +              ptrdiff_t nchars, nbytes;
  
                /* Output to end of string or up to '%'.  Field width
                   is length of string.  Don't output more than
                    break;
                  case MODE_LINE_STRING:
                    {
 -                    EMACS_INT bytepos = last_offset;
 -                    EMACS_INT charpos = string_byte_to_char (elt, bytepos);
 -                    EMACS_INT endpos = (precision <= 0
 +                    ptrdiff_t bytepos = last_offset;
 +                    ptrdiff_t charpos = string_byte_to_char (elt, bytepos);
 +                    ptrdiff_t endpos = (precision <= 0
                                          ? string_byte_to_char (elt, offset)
                                          : charpos + nchars);
  
                    break;
                  case MODE_LINE_DISPLAY:
                    {
 -                    EMACS_INT bytepos = last_offset;
 -                    EMACS_INT charpos = string_byte_to_char (elt, bytepos);
 +                    ptrdiff_t bytepos = last_offset;
 +                    ptrdiff_t charpos = string_byte_to_char (elt, bytepos);
  
                      if (precision <= 0)
                        nchars = string_byte_to_char (elt, offset) - charpos;
              }
            else /* c == '%' */
              {
 -              EMACS_INT percent_position = offset;
 +              ptrdiff_t percent_position = offset;
  
                /* Get the specified minimum width.  Zero means
                   don't pad.  */
                else if (c != 0)
                  {
                    int multibyte;
 -                  EMACS_INT bytepos, charpos;
 +                  ptrdiff_t bytepos, charpos;
                    const char *spec;
                    Lisp_Object string;
  
@@@ -20658,7 -20635,7 +20668,7 @@@ static in
  store_mode_line_string (const char *string, Lisp_Object lisp_string, int copy_string,
                        int field_width, int precision, Lisp_Object props)
  {
 -  EMACS_INT len;
 +  ptrdiff_t len;
    int n = 0;
  
    if (string != NULL)
@@@ -20759,7 -20736,7 +20769,7 @@@ are the selected window and the WINDOW'
    struct buffer *old_buffer = NULL;
    int face_id;
    int no_props = INTEGERP (face);
 -  int count = SPECPDL_INDEX ();
 +  ptrdiff_t count = SPECPDL_INDEX ();
    Lisp_Object str;
    int string_start = 0;
  
     the positive integer D to BUF using a minimal field width WIDTH.  */
  
  static void
 -pint2str (register char *buf, register int width, register EMACS_INT d)
 +pint2str (register char *buf, register int width, register ptrdiff_t d)
  {
    register char *p = buf;
  
@@@ -20889,11 -20866,11 +20899,11 @@@ static const char power_letter[] 
    };
  
  static void
 -pint2hrstr (char *buf, int width, EMACS_INT d)
 +pint2hrstr (char *buf, int width, ptrdiff_t d)
  {
    /* We aim to represent the nonnegative integer D as
       QUOTIENT.TENTHS * 10 ^ (3 * EXPONENT). */
 -  EMACS_INT quotient = d;
 +  ptrdiff_t quotient = d;
    int remainder = 0;
    /* -1 means: do not use TENTHS. */
    int tenths = -1;
@@@ -21173,7 -21150,7 +21183,7 @@@ decode_mode_spec (struct window *w, reg
        return "";
        else
        {
 -        EMACS_INT col = current_column ();
 +        ptrdiff_t col = current_column ();
          w->column_number_displayed = make_number (col);
          pint2str (decode_mode_spec_buf, field_width, col);
          return decode_mode_spec_buf;
  
      case 'i':
        {
 -      EMACS_INT size = ZV - BEGV;
 +      ptrdiff_t size = ZV - BEGV;
        pint2str (decode_mode_spec_buf, field_width, size);
        return decode_mode_spec_buf;
        }
  
      case 'I':
        {
 -      EMACS_INT size = ZV - BEGV;
 +      ptrdiff_t size = ZV - BEGV;
        pint2hrstr (decode_mode_spec_buf, field_width, size);
        return decode_mode_spec_buf;
        }
  
      case 'l':
        {
 -      EMACS_INT startpos, startpos_byte, line, linepos, linepos_byte;
 -      EMACS_INT topline, nlines, height;
 -      EMACS_INT junk;
 +      ptrdiff_t startpos, startpos_byte, line, linepos, linepos_byte;
 +      ptrdiff_t topline, nlines, height;
 +      ptrdiff_t junk;
  
        /* %c and %l are ignored in `frame-title-format'.  */
        if (mode_line_target == MODE_LINE_TITLE)
        else if (nlines < height + 25 || nlines > height * 3 + 50
                 || linepos == BUF_BEGV (b))
          {
 -          EMACS_INT limit = BUF_BEGV (b);
 -          EMACS_INT limit_byte = BUF_BEGV_BYTE (b);
 -          EMACS_INT position;
 -          EMACS_INT distance =
 +          ptrdiff_t limit = BUF_BEGV (b);
 +          ptrdiff_t limit_byte = BUF_BEGV_BYTE (b);
 +          ptrdiff_t position;
 +          ptrdiff_t distance =
              (height * 2 + 30) * line_number_display_limit_width;
  
            if (startpos - distance > limit)
  
      case 'p':
        {
 -      EMACS_INT pos = marker_position (w->start);
 -      EMACS_INT total = BUF_ZV (b) - BUF_BEGV (b);
 +      ptrdiff_t pos = marker_position (w->start);
 +      ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b);
  
        if (XFASTINT (w->window_end_pos) <= BUF_Z (b) - BUF_ZV (b))
          {
               so get us a 2-digit number that is close.  */
            if (total == 100)
              total = 99;
 -          sprintf (decode_mode_spec_buf, "%2"pI"d%%", total);
 +          sprintf (decode_mode_spec_buf, "%2"pD"d%%", total);
            return decode_mode_spec_buf;
          }
        }
        /* Display percentage of size above the bottom of the screen.  */
      case 'P':
        {
 -      EMACS_INT toppos = marker_position (w->start);
 -      EMACS_INT botpos = BUF_Z (b) - XFASTINT (w->window_end_pos);
 -      EMACS_INT total = BUF_ZV (b) - BUF_BEGV (b);
 +      ptrdiff_t toppos = marker_position (w->start);
 +      ptrdiff_t botpos = BUF_Z (b) - XFASTINT (w->window_end_pos);
 +      ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b);
  
        if (botpos >= BUF_ZV (b))
          {
            if (total == 100)
              total = 99;
            if (toppos <= BUF_BEGV (b))
 -            sprintf (decode_mode_spec_buf, "Top%2"pI"d%%", total);
 +            sprintf (decode_mode_spec_buf, "Top%2"pD"d%%", total);
            else
 -            sprintf (decode_mode_spec_buf, "%2"pI"d%%", total);
 +            sprintf (decode_mode_spec_buf, "%2"pD"d%%", total);
            return decode_mode_spec_buf;
          }
        }
  
      case '@':
        {
 -      int count = inhibit_garbage_collection ();
 +      ptrdiff_t count = inhibit_garbage_collection ();
        Lisp_Object val = call1 (intern ("file-remote-p"),
                                 BVAR (current_buffer, directory));
        unbind_to (count, Qnil);
  
     Set *BYTE_POS_PTR to 1 if we found COUNT lines, 0 if we hit LIMIT.  */
  
 -static EMACS_INT
 -display_count_lines (EMACS_INT start_byte,
 -                   EMACS_INT limit_byte, EMACS_INT count,
 -                   EMACS_INT *byte_pos_ptr)
 +static ptrdiff_t
 +display_count_lines (ptrdiff_t start_byte,
 +                   ptrdiff_t limit_byte, ptrdiff_t count,
 +                   ptrdiff_t *byte_pos_ptr)
  {
    register unsigned char *cursor;
    unsigned char *base;
  
 -  register EMACS_INT ceiling;
 +  register ptrdiff_t ceiling;
    register unsigned char *ceiling_addr;
 -  EMACS_INT orig_count = count;
 +  ptrdiff_t orig_count = count;
  
    /* If we are not in selective display mode,
       check only for newlines.  */
  
  static int
  display_string (const char *string, Lisp_Object lisp_string, Lisp_Object face_string,
 -              EMACS_INT face_string_pos, EMACS_INT start, struct it *it,
 +              ptrdiff_t face_string_pos, ptrdiff_t start, struct it *it,
                int field_width, int precision, int max_x, int multibyte)
  {
    int hpos_at_start = it->hpos;
    int saved_face_id = it->face_id;
    struct glyph_row *row = it->glyph_row;
 -  EMACS_INT it_charpos;
 +  ptrdiff_t it_charpos;
  
    /* Initialize the iterator IT for iteration over STRING beginning
       with index START.  */
       FACE_STRING, if that's given.  */
    if (STRINGP (face_string))
      {
 -      EMACS_INT endptr;
 +      ptrdiff_t endptr;
        struct face *face;
  
        it->face_id
@@@ -23141,7 -23118,7 +23151,7 @@@ compute_overhangs_and_x (struct glyph_s
  
  static int
  draw_glyphs (struct window *w, int x, struct glyph_row *row,
 -           enum glyph_row_area area, EMACS_INT start, EMACS_INT end,
 +           enum glyph_row_area area, ptrdiff_t start, ptrdiff_t end,
             enum draw_glyphs_face hl, int overlaps)
  {
    struct glyph_string *head, *tail;
@@@ -24605,7 -24582,7 +24615,7 @@@ x_produce_glyphs (struct it *it
          XChar2b char2b;
          struct font_metrics *pcm;
          int font_not_found_p;
 -        EMACS_INT pos;
 +        ptrdiff_t pos;
  
          for (glyph_len = cmp->glyph_len; glyph_len > 0; glyph_len--)
            if ((c = COMPOSITION_GLYPH (cmp, glyph_len - 1)) != '\t')
@@@ -25013,7 -24990,7 +25023,7 @@@ x_insert_glyphs (struct glyph *start, i
    struct glyph_row *row;
    struct glyph *glyph;
    int frame_x, frame_y;
 -  EMACS_INT hpos;
 +  ptrdiff_t hpos;
  
    xassert (updated_window && updated_row);
    BLOCK_INPUT;
@@@ -25160,7 -25137,8 +25170,7 @@@ get_specified_cursor_type (Lisp_Object 
  
    if (CONSP (arg)
        && EQ (XCAR (arg), Qbar)
 -      && INTEGERP (XCDR (arg))
 -      && XINT (XCDR (arg)) >= 0)
 +      && RANGED_INTEGERP (0, XCDR (arg), INT_MAX))
      {
        *width = XINT (XCDR (arg));
        return BAR_CURSOR;
  
    if (CONSP (arg)
        && EQ (XCAR (arg), Qhbar)
 -      && INTEGERP (XCDR (arg))
 -      && XINT (XCDR (arg)) >= 0)
 +      && RANGED_INTEGERP (0, XCDR (arg), INT_MAX))
      {
        *width = XINT (XCDR (arg));
        return HBAR_CURSOR;
@@@ -25832,7 -25811,7 +25842,7 @@@ draw_row_with_mouse_face (struct windo
        return;
      }
  #endif
 -#if defined (HAVE_GPM) || defined (MSDOS)
 +#if defined (HAVE_GPM) || defined (MSDOS) || defined (WINDOWSNT)
    tty_draw_row_with_mouse_face (w, row, start_hpos, end_hpos, draw);
  #endif
  }
@@@ -26071,7 -26050,7 +26081,7 @@@ cursor_in_mouse_face_p (struct window *
     buffer positions change non-linearly with glyph rows.  */
  static void
  rows_from_pos_range (struct window *w,
 -                   EMACS_INT start_charpos, EMACS_INT end_charpos,
 +                   ptrdiff_t start_charpos, ptrdiff_t end_charpos,
                     Lisp_Object disp_string,
                     struct glyph_row **start, struct glyph_row **end)
  {
    for ( ; row->enabled_p && MATRIX_ROW_BOTTOM_Y (row) <= last_y; row++)
      {
        struct glyph_row *next = row + 1;
 -      EMACS_INT next_start = MATRIX_ROW_START_CHARPOS (next);
 +      ptrdiff_t next_start = MATRIX_ROW_START_CHARPOS (next);
  
        if (!next->enabled_p
          || next >= MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w)
  static void
  mouse_face_from_buffer_pos (Lisp_Object window,
                            Mouse_HLInfo *hlinfo,
 -                          EMACS_INT mouse_charpos,
 -                          EMACS_INT start_charpos,
 -                          EMACS_INT end_charpos,
 +                          ptrdiff_t mouse_charpos,
 +                          ptrdiff_t start_charpos,
 +                          ptrdiff_t end_charpos,
                            Lisp_Object before_string,
                            Lisp_Object after_string,
                            Lisp_Object disp_string)
    struct glyph_row *first = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
    struct glyph_row *r1, *r2;
    struct glyph *glyph, *end;
 -  EMACS_INT ignore, pos;
 +  ptrdiff_t ignore, pos;
    int x;
  
    xassert (NILP (disp_string) || STRINGP (disp_string));
     Value is non-zero if a glyph was found.  */
  
  static int
 -fast_find_string_pos (struct window *w, EMACS_INT pos, Lisp_Object object,
 +fast_find_string_pos (struct window *w, ptrdiff_t pos, Lisp_Object object,
                      int *hpos, int *vpos, int *x, int *y, int right_p)
  {
    int yb = window_text_bottom_y (w);
  static void
  mouse_face_from_string_pos (struct window *w, Mouse_HLInfo *hlinfo,
                            Lisp_Object object,
 -                          EMACS_INT startpos, EMACS_INT endpos)
 +                          ptrdiff_t startpos, ptrdiff_t endpos)
  {
    int yb = window_text_bottom_y (w);
    struct glyph_row *r;
@@@ -26812,8 -26791,8 +26822,8 @@@ on_hot_spot_p (Lisp_Object hot_spot, in
        {
          struct Lisp_Vector *v = XVECTOR (XCDR (hot_spot));
          Lisp_Object *poly = v->contents;
 -        int n = v->header.size;
 -        int i;
 +        ptrdiff_t n = v->header.size;
 +        ptrdiff_t i;
          int inside = 0;
          Lisp_Object lx, ly;
          int x0, y0;
@@@ -26891,9 -26870,7 +26901,9 @@@ Returns the alist element for the firs
    CHECK_NUMBER (x);
    CHECK_NUMBER (y);
  
 -  return find_hot_spot (map, XINT (x), XINT (y));
 +  return find_hot_spot (map,
 +                      clip_to_bounds (INT_MIN, XINT (x), INT_MAX),
 +                      clip_to_bounds (INT_MIN, XINT (y), INT_MAX));
  }
  
  
@@@ -26952,7 -26929,7 +26962,7 @@@ note_mode_line_or_margin_highlight (Lis
    Cursor cursor = No_Cursor;
    Lisp_Object pointer = Qnil;
    int dx, dy, width, height;
 -  EMACS_INT charpos;
 +  ptrdiff_t charpos;
    Lisp_Object string, object = Qnil;
    Lisp_Object pos, help;
  
          int gpos;
          int gseq_length;
          int total_pixel_width;
 -        EMACS_INT begpos, endpos, ignore;
 +        ptrdiff_t begpos, endpos, ignore;
  
          int vpos, hpos;
  
@@@ -27322,14 -27299,14 +27332,14 @@@ note_mouse_highlight (struct frame *f, 
        && XFASTINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b))
      {
        int hpos, vpos, dx, dy, area = LAST_AREA;
 -      EMACS_INT pos;
 +      ptrdiff_t pos;
        struct glyph *glyph;
        Lisp_Object object;
        Lisp_Object mouse_face = Qnil, position;
        Lisp_Object *overlay_vec = NULL;
        ptrdiff_t i, noverlays;
        struct buffer *obuf;
 -      EMACS_INT obegv, ozv;
 +      ptrdiff_t obegv, ozv;
        int same_region;
  
        /* Find the glyph under X/Y.  */
              /* The mouse-highlighting comes from a display string
                 with a mouse-face.  */
              Lisp_Object s, e;
 -            EMACS_INT ignore;
 +            ptrdiff_t ignore;
  
              s = Fprevious_single_property_change
                (make_number (pos + 1), Qmouse_face, object, Qnil);
                  /* If we are on a display string with no mouse-face,
                     check if the text under it has one.  */
                  struct glyph_row *r = MATRIX_ROW (w->current_matrix, vpos);
 -                EMACS_INT start = MATRIX_ROW_START_CHARPOS (r);
 +                ptrdiff_t start = MATRIX_ROW_START_CHARPOS (r);
                  pos = string_buffer_position (object, start);
                  if (pos > 0)
                    {
        else
          {
            Lisp_Object obj = glyph->object;
 -          EMACS_INT charpos = glyph->charpos;
 +          ptrdiff_t charpos = glyph->charpos;
  
            /* Try text properties.  */
            if (STRINGP (obj)
                       see if the buffer text ``under'' it does.  */
                    struct glyph_row *r
                      = MATRIX_ROW (w->current_matrix, vpos);
 -                  EMACS_INT start = MATRIX_ROW_START_CHARPOS (r);
 -                  EMACS_INT p = string_buffer_position (obj, start);
 +                  ptrdiff_t start = MATRIX_ROW_START_CHARPOS (r);
 +                  ptrdiff_t p = string_buffer_position (obj, start);
                    if (p > 0)
                      {
                        help = Fget_char_property (make_number (p),
          if (NILP (pointer))
            {
              Lisp_Object obj = glyph->object;
 -            EMACS_INT charpos = glyph->charpos;
 +            ptrdiff_t charpos = glyph->charpos;
  
              /* Try text properties.  */
              if (STRINGP (obj)
                         see if the buffer text ``under'' it does.  */
                      struct glyph_row *r
                        = MATRIX_ROW (w->current_matrix, vpos);
 -                    EMACS_INT start = MATRIX_ROW_START_CHARPOS (r);
 -                    EMACS_INT p = string_buffer_position (obj, start);
 +                    ptrdiff_t start = MATRIX_ROW_START_CHARPOS (r);
 +                    ptrdiff_t p = string_buffer_position (obj, start);
                      if (p > 0)
                        pointer = Fget_char_property (make_number (p),
                                                      Qpointer, w->buffer);
@@@ -28435,14 -28412,14 +28445,14 @@@ syms_of_xdisp (void
  
  #ifdef HAVE_WINDOW_SYSTEM
    DEFVAR_BOOL ("x-stretch-cursor", x_stretch_cursor_p,
 -    doc: /* *Non-nil means draw block cursor as wide as the glyph under it.
 +    doc: /* Non-nil means draw block cursor as wide as the glyph under it.
  For example, if a block cursor is over a tab, it will be drawn as
  wide as that tab on the display.  */);
    x_stretch_cursor_p = 0;
  #endif
  
    DEFVAR_LISP ("show-trailing-whitespace", Vshow_trailing_whitespace,
 -    doc: /* *Non-nil means highlight trailing whitespace.
 +    doc: /* Non-nil means highlight trailing whitespace.
  The face used for trailing whitespace is `trailing-whitespace'.  */);
    Vshow_trailing_whitespace = Qnil;
  
@@@ -28462,7 -28439,7 +28472,7 @@@ A value of nil means no special handlin
    Vnobreak_char_display = Qt;
  
    DEFVAR_LISP ("void-text-area-pointer", Vvoid_text_area_pointer,
 -    doc: /* *The pointer shape to show in void text areas.
 +    doc: /* The pointer shape to show in void text areas.
  A value of nil means to show the text pointer.  Other options are `arrow',
  `text', `hand', `vdrag', `hdrag', `modeline', and `hourglass'.  */);
    Vvoid_text_area_pointer = Qarrow;
@@@ -28495,14 -28472,14 +28505,14 @@@ where to display overlay arrows.  */)
      = Fcons (intern_c_string ("overlay-arrow-position"), Qnil);
  
    DEFVAR_INT ("scroll-step", emacs_scroll_step,
 -    doc: /* *The number of lines to try scrolling a window by when point moves out.
 +    doc: /* The number of lines to try scrolling a window by when point moves out.
  If that fails to bring point back on frame, point is centered instead.
  If this is zero, point is always centered after it moves off frame.
  If you want scrolling to always be a line at a time, you should set
  `scroll-conservatively' to a large value rather than set this to 1.  */);
  
    DEFVAR_INT ("scroll-conservatively", scroll_conservatively,
 -    doc: /* *Scroll up to this many lines, to bring point back on screen.
 +    doc: /* Scroll up to this many lines, to bring point back on screen.
  If point moves off-screen, redisplay will scroll by up to
  `scroll-conservatively' lines in order to bring point just barely
  onto the screen again.  If that cannot be done, then redisplay
@@@ -28516,7 -28493,7 +28526,7 @@@ A value of zero means always recenter p
    scroll_conservatively = 0;
  
    DEFVAR_INT ("scroll-margin", scroll_margin,
 -    doc: /* *Number of lines of margin at the top and bottom of a window.
 +    doc: /* Number of lines of margin at the top and bottom of a window.
  Recenter the window whenever point gets within this many lines
  of the top or bottom of the window.  */);
    scroll_margin = 0;
@@@ -28552,20 -28529,20 +28562,20 @@@ Any other value means to use the approp
    mode_line_inverse_video = 1;
  
    DEFVAR_LISP ("line-number-display-limit", Vline_number_display_limit,
 -    doc: /* *Maximum buffer size for which line number should be displayed.
 +    doc: /* Maximum buffer size for which line number should be displayed.
  If the buffer is bigger than this, the line number does not appear
  in the mode line.  A value of nil means no limit.  */);
    Vline_number_display_limit = Qnil;
  
    DEFVAR_INT ("line-number-display-limit-width",
              line_number_display_limit_width,
 -    doc: /* *Maximum line width (in characters) for line number display.
 +    doc: /* Maximum line width (in characters) for line number display.
  If the average length of the lines near point is bigger than this, then the
  line number may be omitted from the mode line.  */);
    line_number_display_limit_width = 200;
  
    DEFVAR_BOOL ("highlight-nonselected-windows", highlight_nonselected_windows,
 -    doc: /* *Non-nil means highlight region even in nonselected windows.  */);
 +    doc: /* Non-nil means highlight region even in nonselected windows.  */);
    highlight_nonselected_windows = 0;
  
    DEFVAR_BOOL ("multiple-frames", multiple_frames,
@@@ -28637,7 -28614,7 +28647,7 @@@ See `set-window-redisplay-end-trigger'
    Vredisplay_end_trigger_functions = Qnil;
  
    DEFVAR_LISP ("mouse-autoselect-window", Vmouse_autoselect_window,
 -     doc: /* *Non-nil means autoselect window with mouse pointer.
 +     doc: /* Non-nil means autoselect window with mouse pointer.
  If nil, do not autoselect windows.
  A positive number means delay autoselection by that many seconds: a
  window is autoselected only after the mouse has remained in that
@@@ -28657,7 -28634,7 +28667,7 @@@ When customizing this variable make sur
    Vmouse_autoselect_window = Qnil;
  
    DEFVAR_LISP ("auto-resize-tool-bars", Vauto_resize_tool_bars,
 -    doc: /* *Non-nil means automatically resize tool-bars.
 +    doc: /* Non-nil means automatically resize tool-bars.
  This dynamically changes the tool-bar's height to the minimum height
  that is needed to make all tool-bar items visible.
  If value is `grow-only', the tool-bar's height is only increased
@@@ -28665,15 -28642,15 +28675,15 @@@ automatically; to decrease the tool-ba
    Vauto_resize_tool_bars = Qt;
  
    DEFVAR_BOOL ("auto-raise-tool-bar-buttons", auto_raise_tool_bar_buttons_p,
 -    doc: /* *Non-nil means raise tool-bar buttons when the mouse moves over them.  */);
 +    doc: /* Non-nil means raise tool-bar buttons when the mouse moves over them.  */);
    auto_raise_tool_bar_buttons_p = 1;
  
    DEFVAR_BOOL ("make-cursor-line-fully-visible", make_cursor_line_fully_visible_p,
 -    doc: /* *Non-nil means to scroll (recenter) cursor line if it is not fully visible.  */);
 +    doc: /* Non-nil means to scroll (recenter) cursor line if it is not fully visible.  */);
    make_cursor_line_fully_visible_p = 1;
  
    DEFVAR_LISP ("tool-bar-border", Vtool_bar_border,
 -    doc: /* *Border below tool-bar in pixels.
 +    doc: /* Border below tool-bar in pixels.
  If an integer, use it as the height of the border.
  If it is one of `internal-border-width' or `border-width', use the
  value of the corresponding frame parameter.
@@@ -28681,7 -28658,7 +28691,7 @@@ Otherwise, no border is added below th
    Vtool_bar_border = Qinternal_border_width;
  
    DEFVAR_LISP ("tool-bar-button-margin", Vtool_bar_button_margin,
 -    doc: /* *Margin around tool-bar buttons in pixels.
 +    doc: /* Margin around tool-bar buttons in pixels.
  If an integer, use that for both horizontal and vertical margins.
  Otherwise, value should be a pair of integers `(HORZ . VERT)' with
  HORZ specifying the horizontal margin, and VERT specifying the
@@@ -28689,7 -28666,7 +28699,7 @@@ vertical margin.  */)
    Vtool_bar_button_margin = make_number (DEFAULT_TOOL_BAR_BUTTON_MARGIN);
  
    DEFVAR_INT ("tool-bar-button-relief", tool_bar_button_relief,
 -    doc: /* *Relief thickness of tool-bar buttons.  */);
 +    doc: /* Relief thickness of tool-bar buttons.  */);
    tool_bar_button_relief = DEFAULT_TOOL_BAR_BUTTON_RELIEF;
  
    DEFVAR_LISP ("tool-bar-style", Vtool_bar_style,
@@@ -28704,7 -28681,7 +28714,7 @@@ It can be one o
    Vtool_bar_style = Qnil;
  
    DEFVAR_INT ("tool-bar-max-label-size", tool_bar_max_label_size,
 -    doc: /* *Maximum number of characters a label can have to be shown.
 +    doc: /* Maximum number of characters a label can have to be shown.
  The tool bar style must also show labels for this to have any effect, see
  `tool-bar-style'.  */);
    tool_bar_max_label_size = DEFAULT_TOOL_BAR_LABEL_SIZE;
@@@ -28719,7 -28696,7 +28729,7 @@@ fontified regions the property `fontifi
  
    DEFVAR_BOOL ("unibyte-display-via-language-environment",
                 unibyte_display_via_language_environment,
 -    doc: /* *Non-nil means display unibyte text according to language environment.
 +    doc: /* Non-nil means display unibyte text according to language environment.
  Specifically, this means that raw bytes in the range 160-255 decimal
  are displayed by converting them to the equivalent multibyte characters
  according to the current language environment.  As a result, they are
@@@ -28730,7 -28707,7 +28740,7 @@@ but does not change the fact they are i
    unibyte_display_via_language_environment = 0;
  
    DEFVAR_LISP ("max-mini-window-height", Vmax_mini_window_height,
 -    doc: /* *Maximum height for resizing mini-windows (the minibuffer and the echo area).
 +    doc: /* Maximum height for resizing mini-windows (the minibuffer and the echo area).
  If a float, it specifies a fraction of the mini-window frame's height.
  If an integer, it specifies a number of lines.  */);
    Vmax_mini_window_height = make_float (0.25);
@@@ -28764,12 -28741,12 +28774,12 @@@ point visible.  */)
    DEFSYM (Qauto_hscroll_mode, "auto-hscroll-mode");
  
    DEFVAR_INT ("hscroll-margin", hscroll_margin,
 -    doc: /* *How many columns away from the window edge point is allowed to get
 +    doc: /* How many columns away from the window edge point is allowed to get
  before automatic hscrolling will horizontally scroll the window.  */);
    hscroll_margin = 5;
  
    DEFVAR_LISP ("hscroll-step", Vhscroll_step,
 -    doc: /* *How many columns to scroll the window when point gets too close to the edge.
 +    doc: /* How many columns to scroll the window when point gets too close to the edge.
  When point is less than `hscroll-margin' columns from the window
  edge, automatic hscrolling will scroll the window by the amount of columns
  determined by this variable.  If its value is a positive integer, scroll that
@@@ -28856,7 -28833,7 +28866,7 @@@ To add a prefix to continuation lines, 
  #endif /* GLYPH_DEBUG */
  
    DEFVAR_INT ("overline-margin", overline_margin,
 -             doc: /* *Space between overline and text, in pixels.
 +             doc: /* Space between overline and text, in pixels.
  The default value is 2: the height of the overline (1 pixel) plus 1 pixel
  margin to the character height.  */);
    overline_margin = 2;
@@@ -28877,7 -28854,7 +28887,7 @@@ cursor shapes.  */)
    display_hourglass_p = 1;
  
    DEFVAR_LISP ("hourglass-delay", Vhourglass_delay,
 -             doc: /* *Seconds to wait before displaying an hourglass pointer when Emacs is busy.  */);
 +             doc: /* Seconds to wait before displaying an hourglass pointer when Emacs is busy.  */);
    Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY);
  
    hourglass_atimer = NULL;
@@@ -28973,22 -28950,37 +28983,22 @@@ init_xdisp (void
  
  /* Platform-independent portion of hourglass implementation. */
  
 -/* Return non-zero if hourglass timer has been started or hourglass is
 -   shown.  */
 -int
 -hourglass_started (void)
 -{
 -  return hourglass_shown_p || hourglass_atimer != NULL;
 -}
 -
  /* Cancel a currently active hourglass timer, and start a new one.  */
  void
  start_hourglass (void)
  {
  #if defined (HAVE_WINDOW_SYSTEM)
    EMACS_TIME delay;
 -  int secs, usecs = 0;
 +  int secs = DEFAULT_HOURGLASS_DELAY, usecs = 0;
  
    cancel_hourglass ();
  
 -  if (INTEGERP (Vhourglass_delay)
 -      && XINT (Vhourglass_delay) > 0)
 -    secs = XFASTINT (Vhourglass_delay);
 -  else if (FLOATP (Vhourglass_delay)
 -         && XFLOAT_DATA (Vhourglass_delay) > 0)
 +  if (NUMBERP (Vhourglass_delay))
      {
 -      Lisp_Object tem;
 -      tem = Ftruncate (Vhourglass_delay, Qnil);
 -      secs = XFASTINT (tem);
 -      usecs = (XFLOAT_DATA (Vhourglass_delay) - secs) * 1000000;
 +      double duration = extract_float (Vhourglass_delay);
 +      if (0 < duration)
 +      duration_to_sec_usec (duration, &secs, &usecs);
      }
 -  else
 -    secs = DEFAULT_HOURGLASS_DELAY;
  
    EMACS_SET_SECS_USECS (delay, secs, usecs);
    hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay,