]> code.delx.au - gnu-emacs/commitdiff
Merge from origin/emacs-25
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 12 Apr 2016 15:50:47 +0000 (08:50 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 12 Apr 2016 15:50:47 +0000 (08:50 -0700)
ca50981 Improve time zone documentation
c23c965 Prevent bootstrap autoload backup files
9344612 Disable multicolor fonts on OS X since they are not supported...
c41ce1c Capitalize “Universal Time” in documentation
10597c9 Don't use 'find-program'

1  2 
doc/emacs/cmdargs.texi
doc/lispref/os.texi
etc/NEWS
etc/PROBLEMS
lisp/calendar/solar.el
lisp/emacs-lisp/autoload.el
lisp/gnus/gnus-art.el
lisp/vc/add-log.el
src/editfns.c

diff --combined doc/emacs/cmdargs.texi
index 646c8da1bb86d8dd863f7bcc4e1bae5aa8aac6b0,f0f686f855c1909167ec4cc8fc0af8839b7b8b96..444d30527f8fc8ed1122225575bd0e66ac5278a5
@@@ -283,13 -283,6 +283,13 @@@ which will invoke Emacs with @samp{--sc
  the script file as @var{file}.  Emacs Lisp then treats the @samp{#!}
  on this first line as a comment delimiter.
  
 +@item --no-build-details
 +@opindex --no-build-details
 +@cindex build details
 +@cindex deterministic build
 +Omit details like system name and build time from the Emacs executable,
 +so that builds are more deterministic.
 +
  @item -q
  @opindex -q
  @itemx --no-init-file
@@@ -641,8 -634,9 +641,9 @@@ to put temporary files (@pxref{Backup})
  @env{TMP}, then @env{TEMP}, and finally @file{c:/temp}.
  @item TZ
  @vindex TZ, environment variable
- This specifies the current time zone and possibly also daylight
- saving time information.  On MS-DOS, if @env{TZ} is not set in the
+ This specifies the default time zone and possibly also daylight
+ saving time information.  @xref{Time Zone Rules,,, elisp, The GNU
+ Emacs Lisp Reference Manual}.  On MS-DOS, if @env{TZ} is not set in the
  environment when Emacs starts, Emacs defines a default value as
  appropriate for the country code returned by DOS@.  On MS-Windows, Emacs
  does not use @env{TZ} at all.
diff --combined doc/lispref/os.texi
index 03d04ba3cf33d0fa738f54b707c70717d3450943,5f189b984a32f1de6105d3c8079f31ff24ac11ba..6e0edec29437a806e967455c9a6cbc0ac91074f4
@@@ -19,6 -19,7 +19,7 @@@ terminal and the screen
  * System Environment::  Distinguish the name and kind of system.
  * User Identification:: Finding the name and user id of the user.
  * Time of Day::         Getting the current time.
+ * Time Zone Rules::     Rules for time zones and daylight saving time.
  * Time Conversion::     Converting a time from numeric form to
                            calendrical data and vice versa.
  * Time Parsing::        Converting a time from numeric form to text
@@@ -899,6 -900,9 +900,6 @@@ A GNU (glibc-based) system with a FreeB
  @item hpux
  Hewlett-Packard HPUX operating system.
  
 -@item irix
 -Silicon Graphics Irix system.
 -
  @item nacl
  Google Native Client (@acronym{NaCl}) sandboxing system.
  
@@@ -1259,7 -1263,7 +1260,7 @@@ information may some day be added at th
  
  The argument @var{time}, if given, specifies a time to format,
  instead of the current time.  The optional argument @var{zone}
- defaults to the current time zone rule.
+ defaults to the current time zone rule.  @xref{Time Zone Rules}.
  
  @example
  @group
@@@ -1296,26 -1300,9 +1297,9 @@@ For example, if @var{time} is a number
  or rounding errors occur.
  @end defun
  
- @defun current-time-zone &optional time zone
- @cindex time zone, current
- This function returns a list describing the time zone that the user is
- in.
- The value has the form @code{(@var{offset} @var{name})}.  Here
- @var{offset} is an integer giving the number of seconds ahead of Universal Time
- (east of Greenwich).  A negative value means west of Greenwich.  The
- second element, @var{name}, is a string giving the name of the time
- zone.  Both elements change when daylight saving time begins or ends;
- if the user has specified a time zone that does not use a seasonal time
- adjustment, then the value is constant through time.
- If the operating system doesn't supply all the information necessary to
- compute the value, the unknown elements of the list are @code{nil}.
- The argument @var{time}, if given, specifies a time value to
- analyze instead of the current time.  The optional argument @var{zone}
- defaults to the current time zone rule.
- @end defun
+ @node Time Zone Rules
+ @section Time Zone Rules
+ @cindex time zone rules
  
  @vindex TZ, environment variable
  The default time zone is determined by the @env{TZ} environment
@@@ -1324,6 -1311,15 +1308,15 @@@ to default to Universal Time with @code
  @env{TZ} is not in the environment, Emacs uses system wall clock time,
  which is a platform-dependent default time zone.
  
+ The set of supported @env{TZ} strings is system-dependent.  GNU and
+ many other systems support the tzdata database, e.g.,
+ @samp{"America/New_York"} specifies the time zone and daylight saving
+ time history for locations near New York City.  GNU and most other
+ systems support POSIX-style @env{TZ} strings, e.g.,
+ @samp{"EST+5EDT,M4.1.0/2,M10.5.0/2"} specifies the rules used in New
+ York from 1987 through 2006.  All systems support the string
+ @samp{"UTC0"} meaning Universal Time.
  @cindex time zone rule
  Functions that convert to and from local time accept an optional
  @dfn{time zone rule} argument, which specifies the conversion's time
@@@ -1334,6 -1330,29 +1327,29 @@@ If it is @code{t}, the conversion uses 
  a string, the conversion uses the time zone rule equivalent to setting
  @env{TZ} to that string.
  
+ @defun current-time-zone &optional time zone
+ @cindex time zone, current
+ This function returns a list describing the time zone that the user is
+ in.
+ The value has the form @code{(@var{offset} @var{abbr})}.  Here
+ @var{offset} is an integer giving the number of seconds ahead of Universal Time
+ (east of Greenwich).  A negative value means west of Greenwich.  The
+ second element, @var{abbr}, is a string giving an abbreviation for the
+ time zone, e.g., @samp{"CST"} for China Standard Time or for
+ U.S. Central Standard Time.  Both elements can change when daylight
+ saving time begins or ends; if the user has specified a time zone that
+ does not use a seasonal time adjustment, then the value is constant
+ through time.
+ If the operating system doesn't supply all the information necessary to
+ compute the value, the unknown elements of the list are @code{nil}.
+ The argument @var{time}, if given, specifies a time value to
+ analyze instead of the current time.  The optional argument @var{zone}
+ defaults to the current time zone rule.
+ @end defun
  @node Time Conversion
  @section Time Conversion
  @cindex calendrical information
@@@ -1358,8 -1377,8 +1374,8 @@@ as traditional Gregorian years do; for 
  @defun decode-time &optional time zone
  This function converts a time value into calendrical information.  If
  you don't specify @var{time}, it decodes the current time, and similarly
- @var{zone} defaults to the current time zone rule.  The return
- value is a list of nine elements, as follows:
+ @var{zone} defaults to the current time zone rule.  @xref{Time Zone Rules}.
The return value is a list of nine elements, as follows:
  
  @example
  (@var{seconds} @var{minutes} @var{hour} @var{day} @var{month} @var{year} @var{dow} @var{dst} @var{utcoff})
@@@ -1406,6 -1425,7 +1422,7 @@@ to stand for years above 1900, or year
  yourself before you call @code{encode-time}.
  
  The optional argument @var{zone} defaults to the current time zone rule.
+ @xref{Time Zone Rules}.
  In addition to the usual time zone rule values, it can also be a list
  (as you would get from @code{current-time-zone}) or an integer (as
  from @code{decode-time}), applied without any further alteration for
@@@ -1449,8 -1469,8 +1466,8 @@@ corresponding time value
  
  This function converts @var{time} (or the current time, if
  @var{time} is omitted) to a string according to
- @var{format-string}.  The conversion uses the time zone rule @var{zone}
(or the current time zone rule, if omitted).  The argument
+ @var{format-string}.  The conversion uses the time zone rule @var{zone}, which
defaults to the current time zone rule.  @xref{Time Zone Rules}.  The argument
  @var{format-string} may contain @samp{%}-sequences which say to
  substitute parts of the time.  Here is a table of what the
  @samp{%}-sequences mean:
@@@ -1842,12 -1862,6 +1859,12 @@@ one of these functions; the arrival of 
  cause anything special to happen.
  @end defun
  
 +@findex timer-list
 +The @code{timer-list} command lists all the currently active timers.
 +There's only one command available in the buffer displayed: @kbd{c}
 +(@code{timer-list-cancel}) that will cancel the timer on the line
 +under point.
 +
  @node Idle Timers
  @section Idle Timers
  @cindex idle timers
diff --combined etc/NEWS
index 59f8d0867178730def74e143ef3fd651e5bb3d91,bae42af6d6d438f586f841545c9de9bf836a8b36..00f5aadd856082cd94c9a51560aa482b2aaee842
+++ b/etc/NEWS
@@@ -22,224 -22,6 +22,224 @@@ Temporary note
  When you add a new item, use the appropriate mark if you are sure it applies,
  otherwise leave it unmarked.
  
 +\f
 +* Installation Changes in Emacs 25.2
 +
 +** The new option 'configure --enable-gcc-warnings=warn-only' causes
 +GCC to issue warnings without stopping the bild.  This behavior is now
 +the default in developer builds.  As before, use
 +'--disable-gcc-warnings' to suppress GCC's warnings, and
 +'--enable-gcc-warnings' to stop the build if GCC issues warnings.
 +
 ++++
 +** New configure option '--disable-build-details' attempts to build an
 +Emacs that is more likely to be reproducible; that is, if you build
 +and install Emacs twice, the second Emacs is a copy of the first.
 +Deterministic builds omit the build date from the output of the
 +emacs-version and erc-cmd-SV functions, and the leave the following
 +variables nil: emacs-build-system, emacs-build-time,
 +erc-emacs-build-time.
 +
 +** Emacs no longer works on IRIX.  We expect that Emacs users are not
 +affected by this, as SGI stopped supporting IRIX in December 2013.
 +
 +\f
 +* Startup Changes in Emacs 25.2
 +
 +\f
 +* Changes in Emacs 25.2
 +
 ++++
 +** A number of accessors for the value returned by 'file-attributes'
 +has been added.  They are: 'file-attribute-type',
 +'file-attribute-link-number', 'file-attribute-user-id',
 +'file-attribute-group-id', 'file-attribute-access-time',
 +'file-attribute-modification-time',
 +'file-attribute-status-change-time', 'file-attribute-size',
 +'file-attribute-modes', 'file-attribute-inode-number', and
 +'file-attribute-device-number'
 +
 ++++
 +** The new function 'buffer-hash' has been added, and can be used to
 +compute a fash, non-consing hash of the contents of a buffer.
 +
 +---
 +** 'fill-paragraph' no longer marks the buffer as changed unless it
 +actually changed something.
 +
 +---
 +** The locale language name 'ca' is now mapped to the language
 +environment 'Catalan', which has been added.
 +
 +---
 +** 'align-regexp' has a separate history for its interactive argument
 +'align-regexp' no longer shares its history with all other
 +history-less functions that use 'read-string'
 +
 ++++
 +** The networking code has been reworked so that it's more
 +asynchronous than it was (when specifying :nowait t in
 +'make-network-process').  How asynchronous it is varies based on the
 +capabilities of the system, but on a typical GNU/Linux system the DNS
 +resolution, the connection, and (for TLS streams) the TLS negotiation
 +are all done without blocking the main Emacs thread.  To get
 +asynchronous TLS, the TLS boot parameters have to be passed in (see
 +the manual for details).
 +
 +Certain process oriented functions (like 'process-datagram-address')
 +will block until socket setup has been performed.  The recommended way
 +to deal with asynchronous sockets is to avoid interacting with them
 +until they have changed status to "run".  This is most easily done
 +from a process sentinel.
 +
 +** 'make-network-process' and 'open-network-stream' sometimes allowed
 +:service to be an integer string (e.g., :service "993") and sometimes
 +required an integer (e.g., :service 993).  This difference has been
 +eliminated, and integer strings work everywhere.
 +
 +** It is possible to disable attempted recovery on fatal signals
 +
 +Two new variables allow to disable attempts to recover from stack
 +overflow and to avoid automatic auto-save when Emacs is delivered a
 +fatal signal.  'attempt-stack-overflow-recovery', if set to 'nil',
 +will disable attempts to recover from C stack overflows; Emacs will
 +then crash as with any other fatal signal.
 +'attempt-orderly-shutdown-on-fatal-signal', if set to 'nil', will
 +disable attempts to auto-save the session and shut down in an orderly
 +fashion when Emacs receives a fatal signal; instead, Emacs will
 +terminate immediately.  Both variables are non-'nil' by default.
 +These variables are for users who would like to avoid the small
 +probability of data corruption due to techniques Emacs uses to recover
 +in these situations.
 +
 +\f
 +* Editing Changes in Emacs 25.2
 +
 +\f
 +* Changes in Specialized Modes and Packages in Emacs 25.2
 +
 +** eww
 +
 ++++
 +*** A new 's' command for switching to another eww buffer via the minibuffer.
 +
 +---
 +*** The 'o' command ('shr-save-contents') has moved to 'O' to avoid collision
 +with the 'o' command from 'image-map'.
 +
 ++++
 +** The commands that add ChangeLog entries now prefer a VCS root directory
 +for the ChangeLog file, if none already exists.  Customize
 +'change-log-directory-files' to nil for the old behavior.
 +
 +---
 +** Support for non-string values of 'time-stamp-format' has been removed.
 +
 +** Tramp
 +
 ++++
 +*** New connection method "sg", which allows to edit files under
 +different group ID.
 +
 ++++
 +*** New connection method "doas" for OpenBSD hosts.
 +
 +---
 +** 'auto-revert-use-notify' is set back to t in 'global-auto-revert-mode'.
 +
 +** CSS mode
 +
 +---
 +*** Support for completing attribute values and bang-rules using the
 +'completion-at-point' command.
 +
 +\f
 +* New Modes and Packages in Emacs 25.2
 +
 +\f
 +* Incompatible Lisp Changes in Emacs 25.2
 +
 ++++
 +** Resizing a frame no longer runs 'window-configuration-change-hook'.
 +Put your function on 'window-size-change-functions' instead.
 +
 +\f
 +* Lisp Changes in Emacs 25.2
 +
 +** New var syntax-ppss-table to control the syntax-table used in syntax-ppss
 +
 +** Autoload files can be generated without timestamps,
 +by setting 'autoload-timestamps' to nil.
 +FIXME As an experiment, nil is the current default.
 +If no insurmountable problems before next release, it can stay that way.
 +
 +** 'ert-with-function-mocked' of 'ert-x package allows mocking of functions
 +in unit tests.
 +
 +---
 +** 'gnutls-boot' now takes a parameter :complete-negotiation that says
 +that negotiation should complete even on non-blocking sockets.
 +
 ++++
 +** New functions 'window-pixel-width-before-size-change' and
 +'window-pixel-height-before-size-change' allow to detect which window
 +changed size when 'window-size-change-functions' are run.
 +
 ++++
 +** New function 'display-buffer-reuse-mode-window' is an action function
 +suitable for use in 'display-buffer-alist'. For example, to avoid creating
 +a new window when opening man pages when there's already one, use
 +(add-to-list 'display-buffer-alist
 +     '("\\`\\*Man .*\\*\\'" .
 +       (display-buffer-reuse-mode-window
 +        (inhibit-same-window . nil)
 +        (mode . Man-mode))))
 +
 ++++
 +** New function 'func-arity' returns information about the argument list
 +of an arbitrary function.
 +This is a generalization of 'subr-arity' for functions that are not
 +built-in primitives.  We recommend using this new function instead of
 +'subr-arity'.
 +
 ++++
 +** 'parse-partial-sexp' state has a new element.  Element 10 is
 +non-nil when the last character scanned might be the first character
 +of a two character construct, i.e. a comment delimiter or escaped
 +character.  Its value is the syntax of that last character.
 +
 ++++
 +** 'parse-partial-sexp''s state, element 9, has now been confirmed as
 +permanent and documented, and may be used by Lisp programs.  Its value
 +is a list of currently open parenthesis positions, starting with the
 +outermost parenthesis.
 +
 +** The function 'redirect-debugging-output' now works on platforms
 +other than GNU/Linux.
 +
 ++++
 +** New functions 'sxhash-eq' and 'sxhash-eql' return hash codes of a
 +Lisp object suitable for use with 'eq' and 'eql' correspondingly.  If
 +two objects are 'eq' ('eql'), then the result of 'sxhash-eq'
 +('sxhash-eql') on them will be the same.
 +
 ++++
 +** Function 'sxhash' has been renamed to 'sxhash-equal' for
 +consistency with the new functions.  For compatibility, 'sxhash'
 +remains as an alias to 'sxhash-equal'.
 +
 +\f
 +* Changes in Emacs 25.2 on Non-Free Operating Systems
 +
 +** Intercepting hotkeys on Windows 7 and later now works better.
 +The new keyboard hooking code properly grabs system hotkeys such as
 +Win-* and Alt-TAB, in a way that Emacs can get at them before the
 +system.  This makes the 'w32-register-hot-key' functionality work
 +again on all versions of MS-Windows starting with Windows 7.  On
 +Windows NT and later you can now register any hotkey combination.  (On
 +Windows 9X, the previous limitations, spelled out in the Emacs manual,
 +still apply.)
 +
  \f
  * Installation Changes in Emacs 25.1
  
@@@ -404,32 -186,17 +404,32 @@@ change in future releases.  For that re
  by default, and must be enabled by using the '--with-modules' option
  at configure time.
  
 ++++
 +** A second dir-local file (.dir-locals-2.el) is now accepted.
 +See the variable 'dir-locals-file-2' for more information.
 +
  +++
  ** Network security (TLS/SSL certificate validity and the like) is
  added via the new Network Security Manager (NSM) and controlled via
  the 'network-security-level' variable.
  
 +---
 +** International domain names (IDNA) are now encoded via the new
 +puny.el library, so that one can visit web sites with non-ASCII URLs.
 +
  +++
  ** C-h l now also lists the commands that were run.
  
 +** The new M-s M-w key binding uses eww to search the web for the
 +text in the region.
 +
  +++
 -** x-select-enable-clipboard is renamed select-enable-clipboard
 -and x-select-enable-primary is renamed select-enable-primary.
 +** The new 'timer-list' command lists all active timers in a buffer
 +where you can cancel them with the 'c' command.
 +
 +** M-x suggests shorthands and ignores obsolete commands for completion.
 +** x-select-enable-clipboard is renamed select-enable-clipboard.
 +x-select-enable-primary and renamed select-enable-primary.
  Additionally they both now apply to all systems (OSX, GNUstep, Windows, you
  name it), with the proviso that on some systems (e.g. Windows)
  select-enable-primary is ineffective since the system doesn't
@@@ -444,10 -211,6 +444,10 @@@ selected window is strongly dedicated t
  ** The option 'even-window-heights' has been renamed to
  'even-window-sizes' and now handles window widths as well.
  
 ++++
 +** New function 'read-multiple-choice' use to prompt for
 +multiple-choice questions, with a handy way to display help texts.
 +
  +++
  ** terpri gets an optional arg ENSURE to conditionally output a newline.
  
@@@ -570,11 -333,6 +570,11 @@@ is intended for adding to 'kill-emacs-q
  in favor of the global 'M-s h' bindings introduced in Emacs-23.1.
  They'll disappear soon.
  
 ++++
 +** New bindings for 'query-replace-map'.
 +'undo', undo the last replacement; bound to 'u'.
 +'undo-all', undo all replacements; bound to 'U'.
 +
  \f
  * Changes in Specialized Modes and Packages in Emacs 25.1
  
@@@ -638,18 -396,6 +638,18 @@@ the ordering of object keys by default
  'json-pretty-print-buffer-ordered' pretty prints JSON objects with
  object keys sorted alphabetically.
  
 ++++
 +** Prog mode has some support for multi-mode indentation.
 +This allows better indentation support in modes that support multiple
 +programming languages in the same buffer, like literate programming
 +environments or ANTLR programs with embedded Python code.
 +
 +A major mode can provide indentation context for a sub-mode through
 +the 'prog-indentation-context' variable.  To support this, modes that
 +provide indentation should use 'prog-widen' instead of 'widen' and
 +'prog-first-column' instead of a literal zero.  See the node
 +"Mode-Specific Indent" in the ELisp manual for more details.
 +
  ** Prettify Symbols mode
  
  +++
@@@ -705,9 -451,6 +705,9 @@@ obsolete alias for the new 'save-place-
  'erc-network-hide-list' and 'erc-channel-hide-list' will only hide the
  specified message types for the respective specified targets.
  
 +*** New variable 'erc-default-port-tls' used to connect to TLS IRC
 +servers.
 +
  ---
  *** Reconnection is now asynchronous.
  
@@@ -958,11 -701,6 +958,11 @@@ using mono-spaced font
  whether to use variable-pitch fonts or not.  The user can also
  customize the 'shr-use-fonts' variable.
  
 ++++
 +*** A new command 'C' ('eww-toggle-colors') can be used to toggle
 +whether to use the HTML-specified colors or not.  The user can also
 +customize the 'shr-use-colors' variable.
 +
  +++
  *** A new command 'R' ('eww-readable') will try do identify the main
  textual parts of a web page and display only that, leaving menus and
@@@ -972,13 -710,6 +972,13 @@@ the like off the page
  *** A new command 'D' ('eww-toggle-paragraph-direction') allows you to
  toggle the paragraph direction between left-to-right and right-to-left.
  
 +---
 +*** Images that are being loaded are now marked with grey
 +"placeholder" images of the size specified by the HTML.  They are then
 +replaced by the real images asynchronously, which will also now
 +respect width/height HTML specs (unless they specify widths/heights
 +bigger than the current window).
 +
  ---
  *** You can now use several eww buffers in parallel by renaming eww
  buffers you want to keep separate.
@@@ -1018,17 -749,6 +1018,17 @@@ invalid certificates are marked in red
  *** text/html messages that contain inline image parts will be
  transformed into multipart/related messages before sending.
  
 +---
 +*** The 'message-valid-fqdn-regexp' variable has been removed, since
 +there are now top-level domains added all the time.  Message will no
 +longer warn about sending emails to top-level domains it hasn't heard
 +about.
 +
 +*** 'message-beginning-of-line' (bound to C-a) understands folded headers.
 +In 'visual-line-mode' it will look for the true beginning of a header
 +while in non-'visual-line-mode' it will move the point to the indented
 +header's value.
 +
  +++
  ** In Show Paren Mode, a parenthesis can be highlighted when point
  stands inside it, and certain parens can be highlighted when point is
@@@ -1040,30 -760,6 +1040,30 @@@ respectively, 'show-paren-when-point-in
  ** If gpg2 exists on the system, it is now used as the default value
  of 'epg-gpg-program' (instead of gpg).
  
 +** Images
 +
 ++++
 +*** Images are automatically scaled before displaying based on the
 +'image-scaling-factor' variable (if Emacs supports scaling the images
 +in question).
 +
 ++++
 +*** Images inserted with 'insert-image' and related functions get a
 +keymap put into the text properties (or overlays) that span the
 +image.  This keymap binds keystrokes for manipulating size and
 +rotation, as well as saving the image to a file.  These commands are
 +also available in 'image-mode'.
 +
 ++++
 +*** A new library for creating and manipulating SVG images has been
 +added.  See the "SVG Images" section in the lispref manual for
 +details.
 +
 ++++
 +*** New setf-able function to access and set image parameters is
 +provided: 'image-property'.
 +
 +
  ** Lisp mode
  
  ---
@@@ -1237,13 -933,6 +1237,13 @@@ variable, meaning you can bind it aroun
  plist will contain a :peer element that has the output of
  'gnutls-peer-status' (if Emacs is built with GnuTLS support).
  
 ++++
 +*** The new function 'url-cookie-delete-cookie' can be used to
 +programmatically delete all cookies, or cookies from a specific
 +domain.
 +
 +*** The URL package now support https over proxies supporting CONNECT.
 +
  ** Tramp
  
  +++
@@@ -1293,11 -982,6 +1293,11 @@@ This command is useful when you perfor
  outside Emacs (e.g., from the shell prompt), or if you switch the VC
  back-end for the buffer's file, or remove it from version control.
  
 +---
 +*** The VC state indicator in the mode line now defaults to more
 +colorful faces to make it more obvious to the user what the state is.
 +See the 'vc-faces' customization group.
 +
  +++
  *** New option 'vc-annotate-background-mode' controls whether
  the color range from 'vc-annotate-color-map' is applied to the
@@@ -1586,15 -1270,6 +1586,15 @@@ compression command is determined from 
  'dired-compress-files-alist' variable.
  
  +++
 +*** In wdired, when editing files to contain slash characters,
 +the resulting directories are automatically created.  Whether
 +to do this or not is controlled by the
 +'wdired-create-parent-directories' variable.
 +
 ++++
 +*** 'W' is now bound to 'browse-url-of-dired-file', and is useful for
 +viewing HTML files and the like.
 +
  *** New user interface for the 'A' and 'Q' commands.
  These keys, now bound to 'dired-do-find-regexp' and
  'dired-do-find-regexp-and-replace', work similarly to 'xref-find-apropos'
@@@ -1740,14 -1415,6 +1740,14 @@@ Although M-x term still sets EMACS for 
  this is deprecated and will be phased out when Bash 4.4 or later takes over.
  Use the INSIDE_EMACS environment variable instead.
  
 +** 'C-up', 'C-down', 'C-left' and 'C-right' are now defined in term
 +mode to send the same escape sequences that xterm does.  This makes
 +things like forward-word in readline work.
 +
 +---
 +** hideshow mode got four key bindings that are analogous to outline
 +mode bindings: 'C-c @ C-a',  'C-c @ C-t',  'C-c @ C-d', and 'C-c @ C-e.'
 +
  +++
  ** 'save-excursion' does not save&restore the mark any more.
  Use 'save-mark-and-excursion' if you want the old behavior.
@@@ -1842,10 -1509,6 +1842,10 @@@ behavior, set 'diff-switches' to '-c'
  dynamically.  Any third-party code that changes these templates should
  be updated accordingly.
  
 +** The grep/rgrep/lgrep functions will now ask about saving files
 +before running.  This is controlled by the 'grep-save-buffers'
 +variable.
 +
  +++
  ** '(/ N)' is now equivalent to '(/ 1 N)' rather than to '(/ N 1)'.
  The new behavior is compatible with Common Lisp and with XEmacs.
@@@ -1951,10 -1614,6 +1951,10 @@@ details
  It should be placed right where the docstring would be, and FORM is then
  evaluated (and should return a string) when the closure is built.
  
 +---
 +** The new command 'fortune-message' has been added, which displays
 +fortunes in the echo area.
 +
  +++
  ** define-inline provides a new way to define inlinable functions.
  
@@@ -1981,12 -1640,6 +1981,12 @@@ environment.  For the time being this i
  systems and for MS-Windows, for other systems they fall back to their
  counterparts 'string-lessp' and 'string-equal'.
  
 ++++
 +** The new function 'string-version-lessp' compares strings by
 +interpreting consecutive runs of numerical characters as numbers, and
 +compares their numerical values.  According to this predicate,
 +"foo2.png" is smaller than "foo12.png".
 +
  ---
  *** The ls-lisp package uses 'string-collate-lessp' to sort file names.
  The effect is that, on systems that use ls-lisp for Dired, the default
@@@ -2125,11 -1778,11 +2125,11 @@@ quotation marks
  *** Time conversion functions now accept an optional ZONE argument
  that specifies the time zone rules for conversion.  ZONE is omitted or
  nil for Emacs local time, t for Universal Time, 'wall' for system wall
- clock time, or a string as in 'set-time-zone-rule' for a time zone
rule.  The affected functions are 'current-time-string',
- 'current-time-zone', 'decode-time', and 'format-time-string'.  The
- function 'encode-time', which already accepted a simple time zone rule
argument, has been extended to accept all the new forms.
+ clock time, or a string as in the TZ environment variable.  The
affected functions are 'current-time-string', 'current-time-zone',
+ 'decode-time', and 'format-time-string'.  The function 'encode-time',
+ which already accepted a simple time zone rule argument, has been
+ extended to accept all the new forms.
  
  *** Incompatible change in the third argument of 'format-time-string'.
  Previously, any non-nil argument was interpreted as specifying Universal Time.
@@@ -2181,14 -1834,6 +2181,14 @@@ coding-system of your choice when invok
  ** New possible value for 'system-type': 'nacl'.
  This is used by Google's Native Client (NaCl).
  
 +---
 +** 'read-color' will now display the color names using the color itself
 +as the background color.
 +
 +---
 +** There is now a new variable 'flyspell-sort-corrections-function'
 +that allows changing the way corrections are sorted.
 +
  ** Miscellaneous name change
  
  ---
diff --combined etc/PROBLEMS
index 2ccb77113769cc9a6f446548f4bbbc96ef8c85af,be9400bf2647a79a9188d91b46d8fc72c848d053..4288808f407348b53ed50ae779a33babb9bbdbb8
@@@ -542,6 -542,26 +542,6 @@@ Other systems allow to set LD_RUN_PATH 
  Emacs is linked.  With LD_RUN_PATH set, the linker will include a
  specified run-time search path in the executable.
  
 -On some systems, Emacs can crash due to problems with dynamic
 -linking.  Specifically, on SGI Irix 6.5, crashes were reported with
 -backtraces like this:
 -
 -  (dbx) where
 -   0 strcmp(0xf49239d, 0x4031184, 0x40302b4, 0x12, 0xf0000000, 0xf4923aa, 0x0, 0x492ddb2) ["/xlv22/ficus-jan23/work/irix/lib/libc/libc_n32_M3_ns/strings/strcmp.s":35, 0xfb7e480]
 -   1 general_find_symbol(0xf49239d, 0x0, 0x0, 0x0, 0xf0000000, 0xf4923aa, 0x0, 0x492ddb2)
 - ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld.c":2140, 0xfb65a98]
 -   2 resolve_symbol(0xf49239d, 0x4031184, 0x0, 0xfbdd438, 0x0, 0xf4923aa, 0x0, 0x492ddb2)
 - ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld.c":1947, 0xfb657e4]
 -   3 lazy_text_resolve(0xd18, 0x1a3, 0x40302b4, 0x12, 0xf0000000, 0xf4923aa, 0x0, 0x492ddb2)
 - ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld.c":997, 0xfb64d44]
 -   4 _rld_text_resolve(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
 - ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld_bridge.s":175, 0xfb6032c]
 -
 -('rld' is the dynamic linker.)  We don't know why this
 -happens, but setting the environment variable LD_BIND_NOW to 1 (which
 -forces the dynamic linker to bind all shared objects early on) seems
 -to work around the problem.
 -
  Please refer to the documentation of your dynamic linker for details.
  
  *** When you run Ispell from Emacs, it reports a "misalignment" error.
@@@ -578,6 -598,17 +578,6 @@@ you have a personal configuration file 
  can cause this error.  Remove that file, execute 'ispell-kill-ispell'
  in Emacs, and then try spell-checking again.
  
 -*** Emacs eats all file descriptors when using kqueue file notifications.
 -See <http://debbugs.gnu.org/22814>.
 -
 -When you have a large number of buffers running auto-revert-mode, and
 -Emacs is configured to use the kqueue file notification library, it
 -uses an own file descriptor for every watched file.  On systems with a
 -small limit of file descriptors allowed per process, like OS X, you
 -could run out of file descriptors.  You won't be able to open new files.
 -
 -auto-revert-use-notify is set to nil in global-auto-revert-mode, therefore.
 -
  * Runtime problems related to font handling
  
  ** Characters are displayed as empty boxes or with wrong font under X.
@@@ -1909,6 -1940,14 +1909,6 @@@ This seems to be a GCC optimization bu
  and -g -O2) and GCC 4.2.3 (-g -O and -g -O2).  You can fix this by
  compiling with GCC 4.2.3 or CC 5.7, with no optimizations.
  
 -** Irix
 -
 -*** Irix: Trouble using ptys, or running out of ptys.
 -
 -The program mkpts (which may be in '/usr/adm' or '/usr/sbin') needs to
 -be set-UID to root, or non-root programs like Emacs will not be able
 -to allocate ptys reliably.
 -
  * Runtime problems specific to MS-Windows
  
  ** Emacs on Windows 9X requires UNICOWS.DLL
@@@ -2181,11 -2220,11 +2181,11 @@@ month names with consistent widths for 
  of Windows.  This is caused by a deficiency in the underlying system
  library function.
  
- ** Problems with set-time-zone-rule function
+ ** Non-US time zones.
  
- The function set-time-zone-rule gives incorrect results for many
- non-US timezones.  This is due to over-simplistic handling of
daylight savings switchovers by the Windows libraries.
+ Many non-US time zones are implemented incorrectly.  This is due to
+ over-simplistic handling of daylight savings switchovers by the
+ Windows libraries.
  
  ** Files larger than 4GB report wrong size in a 32-bit Windows build
  
diff --combined lisp/calendar/solar.el
index bf8bedd599e0f170261e085c6a9d433594de4a21,c78d2bbf51977dcf61f19e354b3dadd81f3dacf6..6fec8055319d87496a416279e8fbcd92cbb479f5
@@@ -65,10 -65,10 +65,10 @@@ and `am-pm' and `time-zone', both alpha
  
  For example, the form
  
 -  '(24-hours \":\" minutes
 +   (24-hours \":\" minutes
      (if time-zone \" (\") time-zone (if time-zone \")\"))
  
 -would give military-style times like `21:07 (UTC)'."
 +would give military-style times like \"21:07 (UTC)\"."
    :type 'sexp
    :risky t
    :group 'calendar)
@@@ -173,7 -173,7 +173,7 @@@ delta.  At present, delta = 0.01 degree
  ;;; End of user options.
  
  (defvar solar-sidereal-time-greenwich-midnight nil
-   "Sidereal time at Greenwich at midnight (universal time).")
+   "Sidereal time at Greenwich at midnight (Universal Time).")
  
  (defvar solar-northern-spring-or-summer-season nil
    "Non-nil if northern spring or summer and nil otherwise.
@@@ -413,8 -413,8 +413,8 @@@ Result is in days.  For the years 1800-
  (defun solar-ephemeris-time (time)
    "Ephemeris Time at moment TIME.
  TIME is a pair with the first component being the number of Julian centuries
- elapsed at 0 Universal Time, and the second component being the universal
time.  For instance, the pair corresponding to November 28, 1995 at 16 UT is
+ elapsed at 0 Universal Time, and the second component counting Universal Time
hours.  For instance, the pair corresponding to November 28, 1995 at 16 UT is
  \(-0.040945 16), -0.040945 being the number of Julian centuries elapsed between
  Jan 1, 2000 at 12 UT and November 28, 1995 at 0 UT.
  
@@@ -430,7 -430,7 +430,7 @@@ Result is in Julian centuries of epheme
    "Right ascension (in hours) and declination (in degrees) of the sun at TIME.
  TIME is a pair with the first component being the number of
  Julian centuries elapsed at 0 Universal Time, and the second
- component being the universal time.  For instance, the pair
+ component counting Universal Time hours.  For instance, the pair
  corresponding to November 28, 1995 at 16 UT is (-0.040945 16),
  -0.040945 being the number of Julian centuries elapsed between
  Jan 1, 2000 at 12 UT and November 28, 1995 at 0 UT.  SUNRISE-FLAG is passed
@@@ -444,7 -444,7 +444,7 @@@ to `solar-ecliptic-coordinates'.
    "Azimuth and height of the sun at TIME, LATITUDE, and LONGITUDE.
  TIME is a pair with the first component being the number of
  Julian centuries elapsed at 0 Universal Time, and the second
- component being the universal time.  For instance, the pair
+ component counting Universal Time hours.  For instance, the pair
  corresponding to November 28, 1995 at 16 UT is (-0.040945 16),
  -0.040945 being the number of Julian centuries elapsed between
  Jan 1, 2000 at 12 UT and November 28, 1995 at 0 UT.  SUNRISE-FLAG
@@@ -476,8 -476,8 +476,8 @@@ Sunrise if DIRECTION =-1 or sunset if =
  being TIME.
  
  TIME is a pair with the first component being the number of Julian centuries
- elapsed at 0 Universal Time, and the second component being the universal
time.  For instance, the pair corresponding to November 28, 1995 at 16 UT is
+ elapsed at 0 Universal Time, and the second component counting Universal Time
hours.  For instance, the pair corresponding to November 28, 1995 at 16 UT is
  \(-0.040945 16), -0.040945 being the number of Julian centuries elapsed between
  Jan 1, 2000 at 12 UT and November 28, 1995 at 0 UT.
  
@@@ -522,8 -522,8 +522,8 @@@ Uses binary search.
  Parameters are the midday TIME and the LATITUDE, LONGITUDE of the location.
  
  TIME is a pair with the first component being the number of Julian centuries
- elapsed at 0 Universal Time, and the second component being the universal
time.  For instance, the pair corresponding to November 28, 1995 at 16 UT is
+ elapsed at 0 Universal Time, and the second component counting Universal Time
hours.  For instance, the pair corresponding to November 28, 1995 at 16 UT is
  \(-0.040945 16), -0.040945 being the number of Julian centuries elapsed between
  Jan 1, 2000 at 12 UT and November 28, 1995 at 0 UT.
  
index 1b06fb6a51d0195be2da15735a4934096abcfb40,592d69d2eb9c2432771ea9c72eb132fedc95e1ce..14e584df672b497aec216ab61a7b7dd0977444b2
@@@ -87,23 -87,6 +87,23 @@@ that text will be copied verbatim to `g
  (defconst generate-autoload-section-continuation ";;;;;; "
    "String to add on each continuation of the section header form.")
  
 +(defvar autoload-timestamps nil               ; experimental, see bug#22213
 +  "Non-nil means insert a timestamp for each input file into the output.
 +We use these in incremental updates of the output file to decide
 +if we need to rescan an input file.  If you set this to nil,
 +then we use the timestamp of the output file instead.  As a result:
 + - for fixed inputs, the output will be the same every time
 + - incremental updates of the output file might not be correct if:
 +   i) the timestamp of the output file cannot be trusted (at least
 +     relative to that of the input files)
 +   ii) any of the input files can be modified during the time it takes
 +      to create the output
 +   iii) only a subset of the input files are scanned
 +   These issues are unlikely to happen in practice, and would arguably
 +   represent bugs in the build system.  Item iii) will happen if you
 +   use a command like `update-file-autoloads', though, since it only
 +   checks a single input file.")
 +
  (defvar autoload-modified-buffers)      ;Dynamically scoped var.
  
  (defun make-autoload (form file &optional expansion)
@@@ -251,9 -234,22 +251,22 @@@ If a buffer is visiting the desired aut
        (enable-local-eval nil))
      ;; We used to use `raw-text' to read this file, but this causes
      ;; problems when the file contains non-ASCII characters.
-     (let ((delay-mode-hooks t))
-       (find-file-noselect
-        (autoload-ensure-default-file (autoload-generated-file))))))
+     (let* ((delay-mode-hooks t)
+            (file (autoload-generated-file))
+            (file-missing (not (file-exists-p file))))
+       (when file-missing
+         (autoload-ensure-default-file file))
+       (with-current-buffer
+           (find-file-noselect
+            (autoload-ensure-file-writeable
+             file))
+         ;; block backups when the file has just been created, since
+         ;; the backups will just be the auto-generated headers.
+         ;; bug#23203
+         (when file-missing
+           (setq buffer-backed-up t)
+           (save-buffer))
+         (current-buffer)))))
  
  (defun autoload-generated-file ()
    (expand-file-name generated-autoload-file
@@@ -374,21 -370,22 +387,22 @@@ not be relied upon.
  ;;;###autoload
  (put 'autoload-ensure-writable 'risky-local-variable t)
  
+ (defun autoload-ensure-file-writeable (file)
+   ;; Probably pointless, but replaces the old AUTOGEN_VCS in lisp/Makefile,
+   ;; which was designed to handle CVSREAD=1 and equivalent.
+   (and autoload-ensure-writable
+        (let ((modes (file-modes file)))
+          (if (zerop (logand modes #o0200))
+              ;; Ignore any errors here, and let subsequent attempts
+              ;; to write the file raise any real error.
+              (ignore-errors (set-file-modes file (logior modes #o0200))))))
+   file)
  (defun autoload-ensure-default-file (file)
    "Make sure that the autoload file FILE exists, creating it if needed.
  If the file already exists and `autoload-ensure-writable' is non-nil,
  make it writable."
-   (if (file-exists-p file)
-       ;; Probably pointless, but replaces the old AUTOGEN_VCS in lisp/Makefile,
-       ;; which was designed to handle CVSREAD=1 and equivalent.
-       (and autoload-ensure-writable
-          (let ((modes (file-modes file)))
-            (if (zerop (logand modes #o0200))
-                ;; Ignore any errors here, and let subsequent attempts
-                ;; to write the file raise any real error.
-                (ignore-errors (set-file-modes file (logior modes #o0200))))))
-     (write-region (autoload-rubric file) nil file))
-   file)
+   (write-region (autoload-rubric file) nil file))
  
  (defun autoload-insert-section-header (outbuf autoloads load-name file time)
    "Insert the section-header line,
@@@ -641,9 -638,7 +655,9 @@@ FILE's modification time.
                                        ;; We'd really want to just use
                                        ;; `emacs-internal' instead.
                                        nil nil 'emacs-mule-unix)
 -                               (nth 5 (file-attributes relfile))))
 +                               (if autoload-timestamps
 +                                   (nth 5 (file-attributes relfile))
 +                                 t)))
                              (insert ";;; Generated autoloads from " relfile "\n")))
                          (insert generate-autoload-section-trailer))))
                    (or noninteractive
        (let ((version-control 'never))
        (save-buffer)))))
  
 +;; FIXME This command should be deprecated.
 +;; See http://debbugs.gnu.org/22213#41
  ;;;###autoload
  (defun update-file-autoloads (file &optional save-after outfile)
    "Update the autoloads for FILE.
@@@ -693,9 -686,6 +707,9 @@@ Return FILE if there was no autoload co
                     (read-file-name "Write autoload definitions to file: ")))
    (let* ((generated-autoload-file (or outfile generated-autoload-file))
         (autoload-modified-buffers nil)
 +       ;; We need this only if the output file handles more than one input.
 +       ;; See http://debbugs.gnu.org/22213#38 and subsequent.
 +       (autoload-timestamps t)
           (no-autoloads (autoload-generate-file-autoloads file)))
      (if autoload-modified-buffers
          (if save-after (autoload-save-buffers))
@@@ -713,9 -703,6 +727,9 @@@ removes any prior now out-of-date autol
    (catch 'up-to-date
      (let* ((buf (current-buffer))
             (existing-buffer (if buffer-file-name buf))
 +           (output-file (autoload-generated-file))
 +           (output-time (if (file-exists-p output-file)
 +                            (nth 5 (file-attributes output-file))))
             (found nil))
        (with-current-buffer (autoload-find-generated-file)
          ;; This is to make generated-autoload-file have Unix EOLs, so
                           (file-time (nth 5 (file-attributes file))))
                       (if (and (or (null existing-buffer)
                                    (not (buffer-modified-p existing-buffer)))
 -                              (or
 +                              (cond
                                 ;; last-time is the time-stamp (specifying
                                 ;; the last time we looked at the file) and
                                 ;; the file hasn't been changed since.
 -                               (and (listp last-time)
 -                                    (not (time-less-p last-time file-time)))
 +                               ((listp last-time)
 +                                (not (time-less-p last-time file-time)))
 +                               ;; FIXME? Arguably we should throw a
 +                               ;; user error, or some kind of warning,
 +                               ;; if we were called from update-file-autoloads,
 +                               ;; which can update only a single input file.
 +                               ;; It's not appropriate to use the output
 +                               ;; file modtime in such a case,
 +                               ;; if there are multiple input files
 +                               ;; contributing to the output.
 +                               ((and output-time (eq t last-time))
 +                                (not (time-less-p output-time file-time)))
                                 ;; last-time is an MD5 checksum instead.
 -                               (and (stringp last-time)
 -                                    (equal last-time
 -                                           (md5 buf nil nil 'emacs-mule)))))
 +                               ((stringp last-time)
 +                                (equal last-time
 +                                     (md5 buf nil nil 'emacs-mule)))))
                           (throw 'up-to-date nil)
                         (autoload-remove-section begin)
                         (setq found t))))
@@@ -819,10 -796,7 +833,10 @@@ write its autoloads into the specified 
         (generated-autoload-file
          (if (called-interactively-p 'interactive)
              (read-file-name "Write autoload definitions to file: ")
 -          generated-autoload-file)))
 +          generated-autoload-file))
 +       (output-time
 +        (if (file-exists-p generated-autoload-file)
 +            (nth 5 (file-attributes generated-autoload-file)))))
  
      (with-current-buffer (autoload-find-generated-file)
        (save-excursion
                   ;; Remove the obsolete section.
                   (autoload-remove-section (match-beginning 0))
                   (setq last-time (nth 4 form))
 +                 (if (equal t last-time)
 +                     (setq last-time output-time))
                   (dolist (file file)
                     (let ((file-time (nth 5 (file-attributes file))))
                       (when (and file-time
                         (member (expand-file-name file) autoload-excludes))
                     ;; Remove the obsolete section.
                   (autoload-remove-section (match-beginning 0)))
 -                ((not (time-less-p (nth 4 form)
 +                ((not (time-less-p (let ((oldtime (nth 4 form)))
 +                                     (if (equal t oldtime)
 +                                         output-time
 +                                       oldtime))
                                       (nth 5 (file-attributes file))))
                   ;; File hasn't changed.
                   nil)
          (goto-char (point-max))
          (search-backward "\f" nil t)
          (autoload-insert-section-header
 -         (current-buffer) nil nil no-autoloads no-autoloads-time)
 +         (current-buffer) nil nil no-autoloads (if autoload-timestamps
 +                                                   no-autoloads-time
 +                                                 t))
          (insert generate-autoload-section-trailer)))
  
        (let ((version-control 'never))
diff --combined lisp/gnus/gnus-art.el
index ca4758286425bb5a511964f98a08e564247f46d0,66b1e38da2efe09141af42cc3fb9c9268aa953ed..94ebbdd60c7f111c302b277fecaa11af53dd7721
@@@ -266,11 -266,18 +266,11 @@@ This can also be a list of the above va
  ;; Fixme: This isn't the right thing for mixed graphical and non-graphical
  ;; frames in a session.
  (defcustom gnus-article-x-face-command
 -  (if (featurep 'xemacs)
 -      (if (or (gnus-image-type-available-p 'xface)
 -            (gnus-image-type-available-p 'pbm))
 -        'gnus-display-x-face-in-from
 -      "{ echo \
 +  (if (gnus-image-type-available-p 'pbm)
 +      'gnus-display-x-face-in-from
 +    "{ echo \
  '/* Format_version=1, Width=48, Height=48, Depth=1, Valid_bits_per_item=16 */'\
 -; uncompface; } | icontopbm | ee -")
 -    (if (gnus-image-type-available-p 'pbm)
 -      'gnus-display-x-face-in-from
 -      "{ echo \
 -'/* Format_version=1, Width=48, Height=48, Depth=1, Valid_bits_per_item=16 */'\
 -; uncompface; } | icontopbm | display -"))
 +; uncompface; } | icontopbm | display -")
    "*String or function to be executed to display an X-Face header.
  If it is a string, the command will be executed in a sub-shell
  asynchronously.  The compressed face will be piped to this command."
@@@ -477,7 -484,9 +477,7 @@@ and the latter avoids underlining any w
  Example: (_/*word*/_)."
    :group 'gnus-article-emphasis)
  
 -(defface gnus-emphasis-strikethru (if (featurep 'xemacs)
 -                                    '((t (:strikethru t)))
 -                                  '((t (:strike-through t))))
 +(defface gnus-emphasis-strikethru '((t (:strike-through t)))
    "Face used for displaying strike-through text (-word-)."
    :group 'gnus-article-emphasis)
  
@@@ -702,6 -711,13 +702,6 @@@ The following additional specs are avai
    :type 'hook
    :group 'gnus-article-various)
  
 -(when (featurep 'xemacs)
 -  ;; Extracted from gnus-xmas-define in order to preserve user settings
 -  (when (fboundp 'turn-off-scroll-in-place)
 -    (add-hook 'gnus-article-mode-hook 'turn-off-scroll-in-place))
 -  ;; Extracted from gnus-xmas-redefine in order to preserve user settings
 -  (add-hook 'gnus-article-mode-hook 'gnus-xmas-article-menu-add))
 -
  (defcustom gnus-article-menu-hook nil
    "*Hook run after the creation of the article mode menu."
    :type 'hook
@@@ -867,8 -883,10 +867,8 @@@ be displayed by the first non-nil match
                               (item :tag "skip" nil)
                               (face :value default)))))
  
 -(defcustom gnus-face-properties-alist (if (featurep 'xemacs)
 -                                        '((xface . (:face gnus-x-face)))
 -                                      '((pbm . (:face gnus-x-face))
 -                                        (png . nil)))
 +(defcustom gnus-face-properties-alist '((pbm . (:face gnus-x-face))
 +                                      (png . nil))
    "Alist of image types and properties applied to Face and X-Face images.
  Here are examples:
  
  
  See the manual for the valid properties for various image types.
  Currently, `pbm' is used for X-Face images and `png' is used for Face
 -images in Emacs.  Only the `:face' property is effective on the `xface'
 -image type in XEmacs if it is built with the libcompface library."
 +images in Emacs."
    :version "23.1" ;; No Gnus
    :group 'gnus-article-headers
    :type '(repeat (cons :format "%v" (symbol :tag "Image type") plist)))
@@@ -1009,7 -1028,7 +1009,7 @@@ on parts -- for instance, adding Vcard 
  
  (defcustom gnus-article-date-headers '(combined-lapsed)
    "A list of Date header formats to display.
- Valid formats are `ut' (universal time), `local' (local time
+ Valid formats are `ut' (Universal Time), `local' (local time
  zone), `english' (readable English), `lapsed' (elapsed time),
  `combined-lapsed' (both the original date and the elapsed time),
  `original' (the original date header), `iso8601' (ISO8601
@@@ -1393,7 -1412,7 +1393,7 @@@ predicate.  See Info node `(gnus)Custom
    :type gnus-article-treat-custom)
  (put 'gnus-treat-overstrike 'highlight t)
  
 -(defcustom gnus-treat-ansi-sequences (if (locate-library "ansi-color") t)
 +(defcustom gnus-treat-ansi-sequences t
    "Treat ANSI SGR control sequences.
  Valid values are nil, t, `head', `first', `last', an integer or a
  predicate.  See Info node `(gnus)Customizing Articles'."
  (defcustom gnus-treat-display-x-face
    (and (not noninteractive)
         (gnus-image-type-available-p 'xbm)
 -       (if (featurep 'xemacs)
 -         (featurep 'xface)
 -       (condition-case nil
 -             (and (string-match "^0x" (shell-command-to-string "uncompface"))
 -                  (executable-find "icontopbm"))
 -           ;; shell-command-to-string may signal an error, e.g. if
 -           ;; shell-file-name is not found.
 -           (error nil)))
 +       (condition-case nil
 +         (and (string-match "^0x" (shell-command-to-string "uncompface"))
 +              (executable-find "icontopbm"))
 +       ;; shell-command-to-string may signal an error, e.g. if
 +       ;; shell-file-name is not found.
 +       (error nil))
         'head)
    "Display X-Face headers.
  Valid values are nil and `head'.
@@@ -2066,7 -2087,7 +2066,7 @@@ always hide.
                     (- gnus-article-normalized-header-length column)
                     ? )))
           ((> column gnus-article-normalized-header-length)
 -          (gnus-put-text-property
 +          (put-text-property
             (progn
               (forward-char gnus-article-normalized-header-length)
               (point))
@@@ -2096,17 -2117,21 +2096,17 @@@ try this wash.
    "Translate many Unicode characters into their ASCII equivalents."
    (interactive)
    (require 'org-entities)
 -  (let ((table (make-char-table (if (featurep 'xemacs) 'generic))))
 +  (let ((table (make-char-table nil)))
      (dolist (elem org-entities)
        (when (and (listp elem)
                 (= (length (nth 6 elem)) 1))
 -      (if (featurep 'xemacs)
 -          (put-char-table (aref (nth 6 elem) 0) (nth 4 elem) table)
 -        (set-char-table-range table (aref (nth 6 elem) 0) (nth 4 elem)))))
 +      (set-char-table-range table (aref (nth 6 elem) 0) (nth 4 elem))))
      (save-excursion
        (when (article-goto-body)
        (let ((inhibit-read-only t)
              replace props)
          (while (not (eobp))
 -          (if (not (setq replace (if (featurep 'xemacs)
 -                                     (get-char-table (following-char) table)
 -                                   (aref table (following-char)))))
 +          (if (not (setq replace (aref table (following-char))))
                (forward-char 1)
              (if (prog1
                      (setq props (text-properties-at (point)))
@@@ -2289,6 -2314,8 +2289,6 @@@ long lines if and only if arg is positi
        (setq truncate-lines nil))
       ((numberp arg)
        (setq truncate-lines t)))
 -    ;; In versions of Emacs 22 (CVS) before 2006-05-26,
 -    ;; `toggle-truncate-lines' needs an argument.
      (toggle-truncate-lines)))
  
  (defun gnus-article-treat-body-boundary ()
        (goto-char (point-max))
        (let ((start (point)))
        (insert "X-Boundary: ")
 -      (gnus-add-text-properties start (point) gnus-hidden-properties)
 +      (add-text-properties start (point) gnus-hidden-properties)
         (insert (let (str (max (window-width)))
 -                 (if (featurep 'xemacs)
 -                     (setq max (1- max)))
                   (while (>= max (length str))
                    (setq str (concat str gnus-body-boundary-delimiter)))
                   (substring str 0 max))
                "\n")
 -      (gnus-put-text-property start (point) 'gnus-decoration 'header)))))
 +      (put-text-property start (point) 'gnus-decoration 'header)))))
  
  (defun article-fill-long-lines ()
    "Fill lines that are wider than the window width."
                   ;; The command is a string, so we interpret the command
                   ;; as a, well, command, and fork it off.
                   (let ((process-connection-type nil))
 -                   (gnus-set-process-query-on-exit-flag
 +                   (set-process-query-on-exit-flag
                      (start-process
                       "article-x-face" nil shell-file-name
                       shell-command-switch gnus-article-x-face-command)
@@@ -2512,7 -2541,7 +2512,7 @@@ If PROMPT (the prefix), prompt for a co
              ctl (and ct (mail-header-parse-content-type ct))
              charset (cond
                       (prompt
 -                      (mm-read-coding-system "Charset to decode: "))
 +                      (read-coding-system "Charset to decode: "))
                       (ctl
                        (mail-content-type-get ctl 'charset)))
              format (and ctl (mail-content-type-get ctl 'format)))
@@@ -2633,7 -2662,7 +2633,7 @@@ If READ-CHARSET, ask for a coding syste
              (if (stringp charset)
                  (setq charset (intern (downcase charset)))))))
        (if read-charset
 -        (setq charset (mm-read-coding-system "Charset: " charset)))
 +        (setq charset (read-coding-system "Charset: " charset)))
        (unless charset
        (setq charset gnus-newsgroup-charset))
        (when (or force
@@@ -2661,7 -2690,7 +2661,7 @@@ If READ-CHARSET, ask for a coding syste
              (if (stringp charset)
                  (setq charset (intern (downcase charset)))))))
        (if read-charset
 -        (setq charset (mm-read-coding-system "Charset: " charset)))
 +        (setq charset (read-coding-system "Charset: " charset)))
        (unless charset
        (setq charset gnus-newsgroup-charset))
        (when (or force
        (save-restriction
          (narrow-to-region (point) (point-max))
          (base64-decode-region (point-min) (point-max))
 -        (mm-decode-coding-region
 +        (decode-coding-region
           (point-min) (point-max)
           (mm-charset-to-coding-system charset nil t)))))))
  
 -(eval-when-compile
 -  (require 'rfc1843))
 +(declare-function rfc1843-decode-region "rfc1843" (from to))
  
  (defun article-decode-HZ ()
    "Translate a HZ-encoded article."
        (while (re-search-forward
              "\\(\\(https?\\|ftp\\)://\\S-+\\) *\n\\(\\S-+\\)" nil t)
        (replace-match "\\1\\3" t)))
 -    (when (gmm-called-interactively-p 'any)
 +    (when (called-interactively-p 'any)
        (gnus-treat-article nil))))
  
  (defun article-wash-html ()
@@@ -2747,7 -2777,7 +2747,7 @@@ summary buffer.
        (cond ((file-directory-p file)
             (when (or (not (eq how 'file))
                       (gnus-y-or-n-p
 -                      (gnus-format-message
 +                      (format-message
                         "Delete temporary HTML file(s) in directory `%s'? "
                         (file-name-as-directory file))))
               (gnus-delete-directory file)))
@@@ -2853,7 -2883,7 +2853,7 @@@ message header will be added to the bod
  <img[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*src=\"\\(cid:\\([^\"]+\\)\\)\""
                                           nil t)
                   (unless cid-dir
 -                   (setq cid-dir (mm-make-temp-file "cid" t))
 +                   (setq cid-dir (make-temp-file "cid" t))
                     (add-to-list 'gnus-article-browse-html-temp-list cid-dir))
                   (setq file nil
                         content nil)
                     (replace-match cid-file nil nil nil 1))))
               (unless content (setq content (buffer-string))))
             (when (or charset header (not file))
 -             (setq tmp-file (mm-make-temp-file
 +             (setq tmp-file (make-temp-file
                               ;; Do we need to care for 8.3 filenames?
                               "mm-" nil ".html")))
             ;; Add a meta html tag to specify charset and a header.
                   ;; charset specified in parts might be different.
                   (if (eq charset 'gnus-decoded)
                       (setq charset 'utf-8
 -                           eheader (mm-encode-coding-string (buffer-string)
 -                                                            charset)
 +                           eheader (encode-coding-string (buffer-string)
 +                                                         charset)
                             title (when title
 -                                   (mm-encode-coding-string title charset))
 -                           body (mm-encode-coding-string content charset))
 +                                   (encode-coding-string title charset))
 +                           body (encode-coding-string content charset))
                     (setq hcharset (mm-find-mime-charset-region (point-min)
                                                                 (point-max)))
                     (cond ((= (length hcharset) 1)
                                     (mm-charset-to-coding-system charset
                                                                  nil t))
                               (if (eq coding body)
 -                                 (setq eheader (mm-encode-coding-string
 +                                 (setq eheader (encode-coding-string
                                                  (buffer-string) coding)
                                         title (when title
 -                                               (mm-encode-coding-string
 +                                               (encode-coding-string
                                                  title coding))
                                         body content)
                                 (setq charset 'utf-8
 -                                     eheader (mm-encode-coding-string
 +                                     eheader (encode-coding-string
                                                (buffer-string) charset)
                                       title (when title
 -                                             (mm-encode-coding-string
 +                                             (encode-coding-string
                                                title charset))
 -                                     body (mm-encode-coding-string
 -                                           (mm-decode-coding-string
 +                                     body (encode-coding-string
 +                                           (decode-coding-string
                                              content body)
                                             charset))))
                           (setq charset hcharset
 -                               eheader (mm-encode-coding-string
 +                               eheader (encode-coding-string
                                          (buffer-string) coding)
                                 title (when title
 -                                       (mm-encode-coding-string
 +                                       (encode-coding-string
                                          title coding))
                                 body content))
 -                     (setq eheader (mm-string-as-unibyte (buffer-string))
 +                     (setq eheader (string-as-unibyte (buffer-string))
                             body content)))
                   (erase-buffer)
                   (mm-disable-multibyte)
              (charset
               (mm-with-unibyte-buffer
                 (insert (if (eq charset 'gnus-decoded)
 -                           (mm-encode-coding-string content
 -                                                    (setq charset 'utf-8))
 +                           (encode-coding-string content
 +                                                 (setq charset 'utf-8))
                           content))
                 (if (or (mm-add-meta-html-tag handle charset)
                         (not file))
@@@ -4131,7 -4161,8 +4131,7 @@@ and the raw article including all heade
        (setq command
            (if (and (eq command 'default) default)
                default
 -            (gnus-read-shell-command "Shell command on this article: "
 -                                     default))))
 +            (read-shell-command "Shell command on this article: " default))))
      (when (string-equal command "")
        (if default
          (setq command default)
@@@ -4295,6 -4326,8 +4295,6 @@@ If variable `gnus-use-long-file-name' i
                  (put-text-property (match-end 0) (point-max)
                                     'face eface)))))))))
  
 -(autoload 'canlock-verify "canlock" nil t) ;; for XEmacs.
 -
  (defun article-verify-cancel-lock ()
    "Verify Cancel-Lock header."
    (interactive)
   'undefined 'gnus-article-read-summary-keys gnus-article-mode-map)
  
  (defvar gnus-article-send-map)
 -
  (gnus-define-keys (gnus-article-send-map "S" gnus-article-mode-map)
 -  "W" gnus-article-wide-reply-with-original)
 -(if (featurep 'xemacs)
 -    (set-keymap-default-binding gnus-article-send-map
 -                              'gnus-article-read-summary-send-keys)
 -  (define-key gnus-article-send-map [t] 'gnus-article-read-summary-send-keys))
 +  "W" gnus-article-wide-reply-with-original
 +  [t] 'gnus-article-read-summary-send-keys)
  
  (defun gnus-article-make-menu-bar ()
    (unless (boundp 'gnus-article-commands-menu)
@@@ -4485,8 -4522,8 +4485,8 @@@ commands
    (make-local-variable 'gnus-article-ignored-charsets)
    (set (make-local-variable 'bookmark-make-record-function)
         'gnus-summary-bookmark-make-record)
 -  ;; Prevent Emacs 22 from displaying non-break space with `nobreak-space'
 -  ;; face.
 +  ;; Prevent Emacs from displaying non-break space with
 +  ;; `nobreak-space' face.
    (set (make-local-variable 'nobreak-char-display) nil)
    ;; Enable `gnus-article-remove-images' to delete images shr.el renders.
    (set (make-local-variable 'shr-put-image-function) 'gnus-shr-put-image)
  (defun gnus-article-stop-animations ()
    (dolist (timer (and (boundp 'timer-list)
                      timer-list))
 -    (when (eq (gnus-timer--function timer) 'image-animate-timeout)
 +    (when (eq (timer--function timer) 'image-animate-timeout)
        (cancel-timer timer))))
  
  (defun gnus-stop-downloads ()
@@@ -4608,7 -4645,8 +4608,7 @@@ If ALL-HEADERS is non-nil, no headers a
        (gnus-article-setup-buffer)
        (set-buffer gnus-article-buffer)
        ;; Deactivate active regions.
 -      (when (and (boundp 'transient-mark-mode)
 -                 transient-mark-mode)
 +      (when transient-mark-mode
          (setq mark-active nil))
        (if (not (setq result (let ((inhibit-read-only t))
                                (gnus-request-article-this-buffer
@@@ -4868,8 -4906,8 +4868,8 @@@ General format specifiers can also be u
  
  (defvar gnus-mime-button-map
    (let ((map (make-sparse-keymap)))
 -    (define-key map gnus-mouse-2 'gnus-article-push-button)
 -    (define-key map gnus-down-mouse-3 'gnus-mime-button-menu)
 +    (define-key map [mouse-2] 'gnus-article-push-button)
 +    (define-key map [down-mouse-3] 'gnus-mime-button-menu)
      (dolist (c gnus-mime-button-commands)
        (define-key map (cadr c) (car c)))
      map))
@@@ -5012,6 -5050,7 +5012,6 @@@ and `gnus-mime-delete-part', and not pr
          (let ((mbl1 mml-buffer-list))
            (setq mml-buffer-list mbl)
            (set (make-local-variable 'mml-buffer-list) mbl1))
 -        (gnus-make-local-hook 'kill-buffer-hook)
          (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)))
       `(lambda (no-highlight)
        (let ((mail-parse-charset (or gnus-article-charset
@@@ -5255,7 -5294,7 +5255,7 @@@ are decompressed.
         ((numberp arg)
        (setq charset (or (cdr (assq arg
                                     gnus-summary-show-article-charset-alist))
 -                        (mm-read-coding-system "Charset: ")))))
 +                        (read-coding-system "Charset: ")))))
        (switch-to-buffer (generate-new-buffer filename))
        (if (or coding-system
              (and charset
                   (not (eq coding-system 'ascii))))
          (progn
            (mm-enable-multibyte)
 -          (insert (mm-decode-coding-string contents coding-system))
 -          (setq buffer-file-coding-system
 -                (if (boundp 'last-coding-system-used)
 -                    (symbol-value 'last-coding-system-used)
 -                  coding-system)))
 +          (insert (decode-coding-string contents coding-system))
 +          (setq buffer-file-coding-system last-coding-system-used))
        (mm-disable-multibyte)
        (insert contents)
        (setq buffer-file-coding-system mm-binary-coding-system))
    (gnus-article-check-buffer)
    (let* ((handle (or handle (get-text-property (point) 'gnus-data)))
         (contents (and handle (mm-get-part handle)))
 -       (file (mm-make-temp-file (expand-file-name "mm." mm-tmp-directory)))
 +       (file (make-temp-file (expand-file-name "mm." mm-tmp-directory)))
         (printer (mailcap-mime-info (mm-handle-media-type handle) "print")))
      (when contents
        (if printer
@@@ -5352,9 -5394,18 +5352,9 @@@ Compressed files like .gz and .bz2 are 
        (let ((displayed-p (mm-handle-displayed-p handle)))
        (gnus-insert-mime-button handle (get-text-property btn 'gnus-part)
                                 (list displayed-p))
 -      (if (featurep 'emacs)
 -          (delete-region
 -           (point)
 -           (next-single-property-change (point) 'gnus-data nil (point-max)))
 -        (let* ((end (next-single-property-change (point) 'gnus-data))
 -               (annots (annotations-at (or end (point-max)))))
 -          (delete-region (point)
 -                         (if end
 -                             (if annots (1+ end) end)
 -                           (point-max)))
 -          (dolist (annot annots)
 -            (set-extent-endpoints annot (point) (point)))))
 +      (delete-region
 +       (point)
 +       (next-single-property-change (point) 'gnus-data nil (point-max)))
        (setq start (point))
        (if (search-backward "\n\n" nil t)
            (progn
@@@ -5415,7 -5466,7 +5415,7 @@@ specified charset.
                           (or (cdr (assq
                                     arg
                                     gnus-summary-show-article-charset-alist))
 -                             (mm-read-coding-system "Charset: "))))
 +                             (read-coding-system "Charset: "))))
              (if (mm-handle-undisplayer handle)
                  (mm-remove-part handle)))
        (gnus-mime-set-charset-parameters handle charset)
@@@ -5530,7 -5581,7 +5530,7 @@@ If INTERACTIVE, call FUNCTION interacti
                             window
                           (setq window (selected-window))
                           ;; Article may be displayed in the other frame.
 -                         (gnus-select-frame-set-input-focus
 +                         (select-frame-set-input-focus
                            (prog1
                                frame
                              (setq frame (selected-frame))))))
                             (get-text-property (point) 'gnus-data))))
                (set-marker overlay-arrow-position nil)
                (unless gnus-auto-select-part
 -                (gnus-select-frame-set-input-focus frame)
 +                (select-frame-set-input-focus frame)
                  (select-window window))))
            t))
        (if gnus-inhibit-mime-unbuttonizing
@@@ -5737,9 -5788,18 +5737,9 @@@ all parts.
        ;; Toggle the button appearance between `[button]...' and `[button]'.
        (let ((displayed-p (mm-handle-displayed-p handle)))
        (gnus-insert-mime-button handle id (list displayed-p))
 -      (if (featurep 'emacs)
 -          (delete-region
 -           (point)
 -           (next-single-property-change (point) 'gnus-data nil (point-max)))
 -        (let* ((end (next-single-property-change (point) 'gnus-data))
 -               (annots (annotations-at (or end (point-max)))))
 -          (delete-region (point)
 -                         (if end
 -                             (if annots (1+ end) end)
 -                           (point-max)))
 -          (dolist (annot annots)
 -            (set-extent-endpoints annot (point) (point)))))
 +      (delete-region
 +       (point)
 +       (next-single-property-change (point) 'gnus-data nil (point-max)))
        (setq start (point))
        (if (search-backward "\n\n" nil t)
            (progn
       :button-keymap gnus-mime-button-map
       :help-echo
       (lambda (widget)
 -       ;; Needed to properly clear the message due to a bug in
 -       ;; wid-edit (XEmacs only).
 -       (if (boundp 'help-echo-owns-message)
 -         (setq help-echo-owns-message t))
         (format
        "%S: %s the MIME part; %S: more options"
 -      (aref gnus-mouse-2 0)
 +      'mouse-2
        (if (mm-handle-displayed-p (widget-get widget :mime-handle))
            "hide" "show")
 -      (aref gnus-down-mouse-3 0))))))
 +      'down-mouse-3)))))
  
  (defun gnus-widget-press-button (elems _el)
    (goto-char (widget-get elems :from))
@@@ -6100,7 -6164,8 +6100,7 @@@ If nil, don't show those extra buttons.
  
  (defun gnus-article-insert-newline ()
    "Insert a newline, but mark it as undeletable."
 -  (gnus-put-text-property
 -   (point) (progn (insert "\n") (point)) 'gnus-undeletable t))
 +  (put-text-property (point) (progn (insert "\n") (point)) 'gnus-undeletable t))
  
  (defun gnus-mime-display-alternative (handles &optional preferred ibegend id)
    (let* ((preferred (or preferred (mm-preferred-alternative handles)))
                  (not preferred)
                  (not (gnus-unbuttonized-mime-type-p
                        "multipart/alternative")))
 -        (gnus-add-text-properties
 +        (add-text-properties
           (setq from (point))
           (progn
             (insert (format "%d.  " id))
               (gnus-mime-display-alternative
                ',ihandles ',not-pref ',begend ,id))
             keymap ,gnus-mime-button-map
 -           ,gnus-mouse-face-prop ,gnus-article-mouse-face
 +           mouse-face ,gnus-article-mouse-face
             face ,gnus-article-button-face
             gnus-part ,id
             article-type multipart
             rear-nonsticky t))
          (widget-convert-button 'link from (point)
 -                               :action 'gnus-widget-press-button
 -                               :button-keymap gnus-widget-button-keymap)
 +                               :action 'gnus-widget-press-button)
          ;; Do the handles
          (while (setq handle (pop handles))
 -          (gnus-add-text-properties
 +          (add-text-properties
             (setq from (point))
             (progn
               (insert (format "(%c) %-18s"
                 (gnus-mime-display-alternative
                  ',ihandles ',handle ',begend ,id))
               keymap ,gnus-mime-button-map
 -             ,gnus-mouse-face-prop ,gnus-article-mouse-face
 +             mouse-face ,gnus-article-mouse-face
               face ,gnus-article-button-face
               gnus-part ,id
               gnus-data ,handle
               rear-nonsticky t))
            (widget-convert-button 'link from (point)
 -                                 :action 'gnus-widget-press-button
 -                                 :button-keymap gnus-widget-button-keymap)
 +                                 :action 'gnus-widget-press-button)
            (insert "  "))
          (insert "\n\n"))
        (when preferred
@@@ -6283,7 -6350,7 +6283,7 @@@ Provided for backwards compatibility.
                 (not (with-current-buffer gnus-summary-buffer
                        gnus-have-all-headers)))
             (not gnus-inhibit-hiding))
 -    (gnus-article-hide-headers)))
 +    (article-hide-headers)))
  
  (declare-function shr-put-image "shr" (data alt &optional flags))
  
@@@ -6439,13 -6506,14 +6439,13 @@@ the coding cookie.
        (when coding
        ;; If the coding system is not suitable to encode the text,
        ;; ask a user for a proper one.
 -      (when (fboundp 'select-safe-coding-system)
 -        (setq coding (coding-system-base
 -                      (save-window-excursion
 -                        (select-safe-coding-system (point-min) (point-max)
 -                                                   coding))))
 -        (setq coding-system-for-write
 -              (or (cdr (assq coding '((mule-utf-8 . utf-8))))
 -                  coding)))
 +      (setq coding (coding-system-base
 +                    (save-window-excursion
 +                      (select-safe-coding-system (point-min) (point-max)
 +                                                 coding))))
 +      (setq coding-system-for-write
 +            (or (cdr (assq coding '((mule-utf-8 . utf-8))))
 +                coding))
        (goto-char (point-min))
        ;; Add the coding cookie.
        (insert (format "X-Gnus-Coding-System: -*- coding: %s; -*-\n\n"
@@@ -6516,14 -6584,14 +6516,14 @@@ If given a numerical ARG, move forward 
    (interactive)
    (when (gnus-article-next-page)
      (goto-char (point-min))
 -    (gnus-article-read-summary-keys nil (gnus-character-to-event ?n))))
 +    (gnus-article-read-summary-keys nil ?n)))
  
  
  (defun gnus-article-goto-prev-page ()
    "Show the previous page of the article."
    (interactive)
    (if (save-restriction (widen) (bobp)) ;; Real beginning-of-buffer?
 -      (gnus-article-read-summary-keys nil (gnus-character-to-event ?p))
 +      (gnus-article-read-summary-keys nil ?p)
      (gnus-article-prev-page nil)))
  
  ;; This is cleaner but currently breaks `gnus-pick-mode':
  If end of article, return non-nil.  Otherwise return nil.
  Argument LINES specifies lines to be scrolled up."
    (interactive "p")
 -  (move-to-window-line (if (featurep 'xemacs) -1 (- -1 scroll-margin)))
 +  (move-to-window-line (- -1 scroll-margin))
    (if (and (not (and gnus-article-over-scroll
                     (> (count-lines (window-start) (point-max))
 -                      (if (featurep 'xemacs)
 -                          (or lines (1- (window-height)))
 -                        (+ (or lines (1- (window-height))) scroll-margin)))))
 +                      (+ (or lines (1- (window-height))) scroll-margin))))
           (save-excursion
             (end-of-line)
             (and (pos-visible-in-window-p)     ;Not continuation line.
  
  (defun gnus-article-beginning-of-window ()
    "Move point to the beginning of the window.
 -In Emacs, the point is placed at the line number which `scroll-margin'
 +The point is placed at the line number which `scroll-margin'
  specifies."
 -  (if (featurep 'xemacs)
 -      (move-to-window-line 0)
 -    ;; There is an obscure bug in Emacs that makes it impossible to
 -    ;; scroll past big pictures in the article buffer.  Try to fix
 -    ;; this by adding a sanity check by counting the lines visible.
 -    (when (> (count-lines (window-start) (window-end)) 30)
 -      (move-to-window-line
 -       (min (max 0 scroll-margin)
 -          (max 1 (- (window-height)
 -                    (if mode-line-format 1 0)
 -                    (if header-line-format 1 0)
 -                    2)))))))
 +  ;; There is an obscure bug in Emacs that makes it impossible to
 +  ;; scroll past big pictures in the article buffer.  Try to fix
 +  ;; this by adding a sanity check by counting the lines visible.
 +  (when (> (count-lines (window-start) (window-end)) 30)
 +    (move-to-window-line
 +     (min (max 0 scroll-margin)
 +        (max 1 (- (window-height)
 +                  (if mode-line-format 1 0)
 +                  (if header-line-format 1 0)
 +                  2))))))
  
  (defvar scroll-in-place)
  
@@@ -6610,7 -6682,10 +6610,7 @@@ Argument LINES specifies lines to be sc
        (goto-char (point-max))
        (recenter (if gnus-article-over-scroll
                      (if lines
 -                        (max (if (featurep 'xemacs)
 -                                 lines
 -                               (+ lines scroll-margin))
 -                             3)
 +                        (max (+ lines scroll-margin) 3)
                        (- (window-height) 2))
                    -1)))
      (prog1
@@@ -6691,7 -6766,9 +6691,7 @@@ not have a face in `gnus-article-boring
        (let (gnus-pick-mode)
        (setq unread-command-events (nconc unread-command-events
                                           (list (or key last-command-event)))
 -            keys (if (featurep 'xemacs)
 -                     (events-to-keys (read-key-sequence nil t))
 -                   (read-key-sequence nil t)))))
 +            keys (read-key-sequence nil t))))
  
      (message "")
  
                                                (article 1.0)))))))
                     (gnus-configure-windows 'article))
                   (setq win (get-buffer-window summary-buffer 'visible)))
 -               (gnus-select-frame-set-input-focus (window-frame win))
 +               (select-frame-set-input-focus (window-frame win))
                 (select-window win))))
        (setq in-buffer (current-buffer))
        ;; We disable the pick minor mode commands.
  
  (defun gnus-article-read-summary-send-keys ()
    (interactive)
 -  (let ((unread-command-events (list (gnus-character-to-event ?S))))
 +  (let ((unread-command-events (list ?S)))
      (gnus-article-read-summary-keys)))
  
  (defun gnus-article-describe-key (key)
    "Display documentation of the function invoked by KEY.
  KEY is a string or a vector."
 -  (interactive (list (let ((cursor-in-echo-area t)) ;; better for XEmacs.
 +  (interactive (list (let ((cursor-in-echo-area t))
                       (read-key-sequence "Describe key: "))))
    (gnus-article-check-buffer)
    (if (memq (key-binding key t) '(gnus-article-read-summary-keys
                                  gnus-article-read-summary-send-keys))
        (with-current-buffer gnus-article-current-summary
        (setq unread-command-events
 -            (if (featurep 'xemacs)
 -                (append key unread-command-events)
 -              (nconc
 -               (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
 -                                       (list 'meta (- x 128))
 -                                     x))
 -                       key)
 -               unread-command-events)))
 +            (nconc
 +             (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
 +                                     (list 'meta (- x 128))
 +                                   x))
 +                     key)
 +             unread-command-events))
        (let ((cursor-in-echo-area t)
              gnus-pick-mode)
          (describe-key (read-key-sequence nil t))))
  (defun gnus-article-describe-key-briefly (key &optional insert)
    "Display documentation of the function invoked by KEY.
  KEY is a string or a vector."
 -  (interactive (list (let ((cursor-in-echo-area t)) ;; better for XEmacs.
 +  (interactive (list (let ((cursor-in-echo-area t))
                       (read-key-sequence "Describe key: "))
                     current-prefix-arg))
    (gnus-article-check-buffer)
                                  gnus-article-read-summary-send-keys))
        (with-current-buffer gnus-article-current-summary
        (setq unread-command-events
 -            (if (featurep 'xemacs)
 -                (append key unread-command-events)
 -              (nconc
 -               (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
 -                                       (list 'meta (- x 128))
 -                                     x))
 -                       key)
 -               unread-command-events)))
 +            (nconc
 +             (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
 +                                     (list 'meta (- x 128))
 +                                   x))
 +                     key)
 +             unread-command-events))
        (let ((cursor-in-echo-area t)
              gnus-pick-mode)
          (describe-key-briefly (read-key-sequence nil t) insert)))
@@@ -6906,12 -6987,13 +6906,12 @@@ the entire article will be yanked.
    (interactive)
    (let ((article (cdr gnus-article-current))
        contents)
 -    (if (not (gnus-region-active-p))
 +    (if (not (and transient-mark-mode mark-active))
        (with-current-buffer gnus-summary-buffer
          (gnus-summary-reply (list (list article)) wide))
        (setq contents (buffer-substring (point) (mark t)))
        ;; Deactivate active regions.
 -      (when (and (boundp 'transient-mark-mode)
 -               transient-mark-mode)
 +      (when transient-mark-mode
        (setq mark-active nil))
        (with-current-buffer gnus-summary-buffer
        (gnus-summary-reply
@@@ -6931,12 -7013,13 +6931,12 @@@ the entire article will be yanked.
    (interactive)
    (let ((article (cdr gnus-article-current))
        contents)
 -      (if (not (gnus-region-active-p))
 +      (if (not (and transient-mark-mode mark-active))
          (with-current-buffer gnus-summary-buffer
            (gnus-summary-followup (list (list article))))
        (setq contents (buffer-substring (point) (mark t)))
        ;; Deactivate active regions.
 -      (when (and (boundp 'transient-mark-mode)
 -                 transient-mark-mode)
 +      (when transient-mark-mode
          (setq mark-active nil))
        (with-current-buffer gnus-summary-buffer
          (gnus-summary-followup
@@@ -6948,11 -7031,10 +6948,11 @@@ This means that signatures, cited text 
  hidden.
  If given a prefix, show the hidden text instead."
    (interactive (append (gnus-article-hidden-arg) (list 'force)))
 -  (gnus-article-hide-headers arg)
 -  (gnus-article-hide-list-identifiers arg)
 -  (gnus-article-hide-citation-maybe arg force)
 -  (gnus-article-hide-signature arg))
 +  (gnus-with-article-buffer
 +    (article-hide-headers arg)
 +    (article-hide-list-identifiers)
 +    (gnus-article-hide-citation-maybe arg force)
 +    (article-hide-signature arg)))
  
  (defun gnus-check-group-server ()
    ;; Make sure the connection to the server is alive.
              ;; equivalent of string-make-multibyte which amount to decoding
              ;; with locale-coding-system, causing failure of
              ;; subsequent decoding.
 -            (insert (mm-string-to-multibyte
 +            (insert (string-to-multibyte
                       (with-current-buffer gnus-original-article-buffer
                         (buffer-substring (point-min) (point-max)))))
            'article)
@@@ -7256,8 -7338,7 +7256,8 @@@ groups.
    (when (and (not force)
             (gnus-group-read-only-p))
      (error "The current newsgroup does not support article editing"))
 -  (gnus-article-date-original)
 +  (gnus-with-article-buffer
 +    (article-date-original))
    (gnus-article-edit-article
     'ignore
     `(lambda (no-highlight)
     "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|"
     "nntp\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)"
     "\\(//[-a-z0-9_.]+:[0-9]*\\)?"
 -   (if (string-match "[[:digit:]]" "1") ;; Support POSIX?
 -       (let ((chars "-a-z0-9_=#$@~%&*+\\/[:word:]")
 -           (punct "!?:;.,"))
 -       (concat
 -        "\\(?:"
 -        ;; Match paired parentheses, e.g. in Wikipedia URLs:
 -        ;; http://thread.gmane.org/47B4E3B2.3050402@gmail.com
 -        "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)"
 -        "\\(?:" "[" chars punct "]+" "[" chars "]" "\\)?"
 -        "\\|"
 -        "[" chars punct "]+" "[" chars "]"
 -        "\\)"))
 -     (concat ;; XEmacs 21.4 doesn't support POSIX.
 -      "\\([-a-z0-9_=!?#$@~%&*+\\/:;.,]\\|\\w\\)+"
 -      "\\([-a-z0-9_=#$@~%&*+\\/]\\|\\w\\)"))
 +   (let ((chars "-a-z0-9_=#$@~%&*+\\/[:word:]")
 +       (punct "!?:;.,"))
 +     (concat
 +      "\\(?:"
 +      ;; Match paired parentheses, e.g. in Wikipedia URLs:
 +      ;; http://thread.gmane.org/47B4E3B2.3050402@gmail.com
 +      "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)"
 +      "\\(?:" "[" chars punct "]+" "[" chars "]" "\\)?"
 +      "\\|"
 +      "[" chars punct "]+" "[" chars "]"
 +      "\\)"))
     "\\)")
    "Regular expression that matches URLs."
    :version "24.4"
    :group 'gnus-article-buttons
    :type 'regexp)
  
 -(defcustom gnus-button-valid-fqdn-regexp
 -  message-valid-fqdn-regexp
 +(defcustom gnus-button-valid-fqdn-regexp "\\([-A-Za-z0-9]+\\.\\)+[A-Za-z]+"
    "Regular expression that matches a valid FQDN."
 -  :version "22.1"
 +  :version "25.2"
    :group 'gnus-article-buttons
    :type 'regexp)
  
@@@ -7496,7 -7582,7 +7496,7 @@@ address, `ask' if unsure and `invalid' 
        (list gnus-button-mid-or-mail-heuristic-alist)
        (result 0) rate regexp lpartlen elem)
      (setq lpartlen
 -        (length (gnus-replace-in-string mid-or-mail "^\\(.*\\)@.*$" "\\1")))
 +        (length (replace-regexp-in-string "^\\(.*\\)@.*$" "\\1" mid-or-mail)))
      (gnus-message 8 "`%s', length of local part=`%s'." mid-or-mail lpartlen)
      ;; Certain special cases...
      (when (string-match
        (setq guessed
            ;; get rid of surrounding angles...
            (funcall pref
 -                   (gnus-replace-in-string mid-or-mail "^<\\|>$" "")))
 +                   (replace-regexp-in-string "^<\\|>$" "" mid-or-mail)))
        (if (or (eq 'mid guessed) (eq 'mail guessed))
          (setq pref guessed)
        (setq pref 'ask)))
@@@ -7599,13 -7685,13 +7599,13 @@@ as a symbol to FUN.
    "Call `describe-function' when pushing the corresponding URL button."
    (describe-function
     (intern
 -    (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))))
 +    (replace-regexp-in-string gnus-button-handle-describe-prefix "" url))))
  
  (defun gnus-button-handle-describe-variable (url)
    "Call `describe-variable' when pushing the corresponding URL button."
    (describe-variable
     (intern
 -    (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))))
 +    (replace-regexp-in-string gnus-button-handle-describe-prefix "" url))))
  
  (defun gnus-button-handle-symbol (url)
  "Display help on variable or function.
@@@ -7619,7 -7705,7 +7619,7 @@@ Calls `describe-variable' or `describe-
  (defun gnus-button-handle-describe-key (url)
    "Call `describe-key' when pushing the corresponding URL button."
    (let* ((key-string
 -        (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))
 +        (replace-regexp-in-string gnus-button-handle-describe-prefix "" url))
         (keys (ignore-errors (eval `(kbd ,key-string)))))
      (if keys
        (describe-key keys)
  
  (defun gnus-button-handle-apropos (url)
    "Call `apropos' when pushing the corresponding URL button."
 -  (apropos (gnus-replace-in-string url gnus-button-handle-describe-prefix "")))
 +  (apropos (replace-regexp-in-string gnus-button-handle-describe-prefix "" url)))
  
  (defun gnus-button-handle-apropos-command (url)
    "Call `apropos' when pushing the corresponding URL button."
    (apropos-command
 -   (gnus-replace-in-string url gnus-button-handle-describe-prefix "")))
 +   (replace-regexp-in-string gnus-button-handle-describe-prefix "" url)))
  
  (defun gnus-button-handle-apropos-variable (url)
    "Call `apropos' when pushing the corresponding URL button."
 -  (funcall
 -   (if (fboundp 'apropos-variable) 'apropos-variable 'apropos)
 -   (gnus-replace-in-string url gnus-button-handle-describe-prefix "")))
 +  (apropos-variable
 +   (replace-regexp-in-string gnus-button-handle-describe-prefix "" url)))
  
  (defun gnus-button-handle-apropos-documentation (url)
    "Call `apropos' when pushing the corresponding URL button."
 -  (funcall
 -   (if (fboundp 'apropos-documentation) 'apropos-documentation 'apropos)
 -   (gnus-replace-in-string url gnus-button-handle-describe-prefix "")))
 +  (apropos-documentation
 +   (replace-regexp-in-string gnus-button-handle-describe-prefix "" url)))
  
  (defun gnus-button-handle-library (url)
    "Call `locate-library' when pushing the corresponding URL button."
    (gnus-message 9 "url=`%s'" url)
    (let* ((lib (locate-library url))
 -       (file (gnus-replace-in-string (or lib "") "\\.elc" ".el")))
 +       (file (replace-regexp-in-string "\\.elc" ".el" (or lib ""))))
      (if (not lib)
        (gnus-message 1 "Cannot locale library `%s'." url)
        (find-file-read-only file))))
@@@ -7942,14 -8030,14 +7942,14 @@@ do the highlighting.  See the documenta
          (when (and header-face
                     (not (memq (point) hpoints)))
            (push (point) hpoints)
 -          (gnus-put-text-property from (point) 'face header-face))
 +          (put-text-property from (point) 'face header-face))
          (when (and field-face
                     (not (memq (setq from (point)) fpoints)))
            (push from fpoints)
            (if (re-search-forward "^[^ \t]" nil t)
                (forward-char -2)
              (goto-char (point-max)))
 -          (gnus-put-text-property from (point) 'face field-face)))))))
 +          (put-text-property from (point) 'face field-face)))))))
  
  (defun gnus-article-highlight-signature ()
    "Highlight the signature in an article.
@@@ -8004,7 -8092,7 +8004,7 @@@ specified by `gnus-button-alist'.
                           (gnus-article-extend-url-button from start end))
                (gnus-article-add-button start end
                                         'gnus-button-push (list from entry))
 -              (gnus-put-text-property
 +              (put-text-property
                 start end
                 'gnus-string (buffer-substring-no-properties
                               start end))))))))))
@@@ -8106,15 -8194,16 +8106,15 @@@ url is put as the `gnus-button-url' ove
    (when gnus-article-button-face
      (overlay-put (make-overlay from to nil t)
                 'face gnus-article-button-face))
 -  (gnus-add-text-properties
 +  (add-text-properties
     from to
     (nconc (and gnus-article-mouse-face
 -             (list gnus-mouse-face-prop gnus-article-mouse-face))
 +             (list 'mouse-face gnus-article-mouse-face))
          (list 'gnus-callback fun)
          (and data (list 'gnus-data data))))
    (widget-convert-button 'link from to :action 'gnus-widget-press-button
                         :help-echo (or text "Follow the link")
 -                       :keymap gnus-url-button-map
 -                       :button-keymap gnus-widget-button-keymap))
 +                       :keymap gnus-url-button-map))
  
  (defun gnus-article-copy-string ()
    "Copy the string in the button to the kill ring."
    "Fetch a man page."
    (gnus-message 9 "`%s' `%s'" gnus-button-man-handler url)
    (when (eq gnus-button-man-handler 'woman)
 -    (setq url (gnus-replace-in-string url "([1-9][X1a-z]*).*\\'" "")))
 +    (setq url (replace-regexp-in-string "([1-9][X1a-z]*).*\\'" "" url)))
    (gnus-message 9 "`%s' `%s'" gnus-button-man-handler url)
    (funcall gnus-button-man-handler url))
  
  (defun gnus-button-handle-info-url (url)
    "Fetch an info URL."
 -  (setq url (mm-subst-char-in-string ?+ ?\  url))
 +  (setq url (subst-char-in-string ?+ ?\  url))
    (cond
     ((string-match "^\\([^:/]+\\)?/\\(.*\\)" url)
      (gnus-info-find-node
             ")" (gnus-url-unhex-string (match-string 2 url)))))
     ((string-match "([^)\"]+)[^\"]+" url)
      (setq url
 -        (gnus-replace-in-string
 -         (gnus-replace-in-string url "[\n\t ]+" " ") "\"" ""))
 +        (replace-regexp-in-string
 +         "\"" "" (replace-regexp-in-string "[\n\t ]+" " " url)))
      (gnus-info-find-node url))
     (t (error "Can't parse %s" url))))
  
  (defun gnus-button-handle-info-url-gnome (url)
    "Fetch GNOME style info URL."
 -  (setq url (mm-subst-char-in-string ?_ ?\  url))
 +  (setq url (subst-char-in-string ?_ ?\  url))
    (if (string-match "\\([^#]+\\)#?\\(.*\\)" url)
        (gnus-info-find-node
         (concat "("
        (if (fboundp func)
          (funcall func)
        (message-position-on-field (caar args)))
 -      (insert (gnus-replace-in-string
 -             (mapconcat 'identity (reverse (cdar args)) ", ")
 -             "\r\n" "\n" t))
 +      (insert (replace-regexp-in-string
 +             "\r\n" "\n"
 +             (mapconcat 'identity (reverse (cdar args)) ", ") nil t))
        (setq args (cdr args)))
      (if subject
        (message-goto-body)
  
  (defvar gnus-prev-page-map
    (let ((map (make-sparse-keymap)))
 -    (define-key map gnus-mouse-2 'gnus-button-prev-page)
 +    (define-key map [mouse-2] 'gnus-button-prev-page)
      (define-key map "\r" 'gnus-button-prev-page)
      map))
  
  (defvar gnus-next-page-map
    (let ((map (make-sparse-keymap)))
 -    (define-key map gnus-mouse-2 'gnus-button-next-page)
 +    (define-key map [mouse-2] 'gnus-button-next-page)
      (define-key map "\r" 'gnus-button-next-page)
      map))
  
@@@ -8739,8 -8828,8 +8739,8 @@@ For example
  
  (defvar gnus-mime-security-button-map
    (let ((map (make-sparse-keymap)))
 -    (define-key map gnus-mouse-2 'gnus-article-push-button)
 -    (define-key map gnus-down-mouse-3 'gnus-mime-security-button-menu)
 +    (define-key map [mouse-2] 'gnus-article-push-button)
 +    (define-key map [down-mouse-3] 'gnus-mime-security-button-menu)
      (dolist (c gnus-mime-security-button-commands)
        (define-key map (cadr c) (car c)))
      map))
       :button-keymap gnus-mime-security-button-map
       :help-echo
       (lambda (_widget)
 -       ;; Needed to properly clear the message due to a bug in
 -       ;; wid-edit (XEmacs only).
 -       (when (boundp 'help-echo-owns-message)
 -       (setq help-echo-owns-message t))
         (format
        "%S: show detail; %S: more options"
 -      (aref gnus-mouse-2 0)
 -      (aref gnus-down-mouse-3 0))))))
 +      'mouse-2
 +      'down-mouse-3)))))
  
  (defun gnus-mime-display-security (handle)
    (save-restriction
    (interactive)
    (gnus-mime-security-run-function 'mm-pipe-part))
  
 -(gnus-ems-redefine)
 -
  (provide 'gnus-art)
  
  (run-hooks 'gnus-art-load-hook)
diff --combined lisp/vc/add-log.el
index d6c1fc203db9874276d1767ace6e9c3f63f12ddf,fa02a5a1f5efd370cec64413c949e17bae6bd0d3..58a4e77a602a3782f14833e1b1ab6816f9129d59
@@@ -171,14 -171,6 +171,14 @@@ Note: The search is conducted only with
    :type '(repeat regexp)
    :group 'change-log)
  
 +(defcustom change-log-directory-files '(".bzr" ".git" ".hg" ".svn")
 +  "List of files that cause `find-change-log' to stop in containing directory.
 +This applies if no pre-existing ChangeLog is found.  If nil, then in such
 +a case simply use the directory containing the changed file."
 +  :version "25.2"
 +  :type '(repeat file)
 +  :group 'change-log)
 +
  (defface change-log-date
    '((t (:inherit font-lock-string-face)))
    "Face used to highlight dates in date lines."
@@@ -583,10 -575,9 +583,9 @@@ Compatibility function for \\[next-erro
  ;; called add-log-time-zone-rule since it's only used from add-log-* code.
  (defvaralias 'change-log-time-zone-rule 'add-log-time-zone-rule)
  (defvar add-log-time-zone-rule nil
-   "Time zone used for calculating change log time stamps.
- It takes the same format as the TZ argument of `set-time-zone-rule'.
- If nil, use local time.
- If t, use universal time.")
+   "Time zone rule used for calculating change log time stamps.
+ If nil, use local time.  If t, use Universal Time.
+ If a string, interpret as the ZONE argument of `format-time-string'.")
  (put 'add-log-time-zone-rule 'safe-local-variable
       (lambda (x) (or (booleanp x) (stringp x))))
  
@@@ -699,11 -690,7 +698,11 @@@ If `change-log-default-name' is nil, be
  
  If `change-log-default-name' contains a leading directory component, then
  simply find it in the current directory.  Otherwise, search in the current
 -directory and its successive parents for a file so named.
 +directory and its successive parents for a file so named.  Stop at the first
 +such file that exists (or has a buffer visiting it), or the first directory
 +that contains any of `change-log-directory-files'.  If no match is found,
 +use the current directory.  To override the choice of this function,
 +simply create an empty ChangeLog file first by hand in the desired place.
  
  Once a file is found, `change-log-default-name' is set locally in the
  current buffer to the complete file name.
@@@ -736,27 -723,24 +735,27 @@@ Optional arg BUFFER-FILE overrides `buf
          ;; for several related directories.
          (setq file-name (file-chase-links file-name))
          (setq file-name (expand-file-name file-name))
 -        ;; Move up in the dir hierarchy till we find a change log file.
 -        (let ((file1 file-name)
 -              parent-dir)
 -          (while (and (not (or (get-file-buffer file1) (file-exists-p file1)))
 -                      (progn (setq parent-dir
 -                                   (file-name-directory
 -                                    (directory-file-name
 -                                     (file-name-directory file1))))
 -                             ;; Give up if we are already at the root dir.
 -                             (not (string= (file-name-directory file1)
 -                                           parent-dir))))
 -            ;; Move up to the parent dir and try again.
 -            (setq file1 (expand-file-name
 -                         (file-name-nondirectory (change-log-name))
 -                         parent-dir)))
 -          ;; If we found a change log in a parent, use that.
 -          (if (or (get-file-buffer file1) (file-exists-p file1))
 -              (setq file-name file1)))))
 +        (let* ((cbase (file-name-nondirectory (change-log-name)))
 +               (root
 +                (locate-dominating-file
 +                 file-name
 +                 (lambda (dir)
 +                   (or
 +                    (let ((clog (expand-file-name cbase dir)))
 +                      (or (get-file-buffer clog) (file-exists-p clog)))
 +                    ;; Stop at VCS root?
 +                    (and change-log-directory-files
 +                         (let ((files change-log-directory-files)
 +                               found)
 +                           (while
 +                               (and
 +                                (not
 +                                 (setq found
 +                                       (file-exists-p
 +                                        (expand-file-name (car files) dir))))
 +                                (setq files (cdr files))))
 +                           found)))))))
 +          (if root (setq file-name (expand-file-name cbase root))))))
      ;; Make a local variable in this buffer so we needn't search again.
      (set (make-local-variable 'change-log-default-name) file-name))
    file-name)
@@@ -911,10 -895,8 +910,10 @@@ non-nil, otherwise in local time.
                               "\\(\\s \\|[(),:]\\)")
                       bound t)))
               ;; Add to the existing item for the same file.
 -             (re-search-forward "^\\s *$\\|^\\s \\*")
 -             (goto-char (match-beginning 0))
 +             (if (re-search-forward "^\\s *$\\|^\\s \\*" nil t)
 +                 (goto-char (match-beginning 0))
 +               (goto-char (point-max))
 +               (insert "\n"))
               ;; Delete excess empty lines; make just 2.
               (while (and (not (eobp)) (looking-at "^\\s *$"))
                 (delete-region (point) (line-beginning-position 2)))
diff --combined src/editfns.c
index a2d5673a25717d48dcff13c35aa3299f86c0d85b,94b949583adb6a0d66c1c89299d45a8b27555127..70285e6d5dbbfc78962bec6bb473c4f200218b4c
@@@ -1969,10 -1969,10 +1969,10 @@@ DEFUN ("format-time-string", Fformat_ti
         doc: /* Use FORMAT-STRING to format the time TIME, or now if omitted.
  TIME is specified as (HIGH LOW USEC PSEC), as returned by
  `current-time' or `file-attributes'.  The obsolete form (HIGH . LOW)
- is also still accepted.
- The optional ZONE is omitted or nil for Emacs local time, t for
- Universal Time, `wall' for system wall clock time, or a string as in
- `set-time-zone-rule' for a time zone rule.
+ is also still accepted.  The optional ZONE is omitted or nil for Emacs
+ local time, t for Universal Time, `wall' for system wall clock time,
+ or a string as in the TZ environment variable.
  The value is a copy of FORMAT-STRING, but with certain constructs replaced
  by text that describes the specified date and time in TIME:
  
@@@ -2042,6 -2042,7 +2042,6 @@@ format_time_string (char const *format
    char *buf = buffer;
    ptrdiff_t size = sizeof buffer;
    size_t len;
 -  Lisp_Object bufstring;
    int ns = t.tv_nsec;
    USE_SAFE_ALLOCA;
  
      }
  
    xtzfree (tz);
 -  bufstring = make_unibyte_string (buf, len);
 +  AUTO_STRING_WITH_LEN (bufstring, buf, len);
 +  Lisp_Object result = code_convert_string_norecord (bufstring,
 +                                                   Vlocale_coding_system, 0);
    SAFE_FREE ();
 -  return code_convert_string_norecord (bufstring, Vlocale_coding_system, 0);
 +  return result;
  }
  
  DEFUN ("decode-time", Fdecode_time, Sdecode_time, 0, 2, 0,
@@@ -2087,7 -2086,7 +2087,7 @@@ as from `current-time' and `file-attrib
  current time.  The obsolete form (HIGH . LOW) is also still accepted.
  The optional ZONE is omitted or nil for Emacs local time, t for
  Universal Time, `wall' for system wall clock time, or a string as in
`set-time-zone-rule' for a time zone rule.
the TZ environment variable.
  
  The list has the following nine members: SEC is an integer between 0
  and 60; SEC is 60 for a leap second, which only some operating systems
@@@ -2152,9 -2151,9 +2152,9 @@@ DEFUN ("encode-time", Fencode_time, Sen
  This is the reverse operation of `decode-time', which see.
  The optional ZONE is omitted or nil for Emacs local time, t for
  Universal Time, `wall' for system wall clock time, or a string as in
- `set-time-zone-rule' for a time zone rule.  It can also be a list (as
- from `current-time-zone') or an integer (as from `decode-time')
applied without consideration for daylight saving time.
+ the TZ environment variable.  It can also be a list (as from
+ `current-time-zone') or an integer (as from `decode-time') applied
+ without consideration for daylight saving time.
  
  You can pass more than 7 arguments; then the first six arguments
  are used as SECOND through YEAR, and the *last* argument is used as ZONE.
@@@ -2214,7 -2213,7 +2214,7 @@@ but this is considered obsolete
  
  The optional ZONE is omitted or nil for Emacs local time, t for
  Universal Time, `wall' for system wall clock time, or a string as in
`set-time-zone-rule' for a time zone rule.  */)
the TZ environment variable.  */)
    (Lisp_Object specified_time, Lisp_Object zone)
  {
    time_t value = lisp_seconds_argument (specified_time);
@@@ -2291,7 -2290,7 +2291,7 @@@ instead of using the current time.  Th
  `current-time' and from `file-attributes'.  SPECIFIED-TIME can also
  have the form (HIGH . LOW), but this is considered obsolete.
  Optional second arg ZONE is omitted or nil for the local time zone, or
- a string as in `set-time-zone-rule'.
+ a string as in the TZ environment variable.
  
  Some operating systems cannot provide all this information to Emacs;
  in this case, `current-time-zone' returns a list containing nil for
@@@ -2332,8 -2331,11 +2332,11 @@@ the data it can't find.  */
  
  DEFUN ("set-time-zone-rule", Fset_time_zone_rule, Sset_time_zone_rule, 1, 1, 0,
         doc: /* Set the Emacs local time zone using TZ, a string specifying a time zone rule.
- If TZ is nil or `wall', use system wall clock time.  If TZ is t, use
- Universal Time.  If TZ is an integer, treat it as in `encode-time'.
+ If TZ is nil or `wall', use system wall clock time; this differs from
+ the usual Emacs convention where nil means current local time.  If TZ
+ is t, use Universal Time.  If TZ is an integer, treat it as in
+ `encode-time'.
  
  Instead of calling this function, you typically want something else.
  To temporarily use a different time zone rule for just one invocation
@@@ -4993,7 -4995,7 +4996,7 @@@ Transposing beyond buffer boundaries i
          start2_addr = BYTE_POS_ADDR (start2_byte);
            memcpy (temp, start1_addr, len1_byte);
            memcpy (start1_addr, start2_addr, len2_byte);
 -          memcpy (start1_addr + len2_byte, start1_addr + len1_byte, len_mid);
 +          memmove (start1_addr + len2_byte, start1_addr + len1_byte, len_mid);
            memcpy (start1_addr + len2_byte + len_mid, temp, len1_byte);
          SAFE_FREE ();