changeset 90228:fa0da9b57058

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-82 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 542-553) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 116-121) - Merge from emacs--cvs-trunk--0 - Update from CVS
author Miles Bader <miles@gnu.org>
date Mon, 19 Sep 2005 10:20:33 +0000
parents 10fe5fadaf89 (current diff) cabd12ecc31c (diff)
children 626b546fed64
files ChangeLog Makefile.in admin/FOR-RELEASE etc/ChangeLog etc/NEWS etc/PROBLEMS etc/gfdl.1 info/dir lib-src/ChangeLog lib-src/Makefile.in lib-src/makefile.w32-in lisp/ChangeLog lisp/apropos.el lisp/bindings.el lisp/bookmark.el lisp/calc/calc-mode.el lisp/calc/calc-units.el lisp/calendar/cal-menu.el lisp/calendar/calendar.el lisp/calendar/diary-lib.el lisp/calendar/timeclock.el lisp/custom.el lisp/desktop.el lisp/dired-aux.el lisp/echistory.el lisp/ediff-util.el lisp/emacs-lisp/find-func.el lisp/emacs-lisp/lisp-mnt.el lisp/emulation/viper-ex.el lisp/emulation/viper-macs.el lisp/emulation/ws-mode.el lisp/eshell/esh-proc.el lisp/files.el lisp/follow.el lisp/font-lock.el lisp/gnus/ChangeLog lisp/gnus/gnus-art.el lisp/gnus/gnus-sum.el lisp/gnus/gnus.el lisp/help-fns.el lisp/hi-lock.el lisp/ibuf-macs.el lisp/image.el lisp/international/codepage.el lisp/international/iso-insert.el lisp/isearch.el lisp/iswitchb.el lisp/log-edit.el lisp/mail/feedmail.el lisp/mail/rmail-spam-filter.el lisp/mail/sendmail.el lisp/mh-e/ChangeLog lisp/mh-e/mh-alias.el lisp/mh-e/mh-e.el lisp/mh-e/mh-index.el lisp/mh-e/mh-junk.el lisp/mh-e/mh-mime.el lisp/mh-e/mh-print.el lisp/mouse.el lisp/net/ange-ftp.el lisp/net/newsticker.el lisp/net/tramp.el lisp/pcomplete.el lisp/pcvs-defs.el lisp/pcvs.el lisp/play/decipher.el lisp/play/landmark.el lisp/play/zone.el lisp/printing.el lisp/progmodes/ada-mode.el lisp/progmodes/ada-xref.el lisp/progmodes/cmacexp.el lisp/progmodes/compile.el lisp/progmodes/ebnf2ps.el lisp/progmodes/glasses.el lisp/progmodes/gud.el lisp/progmodes/hideshow.el lisp/progmodes/idlw-shell.el lisp/progmodes/idlwave.el lisp/progmodes/ps-mode.el lisp/progmodes/scheme.el lisp/progmodes/sh-script.el lisp/progmodes/vhdl-mode.el lisp/recentf.el lisp/server.el lisp/ses.el lisp/shell.el lisp/simple.el lisp/startup.el lisp/strokes.el lisp/term/mac-win.el lisp/textmodes/artist.el lisp/textmodes/bibtex.el lisp/textmodes/flyspell.el lisp/textmodes/ispell.el lisp/textmodes/org.el lisp/textmodes/reftex-auc.el lisp/textmodes/reftex-cite.el lisp/textmodes/reftex-dcr.el lisp/textmodes/reftex-global.el lisp/textmodes/reftex-index.el lisp/textmodes/reftex-parse.el lisp/textmodes/reftex-ref.el lisp/textmodes/reftex-sel.el lisp/textmodes/reftex-toc.el lisp/textmodes/reftex-vars.el lisp/textmodes/reftex.el lisp/textmodes/tildify.el lisp/time-stamp.el lisp/vc.el lisp/woman.el lispintro/ChangeLog lispintro/emacs-lisp-intro.texi lispref/ChangeLog lispref/display.texi lispref/doclicense.texi lispref/elisp.texi lispref/objects.texi mac/ChangeLog mac/inc/config.h man/ChangeLog man/Makefile.in man/ada-mode.texi man/autotype.texi man/buffers.texi man/calc.texi man/cc-mode.texi man/cl.texi man/doclicense.texi man/ebrowse.texi man/ediff.texi man/emacs-mime.texi man/emacs.texi man/eshell.texi man/eudc.texi man/files.texi man/forms.texi man/gnu.texi man/gnus.texi man/idlwave.texi man/info.texi man/makefile.w32-in man/message.texi man/mh-e.texi man/newsticker.texi man/pcl-cvs.texi man/reftex.texi man/rmail.texi man/sc.texi man/ses.texi man/smtpmail.texi man/speedbar.texi man/tramp.texi man/vip.texi man/viper.texi man/widget.texi man/woman.texi src/ChangeLog src/Makefile.in src/composite.h src/data.c src/editfns.c src/emacs.c src/fileio.c src/keymap.c src/macfns.c src/print.c src/sysdep.c src/w32.c src/window.c src/window.h src/xdisp.c src/xfns.c src/xterm.h
diffstat 191 files changed, 8729 insertions(+), 2503 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Sep 11 22:21:01 2005 +0000
+++ b/ChangeLog	Mon Sep 19 10:20:33 2005 +0000
@@ -1,3 +1,9 @@
+2005-09-15  Ulf Jasper  <ulf.jasper@web.de>
+
+	* Makefile.in (install-arch-indep, uninstall):
+	Handle newsticker manual.
+	(info): Add - to commands.
+
 2005-09-11  Kim F. Storm  <storm@cua.dk>
 
 	* AUTHORS: Regenerate.
--- a/Makefile.in	Sun Sep 11 22:21:01 2005 +0000
+++ b/Makefile.in	Mon Sep 19 10:20:33 2005 +0000
@@ -486,7 +486,7 @@
 	      chmod a+r ${infodir}/dir); \
 	   fi; \
 	   cd ${srcdir}/info ; \
-	   for f in ada-mode* autotype* calc* ccmode* cl* dired-x* ebrowse* ediff* efaq* eintr* elisp* emacs* emacs-mime* emacs-xtra* eshell* eudc* flymake* forms* gnus* idlwave* info* message* mh-e* org* pcl-cvs* pgg* reftex* sc* ses* sieve* speedbar* tramp* vip* widget* woman* smtpmail* url*; do \
+	   for f in ada-mode* autotype* calc* ccmode* cl* dired-x* ebrowse* ediff* efaq* eintr* elisp* emacs* emacs-mime* emacs-xtra* eshell* eudc* flymake* forms* gnus* idlwave* info* message* mh-e* newsticker* org* pcl-cvs* pgg* reftex* sc* ses* sieve* speedbar* tramp* vip* widget* woman* smtpmail* url*; do \
 	     (cd $${thisdir}; \
 	      ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \
 	      chmod a+r ${infodir}/$$f); \
@@ -496,7 +496,7 @@
 	thisdir=`/bin/pwd`; \
 	if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
 	then \
-	  for f in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq elisp eintr emacs emacs-mime emacs-xtra eshell eudc flymake forms gnus idlwave info message mh-e org pcl-cvs pgg reftex sc ses sieve speedbar tramp vip viper widget woman smtpmail url; do \
+	  for f in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq elisp eintr emacs emacs-mime emacs-xtra eshell eudc flymake forms gnus idlwave info message mh-e newsticker org pcl-cvs pgg reftex sc ses sieve speedbar tramp vip viper widget woman smtpmail url; do \
 	    (cd $${thisdir}; \
 	     ${INSTALL_INFO} --info-dir=${infodir} ${infodir}/$$f); \
 	  done; \
@@ -562,7 +562,7 @@
 	done
 	(cd ${archlibdir} && rm -f fns-*)
 	-rm -rf ${libexecdir}/emacs/${version}
-	(cd ${infodir} && rm -f cl* ada-mode* autotype* calc* ccmode* ebrowse* efaq* eintr elisp* eshell* eudc* idlwave* message* pcl-cvs* reftex* speedbar* tramp* widget* woman* dired-x* ediff* emacs* emacs-xtra* flymake* forms* gnus* info* mh-e* org* sc* ses* vip* smtpmail* url*)
+	(cd ${infodir} && rm -f cl* ada-mode* autotype* calc* ccmode* ebrowse* efaq* eintr elisp* eshell* eudc* idlwave* message* pcl-cvs* reftex* speedbar* tramp* widget* woman* dired-x* ediff* emacs* emacs-xtra* flymake* forms* gnus* info* mh-e* newsticker* org* sc* ses* vip* smtpmail* url*)
 	(cd ${man1dir}  && rm -f emacs${manext} emacsclient${manext} etags${manext} ctags${manext})
 	(cd ${bindir}  && rm -f $(EMACSFULL) $(EMACS))
 
@@ -721,9 +721,9 @@
 # put the info files in $(srcdir),
 # so we can do ok running make in the build dir.
 info: force-info
-	(cd man; $(MAKE) $(MFLAGS) info)
-	(cd lispref; $(MAKE) $(MFLAGS) info)
-	(cd lispintro; $(MAKE) $(MFLAGS) info)
+	-(cd man; $(MAKE) $(MFLAGS) info)
+	-(cd lispref; $(MAKE) $(MFLAGS) info)
+	-(cd lispintro; $(MAKE) $(MFLAGS) info)
 dvi:
 	(cd man; $(MAKE) $(MFLAGS) dvi)
 	(cd lispref; $(MAKE) $(MFLAGS) elisp.dvi)
--- a/admin/FOR-RELEASE	Sun Sep 11 22:21:01 2005 +0000
+++ b/admin/FOR-RELEASE	Mon Sep 19 10:20:33 2005 +0000
@@ -46,25 +46,10 @@
 back burner waiting for a legal comment or an alternate implementation
 (around 30 lines of code).
 
-* BUGS
-
-** Fix recognition of shell's `dirs' command.
-
-Is his change right?
-
-Date: Wed, 29 Jun 2005 18:21:28 -0500 (CDT)
-From: kevin.gal@verizon.net
+** goeran@uddeborg.se's Sep 13 crash report
+about trying to display the invalid gif file poison.gif.
 
-When I use tcsh (which echoes command input) in a shell buffer,
-entering "M-x dirs" fails because it mistakens the echoed "dirs"
-string as the directory string to use as input when changing the
-buffers default directory.  The attached gziped patch file contains a
-fix.  The patch also binds the "dirs" command to "\e\C-m" in
-shell-mode-map (previously unbound) to make it easy to invoke.
-Finally, a test has been added to see if "shell-dirstack-query" is
-non-nil.  If so, it is not overwritten.
-
-To enable the fix, the user must set comint-process-echoes to t.
+* BUGS
 
 ** TCP server processes do not work on Windows.
 
--- a/etc/ChangeLog	Sun Sep 11 22:21:01 2005 +0000
+++ b/etc/ChangeLog	Mon Sep 19 10:20:33 2005 +0000
@@ -1,4 +1,17 @@
-2005-09-00  Kevin Ryde  <user42@zip.com.au>
+2005-09-17  Romain Francoise  <romain@orebokech.com>
+
+	* gfdl.1: Update to version 1.2.  Delete UC macro.
+
+2005-09-15  Kenichi Handa  <handa@m17n.org>
+
+	* PROBLEMS: Fix the paragraph describing the limitation of
+	UTF-8/16/7.
+
+2005-09-14  Romain Francoise  <romain@orebokech.com>
+
+	* NEWS: Add entry for write-region-inhibit-fsync.
+
+2005-09-09  Kevin Ryde  <user42@zip.com.au>
 
 	* MORE.STUFF: Update url for calculator.el.
 
--- a/etc/NEWS	Sun Sep 11 22:21:01 2005 +0000
+++ b/etc/NEWS	Mon Sep 19 10:20:33 2005 +0000
@@ -693,6 +693,12 @@
 attempt to construct a unique auto-save name (e.g. for remote files).
 
 +++
+*** The new option `write-region-inhibit-fsync' disables calls to fsync
+in `write-region'.  This can be useful on laptops to avoid spinning up
+the hard drive upon each file save.  Enabling this variable may result
+in data loss, use with care.
+
++++
 *** If the user visits a file larger than `large-file-warning-threshold',
 Emacs asks for confirmation.
 
@@ -1553,6 +1559,14 @@
 
 * New Modes and Packages in Emacs 22.1
 
+---
+** Newsticker is now part of the Emacs distribution.
+
+Newsticker asynchronously retrieves headlines (RSS) from a list of news
+sites, prepares these headlines for reading, and allows for loading the
+corresponding articles in a web browser.  Its documentation is in a
+separate manual.
+
 +++
 ** Filesets are collections of files.  You can define a fileset in
 various ways, such as based on a directory tree or based on
@@ -3066,11 +3080,17 @@
 with other details of skeleton construction.
 
 ---
-** New variable `hs-set-up-overlay' allows customization of the overlay
+** Hideshow mode changes
+
+*** New variable `hs-set-up-overlay' allows customization of the overlay
 used to effect hiding for hideshow minor mode.  Integration with isearch
 handles the overlay property `display' specially, preserving it during
 temporary overlay showing in the course of an isearch operation.
 
+*** New variable `hs-allow-nesting' non-nil means that hiding a block does
+not discard the hidden state of any "internal" blocks; when the parent
+block is later shown, the internal blocks remain hidden.  Default is nil.
+
 +++
 ** `hide-ifdef-mode' now uses overlays rather than selective-display
 to hide its text.  This should be mostly transparent but slightly
@@ -4661,6 +4681,17 @@
 an event is composed by combining the ID of the hot-spot with the
 mouse event, e.g. [area4 mouse-1] if the hot-spot's ID is `area4'.
 
++++
+*** The function `find-image' now searches in etc/images/ and etc/.
+The new variable `image-load-path' is a list of locations in which to
+search for image files.  The default is to search in etc/images, then
+in etc/, and finally in the directories specified by `load-path'.
+Subdirectories of etc/ and etc/images are not recursively searched; if
+you put an image file in a subdirectory, you have to specify it
+explicitly; for example, if an image is put in etc/images/foo/bar.xpm:
+
+  (defimage foo-image '((:type xpm :file "foo/bar.xpm")))
+
 ** Mouse pointer features:
 
 +++ (lispref)
--- a/etc/PROBLEMS	Sun Sep 11 22:21:01 2005 +0000
+++ b/etc/PROBLEMS	Mon Sep 19 10:20:33 2005 +0000
@@ -845,9 +845,16 @@
 
 ** The UTF-8/16/7 coding systems don't encode CJK (Far Eastern) characters.
 
-Emacs by default only supports the parts of the Unicode BMP whose code
-points are in the ranges 0000-33ff and e000-ffff.  This excludes: most
-of CJK, Yi and Hangul, as well as everything outside the BMP.
+Emacs directly supports the Unicode BMP whose code points are in the
+ranges 0000-33ff and e000-ffff, and indirectly supports the parts of
+CJK characters belonging to these legacy charsets:
+
+    GB2312, Big5, JISX0208, JISX0212, JISX0213-1, JISX0213-2, KSC5601
+
+The latter support is done in Utf-Translate-Cjk mode (turned on by
+default).   Which Unicode CJK characters are decoded into which Emacs
+charset is decided by the current language environment.  For instance,
+in Chinese-GB, most of them are decoded into chinese-gb2312.
 
 If you read UTF-8 data with code points outside these ranges, the
 characters appear in the buffer as raw bytes of the original UTF-8
@@ -857,13 +864,6 @@
 substituted with the Unicode `replacement character', and you lose
 information.
 
-To edit such UTF data, turn on Utf-Translate-Cjk mode, which makes
-many common CJK characters available for encoding and decoding and can
-be extended by updating the tables it uses.  This also allows you to
-save as UTF buffers containing characters decoded by the chinese-,
-japanese- and korean- coding systems, e.g. cut and pasted from
-elsewhere.
-
 ** Mule-UCS loads very slowly.
 
 Changes to Emacs internals interact badly with Mule-UCS's `un-define'
--- a/etc/gfdl.1	Sun Sep 11 22:21:01 2005 +0000
+++ b/etc/gfdl.1	Mon Sep 19 10:20:33 2005 +0000
@@ -1,10 +1,9 @@
-.TH GFDL 1 "2001 April 23"
-.UC 4
+.TH GFDL 1 "2005 September 17"
 .SH NAME
 GFDL \- The GNU Free Documentation License
 
 .ce
-Version 1.1, March 2000
+Version 1.2, November 2002
 
 .hy 0
 .na
@@ -23,12 +22,12 @@
 .SH 0. PREAMBLE
 
 The purpose of this License is to make a manual, textbook, or other
-written document "free" in the sense of freedom: to assure everyone
-the effective freedom to copy and redistribute it, with or without
-modifying it, either commercially or noncommercially.  Secondarily,
-this License preserves for the author and publisher a way to get
-credit for their work, while not being considered responsible for
-modifications made by others.
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
 
 This License is a kind of "copyleft", which means that derivative
 works of the document must themselves be free in the same sense.  It
@@ -45,11 +44,15 @@
 
 .SH 1. APPLICABILITY AND DEFINITIONS
 
-This License applies to any manual or other work that contains a
-notice placed by the copyright holder saying it can be distributed
-under the terms of this License.  The "Document", below, refers to any
-such manual or work.  Any member of the public is a licensee, and is
-addressed as "you."
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License.  Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein.  The "Document", below,
+refers to any such manual or work.  Any member of the public is a
+licensee, and is addressed as "you".  You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
 
 A "Modified Version" of the Document means any work containing the
 Document or a portion of it, either copied verbatim, or with
@@ -59,7 +62,7 @@
 the Document that deals exclusively with the relationship of the
 publishers or authors of the Document to the Document's overall subject
 (or to related matters) and contains nothing that could fall directly
-within that overall subject.  (For example, if the Document is in part a
+within that overall subject.  (Thus, if the Document is in part a
 textbook of mathematics, a Secondary Section may not explain any
 mathematics.)  The relationship could be a matter of historical
 connection with the subject or with related matters, or of legal,
@@ -68,33 +71,40 @@
 
 The "Invariant Sections" are certain Secondary Sections whose titles
 are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License.
+that says that the Document is released under this License.  If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant.  The Document may contain zero
+Invariant Sections.  If the Document does not identify any Invariant
+Sections then there are none.
 
 The "Cover Texts" are certain short passages of text that are listed,
 as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License.
+the Document is released under this License.  A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
 
 A "Transparent" copy of the Document means a machine-readable copy,
 represented in a format whose specification is available to the
-general public, whose contents can be viewed and edited directly and
+general public, that is suitable for revising the document
 straightforwardly with generic text editors or (for images composed of
 pixels) generic paint programs or (for drawings) some widely available
 drawing editor, and that is suitable for input to text formatters or
 for automatic translation to a variety of formats suitable for input
 to text formatters.  A copy made in an otherwise Transparent file
-format whose markup has been designed to thwart or discourage
-subsequent modification by readers is not Transparent.  A copy that is
-not "Transparent" is called "Opaque."
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text.  A copy that is not "Transparent" is called "Opaque".
 
 Examples of suitable formats for Transparent copies include plain
 ASCII without markup, Texinfo input format, LaTeX input format, SGML
 or XML using a publicly available DTD, and standard-conforming simple
-HTML designed for human modification.  Opaque formats include
-PostScript, PDF, proprietary formats that can be read and edited only
-by proprietary word processors, SGML or XML for which the DTD and/or
+HTML, PostScript or PDF designed for human modification.  Examples of
+transparent image formats include PNG, XCF and JPG.  Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
 processing tools are not generally available, and the
-machine-generated HTML produced by some word processors for output
-purposes only.
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
 
 The "Title Page" means, for a printed book, the title page itself,
 plus such following pages as are needed to hold, legibly, the material
@@ -103,6 +113,21 @@
 the text near the most prominent appearance of the work's title,
 preceding the beginning of the body of the text.
 
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language.  (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".)  To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document.  These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
 .SH 2. VERBATIM COPYING
 
 You may copy and distribute the Document in any medium, either
@@ -120,9 +145,10 @@
 
 .SH 3. COPYING IN QUANTITY
 
-If you publish printed copies of the Document numbering more than 100,
-and the Document's license notice requires Cover Texts, you must enclose
-the copies in covers that carry, clearly and legibly, all these Cover
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
 Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
 the back cover.  Both covers must also clearly and legibly identify
 you as the publisher of these copies.  The front cover must present
@@ -140,16 +166,15 @@
 If you publish or distribute Opaque copies of the Document numbering
 more than 100, you must either include a machine-readable Transparent
 copy along with each Opaque copy, or state in or with each Opaque copy
-a publicly-accessible computer-network location containing a complete
-Transparent copy of the Document, free of added material, which the
-general network-using public has access to download anonymously at no
-charge using public-standard network protocols.  If you use the latter
-option, you must take reasonably prudent steps, when you begin
-distribution of Opaque copies in quantity, to ensure that this
-Transparent copy will remain thus accessible at the stated location
-until at least one year after the last time you distribute an Opaque
-copy (directly or through your agents or retailers) of that edition to
-the public.
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
 
 It is requested, but not required, that you contact the authors of the
 Document well before redistributing any large number of copies, to give
@@ -165,17 +190,18 @@
 of it.  In addition, you must do these things in the Modified Version:
 .TP
 A.
-Use in the Title Page (and on the covers, if any) a title distinct
-from that of the Document, and from those of previous versions
-(which should, if there were any, be listed in the History section
-of the Document).  You may use the same title as a previous version
-if the original publisher of that version gives permission.
+Use in the Title Page (and on the covers, if any) a title distinct from
+that of the Document, and from those of previous versions (which should,
+if there were any, be listed in the History section of the Document).
+You may use the same title as a previous version if the original
+publisher of that version gives permission.
 .TP
 B.
 List on the Title Page, as authors, one or more persons or entities
-responsible for authorship of the modifications in the Modified
-Version, together with at least five of the principal authors of the
-Document (all of its principal authors, if it has less than five).
+responsible for authorship of the modifications in the Modified Version,
+together with at least five of the principal authors of the Document
+(all of its principal authors, if it has fewer than five), unless they
+release you from this requirement.
 .TP
 C.
 State on the Title page the name of the publisher of the
@@ -190,8 +216,8 @@
 .TP
 F.
 Include, immediately after the copyright notices, a license notice
-giving the public permission to use the Modified Version under the
-terms of this License, in the form shown in the Addendum below.
+giving the public permission to use the Modified Version under the terms
+of this License, in the form shown in the Addendum below.
 .TP
 G.
 Preserve in that license notice the full lists of Invariant Sections
@@ -201,41 +227,44 @@
 Include an unaltered copy of this License.
 .TP
 I.
-Preserve the section entitled "History", and its title, and add to
-it an item stating at least the title, year, new authors, and
-publisher of the Modified Version as given on the Title Page.  If
-there is no section entitled "History" in the Document, create one
-stating the title, year, authors, and publisher of the Document as
-given on its Title Page, then add an item describing the Modified
-Version as stated in the previous sentence.
+Preserve the section Entitled "History", Preserve its Title, and add to
+it an item stating at least the title, year, new authors, and publisher
+of the Modified Version as given on the Title Page.  If there is no
+section Entitled "History" in the Document, create one stating the
+title, year, authors, and publisher of the Document as given on its
+Title Page, then add an item describing the Modified Version as stated
+in the previous sentence.
 .TP
 J.
-Preserve the network location, if any, given in the Document for
-public access to a Transparent copy of the Document, and likewise
-the network locations given in the Document for previous versions
-it was based on.  These may be placed in the "History" section.
-You may omit a network location for a work that was published at
-least four years before the Document itself, or if the original
-publisher of the version it refers to gives permission.
+Preserve the network location, if any, given in the Document for public
+access to a Transparent copy of the Document, and likewise the network
+locations given in the Document for previous versions it was based on.
+These may be placed in the "History" section.  You may omit a network
+location for a work that was published at least four years before the
+Document itself, or if the original publisher of the version it refers
+to gives permission.
 .TP
 K.
-In any section entitled "Acknowledgements" or "Dedications",
-preserve the section's title, and preserve in the section all the
-substance and tone of each of the contributor acknowledgements
-and/or dedications given therein.
+For any section Entitled "Acknowledgements" or "Dedications", Preserve
+the Title of the section, and preserve in the section all the substance
+and tone of each of the contributor acknowledgements and/or dedications
+given therein.
 .TP
 L.
-Preserve all the Invariant Sections of the Document,
-unaltered in their text and in their titles.  Section numbers
-or the equivalent are not considered part of the section titles.
+Preserve all the Invariant Sections of the Document, unaltered in their
+text and in their titles.  Section numbers or the equivalent are not
+considered part of the section titles.
 .TP
 M.
-Delete any section entitled "Endorsements."  Such a section
-may not be included in the Modified Version.
+Delete any section Entitled "Endorsements".  Such a section may not be
+included in the Modified Version.
 .TP
 N.
-Do not retitle any existing section as "Endorsements"
-or to conflict in title with any Invariant Section.
+Do not retitle any existing section to be Entitled "Endorsements" or to
+conflict in title with any Invariant Section.
+.TP
+O.
+Preserve any Warranty Disclaimers.
 .PP
 If the Modified Version includes new front-matter sections or
 appendices that qualify as Secondary Sections and contain no material
@@ -244,7 +273,7 @@
 list of Invariant Sections in the Modified Version's license notice.
 These titles must be distinct from any other section titles.
 
-You may add a section entitled "Endorsements", provided it contains
+You may add a section Entitled "Endorsements", provided it contains
 nothing but endorsements of your Modified Version by various
 parties--for example, statements of peer review or that the text has
 been approved by an organization as the authoritative definition of a
@@ -271,7 +300,7 @@
 versions, provided that you include in the combination all of the
 Invariant Sections of all of the original documents, unmodified, and
 list them all as Invariant Sections of your combined work in its
-license notice.
+license notice, and that you preserve all their Warranty Disclaimers.
 
 The combined work need only contain one copy of this License, and
 multiple identical Invariant Sections may be replaced with a single
@@ -282,11 +311,11 @@
 Make the same adjustment to the section titles in the list of
 Invariant Sections in the license notice of the combined work.
 
-In the combination, you must combine any sections entitled "History"
-in the various original documents, forming one section entitled
-"History"; likewise combine any sections entitled "Acknowledgements",
-and any sections entitled "Dedications."  You must delete all sections
-entitled "Endorsements."
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications".  You must delete all sections
+Entitled "Endorsements".
 
 .SH 6. COLLECTIONS OF DOCUMENTS
 
@@ -305,18 +334,20 @@
 
 A compilation of the Document or its derivatives with other separate
 and independent documents or works, in or on a volume of a storage or
-distribution medium, does not as a whole count as a Modified Version
-of the Document, provided no compilation copyright is claimed for the
-compilation.  Such a compilation is called an "aggregate", and this
-License does not apply to the other self-contained works thus compiled
-with the Document, on account of their being thus compiled, if they
-are not themselves derivative works of the Document.
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
 
 If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one quarter
-of the entire aggregate, the Document's Cover Texts may be placed on
-covers that surround only the Document within the aggregate.
-Otherwise they must appear on covers around the whole aggregate.
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
 
 .SH 8. TRANSLATION
 
@@ -326,10 +357,17 @@
 permission from their copyright holders, but you may include
 translations of some or all Invariant Sections in addition to the
 original versions of these Invariant Sections.  You may include a
-translation of this License provided that you also include the
-original English version of this License.  In case of a disagreement
-between the translation and the original English version of this
-License, the original English version will prevail.
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers.  In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
 
 .SH 9. TERMINATION
 
@@ -358,7 +396,6 @@
 number of this License, you may choose any version ever published (not
 as a draft) by the Free Software Foundation.
 
-
 .SH ADDENDUM: How to use this License for your documents
 
 To use this License in a document you have written, include a copy of
@@ -372,20 +409,28 @@
 .if n (c)
 [\fIyear\fP]  [\fIyour name\fP].
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1
+under the terms of the GNU Free Documentation License, Version 1.2
 or any later version published by the Free Software Foundation;
-with the Invariant Sections being [\fIlist their titles\fP], with the
-Front-Cover Texts being [\fIlist\fP], and with the Back-Cover Texts
-being [\fIlist\fP].
+with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
 A copy of the license is included in the section entitled "GNU
 Free Documentation License."
 .ad
 .hy 1
 
-If you have no Invariant Sections, write "with no Invariant Sections"
-instead of saying which ones are invariant.  If you have no
-Front-Cover Texts, write "no Front-Cover Texts" instead of
-"Front-Cover Texts being [\fIlist\fP]"; likewise for Back-Cover Texts.
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+.hy 0
+.na
+    with the Invariant Sections being [\fILIST THEIR TITLES\fP], with the
+    Front-Cover Texts being [\fILIST\fP], and with the Back-Cover Texts being
+    [\fILIST\fP].
+.ad
+.hy 1
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
 
 If your document contains nontrivial examples of program code, we
 recommend releasing these examples in parallel under your choice of
--- a/info/dir	Sun Sep 11 22:21:01 2005 +0000
+++ b/info/dir	Mon Sep 19 10:20:33 2005 +0000
@@ -48,6 +48,7 @@
 * Message: (message).	Mail and news composition mode that goes with Gnus.
 * MH-E: (mh-e).		Emacs interface to the MH mail system.
 * MIME: (emacs-mime).   Emacs MIME de/composition library.
+* Newsticker: (newsticker).   A News ticker for Emacs.
 * PGG: (pgg).   	Emacs interface to various PGP implementations.
 * SC: (sc).		Supercite lets you cite parts of messages you're
 			  replying to, in flexible ways.
--- a/lib-src/ChangeLog	Sun Sep 11 22:21:01 2005 +0000
+++ b/lib-src/ChangeLog	Mon Sep 19 10:20:33 2005 +0000
@@ -1,3 +1,15 @@
+2005-09-15  Richard M. Stallman  <rms@gnu.org>
+
+	* Makefile.in (update-game-score.o): New target.
+	Compile and link this progranm separately.
+	(update-game-score${EXEEXT}): Use GETOPTDEPTS.
+
+2005-09-11  Jason Rumney  <jasonr@gnu.org>
+
+	* makefile.w32-in (../src/config.h): Don't overwrite. Print a
+	message instead.
+	(../src/paths.h): Removed.
+
 2005-07-27  Juanma Barranquero  <lekktu@gmail.com>
 
 	* .cvsignore: Don't ignore fns-* and fns.el, which are no longer
--- a/lib-src/Makefile.in	Sun Sep 11 22:21:01 2005 +0000
+++ b/lib-src/Makefile.in	Mon Sep 19 10:20:33 2005 +0000
@@ -460,10 +460,12 @@
 hexl${EXEEXT}: ${srcdir}/hexl.c ../src/config.h
 	$(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
 
-update-game-score${EXEEXT}: ${srcdir}/update-game-score.c ../src/config.h
-	$(CC) ${ALL_CFLAGS} ${srcdir}/update-game-score.c \
+update-game-score${EXEEXT}: update-game-score.o $(GETOPTDEPS)
+	$(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} update-game-score.o $(GETOPTOBJS) $(LOADLIBES) -o update-game-score
+
+update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h $(GETOPT_H)
+	$(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \
 	  -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
-	  $(LOADLIBES) -o update-game-score
 
 /* These are NOT included in INSTALLABLES or UTILITIES.
    See ../src/Makefile.in.  */
--- a/lib-src/makefile.w32-in	Sun Sep 11 22:21:01 2005 +0000
+++ b/lib-src/makefile.w32-in	Mon Sep 19 10:20:33 2005 +0000
@@ -300,9 +300,9 @@
 # Headers we would preprocess if we could.
 #
 ../src/config.h:	../nt/$(CONFIG_H)
-			$(CP) $(ALL_DEPS) $@
-../src/paths.h:		../nt/paths.h
-			$(CP) $(ALL_DEPS) $@
+			echo config.h has changed. Re-run configure.bat.
+			exit -1
+
 getopt.h:		getopt_.h
 			$(CP) $(ALL_DEPS) $@
 
--- a/lisp/ChangeLog	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/ChangeLog	Mon Sep 19 10:20:33 2005 +0000
@@ -1,3 +1,386 @@
+2005-09-18  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order
+	to cover prompts like "login as:".  Reported by Slawomir Nowaczyk
+	<slawomir.nowaczyk.847@student.lu.se>.
+
+2005-09-18  Chong Yidong  <cyd@stupidchicken.com>
+
+	* image.el (image-load-path): Use symbol `data-directory' instead
+	of its value, for backward compatibility with packages that bind
+	it during `find-image'.  Suggested by Katsumi Yamaoka.
+	(image-search-load-path): Handle symbols whose values are strings.
+
+2005-09-18  Romain Francoise  <romain@orebokech.com>
+
+	* calendar/diary-lib.el (mark-diary-entries): Rearrange to wrap
+	with-current-buffer form in save-excursion.
+
+2005-09-18  D Goel  <deego@gnufans.org>
+
+	* apropos.el (apropos-command): Fix `message' call: first arg
+	should be a format spec. In this and all other cases that appear
+	below and elsewhere in the source code, I made a change only when
+	two conditions were satisfied: [1] I can think of a possibility
+	that the arguments would cause an error, for example, the code is
+	question relies on extarnal variables such as filenames. [2] I was
+	sure that the arg to `message' could not have been nil in the
+	code.
+
+	* textmodes/tildify.el (tildify-region): Ditto.
+
+	* textmodes/reftex-index.el (reftex-index-change-entry)
+	(reftex-index-phrase-selection-or-word)
+	(reftex-query-index-phrase): Ditto.
+
+	* textmodes/reftex-dcr.el (reftex-echo-ref, reftex-echo-cite): Ditto.
+
+	* textmodes/org.el (org-complete, org-deadline, org-schedule)
+	(org-priority, org-table-sum): Ditto.
+
+	* textmodes/ispell.el (ispell-check-version)
+	(ispell-parse-output): Ditto.
+
+	* textmodes/flyspell.el (flyspell-mode-on)
+	(flyspell-notify-misspell, flyspell-word)
+	(flyspell-display-next-corrections): Ditto.
+
+	* textmodes/bibtex.el (bibtex-print-help-message): Ditto.
+
+	* textmodes/artist.el (artist-key-set-point-poly): Ditto.
+
+	* term/mac-win.el (mac-services-insert-text): Ditto.
+
+	* progmodes/vhdl-mode.el (vhdl-warning, vhdl-print-warnings)
+	(vhdl-hooked-abbrev, vhdl-template-insert-fun)
+	(vhdl-port-paste-testbench, vhdl-compose-new-component)
+	(vhdl-compose-configuration): Ditto.
+
+	* progmodes/sh-script.el (sh-blink, sh-show-indent)
+	(sh-set-indent, sh-learn-line-indent): Ditto.
+
+	* progmodes/ps-mode.el (ps-mode-target-column): Ditto.
+
+	* progmodes/idlwave.el (idlwave-make-tags)
+	(idlwave-scan-library-catalogs): Ditto.
+
+	* progmodes/idlw-shell.el (idlwave-shell-parse-stack-and-display): Ditto.
+
+	* progmodes/gud.el (gud-jdb-analyze-source): Ditto.
+
+	* progmodes/flymake.el (flymake-log): Ditto.
+
+	* progmodes/ebnf2ps.el (ebnf-generate-region): Ditto.
+
+	* progmodes/cmacexp.el (c-macro-expansion): Ditto.
+
+	* progmodes/ada-xref.el (ada-treat-cmd-string): Ditto.
+
+	* progmodes/ada-mode.el (ada-create-case-exception-substring)
+	(ada-justified-indent-current, ada-batch-reformat): Ditto.
+
+	* play/zone.el (zone): Ditto.
+
+	* play/landmark.el (lm-move): Ditto.
+
+	* play/decipher.el (decipher-show-alphabet): Ditto.
+
+	* net/newsticker.el (newsticker--display-jump)
+	(newsticker--display-scroll): Ditto.
+
+	* mail/rmail-spam-filter.el (rsf-add-subject-to-spam-list)
+	(rsf-add-sender-to-spam-list, rsf-add-region-to-spam-list): Ditto.
+
+	* mail/feedmail.el (feedmail-dump-message-to-queue): Ditto.
+
+	* eshell/esh-proc.el (eshell-remove-process-entry): Ditto.
+
+	* emulation/ws-mode.el (ws-last-error): Ditto.
+
+	* emulation/viper-macs.el (ex-map-read-args, ex-unmap-read-args)
+	(viper-record-kbd-macro): Ditto.
+
+	* emulation/viper-ex.el (ex-pwd, viper-info-on-file): Ditto.
+
+	* emacs-lisp/lisp-mnt.el (lm-report-bug): Ditto.
+
+	* emacs-lisp/find-func.el (find-function-noselect): Ditto.
+
+	* calendar/timeclock.el (timeclock-status-string)
+	(timeclock-workday-remaining-string)
+	(timeclock-workday-elapsed-string)
+	(timeclock-when-to-leave-string): Ditto.
+
+	* calendar/icalendar.el (icalendar--convert-ical-to-diary): Ditto.
+
+	* calc/calc-units.el (calc-enter-units-table): Ditto.
+
+	* calc/calc-mode.el (calc-mode-record-mode): Ditto.
+
+	* woman.el (woman-mini-help): Ditto.
+
+	* wdired.el (wdired-change-to-wdired-mode): Ditto.
+
+	* vc.el (vc-retrieve-snapshot): Ditto.
+
+	* strokes.el (strokes-read-stroke, strokes-read-complex-stroke): Ditto.
+
+	* startup.el (display-startup-echo-area-message): Ditto.
+
+	* simple.el (set-goal-column): Ditto.
+
+	* ses.el (ses-command-hook, ses-recalculate-cell): Ditto.
+
+	* server.el (server-process-filter): Ditto.
+
+	* printing.el (pr-interface-txt-print, pr-interface-printify)
+	(pr-interface-ps): Ditto.
+
+	* pcvs.el (cvs-help): Ditto.
+
+	* log-edit.el (log-edit, log-edit-mode-help): Ditto.
+
+	* iswitchb.el (iswitchb-possible-new-buffer): Ditto.
+
+	* isearch.el (isearch-edit-string): Ditto.
+
+	* image-mode.el (image-mode, image-minor-mode): Ditto.
+
+	* ibuf-macs.el (define-ibuffer-filter): Ditto.
+
+	* hi-lock.el (hi-lock-find-patterns): Ditto.
+
+	* files.el (toggle-read-only): Ditto.
+
+	* ediff-util.el (ediff-copy-diff)
+	(ediff-write-merge-buffer-and-maybe-kill): Ditto.
+
+	* echistory.el (Electric-history-undefined): Ditto.
+
+	* dnd.el (dnd-insert-text): Ditto.
+
+	* dired-aux.el (dired-query): Ditto.
+
+	* desktop.el (desktop-restore-file-buffer)
+	(desktop-lazy-create-buffer): Ditto.
+
+	* bookmark.el (bookmark-bmenu-locate): Ditto.
+
+	* obsolete/fast-lock.el (@top-level): Ditto in the macro
+	definition of `with-temp-message'.
+
+	* pcomplete.el (pcomplete--help): Fix `message' format spec. Not
+	having a %s would be weird, though not technically wrong.
+
+2005-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* term/mac-win.el (mac-add-charset-info): Doc fix.
+
+2005-09-17  Romain Francoise  <romain@orebokech.com>
+
+	* shell.el (shell-resync-dirs): Handle echoing processes more
+	reliably.  Don't insert resync command if `comint-process-echoes'
+	is non-nil.
+
+2005-09-17  Magnus Henoch  <mange@freemail.hu>
+
+	* textmodes/ispell.el (ispell-aspell-supports-utf8): New variable.
+	(ispell-check-version): Set ispell-aspell-supports-utf8 to t for
+	aspell versions >= 0.60.
+	(ispell-valid-dictionary-list): Call ispell-find-aspell-dictionaries
+	only if ispell-aspell-supports-utf8 is non-nil.
+
+2005-09-17  Johan Bockg,Ae(Brd  <bojohan@dd.chalmers.se>
+
+	* progmodes/scheme.el (scheme-mode-variables): Use setq to assign
+	buffer-local value to lisp-indent-function.
+
+2005-09-17  Milan Zamazal  <pdm@zamazal.org>
+
+	* progmodes/glasses.el (glasses-make-readable): If
+	glasses-separator differs from underscore, put appropriate
+	overlays over underscore characters.
+	(glasses-convert-to-unreadable): If glasses-separator differs from
+	underscore, try to convert glasses-separator characters to
+	underscores.
+
+2005-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* calendar/diary-lib.el (mark-diary-entries): Don't move point.
+	Use with-syntax-table and dolist.
+
+2005-09-16  Carsten Dominik  <dominik@science.uva.nl>
+
+	* textmodes/reftex-auc.el:
+	* textmodes/reftex-cite.el:
+	* textmodes/reftex-dcr.el:
+	* textmodes/reftex-global.el:
+	* textmodes/reftex-parse.el:
+	* textmodes/reftex-ref.el:
+	* textmodes/reftex-sel.el:
+	* textmodes/reftex-toc.el:
+	* textmodes/reftex-vars.el:
+	* textmodes/reftex.el: Small changes to remove compiler warnings.
+
+	* textmodes/reftex-index.el: Likewise.
+	(reftex-query-index-phrase): More efficient use of markers.
+
+2005-09-15  Chong Yidong  <cyd@stupidchicken.com>
+
+	* image.el (image-load-path): New variable.
+	(image-search-load-path): New function.
+	(find-image): Search for images in `image-load-path'.
+
+2005-09-15  Richard M. Stallman  <rms@gnu.org>
+
+	* follow.el: Change Maintainer field.
+
+2005-09-15  David Ponce  <david@dponce.com>
+
+	* recentf.el (recentf-save-file-modes): New option.
+	(recentf-save-list): Use it.
+
+2005-09-15  Nick Roberts  <nickrob@snap.net.nz>
+
+	* bindings.el (mode-line-eol-desc, mode-line-coding-system-map)
+	(mode-line-mule-info, mode-line-modified): Move bindings from
+	mouse-3 to mouse-1.
+
+2005-09-15  Chong Yidong  <cyd@stupidchicken.com>
+
+	* simple.el (sendmail-user-agent-compose): Revert last change.
+
+2005-09-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* net/ange-ftp.el (ange-ftp-process-filter): Revert to ^#+$.
+	Use with-current-buffer.
+	(ange-ftp-gwp-start): Remove unused var `gw-user'.
+	(ange-ftp-guess-hash-mark-size): Remove unused var `result'.
+	(ange-ftp-insert-directory): Remove unused var `short'.
+	(ange-ftp-file-name-sans-versions): Remove unused var `host-type'.
+
+	* pcvs-defs.el (cvs-version): Recognize CVSNT version string.
+	(cvs-execute-single-dir): Change default: cvs-1.9 is ancient.
+
+	* calendar/cal-menu.el: Don't require easymenu, since we don't use it.
+	(check-calendar-holidays, diary-list-entries): Autoload.
+	Otherwise `emacs -q' followed by "mouse-2 -> diary entries" burps.
+	(calendar-mouse-holidays, calendar-mouse-view-diary-entries): Simplify.
+
+	* calendar/diary-lib.el (diary-show-all-entries): Fix last change,
+	which mistakenly removed a call to display-buffer.
+
+2005-09-14  Juanma Barranquero  <lekktu@gmail.com>
+
+	* obsolete/iso-insert.el: Move to obsolete/ from international/.
+
+2005-09-14  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* progmodes/hideshow.el
+	(hs-hide-comments-when-hiding-all): Remove autoload cookie.
+	(hs-allow-nesting): New user var.
+	(hs-discard-overlays): Skip "internal" overlays if nesting allowed.
+	(hs-hide-block-at-point): When nesting allowed,
+	if there is already an overlay in place, delete it.
+	(hs-safety-is-job-n): Delete func; remove call sites.
+	(hs-hide-level-recursive): Don't pre-clean if nesting allowed.
+	(hs-overlay-at): New func.
+	(hs-already-hidden-p, hs-show-block): Use it.
+	(hs-hide-all): Don't pre-clean if nesting allowed.
+	(hs-show-all): Temporarily disallow
+	nesting around call to `hs-discard-overlays'.
+
+2005-09-14  Chong Yidong  <cyd@stupidchicken.com>
+
+	* mouse.el (mouse-major-mode-menu): Make `prefix' optional.
+	Delete unused local var.
+
+2005-09-13  Juanma Barranquero  <lekktu@gmail.com>
+
+	* help-fns.el (describe-categories): "?\ " -> "?\s".
+	(help-do-arg-highlight): Recognize also ARG-n, as in
+	`move-to-left-margin' (ARG+n is already recognized).  Simplify.
+
+	* international/codepage.el (dos-unsupported-char-glyph):
+	* net/newsticker.el (tool-bar-map, w3-mode-map)
+	(w3m-minor-mode-map):
+	* progmodes/vhdl-mode.el (conf-alist, conf-entry, conf-key)
+	(ent-alist):
+	* textmodes/reftex-vars.el (reftex-tables-dirty): Add defvars.
+
+2005-09-13  Chong Yidong  <cyd@stupidchicken.com>
+
+	* custom.el (custom-push-theme): Handle the case where a symbol is
+	bound but face properties have not yet been assigned.
+
+	* mail/sendmail.el (mail): Use new buffer if `noerase' is `new'.
+	Fix behavior if noerase is `t' and there is no mail buffer.
+
+	* simple.el (sendmail-user-agent-compose): Use a new mail buffer
+	if `continue' is nil, rather than signal an error.
+
+2005-09-12  Richard M. Stallman  <rms@gnu.org>
+
+	* font-lock.el (font-lock-keywords): Add autoload.
+
+	* help-fns.el (describe-variable): Rearrange to put source link
+	in a predictable place.
+
+	* net/newsticker.el: New file.
+
+2005-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* calendar/calendar.el (calendar-for-loop): Add edebug info.
+	(calendar-basic-setup): Use the new nil arg.
+	(number-of-diary-entries): Move to diary-lib.el.
+
+	* calendar/diary-lib.el: Use with-current-buffer, match-string.
+	(diary-list-entries): Use with-syntax-table and dolist.
+	Rename from list-diary-entries.
+	Use number-of-diary-entries if `number' is nil.
+	(diary, diary-view-entries): Use this new name and new nil arg value.
+	(number-of-diary-entries): Move from calendar.el.
+	(diary-unhide-everything): New function.
+	(include-other-diary-files, fancy-diary-display)
+	(diary-show-all-entries, make-diary-entry): Use it.
+	(diary-mail-entries): Use buffer-string.
+	(mark-diary-entries): Fix long standing paren typo.
+	(diary-sexp-entry): Use count-lines.
+	(make-diary-entry): Avoid `previous-line'.
+	(diary-mode-map): New var.
+	(diary-mode): Redraw cal after saving.  Setup header-line.
+	(fancy-diary-display-mode): Use local-set-key.
+
+	* startup.el (command-line): Try calling various terminal-init-foo-bar
+	functions by stripping hyphenated suffixes from $TERM.
+
+	* files.el (normal-mode): Check boundness of font-lock-keywords.
+
+2005-09-12  Richard M. Stallman  <rms@gnu.org>
+
+	* progmodes/compile.el: Don't decide a file's directory
+	until the user actually tries to go there.
+	(compilation-next-error-function):
+	Pass compilation-find-file the directory from the file-struct.
+	(compilation-internal-error-properties): Separate local FILE-STRUCT
+	from FILE.  Doc the args better.  Rename arg FMT to FMTS.
+	(compilation-find-file): Arg DIR renamed to DIRECTORY.
+	Expand it, and if nil, use default-directory.
+	(compilation-get-file-structure): Don't mix specified directory
+	with default directory.  Put specified directory into
+	file-struct.  Don't make the file name absolute.
+
+	* progmodes/compile.el (compilation-error-regexp-alist): Doc fix.
+	(compile-command): Add autoload.
+	(compilation-disable-input): Add autoload.
+
+2005-09-11  Stephen Gildea  <gildea@stop.mail-abuse.org>
+
+	* time-stamp.el: Mention variable `time-stamp-pattern' in doc
+	strings of the variables it can override.
+	(time-stamp): New (as yet undocumented) time-stamp-format escapes
+	%Q and %q, for fully-qualified domain name and unqualified host name.
+
 2005-09-11  Kim F. Storm  <storm@cua.dk>
 
 	* emacs-lisp/authors.el (authors-aliases): Update list.
@@ -15,14 +398,14 @@
 
 2005-09-10  Pascal Dupuis  <Pascal.Dupuis@esat.kuleuven.be>  (tiny change)
 
-	* progmodes/octave-inf.el (inferior-octave-startup): Resync
-	current dir at the end.
+	* progmodes/octave-inf.el (inferior-octave-startup):
+	Resync current dir at the end.
 
 2005-09-10  Emilio C. Lopes  <eclig@gmx.net>
 
-	* woman.el (woman-topic-at-point-default): Renamed to
-	woman-use-topic-at-point-default.
-	(woman-topic-at-point): Renamed to woman-use-topic-at-point.
+	* woman.el (woman-topic-at-point-default):
+	Rename to woman-use-topic-at-point-default.
+	(woman-topic-at-point): Rename to woman-use-topic-at-point.
 	(woman-file-name): Reflect renames above.  Automatically use the
 	word at point as topic if woman-use-topic-at-point is non-nil.
 	Otherwise offer it as default but don't insert it in the
@@ -40,28 +423,26 @@
 	(menu-bar-non-minibuffer-window-p): New functions.
 	("Split Window", "Save As..."): Use them.
 	("Postscript Print Buffer (B+W)", "Postscript Print Buffer")
-	("Print Buffer", "Truncate Long Lines in this Buffer"):  Use
-	menu-bar-menu-frame-live-and-visible-p.
+	("Print Buffer", "Truncate Long Lines in this Buffer"):
+	Use menu-bar-menu-frame-live-and-visible-p.
 	("Save Buffer", "Insert File", "Open Directory...")
-	("Open File...", "Visit New File..."): Use
-	menu-bar-non-minibuffer-window-p.
-	(kill-this-buffer-enabled-p, dired <menu-enable>): Use
-	menu-bar-non-minibuffer-window-p.
+	("Open File...", "Visit New File..."):
+	Use menu-bar-non-minibuffer-window-p.
+	(kill-this-buffer-enabled-p, dired <menu-enable>):
+	Use menu-bar-non-minibuffer-window-p.
 
 2005-09-09  Eli Zaretskii  <eliz@gnu.org>
 
 	* cus-start.el (all): Don't complain about fringe-related
 	built-ins if fringes are not supported.  Ditto about
-	selection-related built-ins.  Fix the test for GTK-related
-	built-ins.
+	selection-related built-ins.  Fix the test for GTK-related built-ins.
 
 	* menu-bar.el ("Split Window", "Postscript Print Buffer (B+W)")
 	("Postscript Print Buffer", "Print Region", "Save As...")
 	("Save", "Insert File...", "Open Directory...")
 	("Open File...", "Visit New File..."")
 	("Truncate Long Lines in this Buffer"): Don't look at
-	menu-updating-frame if this display does not support multiple
-	frames.
+	menu-updating-frame if this display does not support multiple frames.
 
 2005-09-09  Frederik Fouvry  <fouvry@CoLi.Uni-SB.DE>
 
@@ -94,15 +475,6 @@
 
 	* descr-text.el (describe-property-list): Handle non-symbol prop names.
 
-2005-09-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-	* net/ange-ftp.el (ange-ftp-process-filter): Revert to ^#+$.
-	Use with-current-buffer.
-	(ange-ftp-gwp-start): Remove unused var `gw-user'.
-	(ange-ftp-guess-hash-mark-size): Remove unused var `result'.
-	(ange-ftp-insert-directory): Remove unused var `short'.
-	(ange-ftp-file-name-sans-versions): Remove unused var `host-type'.
-
 2005-08-30  Richard M. Stallman  <rms@gnu.org>
 
 	* simple.el (blink-matching-open): Get rid of text props from
@@ -138,6 +510,13 @@
 	(recentf-open-files): Use it.
 	(recentf-open-file-with-key): New command.
 
+2005-09-08  Chong Yidong  <cyd@stupidchicken.com>
+
+	* buff-menu.el (Buffer-menu-sort-by-column): New function.
+	Suggested by Kim F. Storm.
+	(Buffer-menu-sort-button-map): Global keymap for sort buttons.
+	(Buffer-menu-make-sort-button): Use global keymap.
+
 2005-09-07  Michael Albinus  <michael.albinus@gmx.de>
 
 	* woman.el (top): Remap `man' command by `woman' in `woman-mode-map'.
@@ -163,13 +542,6 @@
 	* calc/calc-poly.el (math-expand-term): Multiply out any powers
 	when in matrix mode.
 
-2005-09-08  Chong Yidong  <cyd@stupidchicken.com>
-
-	* buff-menu.el (Buffer-menu-sort-by-column): New function.
-	Suggested by Kim F. Storm.
-	(Buffer-menu-sort-button-map): Global keymap for sort buttons.
-	(Buffer-menu-make-sort-button): Use global keymap.
-
 2005-09-06  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* buff-menu.el (Buffer-menu-make-sort-button): Add docstrings, use
--- a/lisp/apropos.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/apropos.el	Mon Sep 19 10:20:33 2005 +0000
@@ -443,7 +443,7 @@
 	(setq p (cdr p))))
     (and (apropos-print t nil)
 	 message
-	 (message message))))
+	 (message "%s" message))))
 
 
 ;;;###autoload
--- a/lisp/bindings.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/bindings.el	Mon Sep 19 10:20:33 2005 +0000
@@ -123,7 +123,7 @@
 
 (defvar mode-line-coding-system-map
   (let ((map (make-sparse-keymap)))
-    (define-key map [mode-line mouse-3]
+    (define-key map [mode-line mouse-1]
       (lambda (e)
 	(interactive "e")
 	(save-selected-window
@@ -156,7 +156,7 @@
       (setq desc
 	    (propertize
 	     mnemonic
-	     'help-echo (format "%s end-of-line; mouse-3 to cycle"
+	     'help-echo (format "%s end-of-line; mouse-1 to cycle"
 				(if (eq eol 0) "Unix-style LF"
 				  (if (eq eol 1) "Dos-style CRLF"
 				    (if (eq eol 2) "Mac-style CR"
@@ -164,7 +164,7 @@
 	     'keymap
 	     (eval-when-compile
 	       (let ((map (make-sparse-keymap)))
-		 (define-key map [mode-line mouse-3] 'mode-line-change-eol)
+		 (define-key map [mode-line mouse-1] 'mode-line-change-eol)
 		 map))
 	     'mouse-face 'mode-line-highlight))
       (push (cons eol (cons mnemonic desc)) mode-line-eol-desc-cache)
@@ -190,7 +190,7 @@
 	    (when buffer-file-coding-system
 	      (if enable-multibyte-characters
 		  (concat (symbol-name buffer-file-coding-system)
-			  " buffer; mouse-3: describe coding system")
+			  " buffer; mouse-1: describe coding system")
 		(concat "Unibyte " (symbol-name buffer-file-coding-system)
 			" buffer")))))
       'mouse-face 'mode-line-highlight
@@ -230,27 +230,27 @@
   (list (propertize
 	 "%1*"
 	 'help-echo (purecopy (lambda (window object point)
- 				(format "%sead-only: mouse-3 toggles"
+ 				(format "%sead-only: mouse-1 toggles"
 					(save-selected-window
 					  (select-window window)
 					  (if buffer-read-only
 					      "R"
 					    "Not r")))))
 	 'local-map (purecopy (make-mode-line-mouse-map
-			       'mouse-3
+			       'mouse-1
 			       #'mode-line-toggle-read-only))
 	 'mouse-face 'mode-line-highlight)
 	(propertize
 	 "%1+"
 	 'help-echo  (purecopy (lambda (window object point)
-				 (format "%sodified: mouse-3 toggles"
+				 (format "%sodified: mouse-1 toggles"
 					 (save-selected-window
 					   (select-window window)
 					   (if (buffer-modified-p)
 					     "M"
 					   "Not m")))))
 	 'local-map (purecopy (make-mode-line-mouse-map
-			       'mouse-3 #'mode-line-toggle-modified))
+			       'mouse-1 #'mode-line-toggle-modified))
 	 'mouse-face 'mode-line-highlight))
   "Mode-line control for displaying whether current buffer is modified.")
 
--- a/lisp/bookmark.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/bookmark.el	Mon Sep 19 10:20:33 2005 +0000
@@ -2058,7 +2058,7 @@
   (interactive)
   (if (bookmark-bmenu-check-position)
       (let ((bmrk (bookmark-bmenu-bookmark)))
-        (message (bookmark-location bmrk)))))
+        (message "%s" (bookmark-location bmrk)))))
 
 (defun bookmark-bmenu-relocate ()
   "Change the file path of the bookmark on the current line,
--- a/lisp/calc/calc-mode.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/calc/calc-mode.el	Mon Sep 19 10:20:33 2005 +0000
@@ -408,7 +408,8 @@
 			   ((= n 4) 'global)
 			   ((= n 5) 'save)
 			   (t 'local)))
-   (message (cond ((and (eq calc-mode-save-mode 'local) calc-embedded-info)
+   (message "%s" 
+	    (cond ((and (eq calc-mode-save-mode 'local) calc-embedded-info)
 		   "Recording mode changes with [calc-mode: ...]")
 		  ((eq calc-mode-save-mode 'edit)
 		   "Recording mode changes with [calc-edit-mode: ...]")
--- a/lisp/calc/calc-units.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/calc/calc-units.el	Mon Sep 19 10:20:33 2005 +0000
@@ -515,7 +515,7 @@
   (interactive "P")
   (and n (setq math-units-table-buffer-valid nil))
   (math-build-units-table-buffer t)
-  (message (substitute-command-keys "Type \\[calc] to return to the Calculator")))
+  (message "%s" (substitute-command-keys "Type \\[calc] to return to the Calculator")))
 
 (defun calc-define-unit (uname desc)
   (interactive "SDefine unit name: \nsDescription: ")
--- a/lisp/calendar/cal-menu.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/calendar/cal-menu.el	Mon Sep 19 10:20:33 2005 +0000
@@ -44,7 +44,6 @@
 (defvar event)
 
 (eval-when-compile (require 'calendar))
-(require 'easymenu)
 
 (define-key calendar-mode-map [menu-bar edit] 'undefined)
 (define-key calendar-mode-map [menu-bar search] 'undefined)
@@ -323,12 +322,14 @@
     (calendar-cursor-to-date (calendar-current-date))
     (calendar-cursor-holidays)))
 
+(autoload 'check-calendar-holidays "holidays")
+(autoload 'diary-list-entries "diary-lib")
+
 (defun calendar-mouse-holidays ()
   "Pop up menu of holidays for mouse selected date."
   (interactive)
   (let* ((date (calendar-event-to-date))
-         (l (mapcar '(lambda (x) (list x))
-                    (check-calendar-holidays date)))
+         (l (mapcar 'list (check-calendar-holidays date)))
          (selection
           (cal-menu-x-popup-menu
            event
@@ -350,11 +351,10 @@
          (diary-list-include-blanks nil)
          (diary-display-hook 'ignore)
          (diary-entries
-          (mapcar '(lambda (x) (split-string (car (cdr x)) "\^M\\|\n"))
-                  (list-diary-entries date 1)))
+          (mapcar (lambda (x) (split-string (car (cdr x)) "\^M\\|\n"))
+                  (diary-list-entries date 1)))
          (holidays (if holidays-in-diary-buffer
-                       (mapcar '(lambda (x) (list x))
-                               (check-calendar-holidays date))))
+                       (check-calendar-holidays date)))
          (title (concat "Diary entries "
                         (if diary (format "from %s " diary) "")
                         "for "
@@ -365,9 +365,7 @@
            (list title
                  (append
                   (list title)
-                  (if holidays
-                      (mapcar '(lambda (x) (list (concat "     " (car x))))
-                              holidays))
+                  (mapcar (lambda (x) (list (concat "     " x))) holidays)
                   (if holidays
                       (list "--shadow-etched-in" "--shadow-etched-in"))
                   (if diary-entries
--- a/lisp/calendar/calendar.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/calendar/calendar.el	Mon Sep 19 10:20:33 2005 +0000
@@ -164,35 +164,6 @@
   :group 'diary)
 
 ;;;###autoload
-(defcustom number-of-diary-entries 1
-  "*Specifies how many days of diary entries are to be displayed initially.
-This variable affects the diary display when the command \\[diary] is used,
-or if the value of the variable `view-diary-entries-initially' is t.  For
-example, if the default value 1 is used, then only the current day's diary
-entries will be displayed.  If the value 2 is used, then both the current
-day's and the next day's entries will be displayed.
-
-The value can also be a vector such as [0 2 2 2 2 4 1]; this value
-says to display no diary entries on Sunday, the display the entries
-for the current date and the day after on Monday through Thursday,
-display Friday through Monday's entries on Friday, and display only
-Saturday's entries on Saturday.
-
-This variable does not affect the diary display with the `d' command
-from the calendar; in that case, the prefix argument controls the
-number of days of diary entries displayed."
-  :type '(choice (integer :tag "Entries")
-		 (vector :value [0 0 0 0 0 0 0]
-			 (integer :tag "Sunday")
-			 (integer :tag "Monday")
-			 (integer :tag "Tuesday")
-			 (integer :tag "Wednesday")
-			 (integer :tag "Thursday")
-			 (integer :tag "Friday")
-			 (integer :tag "Saturday")))
-  :group 'diary)
-
-;;;###autoload
 (defcustom mark-diary-entries-in-calendar nil
   "*Non-nil means mark dates with diary entries, in the calendar window.
 The marking symbol is specified by the variable `diary-entry-marker'."
@@ -393,7 +364,7 @@
 
 For example,
 
-  (add-hook 'calendar-move-hook (lambda () (view-diary-entries 1)))
+  (add-hook 'calendar-move-hook (lambda () (diary-view-entries 1)))
 
 redisplays the diary for whatever date the cursor is moved to."
   :type 'hook
@@ -1335,6 +1306,7 @@
 
 (defmacro calendar-for-loop (var from init to final do &rest body)
   "Execute a for loop."
+  (declare (debug (symbolp "from" form "to" form "do" body)))
   `(let ((,var (1- ,init)))
     (while (>= ,final (setq ,var (1+ ,var)))
       ,@body)))
@@ -1651,10 +1623,7 @@
     (increment-calendar-month month year (- calendar-offset))
     (generate-calendar-window month year)
     (if (and view-diary-entries-initially (calendar-date-is-visible-p date))
-        (view-diary-entries
-         (if (vectorp number-of-diary-entries)
-             (aref number-of-diary-entries (calendar-day-of-week date))
-           number-of-diary-entries))))
+        (diary-view-entries)))
   (let* ((diary-buffer (get-file-buffer diary-file))
          (diary-window (if diary-buffer (get-buffer-window diary-buffer)))
          (split-height-threshold (if diary-window 2 1000)))
@@ -1662,7 +1631,7 @@
         (list-calendar-holidays)))
   (run-hooks 'initial-calendar-window-hook))
 
-(autoload 'view-diary-entries "diary-lib"
+(autoload 'diary-view-entries "diary-lib"
   "Prepare and display a buffer with diary entries.
 Searches your diary file for entries that match ARG days starting with
 the date indicated by the cursor position in the displayed three-month
@@ -2272,7 +2241,7 @@
   (define-key calendar-mode-map "x"   'mark-calendar-holidays)
   (define-key calendar-mode-map "u"   'calendar-unmark)
   (define-key calendar-mode-map "m"   'mark-diary-entries)
-  (define-key calendar-mode-map "d"   'view-diary-entries)
+  (define-key calendar-mode-map "d"   'diary-view-entries)
   (define-key calendar-mode-map "D"   'view-other-diary-entries)
   (define-key calendar-mode-map "s"   'show-all-diary-entries)
   (define-key calendar-mode-map "pd"  'calendar-print-day-of-year)
@@ -2493,8 +2462,7 @@
 (defun update-calendar-mode-line ()
   "Update the calendar mode line with the current date and date style."
   (if (bufferp (get-buffer calendar-buffer))
-      (save-excursion
-        (set-buffer calendar-buffer)
+      (with-current-buffer calendar-buffer
         (setq mode-line-format
               (calendar-string-spread
                (let ((date (condition-case nil
@@ -2589,14 +2557,15 @@
           (list month
                 (string-to-number (buffer-substring (1+ (point)) (+ 4 (point))))
                 year))
-      (if (looking-at "\\*")
-          (save-excursion
-            (re-search-backward "[^*]")
-            (if (looking-at ".\\*\\*")
-                (list month calendar-starred-day year)
-              (if error (error "Not on a date!"))))
+      (if (and (looking-at "\\*")
+               (save-excursion
+                 (re-search-backward "[^*]")
+                 (looking-at ".\\*\\*")))
+          (list month calendar-starred-day year)
         (if error (error "Not on a date!"))))))
 
+(add-to-list 'debug-ignored-errors "Not on a date!")
+
 ;; The following version of calendar-gregorian-from-absolute is preferred for
 ;; reasons of clarity, BUT it's much slower than the version that follows it.
 
@@ -3071,8 +3040,7 @@
   "Show dates on other calendars for date under the cursor."
   (interactive)
   (let* ((date (calendar-cursor-to-date t)))
-    (save-excursion
-      (set-buffer (get-buffer-create other-calendars-buffer))
+    (with-current-buffer (get-buffer-create other-calendars-buffer)
       (setq buffer-read-only nil)
       (calendar-set-mode-line
        (concat (calendar-date-string date) " (Gregorian)"))
@@ -3138,9 +3106,9 @@
 
 (provide 'calendar)
 
-;;; Local variables:
-;;; byte-compile-dynamic: t
-;;; End:
-
-;;; arch-tag: 19c61596-c8fb-4c69-bcf1-7dd739919cd8
+;; Local variables:
+;; byte-compile-dynamic: t
+;; End:
+
+;; arch-tag: 19c61596-c8fb-4c69-bcf1-7dd739919cd8
 ;;; calendar.el ends here
--- a/lisp/calendar/diary-lib.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/calendar/diary-lib.el	Mon Sep 19 10:20:33 2005 +0000
@@ -58,21 +58,17 @@
   (interactive "P")
   (diary-check-diary-file)
   (let ((date (calendar-current-date)))
-    (list-diary-entries
-     date
-     (cond (arg (prefix-numeric-value arg))
-           ((vectorp number-of-diary-entries)
-            (aref number-of-diary-entries (calendar-day-of-week date)))
-           (t number-of-diary-entries)))))
+    (diary-list-entries date (if arg (prefix-numeric-value arg)))))
 
-(defun view-diary-entries (arg)
+(define-obsolete-function-alias 'view-diary-entries 'diary-view-entries)
+(defun diary-view-entries (&optional arg)
   "Prepare and display a buffer with diary entries.
 Searches the file named in `diary-file' for entries that
 match ARG days starting with the date indicated by the cursor position
 in the displayed three-month calendar."
   (interactive "p")
   (diary-check-diary-file)
-  (list-diary-entries (calendar-cursor-to-date t) arg))
+  (diary-list-entries (calendar-cursor-to-date t) arg))
 
 (defun view-other-diary-entries (arg d-file)
   "Prepare and display buffer of diary entries from an alternative diary file.
@@ -182,14 +178,15 @@
   "Local time of candle lighting diary entry--applies if date is a Friday.
 No diary entry if there is no sunset on that date.")
 
-(defvar diary-syntax-table (copy-syntax-table (standard-syntax-table))
+(defvar diary-syntax-table
+  (let ((st (copy-syntax-table (standard-syntax-table))))
+    (modify-syntax-entry ?* "w" st)
+    (modify-syntax-entry ?: "w" st)
+    st)
   "The syntax table used when parsing dates in the diary file.
 It is the standard syntax table used in Fundamental mode, but with the
 syntax of `*' and `:' changed to be word constituents.")
 
-(modify-syntax-entry ?* "w" diary-syntax-table)
-(modify-syntax-entry ?: "w" diary-syntax-table)
-
 (defvar diary-entries-list)
 (defvar displayed-year)
 (defvar displayed-month)
@@ -243,9 +240,7 @@
 		    regexp (concat diary-glob-file-regexp-prefix regexp))
 	      (setq attrvalue nil)
 	      (if (re-search-forward regexp (point-max) t)
-		  (setq attrvalue (buffer-substring-no-properties
-				   (match-beginning regnum)
-				   (match-end regnum))))
+		  (setq attrvalue (match-string-no-properties regnum)))
 	      (if (and attrvalue
 		       (setq attrvalue (diary-attrtype-convert attrvalue type)))
 		  (setq ret-attr (append ret-attr (list attrname attrvalue))))
@@ -264,9 +259,7 @@
 	    (setq attrvalue nil)
 	    (if (string-match regexp entry)
 		(progn
-		  (setq attrvalue (substring-no-properties entry
-							   (match-beginning regnum)
-							   (match-end regnum)))
+		  (setq attrvalue (match-string-no-properties regnum entry))
 		  (setq entry (replace-match "" t t entry))))
 	    (if (and attrvalue
 		     (setq attrvalue (diary-attrtype-convert attrvalue type)))
@@ -299,8 +292,38 @@
 
 (defvar diary-saved-point)		; internal
 
-(defun list-diary-entries (date number)
-  "Create and display a buffer containing the relevant lines in diary-file.
+
+(defcustom number-of-diary-entries 1
+  "Specifies how many days of diary entries are to be displayed initially.
+This variable affects the diary display when the command \\[diary] is used,
+or if the value of the variable `view-diary-entries-initially' is t.  For
+example, if the default value 1 is used, then only the current day's diary
+entries will be displayed.  If the value 2 is used, then both the current
+day's and the next day's entries will be displayed.
+
+The value can also be a vector such as [0 2 2 2 2 4 1]; this value
+says to display no diary entries on Sunday, the display the entries
+for the current date and the day after on Monday through Thursday,
+display Friday through Monday's entries on Friday, and display only
+Saturday's entries on Saturday.
+
+This variable does not affect the diary display with the `d' command
+from the calendar; in that case, the prefix argument controls the
+number of days of diary entries displayed."
+  :type '(choice (integer :tag "Entries")
+		 (vector :value [0 0 0 0 0 0 0]
+			 (integer :tag "Sunday")
+			 (integer :tag "Monday")
+			 (integer :tag "Tuesday")
+			 (integer :tag "Wednesday")
+			 (integer :tag "Thursday")
+			 (integer :tag "Friday")
+			 (integer :tag "Saturday")))
+  :group 'diary)
+
+(define-obsolete-function-alias 'list-diary-entries 'diary-list-entries)
+(defun diary-list-entries (date number)
+  "Create and display a buffer containing the relevant lines in `diary-file'.
 The arguments are DATE and NUMBER; the entries selected are those
 for NUMBER days starting with date DATE.  The other entries are hidden
 using selective display.  If NUMBER is less than 1, this function does nothing.
@@ -332,10 +355,12 @@
 
     `diary-hook' is run last.  This can be used for an appointment
         notification function."
-
+  (unless number
+    (setq number (if (vectorp number-of-diary-entries)
+                     (aref number-of-diary-entries (calendar-day-of-week date))
+                   number-of-diary-entries)))
   (when (> number 0)
     (let ((original-date date);; save for possible use in the hooks
-          old-diary-syntax-table
           diary-entries-list
           file-glob-attrs
           (date-string (calendar-date-string date))
@@ -356,100 +381,94 @@
             (setq selective-display-ellipses nil)
             (if diary-header-line-flag
                 (setq header-line-format diary-header-line-format))
-            (setq old-diary-syntax-table (syntax-table))
-            (set-syntax-table diary-syntax-table)
-            (unwind-protect
-                (let ((buffer-read-only nil)
-                      (diary-modified (buffer-modified-p))
-                      (mark (regexp-quote diary-nonmarking-symbol)))
-                  ;; First and last characters must be ^M or \n for
-                  ;; selective display to work properly
-                  (goto-char (1- (point-max)))
-                  (if (not (looking-at "\^M\\|\n"))
-                      (progn
-                        (goto-char (point-max))
-                        (insert "\^M")))
-                  (goto-char (point-min))
-                  (if (not (looking-at "\^M\\|\n"))
-                      (insert "\^M"))
-                  (subst-char-in-region (point-min) (point-max) ?\n ?\^M t)
-                  (calendar-for-loop
-                   i from 1 to number do
-                   (let ((d diary-date-forms)
-                         (month (extract-calendar-month date))
-                         (day (extract-calendar-day date))
-                         (year (extract-calendar-year date))
-                         (entry-found (list-sexp-diary-entries date)))
-                     (while d
-                       (let*
-                           ((date-form (if (equal (car (car d)) 'backup)
-                                           (cdr (car d))
-                                         (car d)))
-                            (backup (equal (car (car d)) 'backup))
-                            (dayname
-                             (format "%s\\|%s\\.?"
-                                     (calendar-day-name date)
-                                     (calendar-day-name date 'abbrev)))
-                            (monthname
-                             (format "\\*\\|%s\\|%s\\.?"
-                                     (calendar-month-name month)
-                                     (calendar-month-name month 'abbrev)))
-                            (month (concat "\\*\\|0*" (int-to-string month)))
-                            (day (concat "\\*\\|0*" (int-to-string day)))
-                            (year
-                             (concat
-                              "\\*\\|0*" (int-to-string year)
-                              (if abbreviated-calendar-year
-                                  (concat "\\|" (format "%02d" (% year 100)))
-                                "")))
-                            (regexp
-                             (concat
-                              "\\(\\`\\|\^M\\|\n\\)" mark "?\\("
-                              (mapconcat 'eval date-form "\\)\\(")
-                              "\\)"))
-                            (case-fold-search t))
-                         (goto-char (point-min))
-                         (while (re-search-forward regexp nil t)
-                           (if backup (re-search-backward "\\<" nil t))
-                           (if (and (or (char-equal (preceding-char) ?\^M)
-                                        (char-equal (preceding-char) ?\n))
-                                    (not (looking-at " \\|\^I")))
-                               ;;  Diary entry that consists only of date.
-                               (backward-char 1)
-                             ;; Found a nonempty diary entry--make it
-                             ;; visible and add it to the list.
-                             (setq entry-found t)
-                             (let ((entry-start (point))
-                                   date-start temp)
-                               (re-search-backward "\^M\\|\n\\|\\`")
-                               (setq date-start (point))
-                               (re-search-forward "\^M\\|\n" nil t 2)
-                               (while (looking-at " \\|\^I")
-                                 (re-search-forward "\^M\\|\n" nil t))
-                               (backward-char 1)
-                               (subst-char-in-region date-start
-                                                     (point) ?\^M ?\n t)
-                               (setq entry (buffer-substring entry-start (point))
-                                     temp (diary-pull-attrs entry file-glob-attrs)
-                                     entry (nth 0 temp))
-                               (add-to-diary-list
-                                date
-                                entry
-                                (buffer-substring
-                                 (1+ date-start) (1- entry-start))
-                                (copy-marker entry-start) (nth 1 temp))))))
-                       (setq d (cdr d)))
-                     (or entry-found
-                         (not diary-list-include-blanks)
-                         (setq diary-entries-list
-                               (append diary-entries-list
-                                       (list (list date "" "" "" "")))))
-                     (setq date
-                           (calendar-gregorian-from-absolute
-                            (1+ (calendar-absolute-from-gregorian date))))
-                     (setq entry-found nil)))
-                  (set-buffer-modified-p diary-modified))
-              (set-syntax-table old-diary-syntax-table))
+            (with-syntax-table diary-syntax-table
+              (let ((buffer-read-only nil)
+                    (diary-modified (buffer-modified-p))
+                    (mark (regexp-quote diary-nonmarking-symbol)))
+                ;; First and last characters must be ^M or \n for
+                ;; selective display to work properly
+                (goto-char (1- (point-max)))
+                (if (not (looking-at "\^M\\|\n"))
+                    (progn
+                      (goto-char (point-max))
+                      (insert "\^M")))
+                (goto-char (point-min))
+                (if (not (looking-at "\^M\\|\n"))
+                    (insert "\^M"))
+                (subst-char-in-region (point-min) (point-max) ?\n ?\^M t)
+                (calendar-for-loop
+                 i from 1 to number do
+                 (let ((month (extract-calendar-month date))
+                       (day (extract-calendar-day date))
+                       (year (extract-calendar-year date))
+                       (entry-found (list-sexp-diary-entries date)))
+                   (dolist (date-form diary-date-forms)
+                     (let*
+                         ((backup (when (eq (car date-form) 'backup)
+                                    (setq date-form (cdr date-form))
+                                    t))
+                          (dayname
+                           (format "%s\\|%s\\.?"
+                                   (calendar-day-name date)
+                                   (calendar-day-name date 'abbrev)))
+                          (monthname
+                           (format "\\*\\|%s\\|%s\\.?"
+                                   (calendar-month-name month)
+                                   (calendar-month-name month 'abbrev)))
+                          (month (concat "\\*\\|0*" (int-to-string month)))
+                          (day (concat "\\*\\|0*" (int-to-string day)))
+                          (year
+                           (concat
+                            "\\*\\|0*" (int-to-string year)
+                            (if abbreviated-calendar-year
+                                (concat "\\|" (format "%02d" (% year 100)))
+                              "")))
+                          (regexp
+                           (concat
+                            "\\(\\`\\|\^M\\|\n\\)" mark "?\\("
+                            (mapconcat 'eval date-form "\\)\\(")
+                            "\\)"))
+                          (case-fold-search t))
+                       (goto-char (point-min))
+                       (while (re-search-forward regexp nil t)
+                         (if backup (re-search-backward "\\<" nil t))
+                         (if (and (or (char-equal (preceding-char) ?\^M)
+                                      (char-equal (preceding-char) ?\n))
+                                  (not (looking-at " \\|\^I")))
+                             ;;  Diary entry that consists only of date.
+                             (backward-char 1)
+                           ;; Found a nonempty diary entry--make it
+                           ;; visible and add it to the list.
+                           (setq entry-found t)
+                           (let ((entry-start (point))
+                                 date-start temp)
+                             (re-search-backward "\^M\\|\n\\|\\`")
+                             (setq date-start (point))
+                             (re-search-forward "\^M\\|\n" nil t 2)
+                             (while (looking-at " \\|\^I")
+                               (re-search-forward "\^M\\|\n" nil t))
+                             (backward-char 1)
+                             (subst-char-in-region date-start
+                                                   (point) ?\^M ?\n t)
+                             (setq entry (buffer-substring entry-start (point))
+                                   temp (diary-pull-attrs entry file-glob-attrs)
+                                   entry (nth 0 temp))
+                             (add-to-diary-list
+                              date
+                              entry
+                              (buffer-substring
+                               (1+ date-start) (1- entry-start))
+                              (copy-marker entry-start) (nth 1 temp)))))))
+                   (or entry-found
+                       (not diary-list-include-blanks)
+                       (setq diary-entries-list
+                             (append diary-entries-list
+                                     (list (list date "" "" "" "")))))
+                   (setq date
+                         (calendar-gregorian-from-absolute
+                          (1+ (calendar-absolute-from-gregorian date))))
+                   (setq entry-found nil)))
+                (set-buffer-modified-p diary-modified)))
             (goto-char (point-min))
             (run-hooks 'nongregorian-diary-listing-hook
                        'list-diary-entries-hook)
@@ -459,6 +478,14 @@
             (run-hooks 'diary-hook)
             diary-entries-list))))))
 
+(defun diary-unhide-everything ()
+  (setq selective-display nil)
+  (let ((inhibit-read-only t)
+        (modified (buffer-modified-p)))
+    (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)
+    (set-buffer-modified-p modified))
+  (kill-local-variable 'mode-line-format))
+
 (defun include-other-diary-files ()
   "Include the diary entries from other diary files with those of diary-file.
 This function is suitable for use in `list-diary-entries-hook';
@@ -471,34 +498,24 @@
   (goto-char (point-min))
   (while (re-search-forward
           (concat
-           "\\(\\`\\|\^M\\|\n\\)"
+           "\\(?:\\`\\|\^M\\|\n\\)"
            (regexp-quote diary-include-string)
            " \"\\([^\"]*\\)\"")
           nil t)
     (let* ((diary-file (substitute-in-file-name
-                        (buffer-substring-no-properties
-                         (match-beginning 2) (match-end 2))))
+                        (match-string-no-properties 1)))
            (diary-list-include-blanks nil)
            (list-diary-entries-hook 'include-other-diary-files)
            (diary-display-hook 'ignore)
-           (diary-hook nil)
-           (d-buffer (find-buffer-visiting diary-file))
-           (diary-modified (if d-buffer
-                               (save-excursion
-                                 (set-buffer d-buffer)
-                                 (buffer-modified-p)))))
+           (diary-hook nil))
       (if (file-exists-p diary-file)
           (if (file-readable-p diary-file)
               (unwind-protect
                   (setq diary-entries-list
                         (append diary-entries-list
                                 (list-diary-entries original-date number)))
-                (save-excursion
-                  (set-buffer (find-buffer-visiting diary-file))
-		  (let ((inhibit-read-only t))
-		    (subst-char-in-region (point-min) (point-max) ?\^M ?\n t))
-                  (setq selective-display nil)
-                  (set-buffer-modified-p diary-modified)))
+                (with-current-buffer (find-buffer-visiting diary-file)
+                  (diary-unhide-everything)))
             (beep)
             (message "Can't read included diary file %s" diary-file)
             (sleep-for 2))
@@ -564,13 +581,9 @@
 (defun fancy-diary-display ()
   "Prepare a diary buffer with relevant entries in a fancy, noneditable form.
 This function is provided for optional use as the `diary-display-hook'."
-  (save-excursion;; Turn off selective-display in the diary file's buffer.
-    (set-buffer (find-buffer-visiting (substitute-in-file-name diary-file)))
-    (let ((diary-modified (buffer-modified-p)))
-      (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)
-      (setq selective-display nil)
-      (kill-local-variable 'mode-line-format)
-      (set-buffer-modified-p diary-modified)))
+  (with-current-buffer ;; Turn off selective-display in the diary file's buffer.
+      (find-buffer-visiting (substitute-in-file-name diary-file))
+    (diary-unhide-everything))
   (if (or (not diary-entries-list)
           (and (not (cdr diary-entries-list))
                (string-equal (car (cdr (car diary-entries-list))) "")))
@@ -740,7 +753,8 @@
               (kill-buffer temp-buffer)))
         (error "You don't have a diary buffer!")))))
 
-(defun show-all-diary-entries ()
+(define-obsolete-function-alias 'show-all-diary-entries 'diary-show-all-entries)
+(defun diary-show-all-entries ()
   "Show all of the diary entries in the diary file.
 This function gets rid of the selective display of the diary file so that
 all entries, not just some, are visible.  If there is no diary buffer, one
@@ -748,16 +762,10 @@
   (interactive)
   (let ((d-file (diary-check-diary-file))
         (pop-up-frames (window-dedicated-p (selected-window))))
-    (save-excursion
-      (set-buffer (or (find-buffer-visiting d-file)
-                      (find-file-noselect d-file t)))
-      (let ((buffer-read-only nil)
-            (diary-modified (buffer-modified-p)))
-        (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)
-        (setq selective-display nil
-              mode-line-format default-mode-line-format)
-        (display-buffer (current-buffer))
-        (set-buffer-modified-p diary-modified)))))
+    (with-current-buffer (or (find-buffer-visiting d-file)
+                             (find-file-noselect d-file t))
+      (diary-unhide-everything)
+      (display-buffer (current-buffer)))))
 
 (defcustom diary-mail-addr
   (if (boundp 'user-mail-address) user-mail-address "")
@@ -807,9 +815,7 @@
                           (calendar-date-string (calendar-current-date))))
     (insert
      (if (get-buffer fancy-diary-buffer)
-         (save-excursion
-           (set-buffer fancy-diary-buffer)
-           (buffer-substring (point-min) (point-max)))
+         (with-current-buffer fancy-diary-buffer (buffer-string))
        "No entries found"))
     (call-interactively (get mail-user-agent 'sendfunc))))
 
@@ -844,7 +850,7 @@
 `nongregorian-diary-marking-hook' and `mark-diary-entries-hook'
 are run.  If the optional argument REDRAW is non-nil (which is
 the case interactively, for example) then any existing diary
-marks are first removed. This is intended to deal with deleted
+marks are first removed.  This is intended to deal with deleted
 diary entries."
   (interactive "p")
   ;; To remove any deleted diary entries. Do not redraw when:
@@ -859,116 +865,99 @@
   (let ((marking-diary-entries t)
         file-glob-attrs marks)
     (save-excursion
-      (set-buffer (find-file-noselect (diary-check-diary-file) t))
-      (setq mark-diary-entries-in-calendar t)
-      (message "Marking diary entries...")
-      (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '())))
-      (let ((d diary-date-forms)
-            (old-diary-syntax-table (syntax-table))
-            temp)
-        (set-syntax-table diary-syntax-table)
-        (while d
-          (let* ((date-form (if (equal (car (car d)) 'backup)
-                                (cdr (car d))
-                              (car d)));; ignore 'backup directive
-                 (dayname
-                  (diary-name-pattern calendar-day-name-array
-                                      calendar-day-abbrev-array))
-                 (monthname
-                  (format "%s\\|\\*"
-                   (diary-name-pattern calendar-month-name-array
-                                       calendar-month-abbrev-array)))
-                 (month "[0-9]+\\|\\*")
-                 (day "[0-9]+\\|\\*")
-                 (year "[0-9]+\\|\\*")
-                 (l (length date-form))
-                 (d-name-pos (- l (length (memq 'dayname date-form))))
-                 (d-name-pos (if (/= l d-name-pos) (+ 2 d-name-pos)))
-                 (m-name-pos (- l (length (memq 'monthname date-form))))
-                 (m-name-pos (if (/= l m-name-pos) (+ 2 m-name-pos)))
-                 (d-pos (- l (length (memq 'day date-form))))
-                 (d-pos (if (/= l d-pos) (+ 2 d-pos)))
-                 (m-pos (- l (length (memq 'month date-form))))
-                 (m-pos (if (/= l m-pos) (+ 2 m-pos)))
-                 (y-pos (- l (length (memq 'year date-form))))
-                 (y-pos (if (/= l y-pos) (+ 2 y-pos)))
-                 (regexp
-                  (concat
-                   "\\(\\`\\|\^M\\|\n\\)\\("
-                   (mapconcat 'eval date-form "\\)\\(")
-                   "\\)"))
-                 (case-fold-search t))
-            (goto-char (point-min))
-            (while (re-search-forward regexp nil t)
-              (let* ((dd-name
-                      (if d-name-pos
-                          (buffer-substring-no-properties
-                           (match-beginning d-name-pos)
-                           (match-end d-name-pos))))
-                     (mm-name
-                      (if m-name-pos
-                          (buffer-substring-no-properties
-                           (match-beginning m-name-pos)
-                           (match-end m-name-pos))))
-                     (mm (string-to-number
-                          (if m-pos
-                              (buffer-substring-no-properties
-                               (match-beginning m-pos)
-                               (match-end m-pos))
-                            "")))
-                     (dd (string-to-number
-                          (if d-pos
-                              (buffer-substring-no-properties
-                               (match-beginning d-pos)
-                               (match-end d-pos))
-                            "")))
-                     (y-str (if y-pos
-                                (buffer-substring-no-properties
-                                 (match-beginning y-pos)
-                                 (match-end y-pos))))
-                     (yy (if (not y-str)
-                             0
-                           (if (and (= (length y-str) 2)
-                                    abbreviated-calendar-year)
-                               (let* ((current-y
-                                       (extract-calendar-year
-                                        (calendar-current-date)))
-                                      (y (+ (string-to-number y-str)
-                                            (* 100
-                                               (/ current-y 100)))))
-                                 (if (> (- y current-y) 50)
-                                     (- y 100)
-                                   (if (> (- current-y y) 50)
-                                       (+ y 100)
-                                     y)))
-                             (string-to-number y-str))))
-                     (save-excursion
-                       (setq entry (buffer-substring-no-properties
-                                    (point) (line-end-position))
-                             temp (diary-pull-attrs entry file-glob-attrs)
-                             entry (nth 0 temp)
-                             marks (nth 1 temp))))
-                (if dd-name
-                    (mark-calendar-days-named
-                     (cdr (assoc-string
-                           dd-name
-                           (calendar-make-alist
-                            calendar-day-name-array
-                            0 nil calendar-day-abbrev-array) t)) marks)
-                  (if mm-name
-                      (setq mm
-                            (if (string-equal mm-name "*") 0
-                              (cdr (assoc-string
-                                    mm-name
-                                    (calendar-make-alist
-                                     calendar-month-name-array
-                                     1 nil calendar-month-abbrev-array) t)))))
-                  (mark-calendar-date-pattern mm dd yy marks))))
-            (setq d (cdr d))))
-        (mark-sexp-diary-entries)
-        (run-hooks 'nongregorian-diary-marking-hook
-                   'mark-diary-entries-hook)
-        (set-syntax-table old-diary-syntax-table)
+      (with-current-buffer (find-file-noselect (diary-check-diary-file) t)
+        (setq mark-diary-entries-in-calendar t)
+        (message "Marking diary entries...")
+        (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '())))
+        (with-syntax-table diary-syntax-table
+          (dolist (date-form diary-date-forms)
+            (if (eq (car date-form) 'backup)
+                (setq date-form (cdr date-form))) ;; ignore 'backup directive
+            (let* ((dayname
+                    (diary-name-pattern calendar-day-name-array
+                                        calendar-day-abbrev-array))
+                   (monthname
+                    (format "%s\\|\\*"
+                            (diary-name-pattern calendar-month-name-array
+                                                calendar-month-abbrev-array)))
+                   (month "[0-9]+\\|\\*")
+                   (day "[0-9]+\\|\\*")
+                   (year "[0-9]+\\|\\*")
+                   (l (length date-form))
+                   (d-name-pos (- l (length (memq 'dayname date-form))))
+                   (d-name-pos (if (/= l d-name-pos) (+ 2 d-name-pos)))
+                   (m-name-pos (- l (length (memq 'monthname date-form))))
+                   (m-name-pos (if (/= l m-name-pos) (+ 2 m-name-pos)))
+                   (d-pos (- l (length (memq 'day date-form))))
+                   (d-pos (if (/= l d-pos) (+ 2 d-pos)))
+                   (m-pos (- l (length (memq 'month date-form))))
+                   (m-pos (if (/= l m-pos) (+ 2 m-pos)))
+                   (y-pos (- l (length (memq 'year date-form))))
+                   (y-pos (if (/= l y-pos) (+ 2 y-pos)))
+                   (regexp
+                    (concat
+                     "\\(\\`\\|\^M\\|\n\\)\\("
+                     (mapconcat 'eval date-form "\\)\\(")
+                     "\\)"))
+                   (case-fold-search t))
+              (goto-char (point-min))
+              (while (re-search-forward regexp nil t)
+                (let* ((dd-name
+                        (if d-name-pos
+                            (match-string-no-properties d-name-pos)))
+                       (mm-name
+                        (if m-name-pos
+                            (match-string-no-properties m-name-pos)))
+                       (mm (string-to-number
+                            (if m-pos
+                                (match-string-no-properties m-pos)
+                              "")))
+                       (dd (string-to-number
+                            (if d-pos
+                                (match-string-no-properties d-pos)
+                              "")))
+                       (y-str (if y-pos
+                                  (match-string-no-properties y-pos)))
+                       (yy (if (not y-str)
+                               0
+                             (if (and (= (length y-str) 2)
+                                      abbreviated-calendar-year)
+                                 (let* ((current-y
+                                         (extract-calendar-year
+                                          (calendar-current-date)))
+                                        (y (+ (string-to-number y-str)
+                                              (* 100
+                                                 (/ current-y 100)))))
+                                   (if (> (- y current-y) 50)
+                                       (- y 100)
+                                     (if (> (- current-y y) 50)
+                                         (+ y 100)
+                                       y)))
+                               (string-to-number y-str)))))
+                  (let ((tmp (diary-pull-attrs (buffer-substring-no-properties
+                                                (point) (line-end-position))
+                                               file-glob-attrs)))
+                    (setq entry (nth 0 tmp)
+                          marks (nth 1 tmp)))
+                  (if dd-name
+                      (mark-calendar-days-named
+                       (cdr (assoc-string
+                             dd-name
+                             (calendar-make-alist
+                              calendar-day-name-array
+                              0 nil calendar-day-abbrev-array) t)) marks)
+                    (if mm-name
+                        (setq mm
+                              (if (string-equal mm-name "*") 0
+                                (cdr (assoc-string
+                                      mm-name
+                                      (calendar-make-alist
+                                       calendar-month-name-array
+                                       1 nil calendar-month-abbrev-array) t)))))
+                    (mark-calendar-date-pattern mm dd yy marks))))))
+          (mark-sexp-diary-entries)
+          (run-hooks 'nongregorian-diary-marking-hook
+                     'mark-diary-entries-hook))
         (message "Marking diary entries...done")))))
 
 (defun mark-sexp-diary-entries ()
@@ -982,8 +971,7 @@
                           sexp-mark "(diary-remind\\)"))
          (file-glob-attrs (nth 1 (diary-pull-attrs nil '())))
          m y first-date last-date mark file-glob-attrs)
-    (save-excursion
-      (set-buffer calendar-buffer)
+    (with-current-buffer calendar-buffer
       (setq m displayed-month)
       (setq y displayed-year))
     (increment-calendar-month m y -1)
@@ -1048,12 +1036,12 @@
   (goto-char (point-min))
   (while (re-search-forward
           (concat
-           "\\(\\`\\|\^M\\|\n\\)"
+           "\\(?:\\`\\|\^M\\|\n\\)"
            (regexp-quote diary-include-string)
            " \"\\([^\"]*\\)\"")
           nil t)
     (let* ((diary-file (substitute-in-file-name
-                        (match-string-no-properties 2)))
+                        (match-string-no-properties 1)))
            (mark-diary-entries-hook 'mark-included-diary-files)
            (dbuff (find-buffer-visiting diary-file)))
       (if (file-exists-p diary-file)
@@ -1073,8 +1061,7 @@
 (defun mark-calendar-days-named (dayname &optional color)
   "Mark all dates in the calendar window that are day DAYNAME of the week.
 0 means all Sundays, 1 means all Mondays, and so on."
-  (save-excursion
-    (set-buffer calendar-buffer)
+  (with-current-buffer calendar-buffer
     (let ((prev-month displayed-month)
           (prev-year displayed-year)
           (succ-month displayed-month)
@@ -1094,8 +1081,7 @@
 (defun mark-calendar-date-pattern (month day year &optional color)
   "Mark all dates in the calendar window that conform to MONTH/DAY/YEAR.
 A value of 0 in any position is a wildcard."
-  (save-excursion
-    (set-buffer calendar-buffer)
+  (with-current-buffer calendar-buffer
     (let ((m displayed-month)
           (y displayed-year))
       (increment-calendar-month m y -1)
@@ -1152,22 +1138,17 @@
     (cond ((string-match        ; Military time
 	    "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)[:.]?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)"
             s)
-	   (+ (* 100 (string-to-number
-		      (substring s (match-beginning 1) (match-end 1))))
-	      (string-to-number (substring s (match-beginning 2) (match-end 2)))))
+	   (+ (* 100 (string-to-number (match-string 1 s)))
+	      (string-to-number (match-string 2 s))))
 	  ((string-match        ; Hour only  XXam or XXpm
 	    "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)\\([ap]\\)m\\>" s)
-	   (+ (* 100 (% (string-to-number
-			   (substring s (match-beginning 1) (match-end 1)))
-			  12))
+	   (+ (* 100 (% (string-to-number (match-string 1 s)) 12))
 	      (if (equal ?a (downcase (aref s (match-beginning 2))))
 		  0 1200)))
 	  ((string-match        ; Hour and minute  XX:XXam or XX:XXpm
 	    "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)[:.]\\([0-9][0-9]\\)\\([ap]\\)m\\>" s)
-	   (+ (* 100 (% (string-to-number
-			   (substring s (match-beginning 1) (match-end 1)))
-			  12))
-	      (string-to-number (substring s (match-beginning 2) (match-end 2)))
+	   (+ (* 100 (% (string-to-number (match-string 1 s)) 12))
+	      (string-to-number (match-string 2 s))
 	      (if (equal ?a (downcase (aref s (match-beginning 3))))
 		  0 1200)))
 	  (t diary-unknown-time)))) ; Unrecognizable
@@ -1404,14 +1385,7 @@
                     (error
                      (beep)
                      (message "Bad sexp at line %d in %s: %s"
-                              (save-excursion
-                                (save-restriction
-                                  (narrow-to-region 1 (point))
-                                  (goto-char (point-min))
-                                  (let ((lines 1))
-                                    (while (re-search-forward "\n\\|\^M" nil t)
-                                      (setq lines (1+ lines)))
-                                    lines)))
+                              (count-lines (point-min) (point))
                               diary-file sexp)
                      (sleep-for 2))))))
     (cond ((stringp result) result)
@@ -1688,12 +1662,9 @@
 redrawn with the new entry marked, if necessary."
   (let ((pop-up-frames (window-dedicated-p (selected-window))))
     (find-file-other-window (substitute-in-file-name (or file diary-file))))
-  (add-hook 'write-contents-functions 'diary-redraw-calendar nil t)
-  (when selective-display
-    (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)
-    (setq selective-display nil)
-    (kill-local-variable 'mode-line-format))
+  (add-hook 'after-save-hook 'diary-redraw-calendar nil t)
   (widen)
+  (diary-unhide-everything)
   (goto-char (point-max))
   (when (let ((case-fold-search t))
           (search-backward "Local Variables:"
@@ -1701,7 +1672,7 @@
                            t))
     (beginning-of-line)
     (insert "\n")
-    (previous-line 1))
+    (forward-line -1))
   (insert
    (if (bolp) "" "\n")
    (if nonmarking diary-nonmarking-symbol "")
@@ -1798,19 +1769,29 @@
              (calendar-date-string (calendar-cursor-to-date t) nil t))
      arg)))
 
+(defvar diary-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "\C-c\C-s" 'diary-show-all-entries)
+    (define-key map "\C-c\C-q" 'quit-window)
+    map)
+  "Keymap for `diary-mode'.")
+
 ;;;###autoload
-(define-derived-mode diary-mode fundamental-mode
-  "Diary"
+(define-derived-mode diary-mode fundamental-mode "Diary"
   "Major mode for editing the diary file."
   (set (make-local-variable 'font-lock-defaults)
-       '(diary-font-lock-keywords t)))
+       '(diary-font-lock-keywords t))
+  (add-to-invisibility-spec '(diary . nil))
+  (add-hook 'after-save-hook 'diary-redraw-calendar nil t)
+  (if diary-header-line-flag
+      (setq header-line-format diary-header-line-format)))
 
 (define-derived-mode fancy-diary-display-mode fundamental-mode
   "Diary"
   "Major mode used while displaying diary entries using Fancy Display."
   (set (make-local-variable 'font-lock-defaults)
        '(fancy-diary-font-lock-keywords t))
-  (define-key (current-local-map) "q" 'quit-window))
+  (local-set-key "q" 'quit-window))
 
 
 (defvar fancy-diary-font-lock-keywords
@@ -1836,7 +1817,7 @@
   "Keywords to highlight in fancy diary display")
 
 
-(defun font-lock-diary-sexps (limit)
+(defun diary-font-lock-sexps (limit)
   "Recognize sexp diary entry for font-locking."
   (if (re-search-forward
        (concat "^" (regexp-quote diary-nonmarking-symbol)
@@ -1851,7 +1832,7 @@
 	      t))
 	(error t))))
 
-(defun font-lock-diary-date-forms (month-array &optional symbol abbrev-array)
+(defun diary-font-lock-date-forms (month-array &optional symbol abbrev-array)
   "Create font-lock patterns for `diary-date-forms' using MONTH-ARRAY.
 If given, optional SYMBOL must be a prefix to entries.
 If optional ABBREV-ARRAY is present, the abbreviations constructed
@@ -1865,7 +1846,7 @@
         (month "\\([0-9]+\\|\\*\\)")
         (day "\\([0-9]+\\|\\*\\)")
         (year "-?\\([0-9]+\\|\\*\\)"))
-    (mapcar '(lambda (x)
+    (mapcar (lambda (x)
                (cons
                 (concat "^" (regexp-quote diary-nonmarking-symbol) "?"
                         (if symbol (regexp-quote symbol) "") "\\("
@@ -1873,7 +1854,7 @@
                                    ;; If backup, omit first item (backup)
                                    ;; and last item (not part of date)
                                    (if (equal (car x) 'backup)
-                                       (reverse (cdr (reverse (cdr x))))
+                                      (nreverse (cdr (reverse (cdr x))))
                                      x)
                                    "")
                         ;; With backup, last item is not part of date
@@ -1888,14 +1869,14 @@
 
 (defvar diary-font-lock-keywords
       (append
-       (font-lock-diary-date-forms calendar-month-name-array
+       (diary-font-lock-date-forms calendar-month-name-array
                                    nil calendar-month-abbrev-array)
        (when (or (memq 'mark-hebrew-diary-entries
                        nongregorian-diary-marking-hook)
                  (memq 'list-hebrew-diary-entries
                        nongregorian-diary-listing-hook))
          (require 'cal-hebrew)
-         (font-lock-diary-date-forms
+         (diary-font-lock-date-forms
           calendar-hebrew-month-name-array-leap-year
           hebrew-diary-entry-symbol))
        (when (or (memq 'mark-islamic-diary-entries
@@ -1903,7 +1884,7 @@
                  (memq 'list-islamic-diary-entries
                        nongregorian-diary-listing-hook))
          (require 'cal-islam)
-         (font-lock-diary-date-forms
+         (diary-font-lock-date-forms
           calendar-islamic-month-name-array
           islamic-diary-entry-symbol))
        (list
@@ -1925,10 +1906,10 @@
          (concat "^" (regexp-quote diary-nonmarking-symbol)
                  "?\\(" (regexp-quote islamic-diary-entry-symbol) "\\)")
          '(1 font-lock-reference-face))
-        '(font-lock-diary-sexps . font-lock-keyword-face)
+        '(diary-font-lock-sexps . font-lock-keyword-face)
         '("[0-9]?[0-9]\\([:.]?[0-9][0-9]\\)?\\(am\\|pm\\|AM\\|PM\\)\\(-[0-9]?[0-9]\\([:.]?[0-9][0-9]\\)?\\(am\\|pm\\|AM\\|PM\\)\\)?"
           . font-lock-function-name-face)))
-      "Forms to highlight in diary-mode")
+      "Forms to highlight in `diary-mode'.")
 
 
 ;; Following code from Dave Love <fx@gnu.org>.
@@ -2087,5 +2068,5 @@
 
 (provide 'diary-lib)
 
-;;; arch-tag: 22dd506e-2e33-410d-9ae1-095a0c1b2010
+;; arch-tag: 22dd506e-2e33-410d-9ae1-095a0c1b2010
 ;;; diary-lib.el ends here
--- a/lisp/calendar/icalendar.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/calendar/icalendar.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1532,7 +1532,7 @@
          (setq found-error t)
          (setq error-string (format "%s\n%s\nCannot handle this event: %s"
                                     error-val error-string e))
-         (message error-string))))
+         (message "%s" error-string))))
     (if found-error
         (save-current-buffer
           (set-buffer (get-buffer-create "*icalendar-errors*"))
--- a/lisp/calendar/timeclock.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/calendar/timeclock.el	Mon Sep 19 10:20:33 2005 +0000
@@ -441,7 +441,7 @@
 		      "remaining" "over")
 		  (timeclock-when-to-leave-string show-seconds today-only)))
     (if (interactive-p)
-	(message status)
+	(message "%s" status)
       status)))
 
 ;;;###autoload
@@ -512,7 +512,7 @@
 		 (timeclock-workday-remaining today-only)
 		 show-seconds t)))
     (if (interactive-p)
-	(message string)
+	(message "%s" string)
       string)))
 
 (defsubst timeclock-workday-elapsed ()
@@ -534,7 +534,7 @@
   (let ((string (timeclock-seconds-to-string (timeclock-workday-elapsed)
 					     show-seconds)))
     (if (interactive-p)
-	(message string)
+	(message "%s" string)
       string)))
 
 (defsubst timeclock-time-to-seconds (time)
@@ -579,7 +579,7 @@
 	      (format-time-string "%-I:%M:%S %p" then)
 	    (format-time-string "%-I:%M %p" then))))
     (if (interactive-p)
-	(message string)
+	(message "%s" string)
       string)))
 
 ;;; Internal Functions:
--- a/lisp/custom.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/custom.el	Mon Sep 19 10:20:33 2005 +0000
@@ -649,17 +649,16 @@
 	(progn
 	  (setcar (cdr setting) mode)
 	  (setcar (cddr setting) value))
-      (if (and (null old)
-	       (boundp symbol))
-	  (setq old
-		(list
-		 (list 'standard 'set
-		       (if (eq prop 'theme-value)
-			   (symbol-value symbol)
-			 (list
-			  (append
-			   '(t)
-			   (custom-face-attributes-get symbol nil))))))))
+      ;; If no custom theme has been applied yet, first save the
+      ;; current values to the 'standard theme.
+      (if (null old)
+	  (if (and (eq prop 'theme-value)
+		   (boundp symbol))
+	      (setq old
+		    (list (list 'standard 'set (symbol-value symbol))))
+	    (if (facep symbol)
+		(setq old (list (list 'standard 'set (list
+		  (append '(t) (custom-face-attributes-get symbol nil)))))))))
       (put symbol prop (cons (list theme mode value) old)))
     ;; Record, for each theme, all its settings.
     (put theme 'theme-settings
--- a/lisp/desktop.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/desktop.el	Mon Sep 19 10:20:33 2005 +0000
@@ -944,7 +944,7 @@
                                  desktop-buffer-file-name)))
                  (if desktop-missing-file-warning
 		     (y-or-n-p (concat msg " Re-create? "))
-                   (message msg)
+                   (message "%s" msg)
                    nil)))
 	  (let* ((auto-insert nil) ; Disable auto insertion
 		 (coding-system-for-read
@@ -1101,7 +1101,7 @@
            (msg (format "Desktop lazily opening %s (%s remaining)..."
                             buffer-name remaining)))
       (when desktop-lazy-verbose
-        (message msg))
+        (message "%s" msg))
       (let ((desktop-first-buffer nil)
             (desktop-buffer-ok-count 0)
             (desktop-buffer-fail-count 0))
--- a/lisp/dired-aux.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/dired-aux.el	Mon Sep 19 10:20:33 2005 +0000
@@ -845,7 +845,7 @@
 	       (apply 'message qprompt qs-args)
 	       (setq char (set qs-var (read-char))))
 	     ;; Display the question with the answer.
-	     (message (concat (apply 'format qprompt qs-args)
+	     (message "%s" (concat (apply 'format qprompt qs-args)
 			      (char-to-string char)))
 	     (memq (cdr elt) '(t y yes)))))))
 
--- a/lisp/dnd.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/dnd.el	Mon Sep 19 10:20:33 2005 +0000
@@ -179,7 +179,7 @@
 	  (not (windowp window)))
       (progn
 	(kill-new text)
-	(message
+	(message "%s"
 	 (substitute-command-keys
 	  "The dropped text can be accessed with \\[yank]")))
     (insert text))
--- a/lisp/echistory.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/echistory.el	Mon Sep 19 10:20:33 2005 +0000
@@ -140,7 +140,7 @@
 (defun Electric-history-undefined ()
   (interactive)
   (ding)
-  (message (substitute-command-keys "Type \\[Helper-help] for help, ? for commands, C-c C-c to quit, Space to execute"))
+  (message "%s" (substitute-command-keys "Type \\[Helper-help] for help, ? for commands, C-c C-c to quit, Space to execute"))
   (sit-for 4))
 
 (defun Electric-history-quit ()
--- a/lisp/ediff-util.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/ediff-util.el	Mon Sep 19 10:20:33 2005 +0000
@@ -2075,7 +2075,7 @@
 	  (ediff-clear-fine-differences n))
       ;; Make sure that the message about saving and how to restore is seen
       ;; by the user
-      (message messg))
+      (message "%s" messg))
     ))
 
 ;; Save Nth diff of buffer BUF-TYPE \(A, B, or C\).
@@ -2720,7 +2720,7 @@
 	     (format "Another buffer is visiting file %s. Too dangerous to save the merge buffer"
 		     file)))
 	(beep)
-	(message warn-message)
+	(message "%s" warn-message)
 	(with-output-to-temp-buffer ediff-msg-buffer
 	  (princ "\n\n")
 	  (princ warn-message)
@@ -3286,7 +3286,7 @@
 	    (princ warn-message)
 	    (princ "\n\n"))
 	  (if (y-or-n-p
-	       (message warn-message))
+	       (message "%s" warn-message))
 	      (with-current-buffer buff
 		(save-buffer)
 		(kill-buffer (current-buffer)))
--- a/lisp/emacs-lisp/find-func.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/emacs-lisp/find-func.el	Mon Sep 19 10:20:33 2005 +0000
@@ -260,7 +260,7 @@
       (setq function (symbol-function function)
 	    def (symbol-function function)))
     (if aliases
-	(message aliases))
+	(message "%s" aliases))
     (let ((library
 	   (cond ((eq (car-safe def) 'autoload)
 		  (nth 1 def))
--- a/lisp/emacs-lisp/lisp-mnt.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/emacs-lisp/lisp-mnt.el	Mon Sep 19 10:20:33 2005 +0000
@@ -610,7 +610,7 @@
     (if version
 	(insert " version " version))
     (newline 2)
-    (message
+    (message "%s"
      (substitute-command-keys "Type \\[mail-send] to send bug report."))))
 
 (provide 'lisp-mnt)
--- a/lisp/emulation/viper-ex.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/emulation/viper-ex.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1590,7 +1590,7 @@
 
 ;; Ex print working directory
 (defun ex-pwd ()
-  (message default-directory))
+  (message "%s" default-directory))
 
 ;; Ex quit command
 (defun ex-quit ()
@@ -2230,7 +2230,7 @@
 		       (if (buffer-modified-p) "[Modified]" "[Unchanged]")))
     (if (< (+ 1 (length info) (length file))
 	   (window-width (minibuffer-window)))
-	(message (concat file " " info))
+	(message "%s" (concat file " " info))
       (save-window-excursion
 	(with-output-to-temp-buffer " *viper-info*"
 	  (princ (concat "\n" file "\n\n\t" info "\n\n")))
--- a/lisp/emulation/viper-macs.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/emulation/viper-macs.el	Mon Sep 19 10:20:33 2005 +0000
@@ -186,7 +186,7 @@
 	       variant (if (> (length key-seq) 0)
 			   (prin1-to-string (viper-display-macro key-seq))
 			 "")))
-	(message message)
+	(message "%s" message)
 	(setq event (viper-read-key))
 	;;(setq event (viper-read-event))
 	(setq key
@@ -263,7 +263,7 @@
 			   (prin1-to-string
 			    (viper-display-macro key-seq))
 			 "")))
-	(message message)
+	(message "%s" message)
 	(setq event (viper-read-key))
 	;;(setq event (viper-read-event))
 	(setq key
@@ -442,7 +442,11 @@
 		       scope)
 	       viper-custom-file-name))
 
-	  (message msg)
+	  ;; 2005-09-18 T06:41:22-0400 (Sunday)    D. Goel
+	  ;; From careful parsing of the above code, it looks like msg
+	  ;; couldn't be nil when we reach here. Since it is a string,
+	  ;; and a complicated one too, we might as well provide it a "%s"
+	  (message "%s" msg)
 	  ))
 
     (setq new-elt
--- a/lisp/emulation/ws-mode.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/emulation/ws-mode.el	Mon Sep 19 10:20:33 2005 +0000
@@ -691,7 +691,7 @@
 This will only work for errors raised by WordStar mode functions."
   (interactive)
   (if ws-last-errormessage
-      (message ws-last-errormessage)
+      (message "%s" ws-last-errormessage)
     (message "No WordStar error yet.")))
 
 (defun ws-kill-eol ()
--- a/lisp/eshell/esh-proc.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/eshell/esh-proc.el	Mon Sep 19 10:20:33 2005 +0000
@@ -225,8 +225,8 @@
   (if (and (eshell-processp (car entry))
 	   (nth 2 entry)
 	   eshell-done-messages-in-minibuffer)
-      (message (format "[%s]+ Done %s" (process-name (car entry))
-		       (process-command (car entry)))))
+      (message "[%s]+ Done %s" (process-name (car entry))
+	       (process-command (car entry))))
   (setq eshell-process-list
 	(delq entry eshell-process-list)))
 
--- a/lisp/files.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/files.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1738,7 +1738,11 @@
       (hack-local-variables)))
   ;; Turn font lock off and on, to make sure it takes account of
   ;; whatever file local variables are relevant to it.
-  (when (and font-lock-mode (eq (car font-lock-keywords) t))
+  (when (and font-lock-mode
+             ;; Font-lock-mode (now in font-core.el) can be ON when
+             ;; font-lock.el still hasn't been loaded.
+             (boundp 'font-lock-keywords)
+             (eq (car font-lock-keywords) t))
     (setq font-lock-keywords (cadr font-lock-keywords))
     (font-lock-mode 1))
 
@@ -3576,7 +3580,7 @@
      (t (setq buffer-read-only (not buffer-read-only))
         (force-mode-line-update)))
     (if (vc-backend buffer-file-name)
-        (message (substitute-command-keys
+        (message "%s" (substitute-command-keys
                   (concat "File is under version-control; "
                           "use \\[vc-next-action] to check in/out"))))))
 
--- a/lisp/follow.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/follow.el	Mon Sep 19 10:20:33 2005 +0000
@@ -4,7 +4,7 @@
 ;;   2005 Free Software Foundation, Inc.
 
 ;; Author: Anders Lindgren <andersl@andersl.com>
-;; Maintainer: Anders Lindgren <andersl@andersl.com>
+;; Maintainer: FSF (Anders' email bounces, Sep 2005)
 ;; Created: 1995-05-25
 ;; Keywords: display, window, minor-mode, convenience
 ;; Last Changed: 1999-11-17
--- a/lisp/font-lock.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/font-lock.el	Mon Sep 19 10:20:33 2005 +0000
@@ -340,6 +340,7 @@
 
 ;; Fontification variables:
 
+;;;###autoload
 (defvar font-lock-keywords nil
   "A list of the keywords to highlight.
 There are two kinds of values: user-level, and compiled.
--- a/lisp/gnus/ChangeLog	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/gnus/ChangeLog	Mon Sep 19 10:20:33 2005 +0000
@@ -1,3 +1,22 @@
+2005-09-18  D Goel  <deego@gnufans.org>
+
+	* sieve.el (sieve-help): Fix `message' call: first arg should be a
+	format spec.
+	
+2005-09-16  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus.el (gnus-group-startup-message): Bind image-load-path.
+
+2005-09-14  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-art.el (gnus-mime-display-part): Protect against broken
+	MIME messages.
+
+2005-09-13  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-sum.el (gnus-summary-edit-article-done): Remove text props
+	before parsing header.
+
 2005-09-10  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* spam-report.el (spam-report-gmane): Fix generation of spam
--- a/lisp/gnus/gnus-art.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/gnus/gnus-art.el	Mon Sep 19 10:20:33 2005 +0000
@@ -4761,6 +4761,8 @@
 
 (defun gnus-mime-display-part (handle)
   (cond
+   ;; Maybe a broken MIME message.
+   ((null handle))
    ;; Single part.
    ((not (stringp (car handle)))
     (gnus-mime-display-single handle))
--- a/lisp/gnus/gnus-sum.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/gnus/gnus-sum.el	Mon Sep 19 10:20:33 2005 +0000
@@ -9561,7 +9561,8 @@
 	    (save-excursion
 	      (save-restriction
 		(message-narrow-to-head)
-		(let ((head (buffer-string))
+		(let ((head (buffer-substring-no-properties
+			     (point-min) (point-max)))
 		      header)
 		  (with-temp-buffer
 		    (insert (format "211 %d Article retrieved.\n"
--- a/lisp/gnus/gnus.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/gnus/gnus.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1006,6 +1006,11 @@
      (fboundp 'find-image)
      (display-graphic-p)
      (let* ((data-directory (nnheader-find-etc-directory "images/gnus"))
+	    (image-load-path (cond (data-directory
+				    (list data-directory))
+				   ((boundp 'image-load-path)
+				    (symbol-value 'image-load-path))
+				   (t load-path)))
 	    (image (find-image
 		    `((:type xpm :file "gnus.xpm"
 			     :color-symbols
--- a/lisp/gnus/sieve.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/gnus/sieve.el	Mon Sep 19 10:20:33 2005 +0000
@@ -245,7 +245,7 @@
   (if (eq last-command 'sieve-help)
       ;; would need minor-mode for log-edit-mode
       (describe-function 'sieve-mode)
-    (message (substitute-command-keys
+    (message "%s" (substitute-command-keys
 	      "`\\[sieve-edit-script]':edit `\\[sieve-activate]':activate `\\[sieve-deactivate]':deactivate `\\[sieve-remove]':remove"))))
 
 (defun sieve-bury-buffer (buf &optional mainbuf)
--- a/lisp/help-fns.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/help-fns.el	Mon Sep 19 10:20:33 2005 +0000
@@ -269,22 +269,20 @@
 (defun help-do-arg-highlight (doc args)
   (with-syntax-table (make-syntax-table emacs-lisp-mode-syntax-table)
     (modify-syntax-entry ?\- "w")
-    (while args
-      (let ((arg (prog1 (car args) (setq args (cdr args)))))
-        (setq doc (replace-regexp-in-string
-                   ;; This is heuristic, but covers all common cases
-                   ;; except ARG1-ARG2
-                   (concat "\\<"                   ; beginning of word
-                           "\\(?:[a-z-]*-\\)?"     ; for xxx-ARG
-                           "\\("
-                           (regexp-quote arg)
-                           "\\)"
-                           "\\(?:es\\|s\\|th\\)?"  ; for ARGth, ARGs
-                           "\\(?:-[a-z-]+\\)?"     ; for ARG-xxx
-                           "\\>")                  ; end of word
-                   (help-default-arg-highlight arg)
-                   doc t t 1))))
-    doc))
+    (dolist (arg args doc)
+      (setq doc (replace-regexp-in-string
+                 ;; This is heuristic, but covers all common cases
+                 ;; except ARG1-ARG2
+                 (concat "\\<"                   ; beginning of word
+                         "\\(?:[a-z-]*-\\)?"     ; for xxx-ARG
+                         "\\("
+                         (regexp-quote arg)
+                         "\\)"
+                         "\\(?:es\\|s\\|th\\)?"  ; for ARGth, ARGs
+                         "\\(?:-[a-z0-9-]+\\)?"  ; for ARG-xxx, ARG-n
+                         "\\>")                  ; end of word
+                 (help-default-arg-highlight arg)
+                 doc t t 1)))))
 
 (defun help-highlight-arguments (usage doc &rest args)
   (when usage
@@ -522,108 +520,13 @@
       (let* ((valvoid (not (with-current-buffer buffer (boundp variable))))
 	     ;; Extract the value before setting up the output buffer,
 	     ;; in case `buffer' *is* the output buffer.
-	     (val (unless valvoid (buffer-local-value variable buffer))))
+	     (val (unless valvoid (buffer-local-value variable buffer)))
+	     val-start-pos)
 	(help-setup-xref (list #'describe-variable variable buffer)
 			 (interactive-p))
 	(with-output-to-temp-buffer (help-buffer)
 	  (with-current-buffer buffer
 	    (prin1 variable)
-	    (if valvoid
-		(princ " is void")
-	      (with-current-buffer standard-output
-		(princ "'s value is ")
-		(terpri)
-		(let ((from (point)))
-		  (pp val)
-		  ;; Hyperlinks in variable's value are quite frequently
-		  ;; inappropriate e.g C-h v <RET> features <RET>
-		  ;; (help-xref-on-pp from (point))
-		  (if (< (point) (+ from 20))
-		      (delete-region (1- from) from)))))
-	    (terpri)
-	    (when (local-variable-p variable)
-	      (princ (format "%socal in buffer %s; "
-			     (if (get variable 'permanent-local)
-				 "Permanently l" "L")
-			     (buffer-name)))
-	      (if (not (default-boundp variable))
-		  (princ "globally void")
-		(let ((val (default-value variable)))
-		  (with-current-buffer standard-output
-		    (princ "global value is ")
-		    (terpri)
-		    ;; Fixme: pp can take an age if you happen to
-		    ;; ask for a very large expression.  We should
-		    ;; probably print it raw once and check it's a
-		    ;; sensible size before prettyprinting.  -- fx
-		    (let ((from (point)))
-		      (pp val)
-		      ;; See previous comment for this function.
-		      ;; (help-xref-on-pp from (point))
-		      (if (< (point) (+ from 20))
-			(delete-region (1- from) from))))))
-	      (terpri))
-	    (terpri)
-	    (with-current-buffer standard-output
-	      (when (> (count-lines (point-min) (point-max)) 10)
-		;; Note that setting the syntax table like below
-		;; makes forward-sexp move over a `'s' at the end
-		;; of a symbol.
-		(set-syntax-table emacs-lisp-mode-syntax-table)
-		(goto-char (point-min))
-		(if valvoid
-		    (forward-line 1)
-		  (forward-sexp 1)
-		  (delete-region (point) (progn (end-of-line) (point)))
-		  (save-excursion
-		    (insert "\n\nValue:")
-		    (set (make-local-variable 'help-button-cache)
-			 (point-marker)))
-		  (insert " value is shown ")
-		  (insert-button "below"
-				 'action help-button-cache
-				 'follow-link t
-				 'help-echo "mouse-2, RET: show value")
-		  (insert ".\n\n")))
-	      ;; Add a note for variables that have been make-var-buffer-local.
-	      (when (and (local-variable-if-set-p variable)
-			 (or (not (local-variable-p variable))
-			     (with-temp-buffer
-			       (local-variable-if-set-p variable))))
-		(save-excursion
-		  (forward-line -1)
-		  (insert "Automatically becomes buffer-local when set in any fashion.\n"))))
- 	    ;; Mention if it's an alias
-            (let* ((alias (condition-case nil
-                             (indirect-variable variable)
-                           (error variable)))
-                   (obsolete (get variable 'byte-obsolete-variable))
-                   (doc (or (documentation-property variable 'variable-documentation)
-                            (documentation-property alias 'variable-documentation))))
-              (unless (eq alias variable)
-                (princ (format "This variable is an alias for `%s'." alias))
-                (terpri)
-                (terpri))
-              (when obsolete
-                (princ "This variable is obsolete")
-                (if (cdr obsolete) (princ (format " since %s" (cdr obsolete))))
-                (princ ";") (terpri)
-                (princ (if (stringp (car obsolete)) (car obsolete)
-                         (format "use `%s' instead." (car obsolete))))
-                (terpri)
-                (terpri))
-              (princ (or doc "Not documented as a variable.")))
-	    ;; Make a link to customize if this variable can be customized.
-	    (if (custom-variable-p variable)
-		(let ((customize-label "customize"))
-		  (terpri)
-		  (terpri)
-		  (princ (concat "You can " customize-label " this variable."))
-		  (with-current-buffer standard-output
-		    (save-excursion
-		      (re-search-backward
-		       (concat "\\(" customize-label "\\)") nil t)
-		      (help-xref-button 1 'help-customize-variable variable)))))
 	    ;; Make a hyperlink to the library if appropriate.  (Don't
 	    ;; change the format of the buffer's initial line in case
 	    ;; anything expects the current format.)
@@ -647,16 +550,115 @@
 		      (if (get-buffer " *DOC*")
 			  (help-C-file-name variable 'var)
 			'C-source)))
-	      (when file-name
-		(princ "\n\nDefined in `")
-		(princ (if (eq file-name 'C-source) "C source code" file-name))
-		(princ "'.")
-		(with-current-buffer standard-output
-		  (save-excursion
-		    (re-search-backward "`\\([^`']+\\)'" nil t)
-		    (help-xref-button 1 'help-variable-def
-				      variable file-name)))))
+	      (if file-name
+		  (progn
+		    (princ " is a variable defined in `")
+		    (princ (if (eq file-name 'C-source) "C source code" file-name))
+		    (princ "'.\n")
+		    (with-current-buffer standard-output
+		      (save-excursion
+			(re-search-backward "`\\([^`']+\\)'" nil t)
+			(help-xref-button 1 'help-variable-def
+					  variable file-name)))
+		    (if valvoid
+			(princ "It is void as a variable.\n")
+		      (princ "Its ")))
+		(if valvoid
+		    (princ " is void as a variable.\n")
+		  (princ "'s "))))
+	    (if valvoid
+		nil
+	      (with-current-buffer standard-output
+		(setq val-start-pos (point))
+		(princ "value is ")
+		(terpri)
+		(let ((from (point)))
+		  (pp val)
+		  ;; Hyperlinks in variable's value are quite frequently
+		  ;; inappropriate e.g C-h v <RET> features <RET>
+		  ;; (help-xref-on-pp from (point))
+		  (if (< (point) (+ from 20))
+		      (delete-region (1- from) from)))))
+	    (terpri)
 
+	    (when (local-variable-p variable)
+	      (princ (format "%socal in buffer %s; "
+			     (if (get variable 'permanent-local)
+				 "Permanently l" "L")
+			     (buffer-name)))
+	      (if (not (default-boundp variable))
+		  (princ "globally void")
+		(let ((val (default-value variable)))
+		  (with-current-buffer standard-output
+		    (princ "global value is ")
+		    (terpri)
+		    ;; Fixme: pp can take an age if you happen to
+		    ;; ask for a very large expression.  We should
+		    ;; probably print it raw once and check it's a
+		    ;; sensible size before prettyprinting.  -- fx
+		    (let ((from (point)))
+		      (pp val)
+		      ;; See previous comment for this function.
+		      ;; (help-xref-on-pp from (point))
+		      (if (< (point) (+ from 20))
+			  (delete-region (1- from) from)))))))
+	    ;; Add a note for variables that have been make-var-buffer-local.
+	    (when (and (local-variable-if-set-p variable)
+		       (or (not (local-variable-p variable))
+			   (with-temp-buffer
+			     (local-variable-if-set-p variable))))
+	      (princ "\nAutomatically becomes buffer-local when set in any fashion.\n"))
+	    (terpri)
+
+	    ;; If the value is large, move it to the end.
+	    (with-current-buffer standard-output
+	      (when (> (count-lines (point-min) (point-max)) 10)
+		;; Note that setting the syntax table like below
+		;; makes forward-sexp move over a `'s' at the end
+		;; of a symbol.
+		(set-syntax-table emacs-lisp-mode-syntax-table)
+		(goto-char val-start-pos)
+		(delete-region (point) (progn (end-of-line) (point)))
+		(save-excursion
+		  (insert "\n\nValue:")
+		  (set (make-local-variable 'help-button-cache)
+		       (point-marker)))
+		(insert "value is shown ")
+		(insert-button "below"
+			       'action help-button-cache
+			       'follow-link t
+			       'help-echo "mouse-2, RET: show value")
+		(insert ".\n\n")))
+
+ 	    ;; Mention if it's an alias
+            (let* ((alias (condition-case nil
+                             (indirect-variable variable)
+                           (error variable)))
+                   (obsolete (get variable 'byte-obsolete-variable))
+                   (doc (or (documentation-property variable 'variable-documentation)
+                            (documentation-property alias 'variable-documentation))))
+              (unless (eq alias variable)
+                (princ (format "\nThis variable is an alias for `%s'.\n" alias)))
+              (when obsolete
+                (princ "\nThis variable is obsolete")
+                (if (cdr obsolete) (princ (format " since %s" (cdr obsolete))))
+                (princ ";") (terpri)
+                (princ (if (stringp (car obsolete)) (car obsolete)
+                         (format "use `%s' instead." (car obsolete))))
+                (terpri))
+	      (princ "Documentation:\n")
+              (princ (or doc "Not documented as a variable.")))
+	    ;; Make a link to customize if this variable can be customized.
+	    (if (custom-variable-p variable)
+		(let ((customize-label "customize"))
+		  (terpri)
+		  (terpri)
+		  (princ (concat "You can " customize-label " this variable."))
+		  (with-current-buffer standard-output
+		    (save-excursion
+		      (re-search-backward
+		       (concat "\\(" customize-label "\\)") nil t)
+		      (help-xref-button 1 'help-customize-variable variable)))))
 	    (print-help-return-message)
 	    (save-excursion
 	      (set-buffer standard-output)
@@ -708,7 +710,7 @@
 	    (dotimes (i 95)
 	      (let ((elt (aref docs i)))
 		(when elt
-		  (insert (+ i ?\ ) ": " elt "\n"))))
+		  (insert (+ i ?\s) ": " elt "\n"))))
 	    (while (setq table (char-table-parent table))
 	      (insert "\nThe parent category table is:")
 	      (describe-vector table 'help-describe-category-set))))))))
--- a/lisp/hi-lock.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/hi-lock.el	Mon Sep 19 10:20:33 2005 +0000
@@ -564,7 +564,7 @@
                               (hi-lock-current-line)))))))
       (when hi-lock-mode (hi-lock-set-file-patterns all-patterns))
       (if (interactive-p)
-        (message (format "Hi-lock added %d patterns." (length all-patterns)))))))
+        (message "Hi-lock added %d patterns." (length all-patterns))))))
 
 (defun hi-lock-font-lock-hook ()
   "Add hi lock patterns to font-lock's."
--- a/lisp/ibuf-macs.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/ibuf-macs.el	Mon Sep 19 10:20:33 2005 +0000
@@ -281,7 +281,7 @@
 	 ,(concat (or documentation "This filter is not documented."))
 	 (interactive (list ,reader))
 	 (ibuffer-push-filter (cons ',name qualifier))
-	 (message
+	 (message "%s"
 	  (format ,(concat (format "Filter by %s added: " description)
 			   " %s")
 		  qualifier))
--- a/lisp/image-mode.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/image-mode.el	Mon Sep 19 10:20:33 2005 +0000
@@ -66,7 +66,7 @@
     ;; variables were cleared by kill-all-local-variables
     (setq cursor-type nil truncate-lines t))
   (run-mode-hooks 'image-mode-hook)
-  (message (concat (substitute-command-keys
+  (message "%s" (concat (substitute-command-keys
 		    "Type \\[image-toggle-display] to view the image as ")
 		   (if (get-text-property (point-min) 'display)
 		       "text" "an image") ".")))
@@ -84,7 +84,7 @@
     (if (get-text-property (point-min) 'display)
 	(setq cursor-type nil truncate-lines t))
     (add-hook 'change-major-mode-hook (lambda () (image-minor-mode -1)) nil t)
-    (message (concat (substitute-command-keys
+    (message "%s" (concat (substitute-command-keys
 		      "Type \\[image-toggle-display] to view the image as ")
 		     (if (get-text-property (point-min) 'display)
 			 "text" "an image") "."))))
--- a/lisp/image.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/image.el	Mon Sep 19 10:20:33 2005 +0000
@@ -49,6 +49,16 @@
 with one argument, a string containing the image data.  If PREDICATE returns
 a non-nil value, TYPE is the image's type.")
 
+(defvar image-load-path
+  (list (file-name-as-directory (expand-file-name "images" data-directory))
+	'data-directory 'load-path)
+  "List of locations in which to search for image files.
+If an element is a string, it defines a directory to search.
+If an element is a variable symbol whose value is a string, that
+value defines a directory to search.
+If an element is a variable symbol whose value is a list, the
+value is used as a list of directories to search.")
+
 (defun image-jpeg-p (data)
   "Value is non-nil if DATA, a string, consists of JFIF image data.
 We accept the tag Exif because that is the same format."
@@ -269,6 +279,27 @@
 	  (delete-overlay overlay)))
       (setq overlays (cdr overlays)))))
 
+(defun image-search-load-path (file path)
+  (let (element found pathname)
+    (while (and (not found) (consp path))
+      (setq element (car path))
+      (cond
+       ((stringp element)
+	(setq found
+	      (file-readable-p
+	       (setq pathname (expand-file-name file element)))))
+       ((and (symbolp element) (boundp element))
+	(setq element (symbol-value element))
+	(cond
+	 ((stringp element)
+	  (setq found
+		(file-readable-p
+		 (setq pathname (expand-file-name file element)))))
+	 ((consp element)
+	  (if (setq pathname (image-search-load-path file element))
+	      (setq found t))))))
+      (setq path (cdr path)))
+    (if found pathname)))
 
 ;;;###autoload
 (defun find-image (specs)
@@ -286,7 +317,7 @@
 specification to be returned.  Return nil if no specification is
 satisfied.
 
-The image is looked for first on `load-path' and then in `data-directory'."
+The image is looked for in `image-load-path'."
   (let (image)
     (while (and specs (null image))
       (let* ((spec (car specs))
@@ -296,20 +327,11 @@
 	     found)
 	(when (image-type-available-p type)
 	  (cond ((stringp file)
-		 (let ((path load-path))
-		   (while (and (not found) path)
-		     (let ((try-file (expand-file-name file (car path))))
-		       (when (file-readable-p try-file)
-			 (setq found try-file)))
-		     (setq path (cdr path)))
-		   (unless found
-		     (let ((try-file (expand-file-name file data-directory)))
-		       (if (file-readable-p try-file)
-			   (setq found try-file))))
-		   (if found
-		       (setq image
-			     (cons 'image (plist-put (copy-sequence spec)
-						     :file found))))))
+		 (if (setq found (image-search-load-path
+				  file image-load-path))
+		     (setq image
+			   (cons 'image (plist-put (copy-sequence spec)
+						   :file found)))))
 		((not (null data))
 		 (setq image (cons 'image spec)))))
 	(setq specs (cdr specs))))
--- a/lisp/international/codepage.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/international/codepage.el	Mon Sep 19 10:20:33 2005 +0000
@@ -33,6 +33,8 @@
 
 ;;; Code:
 
+(defvar dos-unsupported-char-glyph)
+
 ;; I doubt we need compatibility versions of any of these autoloaded
 ;; functions apart from codepage-setup, which users may call.
 
--- a/lisp/international/iso-insert.el	Sun Sep 11 22:21:01 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,632 +0,0 @@
-;;; iso-insert.el --- insert functions for ISO 8859/1  -*- coding: iso-8859-1;-*-
-
-;; Copyright (C) 1987, 1994, 2001 Free Software Foundation, Inc.
-
-;; Author: Howard Gayle
-;; Maintainer: FSF
-;; Keywords: i18n
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; Provides keys for inserting ISO Latin-1 characters.  They use the
-;; prefix key C-x 8.  Type C-x 8 C-h for a list.
-
-;;; Code:
-
-(defun insert-no-break-space ()
-   (interactive "*")
-   (insert ?\ )
-)
-
-(defun insert-inverted-exclamation-mark ()
-   (interactive "*")
-   (insert ?\¡)
-)
-
-(defun insert-cent-sign ()
-   (interactive "*")
-   (insert ?\¢)
-)
-
-(defun insert-pound-sign ()
-   (interactive "*")
-   (insert ?\£)
-)
-
-(defun insert-general-currency-sign ()
-   (interactive "*")
-   (insert ?\¤)
-)
-
-(defun insert-yen-sign ()
-   (interactive "*")
-   (insert ?\¥)
-)
-
-(defun insert-broken-vertical-line ()
-   (interactive "*")
-   (insert ?\¦)
-)
-
-(defun insert-section-sign ()
-   (interactive "*")
-   (insert ?\§)
-)
-
-(defun insert-diaeresis ()
-   (interactive "*")
-   (insert ?\¨)
-)
-
-(defun insert-copyright-sign ()
-   (interactive "*")
-   (insert ?\©)
-)
-
-(defun insert-ordinal-indicator-feminine ()
-   (interactive "*")
-   (insert ?\ª)
-)
-
-(defun insert-angle-quotation-mark-left ()
-   (interactive "*")
-   (insert ?\«)
-)
-
-(defun insert-not-sign ()
-   (interactive "*")
-   (insert ?\¬)
-)
-
-(defun insert-soft-hyphen ()
-   (interactive "*")
-   (insert ?\­)
-)
-
-(defun insert-registered-sign ()
-   (interactive "*")
-   (insert ?\®)
-)
-
-(defun insert-macron ()
-   (interactive "*")
-   (insert ?\¯)
-)
-
-(defun insert-degree-sign ()
-   (interactive "*")
-   (insert ?\°)
-)
-
-(defun insert-plus-or-minus-sign ()
-   (interactive "*")
-   (insert ?\±)
-)
-
-(defun insert-superscript-two ()
-   (interactive "*")
-   (insert ?\²)
-)
-
-(defun insert-superscript-three ()
-   (interactive "*")
-   (insert ?\³)
-)
-
-(defun insert-acute-accent ()
-   (interactive "*")
-   (insert ?\´)
-)
-
-(defun insert-micro-sign ()
-   (interactive "*")
-   (insert ?\µ)
-)
-
-(defun insert-pilcrow ()
-   (interactive "*")
-   (insert ?\¶)
-)
-
-(defun insert-middle-dot ()
-   (interactive "*")
-   (insert ?\·)
-)
-
-(defun insert-cedilla ()
-   (interactive "*")
-   (insert ?\¸)
-)
-
-(defun insert-superscript-one ()
-   (interactive "*")
-   (insert ?\¹)
-)
-
-(defun insert-ordinal-indicator-masculine ()
-   (interactive "*")
-   (insert ?\º)
-)
-
-(defun insert-angle-quotation-mark-right ()
-   (interactive "*")
-   (insert ?\»)
-)
-
-(defun insert-fraction-one-quarter ()
-   (interactive "*")
-   (insert ?\¼)
-)
-
-(defun insert-fraction-one-half ()
-   (interactive "*")
-   (insert ?\½)
-)
-
-(defun insert-fraction-three-quarters ()
-   (interactive "*")
-   (insert ?\¾)
-)
-
-(defun insert-inverted-question-mark ()
-   (interactive "*")
-   (insert ?\¿)
-)
-
-(defun insert-A-grave ()
-   (interactive "*")
-   (insert ?\À)
-)
-
-(defun insert-A-acute ()
-   (interactive "*")
-   (insert ?\Á)
-)
-
-(defun insert-A-circumflex ()
-   (interactive "*")
-   (insert ?\Â)
-)
-
-(defun insert-A-tilde ()
-   (interactive "*")
-   (insert ?\Ã)
-)
-
-(defun insert-A-umlaut ()
-   (interactive "*")
-   (insert ?\Ä)
-)
-
-(defun insert-A-ring ()
-   (interactive "*")
-   (insert ?\Å)
-)
-
-(defun insert-AE ()
-   (interactive "*")
-   (insert ?\Æ)
-)
-
-(defun insert-C-cedilla ()
-   (interactive "*")
-   (insert ?\Ç)
-)
-
-(defun insert-E-grave ()
-   (interactive "*")
-   (insert ?\È)
-)
-
-(defun insert-E-acute ()
-   (interactive "*")
-   (insert ?\É)
-)
-
-(defun insert-E-circumflex ()
-   (interactive "*")
-   (insert ?\Ê)
-)
-
-(defun insert-E-umlaut ()
-   (interactive "*")
-   (insert ?\Ë)
-)
-
-(defun insert-I-grave ()
-   (interactive "*")
-   (insert ?\Ì)
-)
-
-(defun insert-I-acute ()
-   (interactive "*")
-   (insert ?\Í)
-)
-
-(defun insert-I-circumflex ()
-   (interactive "*")
-   (insert ?\Î)
-)
-
-(defun insert-I-umlaut ()
-   (interactive "*")
-   (insert ?\Ï)
-)
-
-(defun insert-D-stroke ()
-   (interactive "*")
-   (insert ?\Ð)
-)
-
-(defun insert-N-tilde ()
-   (interactive "*")
-   (insert ?\Ñ)
-)
-
-(defun insert-O-grave ()
-   (interactive "*")
-   (insert ?\Ò)
-)
-
-(defun insert-O-acute ()
-   (interactive "*")
-   (insert ?\Ó)
-)
-
-(defun insert-O-circumflex ()
-   (interactive "*")
-   (insert ?\Ô)
-)
-
-(defun insert-O-tilde ()
-   (interactive "*")
-   (insert ?\Õ)
-)
-
-(defun insert-O-umlaut ()
-   (interactive "*")
-   (insert ?\Ö)
-)
-
-(defun insert-multiplication-sign ()
-   (interactive "*")
-   (insert ?\×)
-)
-
-(defun insert-O-slash ()
-   (interactive "*")
-   (insert ?\Ø)
-)
-
-(defun insert-U-grave ()
-   (interactive "*")
-   (insert ?\Ù)
-)
-
-(defun insert-U-acute ()
-   (interactive "*")
-   (insert ?\Ú)
-)
-
-(defun insert-U-circumflex ()
-   (interactive "*")
-   (insert ?\Û)
-)
-
-(defun insert-U-umlaut ()
-   (interactive "*")
-   (insert ?\Ü)
-)
-
-(defun insert-Y-acute ()
-   (interactive "*")
-   (insert ?\Ý)
-)
-
-(defun insert-THORN ()
-   (interactive "*")
-   (insert ?\Þ)
-)
-
-(defun insert-ss ()
-   (interactive "*")
-   (insert ?\ß)
-)
-
-(defun insert-a-grave ()
-   (interactive "*")
-   (insert ?\à)
-)
-
-(defun insert-a-acute ()
-   (interactive "*")
-   (insert ?\á)
-)
-
-(defun insert-a-circumflex ()
-   (interactive "*")
-   (insert ?\â)
-)
-
-(defun insert-a-tilde ()
-   (interactive "*")
-   (insert ?\ã)
-)
-
-(defun insert-a-umlaut ()
-   (interactive "*")
-   (insert ?\ä)
-)
-
-(defun insert-a-ring ()
-   (interactive "*")
-   (insert ?\å)
-)
-
-(defun insert-ae ()
-   (interactive "*")
-   (insert ?\æ)
-)
-
-(defun insert-c-cedilla ()
-   (interactive "*")
-   (insert ?\ç)
-)
-
-(defun insert-e-grave ()
-   (interactive "*")
-   (insert ?\è)
-)
-
-(defun insert-e-acute ()
-   (interactive "*")
-   (insert ?\é)
-)
-
-(defun insert-e-circumflex ()
-   (interactive "*")
-   (insert ?\ê)
-)
-
-(defun insert-e-umlaut ()
-   (interactive "*")
-   (insert ?\ë)
-)
-
-(defun insert-i-grave ()
-   (interactive "*")
-   (insert ?\ì)
-)
-
-(defun insert-i-acute ()
-   (interactive "*")
-   (insert ?\í)
-)
-
-(defun insert-i-circumflex ()
-   (interactive "*")
-   (insert ?\î)
-)
-
-(defun insert-i-umlaut ()
-   (interactive "*")
-   (insert ?\ï)
-)
-
-(defun insert-d-stroke ()
-   (interactive "*")
-   (insert ?\ð)
-)
-
-(defun insert-n-tilde ()
-   (interactive "*")
-   (insert ?\ñ)
-)
-
-(defun insert-o-grave ()
-   (interactive "*")
-   (insert ?\ò)
-)
-
-(defun insert-o-acute ()
-   (interactive "*")
-   (insert ?\ó)
-)
-
-(defun insert-o-circumflex ()
-   (interactive "*")
-   (insert ?\ô)
-)
-
-(defun insert-o-tilde ()
-   (interactive "*")
-   (insert ?\õ)
-)
-
-(defun insert-o-umlaut ()
-   (interactive "*")
-   (insert ?\ö)
-)
-
-(defun insert-division-sign ()
-   (interactive "*")
-   (insert ?\÷)
-)
-
-(defun insert-o-slash ()
-   (interactive "*")
-   (insert ?\ø)
-)
-
-(defun insert-u-grave ()
-   (interactive "*")
-   (insert ?\ù)
-)
-
-(defun insert-u-acute ()
-   (interactive "*")
-   (insert ?\ú)
-)
-
-(defun insert-u-circumflex ()
-   (interactive "*")
-   (insert ?\û)
-)
-
-(defun insert-u-umlaut ()
-   (interactive "*")
-   (insert ?\ü)
-)
-
-(defun insert-y-acute ()
-   (interactive "*")
-   (insert ?\ý)
-)
-
-(defun insert-thorn ()
-   (interactive "*")
-   (insert ?\þ)
-)
-
-(defun insert-y-umlaut ()
-   (interactive "*")
-   (insert ?\ÿ)
-)
-
-(defvar 8859-1-map nil "Keymap for ISO 8859/1 character insertion.")
-(if 8859-1-map nil
-   (setq 8859-1-map (make-keymap))
-   (define-key 8859-1-map " "    'insert-no-break-space)
-   (define-key 8859-1-map "!"    'insert-inverted-exclamation-mark)
-   (define-key 8859-1-map "\""   (make-sparse-keymap))
-   (define-key 8859-1-map "\"\"" 'insert-diaeresis)
-   (define-key 8859-1-map "\"A"  'insert-A-umlaut)
-   (define-key 8859-1-map "\"E"  'insert-E-umlaut)
-   (define-key 8859-1-map "\"I"  'insert-I-umlaut)
-   (define-key 8859-1-map "\"O"  'insert-O-umlaut)
-   (define-key 8859-1-map "\"U"  'insert-U-umlaut)
-   (define-key 8859-1-map "\"a"  'insert-a-umlaut)
-   (define-key 8859-1-map "\"e"  'insert-e-umlaut)
-   (define-key 8859-1-map "\"i"  'insert-i-umlaut)
-   (define-key 8859-1-map "\"o"  'insert-o-umlaut)
-   (define-key 8859-1-map "\"u"  'insert-u-umlaut)
-   (define-key 8859-1-map "\"y"  'insert-y-umlaut)
-   (define-key 8859-1-map "'"    (make-sparse-keymap))
-   (define-key 8859-1-map "''"   'insert-acute-accent)
-   (define-key 8859-1-map "'A"   'insert-A-acute)
-   (define-key 8859-1-map "'E"   'insert-E-acute)
-   (define-key 8859-1-map "'I"   'insert-I-acute)
-   (define-key 8859-1-map "'O"   'insert-O-acute)
-   (define-key 8859-1-map "'U"   'insert-U-acute)
-   (define-key 8859-1-map "'Y"   'insert-Y-acute)
-   (define-key 8859-1-map "'a"   'insert-a-acute)
-   (define-key 8859-1-map "'e"   'insert-e-acute)
-   (define-key 8859-1-map "'i"   'insert-i-acute)
-   (define-key 8859-1-map "'o"   'insert-o-acute)
-   (define-key 8859-1-map "'u"   'insert-u-acute)
-   (define-key 8859-1-map "'y"   'insert-y-acute)
-   (define-key 8859-1-map "$"    'insert-general-currency-sign)
-   (define-key 8859-1-map "+"    'insert-plus-or-minus-sign)
-   (define-key 8859-1-map ","    (make-sparse-keymap))
-   (define-key 8859-1-map ",,"   'insert-cedilla)
-   (define-key 8859-1-map ",C"   'insert-C-cedilla)
-   (define-key 8859-1-map ",c"   'insert-c-cedilla)
-   (define-key 8859-1-map "-"    'insert-soft-hyphen)
-   (define-key 8859-1-map "."    'insert-middle-dot)
-   (define-key 8859-1-map "/"    (make-sparse-keymap))
-   (define-key 8859-1-map "//"   'insert-division-sign)
-   (define-key 8859-1-map "/O"   'insert-O-slash)
-   (define-key 8859-1-map "/o"   'insert-o-slash)
-   (define-key 8859-1-map "1"    (make-sparse-keymap))
-   (define-key 8859-1-map "1/"   (make-sparse-keymap))
-   (define-key 8859-1-map "1/2"  'insert-fraction-one-half)
-   (define-key 8859-1-map "1/4"  'insert-fraction-one-quarter)
-   (define-key 8859-1-map "3"    (make-sparse-keymap))
-   (define-key 8859-1-map "3/"   (make-sparse-keymap))
-   (define-key 8859-1-map "3/4"  'insert-fraction-three-quarters)
-   (define-key 8859-1-map "<"    'insert-angle-quotation-mark-left)
-   (define-key 8859-1-map "="    'insert-macron)
-   (define-key 8859-1-map ">"    'insert-angle-quotation-mark-right)
-   (define-key 8859-1-map "?"    'insert-inverted-question-mark)
-   (define-key 8859-1-map "A"    'insert-A-ring)
-   (define-key 8859-1-map "E"    'insert-AE)
-   (define-key 8859-1-map "C"    'insert-copyright-sign)
-   (define-key 8859-1-map "D"    'insert-D-stroke)
-   (define-key 8859-1-map "L"    'insert-pound-sign)
-   (define-key 8859-1-map "P"    'insert-pilcrow)
-   (define-key 8859-1-map "R"    'insert-registered-sign)
-   (define-key 8859-1-map "S"    'insert-section-sign)
-   (define-key 8859-1-map "T"    'insert-THORN)
-   (define-key 8859-1-map "Y"    'insert-yen-sign)
-   (define-key 8859-1-map "^"    (make-sparse-keymap))
-   (define-key 8859-1-map "^1"   'insert-superscript-one)
-   (define-key 8859-1-map "^2"   'insert-superscript-two)
-   (define-key 8859-1-map "^3"   'insert-superscript-three)
-   (define-key 8859-1-map "^A"   'insert-A-circumflex)
-   (define-key 8859-1-map "^E"   'insert-E-circumflex)
-   (define-key 8859-1-map "^I"   'insert-I-circumflex)
-   (define-key 8859-1-map "^O"   'insert-O-circumflex)
-   (define-key 8859-1-map "^U"   'insert-U-circumflex)
-   (define-key 8859-1-map "^a"   'insert-a-circumflex)
-   (define-key 8859-1-map "^e"   'insert-e-circumflex)
-   (define-key 8859-1-map "^i"   'insert-i-circumflex)
-   (define-key 8859-1-map "^o"   'insert-o-circumflex)
-   (define-key 8859-1-map "^u"   'insert-u-circumflex)
-   (define-key 8859-1-map "_"    (make-sparse-keymap))
-   (define-key 8859-1-map "_a"   'insert-ordinal-indicator-feminine)
-   (define-key 8859-1-map "_o"   'insert-ordinal-indicator-masculine)
-   (define-key 8859-1-map "`"    (make-sparse-keymap))
-   (define-key 8859-1-map "`A"   'insert-A-grave)
-   (define-key 8859-1-map "`E"   'insert-E-grave)
-   (define-key 8859-1-map "`I"   'insert-I-grave)
-   (define-key 8859-1-map "`O"   'insert-O-grave)
-   (define-key 8859-1-map "`U"   'insert-U-grave)
-   (define-key 8859-1-map "`a"   'insert-a-grave)
-   (define-key 8859-1-map "`e"   'insert-e-grave)
-   (define-key 8859-1-map "`i"   'insert-i-grave)
-   (define-key 8859-1-map "`o"   'insert-o-grave)
-   (define-key 8859-1-map "`u"   'insert-u-grave)
-   (define-key 8859-1-map "a"    'insert-a-ring)
-   (define-key 8859-1-map "e"    'insert-ae)
-   (define-key 8859-1-map "c"    'insert-cent-sign)
-   (define-key 8859-1-map "d"    'insert-d-stroke)
-   (define-key 8859-1-map "o"    'insert-degree-sign)
-   (define-key 8859-1-map "s"    'insert-ss)
-   (define-key 8859-1-map "t"    'insert-thorn)
-   (define-key 8859-1-map "u"    'insert-micro-sign)
-   (define-key 8859-1-map "x"    'insert-multiplication-sign)
-   (define-key 8859-1-map "|"    'insert-broken-vertical-line)
-   (define-key 8859-1-map "~"    (make-sparse-keymap))
-   (define-key 8859-1-map "~A"   'insert-A-tilde)
-   (define-key 8859-1-map "~N"   'insert-N-tilde)
-   (define-key 8859-1-map "~O"   'insert-O-tilde)
-   (define-key 8859-1-map "~a"   'insert-a-tilde)
-   (define-key 8859-1-map "~n"   'insert-n-tilde)
-   (define-key 8859-1-map "~o"   'insert-o-tilde)
-   (define-key 8859-1-map "~~"   'insert-not-sign)
-   (if (not (lookup-key global-map "\C-x8"))
-      (define-key global-map "\C-x8" 8859-1-map))
-)
-(defalias '8859-1-map 8859-1-map)
-
-(provide 'iso-insert)
-
-;;; arch-tag: eb5f97bd-a034-4851-92ff-ab1f1bf92814
-;;; iso-insert.el ends here
--- a/lisp/isearch.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/isearch.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1012,7 +1012,7 @@
 		;; read a key the normal way.
 		;; Word search does not apply (yet) to regexp searches,
 		;; no check is made here.
-		(message (isearch-message-prefix nil nil t))
+		(message "%s" (isearch-message-prefix nil nil t))
 		(if (memq (lookup-key isearch-mode-map (vector e))
 			  '(isearch-yank-word
 			    isearch-yank-word-or-char))
--- a/lisp/iswitchb.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/iswitchb.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1122,7 +1122,7 @@
 	      (set-buffer-major-mode newbufcreated))
 	  (iswitchb-visit-buffer newbufcreated))
       ;; else wont create new buffer
-      (message (format "no buffer matching `%s'" buf)))))
+      (message "no buffer matching `%s'" buf))))
 
 (defun iswitchb-window-buffer-p  (buffer)
   "Return window pointer if BUFFER is visible in another frame.
--- a/lisp/log-edit.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/log-edit.el	Mon Sep 19 10:20:33 2005 +0000
@@ -331,7 +331,7 @@
     (set (make-local-variable 'log-edit-initial-files) (log-edit-files))
     (when setup (run-hooks 'log-edit-hook))
     (goto-char (point-min)) (push-mark (point-max))
-    (message (substitute-command-keys
+    (message "%s" (substitute-command-keys
 	      "Press \\[log-edit-done] when you are done editing."))))
 
 (define-derived-mode log-edit-mode text-mode "Log-Edit"
@@ -426,7 +426,7 @@
   (interactive)
   (if (eq last-command 'log-edit-mode-help)
       (describe-function major-mode)
-    (message
+    (message "%s"
      (substitute-command-keys
       "Type `\\[log-edit-done]' to finish commit.  Try `\\[describe-function] log-edit-done' for more help."))))
 
--- a/lisp/mail/feedmail.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/mail/feedmail.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1943,7 +1943,7 @@
 	       (file-exists-p a-s-file-name)
 	       (delete-file a-s-file-name))))
     (if feedmail-queue-chatty
-	(progn (message (concat "FQM: Queued in " filename))
+	(progn (message "%s" (concat "FQM: Queued in " filename))
 	       (sit-for feedmail-queue-chatty-sit-for)))
     (if feedmail-queue-chatty
 	(progn
--- a/lisp/mail/rmail-spam-filter.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/mail/rmail-spam-filter.el	Mon Sep 19 10:20:33 2005 +0000
@@ -449,10 +449,10 @@
     (if rsf-autosave-newly-added-definitions
 	(progn
 	  (custom-save-all)
-	  (message (concat "added subject \n <<< \n" message-subject
+	  (message "%s" (concat "added subject \n <<< \n" message-subject
 			   " \n >>> \n to list of spam definitions. \n"
 			   "and saved the spam definitions to file.")))
-      (message (concat "added subject \n <<< \n" message-subject
+      (message "%s" (concat "added subject \n <<< \n" message-subject
 		       " \n >>> \n to list of spam definitions. \n"
 		       "Don't forget to save the spam definitions to file using the spam
 		       menu"))
@@ -478,10 +478,10 @@
     (if rsf-autosave-newly-added-definitions
 	(progn
 	  (custom-save-all)
-	  (message (concat "added sender \n <<< \n" message-sender
+	  (message "%s" (concat "added sender \n <<< \n" message-sender
 			   " \n >>> \n to list of spam definitions. \n"
 			   "and saved the spam definitions to file.")))
-      (message (concat "added sender \n <<< \n " message-sender
+      (message "%s" (concat "added sender \n <<< \n " message-sender
 		       " \n >>> \n to list of spam definitions."
 		       "Don't forget to save the spam definitions to file using the spam
 		       menu"))
@@ -521,10 +521,10 @@
 	  (if rsf-autosave-newly-added-definitions
 	      (progn
 		(custom-save-all)
-		(message (concat "added highlighted text \n <<< \n" region-to-spam-list
+		(message "%s" (concat "added highlighted text \n <<< \n" region-to-spam-list
 				 " \n >>> \n to list of spam definitions. \n"
 				 "and saved the spam definitions to file.")))
-	    (message (concat "added highlighted text \n <<< \n " region-to-spam-list
+	    (message "%s" (concat "added highlighted text \n <<< \n " region-to-spam-list
 			     " \n >>> \n to list of spam definitions."
 			     "Don't forget to save the spam definitions to file using the
 			     spam menu"))
--- a/lisp/mail/sendmail.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/mail/sendmail.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1591,8 +1591,13 @@
 The normal hook `mail-setup-hook' is run after the message is
 initialized.  It can add more default fields to the message.
 
-When calling from a program, the first argument if non-nil says
-not to erase the existing contents of the `*mail*' buffer.
+The first argument, NOERASE, determines what to do when there is
+an existing modified `*mail*' buffer.  If NOERASE is nil, the
+existing mail buffer is used, and the user is prompted whether to
+keep the old contents or to erase them.  If NOERASE has the value
+`new', a new mail buffer will be created instead of using the old
+one.  Any other non-nil value means to always select the old
+buffer without erasing the contents.
 
 The second through fifth arguments,
  TO, SUBJECT, IN-REPLY-TO and CC, specify if non-nil
@@ -1649,7 +1654,14 @@
 ;;;		   (file-exists-p buffer-auto-save-file-name))
 ;;;	      (message "Auto save file for draft message exists; consider M-x mail-recover"))
 ;;;          t))
-  (pop-to-buffer "*mail*")
+
+  (if (eq noerase 'new)
+      (pop-to-buffer (generate-new-buffer "*mail*"))
+    (and noerase
+	 (not (get-buffer "*mail*"))
+	 (setq noerase nil))
+    (pop-to-buffer "*mail*"))
+
   ;; Avoid danger that the auto-save file can't be written.
   (let ((dir (expand-file-name
 	      (file-name-as-directory mail-default-directory))))
@@ -1664,7 +1676,8 @@
   ;; (in case the user has actually visited a file *mail*).
 ;  (set-visited-file-name nil)
   (let (initialized)
-    (and (not noerase)
+    (and (not (and noerase
+		   (not (eq noerase 'new))))
 	 (if buffer-file-name
 	     (if (buffer-modified-p)
 		 (when (y-or-n-p "Buffer has unsaved changes; reinitialize it and discard them? ")
--- a/lisp/mh-e/ChangeLog	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/mh-e/ChangeLog	Mon Sep 19 10:20:33 2005 +0000
@@ -1,3 +1,24 @@
+2005-09-18  D Goel  <deego@gnufans.org>
+
+
+	* mh-alias.el (mh-alias-ali): Fix `message' call: first arg
+	should be a format spec.
+	
+	* mh-print.el (mh-ps-spool-buffer, mh-ps-spool-a-msg)	
+	(mh-ps-print-msg, mh-ps-print-msg-show): Ditto.	
+
+	* mh-mime.el (mh-toggle-mh-decode-mime-flag): Ditto.
+	
+	* mh-index.el (mh-index-sequenced-messages): Ditto.
+
+
+	* mh-e.el (mh-refile-or-write-again, mh-page-msg): Ditto.
+
+	* mh-junk.el (mh-junk-blacklist, mh-junk-whitelist)
+	(mh-spamassassin-blacklist, mh-spamassassin-whitelist): Ditto.
+
+
+	
 2005-08-15  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* mh-customize.el: Do not use face-alias compatibility for
--- a/lisp/mh-e/mh-alias.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/mh-e/mh-alias.el	Mon Sep 19 10:20:33 2005 +0000
@@ -251,7 +251,7 @@
         (if (looking-at "^$") (delete-backward-char 1))
         (buffer-substring (point-min)(point-max)))
     (error (progn
-             (message (error-message-string err))
+             (message "%s" (error-message-string err))
              alias))))
 
 (defun mh-alias-expand (alias)
--- a/lisp/mh-e/mh-e.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/mh-e/mh-e.el	Mon Sep 19 10:20:33 2005 +0000
@@ -734,7 +734,7 @@
                    (apply 'mh-write-msg-to-file msg (cdr mh-last-destination)))
                  (mh-next-msg interactive-flag)
                  (format "Destination: %s" (cdr mh-last-destination)))))
-    (message output)))
+    (message "%s" output)))
 
 (defun mh-quit ()
   "Quit the current MH-E folder.
@@ -778,12 +778,12 @@
         (if (mh-in-show-buffer (mh-show-buffer)
               (pos-visible-in-window-p (point-max)))
             (progn
-              (message (format
-                        "End of message (Type %s to read %s undeleted message)"
-                        (single-key-description last-input-event)
-                        (if (equal mh-next-direction 'backward)
-                            "previous"
-                          "next")))
+              (message 
+               "End of message (Type %s to read %s undeleted message)"
+               (single-key-description last-input-event)
+               (if (equal mh-next-direction 'backward)
+                   "previous"
+                 "next"))
               (setq mh-page-to-next-msg-flag t))
           (scroll-other-window arg)))
     (mh-show)))
--- a/lisp/mh-e/mh-index.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/mh-e/mh-index.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1325,7 +1325,7 @@
           mh-index-sequence-search-flag t
           mh-index-previous-search (list folders sequence))
     (mh-index-write-data)
-    (when (stringp message) (message message))))
+    (when (stringp message) (message "%s" message))))
 
 ;;;###mh-autoload
 (defun mh-index-new-messages (folders)
--- a/lisp/mh-e/mh-junk.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/mh-e/mh-junk.el	Mon Sep 19 10:20:33 2005 +0000
@@ -63,9 +63,9 @@
                                (substring mh-junk-disposition 1)))
                       (t (concat "+" mh-junk-disposition)))))
       (mh-iterate-on-range msg range
-        (message (format "Blacklisting message %d..." msg))
+        (message "Blacklisting message %d..." msg)
         (funcall (symbol-function blacklist-func) msg)
-        (message (format "Blacklisting message %d...done" msg))
+        (message "Blacklisting message %d...done" msg)
         (if (not (memq msg mh-seen-list))
             (setq mh-seen-list (cons msg mh-seen-list)))
         (if dest
@@ -87,9 +87,9 @@
     (unless whitelist-func
       (error "Customize `mh-junk-program' appropriately"))
     (mh-iterate-on-range msg range
-      (message (format "Whitelisting message %d..." msg))
+      (message "Whitelisting message %d..." msg)
       (funcall (symbol-function whitelist-func) msg)
-      (message (format "Whitelisting message %d...done" msg))
+      (message "Whitelisting message %d...done" msg)
       (mh-refile-a-msg nil (intern mh-inbox)))
     (mh-next-msg)))
 
@@ -179,7 +179,7 @@
         (msg-file (mh-msg-filename msg mh-current-folder))
         (sender))
     (save-excursion
-      (message (format "Reporting message %d..." msg))
+      (message "Reporting message %d..." msg)
       (mh-truncate-log-buffer)
       (call-process mh-spamassassin-executable msg-file mh-log-buffer nil
                     ;;"--report" "--remove-from-whitelist"
@@ -188,7 +188,7 @@
           (message "Recategorizing this message as spam...")
           (call-process mh-sa-learn-executable msg-file mh-log-buffer nil
                         "--single" "--spam" "--local" "--no-rebuild"))
-      (message (format "Blacklisting message %d..." msg))
+      (message "Blacklisting message %d..." msg)
       (set-buffer (get-buffer-create mh-temp-buffer))
       (erase-buffer)
       (call-process (expand-file-name mh-scan-prog mh-progs)
@@ -200,8 +200,8 @@
           (progn
             (setq sender (match-string 0))
             (mh-spamassassin-add-rule "blacklist_from" sender)
-            (message (format "Blacklisting message %d...done" msg)))
-        (message (format "Blacklisting message %d...not done (from my address)" msg))))))
+            (message "Blacklisting message %d...done" msg))
+        (message "Blacklisting message %d...not done (from my address)" msg)))))
 
 (defun mh-spamassassin-whitelist (msg)
   "Whitelist MSG with SpamAssassin.
@@ -230,14 +230,14 @@
         (message "Recategorizing this message as ham...")
         (call-process mh-sa-learn-executable msg-file mh-temp-buffer nil
                       "--single" "--ham" "--local --no-rebuild"))
-      (message (format "Whitelisting message %d..." msg))
+      (message "Whitelisting message %d..." msg)
       (setq from
             (car (mh-funcall-if-exists
                   ietf-drums-parse-address (mh-get-header-field "From:"))))
       (kill-buffer nil)
       (unless (or (null from) (equal from ""))
         (mh-spamassassin-add-rule "whitelist_from" from))
-      (message (format "Whitelisting message %d...done" msg)))))
+      (message "Whitelisting message %d...done" msg))))
 
 (defun mh-spamassassin-add-rule (rule body)
   "Add a new rule to `~/.spamassassin/user_prefs'.
--- a/lisp/mh-e/mh-mime.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/mh-e/mh-mime.el	Mon Sep 19 10:20:33 2005 +0000
@@ -858,7 +858,7 @@
   (interactive)
   (setq mh-decode-mime-flag (not mh-decode-mime-flag))
   (mh-show nil t)
-  (message (format "(setq mh-decode-mime-flag %s)" mh-decode-mime-flag)))
+  (message "(setq mh-decode-mime-flag %s)" mh-decode-mime-flag))
 
 ;;;###mh-autoload
 (defun mh-decode-message-header ()
--- a/lisp/mh-e/mh-print.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/mh-e/mh-print.el	Mon Sep 19 10:20:33 2005 +0000
@@ -64,7 +64,7 @@
 ;; XXX - Default print buffer is bogus
 (defun mh-ps-spool-buffer (buffer)
   "Send BUFFER to printer queue."
-  (message (format "mh-ps-spool-buffer %s" buffer))
+  (message "mh-ps-spool-buffer %s" buffer)
   (save-excursion
     (set-buffer buffer)
     (let ((ps-print-color-p mh-ps-print-color-option)
@@ -85,8 +85,8 @@
   "Print MSG.
 First the message is decoded in BUFFER before the results are sent to the
 printer."
-  (message (format "mh-ps-spool-a-msg msg %s buffer %s"
-		   msg buffer))
+  (message "mh-ps-spool-a-msg msg %s buffer %s"
+		   msg buffer)
   (let ((mh-show-buffer mh-show-buffer)
 	(folder mh-current-folder)
         ;; The following is commented out because
@@ -113,8 +113,8 @@
 Check the documentation of `mh-interactive-range' to see how RANGE is read in
 interactive use."
   (interactive (list (mh-interactive-range "Print")))
-  (message (format "mh-ps-print-msg range %s keys %s"
-		    range (this-command-keys)))
+  (message "mh-ps-print-msg range %s keys %s"
+		    range (this-command-keys))
   (mh-iterate-on-range msg range
     (let ((buffer (get-buffer-create mh-temp-buffer)))
       (unwind-protect
@@ -152,8 +152,8 @@
 (defun mh-ps-print-msg-show (file)
   "Print current show buffer to FILE."
   (interactive (list (mh-ps-print-preprint current-prefix-arg)))
-  (message (format "mh-ps-print-msg-show file %s keys %s mh-show-buffer %s"
-		   file (this-command-keys) mh-show-buffer))
+  (message "mh-ps-print-msg-show file %s keys %s mh-show-buffer %s"
+		   file (this-command-keys mh-show-buffer))
   (let ((msg (mh-get-msg-num t))
         (folder mh-current-folder)
         (show-buffer mh-show-buffer)
--- a/lisp/mouse.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/mouse.el	Mon Sep 19 10:20:33 2005 +0000
@@ -153,7 +153,7 @@
 
 (defvar mouse-major-mode-menu-prefix)	; dynamically bound
 
-(defun mouse-major-mode-menu (event prefix)
+(defun mouse-major-mode-menu (event &optional prefix)
   "Pop up a mode-specific menu of mouse commands.
 Default to the Edit menu if the major mode doesn't define a menu."
   ;; Switch to the window clicked on, because otherwise
@@ -173,8 +173,7 @@
 	 ;; default to the edit menu.
 	 (newmap (if ancestor
 		     (make-sparse-keymap (concat mode-name " Mode"))
-		   menu-bar-edit-menu))
-	 result)
+		   menu-bar-edit-menu)))
     (if ancestor
 	;; Make our menu inherit from the desired keymap which we want
 	;; to display as the menu now.
--- a/lisp/net/ange-ftp.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/net/ange-ftp.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1641,81 +1641,75 @@
 ;; on to ange-ftp-process-handle-line to deal with.
 
 (defun ange-ftp-process-filter (proc str)
-  (let ((buffer (process-buffer proc))
-	(old-buffer (current-buffer)))
-
-    ;; Eliminate nulls.
-    (while (string-match "\000+" str)
-      (setq str (replace-match "" nil nil str)))
-
-    ;; see if the buffer is still around... it could have been deleted.
-    (if (buffer-name buffer)
-	(unwind-protect
-	    (progn
-	      (set-buffer (process-buffer proc))
-
-	      ;; handle hash mark printing
-	      (and ange-ftp-process-busy
-		   (string-match "\\`#+\\'" str)
-		   (setq str (ange-ftp-process-handle-hash str)))
-	      (comint-output-filter proc str)
-	      ;; Replace STR by the result of the comint processing.
-	      (setq str (buffer-substring comint-last-output-start
-					  (process-mark proc)))
-	      (if ange-ftp-process-busy
-		  (progn
-		    (setq ange-ftp-process-string (concat ange-ftp-process-string
-							  str))
-
-		    ;; if we gave an empty password to the USER command earlier
-		    ;; then we should send a null password now.
-		    (if (string-match "Password: *$" ange-ftp-process-string)
-			(process-send-string proc "\n"))))
-	      (while (and ange-ftp-process-busy
-			  (string-match "\n" ange-ftp-process-string))
-		(let ((line (substring ange-ftp-process-string
-				       0
-				       (match-beginning 0)))
-                      (seen-prompt nil))
-		  (setq ange-ftp-process-string (substring ange-ftp-process-string
-							   (match-end 0)))
-		  (while (string-match "\\`ftp> *" line)
-                    (setq seen-prompt t)
-		    (setq line (substring line (match-end 0))))
-                  (if (not (and seen-prompt ange-ftp-pending-error-line))
-                      (ange-ftp-process-handle-line line proc)
-                    ;; If we've seen a potential error message and it
-                    ;; hasn't been cancelled by a good message before
-                    ;; seeing a propt, then the error was real.
-                    (delete-process proc)
-                    (setq ange-ftp-process-busy nil
-                          ange-ftp-process-result-line ange-ftp-pending-error-line))))
-
-	      ;; has the ftp client finished?  if so then do some clean-up
-	      ;; actions.
-	      (if (not ange-ftp-process-busy)
-		  (progn
-		    ;; reset the xfer size
-		    (setq ange-ftp-xfer-size 0)
-
-		    ;; issue the "done" message since we've finished.
-		    (if (and ange-ftp-process-msg
-			     ange-ftp-process-verbose
-			     ange-ftp-process-result)
-			(progn
-			  (ange-ftp-message "%s...done" ange-ftp-process-msg)
-			  (ange-ftp-repaint-minibuffer)
-			  (setq ange-ftp-process-msg nil)))
-
-		    ;; is there a continuation we should be calling?  if so,
-		    ;; we'd better call it, making sure we only call it once.
-		    (if ange-ftp-process-continue
-			(let ((cont ange-ftp-process-continue))
-			  (setq ange-ftp-process-continue nil)
-			  (ange-ftp-call-cont cont
-					      ange-ftp-process-result
-					      ange-ftp-process-result-line))))))
-	  (set-buffer old-buffer)))))
+  ;; Eliminate nulls.
+  (while (string-match "\000+" str)
+    (setq str (replace-match "" nil nil str)))
+
+  ;; see if the buffer is still around... it could have been deleted.
+  (when (buffer-live-p (process-buffer proc))
+    (with-current-buffer (process-buffer proc)
+
+      ;; handle hash mark printing
+      (and ange-ftp-process-busy
+           (string-match "^#+$" str)
+           (setq str (ange-ftp-process-handle-hash str)))
+      (comint-output-filter proc str)
+      ;; Replace STR by the result of the comint processing.
+      (setq str (buffer-substring comint-last-output-start
+                                  (process-mark proc)))
+      (if ange-ftp-process-busy
+          (progn
+            (setq ange-ftp-process-string (concat ange-ftp-process-string
+                                                  str))
+
+            ;; if we gave an empty password to the USER command earlier
+            ;; then we should send a null password now.
+            (if (string-match "Password: *$" ange-ftp-process-string)
+                (process-send-string proc "\n"))))
+      (while (and ange-ftp-process-busy
+                  (string-match "\n" ange-ftp-process-string))
+        (let ((line (substring ange-ftp-process-string
+                               0
+                               (match-beginning 0)))
+              (seen-prompt nil))
+          (setq ange-ftp-process-string (substring ange-ftp-process-string
+                                                   (match-end 0)))
+          (while (string-match "\\`ftp> *" line)
+            (setq seen-prompt t)
+            (setq line (substring line (match-end 0))))
+          (if (not (and seen-prompt ange-ftp-pending-error-line))
+              (ange-ftp-process-handle-line line proc)
+            ;; If we've seen a potential error message and it
+            ;; hasn't been cancelled by a good message before
+            ;; seeing a propt, then the error was real.
+            (delete-process proc)
+            (setq ange-ftp-process-busy nil
+                  ange-ftp-process-result-line ange-ftp-pending-error-line))))
+
+      ;; has the ftp client finished?  if so then do some clean-up
+      ;; actions.
+      (if (not ange-ftp-process-busy)
+          (progn
+            ;; reset the xfer size
+            (setq ange-ftp-xfer-size 0)
+
+            ;; issue the "done" message since we've finished.
+            (if (and ange-ftp-process-msg
+                     ange-ftp-process-verbose
+                     ange-ftp-process-result)
+                (progn
+                  (ange-ftp-message "%s...done" ange-ftp-process-msg)
+                  (ange-ftp-repaint-minibuffer)
+                  (setq ange-ftp-process-msg nil)))
+
+            ;; is there a continuation we should be calling?  if so,
+            ;; we'd better call it, making sure we only call it once.
+            (if ange-ftp-process-continue
+                (let ((cont ange-ftp-process-continue))
+                  (setq ange-ftp-process-continue nil)
+                  (ange-ftp-call-cont cont
+                                      ange-ftp-process-result
+                                      ange-ftp-process-result-line))))))))
 
 (defun ange-ftp-process-sentinel (proc str)
   "When ftp process changes state, nuke all file-entries in cache."
@@ -1795,8 +1789,7 @@
 
 (defun ange-ftp-gwp-start (host user name args)
   "Login to the gateway machine and fire up an ftp process."
-  (let* ((gw-user (ange-ftp-get-user ange-ftp-gateway-host))
-	 ;; It would be nice to make process-connection-type nil,
+  (let* (;; It would be nice to make process-connection-type nil,
 	 ;; but that doesn't work: ftp never responds.
 	 ;; Can anyone find a fix for that?
 	 (proc (let ((process-connection-type t))
@@ -2137,7 +2130,6 @@
       (save-excursion
 	(set-buffer (process-buffer proc))
 	(let* ((status (ange-ftp-raw-send-cmd proc "hash"))
-	       (result (car status))
 	       (line (cdr status)))
 	  (save-match-data
 	    (if (string-match ange-ftp-hash-mark-msgs line)
@@ -4484,8 +4476,7 @@
 ;; `ange-ftp-ls' handles this.
 
 (defun ange-ftp-insert-directory (file switches &optional wildcard full)
-  (let ((short (ange-ftp-abbreviate-filename file))
-	(parsed (ange-ftp-ftp-name (expand-file-name file)))
+  (let ((parsed (ange-ftp-ftp-name (expand-file-name file)))
 	tem)
     (if parsed
 	(if (and (not wildcard)
@@ -4511,10 +4502,9 @@
 (defun ange-ftp-file-name-sans-versions (file keep-backup-version)
   (let* ((short (ange-ftp-abbreviate-filename file))
 	 (parsed (ange-ftp-ftp-name short))
-	 host-type func)
+	 func)
     (if parsed
-	(setq host-type (ange-ftp-host-type (car parsed))
-	      func (cdr (assq (ange-ftp-host-type (car parsed))
+	(setq func (cdr (assq (ange-ftp-host-type (car parsed))
 			      ange-ftp-sans-version-alist))))
     (if func (funcall func file keep-backup-version)
       (ange-ftp-real-file-name-sans-versions file keep-backup-version))))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/net/newsticker.el	Mon Sep 19 10:20:33 2005 +0000
@@ -0,0 +1,4922 @@
+;;; newsticker.el --- A Newsticker for Emacs.
+
+;; Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; Author:      Ulf Jasper <ulf.jasper@web.de>
+;; Filename:    newsticker.el
+;; URL:         http://www.nongnu.org/newsticker
+;; Created:     17. June 2003
+;; Keywords:    News, RSS
+;; Time-stamp:  "26. August 2005, 16:33:46 (ulf)"
+;; CVS-Version: $Id: newsticker.el,v 1.4 2005/09/18 12:36:08 deego Exp $
+
+(defconst newsticker-version "1.8" "Version number of newsticker.el.")
+
+;; ======================================================================
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2 of the License, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; if not, write to the Free Software
+;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+;; USA
+
+;; ======================================================================
+;;; Commentary:
+
+;; Overview
+;; --------
+
+;; Newsticker provides a newsticker for Emacs. A newsticker is a thing that
+;; asynchronously retrieves headlines from a list of news sites, prepares
+;; these headlines for reading, and allows for loading the corresponding
+;; articles in a web browser.
+
+;; Headlines consist of a title and (possibly) a small description. They
+;; are contained in RSS (RDF Site Summary) files. Newsticker should work
+;; with all RSS files that follow the RDF Rich Site Summary 1.0
+;; specification. It should also work with version 2.0 as well as
+;; other/older/alternative RSS formats (like 0.9<something> or such). In
+;; other words: Newsticker is a "RSS reader" or "RSS aggregator".
+
+;; Newsticker provides several commands for reading headlines, navigating
+;; through them, marking them as read/unread, hiding old headlines
+;; etc. Headlines can be displayed as plain text or as rendered HTML.
+
+;; Headlines can be displayed in the echo area, either scrolling like
+;; messages in a stock-quote ticker, or just changing.
+
+;; Newsticker allows for automatic processing of headlines by providing
+;; hooks and (sample) functions for automatically downloading images and
+;; enclosed files (as delivered by podcasts, e.g.).
+
+
+
+;; Requirements
+;; ------------
+;; Newsticker can be used with GNU Emacs version 21.1 or later as well as
+;; XEmacs. It requires an XML-parser (`xml.el') which is part of GNU
+;; Emacs. If you are using XEmacs you want to get the `net-utils' package
+;; which contains `xml.el' for XEmacs.
+
+;; Newsticker requires a program which can retrieve files via http and
+;; prints them to stdout. By default Newsticker will use wget for this
+;; task.
+
+;; Installation
+;; ------------
+;; Place Newsticker in a directory where Emacs can find it. Add the
+;; following line to your Emacs startup file (`~/.emacs').
+;;   (add-to-list 'load-path "/path/to/newsticker/")
+;;   (autoload 'newsticker-start "newsticker" "Emacs Newsticker" t)
+;;   (autoload 'newsticker-show-news "newsticker" "Emacs Newsticker" t)
+
+;; Newsticker-mode supports imenu. It allows for navigating with the help
+;; of a menu. In order to use this feature you should also add the
+;; following.
+;;   (add-hook 'newsticker-mode-hook 'imenu-add-menubar-index)
+
+;; That's it.
+
+;; Usage
+;; -----
+;; The command newsticker-show-news will display all available headlines in
+;; a special buffer, called `*newsticker*'. It will also start the
+;; asynchronous download of headlines. The modeline in the `*newsticker*'
+;; buffer informs whenever new headlines have arrived. Clicking
+;; mouse-button 2 or pressing RET in this buffer on a headline will call
+;; browse-url to load the corresponding news story in your favourite web
+;; browser.
+
+;; The scrolling, or flashing of headlines in the echo area, can be started
+;; with the command newsticker-start-ticker. It can be stopped with
+;; newsticker-stop-ticker.
+
+;; If you just want to start the periodic download of headlines use the
+;; command newsticker-start. Calling newsticker-stop will stop the periodic
+;; download, but will call newsticker-stop-ticker as well.
+
+;; Configuration
+;; -------------
+;; All Newsticker options are customizable, i.e. they can be changed with
+;; Emacs customization methods: Call the command customize-group and enter
+;; `newsticker' for the customization group.
+
+;; All Newsticker options have reasonable default values, so that in most
+;; cases it is not necessary to customize settings before starting
+;; Newsticker for the first time.
+
+;; Newsticker options are organized in the following groups.
+
+;; * newsticker-feed contains options that define which news
+;;   feeds are retrieved and how this is done.
+;;   o newsticker-url-list defines the list of headlines which are
+;;     retrieved.
+;;   o newsticker-retrieval-interval defines how often headlines are
+;;     retrieved.
+;; * newsticker-headline-processing contains options that define how the
+;;   retrieved headlines are processed.
+;;   o newsticker-keep-obsolete-items decides whether unread headlines that
+;;     have been removed from the feed are kept in the Newsticker cache.
+;; * newsticker-layout contains options that define how the buffer for
+;;   reading RSS headlines is formatted.
+;;   o newsticker-item-format defines how the title of a headline is
+;;     formatted.
+;; * newsticker-ticker contains options that define how headlines are shown
+;;   in the echo area.
+;;   o newsticker-display-interval and newsticker-scroll-smoothly define
+;;     how headlines are shown in the echo area.
+;; * newsticker-hooks contains options for hooking other Emacs commands to
+;;   newsticker functions.
+;;   o newsticker-new-item-functions allows for automatic processing of
+;;     headlines. See `newsticker-download-images', and
+;;     `newsticker-download-enclosures' for sample functions.
+;; * newsticker-miscellaneous contains other Newsticker options.
+
+;; Please have a look at the customization buffers for the complete list of
+;; options.
+
+;; Remarks
+;; -------
+;; This newsticker is designed do its job silently in the background
+;; without disturbing you.  However, it is probably impossible to prevent
+;; such a tool from slightly attenuating your Editor's responsiveness every
+;; once in a while.
+
+;; Byte-compiling newsticker.el is recommended.
+
+;; ======================================================================
+;;; History:
+
+;; 1.8 (2005-08-26)
+;;     * Added commands `newsticker-show-extra' and `newsticker-hide-extra'
+;;       to show and hide extra RSS elements, bound to "sx" and "hx"
+;;       resp. Changed default value of `newsticker-show-all-rss-elements'
+;;       to nil.
+;;     * mode-line: Introduced special mode-line-format for newsticker.
+;;     * Get feed logos only once every 24 h.
+;;     * Default faces changed.
+;;     * Minor fixes.
+
+;; 1.7 (2005-06-25)
+;;     * Tool-bar support: most important commands can be called from
+;;       tool-bar buttons.
+;;     * Auto-Narrowing introduced: *newsticker* buffer can be narrowed to
+;;       a single item (bound to key `xi') or a single feed (bound to `xf').
+;;     * Enclosure support: enclosed items are shown (see
+;;       `newsticker-enclosure-face') and can be (automatically) downloaded
+;;       (see below). For those of you who read "podcasts".
+;;     * Added variable `newsticker-auto-mark-filter' for automatically
+;;       marking items as immortal or old.
+;;     * Added hook variable `newsticker-new-item-functions' for handling
+;;       new items.  Added sample functions `newsticker-download-images',
+;;       and `newsticker-download-enclosures'.
+;;     * Added hook variable `newsticker-select-item-hook' which is run
+;;       after `newsticker-(next|previous)-(new-)?-item'.
+;;     * Added hook variable `newsticker-select-feed-hook' which is run
+;;       after `newsticker-(next|previous)-feed'.
+;;     * Added hook variable `newsticker-buffer-change-hook' which is run
+;;       after the contents or visibility of the newsticker buffer has
+;;       changed, e.g. after `newsticker-buffer-update' or
+;;       `newsticker-show-feed-desc'.
+;;     * Added command `newsticker-handle-url' for interactively launching
+;;       arbitrary programs for URLs, bound to `C-RET'.
+;;     * URLs in extra elements are clickable.
+;;     * Better support for w3, added command
+;;       `newsticker-w3m-show-inline-images' for displaying all inline
+;;       images.
+;;     * Insert an artificial headline which notifies about failed retrievals.
+;;     * Use pubDate element (RSS 2.0) instead of retrieval time when
+;;       available.
+;;     * Customizable options grouped.
+;;     * Bugfixes: `newsticker--imenu-create-index'; strip whitespace
+;;       from links; apply coding-system to extra-elements; time-comparison
+;;       for obsolete items; and others which I have forgotten.
+;;     * Workaround for another bug in xml-parse-region -- thanks to anonymous
+;;       for sending patch.
+;;     * Renamed invisible buffers ` *wget-newsticker-<feed>*' to
+;;       ` *newsticker-wget-<feed>*'.
+;;     * Tested with GNU Emacs versions 21.3 and 22.0 and XEmacs 21.something.
+
+;; 1.6 * Support for (some) optional RSS elements: guid, dc:date. See
+;;       `newsticker-show-all-rss-elements' `newsticker-extra-face'.
+;;     * Better support for w3m -- `newsticker-default-face' is obsolete
+;;       now, removed `newsticker-w3m-toggle-inline-image'.
+;;     * Added `newsticker-desc-comp-max' -- comparison of item descriptions
+;;       can take quite some time.
+;;     * Added `newsticker--buffer-make-item-completely-visible' to
+;;       ensure that the current item is fully visible.
+;;     * Allow for non-positive retrieval-interval, which make newsticker
+;;       get news only once.
+;;     * Use :set for customizable variables.
+;;     * Added `newsticker-buffer-force-update', bound to key `U'.
+;;     * Added concept of obsolete items, see
+;;       `newsticker-keep-obsolete-items', `newsticker-obsolete-item-face',
+;;       `newsticker-obsolete-item-max-age'.
+;;     * Added `newsticker-add-url'.
+;;     * OPML export.
+;;     * Save pre-formatted titles => even better performance!!
+;;     * `newsticker-*-new-item' wraps at beginning/end of buffer.
+;;     * Always sort obsolete items to end of item list.
+;;     * Bugfixes:
+;;       - newsticker-hide-entry,
+;;       - changes of feed-titles led to duplicate feed items,
+;;       - faces for rendered HTML texts,
+;;       - length of ticker-text (for "exotic"/multibyte texts),
+;;         Thanks to Hiroshi Maruyama.
+;;       - suppress items with empty title and description
+;;       - newsticker-sort-method was ignored!
+;;       - prevent call of fill-region on HTML-rendered descriptions.
+
+;; 1.5 * Rewrote the visibility stuff. newsticker does not inherit
+;;       outline anymore.  Now you have complete freedom for
+;;       `newsticker-*-format'.
+;;     * Save pre-formatted descriptions => incredible performance boost!!
+;;     * Introduced `newsticker-(start|stop)-ticker'.
+;;     * Introduced statistics for heading-format and
+;;       `newsticker-statistics-face'.
+;;     * Introduced `newsticker-enable-logo-manipulations'.
+;;     * Compare link of items (as well as title and desc).
+;;     * Added `newsticker-start-hook' and `newsticker-stop-hook', thanks
+;;       to mace.
+;;     * Bugfixes -- thanks to Ryan Yeske, Jari Aalto, Bruce Ingalls.
+;;     * Tested with Emacs 21.3.50, 21.3.1, 21.2, 21.1; XEmacs 21.4.15
+
+;; 1.4 * Enabled HTML rendering, added `newsticker-html-renderer' to
+;;       choose a HTML rendering engine, thanks to Greg Scott for testing
+;;     * New Outline handling using text properties instead of "**"
+;;       prefixes.
+;;     * Added possibility to mark single item as old (bound to key
+;;       `o' (`newsticker-mark-item-at-point-as-read').
+;;     * Added possibility to mark single item as immortal (bound to key
+;;       `i' (`newsticker-mark-item-at-point-as-immortal').
+;;     * Added possibility to display feed logos.
+;;     * Added `newsticker-heading-format', `newsticker-item-format'.
+;;     * Added `newsticker-date-format'.
+;;     * Added `newsticker-justification'.
+;;     * Added `newsticker-automatically-mark-visited-items-as-old'.
+;;     * Added `newsticker-w3m-toggle-inline-image' which calls
+;;       `w3m-toggle-inline-image' if `newsticker-html-renderer' is
+;;       `w3m-region'. Exists for convenience only (bound to key
+;;       `RET').
+
+;; 1.3 * Compare title AND desc to check whether item is old, except
+;;       for feed desc
+;;     * Mark as not-up-to-date only after new items have arrived.
+;;     * Added XEmacs compatibility code, tested with XEmacs 21.4.13.
+;;     * Tested with Emacs 21.3.50 and Emacs 21.2.something.
+;;     * Bugfix: Apply coding-systems to feed title and description,
+;;       thanks to OHASHI Akira
+;;     * Bugfix: xml-parser-workaround did not work for japanese texts,
+;;       thanks to OHASHI Akira
+;;     * Kill wget-buffers unless newsticker-debug is not nil.
+;;     * Bugfix: xml-parser-workaround for "DOCTYPE rdf:RDF"
+
+;; 1.2 Peter S Galbraith <psg@debian.org>
+;;     * Added `newsticker-url-list-defaults', splitting the URLs into
+;;       a customizable selection list, and a user add-on list.
+;;     * Minor checkdoc fixes.
+
+;; 1.1 * Introduced optional feed-specific wget-arguments.
+;;     * Keep order of feeds as given in `newsticker-url-list' in
+;;       *newsticker* buffer.
+;;     * Ignore unsupported coding systems.
+
+;; 1.0 * Introduced feed-specific retrieval-timers.
+;;     * Removed dependency on 'cl (cddddr).
+;;     * Thanks to Kevin Rodgers and T.V.  Raman for their help.
+;;     * Use utf-8 for reading and writing cache data.
+;;     * Reported to work with Emacs 21.3.50.
+
+;; 0.99 * Minor tweaks.
+;;      * Tested with Emacs 21.3.2
+
+;; 0.98 * Check exit status of wget processes.  Keep cache data if
+;;        something went wrong.  Throw error when old wget-processes
+;;        are hanging around.
+;;      * Introduced newsticker-specific faces.
+;;      * Added `newsticker-show-descriptions-of-new-items'.
+;;      * Added `newsticker-hide-old-items-in-newsticker-buffer'.
+;;      * Added `newsticker-(hide|show)-old-items'.
+
+;; 0.97 * Minor tweaks.
+
+;; 0.96 * Added caching.
+;;      * newsticker-mode inherits outline-mode.
+;;      * newsticker-mode supports imenu.
+;;      * Easy buffer-navigation with newsticker-mode's keymap.
+;;      * Some bugs fixed.
+;;      * Thanks to Moritz Epple for documentation tips.
+
+;; 0.95 * Added newsticker-mode -- Thanks to T.V.  Raman.
+;;      * Catch xml-parser errors -- Thanks to T.V.  Raman.
+;;      * Remove stupid newlines in titles (headlines) -- Thanks to
+;;        Jeff Rancier.
+
+;; 0.94 * Added clickerability and description for channel headings.
+;;      * Made it work for (at least some) rss 0.9<something> feeds.
+
+;; 0.93 * Added some more sites.
+;;      * Do not flood the *Messages* buffer.
+;;      * First attempt at handling coding systems.
+
+;; 0.92 * Added `newsticker-wget-name'.
+;;      * Try to display message only if minibuffer and echo area are
+;;        not in use already.
+;;      * Dirty workaround for newer versions of xml.el: Remove
+;;        whitespace in rdf.
+;;      * Tested with Emacs 21.3.2 and CVS-snapshot of 2003-06-21.
+
+;; 0.91 * First bugfix: *newsticker* is read-only.
+
+;; 0.9  * First release.
+;;      * Tested with Emacs 21.3.2 and wget 1.8.2.
+
+;; ======================================================================
+;;; To Do:
+
+;; * Image handling for XEmacs (create-image does not exist)
+
+;; ======================================================================
+;;; Code:
+
+(require 'derived)
+(require 'xml)
+
+;; Silence warnings
+(defvar tool-bar-map)
+(defvar w3-mode-map)
+(defvar w3m-minor-mode-map)
+
+;; ======================================================================
+;;; Customizables
+;; ======================================================================
+(defgroup newsticker nil
+  "RSS aggregator."
+  :group 'applications)
+
+(defconst newsticker--raw-url-list-defaults
+  '(("CNET News.com"
+     "http://export.cnet.com/export/feeds/news/rss/1,11176,,00.xml")
+    ("Debian Security Advisories"
+    "http://www.debian.org/security/dsa.en.rdf")
+    ("Debian Security Advisories - Long format"
+    "http://www.debian.org/security/dsa-long.en.rdf")
+    ("Emacs Wiki"
+    "http://www.emacswiki.org/cgi-bin/wiki.pl?action=rss"
+    nil
+    3600)
+    ("Freshmeat.net"
+    "http://freshmeat.net/backend/fm.rdf")
+    ("Kuro5hin.org"
+    "http://www.kuro5hin.org/backend.rdf")
+    ("LWN (Linux Weekly News)"
+    "http://lwn.net/headlines/rss")
+    ("NewsForge"
+    "http://newsforge.com/index.rss")
+    ("NY Times: Technology"
+    "http://partners.userland.com/nytRss/technology.xml")
+    ("NY Times"
+    "http://partners.userland.com/nytRss/nytHomepage.xml")
+    ("Quote of the day"
+    "http://www.quotationspage.com/data/qotd.rss"
+    "07:00"
+    86400)
+    ("The Register"
+    "http://www.theregister.co.uk/tonys/slashdot.rdf")
+    ("slashdot"
+    "http://slashdot.org/index.rss"
+    nil
+    3600)                        ;/. will ban you if under 3600 seconds!
+    ("Wired News"
+    "http://www.wired.com/news_drop/netcenter/netcenter.rdf")
+    ("Heise News (german)"
+    "http://www.heise.de/newsticker/heise.rdf")
+    ("Tagesschau (german)"
+    "http://www.tagesschau.de/newsticker.rdf"
+    nil
+    1800)
+    ("Telepolis (german)"
+    "http://www.heise.de/tp/news.rdf"))
+  "Default URL list in raw form.
+This list is fed into defcustom via `newsticker--splicer'.")
+
+(defun newsticker--splicer (item)
+  "Convert ITEM for splicing into `newsticker-url-list-defaults'."
+  (let ((result (list 'list :tag (nth 0 item) (list 'const (nth 0 item))))
+        (element (cdr item)))
+    (while element
+      (setq result (append result (list (list 'const (car element)))))
+      (setq element (cdr element)))
+    result))
+
+;; ======================================================================
+;;; Customization
+;; ======================================================================
+(defun newsticker--set-customvar (symbol value)
+  "Set newsticker-variable SYMBOL value to VALUE.
+
+Calls all necessary actions which are necessary in order to make
+the new value effective.  Changing `newsticker-url-list', for example,
+will re-start the retrieval-timers."
+  (unless (condition-case nil
+              (eq (symbol-value symbol) value)
+            (error nil))
+    (set symbol value)
+    (cond ((eq symbol 'newsticker-sort-method)
+           (when (fboundp 'newsticker--cache-sort)
+             (message "Applying new sort method...")
+             (newsticker--cache-sort)
+             (newsticker--buffer-set-uptodate nil)
+             (message "Applying new sort method...done")))
+          ((memq symbol '(newsticker-url-list-defaults
+                          newsticker-url-list
+                          newsticker-retrieval-interval))
+           (when (and (fboundp 'newsticker-running-p)
+                      (newsticker-running-p))
+             (message "Restarting newsticker")
+             (newsticker-stop)
+             (newsticker-start)))
+          ((eq symbol 'newsticker-display-interval)
+           (when (and (fboundp 'newsticker-running-p)
+                      (newsticker-running-p))
+             (message "Restarting ticker")
+             (newsticker-stop-ticker)
+             (newsticker-start-ticker)
+             (message "")))
+          ((memq symbol '(newsticker-hide-old-items-in-echo-area
+                          newsticker-hide-obsolete-items-in-echo-area
+                          newsticker-hide-immortal-items-in-echo-area))
+           (when (and (fboundp 'newsticker-running-p)
+                      (newsticker-running-p))
+             (message "Restarting newsticker")
+             (newsticker-stop-ticker)
+             (newsticker--ticker-text-setup)
+             (newsticker-start-ticker)
+             (message "")))
+          ((memq symbol '(newsticker-hide-old-items-in-newsticker-buffer
+                          newsticker-show-descriptions-of-new-items))
+           (when (fboundp 'newsticker--buffer-set-uptodate)
+             (newsticker--buffer-set-uptodate nil)))
+          ((memq symbol '(newsticker-heading-format
+                          newsticker-item-format
+                          newsticker-desc-format
+                          newsticker-date-format
+                          newsticker-statistics-format
+                          newsticker-justification
+                          newsticker-use-full-width
+                          newsticker-html-renderer
+                          newsticker-feed-face
+                          newsticker-new-item-face
+                          newsticker-old-item-face
+                          newsticker-immortal-item-face
+                          newsticker-obsolete-item-face
+                          newsticker-date-face
+                          newsticker-statistics-face
+                          ;;newsticker-default-face
+                          ))
+           (when (fboundp 'newsticker--forget-preformatted)
+             (newsticker--forget-preformatted)))
+          (t
+           (error "Ooops %s" symbol)))))
+
+;; customization group feed
+(defgroup newsticker-feed nil
+  "Settings for the RSS feeds."
+  :group 'newsticker)
+
+(defcustom newsticker-url-list-defaults
+ '(("Emacs Wiki"
+    "http://www.emacswiki.org/cgi-bin/wiki.pl?action=rss"
+    nil
+    3600))
+  "A customizable list of news feeds to select from.
+These were mostly extracted from the Radio Community Server at
+http://subhonker6.userland.com/rcsPublic/rssHotlist.
+
+You may add other entries in `newsticker-url-list'."
+  :type `(set ,@(mapcar `newsticker--splicer
+                        newsticker--raw-url-list-defaults))
+  :set 'newsticker--set-customvar
+  :group 'newsticker-feed)
+
+(defcustom newsticker-url-list nil
+  "The news feeds which you like to watch.
+
+This alist will be used in addition to selection made customizing
+`newsticker-url-list-defaults'.
+
+This is an alist.  Each element consists of two items: a LABEL and a URL,
+optionally followed by a START-TIME, INTERVAL specifier and WGET-ARGUMENTS.
+
+The LABEL gives the name of the news feed.  It can be an arbitrary string.
+
+The URL gives the location of the news feed.  It must point to a valid
+RSS file.  The RSS file is retrieved by calling wget, or whatever you
+specify as `newsticker-wget-name'.
+
+The START-TIME can be either a string, or nil.  If it is a string it
+specifies a fixed time at which this feed shall be retrieved for the
+first time.  (Examples: \"11:00pm\", \"23:00\").  If it is nil (or
+unspecified), this feed will be retrieved immediately after calling
+`newsticker-start'.
+
+The INTERVAL specifies the time between retrievals for this feed.  If it
+is nil (or unspecified) the default interval value as set in
+`newsticker-retrieval-interval' is used.
+
+\(newsticker.el calls `run-at-time'. The newsticker-parameters START-TIME
+and INTERVAL correspond to the `run-at-time'-parameters TIME and REPEAT.)
+
+WGET-ARGUMENTS specifies arguments for wget (see `newsticker-wget-name')
+which apply for this feed only, overriding the value of
+`newsticker-wget-arguments'."
+  :type '(repeat (list :tag "News feed"
+                       (string :tag "Label")
+                       (string :tag "URI")
+                       (choice :tag "Start"
+                               (const   :tag "Default" nil)
+                               (string  :tag "Fixed Time"))
+                       (choice :tag "Interval"
+                               (const   :tag "Default" nil)
+                               (const   :tag "Hourly" 3600)
+                               (const   :tag "Daily" 86400)
+                               (integer :tag "Interval"))
+                       (choice :tag "Wget Arguments"
+                               (const  :tag "Default arguments" nil)
+                               (repeat :tag "Special arguments" string))))
+  :set 'newsticker--set-customvar
+  :group 'newsticker-feed)
+
+(defcustom newsticker-wget-name
+  "wget"
+  "Name of the program which is called to retrieve news from the web.
+The canonical choice is wget but you may take any other program which is
+able to return the contents of a news feed file on stdout."
+  :type 'string
+  :group 'newsticker-feed)
+
+(defcustom newsticker-wget-arguments
+  '("-q" "-O" "-")
+  "Arguments which are passed to wget.
+There is probably no reason to change the default settings, unless you
+are living behind a firewall."
+  :type '(repeat (string :tag "Argument"))
+  :group 'newsticker-feed)
+
+(defcustom newsticker-retrieval-interval
+  3600
+  "Time interval for retrieving new news items (seconds).
+If this value is not positive (i.e. less than or equal to 0)
+items are retrieved only once!
+Please note that some feeds, e.g. Slashdot, will ban you if you
+make it less than 1800 seconds (30 minutes)!"
+  :type '(choice :tag "Interval"
+                 (const   :tag "No automatic retrieval" 0)
+                 (const   :tag "Hourly" 3600)
+                 (const   :tag "Daily" 86400)
+                 (integer :tag "Interval"))
+  :set 'newsticker--set-customvar
+  :group 'newsticker-feed)
+
+(defcustom newsticker-desc-comp-max
+  100
+  "Relevant length of headline descriptions.
+This value gives the maximum number of characters which will be
+taken into account when newsticker compares two headline
+descriptions."
+  :type 'integer
+  :group 'newsticker-feed)
+
+;; customization group behaviour
+(defgroup newsticker-headline-processing nil
+  "Settings for the automatic processing of RSS headlines."
+  :group 'newsticker)
+
+(defcustom newsticker-automatically-mark-items-as-old
+  t
+  "Decides whether to automatically mark items as old.
+If t a new item is considered as new only after its first retrieval.  As
+soon as it is retrieved a second time, it becomes old.  If not t all
+items stay new until you mark them as old.  This is done in the
+*newsticker* buffer."
+  :type 'boolean
+  :group 'newsticker-headline-processing)
+
+(defcustom newsticker-automatically-mark-visited-items-as-old
+  t
+  "Decides whether to automatically mark visited items as old.
+If t an item is marked as old as soon as the associated link is
+visited, i.e. after pressing RET or mouse2 on the item's
+headline."
+
+  :type 'boolean
+  :group 'newsticker-headline-processing)
+
+(defcustom newsticker-keep-obsolete-items
+  t
+  "Decides whether to keep unread items which have been removed from feed.
+If t a new item, which has been removed from the feed, is kept in
+the cache until it is marked as read."
+  :type 'boolean
+  :group 'newsticker-headline-processing)
+
+(defcustom newsticker-obsolete-item-max-age
+  (* 60 60 24)
+  "Maximal age of obsolete items, in seconds.
+Obsolete items which are older than this value will be silently
+deleted at the next retrieval."
+  :type 'integer
+  :group 'newsticker-headline-processing)
+
+(defcustom newsticker-auto-mark-filter
+  nil
+  "A filter for automatically marking headlines.
+
+This is an alist of the form (FEED-NAME OLD-LIST IMMORTAL-LIST).  I.e. each
+element consists of a FEED-NAME and two lists.  Each list consists a set of
+regular expressions.  The first list contains patterns of headlines which
+will be marked as old.  The second list contains patterns of headlines which
+will be marked as immortal.
+
+This filter is checked after a new headline has been retrieved.  If
+FEED-NAME matches the name of the corresponding news feed, both sublists
+are checked: If the title of the headline matches any of the regular
+expressions in OLD-LIST, this headline is marked as old, if it matches any
+of the expressions in IMMORTAL-LIST it is marked as immortal.
+
+If, for example, `newsticker-auto-mark-filter' looks like
+ \((slashdot (\"^Forget me!$\") (\"^Read me$\" \"important\")))
+then all articles from slashdot are marked as old if they have the title
+\"Forget me!\".  All articles which have the title \"Read me\" and all
+articles which contain the string \"important\" in their title are marked
+as immortal."
+  :type '(repeat (list :tag "Feed filter rule"
+                       (string :tag "Feed name")
+                       ;;(choice ,@(mapcar (lambda (i)
+                         ;;                  (list :tag (car i) (car i)))
+                           ;;              newsticker-url-list))
+                       (repeat :tag "Mark as old" string)
+                       (repeat :tag "Mark as immortal" string)))
+  :group 'newsticker-headline-processing)
+
+;; customization group layout
+(defgroup newsticker-layout nil
+  "Settings for layout of the RSS reader."
+  :group 'newsticker)
+
+(defcustom newsticker-sort-method
+  'sort-by-original-order
+  "Sort method for news items.
+The following sort methods are available:
+* `sort-by-original-order' keeps the order in which the items
+  appear in the RSS file (please note that for immortal items,
+  which have been removed from the news feed, there is no original
+  order),
+* `sort-by-time' looks at the time at which an item has been seen
+  the first time.  The most recent item is put at top,
+* `sort-by-title' will put the items in an alphabetical order."
+  :type '(choice
+          (const :tag "Keep original order" sort-by-original-order)
+          (const :tag "Sort by time"        sort-by-time)
+          (const :tag "Sort by title"       sort-by-title))
+  :set 'newsticker--set-customvar
+  :group 'newsticker-layout)
+
+(defcustom newsticker-hide-old-items-in-newsticker-buffer
+  nil
+  "Decides whether to automatically hide old items in the *newsticker* buffer.
+If set to t old items will be completely folded and only new items
+will show up in the *newsticker* buffer.  Otherwise old as well as new
+items will be visible."
+  :type 'boolean
+  :set 'newsticker--set-customvar
+  :group 'newsticker-layout)
+
+(defcustom newsticker-show-descriptions-of-new-items
+  t
+  "Whether to automatically show descriptions of new items in *newsticker*.
+If set to t old items will be folded and new items will be
+unfolded.  Otherwise old as well as new items will be folded."
+  :type 'boolean
+  :set 'newsticker--set-customvar
+  :group 'newsticker-layout)
+
+(defcustom newsticker-heading-format
+  "%l
+%t %d %s"
+  "Format string for feed headings.
+The following printf-like specifiers can be used:
+%d  The date the feed was retrieved.  See `newsticker-date-format'.
+%l  The logo (image) of the feed.  Most RSS feeds provide a small
+    image as logo.  Newsticker can display them, if Emacs can --
+    see `image-types' for a list of supported image types.
+%L  The logo (image) of the feed.  If the logo is not available
+    the title of the feed is used.
+%s  The statistical data of the feed.  See `newsticker-statistics-format'.
+%t  The title of the feed, i.e. its name."
+  :type 'string
+  :set 'newsticker--set-customvar
+  :group 'newsticker-layout)
+
+(defcustom newsticker-item-format
+  "%t %d"
+  "Format string for news item headlines.
+The following printf-like specifiers can be used:
+%d  The date the item was (first) retrieved.  See `newsticker-date-format'.
+%l  The logo (image) of the feed.  Most RSS feeds provide a small
+    image as logo.  Newsticker can display them, if Emacs can --
+    see `image-types' for a list of supported image types.
+%L  The logo (image) of the feed.  If the logo is not available
+    the title of the feed is used.
+%t  The title of the item."
+  :type 'string
+  :set 'newsticker--set-customvar
+  :group 'newsticker-layout)
+
+(defcustom newsticker-desc-format
+  "%d %c"
+  "Format string for news descriptions (contents).
+The following printf-like specifiers can be used:
+%c  The contents (description) of the item.
+%d  The date the item was (first) retrieved.  See `newsticker-date-format'."
+  :type 'string
+  :set 'newsticker--set-customvar
+  :group 'newsticker-layout)
+
+(defcustom newsticker-date-format
+  "(%A, %H:%M)"
+  "Format for the date part in item and feed lines.
+See `format-time-string' for a list of valid specifiers."
+  :type 'string
+  :set 'newsticker--set-customvar
+  :group 'newsticker-layout)
+
+(defcustom newsticker-statistics-format
+  "[%n + %i + %o + %O = %a]"
+  "Format for the statistics part in feed lines.
+The following printf-like specifiers can be used:
+%a  The number of all items in the feed.
+%i  The number of immortal items in the feed.
+%n  The number of new items in the feed.
+%o  The number of old items in the feed.
+%O  The number of obsolete items in the feed."
+  :type 'string
+  :set 'newsticker--set-customvar
+  :group 'newsticker-layout)
+
+(defcustom newsticker-show-all-rss-elements
+  nil
+  "Show all RSS elements."
+  :type 'boolean
+  ;;:set 'newsticker--set-customvar
+  :group 'newsticker-layout)
+
+;; image related things
+(defcustom newsticker-enable-logo-manipulations
+  t
+  "If non-nil newsticker manipulates logo images.
+This enables the following image properties: heuristic mask for all
+logos, and laplace-conversion for images without new items."
+  :type 'boolean
+  :group 'newsticker-layout)
+
+
+;; rendering
+(defcustom newsticker-justification
+  'left
+  "How to fill item descriptions.
+If non-nil newsticker calls `fill-region' to wrap long lines in
+item descriptions.  However, if an item description contains HTML
+text and `newsticker-html-renderer' is non-nil, filling is not
+done."
+  :type '(choice :tag "Justification"
+                 (const :tag "No filling" nil)
+                 (const :tag "Left"       left)
+                 (const :tag "Right"      right)
+                 (const :tag "Center"     center)
+                 (const :tag "Full"       full))
+  :set 'newsticker--set-customvar
+  :group 'newsticker-layout)
+
+(defcustom newsticker-use-full-width
+  t
+  "Decides whether to use the full window width when filling.
+If non-nil newsticker sets `fill-column' so that the whole
+window is used when filling.  See also `newsticker-justification'."
+  :type 'boolean
+  :set 'newsticker--set-customvar
+  :group 'newsticker-layout)
+
+(defcustom newsticker-html-renderer
+  nil
+  "Function for rendering HTML contents.
+If non-nil, newsticker.el will call this function whenever it finds
+HTML-like tags in item descriptions.  Possible functions are, for
+example, `w3m-region', `w3-region', and (if you have htmlr.el installed)
+`newsticker-htmlr-render'.
+
+In order to make sure that the HTML renderer is loaded when you
+run newsticker, you should add one of the following statements to
+your .emacs.  If you use w3m,
+
+  (autoload 'w3m-region \"w3m\"
+    \"Render region in current buffer and replace with result.\" t)
+
+or, if you use w3,
+
+  (require 'w3-auto)
+
+or, if you use htmlr
+
+  (require 'htmlr)"
+  :type '(choice :tag "Function"
+                 (const :tag "None" nil)
+                 (const :tag "w3" w3-region)
+                 (const :tag "w3m" w3m-region)
+                 (const :tag "htmlr" newsticker-htmlr-render))
+  :set 'newsticker--set-customvar
+  :group 'newsticker-layout)
+
+
+;; faces
+(defgroup newsticker-faces nil
+  "Settings for the faces of the RSS reader."
+  :group 'newsticker-layout)
+
+(defface newsticker-feed-face
+  '((((class color) (background dark))
+     (:family "helvetica" :bold t :height 1.2 :foreground "misty rose"))
+    (((class color) (background light))
+     (:family "helvetica" :bold t :height 1.2 :foreground "black")))
+  "Face for news feeds."
+  :group 'newsticker-faces)
+
+(defface newsticker-new-item-face
+  '((((class color) (background dark))
+     (:family "helvetica" :bold t))
+    (((class color) (background light))
+     (:family "helvetica" :bold t)))
+  "Face for old news items."
+  :group 'newsticker-faces)
+
+(defface newsticker-old-item-face
+  '((((class color) (background dark))
+     (:family "helvetica" :bold t :foreground "orange3"))
+    (((class color) (background light))
+     (:family "helvetica" :bold t :foreground "red4")))
+  "Face for old news items."
+  :group 'newsticker-faces)
+
+(defface newsticker-immortal-item-face
+  '((((class color) (background dark))
+     (:family "helvetica" :bold t :italic t :foreground "orange"))
+    (((class color) (background light))
+     (:family "helvetica" :bold t :italic t :foreground "blue")))
+  "Face for immortal news items."
+  :group 'newsticker-faces)
+
+(defface newsticker-obsolete-item-face
+  '((((class color) (background dark))
+     (:family "helvetica" :bold t :strike-through t))
+    (((class color) (background light))
+     (:family "helvetica" :bold t :strike-through t)))
+  "Face for old news items."
+  :group 'newsticker-faces)
+
+(defface newsticker-date-face
+  '((((class color) (background dark))
+     (:family "helvetica" :italic t :height 0.8))
+    (((class color) (background light))
+     (:family "helvetica" :italic t :height 0.8)))
+  "Face for newsticker dates."
+  :group 'newsticker-faces)
+
+(defface newsticker-statistics-face
+  '((((class color) (background dark))
+     (:family "helvetica" :italic t :height 0.8))
+    (((class color) (background light))
+     (:family "helvetica" :italic t :height 0.8)))
+  "Face for newsticker dates."
+  :group 'newsticker-faces)
+
+(defface newsticker-enclosure-face
+  '((((class color) (background dark))
+     (:bold t :background "orange"))
+    (((class color) (background light))
+     (:bold t :background "orange")))
+  "Face for enclosed elements."
+  :group 'newsticker-faces)
+
+(defface newsticker-extra-face
+  '((((class color) (background dark))
+     (:italic t :foreground "gray50" :height 0.8))
+    (((class color) (background light))
+     (:italic t :foreground "gray50" :height 0.8)))
+  "Face for newsticker dates."
+  :group 'newsticker-faces)
+
+;; (defface newsticker-default-face
+;;   '((((class color) (background dark))
+;;      (:inherit default))
+;;     (((class color) (background light))
+;;      (:inherit default)))
+;;   "Face for the description of news items."
+;;   ;;:set 'newsticker--set-customvar
+;;   :group 'newsticker-faces)
+
+
+;; customization group ticker
+(defgroup newsticker-ticker nil
+  "Settings for the RSS ticker."
+  :group 'newsticker)
+
+(defcustom newsticker-display-interval
+  0.3
+  "Time interval for displaying news items in the echo area (seconds).
+If equal or less than 0 no messages are shown in the echo area.  For
+smooth display (see `newsticker-scroll-smoothly') a value of 0.3 seems
+reasonable.  For non-smooth display a value of 10 is a good starting
+point."
+  :type 'number
+  :set 'newsticker--set-customvar
+  :group 'newsticker-ticker)
+
+(defcustom newsticker-scroll-smoothly
+  t
+  "Decides whether to flash or scroll news items.
+If t the news headlines are scrolled (more-or-less) smoothly in the echo
+area.  If nil one headline after another is displayed in the echo area.
+The variable `newsticker-display-interval' determines how fast this
+display moves/changes and whether headlines are shown in the echo area
+at all.  If you change `newsticker-scroll-smoothly' you should also change
+`newsticker-display-interval'."
+  :type 'boolean
+  :group 'newsticker-ticker)
+
+(defcustom newsticker-hide-immortal-items-in-echo-area
+  t
+  "Decides whether to show immortal/non-expiring news items in the ticker.
+If t the echo area will not show immortal items.  See also
+`newsticker-hide-old-items-in-echo-area."
+  :type 'boolean
+  :set 'newsticker--set-customvar
+  :group 'newsticker-ticker)
+
+(defcustom newsticker-hide-old-items-in-echo-area
+  t
+  "Decides whether to show only the newest news items in the ticker.
+If t the echo area will show only new items, i.e. only items which have
+been added between the last two retrievals."
+  :type 'boolean
+  :set 'newsticker--set-customvar
+  :group 'newsticker-ticker)
+
+(defcustom newsticker-hide-obsolete-items-in-echo-area
+  t
+  "Decides whether to show obsolete items items in the ticker.
+If t the echo area will not show obsolete items.  See also
+`newsticker-hide-old-items-in-echo-area."
+  :type 'boolean
+  :set 'newsticker--set-customvar
+  :group 'newsticker-ticker)
+
+(defgroup newsticker-hooks nil
+  "Settings for newsticker hooks."
+  :group 'newsticker)
+
+(defcustom newsticker-start-hook
+  nil
+  "Hook run when starting newsticker.
+This hook is run at the very end of `newsticker-start'."
+  :options '(newsticker-start-ticker)
+  :type 'hook
+  :group 'newsticker-hooks)
+
+(defcustom newsticker-stop-hook
+  nil
+  "Hook run when stopping newsticker.
+This hook is run at the very end of `newsticker-stop'."
+  :options nil
+  :type 'hook
+  :group 'newsticker-hooks)
+
+(defcustom newsticker-new-item-functions
+  nil
+  "List of functions run after a new headline has been retrieved.
+Each function is called with the following three arguments:
+FEED  the name of the corresponding news feed,
+TITLE the title of the headline,
+DESC  the decoded description of the headline.
+
+See `newsticker-download-images', and
+`newsticker-download-enclosures' for sample functions.
+
+Please note that these functions are called only once for a
+headline after it has been retrieved for the first time."
+  :type 'hook
+  :options '(newsticker-download-images
+             newsticker-download-enclosures)
+  :group 'newsticker-hooks)
+
+(defcustom newsticker-select-item-hook
+  'newsticker--buffer-make-item-completely-visible
+  "List of functions run after a headline has been selected.
+Each function is called after one of `newsticker-next-item',
+`newsticker-next-new-item', `newsticker-previous-item',
+`newsticker-previous-new-item' has been called.
+
+The default value 'newsticker--buffer-make-item-completely-visible
+assures that the current item is always completely visible."
+  :type 'hook
+  :options '(newsticker--buffer-make-item-completely-visible)
+  :group 'newsticker-hooks)
+
+(defcustom newsticker-select-feed-hook
+  'newsticker--buffer-make-item-completely-visible
+  "List of functions run after a feed has been selected.
+Each function is called after one of `newsticker-next-feed', and
+`newsticker-previous-feed' has been called.
+
+The default value 'newsticker--buffer-make-item-completely-visible
+assures that the current feed is completely visible."
+  :type 'hook
+  :options '(newsticker--buffer-make-item-completely-visible)
+  :group 'newsticker-hooks)
+
+(defcustom newsticker-buffer-change-hook
+  'newsticker-w3m-show-inline-images
+  "List of functions run after the newsticker buffer has been updated.
+Each function is called after `newsticker-buffer-update' has been called.
+
+The default value '`newsticker-w3m-show-inline-images' loads inline
+images."
+  :type 'hook
+  :group 'newsticker-hooks)
+
+(defcustom newsticker-narrow-hook
+  'newsticker-w3m-show-inline-images
+  "List of functions run after narrowing in newsticker buffer has changed.
+Each function is called after
+`newsticker-toggle-auto-narrow-to-feed' or
+`newsticker-toggle-auto-narrow-to-item' has been called.
+
+The default value '`newsticker-w3m-show-inline-images' loads inline
+images."
+  :type 'hook
+  :group 'newsticker-hooks)
+
+(defgroup newsticker-miscellaneous nil
+  "Miscellaneous newsticker settings."
+  :group 'newsticker)
+
+(defcustom newsticker-cache-filename
+  "~/.newsticker-cache"
+  "Name of the newsticker cache file."
+  :type 'string
+  :group 'newsticker-miscellaneous)
+
+(defcustom newsticker-imagecache-dirname
+  "~/.newsticker-images"
+  "Name of the directory where newsticker stores cached images."
+  :type 'string
+  :group 'newsticker-miscellaneous)
+
+;; debugging
+(defcustom newsticker-debug
+  nil
+  "Enables some features needed for debugging newsticker.el.
+
+If set to t newsticker.el will print lots of debugging messages, and the
+buffers *newsticker-wget-<feed>* will not be closed."
+  :type 'boolean
+  ;;:set 'newsticker--set-customvar
+  :group 'newsticker-miscellaneous)
+
+;; ======================================================================
+;;; Compatibility section, XEmacs, Emacs
+;; ======================================================================
+(unless (fboundp 'time-add)
+  (require 'time-date);;FIXME
+  (defun time-add (t1 t2)
+    (seconds-to-time (+ (time-to-seconds t1) (time-to-seconds t2)))))
+
+(unless (fboundp 'match-string-no-properties)
+  (defalias 'match-string-no-properties 'match-string))
+
+(unless (fboundp 'replace-regexp-in-string)
+  (defun replace-regexp-in-string (re rp st)
+    (save-match-data ;; apparently XEmacs needs save-match-data
+      (replace-in-string st re rp))))
+
+;; copied from subr.el
+(unless (fboundp 'add-to-invisibility-spec)
+  (defun add-to-invisibility-spec (arg)
+    "Add elements to `buffer-invisibility-spec'.
+See documentation for `buffer-invisibility-spec' for the kind of elements
+that can be added."
+    (if (eq buffer-invisibility-spec t)
+        (setq buffer-invisibility-spec (list t)))
+    (setq buffer-invisibility-spec
+          (cons arg buffer-invisibility-spec))))
+
+;; copied from subr.el
+(unless (fboundp 'remove-from-invisibility-spec)
+  (defun remove-from-invisibility-spec (arg)
+    "Remove elements from `buffer-invisibility-spec'."
+    (if (consp buffer-invisibility-spec)
+        (setq buffer-invisibility-spec (delete arg buffer-invisibility-spec)))))
+
+;; ======================================================================
+;;; Internal variables
+;; ======================================================================
+(defvar newsticker--display-timer nil
+  "Timer for newsticker display.")
+(defvar newsticker--retrieval-timer-list nil
+  "List of timers for news retrieval.
+This is an alist, each element consisting of (feed-name . timer)")
+(defvar newsticker--item-list nil
+  "List of newsticker items.")
+(defvar newsticker--item-position 0
+  "Actual position in list of newsticker items.")
+(defvar newsticker--prev-message "There was no previous message yet!"
+  "Last message that the newsticker displayed.")
+(defvar newsticker--scrollable-text ""
+  "The text which is scrolled smoothly in the echo area.")
+(defvar newsticker--buffer-uptodate-p nil
+  "Tells whether the newsticker buffer is up to date.")
+(defvar newsticker--latest-update-time (current-time)
+  "The time at which the latest news arrived.")
+
+(defvar newsticker--cache nil "Cached newsticker data.
+This is a list of the form
+
+ ((label1
+   (title description link time age index preformatted-contents
+    preformatted-title)
+   ...)
+  (label2
+   (title description link time age index preformatted-contents
+    preformatted-title)
+   ...)
+  ...)
+
+where LABEL is a symbol.  TITLE, DESCRIPTION, and LINK are
+strings.  TIME is a time value as returned by `current-time'.
+AGE is a symbol: 'new, 'old, 'immortal, and 'obsolete denote
+ordinary news items, whereas 'feed denotes an item which is not a
+headline but describes the feed itself.  INDEX denotes the
+original position of the item -- used for restoring the original
+order.  PREFORMATTED-CONTENTS and PREFORMATTED-TITLE hold the
+formatted contents of the item's description and title.  This
+speeds things up if HTML rendering is used, which is rather
+slow.")
+
+(defvar newsticker--auto-narrow-to-feed nil
+  "Automatically narrow to current news feed.
+If non-nil only the items of the current news feed are visible.")
+
+(defvar newsticker--auto-narrow-to-item nil
+  "Automatically narrow to current news item.
+If non-nil only the current headline is visible.")
+
+(defconst newsticker--error-headline
+  "[COULD NOT DOWNLOAD HEADLINES!]"
+  "Title of error headline which will be inserted if news retrieval fails.")
+
+;; ======================================================================
+;;; Toolbar
+;; ======================================================================
+(defconst newsticker--next-item-image
+  (if (fboundp 'create-image)
+      (create-image "/* XPM */
+static char * next_xpm[] = {
+\"24 24 42 1\",
+\" 	c None\",
+\".	c #000000\",
+\"+	c #7EB6DE\",
+\"@	c #82BBE2\",
+\"#	c #85BEE4\",
+\"$	c #88C1E7\",
+\"%	c #8AC3E8\",
+\"&	c #87C1E6\",
+\"*	c #8AC4E9\",
+\"=	c #8CC6EA\",
+\"-	c #8CC6EB\",
+\";	c #88C2E7\",
+\">	c #8BC5E9\",
+\",	c #8DC7EB\",
+\"'	c #87C0E6\",
+\")	c #8AC4E8\",
+\"!	c #8BC5EA\",
+\"~	c #8BC4E9\",
+\"{	c #88C1E6\",
+\"]	c #89C3E8\",
+\"^	c #86BFE5\",
+\"/	c #83BBE2\",
+\"(	c #82BBE1\",
+\"_	c #86C0E5\",
+\":	c #87C0E5\",
+\"<	c #83BCE2\",
+\"[	c #81B9E0\",
+\"}	c #81BAE1\",
+\"|	c #78B0D9\",
+\"1	c #7BB3DB\",
+\"2	c #7DB5DD\",
+\"3	c #7DB6DD\",
+\"4	c #72A9D4\",
+\"5	c #75ACD6\",
+\"6	c #76AED7\",
+\"7	c #77AFD8\",
+\"8	c #6BA1CD\",
+\"9	c #6EA4CF\",
+\"0	c #6FA6D1\",
+\"a	c #6298C6\",
+\"b	c #659BC8\",
+\"c	c #5C91C0\",
+\"                        \",
+\"                        \",
+\"       .                \",
+\"       ..               \",
+\"       .+.              \",
+\"       .@#.             \",
+\"       .#$%.            \",
+\"       .&*=-.           \",
+\"       .;>,,,.          \",
+\"       .;>,,,=.         \",
+\"       .')!==~;.        \",
+\"       .#{]*%;^/.       \",
+\"       .(#_':#<.        \",
+\"       .+[@</}.         \",
+\"       .|1232.          \",
+\"       .4567.           \",
+\"       .890.            \",
+\"       .ab.             \",
+\"       .c.              \",
+\"       ..               \",
+\"       .                \",
+\"                        \",
+\"                        \",
+\"                        \"};
+"
+                 'xpm t)
+   "Image for the next item button."))
+
+(defconst newsticker--previous-item-image
+  (if (fboundp 'create-image)
+      (create-image "/* XPM */
+static char * previous_xpm[] = {
+\"24 24 39 1\",
+\" 	c None\",
+\".	c #000000\",
+\"+	c #7BB3DB\",
+\"@	c #83BCE2\",
+\"#	c #7FB8DF\",
+\"$	c #89C2E7\",
+\"%	c #86BFE5\",
+\"&	c #83BBE2\",
+\"*	c #8CC6EA\",
+\"=	c #8BC4E9\",
+\"-	c #88C2E7\",
+\";	c #85BEE4\",
+\">	c #8DC7EB\",
+\",	c #89C3E8\",
+\"'	c #8AC4E8\",
+\")	c #8BC5EA\",
+\"!	c #88C1E6\",
+\"~	c #8AC4E9\",
+\"{	c #8AC3E8\",
+\"]	c #86C0E5\",
+\"^	c #87C0E6\",
+\"/	c #87C0E5\",
+\"(	c #82BBE2\",
+\"_	c #81BAE1\",
+\":	c #7FB7DF\",
+\"<	c #7DB6DD\",
+\"[	c #7DB5DD\",
+\"}	c #7CB4DC\",
+\"|	c #79B1DA\",
+\"1	c #76ADD7\",
+\"2	c #77AFD8\",
+\"3	c #73AAD4\",
+\"4	c #70A7D1\",
+\"5	c #6EA5D0\",
+\"6	c #6CA2CE\",
+\"7	c #689ECB\",
+\"8	c #6399C7\",
+\"9	c #6095C4\",
+\"0	c #5C90C0\",
+\"                        \",
+\"                        \",
+\"                .       \",
+\"               ..       \",
+\"              .+.       \",
+\"             .@#.       \",
+\"            .$%&.       \",
+\"           .*=-;.       \",
+\"          .>>*,%.       \",
+\"         .>>>*,%.       \",
+\"        .')**=-;.       \",
+\"       .;!,~{-%&.       \",
+\"        .;]^/;@#.       \",
+\"         .(@&_:+.       \",
+\"          .<[}|1.       \",
+\"           .2134.       \",
+\"            .567.       \",
+\"             .89.       \",
+\"              .0.       \",
+\"               ..       \",
+\"                .       \",
+\"                        \",
+\"                        \",
+\"                        \"};
+"
+                 'xpm t)
+   "Image for the previous item button."))
+
+(defconst newsticker--previous-feed-image
+  (if (fboundp 'create-image)
+      (create-image "/* XPM */
+static char * prev_feed_xpm[] = {
+\"24 24 52 1\",
+\" 	c None\",
+\".	c #000000\",
+\"+	c #70A7D2\",
+\"@	c #75ADD6\",
+\"#	c #71A8D3\",
+\"$	c #79B1DA\",
+\"%	c #7BB3DB\",
+\"&	c #7DB5DD\",
+\"*	c #83BBE2\",
+\"=	c #7EB6DE\",
+\"-	c #78B0D9\",
+\";	c #7FB7DE\",
+\">	c #88C2E7\",
+\",	c #85BEE4\",
+\"'	c #80B9E0\",
+\")	c #80B8DF\",
+\"!	c #8CC6EA\",
+\"~	c #89C3E8\",
+\"{	c #86BFE5\",
+\"]	c #81BAE1\",
+\"^	c #7CB4DC\",
+\"/	c #7FB8DF\",
+\"(	c #8DC7EB\",
+\"_	c #7BB3DC\",
+\":	c #7EB7DE\",
+\"<	c #8BC4E9\",
+\"[	c #8AC4E9\",
+\"}	c #8AC3E8\",
+\"|	c #87C0E6\",
+\"1	c #87C0E5\",
+\"2	c #83BCE2\",
+\"3	c #75ACD6\",
+\"4	c #7FB7DF\",
+\"5	c #77AED8\",
+\"6	c #71A8D2\",
+\"7	c #70A7D1\",
+\"8	c #76ADD7\",
+\"9	c #6CA2CE\",
+\"0	c #699FCC\",
+\"a	c #73AAD4\",
+\"b	c #6BA1CD\",
+\"c	c #669CC9\",
+\"d	c #6298C5\",
+\"e	c #689ECB\",
+\"f	c #6499C7\",
+\"g	c #6095C3\",
+\"h	c #5C91C0\",
+\"i	c #5E93C2\",
+\"j	c #5B90C0\",
+\"k	c #588CBC\",
+\"l	c #578CBC\",
+\"m	c #5589BA\",
+\"                        \",
+\"                        \",
+\"     ...          .     \",
+\"     .+.         ..     \",
+\"     .@.        .#.     \",
+\"     .$.       .%@.     \",
+\"     .&.      .*=-.     \",
+\"     .;.     .>,'%.     \",
+\"     .).    .!~{]^.     \",
+\"     ./.   .(!~{]_.     \",
+\"     .:.  .!!<>,'%.     \",
+\"     .&. .~[}>{*=-.     \",
+\"     .$.  .|1,2/%@.     \",
+\"     .3.   .*]4%56.     \",
+\"     .7.    .^$8#9.     \",
+\"     .0.     .a7bc.     \",
+\"     .d.      .efg.     \",
+\"     .h.       .ij.     \",
+\"     .k.        .l.     \",
+\"     .m.         ..     \",
+\"     ...          .     \",
+\"                        \",
+\"                        \",
+\"                        \"};
+"
+                 'xpm t)
+   "Image for the previous feed button."))
+
+(defconst newsticker--next-feed-image
+  (if (fboundp 'create-image)
+      (create-image "/* XPM */
+static char * next_feed_xpm[] = {
+\"24 24 57 1\",
+\" 	c None\",
+\".	c #000000\",
+\"+	c #6CA2CE\",
+\"@	c #75ADD6\",
+\"#	c #71A8D3\",
+\"$	c #79B1DA\",
+\"%	c #7EB7DE\",
+\"&	c #7DB5DD\",
+\"*	c #81BAE1\",
+\"=	c #85BEE4\",
+\"-	c #78B0D9\",
+\";	c #7FB7DE\",
+\">	c #83BCE3\",
+\",	c #87C1E6\",
+\"'	c #8AC4E9\",
+\")	c #7BB3DB\",
+\"!	c #80B8DF\",
+\"~	c #88C2E7\",
+\"{	c #8BC5E9\",
+\"]	c #8DC7EB\",
+\"^	c #7CB4DC\",
+\"/	c #7FB8DF\",
+\"(	c #84BDE3\",
+\"_	c #7BB3DC\",
+\":	c #83BCE2\",
+\"<	c #87C0E6\",
+\"[	c #8AC4E8\",
+\"}	c #8BC5EA\",
+\"|	c #8CC6EA\",
+\"1	c #88C1E6\",
+\"2	c #89C3E8\",
+\"3	c #8AC3E8\",
+\"4	c #7EB6DE\",
+\"5	c #82BBE1\",
+\"6	c #86C0E5\",
+\"7	c #87C0E5\",
+\"8	c #75ACD6\",
+\"9	c #7AB2DA\",
+\"0	c #81B9E0\",
+\"a	c #82BBE2\",
+\"b	c #71A8D2\",
+\"c	c #70A7D1\",
+\"d	c #74ACD6\",
+\"e	c #699FCC\",
+\"f	c #6EA5D0\",
+\"g	c #72A9D4\",
+\"h	c #669CC9\",
+\"i	c #6298C5\",
+\"j	c #679DCA\",
+\"k	c #6BA1CD\",
+\"l	c #6095C3\",
+\"m	c #5C91C0\",
+\"n	c #5F94C2\",
+\"o	c #5B90C0\",
+\"p	c #588CBC\",
+\"q	c #578CBC\",
+\"r	c #5589BA\",
+\"                        \",
+\"                        \",
+\"     .          ...     \",
+\"     ..         .+.     \",
+\"     .@.        .#.     \",
+\"     .$%.       .@.     \",
+\"     .&*=.      .-.     \",
+\"     .;>,'.     .).     \",
+\"     .!=~{].    .^.     \",
+\"     ./(~{]].   ._.     \",
+\"     .%:<[}||.  .).     \",
+\"     .&*=12'3~. .-.     \",
+\"     .$45=6<7.  .@.     \",
+\"     .8940a:.   .b.     \",
+\"     .cd-)&.    .+.     \",
+\"     .efg8.     .h.     \",
+\"     .ijk.      .l.     \",
+\"     .mn.       .o.     \",
+\"     .p.        .q.     \",
+\"     ..         .r.     \",
+\"     .          ...     \",
+\"                        \",
+\"                        \",
+\"                        \"};
+"
+                 'xpm t)
+   "Image for the next feed button."))
+
+(defconst newsticker--mark-read-image
+  (if (fboundp 'create-image)
+      (create-image "/* XPM */
+static char * mark_read_xpm[] = {
+\"24 24 44 1\",
+\" 	c None\",
+\".	c #C20000\",
+\"+	c #BE0000\",
+\"@	c #C70000\",
+\"#	c #CE0000\",
+\"$	c #C90000\",
+\"%	c #BD0000\",
+\"&	c #CB0000\",
+\"*	c #D10000\",
+\"=	c #D70000\",
+\"-	c #D30000\",
+\";	c #CD0000\",
+\">	c #C60000\",
+\",	c #D40000\",
+\"'	c #DA0000\",
+\")	c #DE0000\",
+\"!	c #DB0000\",
+\"~	c #D60000\",
+\"{	c #D00000\",
+\"]	c #DC0000\",
+\"^	c #E00000\",
+\"/	c #E40000\",
+\"(	c #E10000\",
+\"_	c #DD0000\",
+\":	c #D80000\",
+\"<	c #E50000\",
+\"[	c #E70000\",
+\"}	c #E60000\",
+\"|	c #E20000\",
+\"1	c #E90000\",
+\"2	c #E80000\",
+\"3	c #E30000\",
+\"4	c #DF0000\",
+\"5	c #D90000\",
+\"6	c #CC0000\",
+\"7	c #C10000\",
+\"8	c #C30000\",
+\"9	c #BF0000\",
+\"0	c #B90000\",
+\"a	c #BC0000\",
+\"b	c #BB0000\",
+\"c	c #B80000\",
+\"d	c #B50000\",
+\"e	c #B70000\",
+\"                        \",
+\"                        \",
+\"                        \",
+\"    .              +    \",
+\"   +@#            $.%   \",
+\"    &*=          -;>    \",
+\"     ,')        !~{     \",
+\"      ]^/      (_:      \",
+\"       (<[    }|)       \",
+\"        <[1  2<|        \",
+\"         }222[<         \",
+\"          }}}<          \",
+\"          333|          \",
+\"         _4^4)]         \",
+\"        ~:'  5=-        \",
+\"       6{-    *#$       \",
+\"      7>$      @89      \",
+\"     0a+        %bc     \",
+\"    ddc          edd    \",
+\"   ddd            ddd   \",
+\"    d              d    \",
+\"                        \",
+\"                        \",
+\"                        \"};
+"
+                 'xpm t)
+   "Image for the next feed button."))
+
+(defconst newsticker--mark-immortal-image
+  (if (fboundp 'create-image)
+      (create-image "/* XPM */
+static char * mark_immortal_xpm[] = {
+\"24 24 93 2\",
+\"  	c None\",
+\". 	c #171717\",
+\"+ 	c #030303\",
+\"@ 	c #000000\",
+\"# 	c #181818\",
+\"$ 	c #090909\",
+\"% 	c #FFC960\",
+\"& 	c #FFCB61\",
+\"* 	c #FFCB62\",
+\"= 	c #FFC961\",
+\"- 	c #FFC75F\",
+\"; 	c #FFC65E\",
+\"> 	c #FFCA61\",
+\", 	c #FFCD63\",
+\"' 	c #FFCF65\",
+\") 	c #FFD065\",
+\"! 	c #FFCE64\",
+\"~ 	c #FFC35C\",
+\"{ 	c #FFC45D\",
+\"] 	c #FFD166\",
+\"^ 	c #FFD267\",
+\"/ 	c #FFD368\",
+\"( 	c #FFD167\",
+\"_ 	c #FFC05A\",
+\": 	c #010101\",
+\"< 	c #040404\",
+\"[ 	c #FFCC62\",
+\"} 	c #FFD569\",
+\"| 	c #FFD56A\",
+\"1 	c #FFC860\",
+\"2 	c #FFC25B\",
+\"3 	c #FFBB56\",
+\"4 	c #020202\",
+\"5 	c #060606\",
+\"6 	c #FFC15B\",
+\"7 	c #FFC85F\",
+\"8 	c #FFD469\",
+\"9 	c #FFD66A\",
+\"0 	c #FFBC57\",
+\"a 	c #1B1B1B\",
+\"b 	c #070707\",
+\"c 	c #FFBA55\",
+\"d 	c #FFB451\",
+\"e 	c #FFB954\",
+\"f 	c #FFB350\",
+\"g 	c #FFB652\",
+\"h 	c #FFBE58\",
+\"i 	c #FFCD64\",
+\"j 	c #FFD066\",
+\"k 	c #FFC059\",
+\"l 	c #FFB14E\",
+\"m 	c #0B0B0B\",
+\"n 	c #FFBB55\",
+\"o 	c #FFC15A\",
+\"p 	c #FFB552\",
+\"q 	c #FFAD4B\",
+\"r 	c #080808\",
+\"s 	c #FFAF4C\",
+\"t 	c #FFB853\",
+\"u 	c #FFA948\",
+\"v 	c #050505\",
+\"w 	c #FFB04E\",
+\"x 	c #FFB753\",
+\"y 	c #FFBC56\",
+\"z 	c #FFC55D\",
+\"A 	c #FFC55E\",
+\"B 	c #FFC45C\",
+\"C 	c #FFBD57\",
+\"D 	c #FFB854\",
+\"E 	c #FFB34F\",
+\"F 	c #FFAB4A\",
+\"G 	c #FFA545\",
+\"H 	c #FFAA49\",
+\"I 	c #FFB04D\",
+\"J 	c #FFB551\",
+\"K 	c #FFBF58\",
+\"L 	c #FFB24F\",
+\"M 	c #FFAC4A\",
+\"N 	c #FFA646\",
+\"O 	c #FFA344\",
+\"P 	c #FFA848\",
+\"Q 	c #FFB14F\",
+\"R 	c #FFAF4D\",
+\"S 	c #FFA546\",
+\"T 	c #FFA243\",
+\"U 	c #FFA445\",
+\"V 	c #FFAE4C\",
+\"W 	c #FFA444\",
+\"X 	c #FFA142\",
+\"Y 	c #FF9F41\",
+\"Z 	c #0A0A0A\",
+\"` 	c #FF9E40\",
+\" .	c #FF9F40\",
+\"                                                \",
+\"                                                \",
+\"                                                \",
+\"                  . + @ @ + #                   \",
+\"              $ @ % & * * = - + +               \",
+\"            @ ; > , ' ) ' ! * - ~ @             \",
+\"          @ { > ! ] ^ / / ( ' * ; _ :           \",
+\"        < _ ; [ ) / } | } / ] , 1 2 3 4         \",
+\"        5 6 7 , ] 8 9 9 9 } ^ ! = ~ 0 a         \",
+\"      b c 6 - , ] 8 9 9 9 } ^ ! % ~ 0 d 5       \",
+\"      : e _ ; * ) / 8 } } / ] , 1 2 3 f 5       \",
+\"      : g h { = i j ^ / ^ ] ! * ; k e l m       \",
+\"      : f n o ; > , ' ) ' ! * - 2 0 p q r       \",
+\"      : s g 0 6 ; % > * * = - ~ h t l u r       \",
+\"      v u w x y k ~ z A z B o C D E F G b       \",
+\"        5 H I J e 0 h K h C c x L M N .         \",
+\"        4 O P q Q d g x g J L R H S T <         \",
+\"          @ T U P F q V q M H N W X +           \",
+\"            @ Y T O W G G W O X Y @             \",
+\"              4 Z ` Y Y Y  .` 4 4               \",
+\"                  5 : : @ @ Z                   \",
+\"                                                \",
+\"                                                \",
+\"                                                \"};
+"
+                 'xpm t)
+   "Image for the next feed button."))
+
+
+(defconst newsticker--narrow-image
+  (if (fboundp 'create-image)
+      (create-image "/* XPM */
+static char * narrow_xpm[] = {
+\"24 24 48 1\",
+\" 	c None\",
+\".	c #000000\",
+\"+	c #969696\",
+\"@	c #9E9E9E\",
+\"#	c #A4A4A4\",
+\"$	c #AAAAAA\",
+\"%	c #AEAEAE\",
+\"&	c #B1B1B1\",
+\"*	c #B3B3B3\",
+\"=	c #B4B4B4\",
+\"-	c #B2B2B2\",
+\";	c #AFAFAF\",
+\">	c #ABABAB\",
+\",	c #A6A6A6\",
+\"'	c #A0A0A0\",
+\")	c #989898\",
+\"!	c #909090\",
+\"~	c #73AAD4\",
+\"{	c #7AB2DA\",
+\"]	c #7FB8DF\",
+\"^	c #84BDE3\",
+\"/	c #88C2E7\",
+\"(	c #8BC5E9\",
+\"_	c #8DC7EB\",
+\":	c #8CC6EA\",
+\"<	c #89C3E8\",
+\"[	c #86BFE5\",
+\"}	c #81BAE1\",
+\"|	c #7BB3DC\",
+\"1	c #75ACD6\",
+\"2	c #6DA4CF\",
+\"3	c #979797\",
+\"4	c #A3A3A3\",
+\"5	c #A8A8A8\",
+\"6	c #ADADAD\",
+\"7	c #ACACAC\",
+\"8	c #A9A9A9\",
+\"9	c #A5A5A5\",
+\"0	c #9A9A9A\",
+\"a	c #929292\",
+\"b	c #8C8C8C\",
+\"c	c #808080\",
+\"d	c #818181\",
+\"e	c #838383\",
+\"f	c #848484\",
+\"g	c #858585\",
+\"h	c #868686\",
+\"i	c #828282\",
+\"                        \",
+\"                        \",
+\"                        \",
+\"   ..................   \",
+\"   .+@#$%&*=*-;>,')!.   \",
+\"   ..................   \",
+\"                        \",
+\"                        \",
+\"   ..................   \",
+\"   .~{]^/(___:<[}|12.   \",
+\"   ..................   \",
+\"                        \",
+\"                        \",
+\"   ..................   \",
+\"   .!3@45>666789'0ab.   \",
+\"   ..................   \",
+\"                        \",
+\"                        \",
+\"   ..................   \",
+\"   .cccdefghhgficccc.   \",
+\"   ..................   \",
+\"                        \",
+\"                        \",
+\"                        \"};
+"
+                 'xpm t)
+   "Image for the next feed button."))
+
+(defconst newsticker--get-all-image
+  (if (fboundp 'create-image)
+      (create-image "/* XPM */
+static char * get_all_xpm[] = {
+\"24 24 70 1\",
+\" 	c None\",
+\".	c #000000\",
+\"+	c #F3DA00\",
+\"@	c #F5DF00\",
+\"#	c #F7E300\",
+\"$	c #F9E700\",
+\"%	c #FAEA00\",
+\"&	c #FBEC00\",
+\"*	c #FBED00\",
+\"=	c #FCEE00\",
+\"-	c #FAEB00\",
+\";	c #F9E800\",
+\">	c #F8E500\",
+\",	c #F6E000\",
+\"'	c #F4DB00\",
+\")	c #F1D500\",
+\"!	c #EFD000\",
+\"~	c #B7CA00\",
+\"{	c #BFD100\",
+\"]	c #C5D700\",
+\"^	c #CBDB00\",
+\"/	c #CFDF00\",
+\"(	c #D2E200\",
+\"_	c #D4E400\",
+\":	c #D3E300\",
+\"<	c #D0E000\",
+\"[	c #CCDD00\",
+\"}	c #C7D800\",
+\"|	c #C1D300\",
+\"1	c #BACC00\",
+\"2	c #B1C500\",
+\"3	c #A8BC00\",
+\"4	c #20A900\",
+\"5	c #22AF00\",
+\"6	c #24B500\",
+\"7	c #26B900\",
+\"8	c #27BC00\",
+\"9	c #27BE00\",
+\"0	c #28BF00\",
+\"a	c #27BD00\",
+\"b	c #26BA00\",
+\"c	c #25B600\",
+\"d	c #23B100\",
+\"e	c #21AB00\",
+\"f	c #1FA400\",
+\"g	c #1C9B00\",
+\"h	c #21AA00\",
+\"i	c #24B300\",
+\"j	c #25B800\",
+\"k	c #25B700\",
+\"l	c #24B400\",
+\"m	c #23B000\",
+\"n	c #1FA500\",
+\"o	c #1D9E00\",
+\"p	c #20A800\",
+\"q	c #21AC00\",
+\"r	c #23B200\",
+\"s	c #22AD00\",
+\"t	c #1D9F00\",
+\"u	c #20A700\",
+\"v	c #1EA100\",
+\"w	c #1C9C00\",
+\"x	c #1DA000\",
+\"y	c #1B9800\",
+\"z	c #1A9600\",
+\"A	c #1A9700\",
+\"B	c #1A9500\",
+\"C	c #199200\",
+\"D	c #189100\",
+\"E	c #178C00\",
+\"                        \",
+\"                        \",
+\"                        \",
+\"                        \",
+\"   ...................  \",
+\"   .+@#$%&*=*&-;>,')!.  \",
+\"   ...................  \",
+\"                        \",
+\"   ...................  \",
+\"   .~{]^/(___:<[}|123.  \",
+\"   ...................  \",
+\"                        \",
+\"   ...................  \",
+\"    .45678909abcdefg.   \",
+\"     .h5icj7jklmeno.    \",
+\"      .pq5drrmshft.     \",
+\"       .fu4h4pnvw.      \",
+\"        .oxvxtwy.       \",
+\"         .zAAzB.        \",
+\"          .CCD.         \",
+\"           .E.          \",
+\"            .           \",
+\"                        \",
+\"                        \"};
+"
+                 'xpm t)
+   "Image for the next feed button."))
+
+
+(defconst newsticker--update-image
+  (if (fboundp 'create-image)
+      (create-image "/* XPM */
+static char * update_xpm[] = {
+\"24 24 37 1\",
+\" 	c None\",
+\".	c #076D00\",
+\"+	c #0A8600\",
+\"@	c #0A8800\",
+\"#	c #098400\",
+\"$	c #087200\",
+\"%	c #087900\",
+\"&	c #098500\",
+\"*	c #098100\",
+\"=	c #087600\",
+\"-	c #097E00\",
+\";	c #097F00\",
+\">	c #0A8700\",
+\",	c #0A8C00\",
+\"'	c #097C00\",
+\")	c #098300\",
+\"!	c #0A8900\",
+\"~	c #0A8E00\",
+\"{	c #0B9200\",
+\"]	c #087700\",
+\"^	c #076E00\",
+\"/	c #076C00\",
+\"(	c #076B00\",
+\"_	c #076A00\",
+\":	c #076900\",
+\"<	c #076800\",
+\"[	c #066700\",
+\"}	c #066500\",
+\"|	c #066400\",
+\"1	c #066300\",
+\"2	c #066600\",
+\"3	c #066200\",
+\"4	c #076700\",
+\"5	c #065E00\",
+\"6	c #066100\",
+\"7	c #065F00\",
+\"8	c #066000\",
+\"                        \",
+\"                        \",
+\"                        \",
+\"    .    +@@@+#         \",
+\"    $% &@      +*       \",
+\"    =-#          ;      \",
+\"    %*>,          '     \",
+\"    ')!~{          =    \",
+\"                   ]$   \",
+\"   ^                ^   \",
+\"   .                .   \",
+\"   /                (   \",
+\"   _                :   \",
+\"   <                [   \",
+\"   }                |   \",
+\"   [[                   \",
+\"    1          $.:23    \",
+\"     3          4}35    \",
+\"      6          655    \",
+\"       76      85 55    \",
+\"        5555555    5    \",
+\"                        \",
+\"                        \",
+\"                        \"};
+"
+                 'xpm t)
+   "Image for the update button."))
+
+(defconst newsticker--browse-image
+  (if (fboundp 'create-image)
+      (create-image "/* XPM */
+static char * visit_xpm[] = {
+\"24 24 39 1\",
+\" 	c None\",
+\".	c #000000\",
+\"+	c #FFFFFF\",
+\"@	c #00E63D\",
+\"#	c #00E83E\",
+\"$	c #00E73D\",
+\"%	c #00E93E\",
+\"&	c #00E63C\",
+\"*	c #00E53C\",
+\"=	c #00E23B\",
+\"-	c #00E33B\",
+\";	c #00E83D\",
+\">	c #00E13A\",
+\",	c #00DD38\",
+\"'	c #00DE38\",
+\")	c #00E23A\",
+\"!	c #00E43C\",
+\"~	c #00DF39\",
+\"{	c #00DB37\",
+\"]	c #00D634\",
+\"^	c #00D734\",
+\"/	c #00E039\",
+\"(	c #00DC37\",
+\"_	c #00D835\",
+\":	c #00D332\",
+\"<	c #00CD2F\",
+\"[	c #00DB36\",
+\"}	c #00D433\",
+\"|	c #00CF30\",
+\"1	c #00DA36\",
+\"2	c #00D936\",
+\"3	c #00D533\",
+\"4	c #00D131\",
+\"5	c #00CE2F\",
+\"6	c #00CC2F\",
+\"7	c #00CA2D\",
+\"8	c #00C62B\",
+\"9	c #00C52A\",
+\"0	c #00BE27\",
+\"                        \",
+\"                        \",
+\"            .           \",
+\"           .+.          \",
+\"          .+++.         \",
+\"         .++.++.        \",
+\"        .++.@.++.       \",
+\"       .++.##$.++.      \",
+\"      .++.%%%#&.++.     \",
+\"     .++.$%%%#*=.++.    \",
+\"    .++.-@;##$*>,.++.   \",
+\"   .++.')!&@@*=~{].++.  \",
+\"  .++.^{~>---)/(_:<.++. \",
+\"   .++.^[,~/~'(_}|.++.  \",
+\"    .++.]_1[12^:|.++.   \",
+\"     .++.:}33:45.++.    \",
+\"      .++.<5567.++.     \",
+\"       .++.889.++.      \",
+\"        .++.0.++.       \",
+\"         .++.++.        \",
+\"          .+++.         \",
+\"           .+.          \",
+\"            .           \",
+\"                        \"};
+"
+                 'xpm t)
+   "Image for the browse button."))
+
+
+(defvar newsticker-tool-bar-map
+  (if (featurep 'xemacs)
+      nil
+    (let ((tool-bar-map (make-sparse-keymap)))
+      (define-key tool-bar-map [newsticker-sep-1]
+        (list 'menu-item "--double-line"))
+      (define-key tool-bar-map [newsticker-browse-url]
+        (list 'menu-item "newsticker-browse-url" 'newsticker-browse-url
+              :visible t
+              :help "Browse URL for item at point"
+              :image newsticker--browse-image))
+      (define-key tool-bar-map [newsticker-buffer-force-update]
+        (list 'menu-item "newsticker-buffer-force-update"
+              'newsticker-buffer-force-update
+              :visible t
+              :help "Update newsticker buffer"
+              :image newsticker--update-image
+              :enable '(not newsticker--buffer-uptodate-p)))
+      (define-key tool-bar-map [newsticker-get-all-news]
+        (list 'menu-item "newsticker-get-all-news" 'newsticker-get-all-news
+              :visible t
+              :help "Get news for all feeds"
+              :image newsticker--get-all-image))
+      (define-key tool-bar-map [newsticker-mark-item-at-point-as-read]
+        (list 'menu-item "newsticker-mark-item-at-point-as-read"
+              'newsticker-mark-item-at-point-as-read
+              :visible t
+              :image newsticker--mark-read-image
+              :help "Mark current item as read"
+              :enable '(newsticker-item-not-old-p)))
+      (define-key tool-bar-map [newsticker-mark-item-at-point-as-immortal]
+        (list 'menu-item "newsticker-mark-item-at-point-as-immortal"
+              'newsticker-mark-item-at-point-as-immortal
+              :visible t
+              :image newsticker--mark-immortal-image
+              :help "Mark current item as immortal"
+              :enable '(newsticker-item-not-immortal-p)))
+      (define-key tool-bar-map [newsticker-toggle-auto-narrow-to-feed]
+        (list 'menu-item "newsticker-toggle-auto-narrow-to-feed"
+              'newsticker-toggle-auto-narrow-to-feed
+              :visible t
+              :help "Toggle visibility of other feeds"
+              :image newsticker--narrow-image))
+      (define-key tool-bar-map [newsticker-next-feed]
+        (list 'menu-item "newsticker-next-feed" 'newsticker-next-feed
+              :visible t
+              :help "Go to next feed"
+              :image newsticker--next-feed-image
+              :enable '(newsticker-next-feed-available-p)))
+      (define-key tool-bar-map [newsticker-next-item]
+        (list 'menu-item "newsticker-next-item" 'newsticker-next-item
+              :visible t
+              :help "Go to next item"
+              :image newsticker--next-item-image
+              :enable '(newsticker-next-item-available-p)))
+      (define-key tool-bar-map [newsticker-previous-item]
+        (list 'menu-item "newsticker-previous-item" 'newsticker-previous-item
+              :visible t
+              :help "Go to previous item"
+              :image newsticker--previous-item-image
+              :enable '(newsticker-previous-item-available-p)))
+      (define-key tool-bar-map [newsticker-previous-feed]
+        (list 'menu-item "newsticker-previous-feed" 'newsticker-previous-feed
+              :visible t
+              :help "Go to previous feed"
+              :image newsticker--previous-feed-image
+              :enable '(newsticker-previous-feed-available-p)))
+      ;; standard icons / actions
+      (tool-bar-add-item "close"
+                         'newsticker-close-buffer
+                         'newsticker-close-buffer
+                         :help "Close newsticker buffer")
+      (tool-bar-add-item "preferences"
+                         'newsticker-customize
+                         'newsticker-customize
+                         :help "Customize newsticker")
+      tool-bar-map)))
+
+;; ======================================================================
+;;; Newsticker mode
+;; ======================================================================
+
+(define-derived-mode newsticker-mode fundamental-mode
+  "NewsTicker"
+  "Viewing RSS news feeds in Emacs."
+  (set (make-local-variable 'tool-bar-map) newsticker-tool-bar-map)
+  (set (make-local-variable 'imenu-sort-function) nil)
+  (set (make-local-variable 'scroll-conservatively) 999)
+  (setq imenu-create-index-function 'newsticker--imenu-create-index)
+  (setq imenu-default-goto-function 'newsticker--imenu-goto)
+  (setq buffer-read-only t)
+  (auto-fill-mode -1) ;; turn auto-fill off!
+  (font-lock-mode -1) ;; turn off font-lock!!
+  (set (make-local-variable 'font-lock-defaults) nil)
+  (set (make-local-variable 'line-move-ignore-invisible) t)
+  (setq mode-line-format
+        (list "-"
+              'mode-line-mule-info
+              'mode-line-modified
+              'mode-line-frame-identification
+              " Newsticker ("
+              '(newsticker--buffer-uptodate-p
+                "up to date"
+                "NEED UPDATE")
+              ") -- "
+              '(:eval (newsticker--buffer-get-feed-title-at-point))
+              ": "
+              '(:eval (newsticker--buffer-get-item-title-at-point))
+              " %-"))
+  (unless newsticker-show-all-rss-elements
+    (add-to-invisibility-spec 'extra))
+  (newsticker--buffer-set-uptodate nil))
+
+;; refine its mode-map
+(define-key newsticker-mode-map "sO" 'newsticker-show-old-items)
+(define-key newsticker-mode-map "hO" 'newsticker-hide-old-items)
+(define-key newsticker-mode-map "sa" 'newsticker-show-all-desc)
+(define-key newsticker-mode-map "ha" 'newsticker-hide-all-desc)
+(define-key newsticker-mode-map "sf" 'newsticker-show-feed-desc)
+(define-key newsticker-mode-map "hf" 'newsticker-hide-feed-desc)
+(define-key newsticker-mode-map "so" 'newsticker-show-old-item-desc)
+(define-key newsticker-mode-map "ho" 'newsticker-hide-old-item-desc)
+(define-key newsticker-mode-map "sn" 'newsticker-show-new-item-desc)
+(define-key newsticker-mode-map "hn" 'newsticker-hide-new-item-desc)
+(define-key newsticker-mode-map "se" 'newsticker-show-entry)
+(define-key newsticker-mode-map "he" 'newsticker-hide-entry)
+(define-key newsticker-mode-map "sx" 'newsticker-show-extra)
+(define-key newsticker-mode-map "hx" 'newsticker-hide-extra)
+
+(define-key newsticker-mode-map " "  'scroll-up)
+(define-key newsticker-mode-map "q"  'newsticker-close-buffer)
+(define-key newsticker-mode-map "p"  'newsticker-previous-item)
+(define-key newsticker-mode-map "P"  'newsticker-previous-new-item)
+(define-key newsticker-mode-map "F"  'newsticker-previous-feed)
+(define-key newsticker-mode-map "\t" 'newsticker-next-item)
+(define-key newsticker-mode-map "n"  'newsticker-next-item)
+(define-key newsticker-mode-map "N"  'newsticker-next-new-item)
+(define-key newsticker-mode-map "f"  'newsticker-next-feed)
+(define-key newsticker-mode-map "M"  'newsticker-mark-all-items-as-read)
+(define-key newsticker-mode-map "m"
+  'newsticker-mark-all-items-at-point-as-read)
+(define-key newsticker-mode-map "o"  'newsticker-mark-item-at-point-as-read)
+(define-key newsticker-mode-map "G"  'newsticker-get-all-news)
+(define-key newsticker-mode-map "g"  'newsticker-get-news-at-point)
+(define-key newsticker-mode-map "u"  'newsticker-buffer-update)
+(define-key newsticker-mode-map "U"  'newsticker-buffer-force-update)
+(define-key newsticker-mode-map "a"  'newsticker-add-url)
+
+(define-key newsticker-mode-map "i"
+  'newsticker-mark-item-at-point-as-immortal)
+
+(define-key newsticker-mode-map "xf" 'newsticker-toggle-auto-narrow-to-feed)
+(define-key newsticker-mode-map "xi" 'newsticker-toggle-auto-narrow-to-item)
+
+;; maps for the clickable portions
+(defvar newsticker--url-keymap (make-sparse-keymap)
+  "Key map for click-able headings in the newsticker buffer.")
+(define-key newsticker--url-keymap [mouse-2]
+  'newsticker-mouse-browse-url)
+(define-key newsticker--url-keymap "\n"
+  'newsticker-browse-url)
+(define-key newsticker--url-keymap "\C-m"
+  'newsticker-browse-url)
+(define-key newsticker--url-keymap [(control return)]
+  'newsticker-handle-url)
+
+;; newsticker menu
+(defvar newsticker-menu (make-sparse-keymap "Newsticker"))
+
+(define-key newsticker-menu [newsticker-browse-url]
+  '("Browse URL for item at point" . newsticker-browse-url))
+(define-key newsticker-menu [newsticker-separator-1]
+  '("--"))
+(define-key newsticker-menu [newsticker-buffer-update]
+  '("Update buffer" . newsticker-buffer-update))
+(define-key newsticker-menu [newsticker-separator-2]
+  '("--"))
+(define-key newsticker-menu [newsticker-get-all-news]
+  '("Get news from all feeds" . newsticker-get-all-news))
+(define-key newsticker-menu [newsticker-get-news-at-point]
+  '("Get news from feed at point" . newsticker-get-news-at-point))
+(define-key newsticker-menu [newsticker-separator-3]
+  '("--"))
+(define-key newsticker-menu [newsticker-mark-all-items-as-read]
+  '("Mark all items as read" . newsticker-mark-all-items-as-read))
+(define-key newsticker-menu [newsticker-mark-all-items-at-point-as-read]
+  '("Mark all items in feed at point as read" .
+    newsticker-mark-all-items-at-point-as-read))
+(define-key newsticker-menu [newsticker-mark-item-at-point-as-read]
+  '("Mark item at point as read" .
+    newsticker-mark-item-at-point-as-read))
+(define-key newsticker-menu [newsticker-mark-item-at-point-as-immortal]
+  '("Toggle immortality for item at point" .
+    newsticker-mark-item-at-point-as-immortal))
+(define-key newsticker-menu [newsticker-separator-4]
+  '("--"))
+(define-key newsticker-menu [newsticker-hide-old-items]
+  '("Hide old items" . newsticker-hide-old-items))
+(define-key newsticker-menu [newsticker-show-old-items]
+  '("Show old items" . newsticker-show-old-items))
+(define-key newsticker-menu [newsticker-next-item]
+  '("Go to next item" . newsticker-next-item))
+(define-key newsticker-menu [newsticker-previous-item]
+  '("Go to previous item" . newsticker-previous-item))
+
+;; bind menu to mouse
+(define-key newsticker-mode-map [down-mouse-3] newsticker-menu)
+;; Put menu in menu-bar
+(define-key newsticker-mode-map [menu-bar Newsticker]
+  (cons "Newsticker" newsticker-menu))
+
+
+;; ======================================================================
+;;; shortcuts
+;; ======================================================================
+(defsubst newsticker--title (item)
+  "Return title of ITEM."
+  (nth 0 item))
+(defsubst newsticker--desc (item)
+  "Return description of ITEM."
+  (nth 1 item))
+(defsubst newsticker--link (item)
+  "Return link of ITEM."
+  (nth 2 item))
+(defsubst newsticker--time (item)
+  "Return time of ITEM."
+  (nth 3 item))
+(defsubst newsticker--age (item)
+  "Return age of ITEM."
+  (nth 4 item))
+(defsubst newsticker--pos (item)
+  "Return position/index of ITEM."
+  (nth 5 item))
+(defsubst newsticker--preformatted-contents (item)
+  "Return pre-formatted text of ITEM."
+  (nth 6 item))
+(defsubst newsticker--preformatted-title (item)
+  "Return pre-formatted title of ITEM."
+  (nth 7 item))
+(defsubst newsticker--extra (item)
+  "Return extra attributes of ITEM."
+  (nth 8 item))
+(defsubst newsticker--guid (item)
+  "Return guid of ITEM."
+  (let ((guid (assoc 'guid (newsticker--extra item))))
+    (if (stringp guid)
+        guid
+      (car (xml-node-children guid)))))
+(defsubst newsticker--enclosure (item)
+  "Return enclosure element of ITEM in the form \(...FIXME...\)or nil."
+  (let ((enclosure (assoc 'enclosure (newsticker--extra item))))
+    (if enclosure
+        (xml-node-attributes enclosure))))
+
+;; ======================================================================
+;;; User fun
+;; ======================================================================
+
+(defun newsticker-start (&optional do-not-complain-if-running)
+  "Start the newsticker.
+Start the timers for display and retrieval.  If the newsticker, i.e. the
+timers, are running already a warning message is printed unless
+DO-NOT-COMPLAIN-IF-RUNNING is not nil.
+Run `newsticker-start-hook' if newsticker was not running already."
+  (interactive)
+  (let ((running (newsticker-running-p)))
+    ;; read old cache if it exists and newsticker is not running
+    (unless running
+      (let* ((coding-system-for-read 'utf-8)
+             (buf (find-file-noselect newsticker-cache-filename)))
+        (when buf
+          (set-buffer buf)
+          (goto-char (point-min))
+          (condition-case nil
+              (setq newsticker--cache (read buf))
+            (error
+             (message "Error while reading newsticker cache file!")
+             (setq newsticker--cache nil))))))
+    ;; start retrieval timers -- for sake of simplicity we will start
+    ;; one timer for each feed
+    (mapc (lambda (item)
+            (let* ((feed-name (car item))
+                   (start-time (nth 2 item))
+                   (interval (or (nth 3 item)
+                                 newsticker-retrieval-interval))
+                   (timer (assoc (car item)
+                                 newsticker--retrieval-timer-list)))
+              (if timer
+                  (or do-not-complain-if-running
+                      (message "Timer for %s is running already!"
+                               feed-name))
+                (newsticker--debug-msg "Starting timer for %s: %s, %d"
+                                       feed-name start-time interval)
+                ;; do not repeat retrieval if interval not positive
+                (if (<= interval 0)
+                    (setq interval nil))
+                ;; Suddenly XEmacs doesn't like start-time 0
+                (if (or (not start-time)
+                        (and (numberp start-time) (= start-time 0)))
+                    (setq start-time 1))
+                (message "start-time %s" start-time)
+                (setq timer (run-at-time start-time interval
+                                         'newsticker-get-news feed-name))
+                (if interval
+                    (add-to-list 'newsticker--retrieval-timer-list
+                                 (cons feed-name timer))))))
+          (append newsticker-url-list-defaults newsticker-url-list))
+    (unless running
+      (run-hooks 'newsticker-start-hook)
+      (message "Newsticker started!"))))
+
+(defun newsticker-start-ticker ()
+  "Start newsticker's ticker (but not the news retrieval.
+Start display timer for the actual ticker if wanted and not
+running already."
+  (interactive)
+  (if (and (> newsticker-display-interval 0)
+           (not newsticker--display-timer))
+      (setq newsticker--display-timer
+            (run-at-time newsticker-display-interval
+                         newsticker-display-interval
+                         'newsticker--display-tick))))
+
+(defun newsticker-stop ()
+  "Stop the newsticker and the newsticker-ticker.
+Cancel the timers for display and retrieval.  Run `newsticker-stop-hook'
+if newsticker has been running."
+  (interactive)
+  (newsticker--cache-update t)
+  (newsticker-stop-ticker)
+  (when (newsticker-running-p)
+    (mapc (lambda (name-and-timer)
+            (cancel-timer (cdr name-and-timer)))
+          newsticker--retrieval-timer-list)
+    (setq newsticker--retrieval-timer-list nil)
+    (run-hooks 'newsticker-stop-hook)
+    (message "Newsticker stopped!")))
+
+(defun newsticker-stop-ticker ()
+  "Stop newsticker's ticker (but not the news retrieval)."
+  (interactive)
+  (when newsticker--display-timer
+    (cancel-timer newsticker--display-timer)
+    (setq newsticker--display-timer nil)))
+
+;; the functions we need for retrieval and display
+(defun newsticker-show-news ()
+  "Switch to newsticker buffer.  You may want to bind this to a key."
+  (interactive)
+  (newsticker-start t) ;; will start only if not running
+  (newsticker-buffer-update)
+  (switch-to-buffer "*newsticker*"))
+
+(defun newsticker-buffer-force-update ()
+  "Update the newsticker buffer, even if not necessary."
+  (interactive)
+  (newsticker-buffer-update t))
+
+(defun newsticker-buffer-update (&optional force)
+  "Update the *newsticker* buffer.
+Unless FORCE is t this is donly only if necessary, i.e. when the
+*newsticker* buffer is not up-to-date."
+  (interactive)
+  ;; bring cache data into proper order....
+  (newsticker--cache-sort)
+  ;; fill buffer
+  (save-excursion
+    (let ((buf (get-buffer "*newsticker*")))
+      (if buf
+          (switch-to-buffer buf)
+        (switch-to-buffer (get-buffer-create "*newsticker*"))
+        (newsticker--buffer-set-uptodate nil)))
+   (when (or force
+             (not newsticker--buffer-uptodate-p))
+     (message "Preparing newsticker buffer...")
+     (setq buffer-undo-list t)
+     (let ((inhibit-read-only t))
+       (set-buffer-modified-p nil)
+       (erase-buffer)
+       (newsticker-mode)
+       ;; Emacs 21.3.50 does not care if we turn off auto-fill in the
+       ;; definition of newsticker-mode, so we do it here (again)
+       (auto-fill-mode -1)
+
+       (set-buffer-file-coding-system 'utf-8)
+
+       (if newsticker-use-full-width
+           (set (make-local-variable 'fill-column) (1- (window-width))))
+       (newsticker--buffer-insert-all-items)
+
+       ;; FIXME: needed for methods buffer in ecb
+       ;; (set-visited-file-name "*newsticker*")
+
+       (set-buffer-modified-p nil)
+        (newsticker-hide-all-desc)
+        (if newsticker-hide-old-items-in-newsticker-buffer
+            (newsticker-hide-old-items))
+        (if newsticker-show-descriptions-of-new-items
+            (newsticker-show-new-item-desc))
+       )
+     (message ""))
+   (newsticker--buffer-set-uptodate t)
+   (run-hooks 'newsticker-buffer-change-hook)))
+
+(defun newsticker-get-all-news ()
+  "Launch retrieval of news from all configured newsticker sites.
+This does NOT start the retrieval timers."
+  (interactive)
+  ;; launch retrieval of news
+  (mapc (lambda (item)
+          (newsticker-get-news (car item)))
+        (append newsticker-url-list-defaults newsticker-url-list)))
+
+(defun newsticker-get-news-at-point ()
+  "Launch retrieval of news for the feed point is in.
+This does NOT start the retrieval timers."
+  (interactive)
+  ;; launch retrieval of news
+  (let ((feed (get-text-property (point) 'feed)))
+      (when feed
+        (newsticker--debug-msg "Getting news for %s" (symbol-name feed))
+        (newsticker-get-news (symbol-name feed)))))
+
+(defun newsticker-add-url (url name)
+  "Add given URL under given NAME to `newsticker-url-list'.
+If URL is nil it is searched at point."
+  (interactive
+   (list
+    (read-string "URL: "
+                 (save-excursion
+                   (end-of-line)
+                   (and
+                    (re-search-backward
+                     "http://"
+                     (if (> (point) (+ (point-min) 100))
+                         (- (point) 100)
+                       (point-min))
+                     t)
+                    (re-search-forward
+                     "http://[-a-zA-Z0-9&/_.]*"
+                     (if (< (point) (- (point-max) 200))
+                         (+ (point) 200)
+                       (point-max))
+                     t)
+                    (buffer-substring-no-properties (match-beginning 0)
+                                                    (match-end 0)))))
+    (read-string "Name: ")))
+  (add-to-list 'newsticker-url-list (list name url nil nil nil) t)
+  (customize-variable 'newsticker-url-list))
+
+(defun newsticker-w3m-show-inline-images ()
+  "Show inline images in visible text ranges.
+In-line images in invisible text ranges are hidden.  This function
+calls `w3m-toggle-inline-image'.  It works only if
+`newsticker-html-renderer' is set to `w3m-region'"
+  (interactive)
+  (if (eq newsticker-html-renderer 'w3m-region)
+      (let ((inhibit-read-only t))
+        (save-excursion
+          (save-restriction
+            (widen)
+            (goto-char (point-min))
+            (let ((pos (point)))
+              (while pos
+                (setq pos (next-single-property-change pos 'w3m-image))
+                (when pos
+                  (goto-char pos)
+                  (when (get-text-property pos 'w3m-image)
+                    (let ((invis (newsticker--lists-intersect-p
+                                  (get-text-property (1- (point)) 'invisible)
+                                  buffer-invisibility-spec)))
+                      (if invis
+                          (w3m-remove-image
+                           pos (next-single-property-change pos 'w3m-image))
+                        (w3m-toggle-inline-image t))))))))))))
+
+;; ======================================================================
+;;; keymap stuff
+;; ======================================================================
+(defun newsticker-close-buffer ()
+  "Close the newsticker buffer."
+  (interactive)
+  (newsticker--cache-update t)
+  (bury-buffer))
+
+(defun newsticker-next-new-item (&optional do-not-wrap-at-eob)
+  "Go to next new news item.
+If no new item is found behind point, search is continued at
+beginning of buffer unless optional argument DO-NOT-WRAP-AT-EOB
+is non-nil."
+  (interactive)
+  (widen)
+  (let ((go-ahead t))
+    (while go-ahead
+      (unless (newsticker--buffer-goto '(item) 'new)
+	;; found nothing -- wrap
+	(unless do-not-wrap-at-eob
+	  (goto-char (point-min))
+	  (newsticker-next-new-item t))
+	(setq go-ahead nil))
+      (unless (newsticker--lists-intersect-p
+               (get-text-property (point) 'invisible)
+               buffer-invisibility-spec)
+	;; this item is invisible -- continue search
+        (setq go-ahead nil))))
+  (run-hooks 'newsticker-select-item-hook)
+  (point))
+
+(defun newsticker-previous-new-item (&optional do-not-wrap-at-bob)
+  "Go to previous new news item.
+If no new item is found before point, search is continued at
+beginning of buffer unless optional argument DO-NOT-WRAP-AT-BOB
+is non-nil."
+  (interactive)
+  (widen)
+  (let ((go-ahead t))
+    (while go-ahead
+      (unless (newsticker--buffer-goto '(item) 'new t)
+	(unless do-not-wrap-at-bob
+	  (goto-char (point-max))
+	  (newsticker--buffer-goto '(item) 'new t)))
+      (unless (newsticker--lists-intersect-p
+               (get-text-property (point) 'invisible)
+		    buffer-invisibility-spec)
+	(setq go-ahead nil))))
+  (run-hooks 'newsticker-select-item-hook)
+  (point))
+
+(defun newsticker-next-item (&optional do-not-wrap-at-eob)
+  "Go to next news item.
+Return new buffer position.
+If no item is found below point, search is continued at beginning
+of buffer unless optional argument DO-NOT-WRAP-AT-EOB is
+non-nil."
+  (interactive)
+  (widen)
+  (let ((go-ahead t)
+        (search-list '(item)))
+    (if newsticker--auto-narrow-to-item
+        (setq search-list '(item feed)))
+    (while go-ahead
+      (unless (newsticker--buffer-goto search-list)
+	;; found nothing -- wrap
+	(unless do-not-wrap-at-eob
+	  (goto-char (point-min)))
+	(setq go-ahead nil))
+      (unless (newsticker--lists-intersect-p
+               (get-text-property (point) 'invisible)
+		    buffer-invisibility-spec)
+	(setq go-ahead nil))))
+  (run-hooks 'newsticker-select-item-hook)
+  (point))
+
+(defun newsticker-previous-item (&optional do-not-wrap-at-bob)
+  "Go to previous news item.
+Return new buffer position.
+If no item is found before point, search is continued at
+beginning of buffer unless optional argument DO-NOT-WRAP-AT-BOB
+is non-nil."
+  (interactive)
+  (widen)
+  (let ((go-ahead t)
+        (search-list '(item)))
+    (if newsticker--auto-narrow-to-item
+        (setq search-list '(item feed)))
+    (when (bobp)
+      (unless do-not-wrap-at-bob
+	(goto-char (point-max))))
+    (while go-ahead
+      (if (newsticker--buffer-goto search-list nil t)
+          (unless (newsticker--lists-intersect-p
+                   (get-text-property (point) 'invisible)
+                   buffer-invisibility-spec)
+            (setq go-ahead nil))
+        (goto-char (point-min))
+        (setq go-ahead nil))))
+  (run-hooks 'newsticker-select-item-hook)
+  (point))
+
+(defun newsticker-next-feed ()
+  "Go to next news feed.
+Return new buffer position."
+  (interactive)
+  (widen)
+  (newsticker--buffer-goto '(feed))
+  (run-hooks 'newsticker-select-feed-hook)
+  (point))
+
+(defun newsticker-previous-feed ()
+  "Go to previous news feed.
+Return new buffer position."
+  (interactive)
+  (widen)
+  (newsticker--buffer-goto '(feed) nil t)
+  (run-hooks 'newsticker-select-feed-hook)
+  (point))
+
+(defun newsticker-mark-all-items-at-point-as-read ()
+  "Mark all items as read and clear ticker contents."
+  (interactive)
+  (when (or newsticker--buffer-uptodate-p
+            (y-or-n-p
+             "Buffer is not up to date -- really mark items as read? "))
+    (let ((feed (get-text-property (point) 'feed))
+          (pos (point)))
+      (when feed
+        (message "Marking all items as read for %s" (symbol-name feed))
+        (newsticker--cache-replace-age newsticker--cache feed 'new 'old)
+        (newsticker--cache-replace-age newsticker--cache feed 'obsolete 'old)
+        (newsticker--cache-update)
+        (newsticker--buffer-set-uptodate nil)
+        (newsticker--ticker-text-setup)
+        (newsticker-buffer-update)
+        ;; go back to where we came frome
+        (goto-char pos)
+        (end-of-line)
+        (newsticker--buffer-goto '(feed) nil t)))))
+
+(defun newsticker-mark-item-at-point-as-read (&optional respect-immortality)
+  "Mark item at point as read.
+If optional argument RESPECT-IMMORTALITY is not nil immortal items do
+not get changed."
+  (interactive)
+  (when (or newsticker--buffer-uptodate-p
+            (y-or-n-p
+             "Buffer is not up to date -- really mark this item as read? "))
+    (let ((feed (get-text-property (point) 'feed))
+          (item nil))
+      (when feed
+        (save-excursion
+          (newsticker--buffer-beginning-of-item)
+          (let ((inhibit-read-only t)
+                (age (get-text-property (point) 'nt-age))
+                (title (get-text-property (point) 'nt-title))
+                (guid (get-text-property (point) 'nt-guid))
+                (nt-desc (get-text-property (point) 'nt-desc))
+                (pos (save-excursion (newsticker--buffer-end-of-item))))
+            (when (or (eq age 'new)
+                      (eq age 'obsolete)
+                      (and (eq age 'immortal)
+                           (not respect-immortality)))
+              ;; find item
+              (setq item (newsticker--cache-contains newsticker--cache
+                                                     feed title nt-desc
+                                                     nil nil guid))
+              ;; mark as old
+              (when item
+                (setcar (nthcdr 4 item) 'old)
+                (newsticker--do-forget-preformatted item))
+              ;; clean up ticker
+              (if (or (and (eq age 'new)
+                           newsticker-hide-immortal-items-in-echo-area)
+                      (and (memq age '(old immortal))
+                           (not
+                            (eq newsticker-hide-old-items-in-newsticker-buffer
+                                newsticker-hide-immortal-items-in-echo-area))))
+                  (newsticker--ticker-text-remove feed title))
+              ;; set faces etc.
+              (save-excursion
+                (save-restriction
+                  (widen)
+                  (put-text-property (point) pos 'nt-age 'old)
+                  (newsticker--buffer-set-faces (point) pos)))
+              (set-buffer-modified-p nil))))
+        ;; move forward
+        (newsticker-next-item t)))))
+
+(defun newsticker-mark-item-at-point-as-immortal ()
+  "Mark item at point as read."
+  (interactive)
+  (when (or newsticker--buffer-uptodate-p
+            (y-or-n-p
+             "Buffer is not up to date -- really mark this item as read? "))
+    (let ((feed (get-text-property (point) 'feed))
+          (item nil))
+      (when feed
+        (save-excursion
+          (newsticker--buffer-beginning-of-item)
+          (let ((inhibit-read-only t)
+                (oldage (get-text-property (point) 'nt-age))
+                (title (get-text-property (point) 'nt-title))
+                (guid (get-text-property (point) 'nt-guid))
+                (pos  (save-excursion (newsticker--buffer-end-of-item))))
+            (let ((newage 'immortal))
+              (if (eq oldage 'immortal)
+                  (setq newage 'old))
+              (setq item (newsticker--cache-contains newsticker--cache
+                                                     feed title nil nil nil
+                                                     guid))
+              ;; change age
+              (when item
+                (setcar (nthcdr 4 item) newage)
+                (newsticker--do-forget-preformatted item))
+              (if (or (and (eq newage 'immortal)
+                           newsticker-hide-immortal-items-in-echo-area)
+                      (and (eq newage 'obsolete)
+                           newsticker-hide-obsolete-items-in-echo-area)
+                      (and (eq oldage 'immortal)
+                           (not
+                            (eq newsticker-hide-old-items-in-newsticker-buffer
+                                newsticker-hide-immortal-items-in-echo-area))))
+                  (newsticker--ticker-text-remove feed title)
+                (newsticker--ticker-text-setup))
+              (save-excursion
+                (save-restriction
+                  (widen)
+                  (put-text-property (point) pos 'nt-age newage)
+                  (if (eq newage 'immortal)
+                      (put-text-property (point) pos 'nt-age 'immortal)
+                    (put-text-property (point) pos 'nt-age 'old))
+                  (newsticker--buffer-set-faces (point) pos))))))
+          (if item
+            (newsticker-next-item t))))))
+
+(defun newsticker-mark-all-items-as-read ()
+  "Mark all items as read and clear ticker contents."
+  (interactive)
+  (when (or newsticker--buffer-uptodate-p
+            (y-or-n-p
+             "Buffer is not up to date -- really mark items as read? "))
+    (newsticker--cache-replace-age newsticker--cache 'any 'new 'old)
+    (newsticker--buffer-set-uptodate nil)
+    (newsticker--ticker-text-setup)
+    (newsticker--cache-update)
+    (newsticker-buffer-update)))
+
+(defun newsticker-hide-extra ()
+  "Hide the extra elements of items."
+  (interactive)
+  (newsticker--buffer-hideshow 'extra nil)
+  (newsticker--buffer-redraw))
+
+(defun newsticker-show-extra ()
+  "Show the extra elements of items."
+  (interactive)
+  (newsticker--buffer-hideshow 'extra t)
+  (newsticker--buffer-redraw))
+
+(defun newsticker-hide-old-item-desc ()
+  "Hide the description of old items."
+  (interactive)
+  (newsticker--buffer-hideshow 'desc-old nil)
+  (newsticker--buffer-redraw))
+
+(defun newsticker-show-old-item-desc ()
+  "Show the description of old items."
+  (interactive)
+  (newsticker--buffer-hideshow 'item-old t)
+  (newsticker--buffer-hideshow 'desc-old t)
+  (newsticker--buffer-redraw))
+
+(defun newsticker-hide-new-item-desc ()
+  "Hide the description of new items."
+  (interactive)
+  (newsticker--buffer-hideshow 'desc-new nil)
+  (newsticker--buffer-hideshow 'desc-immortal nil)
+  (newsticker--buffer-hideshow 'desc-obsolete nil)
+  (newsticker--buffer-redraw))
+
+(defun newsticker-show-new-item-desc ()
+  "Show the description of new items."
+  (interactive)
+  (newsticker--buffer-hideshow 'desc-new t)
+  (newsticker--buffer-hideshow 'desc-immortal t)
+  (newsticker--buffer-hideshow 'desc-obsolete t)
+  (newsticker--buffer-redraw))
+
+(defun newsticker-hide-feed-desc ()
+  "Hide the description of feeds."
+  (interactive)
+  (newsticker--buffer-hideshow 'desc-feed nil)
+  (newsticker--buffer-redraw))
+
+(defun newsticker-show-feed-desc ()
+  "Show the description of old items."
+  (interactive)
+  (newsticker--buffer-hideshow 'desc-feed t)
+  (newsticker--buffer-redraw))
+
+(defun newsticker-hide-all-desc ()
+  "Hide the descriptions of feeds and all items."
+  (interactive)
+  (newsticker--buffer-hideshow 'desc-feed nil)
+  (newsticker--buffer-hideshow 'desc-immortal nil)
+  (newsticker--buffer-hideshow 'desc-obsolete nil)
+  (newsticker--buffer-hideshow 'desc-new  nil)
+  (newsticker--buffer-hideshow 'desc-old  nil)
+  (newsticker--buffer-redraw))
+
+(defun newsticker-show-all-desc ()
+  "Show the descriptions of feeds and all items."
+  (interactive)
+  (newsticker--buffer-hideshow 'desc-feed t)
+  (newsticker--buffer-hideshow 'desc-immortal  t)
+  (newsticker--buffer-hideshow 'desc-obsolete  t)
+  (newsticker--buffer-hideshow 'desc-new  t)
+  (newsticker--buffer-hideshow 'desc-old  t)
+  (newsticker--buffer-redraw))
+
+(defun newsticker-hide-old-items ()
+  "Hide old items."
+  (interactive)
+  (newsticker--buffer-hideshow 'desc-old nil)
+  (newsticker--buffer-hideshow 'item-old nil)
+  (newsticker--buffer-redraw))
+
+(defun newsticker-show-old-items ()
+  "Show old items."
+  (interactive)
+  (newsticker--buffer-hideshow 'desc-old t)
+  (newsticker--buffer-hideshow 'item-old t)
+  (newsticker--buffer-redraw))
+
+(defun newsticker-hide-entry ()
+  "Hide description of entry at point."
+  (interactive)
+  (save-excursion
+    (let* (pos1 pos2
+                (inhibit-read-only t)
+                inv-prop org-inv-prop
+                is-invisible)
+      (newsticker--buffer-beginning-of-item)
+      (newsticker--buffer-goto '(desc))
+      (setq pos1 (max (point-min) (1- (point))))
+      (newsticker--buffer-goto '(extra feed item))
+      (setq pos2 (max (point-min) (1- (point))))
+      (setq inv-prop (get-text-property pos1 'invisible))
+      (setq org-inv-prop (get-text-property pos1 'org-invisible))
+      (cond ((eq inv-prop t)
+             ;; do nothing
+             )
+            ((eq org-inv-prop nil)
+             (add-text-properties pos1 pos2 (list 'invisible t
+                                                  'org-invisible inv-prop)))
+            (t
+             ;; toggle
+             (add-text-properties pos1 pos2 (list 'invisible org-inv-prop))
+             (remove-text-properties pos1 pos2 '(org-invisible))))))
+  (newsticker--buffer-redraw))
+
+(defun newsticker-show-entry ()
+  "Show description of entry at point."
+  (interactive)
+  (save-excursion
+    (let* (pos1 pos2
+                (inhibit-read-only t)
+                inv-prop org-inv-prop
+                is-invisible)
+      (newsticker--buffer-beginning-of-item)
+      (newsticker--buffer-goto '(desc))
+      (setq pos1 (max (point-min) (1- (point))))
+      (newsticker--buffer-goto '(extra feed item))
+      (setq pos2 (max (point-min) (1- (point))))
+      (setq inv-prop (get-text-property pos1 'invisible))
+      (setq org-inv-prop (get-text-property pos1 'org-invisible))
+      (cond ((eq org-inv-prop nil)
+             (add-text-properties pos1 pos2 (list 'invisible nil
+                                                  'org-invisible inv-prop)))
+            (t
+             ;; toggle
+             (add-text-properties pos1 pos2 (list 'invisible org-inv-prop))
+             (remove-text-properties pos1 pos2 '(org-invisible))))))
+  (newsticker--buffer-redraw))
+
+(defun newsticker-toggle-auto-narrow-to-feed ()
+  "Toggle narrowing to current news feed.
+If auto-narrowing is active, only news item of the current feed
+are visible."
+  (interactive)
+  (newsticker-set-auto-narrow-to-feed (not newsticker--auto-narrow-to-feed)))
+
+(defun newsticker-set-auto-narrow-to-feed (value)
+  "Turn narrowing to current news feed on or off.
+If VALUE is nil, auto-narrowing is turned off, otherwise it is turned on."
+  (interactive)
+  (setq newsticker--auto-narrow-to-item nil)
+  (setq newsticker--auto-narrow-to-feed value)
+  (widen)
+  (run-hooks 'newsticker-narrow-hook))
+
+(defun newsticker-toggle-auto-narrow-to-item ()
+  "Toggle narrowing to current news item.
+If auto-narrowing is active, only one item of the current feed
+is visible."
+  (interactive)
+  (newsticker-set-auto-narrow-to-item (not newsticker--auto-narrow-to-item)))
+
+(defun newsticker-set-auto-narrow-to-item (value)
+  "Turn narrowing to current news item on or off.
+If VALUE is nil, auto-narrowing is turned off, otherwise it is turned on."
+  (interactive)
+  (setq newsticker--auto-narrow-to-feed nil)
+  (setq newsticker--auto-narrow-to-item value)
+  (widen)
+  (run-hooks 'newsticker-narrow-hook))
+
+(defun newsticker-customize ()
+  "Open the newsticker customization group."
+  (interactive)
+  (customize-group "newsticker"))
+
+(defun newsticker-next-feed-available-p ()
+  "Return t if position is before last feed, nil otherwise."
+  (save-excursion
+    (let ((p (point)))
+      (newsticker--buffer-goto '(feed))
+      (not (= p (point))))))
+
+(defun newsticker-previous-feed-available-p ()
+  "Return t if position is behind first feed, nil otherwise."
+  (save-excursion
+    (let ((p (point)))
+      (newsticker--buffer-goto '(feed) nil t)
+      (not (= p (point))))))
+
+(defun newsticker-next-item-available-p ()
+  "Return t if position is before last feed, nil otherwise."
+  (save-excursion
+    (catch 'result
+      (while (< (point) (point-max))
+        (unless (newsticker--buffer-goto '(item))
+          (throw 'result nil))
+        (unless (newsticker--lists-intersect-p
+                 (get-text-property (point) 'invisible)
+                 buffer-invisibility-spec)
+          (throw 'result t))))))
+
+(defun newsticker-previous-item-available-p ()
+  "Return t if position is behind first item, nil otherwise."
+  (save-excursion
+    (catch 'result
+      (while (> (point) (point-min))
+        (unless (newsticker--buffer-goto '(item) nil t)
+          (throw 'result nil))
+        (unless (newsticker--lists-intersect-p
+                 (get-text-property (point) 'invisible)
+                 buffer-invisibility-spec)
+          (throw 'result t))))))
+
+(defun newsticker-item-not-old-p ()
+  "Return t if there is an item at point which is not old, nil otherwise."
+    (when (get-text-property (point) 'feed)
+      (save-excursion
+        (newsticker--buffer-beginning-of-item)
+        (let ((age (get-text-property (point) 'nt-age)))
+          (and (memq  age '(new immortal obsolete)) t)))))
+
+(defun newsticker-item-not-immortal-p ()
+  "Return t if there is an item at point which is not immortal, nil otherwise."
+    (when (get-text-property (point) 'feed)
+      (save-excursion
+        (newsticker--buffer-beginning-of-item)
+        (let ((age (get-text-property (point) 'nt-age)))
+          (and (memq  age '(new old obsolete)) t)))))
+
+;; ======================================================================
+;;; local stuff
+;; ======================================================================
+(defun newsticker-running-p ()
+  "Check whether newsticker is running.
+Return t if newsticker is running, nil otherwise.  Newsticker is
+considered to be running if the newsticker timer list is not empty."
+  (> (length newsticker--retrieval-timer-list) 0))
+
+(defun newsticker-ticker-running-p ()
+  "Check whether newsticker's actual ticker is running.
+Return t if ticker is running, nil otherwise.  Newsticker is
+considered to be running if the newsticker timer list is not
+empty."
+  (timerp newsticker--display-timer))
+
+;; ======================================================================
+;;; local stuff
+;; ======================================================================
+(defun newsticker-get-news (feed-name)
+  "Get news from the site FEED-NAME and load feed logo.
+FEED-NAME must be a string which occurs as the label (i.e. the first element)
+in an element of `newsticker-url-list' or `newsticker-url-list-defaults'."
+  (newsticker--debug-msg "%s: Getting news for %s"
+                         (format-time-string "%A, %H:%M" (current-time))
+                         feed-name)
+  (let* ((buffername (concat " *newsticker-wget-" feed-name "*"))
+         (item (or (assoc feed-name newsticker-url-list)
+                   (assoc feed-name newsticker-url-list-defaults)
+                   (error
+                    "Cannot get news for %s: Check newsticker-url-list"
+                    feed-name)))
+         (url (cadr item))
+         (wget-arguments (or (car (cdr (cdr (cdr (cdr item)))))
+                             newsticker-wget-arguments)))
+    (save-excursion
+      (set-buffer (get-buffer-create buffername))
+      (erase-buffer)
+      ;; throw an error if there is an old wget-process around
+      (if (get-process feed-name)
+          (error "Another wget-process is running for %s" feed-name))
+      ;; start wget
+      (let* ((args (append wget-arguments (list url)))
+             (proc (apply 'start-process feed-name buffername
+                          newsticker-wget-name args)))
+        (set-process-coding-system proc 'no-conversion 'no-conversion)
+        (set-process-sentinel proc 'newsticker--sentinel)))))
+
+
+(defun newsticker-mouse-browse-url (event)
+  "Call `browse-url' for the link of the item at which the EVENT occurred."
+  (interactive "e")
+  (save-excursion
+    (switch-to-buffer (window-buffer (posn-window (event-end event))))
+    (let ((url (get-text-property (posn-point (event-end event))
+                                  'nt-link)))
+      (when url
+        (browse-url url)
+        (save-excursion
+          (goto-char (posn-point (event-end event)))
+          (if newsticker-automatically-mark-visited-items-as-old
+              (newsticker-mark-item-at-point-as-read t)))))))
+
+(defun newsticker-browse-url ()
+  "Call `browse-url' for the link of the item at point."
+  (interactive)
+  (let ((url (get-text-property (point) 'nt-link)))
+    (when url
+      (browse-url url)
+      (if newsticker-automatically-mark-visited-items-as-old
+          (newsticker-mark-item-at-point-as-read t)))))
+
+(defvar newsticker-open-url-history
+  '("wget" "xmms" "realplay")
+  "...")
+
+(defun newsticker-handle-url ()
+  "Ask for a program to open the link of the item at point."
+  (interactive)
+  (let ((url (get-text-property (point) 'nt-link)))
+    (when url
+      (let ((prog (read-string "Open url with: " nil
+                               'newsticker-open-url-history)))
+        (when prog
+          (message "%s %s" prog url)
+          (start-process prog prog prog url)
+      (if newsticker-automatically-mark-visited-items-as-old
+          (newsticker-mark-item-at-point-as-read t)))))))
+
+(defun newsticker--sentinel (process event)
+  "Sentinel for extracting news titles from an RDF buffer.
+Argument PROCESS is the process which has just changed its state.
+Argument EVENT tells what has happened to the process."
+  (let* ((p-status (process-status process))
+         (exit-status (process-exit-status process))
+         (time (current-time))
+         (name (process-name process))
+         (name-symbol (intern name))
+         (something-was-added nil))
+    ;; catch known errors (zombie processes, rubbish-xml etc.
+    ;; if an error occurs the news feed is not updated!
+    (catch 'oops
+      (unless (and (eq p-status 'exit)
+                   (= exit-status 0))
+        (setq newsticker--cache
+              (newsticker--cache-add
+               newsticker--cache
+               name-symbol
+               newsticker--error-headline
+               (format
+                (concat "%s: Newsticker could not retrieve news from %s.\n"
+                        "Return status: `%s'\n"
+                        "Command was `%s'")
+                (format-time-string "%A, %H:%M" (current-time))
+                name event (process-command process))
+               ""
+               (current-time)
+               'new
+               0 nil))
+        (message "%s: Error while retrieving news from %s"
+                 (format-time-string "%A, %H:%M" (current-time))
+                 (process-name process))
+        (throw 'oops nil))
+      (let* ((coding-system nil)
+             (node-list
+              (save-current-buffer
+                (set-buffer (process-buffer process))
+                ;; a very very dirty workaround to overcome the
+                ;; problems with the newest (20030621) xml.el:
+                ;; remove all unnecessary whitespace
+                (goto-char (point-min))
+                (while (re-search-forward ">[ \t\r\n]+<" nil t)
+                  (replace-match "><" nil t))
+                ;; and another brutal workaround (20031105)!  For some
+                ;; reason the xml parser does not like the colon in the
+                ;; doctype name "rdf:RDF"
+                (goto-char (point-min))
+                (if (re-search-forward "<!DOCTYPE[ \t\n]+rdf:RDF" nil t)
+                  (replace-match "<!DOCTYPE rdfColonRDF" nil t))
+                ;; finally.... ~##^°!!!!!
+                (goto-char (point-min))
+                (while (search-forward "\r\n" nil t)
+                  (replace-match "\n" nil t))
+                ;; still more brutal workarounds (20040309)!  The xml
+                ;; parser does not like doctype rss
+                (goto-char (point-min))
+                (if (re-search-forward "<!DOCTYPE[ \t\n]+rss[ \t\n]*>" nil t)
+                  (replace-match "" nil t))
+                ;; And another one (20050618)! (Fixed in GNU Emacs 22.0.50.18)
+                ;; Remove comments to avoid this xml-parsing bug:
+                ;; "XML files can have only one toplevel tag"
+                (goto-char (point-min))
+                (while (search-forward "<!--" nil t)
+                  (let ((start (match-beginning 0)))
+                    (unless (search-forward "-->" nil t)
+                      (error "Can't find end of comment"))
+                    (delete-region start (point))))
+                ;; And another one (20050702)! If description is HTML
+                ;; encoded and starts with a `<', wrap the whole
+                ;; description in a CDATA expression.  This happened for
+                ;; http://www.thefreedictionary.com/_/WoD/rss.aspx?type=quote
+                 (goto-char (point-min))
+                 (while (re-search-forward
+                         "<description>\\(<img.*?\\)</description>" nil t)
+                   (replace-match
+                    "<description><![CDATA[ \\1 ]]></description>"))
+                ;;
+                (set-buffer-modified-p nil)
+                (goto-char (point-min))
+                (if (re-search-forward "encoding=\"\\([^\"]+\\)\""
+                                       nil t)
+                    (setq coding-system (intern
+                                         (downcase(match-string 1)))))
+                (condition-case errordata
+                    ;; The xml parser might fail
+                    ;; or the xml might be bugged
+                    (xml-parse-region (point-min) (point-max))
+                  (error (message "Could not parse %s: %s"
+                                  (buffer-name) (cadr errordata))
+                         (throw 'oops nil)))))
+             (topnode (car node-list))
+             (channelnode (car (xml-get-children topnode 'channel)))
+             (imageurl nil)
+             (position 0))
+        ;; mark all items as obsolete
+        (newsticker--cache-replace-age newsticker--cache
+                                       name-symbol
+                                       'new 'obsolete-new)
+        (newsticker--cache-replace-age newsticker--cache
+                                       name-symbol
+                                       'old 'obsolete-old)
+        (newsticker--cache-replace-age newsticker--cache
+                                       name-symbol
+                                       'feed 'obsolete-old)
+        ;; gather the news
+        (if (eq (xml-node-name topnode) 'rss)
+            ;; this is RSS 0.91 or something similar
+            ;; all items are inside the channel node
+            (setq topnode channelnode))
+        (setq imageurl
+              (car (xml-node-children
+                    (car (xml-get-children
+                          (car (xml-get-children
+                                topnode
+                                'image))
+                          'url)))))
+        (let ((title (or (car (xml-node-children (car (xml-get-children
+                                                       channelnode 'title))))
+                         "[untitled]"))
+              (link (or (car (xml-node-children (car (xml-get-children
+                                                      channelnode 'link))))
+                        ""))
+              (desc (or (car (xml-node-children (car (xml-get-children
+                                                      channelnode
+                                                      'content:encoded))))
+                        (car (xml-node-children (car (xml-get-children
+                                                      channelnode
+                                                      'description))))
+                        "[No description available]"))
+              (old-item nil))
+          ;; check coding system
+          (setq coding-system
+                (condition-case nil
+                    (check-coding-system coding-system)
+                  (coding-system-error
+                   (message "newsticker.el: %s %s %s %s"
+                            "ignoring coding system "
+                            coding-system
+                            " for "
+                            name)
+                   nil)))
+          ;; apply coding system
+          (when coding-system
+            (setq title (newsticker--decode-coding-string title coding-system))
+            (if desc
+                (setq desc (newsticker--decode-coding-string desc
+                                                             coding-system)))
+            (setq link (newsticker--decode-coding-string link coding-system)))
+          ;; decode numeric entities
+          (setq title (newsticker--decode-numeric-entities title))
+          (setq desc  (newsticker--decode-numeric-entities desc))
+          (setq link  (newsticker--decode-numeric-entities link))
+          ;; remove whitespace from title, desc, and link
+          (setq title (newsticker--remove-whitespace title))
+          (setq desc (newsticker--remove-whitespace desc))
+          (setq link (newsticker--remove-whitespace link))
+
+          ;; handle the feed itself
+          (unless (newsticker--cache-contains newsticker--cache
+                                              name-symbol title
+                                              desc link 'feed)
+            (setq something-was-added t))
+          (setq newsticker--cache
+                (newsticker--cache-add
+                 newsticker--cache name-symbol
+                 title desc link time 'feed position
+                 (xml-node-children channelnode)
+                 'feed time))
+          ;; gather all items for this feed
+          (mapc (lambda (node)
+                  (when (eq (xml-node-name node) 'item)
+                    (setq position (1+ position))
+                    (setq title (or (car (xml-node-children
+                                          (car (xml-get-children
+                                                node 'title))))
+                                    "[untitled]"))
+                    (setq link (or (car (xml-node-children
+                                         (car (xml-get-children
+                                               node 'link))))
+                                   ""))
+                    (setq desc (or
+                                (car (xml-node-children
+                                      (car (xml-get-children
+                                            node 'content:encoded))))
+                                (car (xml-node-children
+                                      (car (xml-get-children
+                                            node 'description))))))
+                    ;; use pubDate value if present
+                    (setq time (or (newsticker--decode-rfc822-date
+                                    (car (xml-node-children
+                                          (car (xml-get-children
+                                                node 'pubDate)))))
+                                   time))
+                    ;; use dc:date value if present
+                    (setq time (or (newsticker--decode-iso8601-date
+                                    (car (xml-node-children
+                                          (car (xml-get-children
+                                                node 'dc:date)))))
+                                   time))
+                    ;; It happened that the title or description
+                    ;; contained evil HTML code that confused the
+                    ;; xml parser.  Therefore:
+                    (unless (stringp title)
+                      (setq title (prin1-to-string title)))
+                    (unless (or (stringp desc) (not desc))
+                      (setq desc (prin1-to-string desc)))
+                    ;; ignore items with empty title AND empty desc
+                    (when (or (> (length title) 0)
+                              (> (length desc) 0))
+                      ;; apply coding system
+                      (when coding-system
+                        (setq title (newsticker--decode-coding-string
+                                     title coding-system))
+                        (if desc
+                            (setq desc (newsticker--decode-coding-string desc
+                                                             coding-system)))
+                        (setq link (newsticker--decode-coding-string
+                                    link coding-system)))
+                      ;; decode numeric entities
+                      (setq title (newsticker--decode-numeric-entities title))
+                      (when desc
+                        (setq desc  (newsticker--decode-numeric-entities desc)))
+                      (setq link (newsticker--decode-numeric-entities link))
+                      ;; remove whitespace from title, desc, and link
+                      (setq title (newsticker--remove-whitespace title))
+                      (setq desc (newsticker--remove-whitespace desc))
+                      (setq link (newsticker--remove-whitespace link))
+                      ;; add data to cache
+                      ;; do we have this item already?
+                      (let* ((tguid (assoc 'guid (xml-node-children node)))
+                             (guid (if (stringp tguid)
+                                       tguid
+                                     (car (xml-node-children tguid)))))
+                        ;;(message "guid=%s" guid)
+                        (setq old-item
+                              (newsticker--cache-contains newsticker--cache
+                                                          name-symbol title
+                                                          desc link nil guid)))
+                      ;; add this item, or mark it as old, or do nothing
+                      (let ((age1 'new)
+                            (age2 'old)
+                            (item-new-p nil))
+                        (if old-item
+                            (let ((prev-age (newsticker--age old-item)))
+                              (unless
+                                  newsticker-automatically-mark-items-as-old
+                                (if (eq prev-age 'obsolete-old)
+                                    (setq age2 'old)
+                                  (setq age2 'new)))
+                              (if (eq prev-age 'immortal)
+                                  (setq age2 'immortal)))
+                          ;; item was not there
+                          (setq item-new-p t)
+                          (setq something-was-added t))
+                        (setq newsticker--cache
+                              (newsticker--cache-add
+                               newsticker--cache name-symbol title desc link
+                               time age1 position (xml-node-children node)
+                               age2))
+                        (when item-new-p
+                          (let ((item (newsticker--cache-contains
+                                       newsticker--cache
+                                       name-symbol title
+                                       desc link nil)))
+                            (if newsticker-auto-mark-filter
+                                (newsticker--run-auto-mark-filter name item))
+                            (run-hook-with-args
+                             'newsticker-new-item-functions name item)))))))
+                (xml-get-children topnode 'item)))
+        ;; Remove those old items from cache which have been removed from
+        ;; the feed
+        (newsticker--cache-replace-age newsticker--cache
+                                       name-symbol 'obsolete-old 'deleteme)
+        (newsticker--cache-remove newsticker--cache name-symbol
+                                  'deleteme)
+        ;; Remove those new items from cache which have been removed from
+        ;; the feed.  Or keep them as `obsolete'
+        (if (not newsticker-keep-obsolete-items)
+            (newsticker--cache-remove newsticker--cache
+                                      name-symbol 'obsolete-new)
+          (setq newsticker--cache
+                (newsticker--cache-mark-expired
+                 newsticker--cache name-symbol 'obsolete 'obsolete-expired
+                 newsticker-obsolete-item-max-age))
+          (newsticker--cache-remove newsticker--cache
+                                    name-symbol 'obsolete-expired)
+          (newsticker--cache-replace-age newsticker--cache
+                                         name-symbol 'obsolete-new
+                                         'obsolete))
+        ;; bring cache data into proper order....
+        ;; (newsticker--cache-sort)
+        ;; setup scrollable text
+        (newsticker--ticker-text-setup)
+        (setq newsticker--latest-update-time (current-time))
+        (when something-was-added
+          ;; FIXME: should we care about removed items as well?
+          (newsticker--cache-update)
+          (newsticker--buffer-set-uptodate nil))
+        ;; kill the process buffer if wanted
+        (unless newsticker-debug
+          (kill-buffer (process-buffer process)))
+        ;; launch retrieval of image
+        (when (and imageurl
+                   (string-match "%l" newsticker-heading-format))
+          (newsticker--image-get name imageurl))))))
+
+(defun newsticker--display-tick ()
+  "Called from the display timer.
+This function calls a display function, according to the variable
+`newsticker-scroll-smoothly'."
+  (if newsticker-scroll-smoothly
+      (newsticker--display-scroll)
+    (newsticker--display-jump)))
+
+(defsubst newsticker--echo-area-clean-p ()
+  "Check whether somebody is using the echo area / minibuffer.
+Return t if echo area and minibuffer are unused."
+  (not (or (active-minibuffer-window)
+           (and (current-message)
+                (not (string= (current-message)
+                              newsticker--prev-message))))))
+
+(defun newsticker--display-jump ()
+  "Called from the display timer.
+This function displays the next ticker item in the echo area, unless
+there is another message displayed or the minibuffer is active."
+  (let ((message-log-max nil));; prevents message text from being logged
+    (when (newsticker--echo-area-clean-p)
+      (setq newsticker--item-position (1+ newsticker--item-position))
+      (when (>= newsticker--item-position (length newsticker--item-list))
+        (setq newsticker--item-position 0))
+      (setq newsticker--prev-message
+            (nth newsticker--item-position newsticker--item-list))
+      (message "%s" newsticker--prev-message))))
+
+(defun newsticker--display-scroll ()
+  "Called from the display timer.
+This function scrolls the ticker items in the echo area, unless
+there is another message displayed or the minibuffer is active."
+  (when (newsticker--echo-area-clean-p)
+    (let* ((width (- (frame-width) 1))
+           (message-log-max nil);; prevents message text from being logged
+           (i newsticker--item-position)
+           subtext
+           (s-text newsticker--scrollable-text)
+           (l (length s-text)))
+      ;; don't show anything if there is nothing to show
+      (unless (< (length s-text) 1)
+        ;; repeat the ticker string if it is shorter than frame width
+        (while (< (length s-text) width)
+          (setq s-text (concat s-text s-text)))
+        ;; get the width of the printed string
+        (setq l (length s-text))
+        (cond ((< i (- l width))
+               (setq subtext (substring s-text i (+ i width))))
+              (t
+               (setq subtext (concat
+                              (substring s-text i l)
+                              (substring s-text 0 (- width (- l i)))))))
+        ;; Take care of multibyte strings, for which (string-width) is
+        ;; larger than (length).
+        ;; Actually, such strings may be smaller than (frame-width)
+        ;; because return values of (string-width) are too large:
+        ;; (string-width "<japanese character>") => 2
+        (let ((t-width (1- (length subtext))))
+          (while (> (string-width subtext) width)
+            (setq subtext (substring subtext 0 t-width))
+            (setq t-width (1- t-width))))
+        ;; show the ticker text and save current position
+        (message "%s" subtext)
+        (setq newsticker--prev-message subtext)
+        (setq newsticker--item-position (1+ i))
+        (when (>= newsticker--item-position l)
+          (setq newsticker--item-position 0))))))
+
+;; ======================================================================
+;;; misc
+;; ======================================================================
+(defun newsticker--decode-coding-string (string coding-system)
+  "Wrapper around `decode-coding-string'.
+This functions passes the arguments STRING and CODING-SYSTEM to
+`decode-coding-string'.  If the decoding is successful the
+decoded string is returned, otherwise the unmodified input string
+is returned."
+  (condition-case nil
+      (decode-coding-string string coding-system)
+    (error
+     (message "Cannot decode encoded string `%s'" string)
+     string)))
+
+(defun newsticker--decode-numeric-entities (string)
+  "Decode SGML numeric entities by their respective utf characters.
+This function replaces numeric entities in the input STRING and
+returns the modified string.  For example \"&#42;\" gets replaced
+by \"*\"."
+  (let ((start 0))
+    (while (string-match "&#\\([0-9]+\\);" string start)
+      (condition-case nil
+          (setq string (replace-match
+                        (string (read (substring string (match-beginning 1)
+                                                 (match-end 1))))
+                        nil nil string))
+        (error nil))
+      (setq start (1+ (match-beginning 0))))
+    string))
+
+(defun newsticker--remove-whitespace (string)
+  "Remove leading and trailing whitespace from STRING."
+  ;; we must have ...+ but not ...* in the regexps otherwise xemacs loops
+  ;; endlessly...
+  (when string
+    (replace-regexp-in-string
+     "[ \t\r\n]+$" ""
+     (replace-regexp-in-string "^[ \t\r\n]+" "" string))))
+
+(defun newsticker--do-forget-preformatted (item)
+  "Forget all cached pre-formatted data.
+Remove the pre-formatted from `newsticker--cache'."
+  (if (nthcdr 7 item)
+      (setcar (nthcdr 7 item) nil))
+  (if (nthcdr 6 item)
+      (setcar (nthcdr 6 item) nil)))
+
+(defun newsticker--forget-preformatted ()
+  "Forget all cached pre-formatted data.
+Remove the pre-formatted from `newsticker--cache'."
+  (mapc (lambda (feed)
+          (mapc 'newsticker--do-forget-preformatted
+                (cdr feed)))
+        newsticker--cache)
+  (newsticker--buffer-set-uptodate nil))
+
+(defun newsticker--debug-msg (string &rest args)
+  "Print newsticker debug messages.
+This function calls `message' with arguments STRING and ARGS, if
+`newsticker-debug' is non-nil."
+  (and newsticker-debug
+       ;;(not (active-minibuffer-window))
+       ;;(not (current-message))
+       (apply 'message string args)))
+
+(defun newsticker--decode-iso8601-date (iso8601-string)
+  "Return ISO8601-STRING in format like `decode-time'.
+Converts from ISO-8601 to Emacs representation.  If ISO8601-STRING
+Examples:
+2004-09-17T05:09:49+00:00
+2004-09-17T05:09+00:00
+2004-09-17T05:09:49
+2004-09-17T05:09
+2004-09-17
+2004-09
+2004"
+  (if iso8601-string
+      (when (string-match
+             (concat
+              "\\([0-9]\\{4\\}\\)"
+              "\\(-\\([0-9]\\{2\\}\\)"
+              "\\(-\\([0-9]\\{2\\}\\)"
+              "\\(T"
+              "\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)"
+              "\\(:\\([0-9]\\{2\\}\\)\\)?"
+              "\\(\\([-+Z]\\)\\(\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)?"
+              "\\)?\\)?\\)?")
+             iso8601-string)
+        (let ((year (read (match-string 1 iso8601-string)))
+              (month (read (match-string 3 iso8601-string)))
+              (day (read (match-string 5 iso8601-string)))
+              (hour (read (or (match-string 7 iso8601-string)
+                              "0")))
+              (minute (read (or (match-string 8 iso8601-string)
+                                "0")))
+              ;;(second (read (or (match-string 10 iso8601-string)
+              ;; "0")))
+              (sign (match-string 12 iso8601-string))
+              (offset-hour (read (or (match-string 14 iso8601-string)
+                                     "0")))
+              (offset-minute (read (or (match-string 15 iso8601-string)
+                                       "0")))
+              (second 0))
+          (cond ((string= sign "+")
+                 (setq hour (- hour offset-hour))
+                 (setq minute (- minute offset-minute)))
+                ((string= sign "-")
+                 (setq hour (+ hour offset-hour))
+                 (setq minute (+ minute offset-minute))))
+          ;; if UTC subtract current-time-zone offset
+          ;;(setq second (+ (car (current-time-zone)) second)))
+
+          (condition-case nil
+              (encode-time second minute hour day month year t)
+            (error
+             (message "Cannot decode \"%s\"" iso8601-string)
+             nil))))
+    nil))
+
+(defun newsticker--decode-rfc822-date (rfc822-string)
+  "Return RFC822-STRING in format like `decode-time'.
+Converts from RFC822 to Emacs representation.
+Examples:
+Sat, 07 Sep 2002 00:00:01 GMT
+07 Sep 2002 00:00:01 GMT"
+  (if rfc822-string
+      (when (string-match
+             (concat
+              "\\s-*"
+              ;; week day
+              "\\(\\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\)\\s-*,?\\)\\s-+"
+              ;; day
+              "\\([0-9]\\{1,2\\}\\)\\s-+"
+              ;; month
+              "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|"
+              "Sep\\|Oct\\|Nov\\|Dec\\)\\s-+"
+              ;; year
+              "\\([0-9]\\{2,4\\}\\)\\s-+"
+              ;; hour
+              "\\([0-9]\\{2\\}\\)"
+              ;; minute
+              ":\\([0-9]\\{2\\}\\)"
+              ;; second
+              "\\(:\\([0-9]\\{2\\}\\)\\)?"
+              ;; zone -- fixme
+              "\\(\\s-+.*\\)?")
+             rfc822-string)
+        (let ((day (read (match-string 3 rfc822-string)))
+              (month-name (match-string 4 rfc822-string))
+              (month 0)
+              (year (read (match-string 5 rfc822-string)))
+              (hour (read (match-string 6 rfc822-string)))
+              (minute (read (match-string 7 rfc822-string)))
+              (second (read (or (match-string 9 rfc822-string)
+                                "0")))
+              ;;(zone (match-string 10 rfc822-string))
+              )
+          (condition-case error-data
+              (let ((i 1))
+                (mapc (lambda (m)
+                        (if (string= month-name m)
+                            (setq month i))
+                        (setq i (1+ i)))
+                      '("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug"
+                        "Sep" "Oct" "Nov" "Dec"))
+                (encode-time second minute hour day month year t))
+            (error
+             (message "Cannot decode \"%s\": %s %s" rfc822-string
+                      (car error-data) (cdr error-data))
+             nil))))
+      nil))
+
+(defun newsticker--lists-intersect-p (list1 list2)
+  "Return t if LIST1 and LIST2 share elements."
+  (let ((result nil))
+    (mapc (lambda (elt)
+            (if (memq elt list2)
+                (setq result t)))
+          list1)
+    result))
+
+;; ======================================================================
+;;; images
+;; ======================================================================
+(defun newsticker--image-get (feed-name url)
+  "Get image of the news site FEED-NAME from URL.
+If the image has been downloaded in the last 24h do nothing."
+  (let ((image-name (concat newsticker-imagecache-dirname "/"
+                            feed-name)))
+    (if (and (file-exists-p image-name)
+             (time-less-p (current-time)
+                          (time-add (nth 5 (file-attributes image-name))
+                                    (seconds-to-time 86400))))
+        (newsticker--debug-msg "%s: Getting image for %s skipped"
+                               (format-time-string "%A, %H:%M" (current-time))
+                               feed-name)
+      ;; download
+      (newsticker--debug-msg "%s: Getting image for %s"
+                             (format-time-string "%A, %H:%M" (current-time))
+                             feed-name)
+      (let* ((buffername (concat " *newsticker-wget-image-" feed-name "*"))
+             (item (or (assoc feed-name newsticker-url-list)
+                       (assoc feed-name newsticker-url-list-defaults)
+                       (error
+                        "Cannot get news for %s: Check newsticker-url-list"
+                        feed-name)))
+             (wget-arguments (or (car (cdr (cdr (cdr (cdr item)))))
+                                 newsticker-wget-arguments)))
+        (save-excursion
+          (set-buffer (get-buffer-create buffername))
+          (erase-buffer)
+          ;; throw an error if there is an old wget-process around
+          (if (get-process feed-name)
+              (error "Another wget-process is running for image %s"
+                     feed-name))
+          ;; start wget
+          (let* ((args (append wget-arguments (list url)))
+                 (proc (apply 'start-process feed-name buffername
+                              newsticker-wget-name args)))
+            (set-process-coding-system proc 'no-conversion 'no-conversion)
+            (set-process-sentinel proc 'newsticker--image-sentinel)))))))
+
+(defun newsticker--image-sentinel (process event)
+  "Sentinel for image-retrieving PROCESS caused by EVENT."
+  (let* ((p-status (process-status process))
+         (exit-status (process-exit-status process))
+         (feed-name (process-name process)))
+    ;; catch known errors (zombie processes, rubbish-xml etc.
+    ;; if an error occurs the news feed is not updated!
+    (catch 'oops
+      (unless (and (eq p-status 'exit)
+                   (= exit-status 0))
+        (message "%s: Error while retrieving image from %s"
+                 (format-time-string "%A, %H:%M" (current-time))
+                 feed-name)
+        (throw 'oops nil))
+      (let (image-name)
+        (save-excursion
+          (set-buffer (process-buffer process))
+          (setq image-name (concat newsticker-imagecache-dirname "/"
+                                   feed-name))
+          (set-buffer-file-coding-system 'no-conversion)
+          ;; make sure the cache dir exists
+          (unless (file-directory-p newsticker-imagecache-dirname)
+            (make-directory newsticker-imagecache-dirname))
+          ;; write and close buffer
+          (let ((require-final-newline nil)
+                (backup-inhibited t)
+                (coding-system-for-write 'no-conversion))
+            (write-region nil nil image-name nil 'quiet))
+          (set-buffer-modified-p nil)
+          (kill-buffer (current-buffer)))))))
+
+(defun newsticker--image-read (feed-name-symbol disabled)
+  "Read the cached image for FEED-NAME-SYMBOL from disk.
+If DISABLED is non-nil the image will be converted to a disabled look
+\(unless `newsticker-enable-logo-manipulations' is not t\).
+Return the image."
+  (let ((image-name (concat newsticker-imagecache-dirname "/"
+                            (symbol-name feed-name-symbol)))
+        (img nil))
+    (when (file-exists-p image-name)
+      (condition-case error-data
+          (setq img (create-image
+                     image-name nil nil
+                     :conversion (and newsticker-enable-logo-manipulations
+                                      disabled
+                                      'disabled)
+                     :mask (and newsticker-enable-logo-manipulations
+                                'heuristic)
+                     :ascent 70))
+        (error
+         (message "Error: cannot create image: %s"
+                  (cadr error-data)))))
+    img))
+
+;; ======================================================================
+;;; imenu stuff
+;; ======================================================================
+(defun newsticker--imenu-create-index ()
+  "Scan newsticker buffer and return an index for imenu."
+  (save-excursion
+    (goto-char (point-min))
+    (let ((index-alist nil)
+          (feed-list nil)
+          (go-ahead t))
+      (while go-ahead
+        (let ((type  (get-text-property (point) 'nt-type))
+              (title (get-text-property (point) 'nt-title)))
+          (cond ((eq type 'feed)
+                 ;; we're on a feed heading
+                 (when feed-list
+                   (if index-alist
+                       (nconc index-alist (list feed-list))
+                     (setq index-alist (list feed-list))))
+                 (setq feed-list (list title)))
+                (t
+                 (nconc feed-list
+                        (list (cons title (point)))))))
+	(setq go-ahead (newsticker--buffer-goto '(item feed))))
+      (if index-alist
+	  (nconc index-alist (list feed-list))
+	(setq index-alist (list feed-list)))
+      index-alist)))
+
+(defun newsticker--imenu-goto (name pos &rest args)
+  "Go item NAME at position POS and show item.
+ARGS are ignored."
+  (goto-char pos)
+  (newsticker-show-entry))
+
+;; ======================================================================
+;;; buffer stuff
+;; ======================================================================
+(defun newsticker--buffer-set-uptodate (value)
+  "Set the uptodate-status of the newsticker buffer to VALUE.
+The mode-line is changed accordingly."
+  (setq newsticker--buffer-uptodate-p value)
+  (let ((b (get-buffer "*newsticker*")))
+    (when b
+      (save-excursion
+       (set-buffer b)
+       (if value
+           (setq mode-name "Newsticker -- up to date -- ")
+         (setq mode-name "Newsticker -- NEED UPDATE -- ")))
+      (sit-for 0))))
+
+(defun newsticker--buffer-redraw ()
+  "Sometimes (CVS) Emacs forgets to update the window..."
+  (if (fboundp 'force-window-update)
+      (force-window-update (current-buffer))
+    (redraw-frame (selected-frame)))
+  (run-hooks 'newsticker-buffer-change-hook)
+  (sit-for 0))
+
+(defun newsticker--buffer-insert-all-items ()
+  "Insert all cached newsticker items into the current buffer.
+Keeps order of feeds as given in `newsticker-url-list' and
+`newsticker-url-list-defaults'."
+  (goto-char (point-min))
+  (mapc (lambda (url-item)
+          (let* ((feed-name (car url-item))
+                 (feed-name-symbol (intern feed-name))
+                 (feed (assoc feed-name-symbol newsticker--cache))
+                 (items (cdr feed))
+                 (pos (point)))
+            (when feed
+              ;; insert the feed description
+              (mapc (lambda (item)
+                      (when (eq (newsticker--age item) 'feed)
+                        (newsticker--buffer-insert-item item
+                                                        feed-name-symbol)))
+                    items)
+              ;;insert the items
+              (mapc (lambda (item)
+                      (if (memq (newsticker--age item) '(new immortal old
+                                                             obsolete))
+                          (newsticker--buffer-insert-item item
+                                                          feed-name-symbol)))
+                    items)
+              (put-text-property pos (point) 'feed (car feed))
+
+              ;; insert empty line between feeds
+              (let ((p (point)))
+                (insert "\n")
+                (put-text-property p (point) 'hard t)))))
+        (append newsticker-url-list newsticker-url-list-defaults))
+
+  (newsticker--buffer-set-faces (point-min) (point-max))
+  (newsticker--buffer-set-invisibility (point-min) (point-max))
+  (goto-char (point-min)))
+
+(defun newsticker--buffer-insert-item (item &optional feed-name-symbol)
+  "Insert a news item in the current buffer.
+Insert the string PREFIX and a formatted representation of the
+ITEM.  The optional parameter FEED-NAME-SYMBOL determines how the
+item is formatted and whether the item-retrieval time is added as
+well."
+  ;; insert headline
+  (if (eq (newsticker--age item) 'feed)
+      (newsticker--buffer-do-insert-text item 'feed feed-name-symbol)
+    (newsticker--buffer-do-insert-text item 'item feed-name-symbol))
+  ;; insert the description
+  (newsticker--buffer-do-insert-text item 'desc feed-name-symbol))
+
+(defun newsticker--buffer-do-insert-text (item type feed-name-symbol)
+  "Actually insert contents of news item, format it, render it and all that.
+ITEM is a news item, TYPE tells which part of the item shall be inserted,
+FEED-NAME-SYMBOL tells to which feed this item belongs."
+  (let* ((pos (point))
+         (format newsticker-desc-format)
+         (pos-date-start nil)
+         (pos-date-end nil)
+         (pos-stat-start nil)
+         (pos-stat-end nil)
+         (pos-text-start nil)
+         (pos-text-end nil)
+         (pos-extra-start nil)
+         (pos-extra-end nil)
+         (pos-enclosure-start nil)
+         (pos-enclosure-end nil)
+         (age (newsticker--age item))
+         (preformatted-contents (newsticker--preformatted-contents item))
+         (preformatted-title (newsticker--preformatted-title item)))
+    (cond ((and preformatted-contents
+                (not (eq (aref preformatted-contents 0) ?\n));; we must
+                                                       ;; NOT have a line
+                                                       ;; break!
+                (eq type 'desc))
+           (insert preformatted-contents))
+          ((and preformatted-title
+                (not (eq (aref preformatted-title 0) ?\n));; we must NOT have a
+                                                    ;; line break!
+                (eq type 'item))
+           (insert preformatted-title))
+          (t
+           ;; item was not formatted before.
+           ;; Let's go.
+           (if (eq type 'item)
+               (setq format newsticker-item-format)
+             (if (eq type 'feed)
+                 (setq format newsticker-heading-format)))
+
+           (while (> (length format) 0)
+             (let ((prefix (if (> (length format) 1)
+                               (substring format 0 2)
+                             "")))
+               (cond ((string= "%c" prefix)
+                      ;; contents
+                      (when (newsticker--desc item)
+                        (setq pos-text-start (point-marker))
+                        (insert (newsticker--desc item))
+                        (setq pos-text-end (point-marker)))
+                      (setq format (substring format 2)))
+                     ((string= "%d" prefix)
+                      ;; date
+                      (setq pos-date-start (point-marker))
+                      (if (newsticker--time item)
+                          (insert (format-time-string newsticker-date-format
+                                                      (newsticker--time item))))
+                      (setq pos-date-end (point-marker))
+                      (setq format (substring format 2)))
+                     ((string= "%l" prefix)
+                      ;; logo
+                      (let ((disabled (cond ((eq (newsticker--age item) 'feed)
+                                             (= (newsticker--stat-num-items
+                                                 feed-name-symbol 'new) 0))
+                                            (t
+                                             (not (eq (newsticker--age item)
+                                                      'new))))))
+                        (let ((img (newsticker--image-read feed-name-symbol
+                                                           disabled)))
+                          (when img
+                            (newsticker--insert-image img (car item)))))
+                      (setq format (substring format 2)))
+                     ((string= "%L" prefix)
+                      ;; logo or title
+                      (let ((disabled (cond ((eq (newsticker--age item) 'feed)
+                                             (= (newsticker--stat-num-items
+                                                 feed-name-symbol 'new) 0))
+                                            (t
+                                             (not (eq (newsticker--age item)
+                                                      'new))))))
+                        (let ((img (newsticker--image-read feed-name-symbol
+                                                           disabled)))
+                          (if img
+                              (newsticker--insert-image img (car item))
+                            (when (car item)
+                              (setq pos-text-start (point-marker))
+			      (if (eq (newsticker--age item) 'feed)
+				  (insert (newsticker--title item))
+				;; FIXME: This is not the "real" title!
+				(insert (format "%s"
+						(car (newsticker--cache-get-feed
+						      feed-name-symbol)))))
+                              (setq pos-text-end (point-marker))))))
+                      (setq format (substring format 2)))
+                     ((string= "%s" prefix)
+                      ;; statistics
+                      (setq pos-stat-start (point-marker))
+                      (if (eq (newsticker--age item) 'feed)
+                          (insert (newsticker--buffer-statistics
+                                   feed-name-symbol)))
+                      (setq pos-stat-end (point-marker))
+                      (setq format (substring format 2)))
+                     ((string= "%t" prefix)
+                      ;; title
+                      (when (car item)
+                        (setq pos-text-start (point-marker))
+                        (insert (car item))
+                        (setq pos-text-end (point-marker)))
+                      (setq format (substring format 2)))
+                     ((string-match "%." prefix)
+                      ;; unknown specifier!
+                      (insert prefix)
+                      (setq format (substring format 2)))
+                     ((string-match "^\\([^%]*\\)\\(.*\\)" format) ;; FIXME!
+                      ;; everything else
+                      (let ((p (point)))
+                        (insert (substring format
+                                           (match-beginning 1) (match-end 1)))
+                        ;; in case that the format string contained newlines
+                        (put-text-property p (point) 'hard t))
+                      (setq format (substring format (match-beginning 2)))))))
+
+           ;; decode HTML if possible...
+           (let ((is-rendered-HTML nil))
+             (when (and newsticker-html-renderer pos-text-start pos-text-end)
+               (condition-case error-data
+                   (save-excursion
+                     ;; check whether it is necessary to call html renderer
+                     ;; (regexp inspired by htmlr.el)
+                     (goto-char pos-text-start)
+                     (when (re-search-forward
+                            "</?[A-Za-z1-6]*\\|&#?[A-Za-z0-9]+;" pos-text-end t)
+                       ;; (message "%s" (newsticker--title item))
+                       (let ((w3m-fill-column (if newsticker-use-full-width
+                                                  -1 fill-column))
+                             (w3-maximum-line-length
+                              (if newsticker-use-full-width nil fill-column)))
+                         (save-excursion
+                           (funcall newsticker-html-renderer pos-text-start
+                                    pos-text-end)))
+                       (cond ((eq newsticker-html-renderer 'w3m-region)
+                              (add-text-properties pos (point-max)
+                                                   (list 'keymap
+                                                         w3m-minor-mode-map)))
+                             ((eq newsticker-html-renderer 'w3-region)
+                              (add-text-properties pos (point-max)
+                                                   (list 'keymap w3-mode-map))))
+                       (setq is-rendered-HTML t)))
+                 (error
+                  (message "Error: HTML rendering failed: %s, %s"
+                           (car error-data) (cdr error-data)))))
+             (when (and newsticker-justification
+                        (eq type 'desc)
+                        (not is-rendered-HTML))
+               (condition-case nil
+                   (let ((use-hard-newlines t))
+                     (fill-region pos (point-max) newsticker-justification))
+                 (error nil))))
+
+             ;; remove leading and trailing newlines
+           (goto-char pos)
+           (unless (= 0 (skip-chars-forward " \t\r\n"))
+             (delete-region pos (point)))
+           (goto-char (point-max))
+           (let ((end (point)))
+             (unless (= 0 (skip-chars-backward " \t\r\n" (1+ pos)))
+               (delete-region (point) end)))
+           (goto-char (point-max))
+
+           ;; closing newline
+           (unless nil ;;(eq pos (point))
+             (insert "\n")
+             (put-text-property (1- (point)) (point) 'hard t))
+
+           ;; insert enclosure element
+           (when (eq type 'desc)
+             (setq pos-enclosure-start (point))
+             (newsticker--buffer-insert-enclosure item)
+             (setq pos-enclosure-end (point)))
+
+           ;; show extra elements
+           (when (eq type 'desc)
+             (goto-char (point-max))
+             (setq pos-extra-start (point))
+             (mapc (lambda (extra-element)
+                     (unless (memq (car extra-element)
+                                   '(items link title description
+                                           content:encoded
+                                           dc:subject dc:date item guid
+                                           pubDate
+                                           enclosure))
+                       (newsticker--buffer-print-extra-element
+                        extra-element)))
+                   (newsticker--extra item))
+             (setq pos-extra-end (point)))
+
+           ;; text properties
+           (when (memq type '(feed item))
+             (add-text-properties pos (1- (point))
+                                  (list 'mouse-face 'highlight
+                                        'nt-link (newsticker--link item)
+                                        'help-echo
+                                        (format "mouse-2: visit item (%s)"
+                                                (newsticker--link item))
+                                        'keymap newsticker--url-keymap))
+             (add-text-properties pos (point)
+                                  (list 'nt-title (newsticker--title item)
+                                        'nt-desc (newsticker--desc item))))
+
+           (add-text-properties pos (point)
+                                (list 'nt-type type
+                                      'nt-face type
+                                      'nt-age  age
+                                      'nt-guid (newsticker--guid item)))
+           (when (and pos-date-start pos-date-end)
+             (put-text-property pos-date-start pos-date-end 'nt-face 'date))
+           (when (and pos-stat-start pos-stat-end)
+             (put-text-property pos-stat-start pos-stat-end 'nt-face 'stat))
+           (when (and pos-extra-start pos-extra-end)
+             (put-text-property pos-extra-start pos-extra-end
+                                'nt-face 'extra)
+             (put-text-property pos-extra-start pos-extra-end
+                                'nt-type 'extra))
+           (when (and pos-enclosure-start pos-enclosure-end
+                      (> pos-enclosure-end pos-enclosure-start))
+             (put-text-property pos-enclosure-start (1- pos-enclosure-end)
+                                'nt-face 'enclosure))
+
+           ;; left margin
+           ;;(unless (memq type '(feed item))
+           ;;(set-left-margin pos (1- (point)) 1))
+
+           ;; save rendered stuff
+           (cond ((eq type 'desc)
+		  ;; preformatted contents
+		  (newsticker--cache-set-preformatted-contents
+		   item (buffer-substring pos (point))))
+		  ((eq type 'item)
+		   ;; preformatted title
+		   (newsticker--cache-set-preformatted-title
+		    item (buffer-substring pos (point)))))))))
+
+(defun newsticker--buffer-print-extra-element (extra-element)
+  "Insert EXTRA-ELEMENT in a pretty form into the current buffer."
+  (insert (format "%s:\t" (car extra-element)))
+  (let (;;(attributes (cadr extra-element)) ;FIXME!!!!
+        (contents (cddr extra-element)))
+    (cond ((listp contents)
+           (mapc (lambda (i)
+                   (if (and (stringp i)
+                            (string-match "^http://.*" i))
+                       (let ((pos (point)))
+                         (insert i " ") ; avoid self-reference from the
+                                        ; nt-link thing
+                         (add-text-properties
+                          pos (point)
+                          (list 'mouse-face 'highlight
+                                'nt-link i
+                                'help-echo
+                                (format "mouse-2: visit (%s)" i)
+                                'keymap newsticker--url-keymap)))
+                         (insert (format "%s" i))))
+                 contents))
+          (t
+           (insert (format "%s" contents))))
+    (insert "\n")))
+
+(defun newsticker--buffer-insert-enclosure (item)
+  "Insert enclosure element of an RSS ITEM into the current buffer."
+  (let ((enclosure (newsticker--enclosure item))
+        (beg (point)))
+    (when enclosure
+      (let ((url (cdr (assoc 'url enclosure)))
+            (length (cdr (assoc 'length enclosure)))
+            (type (cdr (assoc 'type enclosure))))
+        (insert (format "Enclosed file (%s, %1.2f kBytes)" type
+                        (/ (string-to-number length) 1024)))
+        (add-text-properties beg (point)
+                             (list 'mouse-face 'highlight
+                                   'nt-link url
+                                   'help-echo (format
+                                               "mouse-2: visit (%s)" url)
+                                   'keymap newsticker--url-keymap
+                                   'nt-face 'enclosure
+                                   'nt-type 'desc))
+        (insert "\n")))))
+
+(defun newsticker--buffer-statistics (feed-name-symbol)
+  "Return a statistic string for the feed given by FEED-NAME-SYMBOL.
+See `newsticker-statistics-format'."
+  (let ((case-fold-search nil))
+    (replace-regexp-in-string
+     "%a"
+     (format "%d" (newsticker--stat-num-items feed-name-symbol))
+     (replace-regexp-in-string
+      "%i"
+      (format "%d" (newsticker--stat-num-items feed-name-symbol 'immortal))
+      (replace-regexp-in-string
+       "%n"
+       (format "%d" (newsticker--stat-num-items feed-name-symbol 'new))
+       (replace-regexp-in-string
+        "%o"
+        (format "%d" (newsticker--stat-num-items feed-name-symbol 'old))
+        (replace-regexp-in-string
+         "%O"
+         (format "%d" (newsticker--stat-num-items feed-name-symbol 'obsolete))
+         newsticker-statistics-format)))))))
+
+(defun newsticker--buffer-set-faces (start end)
+  "Add face properties according to mark property.
+Scans the buffer between START and END."
+  (save-excursion
+    ;;(put-text-property start end 'face 'newsticker-default-face)
+    (goto-char start)
+    (let ((pos1 start)
+          (pos2 1)
+          (nt-face (get-text-property start 'nt-face))
+          (nt-age (get-text-property start 'nt-age)))
+      (when nt-face
+        (setq pos2 (next-single-property-change (point) 'nt-face))
+        (newsticker--set-face-properties pos1 pos2 nt-face nt-age)
+        (setq nt-face (get-text-property pos2 'nt-face))
+        (setq pos1 pos2))
+      (while (and (setq pos2 (next-single-property-change pos1 'nt-face))
+                  (<= pos2 end)
+                  (> pos2 pos1))
+        (newsticker--set-face-properties pos1 pos2 nt-face nt-age)
+        (setq nt-face (get-text-property pos2 'nt-face))
+        (setq nt-age (get-text-property pos2 'nt-age))
+        (setq pos1 pos2)))))
+
+(defun newsticker--buffer-set-invisibility (start end)
+  "Add invisibility properties according to nt-type property.
+Scans the buffer between START and END.  Sets the 'invisible
+property to '(<nt-type>-<nt-age> <nt-type> <nt-age>)."
+  (save-excursion
+    ;; reset invisibility settings
+    (put-text-property start end 'invisible nil)
+    ;; let's go
+    (goto-char start)
+    (let ((pos1 start)
+          (pos2 1)
+          (nt-type (get-text-property start 'nt-type))
+          (nt-age (get-text-property start 'nt-age)))
+      (when nt-type
+        (setq pos2 (next-single-property-change (point) 'nt-type))
+        (put-text-property (max (point-min) pos1) (1- pos2)
+                           'invisible
+                           (list (intern
+                                  (concat
+                                   (symbol-name
+                                    (if (eq nt-type 'extra) 'desc nt-type))
+                                   "-"
+                                   (symbol-name nt-age)))
+                                 nt-type
+                                 nt-age))
+        (setq nt-type (get-text-property pos2 'nt-type))
+        (setq pos1 pos2))
+      (while (and (setq pos2 (next-single-property-change pos1 'nt-type))
+                  (<= pos2 end)
+                  (> pos2 pos1))
+        ;; must shift one char to the left in order to handle inivisible
+        ;; newlines, motion in invisible text areas and all that correctly
+        (put-text-property (1- pos1) (1- pos2)
+                           'invisible
+                           (list (intern
+                                  (concat
+                                   (symbol-name
+                                    (if (eq nt-type 'extra) 'desc nt-type))
+                                   "-"
+                                   (symbol-name nt-age)))
+                                 nt-type
+                                 nt-age))
+        (setq nt-type (get-text-property pos2 'nt-type))
+        (setq nt-age (get-text-property pos2 'nt-age))
+        (setq pos1 pos2)))))
+
+(defun newsticker--set-face-properties (pos1 pos2 nt-face age)
+  "Set the face for the text between the positions POS1 and POS2.
+The face is chosen according the values of NT-FACE and AGE."
+  (let ((face (cond ((eq nt-face 'feed)
+                     'newsticker-feed-face)
+                    ((eq nt-face 'item)
+                     (cond ((eq age 'new)
+                            'newsticker-new-item-face)
+                           ((eq age 'old)
+                            'newsticker-old-item-face)
+                           ((eq age 'immortal)
+                            'newsticker-immortal-item-face)
+                           ((eq age 'obsolete)
+                            'newsticker-obsolete-item-face)))
+                    ((eq nt-face 'date)
+                     'newsticker-date-face)
+                    ((eq nt-face 'stat)
+                     'newsticker-statistics-face)
+                    ((eq nt-face 'extra)
+                     'newsticker-extra-face)
+                    ((eq nt-face 'enclosure)
+                     'newsticker-enclosure-face))))
+    (when face
+      (put-text-property pos1 (max pos1 pos2) 'face face))))
+
+(defun newsticker--insert-image (img string)
+  "Insert IMG with STRING at point.
+This is a work-around for a strange behavior of Emacs versions before
+21.3.50.  Images inserted with `insert-image' vanished after doing
+`fill-region'."
+  ;; This should work:
+  ;;(insert-image img string)
+  ;; but it does not. Therefore we do this, which should be equivalent!
+  (let ((pos (point)))
+    ;;(insert string)
+    (insert ":-)")
+    (add-text-properties pos (point) (list 'display img))))
+
+;; ======================================================================
+;;; HTML rendering
+;; ======================================================================
+(defun newsticker-htmlr-render (pos1 pos2) ;
+  "Replacement for `htmlr-render'.
+Renders the HTML code in the region POS1 to POS2 using htmlr."
+  (let ((str (buffer-substring-no-properties pos1 pos2)))
+    (delete-region pos1 pos2)
+    (insert
+     (with-temp-buffer
+       (insert str)
+       (goto-char (point-min))
+       ;; begin original htmlr-render
+       (htmlr-reset)
+       ;; something omitted here...
+       (while (< (point) (point-max))
+         (htmlr-step))
+       ;; end original htmlr-render
+       (newsticker--remove-whitespace (buffer-string))))))
+
+;; ======================================================================
+;;; Functions working on the *newsticker* buffer
+;; ======================================================================
+(defun newsticker--buffer-make-item-completely-visible ()
+  "Scroll buffer until current item is completely visible."
+  (switch-to-buffer (get-buffer-create "*newsticker*"))
+  (when newsticker--auto-narrow-to-feed
+    (let* ((min (or (save-excursion (newsticker--buffer-beginning-of-feed))
+                    (point-min)))
+           (max (or (save-excursion (newsticker--buffer-end-of-feed))
+                    (point-max))))
+      (narrow-to-region min max)))
+  (when newsticker--auto-narrow-to-item
+    (let* ((min (or (save-excursion (newsticker--buffer-beginning-of-item))
+                    (point-min)))
+           (max (or (save-excursion (newsticker--buffer-end-of-item))
+                    (point-max))))
+      (narrow-to-region min max)))
+  (sit-for 0)
+  ;; do not count lines and stuff because that does not work when images
+  ;; are displayed. Do it the simple way:
+  (save-excursion
+    (newsticker--buffer-end-of-item)
+    (unless (pos-visible-in-window-p)
+      (recenter -1)))
+  (unless (pos-visible-in-window-p)
+    (recenter 0)))
+
+(defun newsticker--buffer-get-feed-title-at-point ()
+  "Return feed symbol of headline at point."
+  (format "%s" (or (get-text-property (point) 'feed) " ")))
+
+(defun newsticker--buffer-get-item-title-at-point ()
+  "Return feed symbol of headline at point."
+  (format "%s" (or (get-text-property (point) 'nt-title) " ")))
+
+(defun newsticker--buffer-goto (types &optional age backwards)
+  "Search next occurrence of TYPES in current buffer.
+TYPES is a list of symbols.  If TYPES is found point is moved, if
+not point is left unchanged.  If optional parameter AGE is not
+nil, the type AND the age must match.  If BACKWARDS is t, search
+backwards."
+  (let ((pos (save-excursion
+	       (save-restriction
+		 (widen)
+		 (catch 'found
+		   (let ((tpos (point)))
+		     (while (setq tpos
+				  (if backwards
+				      (if (eq tpos (point-min))
+					  nil
+					(or (previous-single-property-change
+					     tpos 'nt-type)
+					    (point-min)))
+				    (next-single-property-change
+				     tpos 'nt-type)))
+		       (and (memq (get-text-property tpos 'nt-type) types)
+			    (or (not age)
+				(eq (get-text-property tpos 'nt-age) age))
+			    (throw 'found tpos)))))))))
+    (when pos
+      (goto-char pos))
+    pos))
+
+(defun newsticker--buffer-hideshow (mark-age onoff )
+  "Hide or show items of type MARK-AGE.
+If ONOFF is nil the item is hidden, otherwise it is shown."
+  (if onoff
+      (remove-from-invisibility-spec mark-age )
+    (add-to-invisibility-spec mark-age)))
+
+(defun newsticker--buffer-beginning-of-item ()
+  "Move point to the beginning of the item at point.
+Return new position."
+  (if (bobp)
+      (point)
+    (let ((type (get-text-property (point) 'nt-type))
+          (typebefore (get-text-property (1- (point)) 'nt-type)))
+      (if (and (memq type '(item feed))
+                   (not (eq type typebefore)))
+          (point)
+        (newsticker--buffer-goto '(item feed) nil t)
+        (point)))))
+
+(defun newsticker--buffer-beginning-of-feed ()
+  "Move point to the beginning of the feed at point.
+Return new position."
+  (if (bobp)
+      (point)
+    (let ((type (get-text-property (point) 'nt-type))
+          (typebefore (get-text-property (1- (point)) 'nt-type)))
+      (if (and (memq type '(feed))
+                   (not (eq type typebefore)))
+          (point)
+        (newsticker--buffer-goto '(feed) nil t)
+        (point)))))
+
+(defun newsticker--buffer-end-of-item ()
+  "Move point to the end of the item at point.
+Take care: end of item is at the end of its last line!"
+  (when (newsticker--buffer-goto '(item feed nil))
+    (point)))
+
+(defun newsticker--buffer-end-of-feed ()
+  "Move point to the end of the last item of the feed at point.
+Take care: end of item is at the end of its last line!"
+  (when (newsticker--buffer-goto '(feed nil))
+    (backward-char 1)
+    (point)))
+
+;; ======================================================================
+;;; manipulation of ticker text
+;; ======================================================================
+(defun newsticker--ticker-text-setup ()
+  "Build the ticker text which is scrolled or flashed in the echo area."
+  ;; reset scrollable text
+  (setq newsticker--scrollable-text "")
+  (setq newsticker--item-list nil)
+  (setq newsticker--item-position 0)
+  ;; build scrollable text from cache data
+  (let ((have-something nil))
+    (mapc
+     (lambda (feed)
+       (let ((feed-name (symbol-name (car feed))))
+         (let ((num-new (newsticker--stat-num-items (car feed) 'new))
+               (num-old (newsticker--stat-num-items (car feed) 'old))
+               (num-imm (newsticker--stat-num-items (car feed) 'immortal))
+               (num-obs (newsticker--stat-num-items (car feed) 'obsolete)))
+           (when (or (> num-new 0)
+                     (and (> num-old 0)
+                          (not newsticker-hide-old-items-in-echo-area))
+                     (and (> num-imm 0)
+                          (not newsticker-hide-immortal-items-in-echo-area))
+                     (and (> num-obs 0)
+                          (not newsticker-hide-obsolete-items-in-echo-area)))
+             (setq have-something t)
+             (mapc
+              (lambda (item)
+                (let ((title (replace-regexp-in-string
+                              "[\r\n]+" " "
+                              (newsticker--title item)))
+                      (age (newsticker--age item)))
+                  (unless (string= title newsticker--error-headline)
+                    (when
+                        (or (eq age 'new)
+                            (and (eq age 'old)
+                                 (not newsticker-hide-old-items-in-echo-area))
+                            (and (eq age 'obsolete)
+                                 (not
+                                  newsticker-hide-obsolete-items-in-echo-area))
+                            (and (eq age 'immortal)
+                                 (not
+                                  newsticker-hide-immortal-items-in-echo-area)))
+                      (setq title (newsticker--remove-whitespace title))
+                      ;; add to flash list
+                      (add-to-list 'newsticker--item-list
+                                   (concat feed-name ": " title) t)
+                      ;; and to the scrollable text
+                      (setq newsticker--scrollable-text
+                            (concat newsticker--scrollable-text
+                                    " " feed-name ": " title " +++"))))))
+                (cdr feed))))))
+     newsticker--cache)
+    (when have-something
+      (setq newsticker--scrollable-text
+            (concat "+++ "
+                    (format-time-string "%A, %H:%M"
+                                        newsticker--latest-update-time)
+                    " ++++++" newsticker--scrollable-text)))))
+
+(defun newsticker--ticker-text-remove (feed title)
+  "Remove the item of FEED with TITLE from the ticker text."
+  ;; reset scrollable text
+  (setq newsticker--item-position 0)
+  (let ((feed-name (symbol-name feed))
+        (t-title (replace-regexp-in-string "[\r\n]+" " " title)))
+    ;; remove from flash list
+    (setq newsticker--item-list (remove (concat feed-name ": " t-title)
+                                        newsticker--item-list))
+    ;; and from the scrollable text
+    (setq newsticker--scrollable-text
+          (replace-regexp-in-string
+           (regexp-quote (concat " " feed-name ": " t-title " +++"))
+           ""
+           newsticker--scrollable-text))
+    (if (string-match (concat "^\\+\\+\\+ [A-Z][a-z]+, "
+                              "[012]?[0-9]:[0-9][0-9] \\+\\+\\+\\+\\+\\+$")
+                              newsticker--scrollable-text)
+        (setq newsticker--scrollable-text ""))))
+
+;; ======================================================================
+;;; manipulation of cached data
+;; ======================================================================
+(defun newsticker--cache-set-preformatted-contents (item contents)
+  "Set preformatted contents of ITEM to CONTENTS."
+  (if (nthcdr 6 item)
+      (setcar (nthcdr 6 item) contents)
+    (setcdr (nthcdr 5 item) (list contents))))
+
+(defun newsticker--cache-set-preformatted-title (item title)
+  "Set preformatted title of ITEM to TITLE."
+  (if (nthcdr 7 item)
+      (setcar (nthcdr 7 item) title)
+    (setcdr (nthcdr 6 item) title)))
+
+(defun newsticker--cache-replace-age (data feed old-age new-age)
+  "Mark all items in DATA in FEED which carry age OLD-AGE with NEW-AGE.
+If FEED is 'any it applies to all feeds.  If OLD-AGE is 'any,
+all marks are replaced by NEW-AGE.  Removes all pre-formatted contents."
+  (mapc (lambda (a-feed)
+          (when (or (eq feed 'any)
+                    (eq (car a-feed) feed))
+            (let ((items (cdr a-feed)))
+              (mapc (lambda (item)
+                      (when (or (eq old-age 'any)
+                                (eq (newsticker--age item) old-age))
+                        (setcar (nthcdr 4 item) new-age)
+                        (newsticker--do-forget-preformatted item)))
+                    items))))
+        data)
+  data)
+
+(defun newsticker--cache-mark-expired (data feed old-age new-age time)
+  "Mark all expired entries.
+This function sets the age entries in DATA in the feed FEED.  If
+an item's age is OLD-AGE it is set to NEW-AGE if the item is
+older than TIME."
+  (mapc
+   (lambda (a-feed)
+     (when (or (eq feed 'any)
+               (eq (car a-feed) feed))
+       (let ((items (cdr a-feed)))
+         (mapc
+          (lambda (item)
+            (when (eq (newsticker--age item) old-age)
+              (let ((exp-time (time-add (newsticker--time item)
+                                        (seconds-to-time time))))
+                (when (time-less-p exp-time (current-time))
+                  (newsticker--debug-msg
+                   "Item `%s' from %s has expired on %s"
+                   (newsticker--title item)
+                   (format-time-string "%Y-%02m-%d, %H:%M"
+                                       (newsticker--time item))
+                   (format-time-string "%Y-%02m-%d, %H:%M" exp-time))
+                  (setcar (nthcdr 4 item) new-age)))))
+          items))))
+   data)
+  data)
+
+(defun newsticker--cache-contains (data feed title desc link age
+                                        &optional guid)
+  "Check DATA whether FEED contains an item with the given properties.
+This function returns the contained item or nil if it is not
+contained.
+The properties which are checked are TITLE, DESC, LINK, AGE, and
+GUID.  In general all properties must match in order to return a
+certain item, except for the following cases.
+
+If AGE equals 'feed the TITLE, DESCription and LINK do not
+matter. If DESC is nil it is ignored as well.  If
+`newsticker-desc-comp-max' is non-nil, only the first
+`newsticker-desc-comp-max' characters of DESC are taken into
+account.
+
+If GUID is non-nil it is sufficient to match this value, and the
+other properties are ignored."
+  (condition-case nil
+      (catch 'found
+        (when (and desc newsticker-desc-comp-max
+                   (> (length desc) newsticker-desc-comp-max))
+          (setq desc (substring desc 0 newsticker-desc-comp-max)))
+        (mapc
+         (lambda (this-feed)
+           (when (eq (car this-feed) feed)
+             (mapc (lambda (anitem)
+                     (when (or
+                            ;; global unique id can match
+                            (and guid
+                                 (string= guid (newsticker--guid anitem)))
+                            ;; or title, desc, etc.
+                            (and
+                             ;;(or (not (eq age 'feed))
+			     ;;  (eq (newsticker--age anitem) 'feed))
+                             (string= (newsticker--title anitem)
+                                      title)
+                             (or (not link)
+                                 (string= (newsticker--link anitem)
+                                          link))
+                             (or (not desc)
+                                 (if (and desc newsticker-desc-comp-max
+                                          (> (length (newsticker--desc anitem))
+                                             newsticker-desc-comp-max))
+                                     (string= (substring
+                                               (newsticker--desc anitem)
+                                               0 newsticker-desc-comp-max)
+                                              desc)
+                                   (string= (newsticker--desc anitem)
+                                            desc)))))
+                       (throw 'found anitem)))
+                   (cdr this-feed))))
+         data)
+        nil)
+    (error nil)))
+
+(defun newsticker--cache-add (data feed-name-symbol title desc link time age
+                                   position extra-elements
+                                   &optional updated-age updated-time
+                                   preformatted-contents
+                                   preformatted-title)
+  "Add another item to cache data.
+Add to DATA in the FEED-NAME-SYMBOL an item with TITLE, DESC,
+LINK, TIME, AGE, POSITION, and EXTRA-ELEMENTS.  If this item is
+contained already, its mark is set to UPDATED-AGE, its time is
+set to UPDATED-TIME, and its pre-formatted contents is set to
+PREFORMATTED-CONTENTS and PREFORMATTED-TITLE.  Returns the age
+which the item got."
+  (let ((item (newsticker--cache-contains data feed-name-symbol title
+                                          desc link age)))
+    (if item
+      ;; does exist already -- change age, update time and position
+        (progn
+          (if (nthcdr 5 item)
+              (setcar (nthcdr 5 item) position)
+            (setcdr (nthcdr 4 item) (list position)))
+          (setcar (nthcdr 4 item) updated-age)
+          (if updated-time
+              (setcar (nthcdr 3 item) updated-time))
+          ;; replace cached pre-formatted contents
+	  (newsticker--cache-set-preformatted-contents
+	   item preformatted-contents)
+	  (newsticker--cache-set-preformatted-title
+	   item preformatted-title))
+      ;; did not exist or age equals 'feed-name-symbol
+      (catch 'found
+        (mapc (lambda (this-feed)
+                (when (eq (car this-feed) feed-name-symbol)
+                  (setcdr this-feed (nconc (cdr this-feed)
+                                           (list (list title desc link
+                                                       time age position
+                                                       preformatted-contents
+                                                       preformatted-title
+                                                       extra-elements))))
+                  (throw 'found this-feed)))
+              data)
+        ;; the feed is not contained
+        (add-to-list 'data (list feed-name-symbol
+                                 (list title desc link time age position
+                                       preformatted-contents
+                                       preformatted-title
+                                       extra-elements))
+                     t))))
+  data)
+
+(defun newsticker--cache-remove (data feed-symbol age)
+  "Remove all entries from DATA in the feed FEED-SYMBOL with AGE.
+FEED-SYMBOL may be 'any.  Entries from old feeds, which are no longer in
+`newsticker-url-list' or `newsticker-url-list-defaults', are removed as
+well."
+  (let* ((pos data)
+         (feed (car pos))
+         (last-pos nil))
+    (while feed
+      (if (or (assoc (symbol-name (car feed)) newsticker-url-list)
+              (assoc (symbol-name (car feed)) newsticker-url-list-defaults))
+          ;; feed is still valid=active
+          ;; (message "Keeping feed %s" (car feed))
+          (if  (or (eq feed-symbol 'any)
+                   (eq feed-symbol (car feed)))
+              (let* ((item-pos (cdr feed))
+                     (item (car item-pos))
+                     (prev-pos nil))
+                (while item
+                  ;;(message "%s" (car item))
+                  (if (eq age (newsticker--age item))
+                      ;; remove this item
+                      (progn
+                        ;;(message "Removing item %s" (car item))
+                        (if prev-pos
+                            (setcdr prev-pos (cdr item-pos))
+                          (setcdr feed (cdr item-pos))))
+                    ;;(message "Keeping item %s" (car item))
+                    (setq prev-pos item-pos))
+                  (setq item-pos (cdr item-pos))
+                  (setq item (car item-pos)))))
+        ;; feed is not active anymore
+        ;; (message "Removing feed %s" (car feed))
+        (if last-pos
+            (setcdr last-pos (cdr pos))
+          (setq data (cdr pos))))
+      (setq last-pos pos)
+      (setq pos (cdr pos))
+      (setq feed (car pos)))))
+
+;; ======================================================================
+;;; Sorting
+;; ======================================================================
+(defun newsticker--cache-item-compare-by-time (item1 item2)
+  "Compare two news items ITEM1 and ITEM2 by comparing their time values."
+  (catch 'result
+    (let ((age1 (newsticker--age item1))
+          (age2 (newsticker--age item2)))
+      (if (not (eq age1 age2))
+          (cond ((eq age1 'obsolete)
+                 (throw 'result nil))
+                ((eq age2 'obsolete)
+                 (throw 'result t)))))
+    (let* ((time1 (newsticker--time item1))
+           (time2 (newsticker--time item2)))
+      (cond ((< (nth 0 time1) (nth 0 time2))
+             nil)
+            ((> (nth 0 time1) (nth 0 time2))
+             t)
+            ((< (nth 1 time1) (nth 1 time2))
+             nil)
+            ((> (nth 1 time1) (nth 1 time2))
+             t)
+            ((< (or (nth 2 time1) 0) (or (nth 2 time2) 0))
+             nil)
+            ((> (or (nth 2 time1) 0) (or (nth 2 time2) 0))
+             t)
+            (t
+             nil)))))
+
+(defun newsticker--cache-item-compare-by-title (item1 item2)
+  "Compare ITEM1 and ITEM2 by comparing their titles."
+  (catch 'result
+    (let ((age1 (newsticker--age item1))
+          (age2 (newsticker--age item2)))
+      (if (not (eq age1 age2))
+          (cond ((eq age1 'obsolete)
+                 (throw 'result nil))
+                ((eq age2 'obsolete)
+                 (throw 'result t)))))
+    (string< (newsticker--title item1) (newsticker--title item2))))
+
+(defun newsticker--cache-item-compare-by-position (item1 item2)
+  "Compare ITEM1 and ITEM2 by comparing their original positions."
+  (catch 'result
+    (let ((age1 (newsticker--age item1))
+          (age2 (newsticker--age item2)))
+      (if (not (eq age1 age2))
+          (cond ((eq age1 'obsolete)
+                 (throw 'result nil))
+                ((eq age2 'obsolete)
+                 (throw 'result t)))))
+    (< (or (newsticker--pos item1) 0) (or (newsticker--pos item2) 0))))
+
+(defun newsticker--cache-sort ()
+  "Sort the newsticker cache data."
+  (let ((sort-fun (cond ((eq newsticker-sort-method 'sort-by-time)
+                         'newsticker--cache-item-compare-by-time)
+                        ((eq newsticker-sort-method 'sort-by-title)
+                         'newsticker--cache-item-compare-by-title)
+                        ((eq newsticker-sort-method 'sort-by-original-order)
+                         'newsticker--cache-item-compare-by-position))))
+    (mapc (lambda (feed-list)
+            (setcdr feed-list (sort (cdr feed-list)
+                                    sort-fun)))
+          newsticker--cache)))
+
+(defun newsticker--cache-update (&optional save)
+  "Update newsticker cache file.
+If optional argument SAVE is not nil the cache file is saved to disk."
+  (save-excursion
+    (let ((coding-system-for-write 'utf-8)
+          (buf (find-file-noselect newsticker-cache-filename)))
+      (when buf
+        (set-buffer buf)
+        (setq buffer-undo-list t)
+        (erase-buffer)
+        (insert ";; -*- coding: utf-8 -*-\n")
+        (insert (prin1-to-string newsticker--cache))
+        (when save
+          (save-buffer))))))
+
+(defun newsticker--cache-get-feed (feed)
+  "Return the cached data for the feed FEED.
+FEED is a symbol!"
+  (assoc feed newsticker--cache))
+
+;; ======================================================================
+;;; Statistics
+;; ======================================================================
+(defun newsticker--stat-num-items (feed &optional age)
+  "Return number of items in the given FEED which have the given AGE.
+If AGE is nil, the total number items is returned."
+  (let ((items (cdr (newsticker--cache-get-feed feed)))
+        (num 0))
+    (while items
+      (if age
+          (if (eq (newsticker--age (car items)) age)
+              (setq num (1+ num)))
+        (if (memq (newsticker--age (car items)) '(new old immortal obsolete))
+              (setq num (1+ num))))
+      (setq items (cdr items)))
+    num))
+
+;; ======================================================================
+;;; OPML
+;; ======================================================================
+(defun newsticker-opml-export ()
+  "OPML subscription export.
+Export subscriptions to a buffer in OPML Format."
+  (interactive)
+  (with-current-buffer (get-buffer-create "*OPML Export*")
+    (set-buffer-file-coding-system 'utf-8)
+    (insert (concat
+             "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
+             "<!-- OPML generated by Emacs newsticker.el -->\n"
+             "<opml version=\"1.0\">\n"
+             "  <head>\n"
+             "    <title>mySubscriptions</title>\n"
+             "    <dateCreated>" (format-time-string "%a, %d %b %Y %T %z")
+             "</dateCreated>\n"
+             "    <ownerEmail>" user-mail-address "</ownerEmail>\n"
+             "    <ownerName>" (user-full-name) "</ownerName>\n"
+             "  </head>\n"
+             "  <body>\n"))
+    (mapc (lambda (sub)
+            (insert "    <outline text=\"")
+            (insert (newsticker--title sub))
+            (insert "\" xmlUrl=\"")
+            (insert (cadr sub))
+            (insert "\"/>\n"))
+          (append newsticker-url-list newsticker-url-list-defaults))
+    (insert "  </body>\n</opml>\n"))
+  (pop-to-buffer "*OPML Export*")
+  (when (fboundp 'sgml-mode)
+    (sgml-mode)))
+
+(defun newsticker-opml-import (filename)
+  "Import OPML data from FILENAME."
+  (interactive "fOPML file: ")
+  (set-buffer (find-file-noselect filename))
+  (goto-char (point-min))
+  (let* ((node-list (xml-parse-region (point-min) (point-max)))
+         (body (car (xml-get-children (car node-list) 'body)))
+         (outlines (xml-get-children body 'outline)))
+    (mapc (lambda (outline)
+            (let ((name (xml-get-attribute outline 'text))
+                  (url (xml-get-attribute outline 'xmlUrl)))
+              (add-to-list 'newsticker-url-list
+                           (list name url nil nil nil) t)))
+          outlines))
+  (customize-variable 'newsticker-url-list))
+
+;; ======================================================================
+;;; Auto marking
+;; ======================================================================
+(defun newsticker--run-auto-mark-filter (feed item)
+  "Automatically mark an item as old or immortal.
+This function checks the variable `newsticker-auto-mark-filter'
+for an entry that matches FEED and ITEM."
+ (let ((case-fold-search t))
+    (mapc (lambda (filter)
+            (let ((filter-feed (car filter))
+                  (old-list (nth 1 filter))
+                  (imm-list (nth 2 filter)))
+            (when (string-match filter-feed feed)
+              (newsticker--do-run-auto-mark-filter item 'old old-list)
+              (newsticker--do-run-auto-mark-filter item 'immortal imm-list))))
+          newsticker-auto-mark-filter)))
+
+(defun newsticker--do-run-auto-mark-filter (item age list)
+  "Actually compare ITEM AGE LIST against `newsticker-auto-mark-filter'."
+  (mapc (lambda (pattern)
+          (when (string-match pattern (newsticker--title item))
+            (setcar (nthcdr 4 item) age)))
+        list))
+
+
+;; ======================================================================
+;;; hook samples
+;; ======================================================================
+(defun newsticker-new-item-functions-sample (feed item)
+  "Demonstrate the use of the `newsticker-new-item-functions' hook.
+This function just prints out the values of the FEED and title of the ITEM."
+  (message (concat "newsticker-new-item-functions-sample: feed=`%s', "
+                   "title=`%s'")
+           feed (newsticker--title item)))
+
+(defun newsticker-download-images (feed item)
+  "Download the first image.
+If FEED equals \"imagefeed\" download the first image URL found
+in the description=contents of ITEM to the directory
+\"~/tmp/newsticker/FEED/TITLE\" where TITLE is the title of the item."
+  (when (string= feed "imagefeed")
+    (let ((title (newsticker--title item))
+          (desc (newsticker--desc item)))
+      (when (string-match "<img src=\"\\(http://[^ \"]+\\)\"" desc)
+        (let ((url (substring desc (match-beginning 1) (match-end 1)))
+              (temp-dir (concat "~/tmp/newsticker/" feed "/" title))
+              (org-dir default-directory))
+          (unless (file-directory-p temp-dir)
+            (make-directory temp-dir t))
+          (cd temp-dir)
+          (message "Getting image %s" url)
+          (apply 'start-process "wget-image"
+                 " *newsticker-wget-download-images*"
+                 newsticker-wget-name
+                 (list url))
+          (cd org-dir))))))
+
+(defun newsticker-download-enclosures (feed item)
+  "In all FEEDs download the enclosed object of the news ITEM.
+The object is saved to the directory \"~/tmp/newsticker/FEED/TITLE\", which
+is created if it does not exist. TITLE is the title of the news
+item. Argument FEED is ignored.
+This function is suited for adding it to `newsticker-new-item-functions'."
+  (let ((title (newsticker--title item))
+        (enclosure (newsticker--enclosure item)))
+    (when enclosure
+      (let ((url (cdr (assoc 'url enclosure)))
+            (temp-dir (concat "~/tmp/newsticker/" feed "/" title))
+            (org-dir default-directory))
+        (unless (file-directory-p temp-dir)
+          (make-directory temp-dir t))
+        (cd temp-dir)
+        (message "Getting enclosure %s" url)
+        (apply 'start-process "wget-enclosure"
+               " *newsticker-wget-download-enclosures*"
+               newsticker-wget-name
+               (list url))
+        (cd org-dir)))))
+
+
+(provide 'newsticker)
+
+;; arch-tag: ab761dfa-67bc-4207-bc64-4307271dc381
+;;; newsticker.el ends here
--- a/lisp/net/tramp.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/net/tramp.el	Mon Sep 19 10:20:33 2005 +0000
@@ -822,9 +822,11 @@
   :type '(repeat string))
 
 (defcustom tramp-login-prompt-regexp
-  ".*ogin: *"
+  ".*ogin\\( .*\\)?: *"
   "*Regexp matching login-like prompts.
-The regexp should match at end of buffer."
+The regexp should match at end of buffer.
+
+Sometimes the prompt is reported to look like \"login as:\"."
   :group 'tramp
   :type 'regexp)
 
--- a/lisp/obsolete/fast-lock.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/obsolete/fast-lock.el	Mon Sep 19 10:20:33 2005 +0000
@@ -226,10 +226,10 @@
               (progn
                 (when temp-message
                   (setq current-message (current-message))
-                  (message temp-message))
+                  (message "%s" temp-message))
                 ,@body)
            (when temp-message
-             (message current-message))))))
+             (message "%s" current-message))))))
  ;;
  ;; We use this for compatibility with a future Emacs.
  (or (fboundp 'defcustom)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/obsolete/iso-insert.el	Mon Sep 19 10:20:33 2005 +0000
@@ -0,0 +1,632 @@
+;;; iso-insert.el --- insert functions for ISO 8859/1  -*- coding: iso-8859-1;-*-
+
+;; Copyright (C) 1987, 1994, 2001 Free Software Foundation, Inc.
+
+;; Author: Howard Gayle
+;; Maintainer: FSF
+;; Keywords: i18n
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; Provides keys for inserting ISO Latin-1 characters.  They use the
+;; prefix key C-x 8.  Type C-x 8 C-h for a list.
+
+;;; Code:
+
+(defun insert-no-break-space ()
+   (interactive "*")
+   (insert ?\ )
+)
+
+(defun insert-inverted-exclamation-mark ()
+   (interactive "*")
+   (insert ?\¡)
+)
+
+(defun insert-cent-sign ()
+   (interactive "*")
+   (insert ?\¢)
+)
+
+(defun insert-pound-sign ()
+   (interactive "*")
+   (insert ?\£)
+)
+
+(defun insert-general-currency-sign ()
+   (interactive "*")
+   (insert ?\¤)
+)
+
+(defun insert-yen-sign ()
+   (interactive "*")
+   (insert ?\¥)
+)
+
+(defun insert-broken-vertical-line ()
+   (interactive "*")
+   (insert ?\¦)
+)
+
+(defun insert-section-sign ()
+   (interactive "*")
+   (insert ?\§)
+)
+
+(defun insert-diaeresis ()
+   (interactive "*")
+   (insert ?\¨)
+)
+
+(defun insert-copyright-sign ()
+   (interactive "*")
+   (insert ?\©)
+)
+
+(defun insert-ordinal-indicator-feminine ()
+   (interactive "*")
+   (insert ?\ª)
+)
+
+(defun insert-angle-quotation-mark-left ()
+   (interactive "*")
+   (insert ?\«)
+)
+
+(defun insert-not-sign ()
+   (interactive "*")
+   (insert ?\¬)
+)
+
+(defun insert-soft-hyphen ()
+   (interactive "*")
+   (insert ?\­)
+)
+
+(defun insert-registered-sign ()
+   (interactive "*")
+   (insert ?\®)
+)
+
+(defun insert-macron ()
+   (interactive "*")
+   (insert ?\¯)
+)
+
+(defun insert-degree-sign ()
+   (interactive "*")
+   (insert ?\°)
+)
+
+(defun insert-plus-or-minus-sign ()
+   (interactive "*")
+   (insert ?\±)
+)
+
+(defun insert-superscript-two ()
+   (interactive "*")
+   (insert ?\²)
+)
+
+(defun insert-superscript-three ()
+   (interactive "*")
+   (insert ?\³)
+)
+
+(defun insert-acute-accent ()
+   (interactive "*")
+   (insert ?\´)
+)
+
+(defun insert-micro-sign ()
+   (interactive "*")
+   (insert ?\µ)
+)
+
+(defun insert-pilcrow ()
+   (interactive "*")
+   (insert ?\¶)
+)
+
+(defun insert-middle-dot ()
+   (interactive "*")
+   (insert ?\·)
+)
+
+(defun insert-cedilla ()
+   (interactive "*")
+   (insert ?\¸)
+)
+
+(defun insert-superscript-one ()
+   (interactive "*")
+   (insert ?\¹)
+)
+
+(defun insert-ordinal-indicator-masculine ()
+   (interactive "*")
+   (insert ?\º)
+)
+
+(defun insert-angle-quotation-mark-right ()
+   (interactive "*")
+   (insert ?\»)
+)
+
+(defun insert-fraction-one-quarter ()
+   (interactive "*")
+   (insert ?\¼)
+)
+
+(defun insert-fraction-one-half ()
+   (interactive "*")
+   (insert ?\½)
+)
+
+(defun insert-fraction-three-quarters ()
+   (interactive "*")
+   (insert ?\¾)
+)
+
+(defun insert-inverted-question-mark ()
+   (interactive "*")
+   (insert ?\¿)
+)
+
+(defun insert-A-grave ()
+   (interactive "*")
+   (insert ?\À)
+)
+
+(defun insert-A-acute ()
+   (interactive "*")
+   (insert ?\Á)
+)
+
+(defun insert-A-circumflex ()
+   (interactive "*")
+   (insert ?\Â)
+)
+
+(defun insert-A-tilde ()
+   (interactive "*")
+   (insert ?\Ã)
+)
+
+(defun insert-A-umlaut ()
+   (interactive "*")
+   (insert ?\Ä)
+)
+
+(defun insert-A-ring ()
+   (interactive "*")
+   (insert ?\Å)
+)
+
+(defun insert-AE ()
+   (interactive "*")
+   (insert ?\Æ)
+)
+
+(defun insert-C-cedilla ()
+   (interactive "*")
+   (insert ?\Ç)
+)
+
+(defun insert-E-grave ()
+   (interactive "*")
+   (insert ?\È)
+)
+
+(defun insert-E-acute ()
+   (interactive "*")
+   (insert ?\É)
+)
+
+(defun insert-E-circumflex ()
+   (interactive "*")
+   (insert ?\Ê)
+)
+
+(defun insert-E-umlaut ()
+   (interactive "*")
+   (insert ?\Ë)
+)
+
+(defun insert-I-grave ()
+   (interactive "*")
+   (insert ?\Ì)
+)
+
+(defun insert-I-acute ()
+   (interactive "*")
+   (insert ?\Í)
+)
+
+(defun insert-I-circumflex ()
+   (interactive "*")
+   (insert ?\Î)
+)
+
+(defun insert-I-umlaut ()
+   (interactive "*")
+   (insert ?\Ï)
+)
+
+(defun insert-D-stroke ()
+   (interactive "*")
+   (insert ?\Ð)
+)
+
+(defun insert-N-tilde ()
+   (interactive "*")
+   (insert ?\Ñ)
+)
+
+(defun insert-O-grave ()
+   (interactive "*")
+   (insert ?\Ò)
+)
+
+(defun insert-O-acute ()
+   (interactive "*")
+   (insert ?\Ó)
+)
+
+(defun insert-O-circumflex ()
+   (interactive "*")
+   (insert ?\Ô)
+)
+
+(defun insert-O-tilde ()
+   (interactive "*")
+   (insert ?\Õ)
+)
+
+(defun insert-O-umlaut ()
+   (interactive "*")
+   (insert ?\Ö)
+)
+
+(defun insert-multiplication-sign ()
+   (interactive "*")
+   (insert ?\×)
+)
+
+(defun insert-O-slash ()
+   (interactive "*")
+   (insert ?\Ø)
+)
+
+(defun insert-U-grave ()
+   (interactive "*")
+   (insert ?\Ù)
+)
+
+(defun insert-U-acute ()
+   (interactive "*")
+   (insert ?\Ú)
+)
+
+(defun insert-U-circumflex ()
+   (interactive "*")
+   (insert ?\Û)
+)
+
+(defun insert-U-umlaut ()
+   (interactive "*")
+   (insert ?\Ü)
+)
+
+(defun insert-Y-acute ()
+   (interactive "*")
+   (insert ?\Ý)
+)
+
+(defun insert-THORN ()
+   (interactive "*")
+   (insert ?\Þ)
+)
+
+(defun insert-ss ()
+   (interactive "*")
+   (insert ?\ß)
+)
+
+(defun insert-a-grave ()
+   (interactive "*")
+   (insert ?\à)
+)
+
+(defun insert-a-acute ()
+   (interactive "*")
+   (insert ?\á)
+)
+
+(defun insert-a-circumflex ()
+   (interactive "*")
+   (insert ?\â)
+)
+
+(defun insert-a-tilde ()
+   (interactive "*")
+   (insert ?\ã)
+)
+
+(defun insert-a-umlaut ()
+   (interactive "*")
+   (insert ?\ä)
+)
+
+(defun insert-a-ring ()
+   (interactive "*")
+   (insert ?\å)
+)
+
+(defun insert-ae ()
+   (interactive "*")
+   (insert ?\æ)
+)
+
+(defun insert-c-cedilla ()
+   (interactive "*")
+   (insert ?\ç)
+)
+
+(defun insert-e-grave ()
+   (interactive "*")
+   (insert ?\è)
+)
+
+(defun insert-e-acute ()
+   (interactive "*")
+   (insert ?\é)
+)
+
+(defun insert-e-circumflex ()
+   (interactive "*")
+   (insert ?\ê)
+)
+
+(defun insert-e-umlaut ()
+   (interactive "*")
+   (insert ?\ë)
+)
+
+(defun insert-i-grave ()
+   (interactive "*")
+   (insert ?\ì)
+)
+
+(defun insert-i-acute ()
+   (interactive "*")
+   (insert ?\í)
+)
+
+(defun insert-i-circumflex ()
+   (interactive "*")
+   (insert ?\î)
+)
+
+(defun insert-i-umlaut ()
+   (interactive "*")
+   (insert ?\ï)
+)
+
+(defun insert-d-stroke ()
+   (interactive "*")
+   (insert ?\ð)
+)
+
+(defun insert-n-tilde ()
+   (interactive "*")
+   (insert ?\ñ)
+)
+
+(defun insert-o-grave ()
+   (interactive "*")
+   (insert ?\ò)
+)
+
+(defun insert-o-acute ()
+   (interactive "*")
+   (insert ?\ó)
+)
+
+(defun insert-o-circumflex ()
+   (interactive "*")
+   (insert ?\ô)
+)
+
+(defun insert-o-tilde ()
+   (interactive "*")
+   (insert ?\õ)
+)
+
+(defun insert-o-umlaut ()
+   (interactive "*")
+   (insert ?\ö)
+)
+
+(defun insert-division-sign ()
+   (interactive "*")
+   (insert ?\÷)
+)
+
+(defun insert-o-slash ()
+   (interactive "*")
+   (insert ?\ø)
+)
+
+(defun insert-u-grave ()
+   (interactive "*")
+   (insert ?\ù)
+)
+
+(defun insert-u-acute ()
+   (interactive "*")
+   (insert ?\ú)
+)
+
+(defun insert-u-circumflex ()
+   (interactive "*")
+   (insert ?\û)
+)
+
+(defun insert-u-umlaut ()
+   (interactive "*")
+   (insert ?\ü)
+)
+
+(defun insert-y-acute ()
+   (interactive "*")
+   (insert ?\ý)
+)
+
+(defun insert-thorn ()
+   (interactive "*")
+   (insert ?\þ)
+)
+
+(defun insert-y-umlaut ()
+   (interactive "*")
+   (insert ?\ÿ)
+)
+
+(defvar 8859-1-map nil "Keymap for ISO 8859/1 character insertion.")
+(if 8859-1-map nil
+   (setq 8859-1-map (make-keymap))
+   (define-key 8859-1-map " "    'insert-no-break-space)
+   (define-key 8859-1-map "!"    'insert-inverted-exclamation-mark)
+   (define-key 8859-1-map "\""   (make-sparse-keymap))
+   (define-key 8859-1-map "\"\"" 'insert-diaeresis)
+   (define-key 8859-1-map "\"A"  'insert-A-umlaut)
+   (define-key 8859-1-map "\"E"  'insert-E-umlaut)
+   (define-key 8859-1-map "\"I"  'insert-I-umlaut)
+   (define-key 8859-1-map "\"O"  'insert-O-umlaut)
+   (define-key 8859-1-map "\"U"  'insert-U-umlaut)
+   (define-key 8859-1-map "\"a"  'insert-a-umlaut)
+   (define-key 8859-1-map "\"e"  'insert-e-umlaut)
+   (define-key 8859-1-map "\"i"  'insert-i-umlaut)
+   (define-key 8859-1-map "\"o"  'insert-o-umlaut)
+   (define-key 8859-1-map "\"u"  'insert-u-umlaut)
+   (define-key 8859-1-map "\"y"  'insert-y-umlaut)
+   (define-key 8859-1-map "'"    (make-sparse-keymap))
+   (define-key 8859-1-map "''"   'insert-acute-accent)
+   (define-key 8859-1-map "'A"   'insert-A-acute)
+   (define-key 8859-1-map "'E"   'insert-E-acute)
+   (define-key 8859-1-map "'I"   'insert-I-acute)
+   (define-key 8859-1-map "'O"   'insert-O-acute)
+   (define-key 8859-1-map "'U"   'insert-U-acute)
+   (define-key 8859-1-map "'Y"   'insert-Y-acute)
+   (define-key 8859-1-map "'a"   'insert-a-acute)
+   (define-key 8859-1-map "'e"   'insert-e-acute)
+   (define-key 8859-1-map "'i"   'insert-i-acute)
+   (define-key 8859-1-map "'o"   'insert-o-acute)
+   (define-key 8859-1-map "'u"   'insert-u-acute)
+   (define-key 8859-1-map "'y"   'insert-y-acute)
+   (define-key 8859-1-map "$"    'insert-general-currency-sign)
+   (define-key 8859-1-map "+"    'insert-plus-or-minus-sign)
+   (define-key 8859-1-map ","    (make-sparse-keymap))
+   (define-key 8859-1-map ",,"   'insert-cedilla)
+   (define-key 8859-1-map ",C"   'insert-C-cedilla)
+   (define-key 8859-1-map ",c"   'insert-c-cedilla)
+   (define-key 8859-1-map "-"    'insert-soft-hyphen)
+   (define-key 8859-1-map "."    'insert-middle-dot)
+   (define-key 8859-1-map "/"    (make-sparse-keymap))
+   (define-key 8859-1-map "//"   'insert-division-sign)
+   (define-key 8859-1-map "/O"   'insert-O-slash)
+   (define-key 8859-1-map "/o"   'insert-o-slash)
+   (define-key 8859-1-map "1"    (make-sparse-keymap))
+   (define-key 8859-1-map "1/"   (make-sparse-keymap))
+   (define-key 8859-1-map "1/2"  'insert-fraction-one-half)
+   (define-key 8859-1-map "1/4"  'insert-fraction-one-quarter)
+   (define-key 8859-1-map "3"    (make-sparse-keymap))
+   (define-key 8859-1-map "3/"   (make-sparse-keymap))
+   (define-key 8859-1-map "3/4"  'insert-fraction-three-quarters)
+   (define-key 8859-1-map "<"    'insert-angle-quotation-mark-left)
+   (define-key 8859-1-map "="    'insert-macron)
+   (define-key 8859-1-map ">"    'insert-angle-quotation-mark-right)
+   (define-key 8859-1-map "?"    'insert-inverted-question-mark)
+   (define-key 8859-1-map "A"    'insert-A-ring)
+   (define-key 8859-1-map "E"    'insert-AE)
+   (define-key 8859-1-map "C"    'insert-copyright-sign)
+   (define-key 8859-1-map "D"    'insert-D-stroke)
+   (define-key 8859-1-map "L"    'insert-pound-sign)
+   (define-key 8859-1-map "P"    'insert-pilcrow)
+   (define-key 8859-1-map "R"    'insert-registered-sign)
+   (define-key 8859-1-map "S"    'insert-section-sign)
+   (define-key 8859-1-map "T"    'insert-THORN)
+   (define-key 8859-1-map "Y"    'insert-yen-sign)
+   (define-key 8859-1-map "^"    (make-sparse-keymap))
+   (define-key 8859-1-map "^1"   'insert-superscript-one)
+   (define-key 8859-1-map "^2"   'insert-superscript-two)
+   (define-key 8859-1-map "^3"   'insert-superscript-three)
+   (define-key 8859-1-map "^A"   'insert-A-circumflex)
+   (define-key 8859-1-map "^E"   'insert-E-circumflex)
+   (define-key 8859-1-map "^I"   'insert-I-circumflex)
+   (define-key 8859-1-map "^O"   'insert-O-circumflex)
+   (define-key 8859-1-map "^U"   'insert-U-circumflex)
+   (define-key 8859-1-map "^a"   'insert-a-circumflex)
+   (define-key 8859-1-map "^e"   'insert-e-circumflex)
+   (define-key 8859-1-map "^i"   'insert-i-circumflex)
+   (define-key 8859-1-map "^o"   'insert-o-circumflex)
+   (define-key 8859-1-map "^u"   'insert-u-circumflex)
+   (define-key 8859-1-map "_"    (make-sparse-keymap))
+   (define-key 8859-1-map "_a"   'insert-ordinal-indicator-feminine)
+   (define-key 8859-1-map "_o"   'insert-ordinal-indicator-masculine)
+   (define-key 8859-1-map "`"    (make-sparse-keymap))
+   (define-key 8859-1-map "`A"   'insert-A-grave)
+   (define-key 8859-1-map "`E"   'insert-E-grave)
+   (define-key 8859-1-map "`I"   'insert-I-grave)
+   (define-key 8859-1-map "`O"   'insert-O-grave)
+   (define-key 8859-1-map "`U"   'insert-U-grave)
+   (define-key 8859-1-map "`a"   'insert-a-grave)
+   (define-key 8859-1-map "`e"   'insert-e-grave)
+   (define-key 8859-1-map "`i"   'insert-i-grave)
+   (define-key 8859-1-map "`o"   'insert-o-grave)
+   (define-key 8859-1-map "`u"   'insert-u-grave)
+   (define-key 8859-1-map "a"    'insert-a-ring)
+   (define-key 8859-1-map "e"    'insert-ae)
+   (define-key 8859-1-map "c"    'insert-cent-sign)
+   (define-key 8859-1-map "d"    'insert-d-stroke)
+   (define-key 8859-1-map "o"    'insert-degree-sign)
+   (define-key 8859-1-map "s"    'insert-ss)
+   (define-key 8859-1-map "t"    'insert-thorn)
+   (define-key 8859-1-map "u"    'insert-micro-sign)
+   (define-key 8859-1-map "x"    'insert-multiplication-sign)
+   (define-key 8859-1-map "|"    'insert-broken-vertical-line)
+   (define-key 8859-1-map "~"    (make-sparse-keymap))
+   (define-key 8859-1-map "~A"   'insert-A-tilde)
+   (define-key 8859-1-map "~N"   'insert-N-tilde)
+   (define-key 8859-1-map "~O"   'insert-O-tilde)
+   (define-key 8859-1-map "~a"   'insert-a-tilde)
+   (define-key 8859-1-map "~n"   'insert-n-tilde)
+   (define-key 8859-1-map "~o"   'insert-o-tilde)
+   (define-key 8859-1-map "~~"   'insert-not-sign)
+   (if (not (lookup-key global-map "\C-x8"))
+      (define-key global-map "\C-x8" 8859-1-map))
+)
+(defalias '8859-1-map 8859-1-map)
+
+(provide 'iso-insert)
+
+;;; arch-tag: eb5f97bd-a034-4851-92ff-ab1f1bf92814
+;;; iso-insert.el ends here
--- a/lisp/pcomplete.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/pcomplete.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1138,7 +1138,7 @@
 		    (fboundp 'Info-goto-node))
 	       (listp pcomplete-help)))
       (if (listp pcomplete-help)
-	  (message (eval pcomplete-help))
+	  (message "%s" (eval pcomplete-help))
 	(save-window-excursion (info))
 	(switch-to-buffer-other-window "*info*")
 	(funcall (symbol-function 'Info-goto-node) pcomplete-help))
--- a/lisp/pcvs-defs.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/pcvs-defs.el	Mon Sep 19 10:20:33 2005 +0000
@@ -38,11 +38,14 @@
   "*Name or full path of the cvs executable.")
 
 (defvar cvs-version
+  ;; With the divergence of the CVSNT codebase and version numbers, this is
+  ;; not really good any more.
   (ignore-errors
     (with-temp-buffer
       (call-process cvs-program nil t nil "-v")
       (goto-char (point-min))
-      (when (re-search-forward "(CVS) \\([0-9]+\\)\\.\\([0-9]+\\)" nil t)
+      (when (re-search-forward "(CVS\\(NT\\)?) \\([0-9]+\\)\\.\\([0-9]+\\)"
+                               nil t)
 	(cons (string-to-number (match-string 1))
 	      (string-to-number (match-string 2))))))
   "*Version of `cvs' installed on your system.
@@ -490,8 +493,11 @@
 ;; cvs-1.10 and above can take file arguments in other directories
 ;; while others need to be executed once per directory
 (defvar cvs-execute-single-dir
-  (if (and (consp cvs-version)
-	    (or (>= (cdr cvs-version) 10) (> (car cvs-version) 1)))
+  (if (or (null cvs-version)
+          (or (>= (cdr cvs-version) 10) (> (car cvs-version) 1)))
+      ;; Supposedly some recent versions of CVS output some directory info
+      ;; as they recurse downthe tree, but it's not good enough in the case
+      ;; where we run "cvs status foo bar/foo".
       '("status")
     t)
   "Whether cvs commands should be executed a directory at a time.
@@ -506,7 +512,7 @@
 a case the sanity check made by pcl-cvs fails and you will have to manually
 set this variable to t (until the cvs server is upgraded).
 When the above problem occurs, pcl-cvs should (hopefully) catch cvs' error
-message and replace it with a message tell you to change this variable.")
+message and replace it with a message telling you to change this variable.")
 
 ;;
 (provide 'pcvs-defs)
--- a/lisp/pcvs.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/pcvs.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1171,7 +1171,7 @@
   (interactive)
   (if (eq last-command 'cvs-help)
       (describe-function 'cvs-mode)   ; would need minor-mode for log-edit-mode
-    (message
+    (message "%s"
      (substitute-command-keys
       "`\\[cvs-help]':help `\\[cvs-mode-add]':add `\\[cvs-mode-commit]':commit \
 `\\[cvs-mode-diff-map]':diff* `\\[cvs-mode-log]':log \
--- a/lisp/play/decipher.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/play/decipher.el	Mon Sep 19 10:20:33 2005 +0000
@@ -600,7 +600,7 @@
 (defun decipher-show-alphabet ()
   "Display the current cipher alphabet in the message line."
   (interactive)
-  (message
+  (message "%s"
    (mapconcat (lambda (a)
                 (concat
                  (char-to-string (car a))
--- a/lisp/play/landmark.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/play/landmark.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1473,7 +1473,7 @@
   (lm-plot-square (lm-point-square) 1)
   (incf lm-number-of-moves)
   (if lm-output-moves
-      (message (format "Moves made: %d" lm-number-of-moves))))
+      (message "Moves made: %d" lm-number-of-moves)))
 
 
 (defun lm-random-move ()
--- a/lisp/play/zone.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/play/zone.el	Mon Sep 19 10:20:33 2005 +0000
@@ -179,7 +179,7 @@
         (error
          (funcall restore)
          (while (not (input-pending-p))
-           (message (format "We were zoning when we wrote %s..." pgm))
+           (message "We were zoning when we wrote %s..." pgm)
            (sit-for 3)
            (message "...here's hoping we didn't hose your buffer!")
            (sit-for 3)))
--- a/lisp/printing.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/printing.el	Mon Sep 19 10:20:33 2005 +0000
@@ -4,7 +4,7 @@
 
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
-;; Time-stamp: <2005/06/11 19:51:32 vinicius>
+;; Time-stamp: <2005-09-18 05:57:14 deego>
 ;; Keywords: wp, print, PostScript
 ;; Version: 6.8.4
 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
@@ -6424,7 +6424,7 @@
     ;; handlers
     ((quit error)
      (ding)
-     (message (error-message-string data)))))
+     (message "%s" (error-message-string data)))))
 
 
 (defun pr-interface-printify (&rest ignore)
@@ -6449,7 +6449,7 @@
     ;; handlers
     ((quit error)
      (ding)
-     (message (error-message-string data)))))
+     (message "%s" (error-message-string data)))))
 
 
 (defun pr-interface-ps-print (&rest ignore)
@@ -6515,7 +6515,7 @@
     ;; handlers
     ((quit error)
      (ding)
-     (message (error-message-string data)))))
+     (message "%s" (error-message-string data)))))
 
 
 (defun pr-i-ps-send ()
--- a/lisp/progmodes/ada-mode.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/ada-mode.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1539,7 +1539,7 @@
 
     (ada-save-exceptions-to-file file-name)
 
-    (message (concat "Defining " word " as a casing exception"))))
+    (message "%s" (concat "Defining " word " as a casing exception"))))
 
 (defun ada-case-read-exceptions-from-file (file-name)
   "Read the content of the casing exception file FILE-NAME."
@@ -2191,17 +2191,17 @@
 
       (if (equal (cdr cur-indent) '(0))
 	  (message (concat "same indentation as line " (number-to-string line)))
-	(message (mapconcat (lambda(x)
-			      (cond
-			       ((symbolp x)
-				(symbol-name x))
-			       ((numberp x)
-				(number-to-string x))
-			       ((listp x)
-				(concat "- " (symbol-name (cadr x))))
-			       ))
-			    (cdr cur-indent)
-			    " + "))))
+	(message "%s" (mapconcat (lambda(x)
+				   (cond
+				    ((symbolp x)
+				     (symbol-name x))
+				    ((numberp x)
+				     (number-to-string x))
+				    ((listp x)
+				     (concat "- " (symbol-name (cadr x))))
+				    ))
+				 (cdr cur-indent)
+				 " + "))))
     (save-excursion
       (goto-char (car cur-indent))
       (sit-for 1))))
@@ -2214,7 +2214,7 @@
 
   (while command-line-args-left
     (let ((source (car command-line-args-left)))
-      (message (concat "formating " source))
+      (message "Formating %s" source)
       (find-file source)
       (ada-indent-region (point-min) (point-max))
       (ada-adjust-case-buffer)
--- a/lisp/progmodes/ada-xref.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/ada-xref.el	Mon Sep 19 10:20:33 2005 +0000
@@ -325,7 +325,7 @@
       ;; Check if there is an environment variable with the same name
       (if (null value)
 	  (if (not (setq value (getenv name)))
-	      (message (concat "No environment variable " name " found"))))
+	      (message "%s" (concat "No environment variable " name " found"))))
 
       (cond
        ((null value)
--- a/lisp/progmodes/cmacexp.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/cmacexp.el	Mon Sep 19 10:20:33 2005 +0000
@@ -346,13 +346,13 @@
 		    (format "\n#line %d \"%s\"\n" startlinenum filename)))
 
 	  ;; Call the preprocessor.
-	  (if display (message mymsg))
+	  (if display (message "%s" mymsg))
 	  (setq exit-status
 		(call-process-region 1 (point-max)
 				     shell-file-name
 				     t (list t tempname) nil "-c"
 				     cppcommand))
-	  (if display (message (concat mymsg "done")))
+	  (if display (message "%s" (concat mymsg "done")))
 	  (if (= (buffer-size) 0)
 	      ;; Empty output is normal after a fatal error.
 	      (insert "\nPreprocessor produced no output\n")
--- a/lisp/progmodes/compile.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/compile.el	Mon Sep 19 10:20:33 2005 +0000
@@ -307,7 +307,7 @@
 (defcustom compilation-error-regexp-alist
   (mapcar 'car compilation-error-regexp-alist-alist)
   "Alist that specifies how to match errors in compiler output.
-Note that on Unix everything is a valid filename, so these
+On GNU and Unix, any string is a valid filename, so these
 matchers must make some common sense assumptions, which catch
 normal cases.  A shorter list will be lighter on resource usage.
 
@@ -436,6 +436,7 @@
 			 (string :tag "Directory")))
   :group 'compilation)
 
+;;;###autoload
 (defcustom compile-command "make -k "
   "*Last shell command used to do a compilation; default for next compilation.
 
@@ -452,6 +453,7 @@
   :type 'string
   :group 'compilation)
 
+;;;###autoload
 (defcustom compilation-disable-input nil
   "*If non-nil, send end-of-file as compilation process input.
 This only affects platforms that support asynchronous processes (see
@@ -664,24 +666,26 @@
       (move-to-column col)
     (goto-char (min (+ (line-beginning-position) col) (line-end-position)))))
 
-(defun compilation-internal-error-properties (file line end-line col end-col type fmt)
+(defun compilation-internal-error-properties (file line end-line col end-col type fmts)
   "Get the meta-info that will be added as text-properties.
 LINE, END-LINE, COL, END-COL are integers or nil.
-TYPE can be 0, 1, or 2.
-FILE should be (ABSOLUTE-FILENAME) or (RELATIVE-FILENAME . DIRNAME) or nil."
+TYPE can be 0, 1, or 2, meaning error, warning, or just info.
+FILE should be (FILENAME) or (RELATIVE-FILENAME . DIRNAME) or nil.
+FMTS is a list of format specs for transforming the file name.
+ (See `compilation-error-regexp-alist'.)"
   (unless file (setq file '("*unknown*")))
-  (setq file (compilation-get-file-structure file fmt))
-  ;; Get first already existing marker (if any has one, all have one).
-  ;; Do this first, as the compilation-assq`s may create new nodes.
-  (let* ((marker-line (car (cddr file)))	; a line structure
+  (let* ((file-struct (compilation-get-file-structure file fmts))
+	 ;; Get first already existing marker (if any has one, all have one).
+	 ;; Do this first, as the compilation-assq`s may create new nodes.
+	 (marker-line (car (cddr file-struct)))	; a line structure
 	 (marker (nth 3 (cadr marker-line)))	; its marker
 	 (compilation-error-screen-columns compilation-error-screen-columns)
 	 end-marker loc end-loc)
     (if (not (and marker (marker-buffer marker)))
-	(setq marker)			; no valid marker for this file
+	(setq marker nil)		; no valid marker for this file
       (setq loc (or line 1))		; normalize no linenumber to line 1
       (catch 'marker			; find nearest loc, at least one exists
-	(dolist (x (nthcdr 3 file))	; loop over remaining lines
+	(dolist (x (nthcdr 3 file-struct))	; loop over remaining lines
 	  (if (> (car x) loc)		; still bigger
 	      (setq marker-line x)
 	    (if (> (- (or (car marker-line) 1) loc)
@@ -710,17 +714,18 @@
 	    (forward-to-indentation 0))
 	  (setq marker (list (point-marker))))))
 
-    (setq loc (compilation-assq line (cdr file)))
+    (setq loc (compilation-assq line (cdr file-struct)))
     (if end-line
-	(setq end-loc (compilation-assq end-line (cdr file))
+	(setq end-loc (compilation-assq end-line (cdr file-struct))
 	      end-loc (compilation-assq end-col end-loc))
       (if end-col			; use same line element
 	  (setq end-loc (compilation-assq end-col loc))))
     (setq loc (compilation-assq col loc))
     ;; If they are new, make the loc(s) reference the file they point to.
-    (or (cdr loc) (setcdr loc `(,line ,file ,@marker)))
+    (or (cdr loc) (setcdr loc `(,line ,file-struct ,@marker)))
     (if end-loc
-	(or (cdr end-loc) (setcdr end-loc `(,(or end-line line) ,file ,@end-marker))))
+	(or (cdr end-loc)
+	    (setcdr end-loc `(,(or end-line line) ,file-struct ,@end-marker))))
 
     ;; Must start with face
     `(face ,compilation-message-face
@@ -1570,8 +1575,7 @@
     ;; markers for that file.
     (unless (and (nth 3 loc) (marker-buffer (nth 3 loc)))
       (with-current-buffer (compilation-find-file marker (caar (nth 2 loc))
-						  (or (cdar (nth 2 loc))
-						      default-directory))
+						  (cadr (car (nth 2 loc))))
 	(save-restriction
 	  (widen)
 	  (goto-char (point-min))
@@ -1734,16 +1738,21 @@
 	    (copy-marker (line-beginning-position))))))
 
 
-(defun compilation-find-file (marker filename dir &rest formats)
+(defun compilation-find-file (marker filename directory &rest formats)
   "Find a buffer for file FILENAME.
 Search the directories in `compilation-search-path'.
 A nil in `compilation-search-path' means to try the
-current directory, which is passed in DIR.
+\"current\" directory, which is passed in DIRECTORY.
+If DIRECTORY. is relative, it is combined with `default-directory'.
+If DIRECTORY. is nil, that means use `default-directory'.
 If FILENAME is not found at all, ask the user where to find it.
 Pop up the buffer containing MARKER and scroll to MARKER if we ask the user."
   (or formats (setq formats '("%s")))
   (save-excursion
     (let ((dirs compilation-search-path)
+	  (spec-dir (if directory
+			(expand-file-name directory)
+		      default-directory))
 	  buffer thisdir fmts name)
       (if (file-name-absolute-p filename)
 	  ;; The file name is absolute.  Use its explicit directory as
@@ -1753,7 +1762,7 @@
 		filename (file-name-nondirectory filename)))
       ;; Now search the path.
       (while (and dirs (null buffer))
-	(setq thisdir (or (car dirs) dir)
+	(setq thisdir (or (car dirs) spec-dir)
 	      fmts formats)
 	;; For each directory, try each format string.
 	(while (and fmts (null buffer))
@@ -1771,7 +1780,7 @@
 			 (read-file-name
 			  (format "Find this %s in: (default %s) "
 				  compilation-error filename)
-			  dir filename t))))
+			  spec-dir filename t))))
 	      (if (file-directory-p name)
 		  (setq name (expand-file-name filename name)))
 	      (setq buffer (and (file-exists-p name)
@@ -1785,26 +1794,32 @@
 
 (defun compilation-get-file-structure (file &optional fmt)
   "Retrieve FILE's file-structure or create a new one.
-FILE should be (ABSOLUTE-FILENAME) or (RELATIVE-FILENAME . DIRNAME)."
+FILE should be (FILENAME) or (RELATIVE-FILENAME . DIRNAME).
+In the former case, FILENAME may be relative or absolute.
 
+The file-structure looks like this:
+  (list (list FILENAME [DIR-FROM-PREV-MSG]) FMT LINE-STRUCT...)
+"
   (or (gethash file compilation-locs)
       ;; File was not previously encountered, at least not in the form passed.
       ;; Let's normalize it and look again.
       (let ((filename (car file))
-	    (default-directory (if (cdr file)
-				   (file-truename (cdr file))
-				 default-directory)))
+	    ;; Get the specified directory from FILE.
+	    (spec-directory (if (cdr file)
+				(file-truename (cdr file)))))
 
 	;; Check for a comint-file-name-prefix and prepend it if appropriate.
 	;; (This is very useful for compilation-minor-mode in an rlogin-mode
 	;; buffer.)
-	(if (boundp 'comint-file-name-prefix)
-	    (if (file-name-absolute-p filename)
-		(setq filename
-		      (concat (with-no-warnings comint-file-name-prefix) filename))
-	      (setq default-directory
-		    (file-truename
-		     (concat (with-no-warnings comint-file-name-prefix) default-directory)))))
+	(when (and (boundp 'comint-file-name-prefix)
+		   (not (equal comint-file-name-prefix "")))
+	  (if (file-name-absolute-p filename)
+	      (setq filename
+		    (concat comint-file-name-prefix filename))
+	    (if spec-directory
+		(setq spec-directory
+		      (file-truename
+		       (concat comint-file-name-prefix spec-directory))))))
 
 	;; If compilation-parse-errors-filename-function is
 	;; defined, use it to process the filename.
@@ -1820,20 +1835,13 @@
 	;; name and fix them.
 	(setq filename (command-line-normalize-file-name filename))
 
-	;; Now eliminate any "..", because find-file would get them wrong.
-	;; Make relative and absolute filenames, with or without links, the
-	;; same.
-	(setq filename
-	      (list (abbreviate-file-name
-		     (file-truename (if (cdr file)
-					(expand-file-name filename)
-				      filename)))))
-
 	;; Store it for the possibly unnormalized name
 	(puthash file
 		 ;; Retrieve or create file-structure for normalized name
-		 (or (gethash filename compilation-locs)
-		     (puthash filename (list filename fmt) compilation-locs))
+		 (or (gethash (list filename) compilation-locs)
+		     (puthash (list filename)
+			      (list (list filename spec-directory) fmt)
+			      compilation-locs))
 		 compilation-locs))))
 
 (add-to-list 'debug-ignored-errors "^No more [-a-z ]+s yet$")
--- a/lisp/progmodes/ebnf2ps.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/ebnf2ps.el	Mon Sep 19 10:20:33 2005 +0000
@@ -5,7 +5,7 @@
 
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
-;; Time-stamp: <2004/11/19 22:30:34 vinicius>
+;; Time-stamp: <2005-09-18 07:27:20 deego>
 ;; Keywords: wp, ebnf, PostScript
 ;; Version: 4.2
 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
@@ -4674,7 +4674,7 @@
       (goto-char the-point)
       (if ebnf-stop-on-error
 	  (error error-msg)
-	(message error-msg)))
+	(message "%s" error-msg)))
      ;; generated output OK
      (gen-func
       nil)
--- a/lisp/progmodes/flymake.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/flymake.el	Mon Sep 19 10:20:33 2005 +0000
@@ -183,7 +183,7 @@
 are the string substitutions (see `format')."
   (if (<= level flymake-log-level)
       (let* ((msg (apply 'format text args)))
-	(message msg)
+	(message "%s" msg)
 	;;(with-temp-buffer
 	;;    (insert msg)
 	;;   (insert "\n")
--- a/lisp/progmodes/glasses.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/glasses.el	Mon Sep 19 10:20:33 2005 +0000
@@ -195,6 +195,16 @@
 			   (looking-at glasses-uncapitalize-regexp))))
 	      (overlay-put o 'invisible t)
 	      (overlay-put o 'after-string (downcase (match-string n))))))
+        ;; Separator change
+        (unless (string= glasses-separator "_")
+          (goto-char beg)
+          (while (re-search-forward "[a-zA-Z0-9]\\(_+\\)[a-zA-Z0-9]" end t)
+            (goto-char (match-beginning 1))
+            (while (eql (char-after) ?\_)
+              (let ((o (glasses-make-overlay (point) (1+ (point)))))
+                ;; `concat' ensures the character properties won't merge
+                (overlay-put o 'display (concat glasses-separator)))
+              (forward-char))))
 	;; Parentheses
 	(when glasses-separate-parentheses-p
 	  (goto-char beg)
@@ -227,6 +237,13 @@
 	  (let ((n (if (match-string 1) 1 2)))
 	    (replace-match "" t nil nil n)
 	    (goto-char (match-end n))))
+        (unless (string= glasses-separator "_")
+          (goto-char (point-min))
+          (while (re-search-forward (format "[a-zA-Z0-9]\\(%s+\\)[a-zA-Z0-9]"
+                                            separator)
+                                    nil t)
+            (replace-match "_" nil nil nil 1)
+            (goto-char (match-beginning 1))))
 	(when glasses-separate-parentheses-p
 	  (goto-char (point-min))
 	  (while (re-search-forward "[a-zA-Z]_*\\( \\)\(" nil t)
--- a/lisp/progmodes/gud.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/gud.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1865,7 +1865,7 @@
 
 	   ;; Anything else means the input is invalid.
 	   (t
-	    (message (format "Error parsing file %s." file))
+	    (message "Error parsing file %s." file)
 	    (throw 'abort nil))))))
     l))
 
--- a/lisp/progmodes/hideshow.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/hideshow.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1,12 +1,12 @@
 ;;; hideshow.el --- minor mode cmds to selectively display code/comment blocks
 
 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-;;               2004, 2005  Free Software Foundation
+;;               2004, 2005  Free Software Foundation, Inc.
 
 ;; Author: Thien-Thi Nguyen <ttn@gnu.org>
 ;;      Dan Nicolaescu <dann@ics.uci.edu>
 ;; Keywords: C C++ java lisp tools editing comments blocks hiding outlines
-;; Maintainer-Version: 5.58.2.4
+;; Maintainer-Version: 5.65.2.2
 ;; Time-of-Day-Author-Most-Likely-to-be-Recalcitrant: early morning
 
 ;; This file is part of GNU Emacs.
@@ -208,11 +208,11 @@
 ;; Thanks go to the following people for valuable ideas, code and
 ;; bug reports.
 ;;
-;;     Dean Andrews, Alf-Ivar Holm, Holger Bauer, Christoph Conrad, Dave
-;;     Love, Dirk Herrmann, Gael Marziou, Jan Djarv, Guillaume Leray,
-;;     Moody Ahmad, Preston F. Crow, Lars Lindberg, Reto Zimmermann,
-;;     Keith Sheffield, Chew Meng Kuan, Tony Lam, Pete Ware, François
-;;     Pinard, Stefan Monnier, Joseph Eydelnant, Michael Ernst
+;;  Dean Andrews, Alf-Ivar Holm, Holger Bauer, Christoph Conrad, Dave Love,
+;;  Dirk Herrmann, Gael Marziou, Jan Djarv, Guillaume Leray, Moody Ahmad,
+;;  Preston F. Crow, Lars Lindberg, Reto Zimmermann, Keith Sheffield,
+;;  Chew Meng Kuan, Tony Lam, Pete Ware, François Pinard, Stefan Monnier,
+;;  Joseph Eydelnant, Michael Ernst, Peter Heslin
 ;;
 ;; Special thanks go to Dan Nicolaescu, who reimplemented hideshow using
 ;; overlays (rather than selective display), added isearch magic, folded
@@ -243,7 +243,6 @@
   :prefix "hs-"
   :group 'languages)
 
-;;;###autoload
 (defcustom hs-hide-comments-when-hiding-all t
   "*Hide the comments too when you do an `hs-hide-all'."
   :type 'boolean
@@ -307,6 +306,11 @@
 (defvar hs-hide-all-non-comment-function nil
   "*Function called if non-nil when doing `hs-hide-all' for non-comments.")
 
+(defvar hs-allow-nesting nil
+  "*If non-nil, hiding remembers internal blocks.
+This means that when the outer block is shown again, any
+previously hidden internal blocks remain hidden.")
+
 (defvar hs-hide-hook nil
   "*Hook called (with `run-hooks') at the end of commands to hide text.
 These commands include the toggling commands (when the result is to hide
@@ -412,12 +416,19 @@
 ;; support functions
 
 (defun hs-discard-overlays (from to)
-  "Delete hideshow overlays in region defined by FROM and TO."
+  "Delete hideshow overlays in region defined by FROM and TO.
+Skip \"internal\" overlays if `hs-allow-nesting' is non-nil."
   (when (< to from)
     (setq from (prog1 to (setq to from))))
-  (dolist (ov (overlays-in from to))
-    (when (overlay-get ov 'hs)
-      (delete-overlay ov))))
+  (if hs-allow-nesting
+      (let (ov)
+        (while (> to (setq from (next-overlay-change from)))
+          (when (setq ov (hs-overlay-at from))
+            (setq from (overlay-end ov))
+            (delete-overlay ov))))
+    (dolist (ov (overlays-in from to))
+      (when (overlay-get ov 'hs)
+        (delete-overlay ov)))))
 
 (defun hs-make-overlay (b e kind &optional b-offset e-offset)
   "Return a new overlay in region defined by B and E with type KIND.
@@ -532,19 +543,16 @@
               ;; `q' is the point at the end of the block
               (progn (hs-forward-sexp mdata 1)
                      (end-of-line)
-                     (point))))
+                     (point)))
+             ov)
         (when (and (< p (point)) (> (count-lines p q) 1))
-          (hs-discard-overlays p q)
+          (cond ((and hs-allow-nesting (setq ov (hs-overlay-at p)))
+                 (delete-overlay ov))
+                ((not hs-allow-nesting)
+                 (hs-discard-overlays p q)))
           (hs-make-overlay p q 'code (- pure-p p)))
         (goto-char (if end q (min p pure-p)))))))
 
-(defun hs-safety-is-job-n ()
-  "Warn if `buffer-invisibility-spec' does not contain symbol `hs'."
-  (unless (and (listp buffer-invisibility-spec)
-               (assq 'hs buffer-invisibility-spec))
-    (message "Warning: `buffer-invisibility-spec' does not contain hs!!")
-    (sit-for 2)))
-
 (defun hs-inside-comment-p ()
   "Return non-nil if point is inside a comment, otherwise nil.
 Actually, return a list containing the buffer position of the start
@@ -587,7 +595,8 @@
             (while (and (< (point) q)
                         (> (point) p)
                         (not (looking-at hs-c-start-regexp)))
-              (setq p (point)) ;; use this to avoid an infinite cycle
+              ;; avoid an infinite cycle
+              (setq p (point))
               (forward-comment 1)
               (skip-chars-forward " \t\n\f"))
             (when (or (not (looking-at hs-c-start-regexp))
@@ -657,7 +666,8 @@
     (setq minp (1+ (point)))
     (funcall hs-forward-sexp-func 1)
     (setq maxp (1- (point))))
-  (hs-discard-overlays minp maxp)       ; eliminate weirdness
+  (unless hs-allow-nesting
+    (hs-discard-overlays minp maxp))
   (goto-char minp)
   (while (progn
            (forward-comment (buffer-size))
@@ -667,7 +677,6 @@
         (hs-hide-level-recursive (1- arg) minp maxp)
       (goto-char (match-beginning hs-block-start-mdata-select))
       (hs-hide-block-at-point t)))
-  (hs-safety-is-job-n)
   (goto-char maxp))
 
 (defmacro hs-life-goes-on (&rest body)
@@ -681,6 +690,15 @@
 
 (put 'hs-life-goes-on 'edebug-form-spec '(&rest form))
 
+(defun hs-overlay-at (position)
+  "Return hideshow overlay at POSITION, or nil if none to be found."
+  (let ((overlays (overlays-at position))
+        ov found)
+    (while (and (not found) (setq ov (car overlays)))
+      (setq found (and (overlay-get ov 'hs) ov)
+            overlays (cdr overlays)))
+    found))
+
 (defun hs-already-hidden-p ()
   "Return non-nil if point is in an already-hidden block, otherwise nil."
   (save-excursion
@@ -694,12 +712,7 @@
           ;; point is inside a block
           (goto-char (match-end 0)))))
     (end-of-line)
-    (let ((overlays (overlays-at (point)))
-          (found nil))
-      (while (and (not found) (overlayp (car overlays)))
-        (setq found (overlay-get (car overlays) 'hs)
-              overlays (cdr overlays)))
-      found)))
+    (hs-overlay-at (point))))
 
 (defun hs-c-like-adjust-block-beginning (initial)
   "Adjust INITIAL, the buffer position after `hs-block-start-regexp'.
@@ -723,7 +736,8 @@
   (hs-life-goes-on
    (message "Hiding all blocks ...")
    (save-excursion
-     (hs-discard-overlays (point-min) (point-max)) ; eliminate weirdness
+     (unless hs-allow-nesting
+       (hs-discard-overlays (point-min) (point-max)))
      (goto-char (point-min))
      (let ((count 0)
            (re (concat "\\("
@@ -746,13 +760,12 @@
                    (funcall hs-hide-all-non-comment-function)
                  (hs-hide-block-at-point t)))
            ;; found a comment, probably
-           (let ((c-reg (hs-inside-comment-p))) ; blech!
+           (let ((c-reg (hs-inside-comment-p)))
              (when (and c-reg (car c-reg))
                (if (> (count-lines (car c-reg) (nth 1 c-reg)) 1)
                    (hs-hide-block-at-point t c-reg)
                  (goto-char (nth 1 c-reg))))))
-         (message "Hiding ... %d" (setq count (1+ count)))))
-     (hs-safety-is-job-n))
+         (message "Hiding ... %d" (setq count (1+ count))))))
    (beginning-of-line)
    (message "Hiding all blocks ... done")
    (run-hooks 'hs-hide-hook)))
@@ -762,7 +775,8 @@
   (interactive)
   (hs-life-goes-on
    (message "Showing all blocks ...")
-   (hs-discard-overlays (point-min) (point-max))
+   (let ((hs-allow-nesting nil))
+     (hs-discard-overlays (point-min) (point-max)))
    (message "Showing all blocks ... done")
    (run-hooks 'hs-show-hook)))
 
@@ -781,7 +795,6 @@
            (looking-at hs-block-start-regexp)
            (hs-find-block-beginning))
        (hs-hide-block-at-point end c-reg)
-       (hs-safety-is-job-n)
        (run-hooks 'hs-hide-hook))))))
 
 (defun hs-show-block (&optional end)
@@ -793,17 +806,15 @@
   (hs-life-goes-on
    (or
     ;; first see if we have something at the end of the line
-    (catch 'eol-begins-hidden-region-p
-      (let ((here (point)))
-        (dolist (ov (save-excursion (end-of-line) (overlays-at (point))))
-          (when (overlay-get ov 'hs)
-            (goto-char
-             (cond (end (overlay-end ov))
-                   ((eq 'comment (overlay-get ov 'hs)) here)
-                   (t (+ (overlay-start ov) (overlay-get ov 'hs-b-offset)))))
-            (delete-overlay ov)
-            (throw 'eol-begins-hidden-region-p t)))
-        nil))
+    (let ((ov (hs-overlay-at (save-excursion (end-of-line) (point))))
+          (here (point)))
+      (when ov
+        (goto-char
+         (cond (end (overlay-end ov))
+               ((eq 'comment (overlay-get ov 'hs)) here)
+               (t (+ (overlay-start ov) (overlay-get ov 'hs-b-offset)))))
+        (delete-overlay ov)
+        t))
     ;; not immediately obvious, look for a suitable block
     (let ((c-reg (hs-inside-comment-p))
           p q)
@@ -812,13 +823,13 @@
                (setq p (car c-reg)
                      q (cadr c-reg))))
             ((and (hs-find-block-beginning)
-                  (looking-at hs-block-start-regexp)) ; fresh match-data, ugh
+                  ;; ugh, fresh match-data
+                  (looking-at hs-block-start-regexp))
              (setq p (point)
                    q (progn (hs-forward-sexp (hs-match-data t) 1) (point)))))
       (when (and p q)
         (hs-discard-overlays p q)
         (goto-char (if end q (1+ p)))))
-    (hs-safety-is-job-n)
     (run-hooks 'hs-show-hook))))
 
 (defun hs-hide-level (arg)
@@ -830,7 +841,6 @@
      (message "Hiding blocks ...")
      (hs-hide-level-recursive arg (point-min) (point-max))
      (message "Hiding blocks ... done"))
-   (hs-safety-is-job-n)
    (run-hooks 'hs-hide-hook)))
 
 (defun hs-toggle-hiding ()
--- a/lisp/progmodes/idlw-shell.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/idlw-shell.el	Mon Sep 19 10:20:33 2005 +0000
@@ -2263,7 +2263,7 @@
     (idlwave-shell-display-line 
      (nth idlwave-shell-calling-stack-index stack) nil
      (unless idlwave-shell-electric-debug-mode 'no-debug)) 
-    (message (or message 
+    (message "%s" (or message 
 		 (format "In routine %s (stack level %d)"
 			 idlwave-shell-calling-stack-routine
 			 (- idlwave-shell-calling-stack-index))))))
--- a/lisp/progmodes/idlwave.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/idlwave.el	Mon Sep 19 10:20:33 2005 +0000
@@ -3995,7 +3995,7 @@
 	      ;; Call etags
 	      (if (not (string-match "^[ \\t]*$" item))
 		  (progn
-		    (message (concat "Tagging " item "..."))
+		    (message "%s" (concat "Tagging " item "..."))
 		    (setq errbuf (get-buffer-create "*idltags-error*"))
 		    (setq status (+ status
 				    (if (eq 0 (call-process
@@ -5188,7 +5188,7 @@
 		     message-base
 		     (not (string= idlwave-library-catalog-libname
 				   old-libname)))
-		(message (concat message-base
+		(message "%s" (concat message-base
 				 idlwave-library-catalog-libname))
 		(setq old-libname idlwave-library-catalog-libname))
 	      (when idlwave-library-catalog-routines
--- a/lisp/progmodes/ps-mode.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/ps-mode.el	Mon Sep 19 10:20:33 2005 +0000
@@ -630,7 +630,7 @@
 	      (current-column))
 	  (error
 	   (ding)
-	   (message (error-message-string err))
+	   (message "%s" (error-message-string err))
 	   0))
       (let (target)
 	(if (not (re-search-backward "[^ \t\n\r\f][ \t\n\r\f]*\\=" nil t))
--- a/lisp/progmodes/scheme.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/scheme.el	Mon Sep 19 10:20:33 2005 +0000
@@ -157,7 +157,7 @@
   (make-local-variable 'parse-sexp-ignore-comments)
   (setq parse-sexp-ignore-comments t)
   (make-local-variable 'lisp-indent-function)
-  (set lisp-indent-function 'scheme-indent-function)
+  (setq lisp-indent-function 'scheme-indent-function)
   (setq mode-line-process '("" scheme-mode-line-process))
   (set (make-local-variable 'imenu-case-fold-search) t)
   (setq imenu-generic-expression scheme-imenu-generic-expression)
--- a/lisp/progmodes/sh-script.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/sh-script.el	Mon Sep 19 10:20:33 2005 +0000
@@ -2572,9 +2572,9 @@
   (if (numberp blinkpos)
       (save-excursion
 	(goto-char blinkpos)
-	(message msg)
+	(if msg (message "%s" msg) (message nil))
 	(sit-for blink-matching-delay))
-    (message msg)))
+    (if message (message "%s" msg) (message nil))))
 
 (defun sh-show-indent (arg)
   "Show the how the currently line would be indented.
@@ -2591,7 +2591,7 @@
 	 (curr-indent (current-indentation))
 	 val msg)
     (if (stringp var)
-	(message (setq msg var))
+	(message "%s" (setq msg var))
       (setq val (sh-calculate-indent info))
 
       (if (eq curr-indent val)
@@ -2610,8 +2610,8 @@
 	  (if (and info (listp (car info))
 		   (eq (car (car info)) t))
 	      (sh-blink (nth 1 (car info))  msg)
-	    (message msg)))
-      (message msg))
+	    (message "%s" msg)))
+      (message "%s" msg))
     ))
 
 (defun sh-set-indent ()
@@ -2624,7 +2624,7 @@
 	 (var (sh-get-indent-var-for-line info))
 	 val old-val indent-val)
     (if (stringp var)
-	(message (format "Cannot set indent - %s" var))
+	(message "Cannot set indent - %s" var)
       (setq old-val (symbol-value var))
       (setq val (sh-read-variable var))
       (condition-case nil
@@ -2675,7 +2675,7 @@
 	   (curr-indent (current-indentation)))
       (cond
        ((stringp var)
-	(message (format "Cannot learn line - %s" var)))
+	(message "Cannot learn line - %s" var))
        ((eq var 'sh-indent-comment)
 	;; This is arbitrary...
 	;; - if curr-indent is 0, set to curr-indent
--- a/lisp/progmodes/vhdl-mode.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/progmodes/vhdl-mode.el	Mon Sep 19 10:20:33 2005 +0000
@@ -134,12 +134,15 @@
   "Non-nil if GNU Emacs 22, ... is used.")
 
 (defvar compilation-file-regexp-alist)
+(defvar conf-alist)
+(defvar conf-entry)
+(defvar conf-key)
+(defvar ent-alist)
 (defvar itimer-version)
 (defvar lazy-lock-defer-contextually)
 (defvar lazy-lock-defer-on-scrolling)
 (defvar lazy-lock-defer-on-the-fly)
 
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Variables
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -363,7 +366,7 @@
   Case adjustment  : adjust case of inserted unit names
 
 \(*) The regular expression must match the error message starting from the
-    beginning of the line (but not necessarily to the end of the line). 
+    beginning of the line (but not necessarily to the end of the line).
 
 Compile options allows insertion of the library name (see `vhdl-project-alist')
 in order to set the compilers library option (e.g. \"vcom -work my_lib\").
@@ -1059,7 +1062,7 @@
     <cursor>
   elsif <clock>'event and <clock> = '1' then  -- rising clock edge
     if <enable> = '1' then  -- synchronous load
-      
+
     end if;
   end if;
 end process <label>;"
@@ -1328,7 +1331,7 @@
   WaveGen_Proc: process
   begin
     -- insert signal assignments here
-    
+
     wait until Clk = '1';
   end process WaveGen_Proc;
 "
@@ -2154,7 +2157,7 @@
 
 (defun vhdl-warning (string &optional nobeep)
   "Print out warning STRING and beep."
-  (message (concat "WARNING:  " string))
+  (message "WARNING:  %s" string)
   (unless (or nobeep noninteractive) (beep)))
 
 (defun vhdl-print-warnings ()
@@ -2162,7 +2165,7 @@
   (let ((no-warnings (length vhdl-warnings)))
     (setq vhdl-warnings (nreverse vhdl-warnings))
     (while vhdl-warnings
-      (message (concat "WARNING:  " (car vhdl-warnings)))
+      (message "WARNING:  %s" (car vhdl-warnings))
       (setq vhdl-warnings (cdr vhdl-warnings)))
     (beep)
     (when (> no-warnings 1)
@@ -4403,16 +4406,16 @@
         outputs from this component -> output port created
       - signals that are inputs to AND outputs from subcomponents are
         considered as internal connections -> internal signal created
- 
+
       Purpose:  With appropriate naming conventions it is possible to
     create higher design levels with only a few mouse clicks or key
     strokes.  A new design level can be created by simply generating a new
     component, placing the required subcomponents from the hierarchy
     browser, and wiring everything automatically.
- 
+
       Note: Automatic wiring only works reliably on templates of new
     components and component instantiations that were created by VHDL mode.
- 
+
       Component declarations can be placed in a components package (option
     `vhdl-use-components-package') which can be automatically generated for
     an entire directory or project (`C-c C-c M-p').  The VHDL'93 direct
@@ -4434,7 +4437,7 @@
 |     Note: Configurations of subcomponents (i.e. hierarchical configuration
 |   declarations) are currently not considered when displaying
 |   configurations in speedbar.
- 
+
       See the options group `vhdl-compose' for all relevant user options.
 
 
@@ -10602,7 +10605,7 @@
 	    (vhdl-template-invoked-by-hook t))
 	(let ((caught (catch 'abort
 			(funcall func))))
-	  (when (stringp caught) (message caught)))
+	  (when (stringp caught) (message "%s" caught)))
 	(when (= invoke-char ?-) (setq abbrev-start-location (point)))
 	;; delete CR which is still in event queue
 	(if (fboundp 'enqueue-eval-event)
@@ -10765,7 +10768,7 @@
 (defun vhdl-template-insert-fun (fun)
   "Call FUN to insert a built-in template."
   (let ((caught (catch 'abort (when fun (funcall fun)))))
-    (when (stringp caught) (message caught))))
+    (when (stringp caught) (message "%s" caught))))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -11692,7 +11695,7 @@
 	(setq arch-buffer (current-buffer))
 	(when ent-buffer (set-buffer ent-buffer) (save-buffer))
 	(set-buffer arch-buffer) (save-buffer))
-      (message
+      (message "%s"
        (concat (format "Pasting port as testbench \"%s(%s)\"...done"
 		       ent-name arch-name)
 	       (and ent-file-name
@@ -15291,7 +15294,7 @@
 (defface vhdl-speedbar-architecture-face
   '((((min-colors 88) (class color) (background light)) (:foreground "Blue1"))
     (((class color) (background light)) (:foreground "Blue"))
-    
+
     (((class color) (background dark)) (:foreground "LightSkyBlue")))
   "Face used for displaying architecture names."
   :group 'speedbar-faces)
@@ -15495,7 +15498,7 @@
     (setq arch-buffer (current-buffer))
     (when ent-buffer (set-buffer ent-buffer) (save-buffer))
     (set-buffer arch-buffer) (save-buffer)
-    (message
+    (message "%s"
      (concat (format "Creating component \"%s(%s)\"...done" ent-name arch-name)
 	     (and ent-file-name
 		  (format "\n  File created: \"%s\"" ent-file-name))
@@ -16117,7 +16120,7 @@
 	   (vhdl-template-footer)
 	 (vhdl-comment-display-line) (insert "\n"))
        (save-buffer))
-     (message
+     (message "%s"
       (concat (format "Generating configuration \"%s\"...done" conf-name)
 	      (and conf-file-name
 		   (format "\n  File created: \"%s\"" conf-file-name))))))
--- a/lisp/recentf.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/recentf.el	Mon Sep 19 10:20:33 2005 +0000
@@ -74,6 +74,15 @@
   :group 'recentf
   :type 'file)
 
+(defcustom recentf-save-file-modes 384 ;; 0600
+  "Mode bits of recentf save file, as an integer, or nil.
+If non-nil, after writing `recentf-save-file', set its mode bits to
+this value.  By default give R/W access only to the user who owns that
+file.  See also the function `set-file-modes'."
+  :group 'recentf
+  :type '(choice (const :tag "Don't change" nil)
+          integer))
+  
 (defcustom recentf-exclude nil
   "*List of regexps and predicates for filenames excluded from the recent list.
 When a filename matches any of the regexps or satisfies any of the
@@ -257,7 +266,7 @@
 If it returns nil, the filename is left unchanged."
   :group 'recentf
   :type '(choice (const :tag "None" nil)
-		 (const abbreviate-file-name)
+                 (const abbreviate-file-name)
                  function))
 
 (defcustom recentf-show-file-shortcuts-flag t
@@ -1206,6 +1215,8 @@
                 (format ";;; coding: %s\n" recentf-save-file-coding-system)
                 ";;; End:\n")
         (write-file (expand-file-name recentf-save-file))
+        (when recentf-save-file-modes
+          (set-file-modes recentf-save-file recentf-save-file-modes))
         nil)
     (error
      (warn "recentf mode: %s" (error-message-string error)))))
--- a/lisp/server.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/server.el	Mon Sep 19 10:20:33 2005 +0000
@@ -371,7 +371,7 @@
 	  (server-switch-buffer (nth 1 client))
 	  (run-hooks 'server-switch-hook)
 	  (unless nowait
-	    (message (substitute-command-keys
+	    (message "%s" (substitute-command-keys
 		      "When done with a buffer, type \\[server-edit]")))))
       ;; Avoid preserving the connection after the last real frame is deleted.
       (if tmp-frame (delete-frame tmp-frame))))
--- a/lisp/ses.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/ses.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1612,7 +1612,7 @@
     (error
      (unless executing-kbd-macro
        (ding))
-     (message (error-message-string err))))
+     (message "%s" (error-message-string err))))
   nil) ;Make coverage-tester happy
 
 (defun ses-create-header-string ()
@@ -1739,7 +1739,7 @@
 	(error (setq sig hold))))
     (cond
      (sig
-      (message (error-message-string sig)))
+      (message "%s" (error-message-string sig)))
      ((consp ses--curcell)
       (message " "))
      (t
--- a/lisp/shell.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/shell.el	Mon Sep 19 10:20:33 2005 +0000
@@ -797,19 +797,26 @@
   (let* ((proc (get-buffer-process (current-buffer)))
 	 (pmark (process-mark proc)))
     (goto-char pmark)
-    (insert shell-dirstack-query) (insert "\n")
+    ;; If the process echoes commands, don't insert a fake command in
+    ;; the buffer or it will appear twice.
+    (unless comint-process-echoes
+      (insert shell-dirstack-query) (insert "\n"))
     (sit-for 0) ; force redisplay
     (comint-send-string proc shell-dirstack-query)
     (comint-send-string proc "\n")
     (set-marker pmark (point))
-    (let ((pt (point))) ; wait for 1 line
+    (let ((pt (point))
+	  (regexp
+	   (concat
+	    (if comint-process-echoes
+		;; Skip command echo if the process echoes
+		(concat "\\(" (regexp-quote shell-dirstack-query) "\n\\)")
+	      "\\(\\)")
+	    "\\(.+\n\\)")))
       ;; This extra newline prevents the user's pending input from spoofing us.
       (insert "\n") (backward-char 1)
-      (while (not (looking-at
-		   (concat "\\(" ; skip literal echo in case of stty echo
-			   (regexp-quote shell-dirstack-query)
-			   "\n\\)?" ; skip if present
-			   "\\(" ".+\n" "\\)")) ) ; what to actually look for
+      ;; Wait for one line.
+      (while (not (looking-at regexp))
 	(accept-process-output proc)
 	(goto-char pt)))
     (goto-char pmark) (delete-char 1) ; remove the extra newline
--- a/lisp/simple.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/simple.el	Mon Sep 19 10:20:33 2005 +0000
@@ -3668,9 +3668,18 @@
         (setq goal-column nil)
         (message "No goal column"))
     (setq goal-column (current-column))
-    (message (substitute-command-keys
-	      "Goal column %d (use \\[set-goal-column] with an arg to unset it)")
-	     goal-column))
+    ;; The older method below can be erroneous if `set-goal-column' is bound
+    ;; to a sequence containing %
+    ;;(message (substitute-command-keys
+    ;;"Goal column %d (use \\[set-goal-column] with an arg to unset it)")
+    ;;goal-column)
+    (message "%s"
+	     (concat 
+	      (format "Goal column %d " goal-column)
+	      (substitute-command-keys
+	       "(use \\[set-goal-column] with an arg to unset it)")))
+    
+    )
   nil)
 
 
--- a/lisp/startup.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/startup.el	Mon Sep 19 10:20:33 2005 +0000
@@ -976,20 +976,28 @@
   (unless (or noninteractive
               window-system
               (null term-file-prefix))
-    (let ((term (getenv "TERM"))
+    (let* ((TERM (getenv "TERM"))
+           (term TERM)
           hyphend)
       (while (and term
                   (not (load (concat term-file-prefix term) t t)))
         ;; Strip off last hyphen and what follows, then try again
         (setq term
-              (if (setq hyphend (string-match "[-_][^-_]+$" term))
+              (if (setq hyphend (string-match "[-_][^-_]+\\'" term))
                   (substring term 0 hyphend)
                 nil)))
-      (when term
-	;; The terminal file has been loaded, now call the terminal
-	;; specific initialization function.
-	(let ((term-init-func (intern (concat "terminal-init-" term))))
-	  (when (fboundp term-init-func)
+      (setq term TERM)
+      ;; The terminal file has been loaded, now call the terminal specific
+      ;; initialization function.
+      (while term
+	(let ((term-init-func (intern-soft (concat "terminal-init-" term))))
+	  (if (not (fboundp term-init-func))
+              ;; Strip off last hyphen and what follows, then try again
+              (setq term
+                    (if (setq hyphend (string-match "[-_][^-_]+\\'" term))
+                        (substring term 0 hyphend)
+                      nil))
+            (setq term nil)
 	    (funcall term-init-func))))))
 
   ;; Update the out-of-memory error message based on user's key bindings
@@ -1472,7 +1480,7 @@
 
 (defun display-startup-echo-area-message ()
   (let ((resize-mini-windows t))
-    (message (startup-echo-area-message))))
+    (message "%s" (startup-echo-area-message))))
 
 
 (defun display-splash-screen ()
--- a/lisp/strokes.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/strokes.el	Mon Sep 19 10:20:33 2005 +0000
@@ -738,7 +738,7 @@
 	  (save-window-excursion
 	    (set-window-configuration strokes-window-configuration)
 	    (when prompt
-	      (message prompt)
+	      (message "%s" prompt)
 	      (setq event (read-event))
 	      (or (strokes-button-press-event-p event)
 		  (error "You must draw with the mouse")))
@@ -769,7 +769,7 @@
 	      (bury-buffer))))
       ;; Otherwise, don't use strokes buffer and read stroke silently
       (when prompt
-	(message prompt)
+	(message "%s" prompt)
 	(setq event (read-event))
 	(or (strokes-button-press-event-p event)
 	    (error "You must draw with the mouse")))
@@ -799,7 +799,7 @@
 	    (grid-locs nil))
 	(if prompt
 	    (while (not (strokes-button-press-event-p event))
-	      (message prompt)
+	      (message "%s" prompt)
 	      (setq event (read-event))))
 	(unwind-protect
 	    (track-mouse
--- a/lisp/term/mac-win.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/term/mac-win.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1110,8 +1110,8 @@
   "Coding system derived from the system script code.")
 
 (defun mac-add-charset-info (xlfd-charset mac-text-encoding)
-  "Function to add character sets to display with Mac fonts.
-Creates entries in `mac-charset-info-alist'.
+  "Add a character set to display with Mac fonts.
+Create an entry in `mac-charset-info-alist'.
 XLFD-CHARSET is a string which will appear in the XLFD font name
 to identify the character set.  MAC-TEXT-ENCODING is the
 correspoinding TextEncodingBase value."
--- a/lisp/textmodes/artist.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/artist.el	Mon Sep 19 10:20:33 2005 +0000
@@ -4162,7 +4162,7 @@
 	  (setq artist-key-is-drawing t)
 
 	  ;; Feedback
-	  (message (substitute-command-keys
+	  (message "%s" (substitute-command-keys
 		    (concat "First point set. "
 			    "Set next with \\[artist-key-set-point], "
 			    "set last with C-u \\[artist-key-set-point]"))))
--- a/lisp/textmodes/bibtex.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/bibtex.el	Mon Sep 19 10:20:33 2005 +0000
@@ -3007,7 +3007,7 @@
 					  (cdr field-list))
 				  t)))
       (if comment
-          (message (nth 1 comment))
+          (message "%s" (nth 1 comment))
         (message "No comment available")))))
 
 (defun bibtex-make-field (field &optional move interactive)
--- a/lisp/textmodes/flyspell.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/flyspell.el	Mon Sep 19 10:20:33 2005 +0000
@@ -566,7 +566,7 @@
 	   (interactive-p))
       (let ((binding (where-is-internal 'flyspell-auto-correct-word
 					nil 'non-ascii)))
-	(message
+	(message "%s"
 	 (if binding
 	     (format "Welcome to flyspell. Use %s or Mouse-2 to correct words."
 		     (key-description binding))
@@ -942,7 +942,7 @@
 			    (sort (car (cdr (cdr poss))) 'string<)
 			  (car (cdr (cdr poss)))))))
     (if flyspell-issue-message-flag
-	(message (format "mispelling `%s'  %S" word replacements)))))
+	(message "mispelling `%s'  %S" word replacements))))
 
 ;*---------------------------------------------------------------------*/
 ;*    flyspell-word-search-backward ...                                */
@@ -1090,7 +1090,7 @@
 			      (if flyspell-highlight-flag
 				  (flyspell-highlight-duplicate-region
 				   start end poss)
-				(message (format "duplicate `%s'" word)))
+				(message "duplicate `%s'" word))
 			      nil)
 			     (t
 			      (setq flyspell-word-cache-result nil)
@@ -1679,7 +1679,7 @@
       (setq pos (cdr pos)))
     (if (fboundp 'display-message)
 	(display-message 'no-log string)
-      (message string))))
+      (message "%s" string))))
 
 ;*---------------------------------------------------------------------*/
 ;*    flyspell-abbrev-table ...                                        */
--- a/lisp/textmodes/ispell.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/ispell.el	Mon Sep 19 10:20:33 2005 +0000
@@ -719,6 +719,12 @@
 
 (defvar ispell-really-aspell nil) ; Non-nil if aspell extensions should be used
 
+(defvar ispell-aspell-supports-utf8 nil
+  "Non-nil means to try to automatically find aspell dictionaries.
+This is set to t in ispell-check-version for aspell >= 0.60.
+
+Earlier aspell versions do not consistently support UTF-8.  Handling
+this would require some extra guessing in `ispell-aspell-find-dictionary'.")
 
 
 
@@ -782,7 +788,7 @@
 								 (point))
 				 ", "
 				 ispell-version))
-	    (message result))
+	    (message "%s" result))
 	;; return library directory.
 	(if (re-search-forward "LIBDIR = \\\"\\([^ \t\n]*\\)\\\"" nil t)
 	    (setq result (buffer-substring (match-beginning 1) (match-end 1)))))
@@ -814,9 +820,11 @@
         (goto-char (point-min))
         (let (case-fold-search)
           (setq ispell-really-aspell
-		(and (search-forward-regexp "(but really Aspell \\(.*\\))" nil t)
-		     (if (version< (match-string 1) "0.60")
-			 (error "aspell version 0.60 or greater is required")
+		(and (search-forward-regexp
+		      "(but really Aspell \\(.*\\))" nil t)
+		     (progn
+		       (setq ispell-aspell-supports-utf8
+			     (not (version< (match-string 1) "0.60")))
 		       t)))))
       (kill-buffer (current-buffer)))
     result))
@@ -972,7 +980,8 @@
 	     (condition-case ()
 		 (progn (ispell-check-version) t)
 	       (error nil))
-	     ispell-really-aspell)
+	     ispell-really-aspell
+	     ispell-aspell-supports-utf8)
     (ispell-find-aspell-dictionaries))
   (let ((dicts (append ispell-local-dictionary-alist ispell-dictionary-alist))
 	(dict-list (cons "default" nil))
@@ -2348,7 +2357,7 @@
     (substring output 2))		; return root word
    ((equal 0 (string-match "[\ra-zA-Z]" output))
     (ding)				; error message from ispell!
-    (message (concat "Ispell error: " output))
+    (message "Ispell error: %s" output)
     (sit-for 5)
     nil)
    (t					; need to process &, ?, and #'s
--- a/lisp/textmodes/org.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/org.el	Mon Sep 19 10:20:33 2005 +0000
@@ -2805,7 +2805,7 @@
 		      (assoc completion table))
 		 (insert " "))
 	     (if (and (equal type :opt) (assoc completion table))
-		 (message (substitute-command-keys
+		 (message "%s" (substitute-command-keys
 			   "Press \\[org-complete] again to insert example settings"))))
 	    (t
 	     (message "Making completion list...")
@@ -2912,7 +2912,7 @@
    org-deadline-string " "
    (format-time-string (car org-time-stamp-formats)
 		       (org-read-date nil 'to-time)))
-  (message (substitute-command-keys
+  (message "%s" (substitute-command-keys
 	    "Use \\[org-timestamp-up-day] and \\[org-timestamp-down-day] to change the date.")))
 
 (defun org-schedule ()
@@ -2924,7 +2924,7 @@
    org-scheduled-string " "
    (format-time-string (car org-time-stamp-formats)
 		       (org-read-date nil 'to-time)))
-  (message (substitute-command-keys
+  (message "%s" (substitute-command-keys
 	    "Use \\[org-timestamp-up-day] and \\[org-timestamp-down-day] to change the date.")))
 
 
@@ -2997,7 +2997,7 @@
 	(setq current org-default-priority))
       (cond
        ((eq action 'set)
-	(message (format "Priority A-%c, SPC to remove: " org-lowest-priority))
+	(message "Priority A-%c, SPC to remove: " org-lowest-priority)
 	(setq new (read-char-exclusive))
 	(cond ((equal new ?\ ) (setq remove t))
 	      ((or (< (upcase new) ?A) (> (upcase new) org-lowest-priority))
@@ -7014,9 +7014,13 @@
 		     (format "%d:%02d:%02d" h m s))))
 	(kill-new sres)
 	(if (interactive-p)
-	    (message (substitute-command-keys
-		      (format "Sum of %d items: %-20s     (\\[yank] will insert result into buffer)"
-			      (length numbers) sres))))
+	    (message "%s"
+		     (concat
+		      (format "Sum of %d items: %-20s     "  (length numbers) sres)
+		      (substitute-command-keys
+		       "(\\[yank] will insert result into buffer)")
+		      ))
+	  )
 	sres))))
 
 (defun org-table-get-number-for-summing (s)
--- a/lisp/textmodes/reftex-auc.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/reftex-auc.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1,10 +1,9 @@
 ;;; reftex-auc.el --- RefTeX's interface to AUCTeX
-
-;; Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
+;;  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.28
+;; Version: VERSIONTAG
 
 ;; This file is part of GNU Emacs.
 
@@ -20,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
@@ -76,7 +75,7 @@
 
 
 (defun reftex-arg-index-tag (optional &optional prompt &rest args)
-  "Prompt for an index tag with completion.
+  "Prompt for an index tag with completion. 
 This is the name of an index, not the entry."
   (let (tag taglist)
     (setq prompt (concat (if optional "(Optional) " "")
@@ -86,8 +85,8 @@
         ;; Use RefTeX completion
         (progn
           (reftex-access-scan-info nil)
-          (setq taglist
-                (cdr (assoc 'index-tags
+          (setq taglist 
+                (cdr (assoc 'index-tags 
                             (symbol-value reftex-docstruct-symbol)))
                 tag (completing-read prompt (mapcar 'list taglist))))
       ;; Just ask like AUCTeX does.
@@ -132,7 +131,7 @@
   ;; Replace AUCTeX functions with RefTeX functions.
   ;; Which functions are replaced is controlled by the variable
   ;; `reftex-plug-into-AUCTeX'.
-
+  
   (if (reftex-plug-flag 0)
       (setq LaTeX-label-function 'reftex-label)
     (setq LaTeX-label-function nil))
@@ -144,11 +143,11 @@
   (and (reftex-plug-flag 3)
        (fboundp 'TeX-arg-cite)
        (fset 'TeX-arg-cite 'reftex-arg-cite))
-
-  (and (reftex-plug-flag 4)
+  
+  (and (reftex-plug-flag 4) 
        (fboundp 'TeX-arg-index-tag)
        (fset 'TeX-arg-index-tag 'reftex-arg-index-tag))
-  (and (reftex-plug-flag 4)
+  (and (reftex-plug-flag 4) 
        (fboundp 'TeX-arg-index)
        (fset 'TeX-arg-index 'reftex-arg-index)))
 
--- a/lisp/textmodes/reftex-cite.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/reftex-cite.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1,10 +1,9 @@
 ;;; reftex-cite.el --- creating citations with RefTeX
-
-;; Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
+;;  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.28
+;; Version: VERSIONTAG
 
 ;; This file is part of GNU Emacs.
 
@@ -20,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
@@ -70,7 +69,7 @@
   (unless (eq (get 'reftex-default-bibliography :reftex-raw)
               reftex-default-bibliography)
     (put 'reftex-default-bibliography :reftex-expanded
-         (reftex-locate-bibliography-files
+         (reftex-locate-bibliography-files 
           default-directory reftex-default-bibliography))
     (put 'reftex-default-bibliography :reftex-raw
          reftex-default-bibliography))
@@ -129,7 +128,7 @@
   ;; If RETURN is non-nil, just return the entry.
 
   (let* ((re
-          (if item
+          (if item 
               (concat "\\\\bibitem\\(\\[[^]]*\\]\\)?{" (regexp-quote key) "}")
             (concat "@[a-zA-Z]+[ \t\n\r]*[{(][ \t\n\r]*" (regexp-quote key)
                     "[, \t\r\n}]")))
@@ -151,7 +150,7 @@
           (when return
             ;; Just return the relevant entry
             (if item (goto-char (match-end 0)))
-            (setq return (buffer-substring
+            (setq return (buffer-substring 
                           (point) (reftex-end-of-bib-entry item)))
             (set-buffer buffer-conf)
             (throw 'exit return))
@@ -167,9 +166,9 @@
         (error "No BibTeX entry with citation key %s" key)))))
 
 (defun reftex-end-of-bib-entry (item)
-  (save-excursion
+  (save-excursion 
     (condition-case nil
-        (if item
+        (if item 
             (progn (end-of-line)
                    (re-search-forward
                     "\\\\bibitem\\|\\end{thebibliography}")
@@ -190,16 +189,16 @@
 
     ;; Read a regexp, completing on known citation keys.
     (setq default (regexp-quote (reftex-get-bibkey-default)))
-    (setq re-list
-          (split-string
-           (completing-read
+    (setq re-list 
+          (split-string 
+           (completing-read 
             (concat
              "Regex { && Regex...}: "
              "[" default "]: ")
             (if reftex-mode
                 (if (fboundp 'LaTeX-bibitem-list)
                     (LaTeX-bibitem-list)
-                  (cdr (assoc 'bibview-cache
+                  (cdr (assoc 'bibview-cache 
                               (symbol-value reftex-docstruct-symbol))))
               nil)
             nil nil nil 'reftex-cite-regexp-hist)
@@ -246,7 +245,7 @@
                    (error (goto-char key-point)
                           (throw 'search-again nil)))
                  (setq end-point (point))
-
+                 
                  ;; Ignore @string, @comment and @c entries or things
                  ;; outside entries
                  (when (or (string= (downcase (match-string 2)) "string")
@@ -255,12 +254,12 @@
                            (< (point) key-point)) ; this means match not in {}
                    (goto-char key-point)
                    (throw 'search-again nil))
-
+                 
                  ;; Well, we have got a match
                  ;;(setq entry (concat
                  ;;             (buffer-substring start-point (point)) "\n"))
                  (setq entry (buffer-substring start-point (point)))
-
+                 
                  ;; Check if other regexp match as well
                  (setq re-list rest-re)
                  (while re-list
@@ -268,24 +267,24 @@
                      ;; nope - move on
                      (throw 'search-again nil))
                    (pop re-list))
-
+                 
                  (setq alist (reftex-parse-bibtex-entry
                               nil start-point end-point))
                  (push (cons "&entry" entry) alist)
-
+                 
                  ;; check for crossref entries
                  (if (assoc "crossref" alist)
                      (setq alist
                            (append
                             alist (reftex-get-crossref-alist alist))))
-
+                 
                  ;; format the entry
                  (push (cons "&formatted" (reftex-format-bib-entry alist))
                        alist)
-
+                 
                  ;; make key the first element
                  (push (reftex-get-bib-field "&key" alist) alist)
-
+                 
                  ;; add it to the list
                  (push alist found-list)))))
           (reftex-kill-temporary-buffers))))
@@ -348,7 +347,7 @@
     (unless files
       (error "Need file name to find thebibliography environment"))
     (while (setq file (pop files))
-      (setq buf (reftex-get-file-buffer-force
+      (setq buf (reftex-get-file-buffer-force 
                  file (not reftex-keep-temporary-buffers)))
       (unless buf
         (error "No such file %s" file))
@@ -359,21 +358,21 @@
         (save-restriction
           (widen)
           (goto-char (point-min))
-          (while (re-search-forward
+          (while (re-search-forward 
                   "\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t)
             (beginning-of-line 2)
             (setq start (point))
-            (if (re-search-forward
+            (if (re-search-forward 
                  "\\(\\`\\|[\n\r]\\)[ \t]*\\\\end{thebibliography}" nil t)
                 (progn
                   (beginning-of-line 1)
                   (setq end (point))))
             (when (and start end)
-              (setq entries
+              (setq entries 
                     (append entries
                       (mapcar 'reftex-parse-bibitem
                         (delete ""
-                                (split-string
+                                (split-string 
                                  (buffer-substring-no-properties start end)
                                  "[ \t\n\r]*\\\\bibitem\\(\\[[^]]*]\\)*"))))))
             (goto-char end)))))
@@ -382,16 +381,16 @@
 
     ;; Read a regexp, completing on known citation keys.
     (setq default (regexp-quote (reftex-get-bibkey-default)))
-    (setq re-list
-          (split-string
-           (completing-read
+    (setq re-list 
+          (split-string 
+           (completing-read 
             (concat
              "Regex { && Regex...}: "
              "[" default "]: ")
             (if reftex-mode
                 (if (fboundp 'LaTeX-bibitem-list)
                     (LaTeX-bibitem-list)
-                  (cdr (assoc 'bibview-cache
+                  (cdr (assoc 'bibview-cache 
                               (symbol-value reftex-docstruct-symbol))))
               nil)
             nil nil nil 'reftex-cite-regexp-hist)
@@ -404,14 +403,14 @@
         (error "Empty regular expression"))
 
     (while (and (setq re (pop re-list)) entries)
-      (setq entries
+      (setq entries 
             (delq nil (mapcar
                        (lambda (x)
                          (if (string-match re (cdr (assoc "&entry" x)))
                              x nil))
                        entries))))
-    (setq entries
-          (mapcar
+    (setq entries 
+          (mapcar 
             (lambda (x)
               (push (cons "&formatted" (reftex-format-bibitem x)) x)
               (push (reftex-get-bib-field "&key" x) x)
@@ -632,7 +631,6 @@
   ;; This really does the work of reftex-citation.
 
   (let* ((format (reftex-figure-out-cite-format arg no-insert format-key))
-         (start 0)
          (docstruct-symbol reftex-docstruct-symbol)
          (selected-entries (reftex-offer-bib-menu))
          (insert-entries selected-entries)
@@ -655,9 +653,9 @@
       ;; FIXME: Unfortunately, this meens that commenting does not work right.
       (pop selected-entries)
       (let ((concat-keys (mapconcat 'car selected-entries ",")))
-        (setq insert-entries
+        (setq insert-entries 
               (list (list concat-keys (cons "&key" concat-keys))))))
-
+    
     (unless no-insert
 
       ;; We shall insert this into the buffer...
@@ -684,7 +682,7 @@
         ;; it has to go.  If there is only a single arg and empty, it can go
         ;; as well.
         (when reftex-cite-cleanup-optional-args
-          (cond
+          (cond 
            ((string-match "\\([a-zA-Z0-9]\\)\\[\\]{" string)
             (setq string (replace-match "\\1{" nil nil string)))
            ((string-match "\\[\\]\\(\\[[a-zA-Z0-9., ]+\\]\\)" string)
@@ -699,14 +697,14 @@
         (delete-char 1))
 
       ;; Tell AUCTeX
-      (when (and reftex-mode
+      (when (and reftex-mode 
                  (fboundp 'LaTeX-add-bibitems)
                  reftex-plug-into-AUCTeX)
         (apply 'LaTeX-add-bibitems (mapcar 'car selected-entries)))
-
+      
       ;; Produce the cite-view strings
       (when (and reftex-mode reftex-cache-cite-echo cite-view)
-        (mapcar (lambda (entry)
+        (mapcar (lambda (entry) 
                   (reftex-make-cite-echo-string entry docstruct-symbol))
                 selected-entries))
 
@@ -714,16 +712,16 @@
 
     (set-marker reftex-select-return-marker nil)
     (reftex-kill-buffer "*RefTeX Select*")
-
+    
     ;; Check if the prefix arg was numeric, and call recursively
     (when (integerp arg)
       (if (> arg 1)
-          (progn
+          (progn      
             (skip-chars-backward "}")
             (decf arg)
             (reftex-do-citation arg))
         (forward-char 1)))
-
+    
     ;; Return the citation key
     (car (car selected-entries))))
 
@@ -737,7 +735,7 @@
      (no-insert
       ;; Format does not really matter because nothing will be inserted.
       (setq format "%l"))
-
+     
      ((and (stringp macro)
            (string-match "\\`\\\\cite\\|cite\\'" macro))
       ;; We are already inside a cite macro
@@ -758,7 +756,7 @@
       (when (listp format)
         (setq key
               (or format-key
-                  (reftex-select-with-char
+                  (reftex-select-with-char 
                    "" (concat "SELECT A CITATION FORMAT\n\n"
                               (mapconcat
                                (lambda (x)
@@ -787,8 +785,8 @@
 
   (let ((bibtype (reftex-bib-or-thebib))
         found-list rtn key data selected-entries)
-    (while
-        (not
+    (while 
+        (not 
          (catch 'done
            ;; Scan bibtex files
            (setq found-list
@@ -803,20 +801,20 @@
                 (reftex-extract-bib-entries-from-thebibliography
                  (reftex-uniquify
                   (mapcar 'cdr
-                          (reftex-all-assq
+                          (reftex-all-assq 
                            'thebib (symbol-value reftex-docstruct-symbol))))))
                (reftex-default-bibliography
                 (message "Using default bibliography")
                 (reftex-extract-bib-entries (reftex-default-bibliography)))
                (t (error "No valid bibliography in this document, and no default available"))))
-
+           
            (unless found-list
              (error "Sorry, no matches found"))
-
+    
           ;; Remember where we came from
           (setq reftex-call-back-to-this-buffer (current-buffer))
           (set-marker reftex-select-return-marker (point))
-
+    
           ;; Offer selection
           (save-window-excursion
             (delete-other-windows)
@@ -857,15 +855,15 @@
                 (goto-char 1))
                ((eq key ?A)
                 ;; Take all (marked)
-                (setq selected-entries
+                (setq selected-entries 
                       (if reftex-select-marked
                           (mapcar 'car (nreverse reftex-select-marked))
                         found-list))
                 (throw 'done t))
                ((eq key ?a)
                 ;; Take all (marked), and push the symbol 'concat
-                (setq selected-entries
-                      (cons 'concat
+                (setq selected-entries 
+                      (cons 'concat 
                             (if reftex-select-marked
                                 (mapcar 'car (nreverse reftex-select-marked))
                               found-list)))
@@ -884,9 +882,9 @@
                ((or (eq key ?\C-m)
                     (eq key 'return))
                 ;; Take selected
-                (setq selected-entries
+                (setq selected-entries 
                       (if reftex-select-marked
-                          (cons 'concat
+                          (cons 'concat 
                                 (mapcar 'car (nreverse reftex-select-marked)))
                         (if data (list data) nil)))
                 (throw 'done t))
@@ -926,7 +924,7 @@
   (let ((file (read-file-name "File to create: ")))
     (find-file-other-window file)
     (if (> (buffer-size) 0)
-        (unless (yes-or-no-p
+        (unless (yes-or-no-p 
                  (format "Overwrite non-empty file %s? " file))
           (error "Abort")))
     (erase-buffer)
@@ -951,7 +949,7 @@
              reftex-mouse-selected-face
            nil))
         tmp len)
-    (mapcar
+    (mapcar 
      (lambda (x)
        (setq tmp (cdr (assoc "&formatted" x))
              len (length tmp))
@@ -1046,7 +1044,7 @@
 (defun reftex-make-cite-echo-string (entry docstruct-symbol)
   ;; Format a bibtex entry for the echo area and cache the result.
   (let* ((key (reftex-get-bib-field "&key" entry))
-         (string
+         (string 
           (let* ((reftex-cite-punctuation '(" " " & " " etal.")))
             (reftex-format-citation entry reftex-cite-view-format)))
          (cache (assq 'bibview-cache (symbol-value docstruct-symbol)))
@@ -1088,7 +1086,7 @@
           (setq bibfile-list
                 (reftex-uniquify
                  (mapcar 'cdr
-                         (reftex-all-assq
+                         (reftex-all-assq 
                           'thebib (symbol-value reftex-docstruct-symbol))))
                 item t))
          (reftex-default-bibliography
@@ -1099,16 +1097,16 @@
         (setq bibfile-list (reftex-visited-files bibfile-list)))
 
       (condition-case nil
-          (reftex-pop-to-bibtex-entry
+          (reftex-pop-to-bibtex-entry 
            key bibfile-list (not reftex-keep-temporary-buffers) t item)
         (error (ding))))
-
+      
     (select-window win)))
 
 ;;; Global BibTeX file
 (defun reftex-all-used-citation-keys ()
   (reftex-access-scan-info)
-  (let ((files (reftex-all-document-files)) file keys kkk kk k)
+  (let ((files (reftex-all-document-files)) file keys kk k)
     (save-excursion
       (while (setq file (pop files))
         (set-buffer (reftex-get-file-buffer-force file 'mark))
@@ -1131,7 +1129,7 @@
   "Create a new BibTeX database file with all entries referenced in document.
 The command prompts for a filename and writes the collected entries to
 that file.  Only entries referenced in the current document with
-any \\cite-like macros are used.
+any \\cite-like macros are used. 
 The sequence in the new file is the same as it was in the old database."
   (interactive "FNew BibTeX file: ")
   (let ((keys (reftex-all-used-citation-keys))
@@ -1145,7 +1143,7 @@
            (save-restriction
              (widen)
              (goto-char (point-min))
-             (while (re-search-forward
+             (while (re-search-forward 
                      "^[ \t]*@[a-zA-Z]+[ \t]*{\\([^ \t\r\n]+\\),"
                      nil t)
                (setq key (match-string 1)
@@ -1162,7 +1160,7 @@
                        keys (delete key keys)))))))))
     (find-file-other-window bibfile)
     (if (> (buffer-size) 0)
-        (unless (yes-or-no-p
+        (unless (yes-or-no-p 
                  (format "Overwrite non-empty file %s? " bibfile))
           (error "Abort")))
     (erase-buffer)
--- a/lisp/textmodes/reftex-dcr.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/reftex-dcr.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1,10 +1,9 @@
 ;;; reftex-dcr.el --- viewing cross references and citations with RefTeX
-
-;; Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
+;;  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.28
+;; Version: VERSIONTAG
 ;;
 
 ;; This file is part of GNU Emacs.
@@ -21,8 +20,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
@@ -268,7 +267,7 @@
   ;; Display crossref info in echo area.
   (cond
    ((null docstruct)
-    (message (substitute-command-keys (format reftex-no-info-message "ref"))))
+    (message "%s" (substitute-command-keys (format reftex-no-info-message "ref"))))
    ((null entry)
     (message "ref: unknown label: %s" label))
    (t
@@ -301,7 +300,7 @@
               (error
                (if (and files (= (length all-files) (length files)))
                    (message "cite: no such database entry: %s" key)
-                 (message (substitute-command-keys 
+                 (message "%s" (substitute-command-keys 
                            (format reftex-no-info-message "cite"))))
                nil)))
       (when entry
--- a/lisp/textmodes/reftex-global.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/reftex-global.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1,10 +1,9 @@
 ;;; reftex-global.el --- operations on entire documents with RefTeX
-
-;; Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
+;;  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.28
+;; Version: VERSIONTAG
 
 ;; This file is part of GNU Emacs.
 
@@ -20,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
@@ -32,9 +31,6 @@
 (require 'reftex)
 ;;;
 
-(defvar isearch-next-buffer-function)
-(defvar TeX-master)
-
 (defun reftex-create-tags-file ()
   "Create TAGS file by running `etags' on the current document.
 The TAGS file is also immediately visited with `visit-tags-table'."
@@ -103,6 +99,10 @@
     (tags-query-replace from to (or delimited current-prefix-arg)
                         (list 'reftex-all-document-files))))
 
+(eval-when-compile
+  (defvar TeX-master)
+  (defvar isearch-next-buffer-function))
+
 (defun reftex-find-duplicate-labels ()
   "Produce a list of all duplicate labels in the document."
 
@@ -140,7 +140,7 @@
     (set (make-local-variable 'TeX-master) master)
     (erase-buffer)
     (insert "                MULTIPLE LABELS IN CURRENT DOCUMENT:\n")
-    (insert
+    (insert 
      " Move point to label and type `r' to run a query-replace on the label\n"
      " and its references.  Type `q' to exit this buffer.\n\n")
     (insert " LABEL               FILE\n")
@@ -198,8 +198,8 @@
            (not (yes-or-no-p "Replacing all simple labels in multiple files is risky.  Continue? ")))
       (error "Abort"))
   ;; Make the translation list
-  (let* ((re-core (concat "\\("
-                          (mapconcat 'cdr reftex-typekey-to-prefix-alist "\\|")
+  (let* ((re-core (concat "\\(" 
+                          (mapconcat 'cdr reftex-typekey-to-prefix-alist "\\|") 
                           "\\)"))
          (label-re (concat "\\`" re-core "\\([0-9]+\\)\\'"))
          (search-re (concat "[{,]\\(" re-core "\\([0-9]+\\)\\)[,}]"))
@@ -232,11 +232,11 @@
     (reftex-save-all-document-buffers)
 
     ;; First test to check for erros
-    (setq n (reftex-translate
+    (setq n (reftex-translate 
              files search-re translate-alist error-fmt 'test))
 
     ;; Now the real thing.
-    (if (yes-or-no-p
+    (if (yes-or-no-p 
          (format "Replace %d items at %d places in %d files? "
                  (length translate-alist) n (length files)))
         (progn
@@ -254,9 +254,9 @@
 
 (defun reftex-translate (files search-re translate-alist error-fmt test)
   ;; In FILES, look for SEARCH-RE and replace match 1 of it with
-  ;; its association in TRANSLATE-ALSIT.
+  ;; its association in TRANSLATE-ALSIT.  
   ;; If we do not find an association and TEST is non-nil, query
-  ;; to ignore the problematic string.
+  ;; to ignore the problematic string.  
   ;; If TEST is nil, it is ignored without query.
   ;; Return the number of replacements.
   (let ((n 0) file label match-data buf macro pos cell)
@@ -282,7 +282,7 @@
                          (or (looking-at "\\\\ref")
                              (looking-at "\\\\[a-zA-Z]*ref\\(range\\)?[^a-zA-Z]")
                              (looking-at "\\\\ref[a-zA-Z]*[^a-zA-Z]")
-                             (looking-at (format
+                             (looking-at (format 
                                           reftex-find-label-regexp-format
                                           (regexp-quote label)))))
                 ;; OK, we should replace it.
@@ -345,7 +345,7 @@
 
 (defun reftex-isearch-wrap-function ()
   (if (not isearch-word)
-      (switch-to-buffer
+      (switch-to-buffer 
        (funcall isearch-next-buffer-function (current-buffer) t)))
   (goto-char (if isearch-forward (point-min) (point-max))))
 
@@ -431,7 +431,7 @@
 `reftex-isearch-minor-mode' on iff ARG is positive."
   (interactive "P")
   (let ((old-reftex-isearch-minor-mode reftex-isearch-minor-mode))
-    (setq reftex-isearch-minor-mode
+    (setq reftex-isearch-minor-mode 
 	  (not (or (and (null arg) reftex-isearch-minor-mode)
 		   (<= (prefix-numeric-value arg) 0))))
     (unless (eq reftex-isearch-minor-mode old-reftex-isearch-minor-mode)
@@ -462,7 +462,7 @@
     ;; Force modeline redisplay.
     (set-buffer-modified-p (buffer-modified-p))))
 
-(add-minor-mode 'reftex-isearch-minor-mode "/I" nil nil
+(add-minor-mode 'reftex-isearch-minor-mode "/I" nil nil 
 		'reftex-isearch-minor-mode)
 
 ;;; arch-tag: 2dbf7633-92c8-4340-8656-7aa019d0f80d
--- a/lisp/textmodes/reftex-index.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/reftex-index.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1,10 +1,9 @@
 ;;; reftex-index.el --- index support with RefTeX
-
-;; Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
+;;  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.28
+;; Version: VERSIONTAG
 
 ;; This file is part of GNU Emacs.
 
@@ -20,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
@@ -32,13 +31,11 @@
 (require 'reftex)
 ;;;
 
-(defvar reftex-index-phrases-marker)
-(defvar TeX-master)
-
 ;; START remove for XEmacs release
 (defvar mark-active)
 (defvar zmacs-regions)
 (defvar transient-mark-mode)
+(defvar TeX-master)
 ;; END remove for XEmacs release
 (defun reftex-index-selection-or-word (&optional arg phrase)
   "Put selection or the word near point into the default index macro.
@@ -56,13 +53,13 @@
          (active (if (boundp 'zmacs-regions)
                      (and zmacs-regions (region-exists-p))  ; XEmacs
                    (and transient-mark-mode mark-active)))  ; Emacs
-         (beg (if active
+         (beg (if active 
                   (region-beginning)
-                (save-excursion
+                (save-excursion 
                   (skip-syntax-backward "w\\") (point))))
          (end (if active
                   (region-end)
-                (save-excursion
+                (save-excursion 
                   (skip-syntax-forward "w\\") (point))))
          (sel (buffer-substring beg end))
          (mathp (condition-case nil (texmathp) (error nil)))
@@ -93,7 +90,7 @@
         ;; Delete what is in the buffer and make the index entry
         (delete-region beg end)
         (reftex-index def-char full-entry def-tag sel)))))
-
+  
 (defun reftex-index (&optional char key tag sel no-insert)
   "Query for an index macro and insert it along with its argments.
 The index macros available are those defined in `reftex-index-macro' or
@@ -169,7 +166,7 @@
   ;; OPT-ARGS is a list of optional argument indices, as given by
   ;; `reftex-parse-args'.
   (let* ((opt (and (integerp itag) (member itag opt-args)))
-         (index-tags (cdr (assq 'index-tags
+         (index-tags (cdr (assq 'index-tags 
                                 (symbol-value reftex-docstruct-symbol))))
          (default (reftex-default-index))
          (prompt (concat "Index tag"
@@ -183,17 +180,17 @@
 (defun reftex-index-select-tag ()
   ;; Have the user select an index tag.
   ;; FIXME: should we cache tag-alist, prompt and help?
-  (let* ((index-tags (cdr (assoc 'index-tags
+  (let* ((index-tags (cdr (assoc 'index-tags 
                                  (symbol-value reftex-docstruct-symbol))))
          (default (reftex-default-index)))
-    (cond
+    (cond 
      ((null index-tags)
       (error "No index tags available"))
 
      ((= (length index-tags) 1)
       ;; Just one index, use it
       (car index-tags))
-
+          
      ((> (length index-tags) 1)
       ;; Several indices, ask.
       (let* ((tags (copy-sequence index-tags))
@@ -214,12 +211,12 @@
               (unless (assq (aref tag i) tag-alist)
                 (push (list (aref tag i)
                             tag
-                            (concat (substring tag 0 i)
+                            (concat (substring tag 0 i) 
                                     "[" (substring tag i (incf i)) "]"
                                     (substring tag i)))
                       tag-alist)
                 (throw 'exit t)))
-            (push (list (+ ?0 (incf cnt)) tag
+            (push (list (+ ?0 (incf cnt)) tag 
                         (concat "[" (int-to-string cnt) "]:" tag))
                   tag-alist)))
         (setq tag-alist (nreverse tag-alist))
@@ -234,7 +231,7 @@
                       (if default
                           (format "[^M]  %s (the default)\n" default)
                         "")
-                      (mapconcat (lambda(x)
+                      (mapconcat (lambda(x) 
                                    (apply 'format "[%c]   %s" x))
                                  tag-alist "\n")))
         ;; Query the user for an index-tag
@@ -263,7 +260,7 @@
     key))
 
 (defun reftex-index-update-taglist (newtag)
-  ;; add NEWTAG to the list of available index tags.
+  ;; add NEWTAG to the list of available index tags. 
   (let ((cell (assoc 'index-tags (symbol-value reftex-docstruct-symbol))))
     (and newtag (cdr cell) (not (member newtag (cdr cell)))
          (push newtag (cdr cell)))))
@@ -314,7 +311,7 @@
   (easy-menu-add reftex-index-menu reftex-index-map)
   (add-hook 'post-command-hook 'reftex-index-post-command-hook nil t)
   (add-hook 'pre-command-hook  'reftex-index-pre-command-hook nil t)
-  (run-mode-hooks 'reftex-index-mode-hook))
+  (run-hooks 'reftex-index-mode-hook))
 
 (defconst reftex-index-help
 "                      AVAILABLE KEYS IN INDEX BUFFER
@@ -344,7 +341,7 @@
   ;; Note:  This function just looks for the nearest match of the
   ;; context string and may fail if the entry moved and an identical
   ;; entry is close to the old position.  Frequent rescans make this
-  ;; safer.
+  ;; safer. 
   (let* ((file (nth 3 data))
          (literal (nth 2 data))
          (pos (nth 4 data))
@@ -392,7 +389,7 @@
          (calling-file (buffer-file-name))
          (restriction
           (or overriding-restriction
-              (and (not redo)
+              (and (not redo) 
                    (reftex-get-restriction current-prefix-arg docstruct))))
          (locations
           ;; See if we are on an index macro as initial position
@@ -401,7 +398,7 @@
                      (macro (car what-macro))
                      (here-I-am (when (member macro reftex-macros-with-index)
                                   (save-excursion
-                                    (goto-char (+ (cdr what-macro)
+                                    (goto-char (+ (cdr what-macro) 
                                                   (length macro)))
                                     (reftex-move-over-touching-args)
                                     (reftex-where-am-I)))))
@@ -412,7 +409,7 @@
     (setq buffer-name (reftex-make-index-buffer-name index-tag))
 
     ;; Goto the buffer and put it into the correct mode
-
+                      
     (when (or restriction current-prefix-arg)
          (reftex-kill-buffer buffer-name))
 
@@ -505,7 +502,7 @@
       ;; Delete the entry at place
       (and (bolp) (forward-char 1))
       (delete-region (previous-single-property-change (1+ (point)) :data)
-                     (or (next-single-property-change (point) :data)
+                     (or (next-single-property-change (point) :data) 
                          (point-max))))
 
     ;; Walk through the list and insert all entries
@@ -526,7 +523,7 @@
       (insert indent (nth 7 cell))
       (when font
         (setq to (point))
-        (put-text-property
+        (put-text-property 
          (- (point) (length (nth 7 cell))) to
          'face index-face)
         (goto-char to))
@@ -554,7 +551,7 @@
 (defun reftex-index-insert-new-letter (letter &optional font)
   ;; Start a new section in the index
   (let ((from (point)))
-    (insert "\n" letter letter letter
+    (insert "\n" letter letter letter 
             "-----------------------------------------------------------------")
     (when font
       (put-text-property from (point) 'face reftex-index-section-face))
@@ -631,10 +628,10 @@
   (interactive "p")
   (setq reftex-callback-fwd t)
   (or (eobp) (forward-char 1))
-  (goto-char (or (next-single-property-change (point) :data)
+  (goto-char (or (next-single-property-change (point) :data) 
                  (point)))
   (unless (get-text-property (point) :data)
-    (goto-char (or (next-single-property-change (point) :data)
+    (goto-char (or (next-single-property-change (point) :data) 
                    (point)))))
 (defun reftex-index-previous (&optional arg)
   "Move to previous selectable item."
@@ -777,7 +774,7 @@
         (reftex-index-restrict-to-section t)
       (setq reftex-index-restriction-indicator (nth 6 bor)
             reftex-index-restriction-data
-            (list bor
+            (list bor 
                   (car (memq (assq 'toc (cdr (memq bor docstruct)))
                              docstruct))))
       (reftex-index-revert))))
@@ -809,7 +806,7 @@
          show-window show-buffer match)
 
     (unless data (error "Don't know which index entry to visit"))
-
+    
     (if (eq (car data) 'index)
         (setq match (reftex-index-show-entry data no-revisit)))
 
@@ -880,7 +877,7 @@
           attr (nth 2 analyze))
     (setf (nth 2 analyze) (if (string= attr bor) "" bor))
     (setq new (apply 'concat analyze))
-    (reftex-index-change-entry
+    (reftex-index-change-entry 
      new (if (string= (nth 2 analyze) bor)
              "Entry is now START-OF-PAGE-RANGE"
            "START-OF-PAGE-RANGE canceled"))))
@@ -938,7 +935,7 @@
           (t (setf (nth n analyze) (concat initial npart))))
     (setq new (apply 'concat analyze))
     ;; Change the entry and insert the changed version into the index.
-    (reftex-index-change-entry
+    (reftex-index-change-entry 
      new (if (string= npart "")
              (format "Deleted: %s" opart)
            (format "New value is: %s" npart)))))
@@ -952,14 +949,14 @@
     (unless data (error "Don't know which index entry to change"))
     (setq old (nth 2 data)
           key (nth 6 data)
-          prefix (completing-read
-                  "Prefix: "
-                  (reftex-sublist-nth
+          prefix (completing-read 
+                  "Prefix: " 
+                  (reftex-sublist-nth 
                    docstruct 6
                    (lambda (x)
                      (and (eq (car x) 'index)
                           (string= (nth 1 x) reftex-index-tag))) t)))
-    (unless (string-match
+    (unless (string-match 
              (concat (regexp-quote (car reftex-index-special-chars)) "\\'")
              prefix)
       (setq prefix (concat prefix (car reftex-index-special-chars))))
@@ -999,7 +996,7 @@
 (defun reftex-index-change-entry (new &optional message)
   ;; Change the full context string of the index entry at point to
   ;; NEW.  This actually edits the buffer where the entry is defined.
-
+  
   (let* ((data (get-text-property (point) :data))
          old beg end info)
     (unless data (error "Cannot change entry"))
@@ -1025,7 +1022,7 @@
         (reftex-insert-index (list data) reftex-index-tag t
                              "EDITED")))
     (setq reftex-last-follow-point 1)
-    (and message (message message))))
+    (and message (message "%s" message))))
 
 ;; Index map
 (define-key reftex-index-map (if (featurep 'xemacs) [(button2)] [(mouse-2)])
@@ -1091,14 +1088,14 @@
       (if (eq char ?!)
           (error "This <%s> index does not contain entries sorted before the letters"
                  reftex-index-tag)
-        (error "This <%s> index does not contain entries starting with `%c'"
+        (error "This <%s> index does not contain entries starting with `%c'" 
                reftex-index-tag char)))))
 
-(easy-menu-define
+(easy-menu-define 
  reftex-index-menu reftex-index-map
  "Menu for Index buffer"
  `("Index"
-   ["Goto section A-Z"
+   ["Goto section A-Z" 
     (message "To go to a section, just press any of: !%s"
              reftex-index-section-letters) t]
    ["Show Entry" reftex-index-view-entry t]
@@ -1138,7 +1135,7 @@
     ["Context" reftex-index-toggle-context :style toggle
      :selected reftex-index-include-context]
     "--"
-    ["Follow Mode" reftex-index-toggle-follow :style toggle
+    ["Follow Mode" reftex-index-toggle-follow :style toggle 
      :selected reftex-index-follow-mode])
    "--"
    ["Help" reftex-index-show-help t]))
@@ -1190,7 +1187,7 @@
   (set-marker reftex-index-return-marker (point))
   (reftex-index-selection-or-word arg 'phrase)
   (if (eq major-mode 'reftex-index-phrases-mode)
-      (message
+      (message "%s" 
        (substitute-command-keys
         "Return to LaTeX with \\[reftex-index-phrases-save-and-return]"))))
 
@@ -1219,7 +1216,7 @@
           (sort (copy-sequence reftex-index-macro-alist)
                 (lambda (a b) (equal (car a) default-macro))))
          macro entry key repeat)
-
+    
     (if master (set (make-local-variable 'TeX-master)
                     (file-name-nondirectory master)))
 
@@ -1232,7 +1229,7 @@
       (if (looking-at reftex-index-phrases-comment-regexp)
           (beginning-of-line 2))
       (while (looking-at "^[ \t]*$")
-          (beginning-of-line 2))
+          (beginning-of-line 2))          
       (cond ((fboundp 'zmacs-activate-region) (zmacs-activate-region))
             ((boundp 'make-active) (setq mark-active t)))
       (if (yes-or-no-p "Delete and rebuilt header ")
@@ -1277,6 +1274,7 @@
 
 
 (defvar reftex-index-phrases-menu)
+(defvar reftex-index-phrases-marker)
 (defvar reftex-index-phrases-restrict-file nil)
 ;;;###autoload
 (defun reftex-index-phrases-mode ()
@@ -1308,17 +1306,17 @@
   (setq major-mode 'reftex-index-phrases-mode
         mode-name "Phrases")
   (use-local-map reftex-index-phrases-map)
-  (set (make-local-variable 'font-lock-defaults)
+  (set (make-local-variable 'font-lock-defaults) 
        reftex-index-phrases-font-lock-defaults)
   (easy-menu-add reftex-index-phrases-menu reftex-index-phrases-map)
   (set (make-local-variable 'reftex-index-phrases-marker) (make-marker))
-  (run-mode-hooks 'reftex-index-phrases-mode-hook))
+  (run-hooks 'reftex-index-phrases-mode-hook))
 (add-hook 'reftex-index-phrases-mode-hook 'turn-on-font-lock)
 
 ;; Font Locking stuff
 (let ((ss (if (featurep 'xemacs) 'secondary-selection ''secondary-selection)))
   (setq reftex-index-phrases-font-lock-keywords
-        (list
+        (list 
          (cons reftex-index-phrases-comment-regexp 'font-lock-comment-face)
          (list reftex-index-phrases-macrodef-regexp
                '(1 font-lock-type-face)
@@ -1342,7 +1340,7 @@
   (setq reftex-index-phrases-font-lock-defaults
         '((reftex-index-phrases-font-lock-keywords)
           nil t nil beginning-of-line))
-  (put 'reftex-index-phrases-mode 'font-lock-defaults
+  (put 'reftex-index-phrases-mode 'font-lock-defaults 
        reftex-index-phrases-font-lock-defaults) ; XEmacs
   )
 
@@ -1404,10 +1402,10 @@
                    (move-marker reftex-index-phrases-marker
                                 (match-beginning 0) (current-buffer))
                    ;; Start the query-replace
-                   (reftex-query-index-phrase-globally
-                    files phrase macro-fmt
+                   (reftex-query-index-phrase-globally 
+                    files phrase macro-fmt 
                     index-key repeat as-words)
-                   (message "%s replaced"
+                   (message "%s replaced" 
                             (reftex-number replace-count "occurrence"))))))
           (t (error "Cannot parse this line")))))
 
@@ -1450,7 +1448,7 @@
           (unless buf (error "Master file %s not found" master))
           (set-buffer buf)
           (reftex-access-scan-info)
-          (setq reftex-index-phrases-files
+          (setq reftex-index-phrases-files 
                 (reftex-all-document-files))))
     ;; Parse the files header for macro definitions
     (setq reftex-index-phrases-macro-data nil)
@@ -1465,7 +1463,7 @@
       ;; Reverse the list, so that the first macro is first
       (if (null reftex-index-phrases-macro-data)
           (error "No valid MACRO DEFINITION line in %s file (make sure to use TAB separators)" reftex-index-phrase-file-extension))
-      (setq reftex-index-phrases-macro-data
+      (setq reftex-index-phrases-macro-data 
             (nreverse reftex-index-phrases-macro-data))
       (goto-char (point-min)))))
 
@@ -1477,7 +1475,7 @@
 index the new part without having to go over the unchanged parts again."
   (interactive "r")
   (let ((win-conf (current-window-configuration))
-        (reftex-index-phrases-restrict-file (buffer-file-name)))
+        (reftex-index-phrases-restrict-file (buffer-file-name)))        
   (save-excursion
     (save-restriction
       (narrow-to-region beg end)
@@ -1500,7 +1498,7 @@
         (setq text (reftex-index-simplify-phrase text))
         (goto-char (point-min))
         (if (re-search-forward
-             (concat "^\\(\\S-*\\)\t\\(" (regexp-quote text)
+             (concat "^\\(\\S-*\\)\t\\(" (regexp-quote text) 
                      "\\) *[\t\n]") nil t)
             (progn
               (goto-char (match-end 2))
@@ -1530,7 +1528,7 @@
           (let* ((phrase (match-string 3))
                  (case-fold-search reftex-index-phrases-case-fold-search)
                  (re (reftex-index-phrases-find-dup-re phrase t)))
-            (if (save-excursion
+            (if (save-excursion 
                   (goto-char (point-min))
                   (and (re-search-forward re nil t)
                        (re-search-forward re nil t)))
@@ -1623,7 +1621,7 @@
             (progn
               (princ (format " Superphrases:  Phrase matches the following %s in the phrase buffer:\n"
                              (reftex-number ntimes2 "line")))
-              (mapcar (lambda(x)
+              (mapcar (lambda(x) 
                         (princ (format "                Line %4d:  %s\n" (car x) (cdr x))))
                       (nreverse superphrases))))))))
 
@@ -1676,7 +1674,7 @@
         beg end)
     (goto-char (point-min))
     ;; Find first and last phrase line in buffer
-    (setq beg
+    (setq beg 
           (and (re-search-forward reftex-index-phrases-phrase-regexp12 nil t)
                (match-beginning 0)))
     (goto-char (point-max))
@@ -1703,15 +1701,15 @@
     (if (string-match reftex-index-phrases-phrase-regexp12 a)
         (progn
           ;; Extract macro char and phrase-or-key for a
-          (setq ca (match-string 1 a)
-                pa (downcase
+          (setq ca (match-string 1 a) 
+                pa (downcase 
                     (or (and reftex-index-phrases-sort-prefers-entry
                              (match-string 6 a))
                         (match-string 3 a))))
           (if (string-match reftex-index-phrases-phrase-regexp12 b)
               (progn
                 ;; Extract macro char and phrase-or-key for b
-                (setq cb (match-string 1 b)
+                (setq cb (match-string 1 b) 
                       pb (downcase
                           (or (and reftex-index-phrases-sort-prefers-entry
                                    (match-string 6 b))
@@ -1719,7 +1717,7 @@
                 (setq c-p (string< ca cb)
                       p-p (string< pa pb))
                 ;; Do the right comparison, based on the value of `chars-first'
-                ;; `chars-first' is bound locally in the calling function
+                ;; `chars-first' is bound locally in the calling function               
                 (if chars-first
                     (if (string= ca cb) p-p c-p)
                   (if (string= pa pb) c-p p-p)))))
@@ -1730,7 +1728,7 @@
       (not reftex-index-phrases-sort-in-blocks))))
 
 (defvar reftex-index-phrases-menu)
-(defun reftex-index-make-phrase-regexp (phrase &optional
+(defun reftex-index-make-phrase-regexp (phrase &optional 
                                                as-words allow-newline)
   "Return a regexp matching PHRASE, even if distributed over lines.
 With optional arg AS-WORDS, require word boundary at beginning and end.
@@ -1741,12 +1739,12 @@
                      "\\([ \t]+\\)")))
     (concat (if (and as-words (string-match "\\`\\w" (car words)))
                 "\\(\\<\\|[`']\\)" "")
-            (mapconcat (lambda (w) (regexp-quote
+            (mapconcat (lambda (w) (regexp-quote 
                                     (if reftex-index-phrases-case-fold-search
                                         (downcase w)
                                       w)))
                        words space-re)
-            (if (and as-words
+            (if (and as-words 
                      (string-match "\\w\\'" (nth (1- (length words)) words)))
                 "\\(\\>\\|'\\)" ""))))
 
@@ -1769,8 +1767,8 @@
   (let ((index-keys (split-string (or index-key match)
                                   reftex-index-phrases-logical-and-regexp)))
     (concat
-     (mapconcat (lambda (x)
-                  (format macro-fmt
+     (mapconcat (lambda (x) 
+                  (format macro-fmt 
                           (format (if mathp reftex-index-math-format "%s") x)))
                 index-keys "")
    (if repeat (reftex-index-simplify-phrase match) ""))))
@@ -1782,7 +1780,7 @@
     (unless files (error "No files"))
     (unwind-protect
         (progn
-          (switch-to-buffer-other-window (reftex-get-file-buffer-force
+          (switch-to-buffer-other-window (reftex-get-file-buffer-force 
                                           (car files)))
           (catch 'no-more-files
             (while (setq file (pop files))
@@ -1822,13 +1820,15 @@
 both ends."
   (let* ((re (reftex-index-make-phrase-regexp phrase as-words 'allow-newline))
          (case-fold-search reftex-index-phrases-case-fold-search)
-         (index-keys (split-string
+         (index-keys (split-string 
                       (or index-key phrase)
                       reftex-index-phrases-logical-or-regexp))
          (nkeys (length index-keys))
          (ckey (nth 0 index-keys))
-         (all-yes nil)
-         match rpl char beg end mathp)
+         (all-yes nil) 
+         match rpl char (beg (make-marker)) (end (make-marker)) mathp)
+    (move-marker beg 1)
+    (move-marker end 1)
     (unwind-protect
         (while (re-search-forward re nil t)
           (catch 'next-match
@@ -1841,24 +1841,24 @@
             (setq mathp
                   (save-match-data
                     (condition-case nil (texmathp) (error nil))))
-            (setq beg (car (match-data))
-                  end (nth 1 (match-data)))
+            (setq beg (move-marker beg (match-beginning 0))
+                  end (move-marker end (match-end 0)))
             (if (and reftex-index-phrases-skip-indexed-matches
                      (save-match-data
                        (reftex-index-phrase-match-is-indexed beg
                                                              end)))
                 (throw 'next-match nil))
             (reftex-highlight 0 (match-beginning 0) (match-end 0))
-            (setq rpl
+            (setq rpl 
                   (save-match-data
                     (reftex-index-make-replace-string
                      macro-fmt (match-string 0) ckey repeat mathp)))
-            (while
+            (while 
                 (not
                  (catch 'loop
                    (message "REPLACE: %s?   (yn!qoe%s?)"
                             rpl
-                            (if (> nkeys 1)
+                            (if (> nkeys 1) 
                                 (concat "1-" (int-to-string nkeys))
                               ""))
                    (setq char (if all-yes ?y (read-char-exclusive)))
@@ -1892,7 +1892,7 @@
                          ((member char '(?o ?O))
                           ;; Select a differnt macro
                           (let* ((nc (reftex-index-select-phrases-macro 2))
-                                 (macro-data
+                                 (macro-data 
                                   (cdr (assoc nc reftex-index-phrases-macro-data)))
                                  (macro-fmt (car macro-data))
                                  (repeat (nth 1 macro-data)))
@@ -1910,7 +1910,7 @@
                           ;; Recursive edit
                           (save-match-data
                             (save-excursion
-                              (message
+                              (message "%s" 
                                (substitute-command-keys
                                 "Recursive edit.  Resume with \\[exit-recursive-edit]"))
                               (recursive-edit))))
@@ -1930,6 +1930,8 @@
                          (t (ding)))
                    nil)))))
       (message "")
+      (move-marker beg nil)
+      (move-marker end nil)
       (setq all-yes nil)
       (reftex-unhighlight 0))))
 
@@ -1939,7 +1941,7 @@
   (save-excursion
     (goto-char end)
     (let* ((all-macros (reftex-what-macro t))
-           (this-macro (car (car all-macros)))
+;           (this-macro (car (car all-macros)))
            (before-macro
             (and (> beg 2)
                  (goto-char (1- beg))
@@ -2043,7 +2045,7 @@
         ("\C-i"     . self-insert-command))
       do (define-key reftex-index-phrases-map (car x) (cdr x)))
 
-(easy-menu-define
+(easy-menu-define 
  reftex-index-phrases-menu reftex-index-phrases-map
  "Menu for Phrases buffer"
  '("Phrases"
--- a/lisp/textmodes/reftex-parse.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/reftex-parse.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1,10 +1,9 @@
 ;;; reftex-parse.el --- parser functions for RefTeX
-
-;; Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
+;;  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.28
+;; Version: VERSIONTAG
 ;;
 
 ;; This file is part of GNU Emacs.
@@ -21,8 +20,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
--- a/lisp/textmodes/reftex-ref.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/reftex-ref.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1,10 +1,9 @@
 ;;; reftex-ref.el --- code to create labels and references with RefTeX
-
-;; Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
+;;  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.28
+;; Version: VERSIONTAG
 
 ;; This file is part of GNU Emacs.
 
@@ -20,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
--- a/lisp/textmodes/reftex-sel.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/reftex-sel.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1,10 +1,9 @@
 ;;; reftex-sel.el --- the selection modes for RefTeX
-
-;; Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2440, 2005
+;;  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.28
+;; Version: VERSIONTAG
 
 ;; This file is part of GNU Emacs.
 
@@ -20,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
@@ -61,7 +60,7 @@
   (when (syntax-table-p reftex-latex-syntax-table)
     (set-syntax-table reftex-latex-syntax-table))
   ;; We do not set a local map - reftex-select-item does this.
-  (run-mode-hooks 'reftex-select-label-mode-hook))
+  (run-hooks 'reftex-select-label-mode-hook))
 
 (defvar reftex-select-bib-map nil
   "Keymap used for *RefTeX Select* buffer, when selecting a BibTeX entry.
@@ -89,7 +88,7 @@
         mode-name "BSelect")
   (set (make-local-variable 'reftex-select-marked) nil)
   ;; We do not set a local map - reftex-select-item does this.
-  (run-mode-hooks 'reftex-select-bib-mode-hook))
+  (run-hooks 'reftex-select-bib-mode-hook))
 
 ;;; (defun reftex-get-offset (buf here-am-I &optional typekey toc index file)
 ;;;   ;; Find the correct offset data, like insert-docstruct would, but faster.
--- a/lisp/textmodes/reftex-toc.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/reftex-toc.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1,10 +1,9 @@
 ;;; reftex-toc.el --- RefTeX's table of contents mode
-
-;; Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
+;;  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.28
+;; Version: VERSIONTAG
 
 ;; This file is part of GNU Emacs.
 
@@ -20,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
@@ -36,8 +35,9 @@
   "Keymap used for *toc* buffer.")
 
 (defvar reftex-toc-menu)
-(defvar zmacs-regions)
-
+(eval-when-compile (defvar zmacs-regions))
+(defvar reftex-last-window-height nil)
+(defvar reftex-last-window-width nil)
 (defvar reftex-toc-include-labels-indicator nil)
 (defvar reftex-toc-include-index-indicator nil)
 (defvar reftex-toc-max-level-indicator nil)
@@ -79,13 +79,11 @@
   (add-hook 'post-command-hook 'reftex-toc-post-command-hook nil t)
   (add-hook 'pre-command-hook  'reftex-toc-pre-command-hook nil t)
   (easy-menu-add reftex-toc-menu reftex-toc-map)
-  (run-mode-hooks 'reftex-toc-mode-hook))
+  (run-hooks 'reftex-toc-mode-hook))
 
 (defvar reftex-last-toc-file nil
   "Stores the file name from which `reftex-toc' was called.  For redo command.")
 
-(defvar reftex-last-window-height nil)
-(defvar reftex-last-window-width nil)
 
 (defvar reftex-toc-return-marker (make-marker)
   "Marker which makes it possible to return from toc to old position.")
@@ -152,7 +150,7 @@
                          (frame-parameter (selected-frame) 'unsplittable)))
          offset toc-window)
 
-    (if (setq toc-window (get-buffer-window
+    (if (setq toc-window (get-buffer-window 
                           "*toc*"
                           (if reuse 'visible)))
         (select-window toc-window)
@@ -168,7 +166,7 @@
             (split-window-horizontally
              (floor (* (window-width)
                        reftex-toc-split-windows-fraction)))
-          (split-window-vertically
+          (split-window-vertically 
            (floor (* (window-height)
                      reftex-toc-split-windows-fraction)))))
 
@@ -213,11 +211,11 @@
              reftex-toc-include-context
              nil ; counter
              nil ; commented
-             here-I-am
+             here-I-am 
              ""     ; xr-prefix
              t      ; a toc buffer
              ))
-
+       
       (run-hooks 'reftex-display-copied-context-hook)
       (message "Building *toc* buffer...done.")
       (setq buffer-read-only t))
@@ -229,7 +227,7 @@
                                    t
                                    reftex-toc-include-index-entries
                                    reftex-toc-include-file-boundaries)
-                (reftex-last-assoc-before-elt
+                (reftex-last-assoc-before-elt 
                  'toc here-I-am
                  (symbol-value reftex-docstruct-symbol))))
       (put 'reftex-toc :reftex-line 3)
@@ -254,7 +252,7 @@
          (not (get-text-property (point) 'intangible))
          (memq reftex-highlight-selection '(cursor both))
          (reftex-highlight 2
-                           (or (previous-single-property-change
+                           (or (previous-single-property-change 
                                 (min (point-max) (1+ (point))) :data)
                                (point-min))
                            (or (next-single-property-change (point) :data)
@@ -301,10 +299,10 @@
                (window-height))))))
 
 (defun reftex-toc-dframe-p (&optional frame error)
-  ;; Check if FRAME is the dedicated TOC frame.
+  ;; Check if FRAME is the dedicated TOC frame.  
   ;; If yes, and ERROR is non-nil, throw an error.
   (setq frame (or frame (selected-frame)))
-  (let ((res (equal
+  (let ((res (equal 
               (if (fboundp 'frame-property)
                   (frame-property frame 'name)
                 (frame-parameter  frame 'name))
@@ -330,7 +328,7 @@
   (if (boundp 'zmacs-region-stays) (setq zmacs-region-stays t))
   (setq reftex-callback-fwd t)
   (or (eobp) (forward-char 1))
-  (goto-char (or (next-single-property-change (point) :data)
+  (goto-char (or (next-single-property-change (point) :data) 
                  (point))))
 (defun reftex-toc-previous (&optional arg)
   "Move to previous selectable item."
@@ -367,7 +365,7 @@
 With prefix ARG, prompt for a label type and include only labels of
 that specific type."
   (interactive "P")
-  (setq reftex-toc-include-labels
+  (setq reftex-toc-include-labels 
         (if arg (reftex-query-label-type)
           (not reftex-toc-include-labels)))
   (reftex-toc-revert))
@@ -471,7 +469,7 @@
 (defun reftex-toc-rescan (&rest ignore)
   "Regenerate the *toc* buffer by reparsing file of section at point."
   (interactive)
-  (if (and reftex-enable-partial-scans
+  (if (and reftex-enable-partial-scans 
            (null current-prefix-arg))
       (let* ((data (get-text-property (point) :data))
              (what (car data))
@@ -505,7 +503,7 @@
 (defun reftex-toc-revert (&rest ignore)
   "Regenerate the *toc* from the internal lists."
   (interactive)
-  (let ((unsplittable
+  (let ((unsplittable 
          (if (fboundp 'frame-property)
              (frame-property (selected-frame) 'unsplittable)
            (frame-parameter (selected-frame) 'unsplittable)))
@@ -547,6 +545,13 @@
 
 ;; Promotion/Demotion stuff
 
+(defvar delta)
+(defvar mpos)
+(defvar pro-or-de)
+(defvar start-pos)
+(defvar start-line)
+(defvar mark-line)
+
 (defun reftex-toc-demote (&optional arg)
   "Demote section at point.  If region is active, apply to all in region."
   (interactive "p")
@@ -592,7 +597,7 @@
             (goto-char start-pos)
             (setq sections (reftex-toc-extract-section-number (car entries)))
             (if (> (setq nsec (length entries)) 1)
-                (setq sections
+                (setq sections 
                       (concat sections "-"
                               (reftex-toc-extract-section-number
                                (nth (1- nsec) entries)))))
@@ -617,17 +622,11 @@
             (save-window-excursion
               (reftex-toc-Rescan))
             (reftex-toc-restore-region start-line mark-line)
-            (message "%d section%s %smoted"
+            (message "%d section%s %smoted" 
                      nsec (if (= 1 nsec) "" "s") pro-or-de)
             nil))
     (if msg (progn (ding) (message msg)))))
 
-(defvar delta)
-(defvar mpos)
-(defvar pro-or-de)
-(defvar start-pos)
-(defvar start-line)
-(defvar mark-line)
 
 (defun reftex-toc-restore-region (point-line &optional mark-line)
   (if mark-line
@@ -642,6 +641,10 @@
           (setq mark-active t
                 deactivate-mark nil)))))
 
+(defvar name1)
+(defvar dummy)
+(defvar dummy2)
+
 (defun reftex-toc-promote-prepare (x)
   "Look at a toc entry and see if we could pro/demote it.
 Expects the level change DELTA to be dynamically scoped into this function.
@@ -670,7 +673,7 @@
                         (beginning-of-line 1)
                         (if (looking-at reftex-section-regexp)
                             (setq name (reftex-match-string 2))
-                          (error "Something is wrong!  Contact maintainer!")))
+                          (error "Something is wrong! Contact maintainer!")))
                     ;; Section has changed, request scan and loading
                     ;; We use a variable to delay until after the safe-exc.
                     ;; because otherwise we loose the region.
@@ -779,7 +782,7 @@
         (error "This is not a label entry."))
     (setq newlabel (read-string (format "Rename label \"%s\" to:" label)))
     (if (assoc newlabel (symbol-value reftex-docstruct-symbol))
-        (if (not (y-or-n-p
+        (if (not (y-or-n-p 
                   (format "Label '%s' exists. Use anyway? " label)))
             (error "Abort")))
     (save-excursion
@@ -789,7 +792,7 @@
             (reftex-query-replace-document
              (concat "{" (regexp-quote label) "}")
              (format "{%s}" newlabel))
-          (error t))))
+          (error t))))        
     (reftex-toc-rescan)))
 
 
@@ -808,9 +811,9 @@
          show-window show-buffer match)
 
     (unless toc (error "Don't know which toc line to visit"))
-
+    
     (cond
-
+  
      ((eq (car toc) 'toc)
       ;; a toc entry
       (setq match (reftex-toc-find-section toc no-revisit)))
@@ -826,7 +829,7 @@
                   (file (nth 1 toc)))
               (if (or (not no-revisit) (reftex-get-buffer-visiting file))
                   (progn
-                    (switch-to-buffer-other-window
+                    (switch-to-buffer-other-window 
                      (reftex-get-file-buffer-force file nil))
                     (goto-char (if (eq where 'bof) (point-min) (point-max))))
                 (message reftex-no-follow-message) nil))))
@@ -879,8 +882,8 @@
                 (looking-at (reftex-make-desperate-section-regexp literal))
                 (looking-at (concat "\\\\"
                                     (regexp-quote
-                                     (car
-                                      (rassq level
+                                     (car 
+                                      (rassq level 
                                              reftex-section-levels-all)))
                                     "[[{]?"))))
            ((or (not no-revisit)
@@ -1050,7 +1053,7 @@
       (define-key reftex-toc-map (vector (list key)) 'digit-argument))
 (define-key reftex-toc-map "-" 'negative-argument)
 
-(easy-menu-define
+(easy-menu-define 
  reftex-toc-menu reftex-toc-map
  "Menu for Table of Contents buffer"
  '("TOC"
@@ -1083,7 +1086,7 @@
     ["Context" reftex-toc-toggle-context :style toggle
      :selected reftex-toc-include-context]
     "--"
-    ["Follow Mode" reftex-toc-toggle-follow :style toggle
+    ["Follow Mode" reftex-toc-toggle-follow :style toggle 
      :selected reftex-toc-follow-mode]
     ["Auto Recenter" reftex-toggle-auto-toc-recenter :style toggle
      :selected reftex-toc-auto-recenter-timer]
--- a/lisp/textmodes/reftex-vars.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/reftex-vars.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1,10 +1,9 @@
 ;;; reftex-vars.el --- configuration variables for RefTeX
-
-;; Copyright (C) 1997, 1998, 1999, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2003, 2004, 2005
+;;  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.28
+;; Version: VERSIONTAG
 
 ;; This file is part of GNU Emacs.
 
@@ -20,13 +19,13 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
 ;;; Code:
-
+(eval-when-compile (defvar reftex-tables-dirty))
 (eval-when-compile (require 'cl))
 (eval-and-compile
   (defun reftex-set-dirty (symbol value)
--- a/lisp/textmodes/reftex.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/reftex.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1,10 +1,9 @@
 ;;; reftex.el --- minor mode for doing \label, \ref, \cite, \index in LaTeX
-
-;; Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
+;;  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.28
+;; Version: VERSIONTAG
 ;; Keywords: tex
 
 ;; This file is part of GNU Emacs.
@@ -21,13 +20,13 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;---------------------------------------------------------------------------
 ;;
 ;;; Commentary:
-;;
+;; 
 ;; RefTeX is a minor mode with distinct support for \ref, \label, \cite,
 ;; and \index commands in (multi-file) LaTeX documents.
 ;; - A table of contents provides easy access to any part of a document.
@@ -72,7 +71,7 @@
 ;;
 ;; Introduction
 ;; ************
-;;
+;; 
 ;; RefTeX is a specialized package for support of labels, references,
 ;; citations, and the index in LaTeX.  RefTeX wraps itself round 4 LaTeX
 ;; macros: `\label', `\ref', `\cite', and `\index'.  Using these macros
@@ -81,13 +80,13 @@
 ;; time-consuming tasks almost entirely.  It also provides functions to
 ;; display the structure of a document and to move around in this
 ;; structure quickly.
-;;
+;; 
 ;;    *Note Imprint::, for information about who to contact for help, bug
 ;; reports or suggestions.
-;;
+;; 
 ;; Environment
 ;; ===========
-;;
+;; 
 ;; RefTeX needs to access all files which are part of a multifile
 ;; document, and the BibTeX database files requested by the
 ;; `\bibliography' command.  To find these files, RefTeX will require a
@@ -96,26 +95,26 @@
 ;; which are also used by RefTeX.  However, on some systems these
 ;; variables do not contain the full search path.  If RefTeX does not work
 ;; for you because it cannot find some files, read *Note Finding Files::.
-;;
+;; 
 ;; Entering RefTeX Mode
 ;; ====================
-;;
+;; 
 ;; To turn RefTeX Mode on and off in a particular buffer, use `M-x
 ;; reftex-mode'.  To turn on RefTeX Mode for all LaTeX files, add the
 ;; following lines to your `.emacs' file:
-;;
+;; 
 ;;      (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
 ;;      (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
-;;
+;; 
 ;; RefTeX in a Nutshell
 ;; ====================
-;;
+;; 
 ;;   1. Table of Contents
 ;;      Typing `C-c =' (`reftex-toc') will show a table of contents of the
 ;;      document.  This buffer can display sections, labels and index
 ;;      entries defined in the document.  From the buffer, you can jump
 ;;      quickly to every part of your document.  Press `?' to get help.
-;;
+;; 
 ;;   2. Labels and References
 ;;      RefTeX helps to create unique labels and to find the correct key
 ;;      for references quickly.  It distinguishes labels for different
@@ -123,7 +122,7 @@
 ;;      others), and can be configured to recognize any additional labeled
 ;;      environments you have defined yourself (variable
 ;;      `reftex-label-alist').
-;;
+;; 
 ;;         * Creating Labels
 ;;           Type `C-c (' (`reftex-label') to insert a label at point.
 ;;           RefTeX will either
@@ -132,17 +131,17 @@
 ;;                tables) or
 ;;              - insert a simple label made of a prefix and a number (all
 ;;                other environments)
-;;
+;; 
 ;;           Which labels are created how is configurable with the variable
 ;;           `reftex-insert-label-flags'.
-;;
+;; 
 ;;         * Referencing Labels
 ;;           To make a reference, type `C-c )' (`reftex-reference').  This
 ;;           shows an outline of the document with all labels of a certain
 ;;           type (figure, equation,...) and some label context.
 ;;           Selecting a label inserts a `\ref{LABEL}' macro into the
 ;;           original buffer.
-;;
+;; 
 ;;   3. Citations
 ;;      Typing `C-c [' (`reftex-citation') will let you specify a regular
 ;;      expression to search in current BibTeX database files (as
@@ -151,7 +150,7 @@
 ;;      sorted.  The selected article is referenced as `\cite{KEY}' (see
 ;;      the variable `reftex-cite-format' if you want to insert different
 ;;      macros).
-;;
+;; 
 ;;   4. Index Support
 ;;      RefTeX helps to enter index entries.  It also compiles all entries
 ;;      into an alphabetically sorted `*Index*' buffer which you can use
@@ -159,25 +158,25 @@
 ;;      index macros and can be configured to recognize any additional
 ;;      macros you have defined (`reftex-index-macros').  Multiple indices
 ;;      are supported.
-;;
+;; 
 ;;         * Creating Index Entries
 ;;           To index the current selection or the word at point, type
 ;;           `C-c /' (`reftex-index-selection-or-word').  The default macro
 ;;           `reftex-index-default-macro' will be used.  For a more
 ;;           complex entry type `C-c <' (`reftex-index'), select any of
 ;;           the index macros and enter the arguments with completion.
-;;
+;; 
 ;;         * The Index Phrases File (Delayed Indexing)
 ;;           Type `C-c \' (`reftex-index-phrase-selection-or-word') to add
 ;;           the current word or selection to a special _index phrase
 ;;           file_.  RefTeX can later search the document for occurrences
 ;;           of these phrases and let you interactively index the matches.
-;;
+;; 
 ;;         * Displaying and Editing the Index
 ;;           To display the compiled index in a special buffer, type `C-c
 ;;           >' (`reftex-display-index').  From that buffer you can check
 ;;           and edit all entries.
-;;
+;; 
 ;;   5. Viewing Cross-References
 ;;      When point is on the KEY argument of a cross-referencing macro
 ;;      (`\label', `\ref', `\cite', `\bibitem', `\index', and variations)
@@ -187,14 +186,14 @@
 ;;      When the enclosing macro is `\cite' or `\ref' and no other message
 ;;      occupies the echo area, information about the citation or label
 ;;      will automatically be displayed in the echo area.
-;;
+;; 
 ;;   6. Multifile Documents
 ;;      Multifile Documents are fully supported.  The included files must
 ;;      have a file variable `TeX-master' or `tex-main-file' pointing to
 ;;      the master file.  RefTeX provides cross-referencing information
 ;;      from all parts of the document, and across document borders
 ;;      (`xr.sty').
-;;
+;; 
 ;;   7. Document Parsing
 ;;      RefTeX needs to parse the document in order to find labels and
 ;;      other information.  It does it automatically once and updates its
@@ -203,23 +202,23 @@
 ;;      with a raw `C-u' prefix, or press the `r' key in the label
 ;;      selection buffer, the table of contents buffer, or the index
 ;;      buffer.
-;;
+;; 
 ;;   8. AUCTeX
 ;;      If your major LaTeX mode is AUCTeX, RefTeX can cooperate with it
 ;;      (see variable `reftex-plug-into-AUCTeX').  AUCTeX contains style
 ;;      files which trigger appropriate settings in RefTeX, so that for
 ;;      many of the popular LaTeX packages no additional customizations
 ;;      will be necessary.
-;;
+;; 
 ;;   9. Useful Settings
 ;;      To make RefTeX faster for large documents, try these:
 ;;           (setq reftex-enable-partial-scans t)
 ;;           (setq reftex-save-parse-info t)
 ;;           (setq reftex-use-multiple-selection-buffers t)
-;;
+;; 
 ;;      To integrate with AUCTeX, use
 ;;           (setq reftex-plug-into-AUCTeX t)
-;;
+;; 
 ;;      To make your own LaTeX macro definitions known to RefTeX,
 ;;      customize the variables
 ;;           `reftex-label-alist'          (for label macros/environments)
@@ -229,7 +228,7 @@
 ;;           `reftex-index-default-macro'  (to set the default macro)
 ;;      If you have a large number of macros defined, you may want to write
 ;;      an AUCTeX style file to support them with both AUCTeX and RefTeX.
-;;
+;; 
 ;;  10. Where Next?
 ;;      Go ahead and use RefTeX.  Use its menus until you have picked up
 ;;      the key bindings.  For an overview of what you can do in each of
@@ -238,7 +237,7 @@
 ;;      The first part of the manual explains in a tutorial way how to use
 ;;      and customize RefTeX.  The second part is a command and variable
 ;;      reference.
-;;
+;; 
 ;;---------------------------------------------------------------------------
 ;;
 ;; AUTHOR
@@ -289,8 +288,6 @@
     (setq reftex-tables-dirty t)
     (set symbol value)))
 
-(defvar font-lock-keywords)
-
 
 ;;; =========================================================================
 ;;;
@@ -304,7 +301,7 @@
 ;;; Define the formal stuff for a minor mode named RefTeX.
 ;;;
 
-(defconst reftex-version "RefTeX version 4.28"
+(defconst reftex-version "RefTeX version VERSIONTAG"
   "Version string for RefTeX.")
 
 (defvar reftex-mode nil
@@ -322,7 +319,7 @@
   (setq reftex-syntax-table (copy-syntax-table))
   (modify-syntax-entry ?\( "." reftex-syntax-table)
   (modify-syntax-entry ?\) "." reftex-syntax-table))
-
+        
 (unless reftex-syntax-table-for-bib
   (setq reftex-syntax-table-for-bib
         (copy-syntax-table reftex-syntax-table))
@@ -398,7 +395,7 @@
         (setq reftex-syntax-table (copy-syntax-table (syntax-table)))
         (modify-syntax-entry ?\( "." reftex-syntax-table)
         (modify-syntax-entry ?\) "." reftex-syntax-table)
-
+        
         (setq reftex-syntax-table-for-bib
               (copy-syntax-table reftex-syntax-table))
         (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib)
@@ -457,6 +454,7 @@
   (defvar tex-main-file)
   (defvar outline-minor-mode)
   (defvar font-lock-mode)
+  (defvar font-lock-keywords)
   (defvar font-lock-fontify-region-function)
   (defvar font-lock-syntactic-keywords))
 
@@ -539,7 +537,7 @@
       ((master
         (cond
          ((fboundp 'TeX-master-file) ; AUCTeX is loaded.  Use its mechanism.
-          (condition-case nil
+          (condition-case nil 
               (TeX-master-file t)
             (error (buffer-file-name))))
          ((fboundp 'tex-main-file) (tex-main-file)) ; Emacs LaTeX mode
@@ -579,7 +577,7 @@
       )
      (t
       ;; Use buffer file name.
-      (buffer-file-name)))
+      (setq master (buffer-file-name))))
     (expand-file-name master)))
 
 (defun reftex-is-multi ()
@@ -740,14 +738,14 @@
 
 ;; A list of all variables in the cache.
 ;; The cache is used to save the compiled versions of some variables.
-(defconst reftex-cache-variables
+(defconst reftex-cache-variables 
   '(reftex-memory ;; This MUST ALWAYS be the first!
-
+    
     ;; Outline
     reftex-section-levels-all
 
     ;; Labels
-    reftex-env-or-mac-alist
+    reftex-env-or-mac-alist 
     reftex-special-env-parsers
     reftex-macros-with-labels
     reftex-label-mac-list
@@ -764,7 +762,7 @@
     reftex-index-macro-alist
     reftex-macros-with-index
     reftex-query-index-macro-prompt
-    reftex-query-index-macro-help
+    reftex-query-index-macro-help 
     reftex-key-to-index-macro-alist
 
     ;; Regular expressions
@@ -809,7 +807,7 @@
      (t (reftex-compile-variables)))))
 
 (defun reftex-reset-mode ()
-  "Reset RefTeX Mode.
+  "Reset RefTeX Mode.  
 This will re-compile the configuration information and remove all
 current scanning information and the parse file to enforce a rescan
 on next use."
@@ -860,12 +858,12 @@
 
 (defun reftex-erase-all-selection-and-index-buffers ()
   ;; Remove all selection buffers associated with current document.
-  (mapcar
+  (mapcar 
    (lambda (type)
      (reftex-erase-buffer (reftex-make-selection-buffer-name type)))
    reftex-typekey-list)
   ;; Kill all index buffers
-  (mapcar
+  (mapcar 
    (lambda (tag)
      (reftex-kill-buffer (reftex-make-index-buffer-name tag)))
    (cdr (assoc 'index-tags (symbol-value reftex-docstruct-symbol)))))
@@ -881,7 +879,7 @@
 
   ;; Record that we have done this, and what we have used.
   (setq reftex-tables-dirty nil)
-  (setq reftex-memory
+  (setq reftex-memory 
         (list reftex-label-alist
               (get reftex-docstruct-symbol 'reftex-section-levels)
               (get reftex-docstruct-symbol 'reftex-label-alist-style)
@@ -900,7 +898,7 @@
               '(nil)))
         (all-index (reftex-uniquify-by-car
                     (reftex-splice-symbols-into-list
-                     (append reftex-index-macros
+                     (append reftex-index-macros 
                              (get reftex-docstruct-symbol
                                   'reftex-index-macros-style)
                              '(default))
@@ -911,7 +909,7 @@
         macro verify repeat nindex tag key toc-level toc-levels)
 
     (setq reftex-words-to-typekey-alist nil
-          reftex-prefix-to-typekey-alist
+          reftex-prefix-to-typekey-alist 
           '(("sec:" . "s") ("cha:" . "s") ("chap:" . "s"))
           reftex-typekey-list nil
           reftex-typekey-to-format-alist nil
@@ -967,7 +965,7 @@
          ((symbolp env-or-mac)
           ;; A special parser function
           (unless (fboundp env-or-mac)
-            (message "Warning: %s does not seem to be a valid function"
+            (message "Warning: %s does not seem to be a valid function" 
                      env-or-mac))
           (setq nargs nil nlabel nil opt-args nil)
           (add-to-list 'reftex-special-env-parsers env-or-mac)
@@ -995,8 +993,8 @@
                            (push (cons string toc-level) toc-levels))))))))
         ;; Translate some special context cases
         (when (assq context reftex-default-context-regexps)
-          (setq context
-                (format
+          (setq context 
+                (format 
                  (cdr (assq context reftex-default-context-regexps))
                  (regexp-quote env-or-mac))))
         ;; See if this is the first format for this typekey
@@ -1029,7 +1027,7 @@
           (nreverse reftex-typekey-to-prefix-alist))
 
     ;; Prepare the typekey query prompt and help string.
-    (setq qh-list
+    (setq qh-list 
           (sort qh-list
                 (lambda (x1 x2)
                   (string< (downcase (car x1)) (downcase (car x2))))))
@@ -1040,7 +1038,7 @@
                   "]"))
     ;; In the help string, we need to wrap lines...
     (setq reftex-type-query-help
-          (concat
+          (concat 
            "SELECT A LABEL TYPE:\n--------------------\n"
            (mapconcat
             (lambda(x)
@@ -1060,7 +1058,7 @@
     ;; which allow for some chars from the ref format to be in the buffer.
     ;; These characters will be seen and removed.
     (setq reftex-words-to-typekey-alist
-          (mapcar
+          (mapcar 
            (lambda (x)
              (setq word (car x)
                    typekey (cdr x)
@@ -1113,18 +1111,18 @@
     (setq reftex-key-to-index-macro-alist
           (sort reftex-key-to-index-macro-alist
                 (lambda (a b) (< (downcase (car a)) (downcase (car b))))))
-    (setq reftex-query-index-macro-prompt
+    (setq reftex-query-index-macro-prompt 
           (concat "Index macro: ["
                   (mapconcat (lambda (x) (char-to-string (car x)))
                              reftex-key-to-index-macro-alist "")
                   "]"))
     (setq i 0
           reftex-query-index-macro-help
-          (concat
+          (concat 
            "SELECT A MACRO:\n---------------\n"
            (mapconcat
             (lambda(x)
-              (format "[%c] %-20.20s%s" (car x) (nth 1 x)
+              (format "[%c] %-20.20s%s" (car x) (nth 1 x) 
                       (if (= 0 (mod (incf i) 3)) "\n" "")))
             reftex-key-to-index-macro-alist "")))
 
@@ -1138,11 +1136,11 @@
     (let* (
 ;          (wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
            (wbol "\\(^\\)[ \t]*")  ; Need to keep the empty group because
-                                  ;;; because match number are hard coded
+                                  ;;; because match number are hard coded  
            (label-re "\\\\label{\\([^}]*\\)}")
-           (include-re (concat wbol
+           (include-re (concat wbol 
                                "\\\\\\("
-                               (mapconcat 'identity
+                               (mapconcat 'identity 
                                           reftex-include-file-commands "\\|")
                                "\\)[{ \t]+\\([^} \t\n\r]+\\)"))
            (section-re
@@ -1196,7 +1194,7 @@
             reftex-macros-with-labels macros-with-labels
             reftex-find-index-entry-regexp-format find-index-re-format
             reftex-find-label-regexp-format find-label-re-format
-            reftex-find-label-regexp-format2
+            reftex-find-label-regexp-format2 
             "\\([]} \t\n\r]\\)\\([[{]\\)\\(%s\\)[]}]")
       (message "Compiling label environment definitions...done")))
   (put reftex-docstruct-symbol 'reftex-cache
@@ -1273,7 +1271,7 @@
   (and (symbolp reftex-docstruct-symbol)
        (symbol-value reftex-docstruct-symbol)
        t))
-
+  
 (defun reftex-silence-toc-markers (list n)
   ;; Set all toc markers in the first N entries in list to nil
   (while (and list (> (decf n) -1))
@@ -1290,7 +1288,7 @@
          (master (reftex-TeX-master-file))
          (enable-local-variables nil)
          (file (if (string-match "\\.[a-zA-Z]+\\'" master)
-                   (concat (substring master 0 (match-beginning 0))
+                   (concat (substring master 0 (match-beginning 0)) 
                            reftex-parse-file-extension)
                  (concat master reftex-parse-file-extension))))
     (cond
@@ -1369,7 +1367,7 @@
 
   ;; Check if the master is the same: when moving a document, this will see it.
   (let* ((real-master (reftex-TeX-master-file))
-         (parsed-master
+         (parsed-master 
           (nth 1 (assq 'bof (symbol-value reftex-docstruct-symbol)))))
     (unless (string= (file-truename real-master) (file-truename parsed-master))
       (message "Master file name in load file is different: %s versus %s"
@@ -1389,7 +1387,7 @@
 (defun reftex-select-external-document (xr-alist xr-index)
   ;; Return index of an external document.
   (let* ((len (length xr-alist)) (highest (1- (+ ?0 len)))
-         (prompt (format "[%c-%c] Select    TAB: Read prefix with completion"
+         (prompt (format "[%c-%c] Select    TAB: Read prefix with completion" 
                          ?0 highest))
          key prefix)
     (cond
@@ -1400,7 +1398,7 @@
       (- 1 xr-index))
      (t
       (save-excursion
-        (let* ((length (apply 'max (mapcar
+        (let* ((length (apply 'max (mapcar 
                                     (lambda(x) (length (car x))) xr-alist)))
                (fmt (format " [%%c]  %%-%ds  %%s\n" length))
                (n (1- ?0)))
@@ -1410,7 +1408,7 @@
                  (concat
                   "SELECT EXTERNAL DOCUMENT\n------------------------\n"
                   (mapconcat
-                   (lambda (x)
+                   (lambda (x) 
                      (format fmt (incf n) (or (car x) "")
                              (abbreviate-file-name (cdr x))))
                    xr-alist ""))
@@ -1434,7 +1432,7 @@
   (let* ((rec-values (if reftex-search-unrecursed-path-first '(nil t) '(t)))
          (extensions (cdr (assoc type reftex-file-extensions)))
          (def-ext (car extensions))
-         (ext-re (concat "\\("
+         (ext-re (concat "\\(" 
                          (mapconcat 'regexp-quote extensions "\\|")
                          "\\)\\'"))
          (files (if (string-match ext-re file)
@@ -1443,8 +1441,8 @@
          path old-path file1)
     (cond
      ((file-name-absolute-p file)
-      (setq file1
-            (or
+      (setq file1 
+            (or 
              (and (car files) (file-regular-p (car files)) (car files))
              (and (cdr files) (file-regular-p (cdr files)) (cdr files)))))
      ((and reftex-use-external-file-finders
@@ -1459,10 +1457,10 @@
             (setq old-path path
                   path (cons master-dir path)
                   file1 (or (and (car files)
-                                 (reftex-find-file-on-path
+                                 (reftex-find-file-on-path 
                                   (car files) path master-dir))
                             (and (cdr files)
-                                 (reftex-find-file-on-path
+                                 (reftex-find-file-on-path 
                                   (cdr files) path master-dir))))))))
     (cond (file1 file1)
           (die (error "No such file: %s" file) nil)
@@ -1507,7 +1505,7 @@
            (reftex-uniquify
             (reftex-parse-colon-path
              (mapconcat
-              (lambda(x)
+              (lambda(x) 
                 (if (string-match "^!" x)
                     (apply 'reftex-process-string
                            (split-string (substring x 1)))
@@ -1516,7 +1514,7 @@
               ;;  (cdr (assoc type reftex-path-environment))
               ;; However, historically we have separate options for the
               ;; environment variables, so we have to do this:
-              (symbol-value (intern (concat "reftex-" type
+              (symbol-value (intern (concat "reftex-" type 
                                             "path-environment-variables")))
               path-separator))))
       (put pathvar 'status 'split)
@@ -1542,11 +1540,11 @@
           ;; or:     Relative recursive path elements need to be expanded
           ;;         relative to new default directory
           (message "Expanding search path to find %s file: %s ..." type file)
-          (put pathvar 'recursive-path
+          (put pathvar 'recursive-path 
                (reftex-expand-path (symbol-value pathvar) master-dir))
           (put pathvar 'master-dir master-dir)
           (get pathvar 'recursive-path))
-         (t
+         (t 
           ;; Recursive path computed earlier is still OK.
           (get pathvar 'recursive-path)))
       ;; The simple path was requested
@@ -1575,7 +1573,7 @@
   ;; Trailing ! or !! will be converted into `//' (emTeX convention)
   (mapcar
    (lambda (dir)
-     (if (string-match "\\(//+\\|/*!+\\)\\'" dir)
+     (if (string-match "\\(//+\\|/*!+\\)\\'" dir) 
          (setq dir (replace-match "//" t t dir)))
      (file-name-as-directory dir))
    (delete "" (split-string path (concat path-separator "+")))))
@@ -1604,7 +1602,7 @@
       (when (file-directory-p dir)
         (setq files (nreverse (directory-files dir t "[^.]")))
         (while (setq file (pop files))
-          (if (file-directory-p file)
+          (if (file-directory-p file) 
               (push (file-name-as-directory file) path)))
         (push dir path1)))
     path1))
@@ -1667,7 +1665,7 @@
   "Show the table of contents for the current document." t)
 (autoload 'reftex-toc-recenter "reftex-toc"
   "Display the TOC window and highlight line corresponding to current position." t)
-(autoload 'reftex-toggle-auto-toc-recenter "reftex-toc"
+(autoload 'reftex-toggle-auto-toc-recenter "reftex-toc" 
   "Toggle automatic recentering of TOC window." t)
 
 ;;; =========================================================================
@@ -1886,7 +1884,7 @@
     (while list
       (if (funcall predicate (car list))
           (push (if completion
-                    (list (nth nth (car list)))
+                    (list (nth nth (car list))) 
                   (nth nth (car list)))
                 rtn))
       (setq list (cdr list)))
@@ -1922,7 +1920,7 @@
   ;; If POS is given, calculate distances relative to it.
   ;; Return nil if there is no match.
   (let ((pos (point))
-        (dist (or max-length (length regexp)))
+        (dist (or max-length (length regexp)))  
         match1 match2 match)
     (goto-char (min (+ pos dist) (point-max)))
     (when (re-search-backward regexp nil t)
@@ -2008,10 +2006,10 @@
                 ((and scroll (equal char ?\C-? ))
                  (condition-case nil (scroll-down) (error nil))
                  (message prompt))
-                (t (message "")
+                (t (message "") 
                    (throw 'exit char)))
           (setq char (read-char-exclusive)))))))
-
+      
 
 (defun reftex-make-regexp-allow-for-ctrl-m (string)
   ;; convert STRING into a regexp, allowing ^M for \n and vice versa
@@ -2209,10 +2207,10 @@
     ;; Restrict number of words
     (if (> (length words) nwords)
         (setcdr (nthcdr (1- nwords) words) nil))
-
+    
     ;; First, try to use all words
     (setq string (mapconcat 'identity words sep))
-
+  
     ;; Abbreviate words if enforced by user settings or string length
     (if (or (eq t abbrev)
             (and abbrev
@@ -2304,7 +2302,7 @@
               (font-lock-set-defaults-1)
               (reftex-select-font-lock-fontify-region (point-min) (point-max))))
            (t
-            ;; Oops?
+            ;; Oops? 
             (message "Sorry: cannot refontify RefTeX Select buffer."))))
       (rename-buffer oldname))))
 
@@ -2353,7 +2351,7 @@
 
 ;; Initialize the overlays
 (aset reftex-highlight-overlays 0 (reftex-make-overlay 1 1))
-(reftex-overlay-put (aref reftex-highlight-overlays 0)
+(reftex-overlay-put (aref reftex-highlight-overlays 0) 
              'face 'highlight)
 (aset reftex-highlight-overlays 1 (reftex-make-overlay 1 1))
 (reftex-overlay-put (aref reftex-highlight-overlays 1)
@@ -2378,7 +2376,7 @@
 
 ;;; =========================================================================
 ;;;
-;;; Keybindings
+;;; Keybindings 
 
 ;; The default bindings in the mode map.
 (loop for x in
@@ -2398,10 +2396,10 @@
 ;; Bind `reftex-mouse-view-crossref' only when the key is still free
 (if (featurep 'xemacs)
     (unless (key-binding [(shift button2)])
-      (define-key reftex-mode-map [(shift button2)]
+      (define-key reftex-mode-map [(shift button2)] 
         'reftex-mouse-view-crossref))
   (unless (key-binding [(shift mouse-2)])
-    (define-key reftex-mode-map [(shift mouse-2)]
+    (define-key reftex-mode-map [(shift mouse-2)] 
       'reftex-mouse-view-crossref)))
 
 ;; Bind `reftex-view-crossref-from-bibtex' in BibTeX mode map
@@ -2505,7 +2503,7 @@
    ("Reference Style"
     ["Default" (setq reftex-vref-is-default nil
                      reftex-fref-is-default nil)
-     :style radio :selected (not (or reftex-vref-is-default
+     :style radio :selected (not (or reftex-vref-is-default 
                                      reftex-fref-is-default))]
     ["Varioref" (setq reftex-vref-is-default t
                       reftex-fref-is-default nil)
@@ -2540,7 +2538,7 @@
           (list 'reftex-add-index-macros (list 'list (list 'quote (car x))))
           :style 'radio :selected
           (list 'memq (list 'quote (car x))
-                (list 'get 'reftex-docstruct-symbol
+                (list 'get 'reftex-docstruct-symbol 
                       (list 'quote 'reftex-index-macros-style)))))
        reftex-index-macros-builtin))
    "--"
@@ -2549,7 +2547,7 @@
    ("Customize"
     ["Browse RefTeX Group" reftex-customize t]
     "--"
-    ["Build Full Customize Menu" reftex-create-customize-menu
+    ["Build Full Customize Menu" reftex-create-customize-menu 
      (fboundp 'customize-menu-create)])
    ("Documentation"
     ["Info" reftex-info t]
@@ -2565,7 +2563,7 @@
   (interactive)
   (if (fboundp 'customize-menu-create)
       (progn
-        (easy-menu-change
+        (easy-menu-change 
          '("Ref") "Customize"
          `(["Browse RefTeX group" reftex-customize t]
            "--"
@@ -2603,7 +2601,7 @@
 ;;; That's it! ----------------------------------------------------------------
 
 (setq reftex-tables-dirty t)  ; in case this file is evaluated by hand
-(provide 'reftex)
+(provide 'reftex) 
 
 ;;;============================================================================
 
--- a/lisp/textmodes/tildify.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/textmodes/tildify.el	Mon Sep 19 10:20:33 2005 +0000
@@ -222,11 +222,11 @@
 		      (if (> (point) (marker-position marker-end))
 			  (setq finish t))
 		    (message
-		     (format "End of environment not found: %s" end-env))
+		     "End of environment not found: %s" end-env)
 		    (setq finish t))))))
       ;; No ignored environments, tildify directly
       (tildify-tildify beg end ask)))
-  (message (format "%d spaces replaced." tildify-count)))
+  (message "%d spaces replaced." tildify-count))
 
 ;;;###autoload
 (defun tildify-buffer ()
--- a/lisp/time-stamp.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/time-stamp.el	Mon Sep 19 10:20:33 2005 +0000
@@ -5,7 +5,7 @@
 
 ;; This file is part of GNU Emacs.
 
-;; Maintainer's Time-stamp: <2004-06-13 19:04:36 teirllm>
+;; Maintainer's Time-stamp: <2004-09-25 20:55:35 gildea>
 ;; Maintainer: Stephen Gildea <gildea@stop.mail-abuse.org>
 ;; Keywords: tools
 
@@ -143,20 +143,26 @@
 file to be time-stamped by \\[time-stamp].  A value of 0 searches the
 entire buffer (use with care).
 
-Do not change `time-stamp-line-limit', `time-stamp-start', or
-`time-stamp-end' for yourself or you will be incompatible
-with other people's files!  If you must change them for some application,
-do so in the local variables section of the time-stamped file itself.")
+This value can also be set with the variable `time-stamp-pattern'.
+
+Do not change `time-stamp-line-limit', `time-stamp-start',
+`time-stamp-end', or `time-stamp-pattern' for yourself or you will be
+incompatible with other people's files!  If you must change them for some
+application, do so in the local variables section of the time-stamped file
+itself.")
 
 
 (defvar time-stamp-start "Time-stamp:[ \t]+\\\\?[\"<]+"    ;Do not change!
   "Regexp after which the time stamp is written by \\[time-stamp].
 See also the variables `time-stamp-end' and `time-stamp-line-limit'.
 
-Do not change `time-stamp-line-limit', `time-stamp-start', or
-`time-stamp-end' for yourself or you will be incompatible
-with other people's files!  If you must change them for some application,
-do so in the local variables section of the time-stamped file itself.")
+This value can also be set with the variable `time-stamp-pattern'.
+
+Do not change `time-stamp-line-limit', `time-stamp-start',
+`time-stamp-end', or `time-stamp-pattern' for yourself or you will be
+incompatible with other people's files!  If you must change them for some
+application, do so in the local variables section of the time-stamped file
+itself.")
 
 
 (defvar time-stamp-end "\\\\?[\">]"    ;Do not change!
@@ -165,13 +171,15 @@
 and the following match of `time-stamp-end', then writes the
 time stamp specified by `time-stamp-format' between them.
 
+This value can also be set with the variable `time-stamp-pattern'.
+
 The end text normally starts on the same line as the start text ends,
 but if there are any newlines in `time-stamp-format', the same number
 of newlines must separate the start and end.  \\[time-stamp] tries
 to not change the number of lines in the buffer.  `time-stamp-inserts-lines'
 controls this behavior.
 
-Do not change `time-stamp-line-limit', `time-stamp-start', `time-stamp-end',
+Do not change `time-stamp-start', `time-stamp-end', `time-stamp-pattern',
 or `time-stamp-inserts-lines' for yourself or you will be incompatible
 with other people's files!  If you must change them for some application,
 do so in the local variables section of the time-stamped file itself.")
@@ -231,9 +239,11 @@
 \"@set Time-stamp: %:b %:d, %:y$\"
 \"newcommand{\\\\\\\\timestamp}{%%}\"
 
-Do not change `time-stamp-pattern' for yourself or you will be incompatible
-with other people's files!  Set it only in the local variables section
-of the time-stamped file itself.")
+Do not change `time-stamp-pattern' `time-stamp-line-limit',
+`time-stamp-start', or `time-stamp-end' for yourself or you will be
+incompatible with other people's files!  If you must change them for
+some application, do so only in the local variables section of the
+time-stamped file itself.")
 
 
 
@@ -251,10 +261,11 @@
 The time stamp is written between the brackets or quotes:
       Time-stamp: <2001-02-18 10:20:51 gildea>
 The time stamp is updated only if the variable `time-stamp-active' is non-nil.
-The format of the time stamp is set by the variable `time-stamp-format'.
-The variables `time-stamp-line-limit', `time-stamp-start', `time-stamp-end',
-`time-stamp-count', and `time-stamp-inserts-lines' control finding the
-template."
+The format of the time stamp is set by the variable `time-stamp-pattern' or
+`time-stamp-format'.  The variables `time-stamp-pattern',
+`time-stamp-line-limit', `time-stamp-start', `time-stamp-end',
+`time-stamp-count', and `time-stamp-inserts-lines' control finding 
+the template."
   (interactive)
   (let ((line-limit time-stamp-line-limit)
 	(ts-start time-stamp-start)
@@ -588,6 +599,13 @@
 	  (user-full-name))
 	 ((eq cur-char ?h)		;mail host name
 	  (time-stamp-mail-host-name))
+	 ((eq cur-char ?q)		;(undocumented unqual hostname)
+	  (let ((qualname (system-name)))
+	    (if (string-match "\\." qualname)
+		(substring qualname 0 (match-beginning 0))
+	      qualname)))
+	 ((eq cur-char ?Q)		;(undocumented fully-qualified host)
+	  (system-name))
 	 ))
 	(let ((padded-result
 	       (format (format "%%%s%c"
--- a/lisp/url/ChangeLog	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/url/ChangeLog	Mon Sep 19 10:20:33 2005 +0000
@@ -1,3 +1,20 @@
+2005-09-17  Richard M. Stallman  <rms@gnu.org>
+
+	* url-vars.el (url-mail-command): Don't test fboundp of `compose-mail'.
+
+	* url-mailto.el (url-mailto): Special case `mail'.
+	Don't test fboundp of `compose-mail'.
+
+2005-09-15  Chong Yidong  <cyd@stupidchicken.com>
+
+	* url-mailto.el (url-mailto): Delete mail buffer after sending
+	autogenerated mail.
+	Call `compose-mail with `new' argument if possible.
+
+2005-09-13  Chong Yidong  <cyd@stupidchicken.com>
+
+	* url-mailto.el (url-mailto): Always use a new mail buffer.
+
 2005-09-01  Chong Yidong  <cyd@stupidchicken.com>
 
 	* url-util.el (url-parse-query-string): New optional argument
--- a/lisp/url/url-mailto.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/url/url-mailto.el	Mon Sep 19 10:20:33 2005 +0000
@@ -92,7 +92,11 @@
 	(setq args (cons (list "to" to) args))))
 
     (setq subject (cdr-safe (assoc "subject" args)))
-    (if (fboundp url-mail-command) (funcall url-mail-command) (mail))
+    (if (eq url-mail-command 'compose-mail)
+	(compose-mail nil nil nil 'new)
+      (if (eq url-mail-command 'mail)
+	  (mail 'new)
+	(funcall url-mail-command)))
     (while args
       (if (string= (caar args) "body")
 	  (progn
@@ -124,12 +128,14 @@
       ;; It seems Microsoft-ish to send without warning.
       ;; Fixme: presumably this should depend on a privacy setting.
       (if (y-or-n-p "Send this auto-generated mail? ")
-	  (cond ((eq url-mail-command 'compose-mail)
-		 (funcall (get mail-user-agent 'sendfunc) nil))
-		;; otherwise, we can't be sure
-		((fboundp 'message-send-and-exit)
-		 (message-send-and-exit))
-		(t (mail-send-and-exit nil)))))
+	  (let ((buffer (current-buffer)))
+	    (cond ((eq url-mail-command 'compose-mail)
+		   (funcall (get mail-user-agent 'sendfunc) nil))
+		  ;; otherwise, we can't be sure
+		  ((fboundp 'message-send-and-exit)
+		   (message-send-and-exit))
+		  (t (mail-send-and-exit nil)))
+	    (kill-buffer buffer))))
     nil))
 
 (provide 'url-mailto)
--- a/lisp/url/url-vars.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/url/url-vars.el	Mon Sep 19 10:20:33 2005 +0000
@@ -174,9 +174,7 @@
 		       (string :tag "Encoding")))
   :group 'url-mime)
 
-(defcustom url-mail-command (if (fboundp 'compose-mail)
-				'compose-mail
-			      'url-mail)
+(defcustom url-mail-command 'compose-mail
   "*This function will be called whenever url needs to send mail.
 It should enter a mail-mode-like buffer in the current window.
 The commands `mail-to' and `mail-subject' should still work in this
--- a/lisp/vc.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/vc.el	Mon Sep 19 10:20:33 2005 +0000
@@ -2333,10 +2333,10 @@
 		 (format "Updating %s... " (abbreviate-file-name dir))
 	       (format "Retrieving snapshot into %s... "
 		       (abbreviate-file-name dir)))))
-    (message msg)
+    (message "%s" msg)
     (vc-call-backend (vc-responsible-backend dir)
 		     'retrieve-snapshot dir name update)
-    (message (concat msg "done"))))
+    (message "%s" (concat msg "done"))))
 
 (defun vc-default-retrieve-snapshot (backend dir name update)
   (if (string= name "")
--- a/lisp/wdired.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/wdired.el	Mon Sep 19 10:20:33 2005 +0000
@@ -264,7 +264,7 @@
   (set-buffer-modified-p nil)
   (setq buffer-undo-list nil)
   (run-mode-hooks 'wdired-mode-hook)
-  (message (substitute-command-keys "Press \\[wdired-finish-edit] when finished \
+  (message "%s" (substitute-command-keys "Press \\[wdired-finish-edit] when finished \
 or \\[wdired-abort-changes] to abort changes")))
 
 
--- a/lisp/woman.el	Sun Sep 11 22:21:01 2005 +0000
+++ b/lisp/woman.el	Mon Sep 19 10:20:33 2005 +0000
@@ -1926,7 +1926,7 @@
     ;; Output the result:
     (and (apropos-print t nil)
 	 message
-	 (message message))))
+	 (message "%s" message))))
 
 
 (defun WoMan-getpage-in-background (topic)
--- a/lispintro/ChangeLog	Sun Sep 11 22:21:01 2005 +0000
+++ b/lispintro/ChangeLog	Mon Sep 19 10:20:33 2005 +0000
@@ -1,3 +1,8 @@
+2005-09-16  Romain Francoise  <romain@orebokech.com>
+
+	* emacs-lisp-intro.texi (GNU Free Documentation License):
+	Specify GFDL version 1.2.
+
 2005-07-30  Eli Zaretskii  <eliz@gnu.org>
 
 	* makefile.w32-in (info): Don't run install-info.
--- a/lispintro/emacs-lisp-intro.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/lispintro/emacs-lisp-intro.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -213,7 +213,7 @@
 ISBN 1-882114-43-4
 
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; there
 being no Invariant Section, with the Front-Cover Texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of
--- a/lispref/ChangeLog	Sun Sep 11 22:21:01 2005 +0000
+++ b/lispref/ChangeLog	Mon Sep 19 10:20:33 2005 +0000
@@ -1,3 +1,34 @@
+2005-09-18  Chong Yidong  <cyd@stupidchicken.com>
+
+	* display.texi (Defining Images): Updated documentation for
+	`image-load-path'.
+
+2005-09-17  Richard M. Stallman  <rms@gnu.org>
+
+	* display.texi (Defining Images): Clean up previous change.
+
+2005-09-16  Romain Francoise  <romain@orebokech.com>
+
+	* elisp.texi: Specify GFDL version 1.2.
+
+	* doclicense.texi (GNU Free Documentation License): Update to
+	version 1.2.
+
+2005-09-15  Chong Yidong  <cyd@stupidchicken.com>
+
+	* display.texi (Defining Images): Document `image-load-path'.
+
+2005-09-15  Richard M. Stallman  <rms@gnu.org>
+
+	* objects.texi (Printed Representation): Minor cleanup.
+	(Box Diagrams): Minor fix.
+	(Cons Cell Type): Move (...) index item here.
+	(Box Diagrams): From here.
+	(Array Type): Minor fix.
+	(Type Predicates): Delete index "predicates".
+	(Hash Table Type): Clarify xref.
+	(Dotted Pair Notation): Minor fix.
+
 2005-09-10  Chong Yidong  <cyd@stupidchicken.com>
 
 	* files.texi (Saving Buffers): Fix typo.
--- a/lispref/display.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/lispref/display.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -3946,10 +3946,31 @@
 @var{file} exists, is used to construct the image specification to be
 returned.  If no specification is satisfied, @code{nil} is returned.
 
-The image is looked for first on @code{load-path} and then in
-@code{data-directory}.
+The image is looked for in @code{image-load-path}.
 @end defun
 
+@defvar image-load-path
+@tindex image-load-path
+This variable's value is a list of locations in which to search for
+image files.  If an element is a string or a variable symbol whose
+value is a string, the string is taken to be the name of a directory
+to search.  If an element is a variable symbol whose value is a list,
+that is taken to be a list of directory names to search.
+
+The default is to search in the @file{images} subdirectory of the
+directory specified by @code{data-directory}, then the directory
+specified by @code{data-directory}, and finally in the directories in
+@code{load-path}.  Subdirectories are not automatically included in
+the search, so if you put an image file in a subdirectory, you have to
+supply the subdirectory name explicitly.  For example, to find the
+image @file{images/foo/bar.xpm} within @code{data-directory}, you
+should specify the image as follows:
+
+@example
+(defimage foo-image '((:type xpm :file "foo/bar.xpm")))
+@end example
+@end defvar
+
 @node Showing Images
 @subsection Showing Images
 
--- a/lispref/doclicense.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/lispref/doclicense.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -2,10 +2,10 @@
 @node GNU Free Documentation License, GPL, Antinews, Top
 
 @appendix GNU Free Documentation License
-@center Version 1.1, March 2000
+@center Version 1.2, November 2002
 
 @display
-Copyright (C) 2000  Free Software Foundation, Inc.
+Copyright (C) 2000,2001,2002  Free Software Foundation, Inc.
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
 Everyone is permitted to copy and distribute verbatim copies
@@ -17,12 +17,12 @@
 PREAMBLE
 
 The purpose of this License is to make a manual, textbook, or other
-written document ``free'' in the sense of freedom: to assure everyone
-the effective freedom to copy and redistribute it, with or without
-modifying it, either commercially or noncommercially.  Secondarily,
-this License preserves for the author and publisher a way to get
-credit for their work, while not being considered responsible for
-modifications made by others.
+functional and useful document ``free'' in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
 
 This License is a kind of ``copyleft'', which means that derivative
 works of the document must themselves be free in the same sense.  It
@@ -41,11 +41,15 @@
 @item
 APPLICABILITY AND DEFINITIONS
 
-This License applies to any manual or other work that contains a
-notice placed by the copyright holder saying it can be distributed
-under the terms of this License.  The ``Document'', below, refers to any
-such manual or work.  Any member of the public is a licensee, and is
-addressed as ``you''.
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License.  Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein.  The ``Document'', below,
+refers to any such manual or work.  Any member of the public is a
+licensee, and is addressed as ``you''.  You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
 
 A ``Modified Version'' of the Document means any work containing the
 Document or a portion of it, either copied verbatim, or with
@@ -55,7 +59,7 @@
 the Document that deals exclusively with the relationship of the
 publishers or authors of the Document to the Document's overall subject
 (or to related matters) and contains nothing that could fall directly
-within that overall subject.  (For example, if the Document is in part a
+within that overall subject.  (Thus, if the Document is in part a
 textbook of mathematics, a Secondary Section may not explain any
 mathematics.)  The relationship could be a matter of historical
 connection with the subject or with related matters, or of legal,
@@ -64,33 +68,41 @@
 
 The ``Invariant Sections'' are certain Secondary Sections whose titles
 are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License.
+that says that the Document is released under this License.  If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant.  The Document may contain zero
+Invariant Sections.  If the Document does not identify any Invariant
+Sections then there are none.
 
 The ``Cover Texts'' are certain short passages of text that are listed,
 as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License.
+the Document is released under this License.  A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
 
 A ``Transparent'' copy of the Document means a machine-readable copy,
 represented in a format whose specification is available to the
-general public, whose contents can be viewed and edited directly and
+general public, that is suitable for revising the document
 straightforwardly with generic text editors or (for images composed of
 pixels) generic paint programs or (for drawings) some widely available
 drawing editor, and that is suitable for input to text formatters or
 for automatic translation to a variety of formats suitable for input
 to text formatters.  A copy made in an otherwise Transparent file
-format whose markup has been designed to thwart or discourage
-subsequent modification by readers is not Transparent.  A copy that is
-not ``Transparent'' is called ``Opaque''.
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text.  A copy that is not ``Transparent'' is called ``Opaque.''
+
 
 Examples of suitable formats for Transparent copies include plain
 ASCII without markup, Texinfo input format, LaTeX input format, SGML
 or XML using a publicly available DTD, and standard-conforming simple
-HTML designed for human modification.  Opaque formats include
-PostScript, PDF, proprietary formats that can be read and edited only
-by proprietary word processors, SGML or XML for which the DTD and/or
+HTML, PostScript or PDF designed for human modification.  Examples of
+transparent image formats include PNG, XCF and JPG.  Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
 processing tools are not generally available, and the
-machine-generated HTML produced by some word processors for output
-purposes only.
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
 
 The ``Title Page'' means, for a printed book, the title page itself,
 plus such following pages as are needed to hold, legibly, the material
@@ -98,6 +110,21 @@
 formats which do not have any title page as such, ``Title Page'' means
 the text near the most prominent appearance of the work's title,
 preceding the beginning of the body of the text.
+
+A section ``Entitled XYZ'' means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language.  (Here XYZ stands for a
+specific section name mentioned below, such as ``Acknowledgements'',
+``Dedications'', ``Endorsements'', or ``History''.)  To ``Preserve the Title''
+of such a section when you modify the Document means that it remains a
+section ``Entitled XYZ'' according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document.  These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
 @sp 1
 @item
 VERBATIM COPYING
@@ -118,9 +145,10 @@
 @item
 COPYING IN QUANTITY
 
-If you publish printed copies of the Document numbering more than 100,
-and the Document's license notice requires Cover Texts, you must enclose
-the copies in covers that carry, clearly and legibly, all these Cover
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
 Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
 the back cover.  Both covers must also clearly and legibly identify
 you as the publisher of these copies.  The front cover must present
@@ -138,16 +166,15 @@
 If you publish or distribute Opaque copies of the Document numbering
 more than 100, you must either include a machine-readable Transparent
 copy along with each Opaque copy, or state in or with each Opaque copy
-a publicly-accessible computer-network location containing a complete
-Transparent copy of the Document, free of added material, which the
-general network-using public has access to download anonymously at no
-charge using public-standard network protocols.  If you use the latter
-option, you must take reasonably prudent steps, when you begin
-distribution of Opaque copies in quantity, to ensure that this
-Transparent copy will remain thus accessible at the stated location
-until at least one year after the last time you distribute an Opaque
-copy (directly or through your agents or retailers) of that edition to
-the public.
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
 
 It is requested, but not required, that you contact the authors of the
 Document well before redistributing any large number of copies, to give
@@ -171,7 +198,8 @@
 B. List on the Title Page, as authors, one or more persons or entities
    responsible for authorship of the modifications in the Modified
    Version, together with at least five of the principal authors of the
-   Document (all of its principal authors, if it has less than five).@*
+   Document (all of its principal authors, if it has fewer than five),
+   unless they release you from this requirement.@*
 C. State on the Title page the name of the publisher of the
    Modified Version, as the publisher.@*
 D. Preserve all the copyright notices of the Document.@*
@@ -183,10 +211,10 @@
 G. Preserve in that license notice the full lists of Invariant Sections
    and required Cover Texts given in the Document's license notice.@*
 H. Include an unaltered copy of this License.@*
-I. Preserve the section entitled ``History'', and its title, and add to
-   it an item stating at least the title, year, new authors, and
+I. Preserve the section Entitled ``History'', Preserve its Title, and add
+   to it an item stating at least the title, year, new authors, and
    publisher of the Modified Version as given on the Title Page.  If
-   there is no section entitled ``History'' in the Document, create one
+   there is no section Entitled ``History'' in the Document, create one
    stating the title, year, authors, and publisher of the Document as
    given on its Title Page, then add an item describing the Modified
    Version as stated in the previous sentence.@*
@@ -197,17 +225,18 @@
    You may omit a network location for a work that was published at
    least four years before the Document itself, or if the original
    publisher of the version it refers to gives permission.@*
-K. In any section entitled ``Acknowledgements'' or ``Dedications'',
-   preserve the section's title, and preserve in the section all the
-   substance and tone of each of the contributor acknowledgements
+K. For any section Entitled ``Acknowledgements'' or ``Dedications'',
+   Preserve the Title of the section, and preserve in the section all
+   the substance and tone of each of the contributor acknowledgements
    and/or dedications given therein.@*
 L. Preserve all the Invariant Sections of the Document,
    unaltered in their text and in their titles.  Section numbers
    or the equivalent are not considered part of the section titles.@*
-M. Delete any section entitled ``Endorsements''.  Such a section
+M. Delete any section Entitled ``Endorsements.''  Such a section
    may not be included in the Modified Version.@*
-N. Do not retitle any existing section as ``Endorsements''
+N. Do not retitle any existing section to be Entitled ``Endorsements''
    or to conflict in title with any Invariant Section.@*
+O. Preserve any Warranty Disclaimers.@*
 @sp 1
 If the Modified Version includes new front-matter sections or
 appendices that qualify as Secondary Sections and contain no material
@@ -216,7 +245,7 @@
 list of Invariant Sections in the Modified Version's license notice.
 These titles must be distinct from any other section titles.
 
-You may add a section entitled ``Endorsements'', provided it contains
+You may add a section Entitled ``Endorsements'', provided it contains
 nothing but endorsements of your Modified Version by various
 parties--for example, statements of peer review or that the text has
 been approved by an organization as the authoritative definition of a
@@ -244,7 +273,7 @@
 versions, provided that you include in the combination all of the
 Invariant Sections of all of the original documents, unmodified, and
 list them all as Invariant Sections of your combined work in its
-license notice.
+license notice, and that you preserve all their Warranty Disclaimers.
 
 The combined work need only contain one copy of this License, and
 multiple identical Invariant Sections may be replaced with a single
@@ -255,11 +284,11 @@
 Make the same adjustment to the section titles in the list of
 Invariant Sections in the license notice of the combined work.
 
-In the combination, you must combine any sections entitled ``History''
-in the various original documents, forming one section entitled
-``History''; likewise combine any sections entitled ``Acknowledgements'',
-and any sections entitled ``Dedications''.  You must delete all sections
-entitled ``Endorsements.''
+In the combination, you must combine any sections Entitled ``History''
+in the various original documents, forming one section Entitled
+``History''; likewise combine any sections Entitled ``Acknowledgements'',
+and any sections Entitled ``Dedications.''  You must delete all sections
+Entitled ``Endorsements.''
 @sp 1
 @item
 COLLECTIONS OF DOCUMENTS
@@ -280,18 +309,20 @@
 
 A compilation of the Document or its derivatives with other separate
 and independent documents or works, in or on a volume of a storage or
-distribution medium, does not as a whole count as a Modified Version
-of the Document, provided no compilation copyright is claimed for the
-compilation.  Such a compilation is called an ``aggregate'', and this
-License does not apply to the other self-contained works thus compiled
-with the Document, on account of their being thus compiled, if they
-are not themselves derivative works of the Document.
+distribution medium, is called an ``aggregate'' if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
 
 If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one quarter
-of the entire aggregate, the Document's Cover Texts may be placed on
-covers that surround only the Document within the aggregate.
-Otherwise they must appear on covers around the whole aggregate.
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
 @sp 1
 @item
 TRANSLATION
@@ -302,10 +333,17 @@
 permission from their copyright holders, but you may include
 translations of some or all Invariant Sections in addition to the
 original versions of these Invariant Sections.  You may include a
-translation of this License provided that you also include the
-original English version of this License.  In case of a disagreement
-between the translation and the original English version of this
-License, the original English version will prevail.
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers.  In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled ``Acknowledgements'',
+``Dedications'', or ``History'', the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
 @sp 1
 @item
 TERMINATION
@@ -346,21 +384,30 @@
 
 @smallexample
 @group
-
-  Copyright (C)  @var{year}  @var{your name}.
-  Permission is granted to copy, distribute and/or modify this document
-  under the terms of the GNU Free Documentation License, Version 1.1
-  or any later version published by the Free Software Foundation;
-  with the Invariant Sections being @var{list their titles}, with the
-  Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
-  A copy of the license is included in the section entitled ``GNU
-  Free Documentation License''.
+Copyright (C)  @var{year}  @var{your name}.
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+A copy of the license is included in the section entitled ``GNU
+Free Documentation License''.
 @end group
 @end smallexample
-If you have no Invariant Sections, write ``with no Invariant Sections''
-instead of saying which ones are invariant.  If you have no
-Front-Cover Texts, write ``no Front-Cover Texts'' instead of
-``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the ``with...Texts.'' line with this:
+
+@smallexample
+@group
+with the Invariant Sections being @var{list their titles}, with the
+Front-Cover Texts being @var{list}, and with the Back-Cover Texts being
+@var{list}.
+@end group
+@end smallexample
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
 
 If your document contains nontrivial examples of program code, we
 recommend releasing these examples in parallel under your choice of
--- a/lispref/elisp.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/lispref/elisp.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -35,7 +35,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with the
 Invariant Sections being ``GNU General Public License'', with the
 Front-Cover texts being ``A GNU Manual'', and with the Back-Cover
--- a/lispref/objects.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/lispref/objects.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -78,10 +78,10 @@
   In most cases, an object's printed representation is also a read
 syntax for the object.  However, some types have no read syntax, since
 it does not make sense to enter objects of these types as constants in
-a Lisp program.  These objects are printed in @dfn{hash notation}: the
-characters @samp{#<} followed by a descriptive string (typically the
-type name followed by the name of the object), and closed with a
-matching @samp{>}.  For example:
+a Lisp program.  These objects are printed in @dfn{hash notation},
+which consists of the characters @samp{#<}, a descriptive string
+(typically the type name followed by the name of the object), and a
+closing @samp{>}.  For example:
 
 @example
 (current-buffer)
@@ -621,6 +621,7 @@
 @dfn{atoms}.
 
 @cindex parenthesis
+@cindex @samp{(@dots{})} in lists
   The read syntax and printed representation for lists are identical, and
 consist of a left parenthesis, an arbitrary number of elements, and a
 right parenthesis.  Here are examples of lists:
@@ -706,7 +707,6 @@
 @end group
 @end smallexample
 
-@cindex @samp{(@dots{})} in lists
 @cindex @code{nil} in lists
 @cindex empty list
   A list with no elements in it is the @dfn{empty list}; it is identical
@@ -749,7 +749,7 @@
 @end group
 @end example
 
-  The same list represented in the first box notation looks like this:
+  The same list represented in the second box notation looks like this:
 
 @example
 @group
@@ -776,7 +776,7 @@
   @dfn{Dotted pair notation} is a general syntax for cons cells that
 represents the @sc{car} and @sc{cdr} explicitly.  In this syntax,
 @code{(@var{a} .@: @var{b})} stands for a cons cell whose @sc{car} is
-the object @var{a}, and whose @sc{cdr} is the object @var{b}.  Dotted
+the object @var{a} and whose @sc{cdr} is the object @var{b}.  Dotted
 pair notation is more general than list syntax because the @sc{cdr}
 does not have to be a list.  However, it is more cumbersome in cases
 where list syntax would work.  In dotted pair notation, the list
@@ -913,9 +913,9 @@
 type of array has its own read syntax; see the following sections for
 details.
 
-  The array type is contained in the sequence type and
-contains the string type, the vector type, the bool-vector type, and the
-char-table type.
+  The array type is a subset of the sequence type, and contains the
+string type, the vector type, the bool-vector type, and the char-table
+type.
 
 @node String Type
 @subsection String Type
@@ -1166,8 +1166,8 @@
 
     A hash table is a very fast kind of lookup table, somewhat like an
 alist in that it maps keys to corresponding values, but much faster.
-Hash tables have no read syntax, and
-print using hash notation.  @xref{Hash Tables}.
+Hash tables have no read syntax, and print using hash notation.
+@xref{Hash Tables}, for functions that operate on hash tables.
 
 @example
 (make-hash-table)
@@ -1607,7 +1607,6 @@
 
 @node Type Predicates
 @section Type Predicates
-@cindex predicates
 @cindex type checking
 @kindex wrong-type-argument
 
@@ -1942,6 +1941,7 @@
 @end group
 @end example
 
+@cindex equality of strings
 Comparison of strings is case-sensitive, but does not take account of
 text properties---it compares only the characters in the strings.  For
 technical reasons, a unibyte string and a multibyte string are
--- a/mac/ChangeLog	Sun Sep 11 22:21:01 2005 +0000
+++ b/mac/ChangeLog	Mon Sep 19 10:20:33 2005 +0000
@@ -1,3 +1,7 @@
+2005-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* inc/config.h: Sync with src/config.in.
+
 2005-07-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* Emacs.app/Contents/Info.plist (mail-to, mail-selection): New
--- a/mac/inc/config.h	Sun Sep 11 22:21:01 2005 +0000
+++ b/mac/inc/config.h	Mon Sep 19 10:20:33 2005 +0000
@@ -46,11 +46,10 @@
 /* Define to 1 if using `getloadavg.c'. */
 /* #undef C_GETLOADAVG */
 
-/* Define C_SWITCH_X_SITE to contain any special flags your compiler
-   may need to deal with X Windows.  For instance, if you've defined
-   HAVE_X_WINDOWS above and your X include files aren't in a place
-   that your compiler can find on its own, you might want to add
-   "-I/..." or something similar.  */
+/* Define C_SWITCH_X_SITE to contain any special flags your compiler may need
+   to deal with X Windows. For instance, if you've defined HAVE_X_WINDOWS
+   above and your X include files aren't in a place that your compiler can
+   find on its own, you might want to add "-I/..." or something similar. */
 /* #undef C_SWITCH_X_SITE */
 
 /* Define to 1 for DGUX with <sys/dg_sys_info.h>. */
@@ -69,6 +68,10 @@
 /* Define to the options passed to configure. */
 #define EMACS_CONFIG_OPTIONS ""
 
+/* Define to 1 if the `getloadavg' function needs to be run setuid or setgid.
+   */
+/* #undef GETLOADAVG_PRIVILEGED */
+
 /* Define to 1 if the `getpgrp' function requires zero arguments. */
 /* #undef GETPGRP_VOID */
 
@@ -104,6 +107,9 @@
 /* Define to 1 if you have the `bzero' function. */
 /* #define HAVE_BZERO */
 
+/* Define to 1 if CancelMenuTracking is available (Mac OSX). */
+/* #undef HAVE_CANCELMENUTRACKING */
+
 /* Define to 1 if you are using the Carbon API on Mac OS X. */
 /* #undef HAVE_CARBON */
 
@@ -196,6 +202,12 @@
 /* Define to 1 if you have the `getloadavg' function. */
 /* #undef HAVE_GETLOADAVG */
 
+/* Define to 1 if you have the <getopt.h> header file. */
+/* #undef HAVE_GETOPT_H */
+
+/* Define to 1 if you have the `getopt_long_only' function. */
+/* #undef HAVE_GETOPT_LONG_ONLY */
+
 /* Define to 1 if you have the `getpagesize' function. */
 /* #undef HAVE_GETPAGESIZE */
 
@@ -220,6 +232,9 @@
 /* Define to 1 if you have the `getwd' function. */
 #define HAVE_GETWD 1
 
+/* Define to 1 if you have the `get_current_dir_name' function. */
+/* #undef HAVE_GET_CURRENT_DIR_NAME */
+
 /* Define to 1 if you have the ungif library (-lungif). */
 /* #undef HAVE_GIF */
 
@@ -509,7 +524,7 @@
 /* #undef HAVE_SETSID */
 
 /* Define to 1 if you have the `setsockopt' function. */
-/* #undefine HAVE_SETSOCKOPT */
+/* #undef HAVE_SETSOCKOPT */
 
 /* Define to 1 if you have the `shutdown' function. */
 /* #undef HAVE_SHUTDOWN */
@@ -586,7 +601,7 @@
 #define HAVE_SYS_PARAM_H 1
 
 /* Define to 1 if you have the <sys/resource.h> header file. */
-/* #undefine HAVE_SYS_RESOURCE_H */
+/* #undef HAVE_SYS_RESOURCE_H */
 
 /* Define to 1 if you have the <sys/select.h> header file. */
 /* #undef HAVE_SYS_SELECT_H */
@@ -863,6 +878,10 @@
 /* Define for large files, on AIX-style hosts. */
 /* #undef _LARGE_FILES */
 
+/* Define to rpl_ if the getopt replacement functions and variables should be
+   used. */
+/* #undef __GETOPT_PREFIX */
+
 /* Define like PROTOTYPES; this can be used by system headers. */
 /* #undef __PROTOTYPES */
 
--- a/man/ChangeLog	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/ChangeLog	Mon Sep 19 10:20:33 2005 +0000
@@ -1,3 +1,54 @@
+2005-09-15  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus.texi (Finding the Parent): Fix description of how Gnus
+	finds article.
+
+2005-09-14  Jari Aalto  <jari.aalto@cante.net>
+
+	* gnus.texi (Advanced Scoring Examples): New exmples to teach how
+	to drop off non-answered articles.
+
+2005-09-17  Eli Zaretskii  <eliz@gnu.org>
+
+	* makefile.w32-in (INFO_TARGETS, DVI_TARGETS): Add newsticker targets.
+	(../info/newsticker, newsticker.dvi): New targets.
+
+2005-09-17  Ulf Jasper  <ulf.jasper@web.de>
+
+	* newsticker.texi: Replace @command with @code.  Replace @example
+	with @lisp.
+	(Top): Added explanations to menu items.
+	(GNU Free Documentation License): Removed.
+
+2005-09-16  Romain Francoise  <romain@orebokech.com>
+
+	Update all files to specify GFDL version 1.2.
+
+	* doclicense.texi (GNU Free Documentation License): Update to
+	version 1.2.
+
+2005-09-15  Richard M. Stallman  <rms@gnu.org>
+
+	* buffers.texi (List Buffers): Fix xref.
+
+	* rmail.texi (Rmail Basics): Fix xref.
+
+	* emacs.texi (Top): Update subnode menus.
+
+	* files.texi (Saving Commands): New node, broken out of Saving.
+	(Customize Save): New node, broken out of Saving.
+	Clarify effect of write-region-inhibit-fsync.
+	(Misc File Ops): Say write-region-inhibit-fsync affects write-region.
+
+	* newsticker.texi: Fix @setfilename.
+
+	* Makefile.in (INFO_TARGETS, DVI_TARGETS): Add newsticker targets.
+	(../info/newsticker, newsticker.dvi): New targets.
+
+2005-09-14  Romain Francoise  <romain@orebokech.com>
+
+	* files.texi (Saving): Mention write-region-inhibit-fsync.
+
 2005-09-05  Chong Yidong  <cyd@stupidchicken.com>
 
 	* custom.texi (Custom Themes): New node.
--- a/man/Makefile.in	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/Makefile.in	Mon Sep 19 10:20:33 2005 +0000
@@ -42,7 +42,7 @@
 		../info/idlwave ../info/eudc ../info/ebrowse ../info/pcl-cvs \
 		../info/woman ../info/eshell ../info/org ../info/url \
 		../info/speedbar ../info/tramp ../info/ses ../info/smtpmail \
-		../info/flymake
+		../info/flymake ../info/newsticker
 DVI_TARGETS = 	emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \
 		 ediff.dvi forms.dvi gnus.dvi message.dvi emacs-mime.dvi \
                  gnus.dvi message.dvi sieve.dvi pgg.dvi mh-e.dvi \
@@ -50,7 +50,7 @@
 		 ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \
 		 pcl-cvs.dvi woman.dvi eshell.dvi org.dvi url.dvi \
 		 speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \
-                 emacs-xtra.dvi
+                 newsticker.dvi emacs-xtra.dvi
 INFOSOURCES = info.texi
 
 # The following rule does not work with all versions of `make'.
@@ -322,6 +322,11 @@
 flymake.dvi: flymake.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/flymake.texi
 
+../info/newsticker: newsticker.texi
+	cd $(srcdir); $(MAKEINFO) newsticker.texi
+newsticker.dvi: newsticker.texi
+	$(ENVADD) $(TEXI2DVI) ${srcdir}/newsticker.texi
+
 mostlyclean:
 	rm -f *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.*
 
--- a/man/ada-mode.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/ada-mode.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -13,7 +13,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with the
 Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and
 ``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU
--- a/man/autotype.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/autotype.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -17,7 +17,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with the
 Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and
 ``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU
--- a/man/buffers.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/buffers.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -179,7 +179,7 @@
 
   @samp{*} in the first field of a line indicates the buffer is ``modified.''
 If several buffers are modified, it may be time to save some with @kbd{C-x s}
-(@pxref{Saving}).  @samp{%} indicates a read-only buffer.  @samp{.} marks the
+(@pxref{Save Commands}).  @samp{%} indicates a read-only buffer.  @samp{.} marks the
 current buffer.  Here is an example of a buffer list:@refill
 
 @smallexample
--- a/man/calc.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/calc.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -88,7 +88,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with the
 Invariant Sections being just ``GNU GENERAL PUBLIC LICENSE'', with the
 Front-Cover texts being ``A GNU Manual,'' and with the Back-Cover
--- a/man/cc-mode.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/cc-mode.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -71,7 +71,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with the
 Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and
 ``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU
--- a/man/cl.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/cl.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -9,7 +9,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/doclicense.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/doclicense.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -1,10 +1,10 @@
 @c -*-texinfo-*-
 @node GNU Free Documentation License, Emacs Invocation, Copying, Top
 @appendix GNU Free Documentation License
-@center Version 1.1, March 2000
+@center Version 1.2, November 2002
 
 @display
-Copyright (C) 2000  Free Software Foundation, Inc.
+Copyright (C) 2000,2001,2002  Free Software Foundation, Inc.
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
 Everyone is permitted to copy and distribute verbatim copies
@@ -16,12 +16,12 @@
 PREAMBLE
 
 The purpose of this License is to make a manual, textbook, or other
-written document ``free'' in the sense of freedom: to assure everyone
-the effective freedom to copy and redistribute it, with or without
-modifying it, either commercially or noncommercially.  Secondarily,
-this License preserves for the author and publisher a way to get
-credit for their work, while not being considered responsible for
-modifications made by others.
+functional and useful document ``free'' in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
 
 This License is a kind of ``copyleft'', which means that derivative
 works of the document must themselves be free in the same sense.  It
@@ -40,11 +40,15 @@
 @item
 APPLICABILITY AND DEFINITIONS
 
-This License applies to any manual or other work that contains a
-notice placed by the copyright holder saying it can be distributed
-under the terms of this License.  The ``Document'', below, refers to any
-such manual or work.  Any member of the public is a licensee, and is
-addressed as ``you.''
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License.  Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein.  The ``Document'', below,
+refers to any such manual or work.  Any member of the public is a
+licensee, and is addressed as ``you''.  You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
 
 A ``Modified Version'' of the Document means any work containing the
 Document or a portion of it, either copied verbatim, or with
@@ -54,7 +58,7 @@
 the Document that deals exclusively with the relationship of the
 publishers or authors of the Document to the Document's overall subject
 (or to related matters) and contains nothing that could fall directly
-within that overall subject.  (For example, if the Document is in part a
+within that overall subject.  (Thus, if the Document is in part a
 textbook of mathematics, a Secondary Section may not explain any
 mathematics.)  The relationship could be a matter of historical
 connection with the subject or with related matters, or of legal,
@@ -63,33 +67,41 @@
 
 The ``Invariant Sections'' are certain Secondary Sections whose titles
 are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License.
+that says that the Document is released under this License.  If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant.  The Document may contain zero
+Invariant Sections.  If the Document does not identify any Invariant
+Sections then there are none.
 
 The ``Cover Texts'' are certain short passages of text that are listed,
 as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License.
+the Document is released under this License.  A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
 
 A ``Transparent'' copy of the Document means a machine-readable copy,
 represented in a format whose specification is available to the
-general public, whose contents can be viewed and edited directly and
+general public, that is suitable for revising the document
 straightforwardly with generic text editors or (for images composed of
 pixels) generic paint programs or (for drawings) some widely available
 drawing editor, and that is suitable for input to text formatters or
 for automatic translation to a variety of formats suitable for input
 to text formatters.  A copy made in an otherwise Transparent file
-format whose markup has been designed to thwart or discourage
-subsequent modification by readers is not Transparent.  A copy that is
-not ``Transparent'' is called ``Opaque.''
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text.  A copy that is not ``Transparent'' is called ``Opaque.''
+
 
 Examples of suitable formats for Transparent copies include plain
 ASCII without markup, Texinfo input format, LaTeX input format, SGML
 or XML using a publicly available DTD, and standard-conforming simple
-HTML designed for human modification.  Opaque formats include
-PostScript, PDF, proprietary formats that can be read and edited only
-by proprietary word processors, SGML or XML for which the DTD and/or
+HTML, PostScript or PDF designed for human modification.  Examples of
+transparent image formats include PNG, XCF and JPG.  Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
 processing tools are not generally available, and the
-machine-generated HTML produced by some word processors for output
-purposes only.
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
 
 The ``Title Page'' means, for a printed book, the title page itself,
 plus such following pages as are needed to hold, legibly, the material
@@ -97,6 +109,21 @@
 formats which do not have any title page as such, ``Title Page'' means
 the text near the most prominent appearance of the work's title,
 preceding the beginning of the body of the text.
+
+A section ``Entitled XYZ'' means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language.  (Here XYZ stands for a
+specific section name mentioned below, such as ``Acknowledgements'',
+``Dedications'', ``Endorsements'', or ``History''.)  To ``Preserve the Title''
+of such a section when you modify the Document means that it remains a
+section ``Entitled XYZ'' according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document.  These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
 @sp 1
 @item
 VERBATIM COPYING
@@ -117,9 +144,10 @@
 @item
 COPYING IN QUANTITY
 
-If you publish printed copies of the Document numbering more than 100,
-and the Document's license notice requires Cover Texts, you must enclose
-the copies in covers that carry, clearly and legibly, all these Cover
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
 Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
 the back cover.  Both covers must also clearly and legibly identify
 you as the publisher of these copies.  The front cover must present
@@ -137,16 +165,15 @@
 If you publish or distribute Opaque copies of the Document numbering
 more than 100, you must either include a machine-readable Transparent
 copy along with each Opaque copy, or state in or with each Opaque copy
-a publicly-accessible computer-network location containing a complete
-Transparent copy of the Document, free of added material, which the
-general network-using public has access to download anonymously at no
-charge using public-standard network protocols.  If you use the latter
-option, you must take reasonably prudent steps, when you begin
-distribution of Opaque copies in quantity, to ensure that this
-Transparent copy will remain thus accessible at the stated location
-until at least one year after the last time you distribute an Opaque
-copy (directly or through your agents or retailers) of that edition to
-the public.
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
 
 It is requested, but not required, that you contact the authors of the
 Document well before redistributing any large number of copies, to give
@@ -170,7 +197,8 @@
 B. List on the Title Page, as authors, one or more persons or entities
    responsible for authorship of the modifications in the Modified
    Version, together with at least five of the principal authors of the
-   Document (all of its principal authors, if it has less than five).@*
+   Document (all of its principal authors, if it has fewer than five),
+   unless they release you from this requirement.@*
 C. State on the Title page the name of the publisher of the
    Modified Version, as the publisher.@*
 D. Preserve all the copyright notices of the Document.@*
@@ -182,10 +210,10 @@
 G. Preserve in that license notice the full lists of Invariant Sections
    and required Cover Texts given in the Document's license notice.@*
 H. Include an unaltered copy of this License.@*
-I. Preserve the section entitled ``History'', and its title, and add to
-   it an item stating at least the title, year, new authors, and
+I. Preserve the section Entitled ``History'', Preserve its Title, and add
+   to it an item stating at least the title, year, new authors, and
    publisher of the Modified Version as given on the Title Page.  If
-   there is no section entitled ``History'' in the Document, create one
+   there is no section Entitled ``History'' in the Document, create one
    stating the title, year, authors, and publisher of the Document as
    given on its Title Page, then add an item describing the Modified
    Version as stated in the previous sentence.@*
@@ -196,17 +224,18 @@
    You may omit a network location for a work that was published at
    least four years before the Document itself, or if the original
    publisher of the version it refers to gives permission.@*
-K. In any section entitled ``Acknowledgements'' or ``Dedications'',
-   preserve the section's title, and preserve in the section all the
-   substance and tone of each of the contributor acknowledgements
+K. For any section Entitled ``Acknowledgements'' or ``Dedications'',
+   Preserve the Title of the section, and preserve in the section all
+   the substance and tone of each of the contributor acknowledgements
    and/or dedications given therein.@*
 L. Preserve all the Invariant Sections of the Document,
    unaltered in their text and in their titles.  Section numbers
    or the equivalent are not considered part of the section titles.@*
-M. Delete any section entitled ``Endorsements.''  Such a section
+M. Delete any section Entitled ``Endorsements.''  Such a section
    may not be included in the Modified Version.@*
-N. Do not retitle any existing section as ``Endorsements''
+N. Do not retitle any existing section to be Entitled ``Endorsements''
    or to conflict in title with any Invariant Section.@*
+O. Preserve any Warranty Disclaimers.@*
 @sp 1
 If the Modified Version includes new front-matter sections or
 appendices that qualify as Secondary Sections and contain no material
@@ -215,7 +244,7 @@
 list of Invariant Sections in the Modified Version's license notice.
 These titles must be distinct from any other section titles.
 
-You may add a section entitled ``Endorsements'', provided it contains
+You may add a section Entitled ``Endorsements'', provided it contains
 nothing but endorsements of your Modified Version by various
 parties--for example, statements of peer review or that the text has
 been approved by an organization as the authoritative definition of a
@@ -243,7 +272,7 @@
 versions, provided that you include in the combination all of the
 Invariant Sections of all of the original documents, unmodified, and
 list them all as Invariant Sections of your combined work in its
-license notice.
+license notice, and that you preserve all their Warranty Disclaimers.
 
 The combined work need only contain one copy of this License, and
 multiple identical Invariant Sections may be replaced with a single
@@ -254,11 +283,11 @@
 Make the same adjustment to the section titles in the list of
 Invariant Sections in the license notice of the combined work.
 
-In the combination, you must combine any sections entitled ``History''
-in the various original documents, forming one section entitled
-``History''; likewise combine any sections entitled ``Acknowledgements'',
-and any sections entitled ``Dedications.''  You must delete all sections
-entitled ``Endorsements.''
+In the combination, you must combine any sections Entitled ``History''
+in the various original documents, forming one section Entitled
+``History''; likewise combine any sections Entitled ``Acknowledgements'',
+and any sections Entitled ``Dedications.''  You must delete all sections
+Entitled ``Endorsements.''
 @sp 1
 @item
 COLLECTIONS OF DOCUMENTS
@@ -279,18 +308,20 @@
 
 A compilation of the Document or its derivatives with other separate
 and independent documents or works, in or on a volume of a storage or
-distribution medium, does not as a whole count as a Modified Version
-of the Document, provided no compilation copyright is claimed for the
-compilation.  Such a compilation is called an ``aggregate'', and this
-License does not apply to the other self-contained works thus compiled
-with the Document, on account of their being thus compiled, if they
-are not themselves derivative works of the Document.
+distribution medium, is called an ``aggregate'' if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
 
 If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one quarter
-of the entire aggregate, the Document's Cover Texts may be placed on
-covers that surround only the Document within the aggregate.
-Otherwise they must appear on covers around the whole aggregate.
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
 @sp 1
 @item
 TRANSLATION
@@ -301,10 +332,17 @@
 permission from their copyright holders, but you may include
 translations of some or all Invariant Sections in addition to the
 original versions of these Invariant Sections.  You may include a
-translation of this License provided that you also include the
-original English version of this License.  In case of a disagreement
-between the translation and the original English version of this
-License, the original English version will prevail.
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers.  In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled ``Acknowledgements'',
+``Dedications'', or ``History'', the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
 @sp 1
 @item
 TERMINATION
@@ -347,19 +385,28 @@
 @group
 Copyright (C)  @var{year}  @var{your name}.
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1
+under the terms of the GNU Free Documentation License, Version 1.2
 or any later version published by the Free Software Foundation;
-with the Invariant Sections being @var{list their titles}, with the
-Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
-A copy of the license is included in the section entitled "GNU
-Free Documentation License."
+with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+A copy of the license is included in the section entitled ``GNU
+Free Documentation License''.
 @end group
 @end smallexample
 
-If you have no Invariant Sections, write ``with no Invariant Sections''
-instead of saying which ones are invariant.  If you have no
-Front-Cover Texts, write ``no Front-Cover Texts'' instead of
-``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the ``with...Texts.'' line with this:
+
+@smallexample
+@group
+with the Invariant Sections being @var{list their titles}, with the
+Front-Cover Texts being @var{list}, and with the Back-Cover Texts being
+@var{list}.
+@end group
+@end smallexample
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
 
 If your document contains nontrivial examples of program code, we
 recommend releasing these examples in parallel under your choice of
--- a/man/ebrowse.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/ebrowse.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -15,7 +15,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual,'' and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/ediff.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/ediff.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -30,7 +30,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/emacs-mime.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/emacs-mime.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -14,7 +14,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/emacs-xtra.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/emacs-xtra.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -14,7 +14,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/emacs.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/emacs.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -16,7 +16,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with the
 Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and
 ``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU
@@ -378,7 +378,9 @@
 
 Saving Files
 
+* Save Commands::       Commands for saving files.
 * Backup::              How Emacs saves the old version of your file.
+* Customize Save::      Customizing the saving of files.
 * Interlocking::        How Emacs protects against simultaneous editing
                           of one file by two users.
 * File Shadowing::      Copying files to "shadows" automatically.
--- a/man/eshell.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/eshell.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -13,7 +13,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/eudc.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/eudc.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -17,7 +17,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/files.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/files.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -366,6 +366,21 @@
   @dfn{Saving} a buffer in Emacs means writing its contents back into the file
 that was visited in the buffer.
 
+@menu
+* Save Commands::       Commands for saving files.
+* Backup::              How Emacs saves the old version of your file.
+* Customize Save::      Customizing the saving of files.
+* Interlocking::        How Emacs protects against simultaneous editing
+                          of one file by two users.
+* Shadowing: File Shadowing.  Copying files to "shadows" automatically.
+* Time Stamps::         Emacs can update time stamps on saved files.
+@end menu
+
+@node Save Commands
+@subsection Commands for Saving Files
+
+  These are the commands that relate to saving and writing files.
+
 @table @kbd
 @item C-x C-s
 Save the current buffer in its visited file on disk (@code{save-buffer}).
@@ -483,33 +498,6 @@
 by simultaneous editing and requires your immediate attention.
 @xref{Interlocking,, Simultaneous Editing}.
 
-@vindex require-final-newline
-  If the value of the variable @code{require-final-newline} is
-@code{t}, Emacs silently puts a newline at the end of any file that
-doesn't already end in one, every time a file is saved or written.  If
-the value is @code{visit}, Emacs adds a newline at the end of any file
-that doesn't have one, just after it visits the file.  (This marks the
-buffer as modified, and you can undo it.)  If the value is
-@code{visit-save}, that means to add newlines both on visiting and on
-saving.  If the value is @code{nil}, Emacs leaves the end of the file
-unchanged; if it's neither @code{nil} nor @code{t}, Emacs asks you
-whether to add a newline.  The default is @code{nil}.
-
-@vindex mode-require-final-newline
-  Many major modes are designed for specific kinds of files that are
-always supposed to end in newlines.  These major modes set the
-variable @code{require-final-newline} according to
-@code{mode-require-final-newline}.  By setting the latter variable,
-you can control how these modes handle final newlines.
-
-@menu
-* Backup::              How Emacs saves the old version of your file.
-* Interlocking::        How Emacs protects against simultaneous editing
-                          of one file by two users.
-* Shadowing: File Shadowing.  Copying files to "shadows" automatically.
-* Time Stamps::         Emacs can update time stamps on saved files.
-@end menu
-
 @node Backup
 @subsection Backup Files
 @cindex backup file
@@ -716,6 +704,38 @@
 any alternate names for the same file.  This has nothing to do with
 Emacs---the version control system does it.
 
+@node Customize Save
+@subsection Customizing Saving of Files
+
+@vindex require-final-newline
+  If the value of the variable @code{require-final-newline} is
+@code{t}, saving or writing a file silently puts a newline at the end
+if there isn't already one there.  If the value is @code{visit}, Emacs
+adds a newline at the end of any file that doesn't have one, just
+after it visits the file.  (This marks the buffer as modified, and you
+can undo it.)  If the value is @code{visit-save}, that means to add
+newlines both on visiting and on saving.  If the value is @code{nil},
+Emacs leaves the end of the file unchanged; if it's neither @code{nil}
+nor @code{t}, Emacs asks you whether to add a newline.  The default is
+@code{nil}.
+
+@vindex mode-require-final-newline
+  Many major modes are designed for specific kinds of files that are
+always supposed to end in newlines.  These major modes set the
+variable @code{require-final-newline} according to
+@code{mode-require-final-newline}.  By setting the latter variable,
+you can control how these modes handle final newlines.
+
+@vindex write-region-inhibit-fsync
+  When Emacs saves a file, it invokes the @code{fsync} system call to
+force the data immediately out to disk.  This is important for safety
+if the system crashes or in case of power outage.  However, it can be
+disruptive on laptops using power saving, because it requires the disk
+to spin up each time you save a file.  Setting
+@code{write-region-inhibit-fsync} to a non-@code{nil} value disables
+this synchronization.  Be careful---this means increased risk of data
+loss.
+
 @node Interlocking
 @subsection Protection against Simultaneous Editing
 
@@ -2999,8 +3019,10 @@
 @findex write-region
   @kbd{M-x write-region} is the inverse of @kbd{M-x insert-file}; it
 copies the contents of the region into the specified file.  @kbd{M-x
-append-to-file} adds the text of the region to the end of the specified
-file.  @xref{Accumulating Text}.
+append-to-file} adds the text of the region to the end of the
+specified file.  @xref{Accumulating Text}.  The variable
+@code{write-region-inhibit-fsync} applies to these commands, as well
+as saving files; see @ref{Customize Save}.
 
 @findex delete-file
 @cindex deletion (of files)
--- a/man/flymake.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/flymake.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -15,7 +15,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
 and with the Back-Cover Texts as in (a) below.  A copy of the license
--- a/man/forms.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/forms.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -23,7 +23,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/gnu.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/gnu.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -10,7 +10,7 @@
    2005 Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/gnus.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/gnus.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -12,7 +12,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
@@ -9624,17 +9624,16 @@
 @kindex M-^ (Summary)
 @cindex Message-ID
 @cindex fetching by Message-ID
-You can also ask the @acronym{NNTP} server for an arbitrary article, no
-matter what group it belongs to.  @kbd{M-^}
-(@code{gnus-summary-refer-article}) will ask you for a
-@code{Message-ID}, which is one of those long, hard-to-read thingies
-that look something like @samp{<38o6up$6f2@@hymir.ifi.uio.no>}.  You
-have to get it all exactly right.  No fuzzy searches, I'm afraid.
-@end table
-
-The current select method will be used when fetching by
-@code{Message-ID} from non-news select method, but you can override this
-by giving this command a prefix.
+You can also ask Gnus for an arbitrary article, no matter what group it
+belongs to.  @kbd{M-^} (@code{gnus-summary-refer-article}) will ask you
+for a @code{Message-ID}, which is one of those long, hard-to-read
+thingies that look something like @samp{<38o6up$6f2@@hymir.ifi.uio.no>}.
+You have to get it all exactly right.  No fuzzy searches, I'm afraid.
+
+Gnus looks for the @code{Message-ID} in the headers that have already
+been fetched, but also tries all the select methods specified by
+@code{gnus-refer-article-method} if it is not found.
+@end table
 
 @vindex gnus-refer-article-method
 If the group you are reading is located on a back end that does not
@@ -20501,9 +20500,20 @@
  1000)
 @end example
 
+Suppose you're reading a high volume group and you're only interested
+in replies. The plan is to score down all articles that don't have
+subject that begin with "Re:", "Fw:" or "Fwd:" and then score up all
+parents of articles that have subjects that begin with reply marks.
+
+@example
+((! ("subject" "re:\\|fwd?:" r))
+  -200)
+((1- ("subject" "re:\\|fwd?:" r))
+  200)
+@end example
+
 The possibilities are endless.
 
-
 @node Advanced Scoring Tips
 @subsection Advanced Scoring Tips
 
--- a/man/idlwave.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/idlwave.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -33,7 +33,7 @@
    2005 Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
@@ -65,7 +65,7 @@
 @sp 2
 @cindex Copyright, of IDLWAVE
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
@@ -2677,21 +2677,17 @@
 The many debugging, compiling, and examination commands provided in
 IDLWAVE are available simultaneously through two different interfaces:
 the original, multi-key command interface, and the new Electric Debug
-Mode.  The functionality they offer is similar, but the way you
-interact with them is quite different.  The main difference is that,
-in Electric Debug Mode, the source buffers are made read-only, and
-single key-strokes are used to step through, examine expressions, set
-and remove breakpoints, etc.  The same variables, prefix arguments,
-and settings apply to both versions, and both can be used
-interchangeably.  By default, when breakpoints are hit, Electric Debug
-Mode is enabled.  The traditional interface is described first.
-@xref{Electric Debug Mode}, for more on that mode.
-
-
-@sp 1
-@noindent @strong{Note that electric debug mode can be prevented from
-activating automatically by customizing the variable
-@code{idlwave-shell-automatic-electric-debug}.}
+Mode.  The functionality they offer is similar, but the way you interact
+with them is quite different.  The main difference is that, in Electric
+Debug Mode, the source buffers are made read-only, and single
+key-strokes are used to step through, examine expressions, set and
+remove breakpoints, etc.  The same variables, prefix arguments, and
+settings apply to both versions, and both can be used interchangeably.
+By default, when breakpoints are hit, Electric Debug Mode is enabled.
+The traditional interface is described first.  @xref{Electric Debug
+Mode}, for more on that mode.  Note that electric debug mode can be
+prevented from activating automatically by customizing the variable
+@code{idlwave-shell-automatic-electric-debug}.
 
 @node Debug Key Bindings, Breakpoints and Stepping, A Tale of Two Modes, Debugging IDL Programs
 @subsection Debug Key Bindings
--- a/man/info.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/info.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -19,7 +19,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/makefile.w32-in	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/makefile.w32-in	Mon Sep 19 10:20:33 2005 +0000
@@ -41,7 +41,8 @@
 		$(infodir)/eudc $(infodir)/ebrowse $(infodir)/pcl-cvs \
 		$(infodir)/woman $(infodir)/eshell $(infodir)/org \
 		$(infodir)/url $(infodir)/speedbar $(infodir)/tramp \
-		$(infodir)/ses $(infodir)/smtpmail $(infodir)/flymake
+		$(infodir)/ses $(infodir)/smtpmail $(infodir)/flymake \
+		$(infodir)/newsticker
 DVI_TARGETS = 	emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \
 		 ediff.dvi forms.dvi gnus.dvi message.dvi emacs-mime.dvi \
                  gnus.dvi message.dvi sieve.dvi pgg.dvi mh-e.dvi \
@@ -49,7 +50,7 @@
 		 ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \
 		 pcl-cvs.dvi woman.dvi eshell.dvi org.dvi url.dvi \
 		 speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \
-                 emacs-xtra.dvi
+                 newsticker.dvi emacs-xtra.dvi
 INFOSOURCES = info.texi
 
 # The following rule does not work with all versions of `make'.
@@ -317,16 +318,19 @@
 
 $(infodir)/org: org.texi
 	$(MAKEINFO) org.texi
-
 org.dvi: org.texi
 	$(ENVADD) $(TEXI2DVI) $(srcdir)/org.texi
 
 $(infodir)/url: url.texi
 	$(MAKEINFO) url.texi
-
 url.dvi: url.texi
 	$(ENVADD) $(TEXI2DVI) $(srcdir)/url.texi
 
+$(infodir)/newsticker: newsticker.texi
+	$(MAKEINFO) newsticker.texi
+newsticker.dvi: newsticker.texi
+	$(ENVADD) $(TEXI2DVI) ${srcdir}/newsticker.texi
+
 mostlyclean:
 	- $(DEL) *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.*
 
--- a/man/message.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/message.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -13,7 +13,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/mh-e.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/mh-e.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -20,7 +20,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/man/newsticker.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -0,0 +1,279 @@
+\input texinfo   @c -*-texinfo-*-
+@comment $Id: newsticker.texi,v 1.5 2005/09/17 11:25:06 eliz Exp $
+@comment %**start of header
+@setfilename ../info/newsticker
+@set VERSION 1.8
+@set UPDATED ``$Id: newsticker.texi,v 1.5 2005/09/17 11:25:06 eliz Exp $''
+@settitle Newsticker @value{VERSION}
+@syncodeindex vr cp
+@syncodeindex fn cp
+@syncodeindex pg cp
+@comment %**end of header
+
+@copying
+This manual is for Newsticker (version @value{VERSION}, @value{UPDATED}).
+
+@noindent
+Copyright @copyright{} 2004, 2005  Free Software Foundation, Inc.
+
+@quotation
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
+and with the Back-Cover Texts as in (a) below.  A copy of the license
+is included in the section entitled ``GNU Free Documentation License''
+in the Emacs manual.
+
+(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
+this GNU Manual, like GNU software.  Copies published by the Free
+Software Foundation raise funds for GNU development.''
+
+This document is part of a collection distributed under the GNU Free
+Documentation License.  If you want to distribute this document
+separately from the collection, you can do so by adding a copy of the
+license to the document, as described in section 6 of the license.
+@end quotation
+@end copying
+
+@dircategory Emacs
+@direntry
+* Newsticker: (newsticker). A Newsticker for Emacs.
+@end direntry
+
+@titlepage
+@title Newsticker -- a Newsticker for Emacs
+@subtitle for version @value{VERSION}, @value{UPDATED}
+@author Ulf Jasper
+@author @email{ulf.jasper@@web.de}
+@author @uref{http://de.geocities.com/ulf_jasper}
+@page
+@vskip 0pt plus 1filll
+@end titlepage
+
+@contents
+
+@ifnottex
+@node Top
+@top Newsticker
+@end ifnottex
+
+@menu
+* Overview::        General description of newsticker.
+* Requirements::    Requirements for using newsticker.
+* Installation::    Installing newsticker on your system.
+* Usage::           Basic newsticker instructions.
+* Configuration::   Customizable newsticker settings.
+* Remarks::         Remarks about newsticker.
+* Index::           Variable, function, and concept index.
+@end menu
+
+@node Overview
+@chapter Overview
+
+Newsticker provides a newsticker for Emacs. A newsticker is a thing
+that asynchronously retrieves headlines from a list of news sites,
+prepares these headlines for reading, and allows for loading the
+corresponding articles in a web browser.
+
+Headlines consist of a title and (possibly) a small description. They
+are contained in RSS (RDF Site Summary) files.  Newsticker should work
+with all RSS files that follow the @uref{http://purl.org/rss/1.0/spec,
+RDF Rich Site Summary 1.0} specification. It should also work with
+version 2.0 as well as other/older/alternative rss formats (like
+0.9<something> or such). In other words: Newsticker is a ``RSS
+reader'' or ``RSS aggregator''.
+
+Newsticker provides several commands for reading headlines, navigating
+through them, marking them as read/unread, hiding old headlines etc.
+Headlines can be displayed as plain text or as rendered HTML.
+
+Headlines can be displayed in the echo area, either scrolling like
+messages in a stock-quote ticker, or just changing.
+
+Newsticker allows for automatic processing of headlines by providing
+hooks and (sample) functions for automatically downloading images and
+enclosed files (as delivered by podcasts, e.g.).
+
+@ifhtml
+Here are screen shots of the @uref{newsticker-1.7.png, version 1.7
+(current version)} and some older screen shots:
+@uref{newsticker-1.6.png, version 1.6},
+@uref{newsticker-1.5.png, version 1.5}, 
+@uref{newsticker-1.4.png, version 1.4}
+@uref{newsticker-1.3.png, version 1.3}, 
+@uref{newsticker-1.0.png, version 1.0}.
+@end ifhtml
+
+@node Requirements
+@chapter Requirements
+
+Newsticker can be used with
+@uref{http://www.gnu.org/software/emacs/emacs.html, GNU Emacs} version
+21.1 or later as well as @uref{http://www.xemacs.org, XEmacs}.  It
+requires an XML-parser (@file{xml.el}) which is part of GNU Emacs.  If
+you are using XEmacs you want to get the @file{net-utils} package
+which contains @file{xml.el} for XEmacs.
+
+Newsticker requires a program which can retrieve files via http and
+prints them to stdout.  By default Newsticker will use
+@uref{http://www.gnu.org/software/wget/wget.html, wget} for this task.
+
+
+@node Installation
+@chapter Installation
+
+Place Newsticker in a directory where Emacs can find it. Add the
+following line to your Emacs startup file (@file{~/.emacs}).
+
+@lisp
+(add-to-list 'load-path "/path/to/newsticker/")
+(autoload 'newsticker-start "newsticker" "Emacs Newsticker" t)
+(autoload 'newsticker-show-news "newsticker" "Emacs Newsticker" t)
+@end lisp
+
+Newsticker-mode supports imenu. This allows for navigating with the
+help of a menu. In order to use this feature you should also add the
+following.
+
+@lisp
+(add-hook 'newsticker-mode-hook 'imenu-add-menubar-index)
+@end lisp
+
+That's it.
+
+@node Usage
+@chapter Usage
+
+@findex newsticker-show-news
+The command @code{newsticker-show-news} will display all available
+headlines in a special buffer, called @samp{*newsticker*}.  It will
+also start the asynchronous download of headlines.  The modeline in
+the @samp{*newsticker*} buffer informs whenever new headlines have
+arrived.  Clicking mouse-button 2 or pressing RET in this buffer on a
+headline will call @code{browse-url} to load the corresponding news
+story in your favourite web browser.
+
+@findex newsticker-start-ticker
+@findex newsticker-stop-ticker
+The scrolling, or flashing of headlines in the echo area, can be
+started with the command @code{newsticker-start-ticker}. It can be
+stopped with @code{newsticker-stop-ticker}.
+
+@findex newsticker-start
+@findex newsticker-stop
+If you just want to start the periodic download of headlines use the
+command @code{newsticker-start}. Calling @code{newsticker-stop} will
+stop the periodic download, but will call
+@code{newsticker-stop-ticker} as well.
+
+@node Configuration
+@chapter Configuration
+
+All Newsticker options are customizable, i.e. they can be changed with
+Emacs customization methods: Call the command
+@code{customize-group} and enter @samp{newsticker} for the customization
+group.
+
+All Newsticker options have reasonable default values, so that in most
+cases it is not necessary to customize settings before starting Newsticker
+for the first time.
+
+Newsticker options are organized in the following groups.
+
+@itemize
+
+@item
+@code{newsticker-feed} contains options that define which news
+feeds are retrieved and how this is done.  
+
+@itemize
+@item
+@vindex newsticker-url-list
+@code{newsticker-url-list} defines the list of headlines which are
+retrieved.
+@item
+@vindex newsticker-retrieval-interval
+@code{newsticker-retrieval-interval} defines how often headlines
+are retrieved.
+@end itemize
+
+@item
+@code{newsticker-headline-processing} contains options that define
+how the retrieved headlines are processed.
+
+@itemize
+@item
+@vindex newsticker-keep-obsolete-items
+@code{newsticker-keep-obsolete-items} decides whether unread
+headlines that have been removed from the feed are kept in the
+Newsticker cache.
+@end itemize
+
+@item
+@code{newsticker-layout} contains options that define how the
+buffer for reading RSS headlines is formatted.
+
+@itemize
+@item
+@vindex newsticker-heading-format
+@code{newsticker-item-format} defines how the title of a headline
+is formatted.
+@end itemize
+
+@item
+@code{newsticker-ticker} contains options that define how headlines
+are shown in the echo area.
+
+@itemize
+@item
+@vindex newsticker-display-interval
+@vindex newsticker-scroll-smoothly
+@code{newsticker-display-interval} and
+@code{newsticker-scroll-smoothly} define how headlines are shown in
+the echo area.
+@end itemize
+
+@item
+@code{newsticker-hooks} contains options for hooking other Emacs
+commands to newsticker functions. 
+@itemize
+@item
+@vindex newsticker-new-item-functions
+@code{newsticker-new-item-functions} allows for automatic
+processing of headlines. See `newsticker-download-images', and
+`newsticker-download-enclosures' for sample functions.
+@end itemize
+
+@item
+@code{newsticker-miscellaneous} contains other Newsticker options.
+
+@end itemize
+
+Please have a look at the customization buffers for the complete list
+of options.
+
+@node Remarks
+@chapter Remarks
+
+This newsticker is designed do its job silently in the background
+without disturbing you.  However, it is probably impossible to prevent
+such a tool from slightly attenuating your Editor's responsiveness
+every once in a while.
+
+Byte-compiling newsticker.el is recommended.
+
+
+
+@node Index
+@unnumbered Index
+
+@printindex cp
+
+@bye
+
+
+
+@ignore
+   arch-tag: 7a4de539-117c-4658-b799-0b9e3d0ccec0
+@end ignore
--- a/man/org.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/org.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -39,7 +39,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
 and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/pcl-cvs.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/pcl-cvs.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -11,7 +11,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with the
 Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and
 ``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU
--- a/man/pgg.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/pgg.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -13,7 +13,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
 Texts.  A copy of the license is included in the section entitled ``GNU
--- a/man/reftex.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/reftex.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -7,9 +7,9 @@
 @syncodeindex fn cp
 
 @c Version and Contact Info
-@set VERSION 4.28
-@set EDITION 4.28
-@set DATE May 2005
+@set VERSION 4.30
+@set EDITION 4.30
+@set DATE September 2005
 @set AUCTEXSITE @uref{http://www.nongnu.org/auctex/,AUCTeX distribution site}
 @set MAINTAINERSITE @uref{http://www.astro.uva.nl/~dominik/Tools/,maintainers webpage}
 @set MAINTAINER Carsten Dominik
@@ -25,12 +25,11 @@
 This is edition @value{EDITION} of the @b{Ref@TeX{}} User Manual for
 @b{Ref@TeX{}} @value{VERSION}
 
-Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004,
-   2005 Free Software Foundation, Inc.
+Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
@@ -154,7 +153,7 @@
 * Citation Info::                    View the corresponding database entry.
 * Chapterbib and Bibunits::          Multiple bibliographies in a Document.
 * Citations Outside LaTeX::          How to make citations in Emails etc.
-* BibTeX Database Subsets::          Extract parts of a big database.
+* BibTeX Database Subsets::          Extract parts of a big database. 
 
 Index Support
 
@@ -1669,7 +1668,7 @@
 * Citation Info::                    View the corresponding database entry.
 * Chapterbib and Bibunits::          Multiple bibliographies in a Document.
 * Citations Outside LaTeX::          How to make citations in Emails etc.
-* BibTeX Database Subsets::          Extract parts of a big database.
+* BibTeX Database Subsets::          Extract parts of a big database. 
 @end menu
 
 @node Creating Citations, Citation Styles, , Citations
@@ -1773,12 +1772,12 @@
 @item e
 Create a new BibTeX database file which contains all @i{marked} entries
 in the selection buffer.  If no entries are marked, all entries are
-selected.
+selected. 
 
 @item E
 Create a new BibTeX database file which contains all @i{unmarked}
 entries in the selection buffer.  If no entries are marked, all entries
-are selected.
+are selected. 
 
 @item @key{TAB}
 Enter a citation key with completion.  This may also be a key which does
@@ -3212,7 +3211,7 @@
 
 Before calling a @b{Ref@TeX{}} function, the style hook should always
 test for the availability of the function, so that the style file will
-also work for people who do not use @b{Ref@TeX{}}.
+also work for people who do not use @b{Ref@TeX{}}. 
 
 Additions made with style files in the way described below remain local
 to the current document.  For example, if one package uses AMSTeX, the
@@ -3493,7 +3492,7 @@
 
 @b{Ref@TeX{}} was written by @i{Carsten Dominik}
 @email{dominik@@science.uva.nl}, with contributions by @i{Stephen
-Eglen}.  @b{Ref@TeX{}} is currently maintained by
+Eglen}.  @b{Ref@TeX{}} is currently maintained by 
 
 @noindent
 Carsten Dominik <dominik@@science.uva.nl>
@@ -3713,7 +3712,7 @@
 Create a new BibTeX database file with all entries referenced in document.
 The command prompts for a filename and writes the collected entries to
 that file.  Only entries referenced in the current document with
-any @code{\cite}-like macros are used.
+any @code{\cite}-like macros are used. 
 The sequence in the new file is the same as it was in the old database.
 @end deffn
 
@@ -3818,7 +3817,7 @@
 ordinary TOC window), the automatic recentering is turned on.  When the
 frame gets destroyed, automatic recentering is turned off again.
 
-This feature can be turned on and off from the menu
+This feature can be turned on and off from the menu 
 (Ref->Options).
 @end defopt
 
@@ -3928,7 +3927,7 @@
 This may also be a function to do local parsing and identify point to be
 in a non-standard label environment.  The function must take an
 argument @var{bound} and limit backward searches to this value.  It
-should return either @code{nil} or a cons cell @code{(@var{function}
+should return either nil or a cons cell @code{(@var{function}
 . @var{position})} with the function symbol and the position where the
 special environment starts.  See the Info documentation for an
 example.
@@ -4085,7 +4084,7 @@
 default does parse around each label to detect the correct label type,
 but this process can be slow when a document contains thousands of
 labels.  If you use label prefixes consistently, you may speed up
-document parsing by setting this variable to a non-@code{nil} value.  RefTeX
+document parsing by setting this variable to a non-nil value.  RefTeX
 will then compare the label prefix with the prefixes found in
 `reftex-label-alist' and derive the correct label type in this way.
 Possible values for this option are:
@@ -4094,7 +4093,7 @@
 t       @r{This means to trust any label prefixes found.}
 regexp  @r{If a regexp, only prefixes matched by the regexp are trusted.}
 list    @r{List of accepted prefixes, as strings.  The colon is part of}
-        @r{the prefix, e.g. ("fn:" "eqn:" "item:").}
+        @r{the prefix, e.g. ("fn:" "eqn:" "item:").}   
 nil     @r{Never trust a label prefix.}
 @end example
 The only disadvantage of using this feature is that the label context
@@ -4650,7 +4649,7 @@
 
 @defopt reftex-index-verify-function
 A function which is called at each match during global indexing.
-If the function returns @code{nil}, the current match is skipped.
+If the function returns nil, the current match is skipped.
 @end defopt
 
 @defopt reftex-index-phrases-skip-indexed-matches
@@ -4770,10 +4769,10 @@
 
 @defopt reftex-revisit-to-echo
 Non-@code{nil} means, automatic citation display will revisit files if
-necessary.  When @code{nil}, citation display in echo area will only
-be active for cached echo strings (see @code{reftex-cache-cite-echo}),
-or for BibTeX database files which are already visited by a live
-associated buffers.
+necessary.  When nil, citation display in echo area will only be active
+for cached echo strings (see @code{reftex-cache-cite-echo}), or for
+BibTeX database files which are already visited by a live associated
+buffers.
 @end defopt
 
 @defopt reftex-cache-cite-echo
@@ -5114,7 +5113,7 @@
 
 @defopt reftex-revisit-to-follow
 Non-@code{nil} means, follow-mode will revisit files if necessary.
-When @code{nil}, follow-mode will be suspended for stuff in unvisited files.
+When nil, follow-mode will be suspended for stuff in unvisited files.
 @end defopt
 
 @defopt reftex-allow-detached-macro-args
@@ -5178,11 +5177,11 @@
 
 @noindent @b{Version 4.24}
 @itemize @bullet
-@item
+@item 
 Inserting citation commands now prompts for optional arguments
 when called with a prefix argument.  Related new options are
 @code{reftex-cite-prompt-optional-args} and
-@code{reftex-cite-cleanup-optional-args}.
+@code{reftex-cite-cleanup-optional-args}. 
 @item
 New option @code{reftex-trust-label-prefix}.  Configure this variable
 if you'd like RefTeX to base its classification of labels on prefixes.
@@ -5190,7 +5189,7 @@
 quality of the context used by RefTeX to describe a label.
 @item
 Fixed bug in @code{reftex-create-bibtex-file} when @code{reftex-comment-citations}
-is non-@code{nil}.
+is non-nil.
 @item
 Fixed bugs in indexing: Case-sensitive search, quotes before and/or
 after words.  Disabbled indexing in comment lines.
@@ -5198,7 +5197,7 @@
 
 @noindent @b{Version 4.22}
 @itemize @bullet
-@item
+@item 
 New command @code{reftex-create-bibtex-file} to create a new database
 with all entries referenced in the current document.
 @item
@@ -5208,7 +5207,7 @@
 
 @noindent @b{Version 4.21}
 @itemize @bullet
-@item
+@item 
 Renaming labels from the toc buffer with key @kbd{M-%}.
 @end itemize
 
@@ -5424,7 +5423,7 @@
 document, all labels and associated context.  New keys @kbd{i}, @kbd{l},
 and @kbd{c}.  New options @code{reftex-toc-include-labels},
 @code{reftex-toc-include-context},
-@code{reftex-toc-include-file-boundaries}.
+@code{reftex-toc-include-file-boundaries}. 
 @end itemize
 
 @noindent @b{Version 3.41}
@@ -5537,7 +5536,7 @@
 @kbd{M-x reftex-reset-mode} now also removes the file with parsing
 info.
 @item
-Default of @code{reftex-revisit-to-follow} changed to @code{nil}.
+Default of @code{reftex-revisit-to-follow} changed to nil.
 @end itemize
 
 @noindent @b{Version 3.24}
--- a/man/rmail.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/rmail.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -92,7 +92,7 @@
 other buffers, and never happen to switch back, you have exited.  Just
 make sure to save the Rmail file eventually (like any other file you
 have changed).  @kbd{C-x s} is a good enough way to do this
-(@pxref{Saving}).  The Rmail command @kbd{b}, @code{rmail-bury},
+(@pxref{Save Commands}).  The Rmail command @kbd{b}, @code{rmail-bury},
 buries the Rmail buffer and its summary buffer without expunging and
 saving the Rmail file.
 
--- a/man/sc.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/sc.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -20,7 +20,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/ses.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/ses.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -15,7 +15,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual,'' and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/sieve.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/sieve.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -13,7 +13,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/smtpmail.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/smtpmail.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -7,7 +7,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
 and with the Back-Cover Texts as in (a) below.  A copy of the license
--- a/man/speedbar.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/speedbar.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -10,7 +10,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with the
 Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and
 ``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU
--- a/man/tramp.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/tramp.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -30,7 +30,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/url.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/url.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -26,7 +26,7 @@
 Copyright (C) 1993, 1994, 1995, 1996  William M. Perry
 
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with the
 Invariant Sections being
 ``GNU GENERAL PUBLIC LICENSE''.  A copy of the
@@ -55,7 +55,7 @@
    2005 Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with the
 Invariant Sections being
 ``GNU GENERAL PUBLIC LICENSE''.  A copy of the
--- a/man/vip.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/vip.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -9,7 +9,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/viper.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/viper.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -12,7 +12,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/man/widget.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/widget.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -14,7 +14,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with the
 Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and
 ``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU
--- a/man/woman.texi	Sun Sep 11 22:21:01 2005 +0000
+++ b/man/woman.texi	Mon Sep 19 10:20:33 2005 +0000
@@ -22,7 +22,7 @@
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
 Manual,'' and with the Back-Cover Texts as in (a) below.  A copy of the
--- a/src/ChangeLog	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/ChangeLog	Mon Sep 19 10:20:33 2005 +0000
@@ -1,3 +1,115 @@
+2005-09-18  Andreas Schwab  <schwab@suse.de>
+
+	* window.h (struct window): Remove height_fixed_p, no longer set.
+
+	* window.c (make_window): Don't initialize height_fixed_p.
+	(window_fixed_size_p): Don't use it.
+
+2005-09-18  John Paul Wallington  <jpw@pobox.com>
+
+	* data.c (Fdefalias): Signal an error if SYMBOL is not a symbol.
+
+2005-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* Makefile.in (SOME_MACHINE_OBJECTS): Undo previous change.
+
+	* macfns.c (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
+	New variables.
+	[TARGET_API_MAC_CARBON] (Fx_file_dialog): Don't allow multiple
+	file selection.
+
+	* sysdep.c [MAC_OS8]: Don't include stdlib.h.  Include sys/param.h.
+
+2005-09-17  Eli Zaretskii  <eliz@gnu.org>
+
+	* Makefile.in (XMENU_OBJ) [!HAVE_CARBON]: Reinstate variable.
+	(obj): Use XMENU_OBJ, not a literal xmenu.o.
+
+2005-09-16  Romain Francoise  <romain@orebokech.com>
+
+	* fileio.c (syms_of_fileio) <write-region-inhibit-fsync>: Doc fix.
+
+2005-09-15  Richard M. Stallman  <rms@gnu.org>
+
+	* xdisp.c (overlay_arrow_at_row): Add HAVE_WINDOW_SYSTEM conditional.
+	(display_mode_element): Instead of `lisp_string' and `this',
+	record `offset' and increment that.
+	`last_offset' replaces `last'.
+
+	* Makefile.in (XMENU_OBJ): Variable deleted.
+	(obj): Use xmenu.o unconditionally.
+	(SOME_MACHINE_OBJECTS): Delete xmenu.o.
+
+	* emacs.c (main): Don't conditionalize syms_of_xmenu on HAVE_XMENU.
+
+2005-09-15  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (move_it_vertically): Don't try to fetch byte BEGV-1.
+	(reseat_at_next_visible_line_start): Likewise (in xassert).
+
+2005-09-14  Romain Francoise  <romain@orebokech.com>
+
+	* fileio.c (write_region_inhibit_fsync): New variable.
+	(Fwrite_region): Use it to skip call to fsync.
+	(syms_of_fileio): Initialize it.
+
+2005-09-14  Kenichi Handa  <handa@m17n.org>
+
+	* coding.c (code_convert_region_unwind): Argument format changed.
+	(run_pre_post_conversion_on_str): If pre-write-conversion function
+	changed the current buffer, delete the new buffer.
+	(run_pre_write_conversin_on_c_str): Likewise.
+
+	* fileio.c (Fexpand_file_name): Check multibyteness of
+	default_directory.
+
+2005-09-13  Kenichi Handa  <handa@m17n.org>
+
+	* composite.c (compose_chars_in_text): Delete it.
+
+	* composite.h (compose_chars_in_text): Delete extern.
+
+2005-09-13  Kim F. Storm  <storm@cua.dk>
+
+	* print.c (print_error_message): Fix last change.
+
+2005-09-12  Kim F. Storm  <storm@cua.dk>
+
+	* composite.c (compose_chars_in_text): Fix setup of `pend'.
+	Unconditionally reload `ptr' and `pend' after eval.
+
+	* xdisp.c (message3): Pass copy of lisp string to message_dolog.
+
+	* print.c (print_error_message): Pass copy of caller name to
+	message_dolog.
+
+	* fileio.c (auto_save_error): Pass copy of lisp string to message2.
+
+2005-09-12  Kenichi Handa  <handa@m17n.org>
+
+	* xdisp.c (display_mode_element): Be sure to make variables THIS
+	and LISP_STRING point into a string data of ELT.
+
+2005-09-12  Kim F. Storm  <storm@cua.dk>
+
+	* editfns.c (Ftranslate_region_internal): Reload `tt' after
+	signal_after_change that may have GC'ed.
+	(Fmessage, Fmessage_box, Fmessage_or_box): Doc fix.
+
+	* keymap.c (Fdescribe_buffer_bindings): Reload `translate'
+	after insert while runs signal_after_change.
+
+	* minibuf.c (Fminibuffer_complete_word): Move `completion_string'
+	declaration to where it is used.
+
+	* w32.c (check_windows_init_file): Fix allocation of error buffer.
+
+	* xfns.c (x_encode_text): Declare static.  Add FREEP arg.
+	(x_set_name_internal): Call x_encode_text with new FREEP arg to
+	know if xfree is needed instead of guessing.
+
+	* xterm.h (x_encode_text): Remove prototype.
+
 2005-09-11  Chris Prince  <cprince@gmail.com>  (tiny change)
 
 	* w32term.c (x_bitmap_icon): Load small icons too.
--- a/src/Makefile.in	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/Makefile.in	Mon Sep 19 10:20:33 2005 +0000
@@ -305,16 +305,17 @@
 #define LIB_X11_LIB -lX11
 #endif
 
+/* xmenu.c should not be compiled on OSX.  */
+#ifndef HAVE_CARBON
+XMENU_OBJ = xmenu.o
+#endif
+
 #ifdef HAVE_X_WINDOWS
 
 XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o
 
 #ifdef HAVE_MENUS
 
-#ifndef HAVE_CARBON
-XMENU_OBJ = xmenu.o
-#endif
-
 #ifdef USE_GTK
 GTK_OBJ= gtkutil.o
 #endif
@@ -450,9 +451,6 @@
 LIBX= $(LIBXMENU) LD_SWITCH_X_SITE -lX10 LIBX10_MACHINE LIBX10_SYSTEM
 #endif /* not HAVE_X11 */
 #else /* not HAVE_X_WINDOWS */
-#if defined(HAVE_MENUS) && !defined(HAVE_CARBON)
-XMENU_OBJ = xmenu.o
-#endif
 #endif /* not HAVE_X_WINDOWS */
 
 LIBSOUND= @LIBSOUND@
--- a/src/composite.h	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/composite.h	Mon Sep 19 10:20:33 2005 +0000
@@ -221,7 +221,6 @@
 extern void syms_of_composite P_ ((void));
 extern void compose_text P_ ((int, int, Lisp_Object, Lisp_Object,
 			      Lisp_Object));
-extern void compose_chars_in_text P_ ((int, int, Lisp_Object));
 
 #endif /* not EMACS_COMPOSITE_H */
 
--- a/src/data.c	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/data.c	Mon Sep 19 10:20:33 2005 +0000
@@ -719,6 +719,7 @@
      (symbol, definition, docstring)
      register Lisp_Object symbol, definition, docstring;
 {
+  CHECK_SYMBOL (symbol);
   if (CONSP (XSYMBOL (symbol)->function)
       && EQ (XCAR (XSYMBOL (symbol)->function), Qautoload))
     LOADHIST_ATTACH (Fcons (Qt, symbol));
--- a/src/editfns.c	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/editfns.c	Mon Sep 19 10:20:33 2005 +0000
@@ -2943,6 +2943,8 @@
 	{
 	  if (tt)
 	    {
+	      /* Reload as signal_after_change in last iteration may GC.  */
+	      tt = SDATA (table);
 	      if (string_multibyte)
 		{
 		  str = tt + string_char_to_byte (table, oc);
@@ -3250,8 +3252,9 @@
 The first argument is a format control string, and the rest are data
 to be formatted under control of the string.  See `format' for details.
 
-If the first argument is nil, the function clears any existing message;
-this lets the minibuffer contents show.  See also `current-message'.
+If the first argument is nil or the empty string, the function clears
+any existing message; this lets the minibuffer contents show.  See
+also `current-message'.
 
 usage: (message STRING &rest ARGS)  */)
      (nargs, args)
@@ -3280,8 +3283,8 @@
 The first argument is a format control string, and the rest are data
 to be formatted under control of the string.  See `format' for details.
 
-If the first argument is nil, clear any existing message; let the
-minibuffer contents show.
+If the first argument is nil or the empty string, clear any existing
+message; let the minibuffer contents show.
 
 usage: (message-box STRING &rest ARGS)  */)
      (nargs, args)
@@ -3342,8 +3345,8 @@
 The first argument is a format control string, and the rest are data
 to be formatted under control of the string.  See `format' for details.
 
-If the first argument is nil, clear any existing message; let the
-minibuffer contents show.
+If the first argument is nil or the empty string, clear any existing
+message; let the minibuffer contents show.
 
 usage: (message-or-box STRING &rest ARGS)  */)
      (nargs, args)
--- a/src/emacs.c	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/emacs.c	Mon Sep 19 10:20:33 2005 +0000
@@ -1630,14 +1630,12 @@
 #endif
 #endif /* HAVE_X_WINDOWS */
 
-#ifdef HAVE_MENUS
 #ifndef HAVE_NTGUI
 #ifndef MAC_OS
       /* Called before init_window_once for Mac OS Classic.  */
       syms_of_xmenu ();
 #endif
 #endif
-#endif
 
 #ifdef HAVE_NTGUI
       syms_of_w32term ();
--- a/src/fileio.c	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/fileio.c	Mon Sep 19 10:20:33 2005 +0000
@@ -225,6 +225,11 @@
    expanding file names.  This can be bound to / or \. */
 Lisp_Object Vdirectory_sep_char;
 
+#ifdef HAVE_FSYNC
+/* Nonzero means skip the call to fsync in Fwrite-region.  */
+int write_region_inhibit_fsync;
+#endif
+
 extern Lisp_Object Vuser_login_name;
 
 #ifdef WINDOWSNT
@@ -1060,6 +1065,7 @@
 #endif /* DOS_NT */
   int length;
   Lisp_Object handler, result;
+  int multibyte;
 
   CHECK_STRING (name);
 
@@ -1137,6 +1143,7 @@
 
   name = FILE_SYSTEM_CASE (name);
   nm = SDATA (name);
+  multibyte = STRING_MULTIBYTE (name);
 
 #ifdef DOS_NT
   /* We will force directory separators to be either all \ or /, so make
@@ -1302,8 +1309,7 @@
 	  if (index (nm, '/'))
 	    {
 	      nm = sys_translate_unix (nm);
-	      return make_specified_string (nm, -1, strlen (nm),
-					    STRING_MULTIBYTE (name));
+	      return make_specified_string (nm, -1, strlen (nm), multibyte);
 	    }
 #endif /* VMS */
 #ifdef DOS_NT
@@ -1315,8 +1321,7 @@
 	  if (IS_DIRECTORY_SEP (nm[1]))
 	    {
 	      if (strcmp (nm, SDATA (name)) != 0)
-		name = make_specified_string (nm, -1, strlen (nm),
-					      STRING_MULTIBYTE (name));
+		name = make_specified_string (nm, -1, strlen (nm), multibyte);
 	    }
 	  else
 #endif
@@ -1325,8 +1330,7 @@
 	    {
 	      char temp[] = " :";
 
-	      name = make_specified_string (nm, -1, p - nm,
-					    STRING_MULTIBYTE (name));
+	      name = make_specified_string (nm, -1, p - nm, multibyte);
 	      temp[0] = DRIVE_LETTER (drive);
 	      name = concat2 (build_string (temp), name);
 	    }
@@ -1334,8 +1338,7 @@
 #else /* not DOS_NT */
 	  if (nm == SDATA (name))
 	    return name;
-	  return make_specified_string (nm, -1, strlen (nm),
-					STRING_MULTIBYTE (name));
+	  return make_specified_string (nm, -1, strlen (nm), multibyte);
 #endif /* not DOS_NT */
 	}
     }
@@ -1447,6 +1450,7 @@
       && !newdir)
     {
       newdir = SDATA (default_directory);
+      multibyte |= STRING_MULTIBYTE (default_directory);
 #ifdef DOS_NT
       /* Note if special escape prefix is present, but remove for now.  */
       if (newdir[0] == '/' && newdir[1] == ':')
@@ -1712,8 +1716,7 @@
   CORRECT_DIR_SEPS (target);
 #endif /* DOS_NT */
 
-  result = make_specified_string (target, -1, o - target,
-                                  STRING_MULTIBYTE (name));
+  result = make_specified_string (target, -1, o - target, multibyte);
 
   /* Again look to see if the file name has special constructs in it
      and perhaps call the corresponding file handler.  This is needed
@@ -5242,7 +5245,7 @@
      Disk full in NFS may be reported here.  */
   /* mib says that closing the file will try to write as fast as NFS can do
      it, and that means the fsync here is not crucial for autosave files.  */
-  if (!auto_saving && fsync (desc) < 0)
+  if (!auto_saving && !write_region_inhibit_fsync && fsync (desc) < 0)
     {
       /* If fsync fails with EINTR, don't treat that as serious.  */
       if (errno != EINTR)
@@ -5685,6 +5688,8 @@
   Lisp_Object args[3], msg;
   int i, nbytes;
   struct gcpro gcpro1;
+  char *msgbuf;
+  USE_SAFE_ALLOCA;
 
   ring_bell ();
 
@@ -5694,13 +5699,15 @@
   msg = Fformat (3, args);
   GCPRO1 (msg);
   nbytes = SBYTES (msg);
+  SAFE_ALLOCA (msgbuf, char *, nbytes);
+  bcopy (SDATA (msg), msgbuf, nbytes);
 
   for (i = 0; i < 3; ++i)
     {
       if (i == 0)
-	message2 (SDATA (msg), nbytes, STRING_MULTIBYTE (msg));
+	message2 (msgbuf, nbytes, STRING_MULTIBYTE (msg));
       else
-	message2_nolog (SDATA (msg), nbytes, STRING_MULTIBYTE (msg));
+	message2_nolog (msgbuf, nbytes, STRING_MULTIBYTE (msg));
       Fsleep_for (make_number (1), Qnil);
     }
 
@@ -6656,6 +6663,14 @@
 a non-nil value.  */);
   Vauto_save_list_file_name = Qnil;
 
+#ifdef HAVE_FSYNC
+  DEFVAR_BOOL ("write-region-inhibit-fsync", &write_region_inhibit_fsync,
+	       doc: /* *Non-nil means don't call fsync in `write-region'.
+This variable affects calls to `write-region' as well as save commands.
+A non-nil value may result in data loss!  */);
+  write_region_inhibit_fsync = 0;
+#endif
+
   defsubr (&Sfind_file_name_handler);
   defsubr (&Sfile_name_directory);
   defsubr (&Sfile_name_nondirectory);
--- a/src/keymap.c	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/keymap.c	Mon Sep 19 10:20:33 2005 +0000
@@ -725,7 +725,7 @@
     Fsignal (Qinvalid_function, Fcons (function, Qnil));
   if (! NILP (sort_first))
     return call3 (intern ("map-keymap-internal"), function, keymap, Qt);
-      
+
   map_keymap (keymap, map_keymap_call, function, NULL, 1);
   return Qnil;
 }
@@ -2863,6 +2863,9 @@
 	    insert (buf, bufend - buf);
 
 	    insert ("\n", 1);
+
+	    /* Insert calls signal_after_change which may GC. */
+	    translate = SDATA (Vkeyboard_translate_table);
 	  }
 
       insert ("\n", 1);
--- a/src/macfns.c	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/macfns.c	Mon Sep 19 10:20:33 2005 +0000
@@ -94,6 +94,11 @@
 
 extern Lisp_Object Vwindow_system_version;
 
+#if GLYPH_DEBUG
+int image_cache_refcount, dpyinfo_refcount;
+#endif
+
+
 #if 0 /* Use xstricmp instead.  */
 /* compare two strings ignoring case */
 
@@ -4145,6 +4150,7 @@
     options.optionFlags = kNavDefaultNavDlogOptions;
     options.optionFlags |= kNavAllFilesInPopup;  /* All files allowed */
     options.optionFlags |= kNavSelectAllReadableItem;
+    options.optionFlags &= ~kNavAllowMultipleFiles;
     if (!NILP(prompt))
       {
 	message = cfstring_create_with_string (prompt);
--- a/src/print.c	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/print.c	Mon Sep 19 10:20:33 2005 +0000
@@ -1025,8 +1025,10 @@
    *Messages*.  */
   if (!NILP (caller) && SYMBOLP (caller))
     {
-      const char *name = SDATA (SYMBOL_NAME (caller));
-      message_dolog (name, strlen (name), 0, 0);
+      Lisp_Object cname = SYMBOL_NAME (caller);
+      char *name = alloca (SBYTES (cname));
+      bcopy (SDATA (cname), name, SBYTES (cname));
+      message_dolog (name, SBYTES (cname), 0, 0);
       message_dolog (": ", 2, 0, 0);
     }
 
--- a/src/sysdep.c	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/sysdep.c	Mon Sep 19 10:20:33 2005 +0000
@@ -49,10 +49,7 @@
 #include "blockinput.h"
 
 #ifdef MAC_OS8
-/* It is essential to include stdlib.h so that this file picks up
-   the correct definitions of rand, srand, and RAND_MAX.
-   Otherwise random numbers will not work correctly.  */
-#include <stdlib.h>
+#include <sys/param.h>
 
 #ifndef subprocesses
 /* Nonzero means delete a process right away if it exits (process.c).  */
--- a/src/w32.c	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/w32.c	Mon Sep 19 10:20:33 2005 +0000
@@ -3894,7 +3894,9 @@
 	  Lisp_Object load_path_print = Fprin1_to_string (full_load_path, Qnil);
 	  char *init_file_name = SDATA (init_file);
 	  char *load_path = SDATA (load_path_print);
-	  char *buffer = alloca (1024);
+	  char *buffer = alloca (1024
+				 + strlen (init_file_name)
+				 + strlen (load_path));
 
 	  sprintf (buffer,
 		   "The Emacs Windows initialization file \"%s.el\" "
--- a/src/window.c	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/window.c	Mon Sep 19 10:20:33 2005 +0000
@@ -273,7 +273,6 @@
   XSETWINDOW (val, p);
   XSETFASTINT (p->last_point, 0);
   p->frozen_window_start_p = 0;
-  p->height_fixed_p = 0;
   p->last_cursor_off_p = p->cursor_off_p = 0;
   p->left_margin_cols = Qnil;
   p->right_margin_cols = Qnil;
@@ -2438,27 +2437,22 @@
     }
   else if (BUFFERP (w->buffer))
     {
-      if (w->height_fixed_p && !width_p)
-	fixed_p = 1;
-      else
+      struct buffer *old = current_buffer;
+      Lisp_Object val;
+
+      current_buffer = XBUFFER (w->buffer);
+      val = find_symbol_value (Qwindow_size_fixed);
+      current_buffer = old;
+
+      fixed_p = 0;
+      if (!EQ (val, Qunbound))
 	{
-	  struct buffer *old = current_buffer;
-	  Lisp_Object val;
-
-	  current_buffer = XBUFFER (w->buffer);
-	  val = find_symbol_value (Qwindow_size_fixed);
-	  current_buffer = old;
-
-	  fixed_p = 0;
-	  if (!EQ (val, Qunbound))
-	    {
-	      fixed_p = !NILP (val);
-
-	      if (fixed_p
-		  && ((EQ (val, Qheight) && width_p)
-		      || (EQ (val, Qwidth) && !width_p)))
-		fixed_p = 0;
-	    }
+	  fixed_p = !NILP (val);
+
+	  if (fixed_p
+	      && ((EQ (val, Qheight) && width_p)
+		  || (EQ (val, Qwidth) && !width_p)))
+	    fixed_p = 0;
 	}
 
       /* Can't tell if this one is resizable without looking at
--- a/src/window.h	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/window.h	Mon Sep 19 10:20:33 2005 +0000
@@ -290,11 +290,6 @@
        be changed during redisplay.  If point is not in the window,
        accept that.  */
     unsigned frozen_window_start_p : 1;
-
-    /* 1 means that this window's height is temporarily fixed.  Used
-       in resize_mini_window to precent resizing selected_window, if
-       possible.  */
-    unsigned height_fixed_p : 1;
 };
 
 /* 1 if W is a minibuffer window.  */
--- a/src/xdisp.c	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/xdisp.c	Mon Sep 19 10:20:33 2005 +0000
@@ -4903,7 +4903,8 @@
 	   && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it),
 				 (double) it->selective)) /* iftc */
       {
-	xassert (FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n');
+	xassert (IT_BYTEPOS (*it) == BEGV
+		 || FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n');
 	newline_found_p = forward_to_next_line_start (it, &skipped_p);
       }
 
@@ -6629,6 +6630,7 @@
       /* If buffer ends in ZV without a newline, move to the start of
 	 the line to satisfy the post-condition.  */
       if (IT_CHARPOS (*it) == ZV
+	  && ZV > BEGV
 	  && FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n')
 	move_it_by_lines (it, 0, 0);
     }
@@ -7166,7 +7168,15 @@
   /* First flush out any partial line written with print.  */
   message_log_maybe_newline ();
   if (STRINGP (m))
-    message_dolog (SDATA (m), nbytes, 1, multibyte);
+    {
+      char *buffer;
+      USE_SAFE_ALLOCA;
+
+      SAFE_ALLOCA (buffer, char *, nbytes);
+      bcopy (SDATA (m), buffer, nbytes);
+      message_dolog (buffer, nbytes, 1, multibyte);
+      SAFE_FREE ();
+    }
   message3_nolog (m, nbytes, multibyte);
 
   UNGCPRO;
@@ -10115,12 +10125,14 @@
 	  if (FRAME_WINDOW_P (it->f)
 	      && WINDOW_LEFT_FRINGE_WIDTH (it->w) > 0)
 	    {
+#ifdef HAVE_WINDOW_SYSTEM
 	      if (val = Fget (var, Qoverlay_arrow_bitmap), SYMBOLP (val))
 		{
 		  int fringe_bitmap;
 		  if ((fringe_bitmap = lookup_fringe_bitmap (val)) != 0)
 		    return make_number (fringe_bitmap);
 		}
+#endif
 	      return make_number (-1); /* Use default arrow bitmap */
 	    }
 	  return overlay_arrow_string_or_property (var);
@@ -16044,7 +16056,7 @@
       {
 	/* A string: output it and check for %-constructs within it.  */
 	unsigned char c;
-	const unsigned char *this, *lisp_string;
+	int offset = 0;
 
 	if (!NILP (props) || risky)
 	  {
@@ -16102,8 +16114,7 @@
 	      }
 	  }
 
-	this = SDATA (elt);
-	lisp_string = this;
+	offset = 0;
 
 	if (literal)
 	  {
@@ -16126,42 +16137,44 @@
 	    break;
 	  }
 
+	/* Handle the non-literal case.  */
+
 	while ((precision <= 0 || n < precision)
-	       && *this
+	       && SREF (elt, offset) != 0
 	       && (mode_line_target != MODE_LINE_DISPLAY
 		   || it->current_x < it->last_visible_x))
 	  {
-	    const unsigned char *last = this;
+	    int last_offset = offset;
 
 	    /* Advance to end of string or next format specifier.  */
-	    while ((c = *this++) != '\0' && c != '%')
+	    while ((c = SREF (elt, offset++)) != '\0' && c != '%')
 	      ;
 
-	    if (this - 1 != last)
+	    if (offset - 1 != last_offset)
 	      {
 		int nchars, nbytes;
 
 		/* Output to end of string or up to '%'.  Field width
 		   is length of string.  Don't output more than
 		   PRECISION allows us.  */
-		--this;
-
-		prec = c_string_width (last, this - last, precision - n,
+		offset--;
+
+		prec = c_string_width (SDATA (elt) + last_offset,
+				       offset - last_offset, precision - n,
 				       &nchars, &nbytes);
 
 		switch (mode_line_target)
 		  {
 		  case MODE_LINE_NOPROP:
 		  case MODE_LINE_TITLE:
-		    n += store_mode_line_noprop (last, 0, prec);
+		    n += store_mode_line_noprop (SDATA (elt) + last_offset, 0, prec);
 		    break;
 		  case MODE_LINE_STRING:
 		    {
-		      int bytepos = last - lisp_string;
+		      int bytepos = last_offset;
 		      int charpos = string_byte_to_char (elt, bytepos);
 		      int endpos = (precision <= 0
-				    ? string_byte_to_char (elt,
-							   this - lisp_string)
+				    ? string_byte_to_char (elt, offset)
 				    : charpos + nchars);
 
 		      n += store_mode_line_string (NULL,
@@ -16172,7 +16185,7 @@
 		    break;
 		  case MODE_LINE_DISPLAY:
 		    {
-		      int bytepos = last - lisp_string;
+		      int bytepos = last_offset;
 		      int charpos = string_byte_to_char (elt, bytepos);
 		      n += display_string (NULL, elt, Qnil, 0, charpos,
 					   it, 0, prec, 0,
@@ -16183,12 +16196,12 @@
 	      }
 	    else /* c == '%' */
 	      {
-		const unsigned char *percent_position = this;
+		int percent_position = offset;
 
 		/* Get the specified minimum width.  Zero means
 		   don't pad.  */
 		field = 0;
-		while ((c = *this++) >= '0' && c <= '9')
+		while ((c = SREF (elt, offset++)) >= '0' && c <= '9')
 		  field = field * 10 + c - '0';
 
 		/* Don't pad beyond the total padding allowed.  */
@@ -16208,7 +16221,7 @@
 		    int bytepos, charpos;
 		    unsigned char *spec;
 
-		    bytepos = percent_position - lisp_string;
+		    bytepos = percent_position;
 		    charpos = (STRING_MULTIBYTE (elt)
 			       ? string_byte_to_char (elt, bytepos)
 			       : bytepos);
--- a/src/xfns.c	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/xfns.c	Mon Sep 19 10:20:33 2005 +0000
@@ -1516,11 +1516,12 @@
    Otherwise store 0 in *STRINGP, which means that the `encoding' of
    the result should be `COMPOUND_TEXT'.  */
 
-unsigned char *
-x_encode_text (string, coding_system, selectionp, text_bytes, stringp)
+static unsigned char *
+x_encode_text (string, coding_system, selectionp, text_bytes, stringp, freep)
      Lisp_Object string, coding_system;
      int *text_bytes, *stringp;
      int selectionp;
+     int *freep;
 {
   int result = string_xstring_p (string);
   struct coding_system coding;
@@ -1530,6 +1531,7 @@
       /* No multibyte character in OBJ.  We need not encode it.  */
       *text_bytes = SBYTES (string);
       *stringp = 1;
+      *freep = 0;
       return SDATA (string);
     }
 
@@ -1543,6 +1545,7 @@
 			SCHARS (string), SBYTES (string), Qnil);
   *text_bytes = coding.produced;
   *stringp = (result == 1 || !EQ (coding_system, Qcompound_text));
+  *freep = 1;
   return coding.destination;
 }
 
@@ -1581,16 +1584,13 @@
 	   in the future which can encode all Unicode characters.
 	   But, for the moment, there's no way to know that the
 	   current window manager supports it or not.  */
-	text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp);
+	text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp,
+				    &do_free_text_value);
 	text.encoding = (stringp ? XA_STRING
 			 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
 	text.format = 8;
 	text.nitems = bytes;
 
-        /* Check early, because ENCODE_UTF_8 below may GC and name may be
-           relocated.  */
-        do_free_text_value = text.value != SDATA (name);
-
 	if (NILP (f->icon_name))
 	  {
 	    icon = text;
@@ -1599,12 +1599,11 @@
 	  {
 	    /* See the above comment "Note: Encoding strategy".  */
 	    icon.value = x_encode_text (f->icon_name, coding_system, 0,
-					&bytes, &stringp);
+					&bytes, &stringp, &do_free_icon_value);
 	    icon.encoding = (stringp ? XA_STRING
 			     : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
 	    icon.format = 8;
 	    icon.nitems = bytes;
-            do_free_icon_value = icon.value != SDATA (f->icon_name);
 	  }
 
 #ifdef USE_GTK
@@ -1967,7 +1966,7 @@
 	 - the same but with the family also replaced with -*-*-.  */
       char *p = base_fontname;
       int i;
-      
+
       for (i = 0; *p; p++)
 	if (*p == '-') i++;
       if (i != 14)
@@ -1991,7 +1990,7 @@
 	  char *allcs = "*-*-*-*-*-*-*";
 	  char *allfamilies = "-*-*-";
 	  char *all = "*-*-*-*-";
-	  
+
 	  for (i = 0, p = base_fontname; i < 8; p++)
 	    {
 	      if (*p == '-')
--- a/src/xterm.h	Sun Sep 11 22:21:01 2005 +0000
+++ b/src/xterm.h	Mon Sep 19 10:20:33 2005 +0000
@@ -1044,8 +1044,6 @@
 extern int defined_color P_ ((struct frame *, char *, XColor *, int));
 extern void x_set_border_pixel P_ ((struct frame *, int));
 extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern unsigned char * x_encode_text P_ ((Lisp_Object, Lisp_Object, int,
-					  int *, int *));
 extern void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
 extern void xic_free_xfontset P_ ((struct frame *));
 extern void create_frame_xic P_ ((struct frame *));