changeset 140:585fb297b004 r20-2b4

Import from CVS: tag r20-2b4
author cvs
date Mon, 13 Aug 2007 09:32:43 +0200
parents 2b5203979d01
children ea67ad3963dc
files CHANGES-beta ChangeLog configure configure.in etc/COOKIES etc/NEWS lib-src/ChangeLog lib-src/update-elc.sh lisp/ChangeLog lisp/bytecomp/byte-optimize.el lisp/calendar/cal-french.el lisp/egg/egg-wnn.el lisp/egg/egg.el lisp/electric/electric.el lisp/gnus/ChangeLog lisp/gnus/gnus-art.el lisp/gnus/gnus-cache.el lisp/gnus/gnus-ems.el lisp/gnus/gnus-picon.el lisp/gnus/gnus-score.el lisp/gnus/gnus-sum.el lisp/gnus/gnus-topic.el lisp/gnus/gnus-undo.el lisp/gnus/gnus.el lisp/gnus/message.el lisp/gnus/nnfolder.el lisp/gnus/nnmail.el lisp/gnus/nntp.el lisp/gnus/nnweb.el lisp/mule/isearch-mule.el lisp/mule/mule-files.el lisp/mule/mule-misc.el lisp/prim/about.el lisp/prim/featurep.el lisp/prim/keydefs.el lisp/prim/loadup.el lisp/prim/sound.el lisp/utils/delbs.el lisp/utils/finder-inf.el lisp/version.el lisp/vm/vm-autoload.el lisp/vm/vm-digest.el lisp/vm/vm-folder.el lisp/vm/vm-mime.el lisp/vm/vm-misc.el lisp/vm/vm-mouse.el lisp/vm/vm-pop.el lisp/vm/vm-reply.el lisp/vm/vm-startup.el lisp/vm/vm-thread.el lisp/vm/vm-vars.el lisp/vm/vm-version.el lisp/vm/vm-window.el man/ChangeLog man/gnus.texi man/lispref/lispref.texi man/message.texi src/ChangeLog src/Makefile.in.in src/buffer.c src/fns.c src/glyphs-x.c src/lread.c
diffstat 63 files changed, 1246 insertions(+), 674 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES-beta	Mon Aug 13 09:31:48 2007 +0200
+++ b/CHANGES-beta	Mon Aug 13 09:32:43 2007 +0200
@@ -1,4 +1,13 @@
 							-*- indented-text -*-
+to 20.2 beta4
+-- Miscellaneous Mule/ Egg/Quail patches courtesy of Jareth Hein
+-- featurep reader macro code introduced and enabled for this beta only.
+-- Do not default with-xim to Motif if Motif libraries are availble
+-- Delete/Backspace correction from Gary Foster
+-- Gnus-5.4.50
+-- VM-6.30
+-- miscellaneous bug fixes
+
 to 20.2 beta3
 -- Miscellaneous Mule/ Egg/Quail patches courtesy of Jareth Hein
 -- Various hyperbole fixes courtesy of Bob Weiner
--- a/ChangeLog	Mon Aug 13 09:31:48 2007 +0200
+++ b/ChangeLog	Mon Aug 13 09:32:43 2007 +0200
@@ -1,3 +1,12 @@
+Fri May  2 16:50:02 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.2-b4 is released.
+
+Thu May  1 18:13:38 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* configure.in (--with-xim): Don't default it to Motif since it
+	causes crashes at startup on some systems.
+
 Sun Apr 27 12:25:55 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.2-b3 is released.
--- a/configure	Mon Aug 13 09:31:48 2007 +0200
+++ b/configure	Mon Aug 13 09:32:43 2007 +0200
@@ -276,6 +276,8 @@
 			the Motif XmIm* routines (when available).
 			If the XmIm* routines are autodetected,
 			then the default is --with-xim=motif, else --with-xim=no.
+			NOTE:  On some systems like SunOS4 use of this option
+			will cause XEmacs to crash at startup.
 --with-canna		Compile with support for Canna (a Japanese input method
 			used in conjunction with Mule support).
 --with-wnn		Compile with support for WNN (a multi-language input method
@@ -4518,7 +4520,7 @@
 rm -f conftest*
 
     LIBS="$xim_save_libs"
-    if   test "$have_XmIm" = "yes"; then with_xim=motif
+    if test "$with_xim" = "yes" -a "$have_XmIm" = "yes"; then with_xim=motif
     elif test "$with_xim"  = "yes"; then with_xim=xlib
     else                                 with_xim=no
     fi
--- a/configure.in	Mon Aug 13 09:31:48 2007 +0200
+++ b/configure.in	Mon Aug 13 09:32:43 2007 +0200
@@ -292,6 +292,8 @@
 			the Motif XmIm* routines (when available).
 			If the XmIm* routines are autodetected,
 			then the default is --with-xim=motif, else --with-xim=no.
+			NOTE:  On some systems like SunOS4 use of this option
+			will cause XEmacs to crash at startup.
 --with-canna		Compile with support for Canna (a Japanese input method
 			used in conjunction with Mule support).
 --with-wnn		Compile with support for WNN (a multi-language input method
@@ -2643,7 +2645,7 @@
     LIBS="${motif_libs} ${LIBS}"
     AC_FUNC_CHECK(XmImMbLookupString, have_XmIm=yes, have_XmIm=no)
     LIBS="$xim_save_libs"
-    if   test "$have_XmIm" = "yes"; then with_xim=motif
+    if test "$with_xim" = "yes" -a "$have_XmIm" = "yes"; then with_xim=motif
     elif test "$with_xim"  = "yes"; then with_xim=xlib
     else                                 with_xim=no
     fi
--- a/etc/COOKIES	Mon Aug 13 09:31:48 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-Original annotation:
-[Someone sent this in from California, and we decided to extend
-our campaign against information hoarding to recipes as well
-as software.  (Recipes are the closest thing, not involving computers,
-to software.)
-
-The story appears to be a myth, according to the Chicago Tribune,
-which says that Mrs Fields Cookies hoards the information completely.
-Therefore, this recipe can be thought of as a compatible replacement.
-We have reports that the cookies it makes are pretty good.]
-
-New annotation for XEmacs 19.15/20.1:
-[This file originally contained SPAM.  It has been updated for XEmacs. -sb]
-
-From: jhayward@math.uiuc.edu (Jonathan Hayward)
-Subject: A delicacy of delicacies
-Date: 19 Feb 1997 16:30:02 -0800
-
-Okay, everyone...  a true story of justice in the good old U.S. of A.  Thought
-y'all might enjoy this; if nothing else, it shows internet justice, if it can
-be called that.
-
-On a whim, I decided to visit Hormel's main plant, and, after a tour, we were
-allowed to taste samples of their various products.  And there was one...  I
-don't think that words can describe how it tasted.  It was a meat product, but
-to call it meat would not do it justice.  The memory of the taste brings tears
-to my eyes.
-
-I like to cook in my spare time, so I asked the tour guide if they could give
-me the recipe.  She frowned, and said, "I'm afraid not."  Well, I said, would
-you let me buy the recipe?  With a cute smile, she said, "Yes."  I asked how
-much, and she responded, "Two-fifty."  I said with approval, just add it to my
-tab.
-
-Thirty days later, I received my VISA statement from Hormel and it was $285.00.
-I looked again and remembered I had only spent $9.95 for a couple of tins, and
-about $20.00 for an anti-nauseant.  As I glanced at the bottom of the
-statement, it said, "Recipe -- $250.00."  Boy, was I upset!  I called Hormel's
-Accounting Dept. and told them the waitress said it was "two-fifty," and I did
-not realize she meant $250.00 for a recipe.  I asked them to take back the
-recipe and reduce my bill and they said they were sorry, but because all the
-recipes were this expensive so not just everyone could duplicate any of our
-delicacies...  the bill would stand.
-
-I waited, thinking of how I could get even or even try and get any of my money
-back.  I just said, "Okay, you folks got my $250.00 and now I'm going to have
-$250.00 worth of fun."  I told her that I was going to see to it that every
-gourmet will have a $250.00 recipe from Hormel for nothing.  She replied, "I
-wish you wouldn't do this."  I said, "I'm sorry but this is the only way I feel
-I could get even," and I will.
-
-So, here it is, and please pass it on to someone else or run a few copies...  I
-paid for it; now you can have it for free.
-
-	(Trust me; this recipe is so good that you will want to make as much as
-	you can at once, which is why I list so much.  This may be doubled, of
-	course):
-	1 pig carcass (all parts that are technically digestible but can't be
-		used for any other purpose, even hot dogs)
-	1 gallon castor oil
-	1 salt lick
-	1 gallon vomit
-	16 lbs recycled plastic
-
-	The cooking technique is simple.  Use a blender, branch shredder, or
-	anything else handy to shred the carcass, salt, and plastic; mix evenly
-	in a sufficiently large container.  There are a variety of ways to cook
-	it; in experimenting, I have found the best option to be slow boiling
-	in motor oil.  But the specific method of cooking doesn't matter much;
-	with such an extraordinary combination of ingredients, nobody will know
-	the difference.  When it is cooked, compress it into small tins (at
-	Hormel, it came in dark blue tins with four large white or yellow
-	letters -- I won't specify which four letter word, because there are
-	some people who find it to be more obscene and offensive than a certain
-	crude word for sex), and open and enjoy at leisure.  You don't need to
-	worry about it spoiling; bacteria won't touch it, and at any rate
-	there is a specific reason why it _can't_ go bad.  Makes at least 112
-	tins.
-
-Have fun!!  This is not a joke --- this is a true story.  That's it.  Please,
-pass it along to everyone you know, single people, mailing lists, etc...
-
-Oh, and one last thing I almost forgot...
-
-I feel a little guilty for presuming to speak about how to best serve a
-delicacy so wonderful -- the final word must go to gourmets and chefs with a
-taste far more refined than mine -- but there are a thousand ways in which it
-may be served, and, after a little experimenting, I really HAVE to share with
-you my personal favorite:
-
-	Open one tin; slice thinly.  Marinate in pesto sauce, with a touch of
-	thyme.  Roast slowly over an open flame (I have found wood --
-	preferably oak -- to work best), then THROW THE STUPID THING OUT THE
-	WINDOW AND COOK YOURSELF A STEAK.
--- a/etc/NEWS	Mon Aug 13 09:31:48 2007 +0200
+++ b/etc/NEWS	Mon Aug 13 09:32:43 2007 +0200
@@ -112,66 +112,28 @@
 * Changes in XEmacs 20.2
 ========================
 
+** configure no longer defaults to using --with-xim=motif if Motif libraries
+are linked.
+
+There are many bugs in the Xlib XIM support in X11R6.3.
+
+** Why XEmacs 20.1 is called 20.2
+
 Testing of XEmacs 20.1 revealed a number of showstopping bugs at the
 very final moment.  Instead of confusing the version numbers further,
 the `20.1' designation was abandoned, and the release was renamed to
 `20.2'.
 
-** The `C-z' key now iconifies only the current X frame.  You can use
-`C-x C-z' to get the old behavior.
-
-On the tty frames `C-z' behaves as before.
-
-** Several Egg/Wnn-related crashes were fixed.
-
-** lib-complete.el was MULE-ized.
-
-The commands `find-library', `find-library-other-window' and
-`find-library-other-frame' now take an optional coding system
-argument.
+** Delete/backspace keysyms have been separated
+
+The Delete and Backspace keysyms are now no longer identical.  A better
+version of delbackspace.el has been added called delbs.el.
 
 ** XEmacs 20.0 MULE API supported for backwards compatibilty
 
 XEmacs 20.2 primarily supports the MULE 3 API.  It now also supports
 the XEmacs 20.0 MULE API.
 
-** `values' now has a setf method
-
-** W3-3.0.85 Courtesy of William Perry
-
-Bug fixes.  See the 20.1 notes for further details.
-
-** Gnus-5.4.47 Courtesy of Lars Magne Ingebrigtsen
-
-Bug fixes.  See the 20.1 notes for further details.
-
-** edmacro.el-3.10 Courtesy of Hrvoje Niksic
-
-Interface changes to maintain Emacs compatibility.
-
-** live-icon.el-1.3
-
-Bug fixes.
-
-** tpu-edt.el
-
-Restoration of proper behavior with respect to the zmacs region.
-
-** xmine.el-1.8
-
-** balloon-help.el-1.06 Courtesy of Kyle Jones
-
-** VM-6.29
-
-** Verilog.el-2.25 Courtesy of Michael McNamara
-
-** etags.c-11.83 Courtesy of F. Potortì
-
-** Further support of Custom package by Hrvoje Niksic
-
-* Changes in XEmacs 20.1 (never publicly released)
-========================
-
 ** The logo has been changed, and the default background color is
 now a shade of gray instead of the eye-burning white.
 
@@ -223,7 +185,7 @@
 ** A number of new packages are added, and many packages were
 updated.
 
-** Gnus-5.4.45, courtesy of Lars Magne Ingebrigtsen
+** Gnus-5.4.50, courtesy of Lars Magne Ingebrigtsen
 
 *** nntp.el has been totally rewritten in an asynchronous fashion.
 
@@ -347,7 +309,7 @@
 and how to add custom support to your Lisp packages.  Custom is also
 documented in the XEmacs info manuals.
 
-** W3-3.0.80, courtesy of William Perry
+** W3-3.0.85, courtesy of William Perry
 
 Version 3 of Emacs/W3, the Emacs World Wide Web browser, has been
 included.  It is significantly faster than any of the previous
@@ -416,12 +378,12 @@
 or named as a command.  The recorded/edited macros can be dumped to
 `.emacs' file.
 
-** xmine.el-1.7, courtesy of Jens Lautenbacher
+** xmine.el-1.8, courtesy of Jens Lautenbacher
 
 XEmacs now includes a minesweeper game with a full-featured graphics
 and mouse interface.  Invoke with `M-x xmine'.
 
-** efs-1.15 courtesy of Andy Norman and Michael Sperber
+** efs-1.15-x5 courtesy of Andy Norman and Michael Sperber
 
 EFS is now integrated with XEmacs, and replaces the old ange-ftp.  It
 has many more features, including info documentation, support for many
@@ -431,12 +393,12 @@
 ** hyperbole-4.022, courtesy of Bob Weiner
 ** hm--html-menus-5.3, courtesy of Heiko Muenkel
 ** python-mode.el-2.90, courtesy of Barry Warsaw
-** balloon-help-1.05, courtesy of Kyle Jones
+** balloon-help-1.06, courtesy of Kyle Jones
 ** xrdb-mode.el-1.21, courtesy of Barry Warsaw
 ** igrep.el-2.56, courtesy of Kevin Rodgers
 ** frame-icon.el, courtesy of Michael Lamoureux and Bob Weiner
 ** itimer.el-1.05, courtesy of Kyle Jones
-** VM-6.26, courtesy of Kyle Jones
+** VM-6.30, courtesy of Kyle Jones
 ** OO-Browser-2.10, courtesy of Bob Weiner
 ** viper-2.93, courtesy of Michael Kifer
 ** ediff-2.64, courtesy of Michael Kifer
@@ -448,13 +410,35 @@
 ** browse-cltl2.el-1.1, courtesy of Holger Schauer
 ** eldoc.el-1.10, courtesy of Noah Friedman
 ** tm-7.105, courtesy of MORIOKA Tomohiko
-** verilog-mode.el, courtesy of Michael McNamara & Adrian Aichner
+** verilog-mode.el-2.25, courtesy of Michael McNamara & Adrian Aichner
 ** overlay.el, courtesy of Joseph Nuspl
+** live-icon.el-1.3, fixes courtesy of Karl Hegbloom
+** tpu-edt.el, fixes courtesy of R. Kevin Oberman
+** etags.c-11.83 Courtesy of F. Potortì
+
 
 
 * Lisp and internal changes in XEmacs 20.2
 ==========================================
 
+** lib-complete.el was MULE-ized.
+
+The commands `find-library', `find-library-other-window' and
+`find-library-other-frame' now take an optional coding system
+argument.
+
+** Experimental support for Lisp reader macros #-, #+.
+
+The Common Lisp reader macros for feature test are now supported.  This
+feature is present for evaluation purposes and is subject to change.
+
+** `values' now has a setf method
+
+** The `C-z' key now iconifies only the current X frame.  You can use
+`C-x C-z' to get the old behavior.
+
+On the tty frames `C-z' behaves as before.
+
 ** `defcustom' and `defgroup' can now be used to specify types and
 placement of the user-settable variables.
 
@@ -562,7 +546,7 @@
 ** Many bugs in the scrollbar code have been fixed.
 
 ** First alpha level support of MS Windows NT is available, courtesy
-of David Hobley.
+of David Hobley and Marc Paquette.
 
 ** Wnn/egg now has initial support Courtesy of Jareth Hein.
 
@@ -578,13 +562,6 @@
 distribution.
 
 
-* Changes in XEmacs 20.1
-========================
-
-XEmacs 20.1 has not been released to the net.  Please consult the 20.2
-entries instead.
-
-
 * Major Differences Between 19.14 and 20.0
 ===========================================
 
--- a/lib-src/ChangeLog	Mon Aug 13 09:31:48 2007 +0200
+++ b/lib-src/ChangeLog	Mon Aug 13 09:32:43 2007 +0200
@@ -1,3 +1,8 @@
+Thu May  1 15:26:20 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* update-elc.sh (mule_p): Test for mule bombs with change in format
+	of new output of featurep.
+
 Fri Apr 25 09:12:04 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* pstogif: Use Martin Buchholz magic to automagically find perl
--- a/lib-src/update-elc.sh	Mon Aug 13 09:31:48 2007 +0200
+++ b/lib-src/update-elc.sh	Mon Aug 13 09:32:43 2007 +0200
@@ -77,11 +77,8 @@
 if test "$mule_p" = nil ; then
   echo No
   ignore_dirs="$ignore_dirs its egg mule"
-elif test "$mule_p" = t; then
+else
   echo Yes
-else
-  echo "Error -- call Martin"
-  exit 1;
 fi
 
 # first recompile the byte-compiler, so that the other compiles take place
--- a/lisp/ChangeLog	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/ChangeLog	Mon Aug 13 09:32:43 2007 +0200
@@ -1,3 +1,18 @@
+Wed Apr 30 18:06:35 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* prim/loadup.el: Put features.elc in the dump list.
+
+	* prim/about.el (about-xemacs): Change date.
+
+Tue Apr 29 18:51:31 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* mule/mule-files.el (buffer-file-coding-system-alist): Regexp for 
+	handling info files didn't match the right pattern.
+
+Sun Apr 27 18:09:48 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* prim/sound.el (load-sound-file): Fix typo.
+
 Sat Apr 26 16:25:49 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* utils/lib-complete.el: Make conformant to Lisp coding standards
@@ -5,8 +20,6 @@
 
 Fri Apr 25 08:39:50 1997  Steven L Baur  <steve@altair.xemacs.org>
 
-	* packages/info.el: Remove mouse-1 binding.
-
 	* modes/sh-script.el (sh-indent-line): Deal with pathological case 
 	of indenting a first line containing a `#' as first non-white
 	space character.
--- a/lisp/bytecomp/byte-optimize.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/bytecomp/byte-optimize.el	Mon Aug 13 09:32:43 2007 +0200
@@ -649,8 +649,10 @@
 ;;      (byte-optimize-two-args-right form)
 ;;      form))
 
+;; jwz: (byte-optimize-approx-equal 0.0 0.0) was returning nil
+;; in xemacs 19.15 because it used < instead of <=.
 (defun byte-optimize-approx-equal (x y)
-  (< (* (abs (- x y)) 100) (abs (+ x y))))
+  (<= (* (abs (- x y)) 100) (abs (+ x y))))
 
 ;; Collect all the constants from FORM, after the STARTth arg,
 ;; and apply FUN to them to make one argument at the end.
@@ -697,6 +699,22 @@
 	 (condition-case ()
 	     (eval form)
 	   (error form)))
+
+	;; `add1' and `sub1' are a marginally fewer instructions
+	;; than `plus' and `minus', so use them when possible.
+	((and (null (nthcdr 3 form))
+	      (eq (nth 2 form) 1))
+	 (list '1+ (nth 1 form)))	; (+ x 1)  -->  (1+ x)
+	((and (null (nthcdr 3 form))
+	      (eq (nth 1 form) 1))
+	 (list '1+ (nth 2 form)))	; (+ 1 x)  -->  (1+ x)
+	((and (null (nthcdr 3 form))
+	      (eq (nth 2 form) -1))
+	 (list '1- (nth 1 form)))	; (+ x -1)  -->  (1- x)
+	((and (null (nthcdr 3 form))
+	      (eq (nth 1 form) -1))
+	 (list '1- (nth 2 form)))	; (+ -1 x)  -->  (1- x)
+
 ;;; It is not safe to delete the function entirely
 ;;; (actually, it would be safe if we know the sole arg
 ;;; is not a marker).
@@ -717,6 +735,7 @@
 		(numberp last))
 	   (setq form (nconc (list '- (- (nth 1 form) last) (nth 2 form))
 			     (delq last (copy-sequence (nthcdr 3 form))))))))
+  (setq form
 ;;; It is not safe to delete the function entirely
 ;;; (actually, it would be safe if we know the sole arg
 ;;; is not a marker).
@@ -728,6 +747,18 @@
 	 (cons (car form) (cdr (cdr form)))
        form))
 ;;;    )
+    )
+
+  ;; `add1' and `sub1' are a marginally fewer instructions than `plus'
+  ;; and `minus', so use them when possible.
+  (cond ((and (null (nthcdr 3 form))
+	      (eq (nth 2 form) 1))
+	 (list '1- (nth 1 form)))	; (- x 1)  -->  (1- x)
+	((and (null (nthcdr 3 form))
+	      (eq (nth 2 form) -1))
+	 (list '1+ (nth 1 form)))	; (- x -1)  -->  (1+ x)
+	(t
+	 form))
   )
 
 (defun byte-optimize-multiply (form)
--- a/lisp/calendar/cal-french.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/calendar/cal-french.el	Mon Aug 13 09:32:43 2007 +0200
@@ -44,8 +44,8 @@
 (require 'calendar)
 
 (defconst french-calendar-month-name-array
-  ["Vende'miaire" "Brumaire" "Frimaire" "Nivo^se" "Pluvio^se" "Vento^se"
-   "Germinal" "Flore'al" "Prairial" "Messidor" "Thermidor" "Fructidor"])
+  ["Vendémiaire" "Brumaire" "Frimaire" "Nivôse" "Pluviôse" "Ventôse"
+   "Germinal" "Floréal" "Prairial" "Messidor" "Thermidor" "Fructidor"])
 
 (defconst french-calendar-day-name-array
   ["Primidi" "Duodi" "Tridi" "Quartidi" "Quintidi" "Sextidi" "Septidi"
@@ -138,10 +138,10 @@
          (d (extract-calendar-day french-date)))
     (cond
      ((< y 1) "")
-     ((= m 13) (format "Jour %s de l'Anne'e %d de la Revolution"
+     ((= m 13) (format "Jour %s de l'Année %d de la Revolution"
                        (aref french-calendar-special-days-array (1- d))
                        y))
-     (t (format "Decade %s, %s de %s de l'Anne'e %d de la Revolution"
+     (t (format "Decade %s, %s de %s de l'Année %d de la Revolution"
                 (make-string (1+ (/ (1- d) 10)) ?I)
                 (aref french-calendar-day-name-array (% (1- d) 10))
                 (aref french-calendar-month-name-array (1- m))
@@ -160,7 +160,7 @@
 Echo French Revolutionary date unless NOECHO is t."
   (interactive
    (let* ((year (calendar-read
-                 "Anne'e de la Revolution (>0): "
+                 "Année de la Revolution (>0): "
                  '(lambda (x) (> x 0))
                  (int-to-string
                   (extract-calendar-year
@@ -194,7 +194,7 @@
           (decade (if (> month 12)
                       1
                     (calendar-read
-                     "De'cade (1-3): "
+                     "Décade (1-3): "
                      '(lambda (x) (memq x '(1 2 3))))))
           (day (if (> month 12)
                    (- month 12)
--- a/lisp/egg/egg-wnn.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/egg/egg-wnn.el	Mon Aug 13 09:32:43 2007 +0200
@@ -247,28 +247,28 @@
       (no-rcfile "No egg-startup-file on %s")
       (file-saved "Wnn dictionary and frequency data recorded.")
       (henkan-mode-indicator "$B4A(B")
-      (begin-henkan "$BJQ493+;OJ8;zNs(B: ")
-      (end-henkan "$BJQ49=*N;J8;zNs(B: ")
-      (kugiri-dai "$BBgJ8@a6h@Z$jJ8;zNs(B: ")
-      (kugiri-sho "$B>.J8@a6h@Z$jJ8;zNs(B: ")
-      (face-henkan "$BJQ496h4VI=<(B0@-(B: ")
-      (face-dai "$BBgJ8@a6h4VI=<(B0@-(B: ")
-      (face-sho "$B>.J8@a6h4VI=<(B0@-(B: ")
-      (jikouho "$B<!8uJd(B:")
+      (begin-henkan "Fence starting character: ")
+      (end-henkan "Fence ending character: ")
+      (kugiri-dai "Large bunsetsu separator: ")
+      (kugiri-sho "Small bunsetsu separator: ")
+      (face-henkan "Face for conversion: ")
+      (face-dai "Face for large bunsetsu: ")
+      (face-sho "Face for small bunsetsu: ")
+      (jikouho "Entries:")
       (off-msg "%s %s(%s:%s) turned off.")
       (henkan-help "Kanji conversion mode:
-$BJ8@a0\F0(B
-  \\[henkan-first-bunsetu]\t$B@hF,J8@a(B\t\\[henkan-last-bunsetu]\t$B8eHxJ8@a(B  
-  \\[henkan-backward-bunsetu]\t$BD>A0J8@a(B\t\\[henkan-forward-bunsetu]\t$BD>8eJ8@a(B
-$BJQ49JQ99(B
-  $BBgJ8@a<!8uJd(B    \\[henkan-next-kouho-dai]\t$B>.J8@a<!8uJd(B    \\[henkan-next-kouho-sho]
-  $BA08uJd(B    \\[henkan-previous-kouho]  \t$B<!8uJd(B    \\[henkan-next-kouho]
-  $BBgJ8@a?-$7(B  \\[henkan-bunsetu-nobasi-dai]  \t$BBgJ8@a=L$a(B  \\[henkan-bunsetu-chijime-dai]
-  $B>.J8@a?-$7(B  \\[henkan-bunsetu-nobasi-sho]  \t$B>.J8@a=L$a(B  \\[henkan-bunsetu-chijime-sho]
-  $BBgJ8@aJQ498uJdA*Br(B  \\[henkan-select-kouho-dai]  \t$B>.J8@aJQ498uJdA*Br(B  \\[henkan-select-kouho-sho]
-$BJQ493NDj(B
-  $BA4J8@a3NDj(B  \\[henkan-kakutei]  \t$BD>A0J8@a$^$G3NDj(B  \\[henkan-kakutei-before-point]
-$BJQ49Cf;_(B    \\[henkan-quit]
+Bunsetsu motion commands
+  \\[henkan-first-bunsetu]\tFirst bunsetsu\t\\[henkan-last-bunsetu]\tLast bunsetsu
+  \\[henkan-backward-bunsetu]\tPrevious bunsetsu\t\\[henkan-forward-bunsetu]\tNext bunsetsu
+Bunsetsu conversion commands
+  \\[henkan-next-kouho-dai]\tNext larger match\t\\[henkan-next-kouho-sho]\tNext smaller match
+  \\[henkan-previous-kouho]\tPrevious match\t\\[henkan-next-kouho]\tNext match
+  \\[henkan-bunsetu-nobasi-dai]\tExtend bunsetsu largest\t\\[henkan-bunsetu-chijime-dai]\tShrink bunsetsu smallest
+  \\[henkan-bunsetu-nobasi-sho]\tExtend bunsetsu\t\\[henkan-bunsetu-chijime-sho]\tShrink bunsetsu
+  \\[henkan-select-kouho-dai]\tMenu select largest match\t\\[henkan-select-kouho-sho]\tMenu select smallest match
+Conversion commands
+  \\[henkan-kakutei]\tComplete conversion commit\t\\[henkan-kakutei-before-point]\tCommit before point
+  \\[henkan-quit]\tAbort conversion
 ")
       (hinsimei "Hinshi (product/noun) name:")
       (jishotouroku-yomi "Dictionary entry for$B!X(B%s$B!Y(B reading:")
--- a/lisp/egg/egg.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/egg/egg.el	Mon Aug 13 09:32:43 2007 +0200
@@ -2082,6 +2082,8 @@
 (make-variable-buffer-local 'egg:*in-fence-mode*)
 (set-default 'egg:*in-fence-mode* nil)
 
+(defvar egg:fence-buffer nil "Buffer fence is active in")
+
 ;;(load-library "its-dump/roma-kana")         ;;;(define-its-mode "roma-kana"        " a$B$"(B")
 ;;(load-library "its-dump/roma-kata")         ;;;(define-its-mode "roma-kata"        " a$B%"(B")
 ;;(load-library "its-dump/downcase")          ;;;(define-its-mode "downcase"         " a a")
@@ -2564,7 +2566,8 @@
   ;; XEmacs change:
 ;  (buffer-disable-undo (current-buffer))
   (undo-boundary)
-  (setq egg:*in-fence-mode* t)
+  (setq egg:*in-fence-mode* t
+	egg:fence-buffer (current-buffer))
   (egg:mode-line-display)
   ;;;(setq egg:*global-map-backup* (current-global-map))
   (setq egg:*local-map-backup*  (current-local-map))
@@ -2580,6 +2583,7 @@
   (set-marker egg:*region-end* egg:*region-start*)
   (egg:fence-face-on)
   (goto-char egg:*region-start*)
+  (add-hook 'pre-command-hook 'fence-pre-command-hook)
   )
 
 (defun henkan-fence-region-or-single-space ()
@@ -2688,6 +2692,7 @@
 (defun egg:quit-egg-mode ()
   ;;;(use-global-map egg:*global-map-backup*)
   (use-local-map egg:*local-map-backup*)
+  (remove-hook 'pre-command-hook 'fence-pre-command-hook)
   (setq egg:*in-fence-mode* nil)
   (egg:mode-line-display)
   (if overwrite-mode
@@ -2724,6 +2729,36 @@
 (if (boundp 'mouse-track-cleanup-hook)
     (add-hook 'mouse-track-cleanup-hook 'fence-mouse-protect))
 
+(defun fence-pre-command-hook ()
+  ;; cribbed off of isearch-mode
+  ;;
+  ;; For use as the value of `pre-command-hook' when fence is active.
+  ;; If the command about to be executed is not ours,
+  ;; kill the fence before that command is executed.
+  ;;
+  (cond ((not (eq (current-buffer) egg:fence-buffer))
+	 ;; If the buffer (likely meaning "frame") has changed, bail.
+	 ;; This can also happen if a proc filter has popped up another
+	 ;; buffer, which is arguably a bad thing for it to have done,
+	 ;; but the way in which egg would have hosed you in that
+	 ;; case is unarguably even worse.
+	 (save-excursion
+	   (set-buffer egg:fence-buffer)
+	   (its:reset-input)
+	   (fence-cancel-input)))
+	((not (and this-command
+		   (symbolp this-command)
+		   (get this-command 'egg-fence-command)))
+	 (its:reset-input)
+	 (fence-cancel-input))
+	(t
+	 (if (or (not (pos-visible-in-window-safe
+		       (marker-position egg:*region-start*)))
+		 (not (pos-visible-in-window-safe
+		       (marker-position egg:*region-end*))))
+	     (recenter))))
+  )
+
 (defun egg-lang-switch-callback ()
   "Do whatever processing is necessary when the language-environment changes."
   (if egg:*in-fence-mode*
@@ -2732,7 +2767,8 @@
 	(fence-cancel-input)))
   (let ((func (get current-language-environment 'set-egg-environ)))
     (if (not (null func))
-      (funcall func))))
+      (funcall func)))
+  (egg:mode-line-display))
 
 (defun fence-mode-help-command ()
   "Display documentation for fence-mode."
@@ -2787,6 +2823,118 @@
 (define-key fence-mode-map [right] 'fence-forward-char)
 (define-key fence-mode-map [left] 'fence-backward-char)
 
+(put 'fence-self-insert-command 'egg-fence-command t)
+(put 'fence-hiragana 'egg-fence-command t)
+(put 'fence-katakana 'egg-fence-command t)
+(put 'fence-hankaku 'egg-fence-command t)
+(put 'fence-zenkaku 'egg-fence-command t)
+(put 'its:select-hiragana 'egg-fence-command t)
+(put 'its:select-katakana 'egg-fence-command t)
+(put 'its:select-downcase 'egg-fence-command t)
+(put 'its:select-upcase 'egg-fence-command t)
+(put 'its:select-zenkaku-downcase 'egg-fence-command t)
+(put 'its:select-zenkaku-upcase 'egg-fence-command t)
+(put 'its:minibuffer-completion-help 'egg-fence-command t)
+(put 'henkan-fence-region-or-single-space 'egg-fence-command t)
+(put 'henkan-fence-region 'egg-fence-command t)
+(put 'fence-beginning-of-line 'egg-fence-command t)
+(put 'fence-backward-char 'egg-fence-command t)
+(put 'fence-cancel-input 'egg-fence-command t)
+(put 'fence-delete-char 'egg-fence-command t)
+(put 'fence-end-of-line 'egg-fence-command t)
+(put 'fence-forward-char 'egg-fence-command t)
+(put 'fence-cancel-input 'egg-fence-command t)
+(put 'fence-mode-help-command 'egg-fence-command t)
+(put 'fence-kill-line 'egg-fence-command t)
+(put 'fence-exit-mode 'egg-fence-command t)
+(put 'fence-exit-mode 'egg-fence-command t)
+(put 'fence-exit-mode 'egg-fence-command t)
+(put 'its:select-previous-mode 'egg-fence-command t)
+(put 'fence-transpose-chars 'egg-fence-command t)
+(put 'eval-expression 'egg-fence-command t)
+(put 'fence-toggle-egg-mode 'egg-fence-command t)
+(put 'jis-code-input 'egg-fence-command t)
+(put 'fence-backward-delete-char 'egg-fence-command t)
+(put 'fence-backward-delete-char 'egg-fence-command t)
+(put 'fence-backward-delete-char 'egg-fence-command t)
+(put 'fence-forward-char 'egg-fence-command t)
+(put 'fence-backward-char 'egg-fence-command t)
+(put 'hiragana-region 'egg-fence-command t)
+(put 'hiragana-paragraph 'egg-fence-command t)
+(put 'hiragana-sentance 'egg-fence-command t)
+(put 'katakana-region 'egg-fence-command t)
+(put 'katakana-paragraph 'egg-fence-command t)
+(put 'katakana-sentance 'egg-fence-command t)
+(put 'hankaku-region 'egg-fence-command t)
+(put 'hankaku-paragraph 'egg-fence-command t)
+(put 'hankaku-sentance 'egg-fence-command t)
+(put 'hankaku-word 'egg-fence-command t)
+(put 'zenkaku-region 'egg-fence-command t)
+(put 'zenkaku-paragraph 'egg-fence-command t)
+(put 'zenkaku-sentance 'egg-fence-command t)
+(put 'zenkaku-word 'egg-fence-command t)
+(put 'roma-kana-region 'egg-fence-command t)
+(put 'roma-kana-paragraph 'egg-fence-command t)
+(put 'roma-kana-sentance 'egg-fence-command t)
+(put 'roma-kana-word 'egg-fence-command t)
+(put 'roma-kanji-region 'egg-fence-command t)
+(put 'roma-kanji-paragraph 'egg-fence-command t)
+(put 'roma-kanji-sentance 'egg-fence-command t)
+(put 'roma-kanji-word 'egg-fence-command t)
+(put 'its:select-mode 'egg-fence-command t)
+(put 'its:select-mode-from-menu 'egg-fence-command t)
+(put 'its:next-mode 'egg-fence-command t)
+(put 'its:previous-mode 'egg-fence-command t)
+(put 'its:select-hiragana 'egg-fence-command t)
+(put 'its:select-katakana 'egg-fence-command t)
+(put 'its:select-downcase 'egg-fence-command t)
+(put 'its:select-upcase   'egg-fence-command t)
+(put 'its:select-zenkaku-downcase 'egg-fence-command t)
+(put 'its:select-zenkaku-upcase   'egg-fence-command t)
+(put 'its:select-mode-temporally 'egg-fence-command t)
+(put 'its:select-previous-mode 'egg-fence-command t)
+(put 'fence-toggle-egg-mode 'egg-fence-command t)
+(put 'fence-transpose-chars 'egg-fence-command t)
+(put 'henkan-region 'egg-fence-command t)
+(put 'henkan-paragraph 'egg-fence-command t)
+(put 'henkan-sentance 'egg-fence-command t)
+(put 'henkan-word 'egg-fence-command t)
+(put 'henkan-kakutei 'egg-fence-command t)
+(put 'gyaku-henkan-region 'egg-fence-command t)
+(put 'gyaku-henkan-sentance 'egg-fence-command t)
+(put 'gyaku-henkan-word 'egg-fence-command t)
+(put 'gyaku-henkan-kakutei 'egg-fence-command t)
+(put 'henkan-kakutei-first-char 'egg-fence-command t)
+(put 'henkan-kakutei-before-point 'egg-fence-command t)
+(put 'sai-henkan 'egg-fence-command t)
+(put 'henkan-forward-bunsetu 'egg-fence-command t)
+(put 'henkan-backward-bunsetu 'egg-fence-command t)
+(put 'henkan-first-bunsetu 'egg-fence-command t)
+(put 'henkan-last-bunsetu 'egg-fence-command t)
+(put 'henkan-hiragana 'egg-fence-command t)
+(put 'henkan-katakana 'egg-fence-command t)
+(put 'henkan-next-kouho 'egg-fence-command t)
+(put 'henkan-next-kouho-dai 'egg-fence-command t)
+(put 'henkan-next-kouho-sho 'egg-fence-command t)
+(put 'henkan-previous-kouho 'egg-fence-command t)
+(put 'henkan-previous-kouho-dai 'egg-fence-command t)
+(put 'henkan-previous-kouho-sho 'egg-fence-command t)
+(put 'henkan-bunsetu-chijime-dai 'egg-fence-command t)
+(put 'henkan-bunsetu-chijime-sho 'egg-fence-command t)
+(put 'henkan-bunsetu-nobasi-dai 'egg-fence-command t)
+(put 'henkan-bunsetu-nobasi-sho 'egg-fence-command t)
+(put 'henkan-saishou-bunsetu 'egg-fence-command t)
+(put 'henkan-saichou-bunsetu 'egg-fence-command t)
+(put 'henkan-quit 'egg-fence-command t)
+(put 'henkan-select-kouho-dai 'egg-fence-command t)
+(put 'henkan-select-kouho-sho 'egg-fence-command t)
+(put 'henkan-word-off 'egg-fence-command t)
+(put 'henkan-kakutei-and-self-insert 'egg-fence-command t)
+(put 'henkan-help-command 'egg-fence-command t)
+(put 'toroku-region 'egg-fence-command t)
+(put 'toroku-henkan-mode 'egg-fence-command t)
+(put 'recenter 'egg-fence-command t)
+
 
 ;;;----------------------------------------------------------------------
 ;;;
--- a/lisp/electric/electric.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/electric/electric.el	Mon Aug 13 09:32:43 2007 +0200
@@ -143,6 +143,13 @@
 				(prin1-to-string conditions)))
 		     (sit-for 2))))
 	(ding))
+      (and (not (eq (current-buffer) electrified-buffer)) ; XEmacs -
+	   (not (eq (selected-window) (minibuffer-window)))
+	   (progn (ding nil 'quit)
+		  (message "Leaving electric command loop %s."
+			   "because buffer has changed")
+		  (sit-for 2)
+		  (throw return-tag nil)))
       (if loop-function (funcall loop-function loop-state err))))
   ;; XEmacs - huh?  It should be impossible to ever get here...
   (ding nil 'alarm)
--- a/lisp/gnus/ChangeLog	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/ChangeLog	Mon Aug 13 09:32:43 2007 +0200
@@ -1,3 +1,116 @@
+Sat May  3 00:59:39 1997  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
+
+	* gnus.el: Gnus v5.4.50 is released.
+
+Sat May  3 00:30:12 1997  Kim-Minh Kaplan  <kimminh.kaplan@utopia.eunet.fr>
+
+	* gnus-picon.el (gnus-picons-prepare-for-annotations): New
+	function, and many changes.
+
+Sat May  3 00:03:51 1997  Lars Magne Ingebrigtsen  <larsi@ifi.uio.no>
+
+	* nnfolder.el (nnfolder-possibly-change-group): Wouldn't always
+	switch buffers.
+
+	* gnus-sum.el (gnus-update-read-articles): Force boundary.
+
+	* gnus-undo.el (gnus-force-undo-boundary): New function.
+
+Fri May  2 23:44:54 1997  Lars Magne Ingebrigtsen  <larsi@ifi.uio.no>
+
+	* gnus-art.el (gnus-article-treat-html): w3-parse-buffer
+	incompatibility. 
+
+Thu May  1 17:56:05 1997  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
+
+	* gnus.el: Gnus v5.4.49 is released.
+
+Sat Apr 19 16:13:03 1997  Erik Toubro Nielsen  <erik@ifad.dk>
+
+	* gnus-sum.el (gnus-summary-exit): Returned to the wrong topic in
+ 	certain obscure cases if selected group occured in multiple
+ 	topics.
+
+	* gnus-topic.el (gnus-topic-update-topic): Did not preserve point
+ 	on the same instance of a group if group occured in multiple
+ 	topics. Caused gnus-summary-exit to return to wrong topic if the
+ 	selected group was in more than one topic.
+
+	Above two bugs happened only if the window configuration for
+ 	summary mode caused the group buffer not to be shown in a window.
+
+Thu May  1 14:28:20 1997  Lars Magne Ingebrigtsen  <larsi@ifi.uio.no>
+
+	* message.el (message-send): Would pretend to have sent.
+
+	* nnmh.el (nnmh-request-list-1): Don't use truename.
+
+Sun Apr 27 15:16:16 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* gnus-xmas.el: Undo previous change, and restore the version from 
+	5.4.46 (without the require 'gnus-art).
+
+Tue Apr 29 11:08:27 1997  Lars Magne Ingebrigtsen  <larsi@ifi.uio.no>
+
+	* gnus-score.el (gnus-summary-increase-score): Better error
+	messages. 
+
+Sun Apr 27 23:15:58 1997  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
+
+	* gnus.el: Gnus v5.4.48 is released.
+
+Sun Apr 27 11:40:57 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* gnus-xmas.el (gnus-art): (require 'gnus-art) introduces a
+	circular dependency on gnus-xmas-define and gnus-xmas-redefine.
+	Brute force it away.
+
+Sun Apr 27 12:32:13 1997  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
+
+	* gnus.el: Gnus v5.4.47 is released.
+
+Sun Apr 27 10:42:08 1997  Lars Magne Ingebrigtsen  <larsi@ifi.uio.no>
+
+	* gnus-cache.el (gnus-cache-move-cache): Allow entering directory
+	name. 
+
+	* nntp.el (nntp-telnet-command, nntp-telnet-switches): New
+	variables. 
+
+	* gnus-score.el (gnus-summary-increase-score): Refuse illegal
+	match types.
+
+Fri Apr 25 06:16:05 1997  Arne Georg Gleditsch  <argggh@ifi.uio.no>
+
+	* gnus-sum.el (gnus-summary-refer-article): Go to article when
+	expunged. 
+
+Wed Apr 23 19:48:43 1997  Per Abrahamsen  <abraham@dina.kvl.dk>
+
+	* gnus-ems.el (gnus-article-x-face-command): Removed bogus
+	declaration.
+
+Mon Apr 21 16:44:00 1997  Paul Franklin  <paul@cs.washington.edu>
+
+	* nnmail.el (nnmail-move-inbox): fewer (0?) file calls on inbox if
+	popmail.
+
+Thu Apr 24 14:04:31 1997  Lars Magne Ingebrigtsen  <larsi@ifi.uio.no>
+
+	* message.el (message-font-lock-keywords): Be more conservative in
+	determining headers.
+
+	* nnmh.el (nnmh-request-list-1): Use truenames.
+
+	* gnus-undo.el (gnus-undo-mode): Don't infest
+	gnus-summary-exit-hook. 
+
+	* gnus-sum.el (gnus-update-read-articles): Force an undo
+	boundary. 
+
+	* nnweb.el (nnweb-fetch-url): Don't rely on return values from
+	url-insert-file-contents. 
+
 Sat Apr 19 06:11:31 1997  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
 
 	* gnus.el: Gnus v5.4.46 is released.
--- a/lisp/gnus/gnus-art.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/gnus-art.el	Mon Aug 13 09:32:43 2007 +0200
@@ -1124,8 +1124,10 @@
        (setq e (point-max)))
       (nnheader-temp-write nil
 	(insert-buffer-substring gnus-article-buffer b e)
+	(require 'url)
 	(save-window-excursion
-	  (setq buf (car (w3-parse-buffer (current-buffer))))))
+	  (w3-parse-buffer (current-buffer))
+	  (setq buf (buffer-string))))
       (when buf
 	(delete-region (point-min) (point-max))
 	(insert-buffer-substring buf)
--- a/lisp/gnus/gnus-cache.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/gnus-cache.el	Mon Aug 13 09:32:43 2007 +0200
@@ -650,7 +650,7 @@
 
 (defun gnus-cache-move-cache (dir)
   "Move the cache tree to somewhere else."
-  (interactive "DMove the cache tree to: ")
+  (interactive "FMove the cache tree to: ")
   (rename-file gnus-cache-directory dir))
 
 (provide 'gnus-cache)
--- a/lisp/gnus/gnus-ems.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/gnus-ems.el	Mon Aug 13 09:32:43 2007 +0200
@@ -75,13 +75,7 @@
       nil
 
     (defvar gnus-mouse-face-prop 'mouse-face
-      "Property used for highlighting mouse regions.")
-
-    (defvar gnus-article-x-face-command
-      "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | xv -quit -"
-      "String or function to be executed to display an X-Face header.
-If it is a string, the command will be executed in a sub-shell
-asynchronously.	 The compressed face will be piped to this command."))
+      "Property used for highlighting mouse regions."))
 
   (cond
    ((string-match "XEmacs\\|Lucid" emacs-version)
--- a/lisp/gnus/gnus-picon.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/gnus-picon.el	Mon Aug 13 09:32:43 2007 +0200
@@ -63,7 +63,7 @@
   :type 'string
   :group 'picons)
 
-(defcustom gnus-picons-user-directories '("local" "users" "usenix" "misc/MISC")
+(defcustom gnus-picons-user-directories '("local" "users" "usenix" "misc")
   "List of directories to search for user faces."
   :type '(repeat string)
   :group 'picons)
@@ -109,7 +109,7 @@
 
 (defcustom gnus-picons-display-article-move-p t
   "*Whether to move point to first empty line when displaying picons.
-This has only an effect if `gnus-picons-display-where' hs value article."
+This has only an effect if `gnus-picons-display-where' has value `article'."
   :type 'boolean
   :group 'picons)
 
@@ -120,26 +120,34 @@
 
 ;;; Internal variables.
 
-(defvar gnus-group-annotations nil)
-(defvar gnus-article-annotations nil)
-(defvar gnus-x-face-annotations nil)
+(defvar gnus-group-annotations nil
+  "List of annotations added/removed when selecting/exiting a group")
+(defvar gnus-article-annotations nil
+  "List of annotations added/removed when selecting an article")
+(defvar gnus-x-face-annotations nil
+  "List of annotations added/removed when selecting an article with an X-Face.")
 
-(defun gnus-picons-remove (plist)
-  (let ((listitem (car plist)))
-    (while (setq listitem (car plist))
-      (when (annotationp listitem)
-	(delete-annotation listitem))
-      (setq plist (cdr plist)))))
+(defun gnus-picons-remove (symbol)
+  "Remove all annotations/processes in variable named SYMBOL.
+This function is careful to set it to nil before removing anything so that
+asynchronous process don't get crazy."
+  (let ((listitems (symbol-value symbol)))
+    (set symbol nil)
+    (while listitems
+      (let ((item (pop listitems)))
+	(cond ((annotationp item)
+	       (delete-annotation item))
+	      ((processp item)
+	       ;; kill the process, ignore any output.
+	       (set-process-sentinel item (function (lambda (p e))))
+	       (delete-process item)))))))
 
 (defun gnus-picons-remove-all ()
   "Removes all picons from the Gnus display(s)."
   (interactive)
-  (gnus-picons-remove gnus-article-annotations)
-  (gnus-picons-remove gnus-group-annotations)
-  (gnus-picons-remove gnus-x-face-annotations)
-  (setq gnus-article-annotations nil
-        gnus-group-annotations nil
-	gnus-x-face-annotations nil)
+  (gnus-picons-remove 'gnus-article-annotations)
+  (gnus-picons-remove 'gnus-group-annotations)
+  (gnus-picons-remove 'gnus-x-face-annotations)
   (when (bufferp gnus-picons-buffer)
     (kill-buffer gnus-picons-buffer)))
 
@@ -153,57 +161,80 @@
         ((stringp variable)
          variable)))
 
+(defun gnus-picons-prepare-for-annotations (annotations)
+  "Prepare picons buffer for puting annotations memorized in ANNOTATIONS.
+ANNOTATIONS should be a symbol naming a variable wich contains a list of
+annotations.  Sets buffer to `gnus-picons-display-where'."
+  ;; let drawing catch up
+  (when gnus-picons-refresh-before-display
+    (sit-for 0))
+  (set-buffer (get-buffer-create
+	       (gnus-get-buffer-name gnus-picons-display-where)))
+  (gnus-add-current-to-buffer-list)
+  (goto-char (point-min))
+  (if (and (eq gnus-picons-display-where 'article)
+	   gnus-picons-display-article-move-p)
+      (when (search-forward "\n\n" nil t)
+	(forward-line -1)))
+  (gnus-picons-remove annotations))
+
 (defun gnus-picons-article-display-x-face ()
   "Display the x-face header bitmap in the 'gnus-picons-display-where buffer."
   ;; delete any old ones.
-  (gnus-picons-remove gnus-x-face-annotations)
-  (setq gnus-x-face-annotations nil)
+  ;; This is needed here because gnus-picons-display-x-face will not
+  ;; be called if there is no X-Face header
+  (gnus-picons-remove 'gnus-x-face-annotations)
   ;; display the new one.
   (let ((gnus-article-x-face-command 'gnus-picons-display-x-face))
     (gnus-article-display-x-face)))
 
+(defun gnus-picons-x-face-sentinel (process event)
+  ;; don't call gnus-picons-prepare-for-annotations, it would reset
+  ;; gnus-x-face-annotations.
+  (set-buffer (get-buffer-create
+	       (gnus-get-buffer-name gnus-picons-display-where)))
+  (gnus-add-current-to-buffer-list)
+  (goto-char (point-min))
+  (if (and (eq gnus-picons-display-where 'article)
+	   gnus-picons-display-article-move-p)
+      (when (search-forward "\n\n" nil t)
+	(forward-line -1)))
+  ;; If the process is still in the list, insert this icon
+  (let ((myself (member process gnus-x-face-annotations)))
+    (when myself
+      (setcar myself
+	      (make-annotation gnus-picons-x-face-file-name nil 'text))
+      (delete-file gnus-picons-x-face-file-name))))
+
 (defun gnus-picons-display-x-face (beg end)
   "Function to display the x-face header in the picons window.
 To use:  (setq gnus-article-x-face-command 'gnus-picons-display-x-face)"
   (interactive)
-  ;; convert the x-face header to a .xbm file
-  (let ((process-connection-type nil)
-	(process nil))
-    (process-kill-without-query
-     (setq process (start-process
-		    "gnus-x-face" nil shell-file-name shell-command-switch
-		    gnus-picons-convert-x-face)))
-    (process-send-region "gnus-x-face" beg end)
-    (process-send-eof "gnus-x-face")
-    ;; wait for it.
-    (while (not (equal (process-status process) 'exit))
-      (sleep-for .1)))
-  ;; display it
-  (save-excursion
-    (set-buffer (get-buffer-create (gnus-get-buffer-name
-				    gnus-picons-display-where)))
-    (gnus-add-current-to-buffer-list)
-    (goto-char (point-min))
-    (let (buffer-read-only)
-      (unless (eolp)
-	(push (make-annotation "\n" (point) 'text)
-	      gnus-x-face-annotations))
-      ;; append the annotation to gnus-article-annotations for deletion.
-      (setq gnus-x-face-annotations
-	    (append
-	     (gnus-picons-try-to-find-face gnus-picons-x-face-file-name t)
-	     gnus-x-face-annotations)))
-    ;; delete the tmp file
-    (delete-file gnus-picons-x-face-file-name)))
+  (if (featurep 'xface)
+      ;; Use builtin support
+      (let ((buf (current-buffer)))
+	(save-excursion
+	  (gnus-picons-prepare-for-annotations 'gnus-x-face-annotations)
+	  (setq gnus-x-face-annotations
+		(cons (make-annotation (concat "X-Face: "
+					       (buffer-substring beg end buf))
+				       nil 'text)
+		      gnus-x-face-annotations))))
+    ;; convert the x-face header to a .xbm file
+    (let* ((process-connection-type nil)
+	   (process (start-process "gnus-x-face" nil
+				   shell-file-name shell-command-switch
+				   gnus-picons-convert-x-face)))
+      (process-kill-without-query process)
+      (setq gnus-x-face-annotations (list process))
+      (set-process-sentinel process 'gnus-picons-x-face-sentinel)
+      (process-send-region process beg end)
+      (process-send-eof process))))
 
 (defun gnus-article-display-picons ()
   "Display faces for an author and his/her domain in gnus-picons-display-where."
   (interactive)
-  ;; let drawing catch up
-  (when gnus-picons-refresh-before-display
-    (sit-for 0))
-  (let ((first t)
-	from at-idx databases)
+  (let (from at-idx)
     (when (and (featurep 'xpm)
 	       (or (not (fboundp 'device-type)) (equal (device-type) 'x))
 	       (setq from (mail-fetch-field "from"))
@@ -216,104 +247,53 @@
 	(let ((username (substring from 0 at-idx))
 	      (addrs (if (eq at-idx (length from))
 			 (if gnus-local-domain
-			     (nreverse (message-tokenize-header
-					gnus-local-domain "."))
-			   '("."))
-		       (nreverse (message-tokenize-header
-				  (substring from (1+ at-idx)) ".")))))
-	  (set-buffer (get-buffer-create
-		       (gnus-get-buffer-name gnus-picons-display-where)))
-	  (gnus-add-current-to-buffer-list)
-	  (goto-char (point-min))
-	  (if (and (eq gnus-picons-display-where 'article)
-		   gnus-picons-display-article-move-p)
-	      (when (search-forward "\n\n" nil t)
-		(forward-line -1))
-	    (unless (eolp)
-	      (push (make-annotation "\n" (point) 'text)
-		    gnus-article-annotations)))
-
-	  (gnus-picons-remove gnus-article-annotations)
-	  (setq gnus-article-annotations nil)
-
-	  ;; look for domain paths.
-	  (setq databases gnus-picons-domain-directories)
-	  (while databases
-	    (setq gnus-article-annotations
-		  (nconc (gnus-picons-insert-face-if-exists
-			  (car databases)
-			  addrs
-			  "unknown" (or gnus-picons-display-as-address
-					gnus-article-annotations) t t)
-			 gnus-article-annotations))
-	    (setq databases (cdr databases)))
-
-	  ;; add an '@' if displaying as address
-	  (when gnus-picons-display-as-address
-	    (setq gnus-article-annotations
-		  (nconc gnus-article-annotations
-			 (list
-			  (make-annotation "@" (point) 'text nil nil nil t)))))
-
-	  ;; then do user directories,
-	  (let (found)
-	    (setq databases gnus-picons-user-directories)
-	    (setq username (downcase username))
-	    (while databases
-	      (setq found
-		    (nconc (gnus-picons-insert-face-if-exists
-			    (car databases) addrs username
-			    (or gnus-picons-display-as-address
-				gnus-article-annotations) nil t)
-			   found))
-	      (setq databases (cdr databases)))
-	    ;; add their name if no face exists
-	    (when (and gnus-picons-display-as-address (not found))
-	      (setq found
-		    (list
-		     (make-annotation username (point) 'text nil nil nil t))))
-	    (setq gnus-article-annotations
-		  (nconc found gnus-article-annotations)))
+			     (message-tokenize-header gnus-local-domain ".")
+			   nil)
+		       (message-tokenize-header (substring from (1+ at-idx))
+						"."))))
+	  (gnus-picons-prepare-for-annotations 'gnus-article-annotations)
+	  (setq gnus-article-annotations
+		(nconc gnus-article-annotations
+		       ;; look for domain paths.
+		       (gnus-picons-display-pairs
+			(gnus-picons-lookup-pairs addrs
+					       gnus-picons-domain-directories)
+			(not (or gnus-picons-display-as-address
+				 gnus-article-annotations))
+			nil "." t)
+		       ;; add an '@' if displaying as address
+		       (if  (and gnus-picons-display-as-address addrs)
+			 (list (make-annotation "@" nil 'text nil nil nil t)))
+		       ;; then do user directories,
+		       (gnus-picons-display-picon-or-name
+			(gnus-picons-lookup-user (downcase username) addrs)
+			username nil t)))
 
 	  (add-hook 'gnus-summary-exit-hook 'gnus-picons-remove-all))))))
 
 (defun gnus-group-display-picons ()
   "Display icons for the group in the gnus-picons-display-where buffer."
   (interactive)
-  ;; let display catch up so far
-  (when gnus-picons-refresh-before-display
-    (sit-for 0))
   (when (and (featurep 'xpm)
 	     (or (not (fboundp 'device-type)) (equal (device-type) 'x)))
     (save-excursion
-      (set-buffer (get-buffer-create
-		   (gnus-get-buffer-name gnus-picons-display-where)))
-      (gnus-add-current-to-buffer-list)
-      (goto-char (point-min))
-      (if (and (eq gnus-picons-display-where 'article)
-	       gnus-picons-display-article-move-p)
-	  (when (search-forward "\n\n" nil t)
-	    (forward-line -1))
-	(unless (eolp)
-	  (push (make-annotation "\n" (point) 'text)
-		gnus-group-annotations)))
-      (cond
-       ((listp gnus-group-annotations)
-	(mapc #'(lambda (ext) (when (extent-live-p ext)
-				(delete-annotation ext)))
-	      gnus-group-annotations)
-	(setq gnus-group-annotations nil))
-       ((annotationp gnus-group-annotations)
-	(delete-annotation gnus-group-annotations)
-	(setq gnus-group-annotations nil)))
-      (gnus-picons-remove gnus-group-annotations)
+      (gnus-picons-prepare-for-annotations 'gnus-group-annotations)
       (setq gnus-group-annotations
-	    (gnus-picons-insert-face-if-exists
-	     gnus-picons-news-directory
-	     (message-tokenize-header gnus-newsgroup-name ".")
-	     "unknown" nil t))
+	    (gnus-picons-display-pairs
+	     (gnus-picons-lookup-pairs (reverse (message-tokenize-header
+					      gnus-newsgroup-name "."))
+				    gnus-picons-news-directory)
+	     t nil "."))
       (add-hook 'gnus-summary-exit-hook 'gnus-picons-remove-all))))
 
+(defun gnus-picons-make-path (dir subdirs)
+  "Make a directory name from a base DIR and a list of SUBDIRS.
+Returns a directory name build by concatenating DIR and all elements of
+SUBDIRS with \"/\" between elements."
+  (while subdirs
+    (setq dir (file-name-as-directory (concat dir (pop subdirs)))))
+  dir)
+
 (defsubst gnus-picons-try-suffixes (file)
   (let ((suffixes gnus-picons-file-suffixes)
 	f)
@@ -322,78 +302,90 @@
       (setq f nil))
     f))
 
-(defun gnus-picons-insert-face-if-exists (database addrs filename &optional
-						   nobar-p dots rightp)
-  "Inserts a face at point if I can find one"
-  ;; '(gnus-picons-insert-face-if-exists
-  ;;    "Database" '("edu" "indiana" "cs") "Name")
-  ;; looks for:
-  ;;  1. edu/indiana/cs/Name
-  ;;  2. edu/indiana/Name
-  ;;  3. edu/Name
-  ;; '(gnus-picons-insert-face-if-exists
-  ;;     "Database/MISC" '("edu" "indiana" "cs") "Name")
-  ;; looks for:
-  ;;  1. MISC/Name
-  ;; The special treatment of MISC doesn't conform with the conventions for
-  ;; picon databases, but otherwise we would always see the MISC/unknown face.
-  (let ((bar (and (not nobar-p)
-		  (or gnus-picons-display-as-address
-		      (annotations-in-region
-		       (point) (min (point-max) (1+ (point)))
-		       (current-buffer)))))
-	(path (concat (file-name-as-directory gnus-picons-database)
-		      database "/"))
-	(domainp (and gnus-picons-display-as-address dots))
-	picons found bar-ann cur first)
-    (when (string-match "/MISC" database)
-      (setq addrs '(".")))
-    (while (and addrs
-		(file-accessible-directory-p path))
-      (setq cur (pop addrs)
-	    path (concat path cur "/"))
-      (if (setq found
-		(gnus-picons-try-suffixes (concat path filename "/face.")))
-	  (progn
-	    (setq picons (nconc (when (and domainp first rightp)
-				  (list (make-annotation
-					 "." (point) 'text
-					 nil nil nil rightp)
-					picons))
-				(gnus-picons-try-to-find-face
-				 found nil (if domainp cur filename) rightp)
-				(when (and domainp first (not rightp))
-				  (list (make-annotation
-					 "." (point) 'text
-					 nil nil nil rightp)
-					picons))
-				picons)))
-	(when domainp
-	  (setq picons
-		(nconc
-		 (list (make-annotation
-			(if first (concat (if (not rightp) ".") cur
-					  (if rightp ".")) cur)
-			(point) 'text nil nil nil rightp))
-		 picons))))
-      (when (and bar (or domainp found))
-	(setq bar-ann (gnus-picons-try-to-find-face
-		       (concat gnus-xmas-glyph-directory "bar.xbm")
-		       nil nil t))
-	(when bar-ann
-	  (setq picons (nconc picons bar-ann))
-	  (setq bar nil)))
-      (setq first t))
-    (when (and addrs domainp)
-      (let ((it (mapconcat 'downcase (nreverse addrs) ".")))
-	(setq picons
-	      (nconc picons (list (make-annotation
-				   (if first
-				       (concat (if (not rightp) ".")
-					       it (if rightp "."))
-				     it)
-				   (point) 'text
-				   nil nil nil rightp))))))
+(defun gnus-picons-lookup (addrs dirs)
+  "Lookup the picon for ADDRS in databases DIRS.
+Returns the picon filename or NIL if none found."
+  (let (result)
+    (while (and dirs (null result))
+      (setq result
+	    (gnus-picons-try-suffixes
+	     (expand-file-name "face."
+			       (gnus-picons-make-path
+				(file-name-as-directory
+				 (concat
+				  (file-name-as-directory gnus-picons-database)
+				  (pop dirs)))
+				(reverse addrs))))))
+    result))
+
+(defun gnus-picons-lookup-user-internal (user domains)
+  (let ((dirs gnus-picons-user-directories)
+	picon)
+    (while (and dirs (null picon))
+      (let ((dir (list (pop dirs)))
+	    (domains domains))
+	(while (and domains (null picon))
+	  (setq picon (gnus-picons-lookup (cons user domains) dir))
+	  (pop domains))
+	;; Also make a try MISC subdir
+	(unless picon
+	  (setq picon (gnus-picons-lookup (list user "MISC") dir)))))
+
+    picon))
+
+(defun gnus-picons-lookup-user (user domains)
+  "Lookup the picon for USER at DOMAINS.
+USER is a string containing a name.
+DOMAINS is a list of strings from the fully qualified domain name."
+  (or (gnus-picons-lookup-user-internal user domains)
+      (gnus-picons-lookup-user-internal "unknown" domains)))
+
+(defun gnus-picons-lookup-pairs (domains directories)
+  "Lookup picons for DOMAINS and all its parents in DIRECTORIES.
+Returns a list of PAIRS whose CAR is the picon filename or NIL if
+none, and whose CDR is the corresponding element of DOMAINS."
+  (let (picons)
+    (while domains
+      (push (list (gnus-picons-lookup (cons "unknown" domains)
+				      (if (listp directories)
+					  directories
+					(list directories)))
+		  (pop domains))
+	    picons))
+    picons))
+
+(defun gnus-picons-display-picon-or-name (picon name &optional xface-p right-p)
+  (if picon
+      (gnus-picons-try-to-find-face picon xface-p name right-p)
+    (list (make-annotation name nil 'text nil nil nil right-p))))
+
+(defun gnus-picons-display-pairs (pairs &optional bar-p xface-p dot-p right-p)
+  "Display picons in list PAIRS."
+  (let ((bar (and bar-p (or gnus-picons-display-as-address
+			  (annotations-in-region (point)
+						 (min (point-max) (1+ (point)))
+						 (current-buffer)))))
+	(domain-p (and gnus-picons-display-as-address dot-p))
+	picons)
+    (while pairs
+      (let ((pair (pop pairs)))
+	(setq picons (nconc (if (and domain-p picons (not right-p))
+				(list (make-annotation
+				       dot-p nil 'text nil nil nil right-p)))
+			    (gnus-picons-display-picon-or-name (car pair)
+							       (cadr pair)
+							       xface-p
+							       right-p)
+			    (if (and domain-p pairs right-p)
+				(list (make-annotation
+				       dot-p nil 'text nil nil nil right-p)))
+			    (when (and bar domain-p)
+			      (setq bar nil)
+			      (gnus-picons-try-to-find-face
+			       (expand-file-name "bar.xbm"
+						 gnus-xmas-glyph-directory)
+			       nil nil t))
+			    picons))))
     picons))
 
 (defvar gnus-picons-glyph-alist nil)
@@ -422,11 +414,8 @@
 	     (set-extent-property txt 'keymap gnus-picons-map)
 	     (set-extent-property txt 'mouse-face gnus-article-mouse-face)
 	     (set-extent-property new 'its-partner txt)
-	     (set-extent-property new 'keymap gnus-picons-map))))))))
-
-(defun gnus-picons-reverse-domain-path (str)
-  "a/b/c/d -> d/c/b/a"
-  (mapconcat 'downcase (nreverse (message-tokenize-header str "/")) "/"))
+	     (set-extent-property new 'keymap gnus-picons-map)
+	     (list txt))))))))
 
 (defun gnus-picons-toggle-extent (event)
   "Toggle picon glyph at given point"
--- a/lisp/gnus/gnus-score.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/gnus-score.el	Mon Aug 13 09:32:43 2007 +0200
@@ -1,4 +1,4 @@
-;;; gnus-score.el --- scoring code for Gnus
+1;;; gnus-score.el --- scoring code for Gnus
 ;; Copyright (C) 1995,96,97 Free Software Foundation, Inc.
 
 ;; Author: Per Abrahamsen <amanda@iesd.auc.dk>
@@ -526,7 +526,8 @@
 
 	  (gnus-score-kill-help-buffer)
 	  (unless (setq entry (assq (downcase hchar) char-to-header))
-	    (if mimic (error "%c %c" prefix hchar) (error "")))
+	    (if mimic (error "%c %c" prefix hchar)
+	      (error "Illegal header type")))
 
 	  (when (/= (downcase hchar) hchar)
 	    ;; This was a majuscule, so we end reading and set the defaults.
@@ -534,36 +535,32 @@
 	    (setq tchar (or tchar ?s)
 		  pchar (or pchar ?t)))
 
-	  ;; We continue reading - the type.
-	  (while (not tchar)
-	    (if mimic
-		(progn
-		  (sit-for 1) (message "%c %c-" prefix hchar))
-	      (message "%s header '%s' with match type (%s?): "
-		       (if increase "Increase" "Lower")
-		       (nth 1 entry)
-		       (mapconcat (lambda (s)
-				    (if (eq (nth 4 entry)
-					    (nth 3 s))
-					(char-to-string (car s))
-				      ""))
-				  char-to-type "")))
-	    (setq tchar (read-char))
-	    (when (or (= tchar ??) (= tchar ?\C-h))
-	      (setq tchar nil)
-	      (gnus-score-insert-help
-	       "Match type"
-	       (delq nil
-		     (mapcar (lambda (s)
-			       (if (eq (nth 4 entry)
-				       (nth 3 s))
-				   s nil))
-			     char-to-type))
-	       2)))
+	  (let ((legal-types
+		 (delq nil
+		       (mapcar (lambda (s)
+				 (if (eq (nth 4 entry)
+					 (nth 3 s))
+				     s nil))
+			       char-to-type))))
+	    ;; We continue reading - the type.
+	    (while (not tchar)
+	      (if mimic
+		  (progn
+		    (sit-for 1) (message "%c %c-" prefix hchar))
+		(message "%s header '%s' with match type (%s?): "
+			 (if increase "Increase" "Lower")
+			 (nth 1 entry)
+			 (mapconcat (lambda (s) (char-to-string (car s)))
+				    legal-types "")))
+	      (setq tchar (read-char))
+	      (when (or (= tchar ??) (= tchar ?\C-h))
+		(setq tchar nil)
+		(gnus-score-insert-help "Match type" legal-types 2)))
 
-	  (gnus-score-kill-help-buffer)
-	  (unless (setq type (nth 1 (assq (downcase tchar) char-to-type)))
-	    (if mimic (error "%c %c" prefix hchar) (error "")))
+	    (gnus-score-kill-help-buffer)
+	    (unless (setq type (nth 1 (assq (downcase tchar) legal-types)))
+	      (if mimic (error "%c %c" prefix hchar)
+		(error "Illegal match type"))))
 
 	  (when (/= (downcase tchar) tchar)
 	    ;; It was a majuscule, so we end reading and use the default.
@@ -596,7 +593,7 @@
 	      (error "You rang?"))
 	    (if mimic
 		(error "%c %c %c %c" prefix hchar tchar pchar)
-	      (error ""))))
+	      (error "Illegal match duration"))))
       ;; Always kill the score help buffer.
       (gnus-score-kill-help-buffer))
 
@@ -2455,8 +2452,8 @@
 	  (if (looking-at "not.")
 	      (progn
 		(setq not-match t)
-		(setq regexp (concat "^" (buffer-substring 5 (point-max)))))
-	    (setq regexp (concat "^" (buffer-substring 1 (point-max))))
+		(setq regexp (concat "^" (buffer-substring 5 (point-max)) "$")))
+	    (setq regexp (concat "^" (buffer-substring 1 (point-max)) "$"))
 	    (setq not-match nil))
 	  ;; Finally - if this resulting regexp matches the group name,
 	  ;; we add this score file to the list of score files
--- a/lisp/gnus/gnus-sum.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/gnus-sum.el	Mon Aug 13 09:32:43 2007 +0200
@@ -4851,6 +4851,7 @@
   (let* ((group gnus-newsgroup-name)
 	 (quit-config (gnus-group-quit-config gnus-newsgroup-name))
 	 (mode major-mode)
+         (group-point nil)
 	 (buf (current-buffer)))
     (run-hooks 'gnus-summary-prepare-exit-hook)
     ;; If we have several article buffers, we kill them at exit.
@@ -4877,6 +4878,7 @@
     (run-hooks 'gnus-summary-exit-hook)
     (unless quit-config
       (gnus-group-next-unread-group 1))
+    (setq group-point (point))
     (if temporary
 	nil				;Nothing to do.
       ;; If we have several article buffers, we kill them at exit.
@@ -4906,8 +4908,7 @@
       ;; Clear the current group name.
       (if (not quit-config)
 	  (progn
-	    (gnus-group-jump-to-group group)
-	    (gnus-group-next-unread-group 1)
+	    (goto-char group-point)
 	    (gnus-configure-windows 'group 'force))
 	(gnus-handle-ephemeral-exit quit-config))
       (unless quit-config
@@ -6155,9 +6156,9 @@
 			 (mail-header-number header)))))
       (if header
 	  (prog1
-	      ;; The article is present in the buffer, to we just go to it.
+              ;; The article is present in the buffer, so we just go to it.
 	      (gnus-summary-goto-article
-	       (mail-header-number header) nil header)
+               (mail-header-number header) nil t)
 	    (when sparse
 	      (gnus-summary-update-article (mail-header-number header))))
 	;; We fetch the article
@@ -8640,6 +8641,7 @@
 	(push (cons prev (cdr active)) read))
       (save-excursion
 	(set-buffer gnus-group-buffer)
+	(gnus-undo-force-boundary)
 	(gnus-undo-register
 	  `(progn
 	     (gnus-info-set-marks ',info ',(gnus-info-marks info) t)
--- a/lisp/gnus/gnus-topic.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/gnus-topic.el	Mon Aug 13 09:32:43 2007 +0200
@@ -547,12 +547,14 @@
   (when (and (eq major-mode 'gnus-group-mode)
 	     gnus-topic-mode)
     (let ((group (gnus-group-group-name))
+          (m (point-marker))
 	  (buffer-read-only nil))
       (when (and group
 		 (gnus-get-info group)
 		 (gnus-topic-goto-topic (gnus-current-topic)))
 	(gnus-topic-update-topic-line (gnus-group-topic-name))
-	(gnus-group-goto-group group)
+	(goto-char m)
+	(set-marker m nil)
 	(gnus-group-position-point)))))
 
 (defun gnus-topic-goto-missing-group (group)
--- a/lisp/gnus/gnus-undo.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/gnus-undo.el	Mon Aug 13 09:32:43 2007 +0200
@@ -71,15 +71,15 @@
    "\M-\C-_"     gnus-undo
    "\C-_"        gnus-undo
    "\C-xu"       gnus-undo
-   [(control /)] gnus-undo    ; many people are used to type `C-/' on
-			      ; X terminals and get `C-_'.
-   ))
+   ;; many people are used to type `C-/' on X terminals and get `C-_'.
+   [(control /)] gnus-undo))
 
 (defun gnus-undo-make-menu-bar ()
+  ;; This is disabled for the time being.
   (when nil
-  (define-key-after (current-local-map) [menu-bar file gnus-undo]
-    (cons "Undo" 'gnus-undo-actions)
-    [menu-bar file whatever])))
+    (define-key-after (current-local-map) [menu-bar file gnus-undo]
+      (cons "Undo" 'gnus-undo-actions)
+      [menu-bar file whatever])))
 
 (defun gnus-undo-mode (&optional arg)
   "Minor mode for providing `undo' in Gnus buffers.
@@ -103,7 +103,6 @@
 	    minor-mode-map-alist))
     (make-local-hook 'post-command-hook)
     (add-hook 'post-command-hook 'gnus-undo-boundary nil t)
-    (add-hook 'gnus-summary-exit-hook 'gnus-undo-boundary)
     (run-hooks 'gnus-undo-mode-hook)))
 
 ;;; Interface functions.
@@ -122,6 +121,11 @@
       (setq gnus-undo-boundary-inhibit nil)
     (setq gnus-undo-boundary t)))
 
+(defun gnus-undo-force-boundary ()
+  "Set Gnus undo boundary."
+  (setq gnus-undo-boundary-inhibit nil
+	gnus-undo-boundary t))
+
 (defun gnus-undo-register (form)
   "Register FORMS as something to be performed to undo a change.
 FORMS may use backtick quote syntax."
--- a/lisp/gnus/gnus.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/gnus.el	Mon Aug 13 09:32:43 2007 +0200
@@ -226,7 +226,7 @@
   :link '(custom-manual "(gnus)Exiting Gnus")
   :group 'gnus)
 
-(defconst gnus-version-number "5.4.46"
+(defconst gnus-version-number "5.4.50"
   "Version number for this version of Gnus.")
 
 (defconst gnus-version (format "Gnus v%s" gnus-version-number)
--- a/lisp/gnus/message.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/message.el	Mon Aug 13 09:32:43 2007 +0200
@@ -751,7 +751,7 @@
       (,(concat "^\\([Nn]ewsgroups:\\|Followup-[Tt]o:\\)" content)
        (1 'message-header-name-face)
        (2 'message-header-newsgroups-face nil t))
-      (,(concat "^\\([^: \n\t]+:\\)" content)
+      (,(concat "^\\([A-Z][^: \n\t]+:\\)" content)
        (1 'message-header-name-face)
        (2 'message-header-other-face nil t))
       (,(concat "^\\(X-[A-Za-z0-9-]+\\|In-Reply-To\\):" content)
@@ -1737,8 +1737,10 @@
     (run-hooks 'message-send-hook)
     (message "Sending...")
     (let ((alist message-send-method-alist)
+	  (success t)
 	  elem sent)
-      (while (setq elem (pop alist))
+      (while (and success
+		  (setq elem (pop alist)))
 	(when (and (or (not (funcall (cadr elem)))
 		       (and (or (not (memq (car elem)
 					   message-sent-message-via))
@@ -1746,9 +1748,9 @@
 				 (format
 				  "Already sent message via %s; resend? "
 				  (car elem))))
-			    (funcall (caddr elem) arg))))
+			    (setq success (funcall (caddr elem) arg)))))
 	  (setq sent t)))
-      (when sent
+      (when (and success sent)
 	(message-do-fcc)
 	;;(when (fboundp 'mail-hist-put-headers-into-history)
 	;; (mail-hist-put-headers-into-history))
--- a/lisp/gnus/nnfolder.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/nnfolder.el	Mon Aug 13 09:32:43 2007 +0200
@@ -513,8 +513,8 @@
 	;; If we have to change groups, see if we don't already have the
 	;; folder in memory.  If we do, verify the modtime and destroy
 	;; the folder if needed so we can rescan it.
-	(when (setq inf (assoc group nnfolder-buffer-alist))
-	  (setq nnfolder-current-buffer (nth 1 inf)))
+	(setq nnfolder-current-buffer
+	      (nth 1 (assoc group nnfolder-buffer-alist)))
 
 	;; If the buffer is not live, make sure it isn't in the alist.  If it
 	;; is live, verify that nobody else has touched the file since last
--- a/lisp/gnus/nnmail.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/nnmail.el	Mon Aug 13 09:32:43 2007 +0200
@@ -545,12 +545,11 @@
     (when (and (file-exists-p nnmail-crash-box)
 	       (zerop (nnheader-file-size (file-truename nnmail-crash-box))))
       (delete-file nnmail-crash-box))
-    (let ((inbox (file-truename (expand-file-name inbox)))
-	  (tofile (file-truename (expand-file-name nnmail-crash-box)))
-	  movemail popmail errors result)
-      (if (setq popmail (string-match
-			 "^po:" (file-name-nondirectory inbox)))
-	  (setq inbox (file-name-nondirectory inbox))
+    (let ((tofile (file-truename (expand-file-name nnmail-crash-box)))
+	  (popmail (string-match "^po:" inbox))
+	  movemail errors result)
+      (unless popmail
+	(setq inbox (file-truename (expand-file-name inbox)))
 	(setq movemail t)
 	;; On some systems, /usr/spool/mail/foo is a directory
 	;; and the actual inbox is /usr/spool/mail/foo/foo.
--- a/lisp/gnus/nntp.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/nntp.el	Mon Aug 13 09:32:43 2007 +0200
@@ -98,6 +98,12 @@
 (defvoo nntp-telnet-passwd nil
   "Password to use to log in via telnet with.")
 
+(defvoo nntp-telnet-command "telnet"
+  "Command used to start telnet.")
+
+(defvoo nntp-telnet-switches '("-8")
+  "Switches given to the telnet command.")
+
 (defvoo nntp-end-of-line "\r\n"
   "String to use on the end of lines when talking to the NNTP server.
 This is \"\\r\\n\" by default, but should be \"\\n\" when
@@ -1040,8 +1046,9 @@
   (save-excursion
     (set-buffer buffer)
     (erase-buffer)
-    (let ((proc (start-process
-		 "nntpd" buffer "telnet" "-8"))
+    (let ((proc (apply
+		 'start-process
+		 "nntpd" buffer nntp-telnet-command nntp-telnet-switches))
 	  (case-fold-search t))
       (when (memq (process-status proc) '(open run))
 	(process-send-string proc "set escape \^X\n")
--- a/lisp/gnus/nnweb.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/gnus/nnweb.el	Mon Aug 13 09:32:43 2007 +0200
@@ -286,9 +286,9 @@
 	  (save-excursion
 	    (set-buffer nnweb-buffer)
 	    (erase-buffer)
-	    (prog1
-		(url-insert-file-contents url)
-	      (copy-to-buffer buf (point-min) (point-max)))))
+	    (url-insert-file-contents url)
+	    (copy-to-buffer buf (point-min) (point-max))
+	    t))
       (nnweb-url-retrieve-asynch
        url 'nnweb-callback (current-buffer) nnheader-callback-function)
       t)))
@@ -562,35 +562,34 @@
       (set-marker body nil))))
 
 (defun nnweb-reference-search (search)
-  (prog1
-      (url-insert-file-contents
-       (concat
-	(nnweb-definition 'address)
-	"?"
-	(nnweb-encode-www-form-urlencoded
-	 `(("search" . "advanced")
-	   ("querytext" . ,search)
-	   ("subj" . "")
-	   ("name" . "")
-	   ("login" . "")
-	   ("host" . "")
-	   ("organization" . "")
-	   ("groups" . "")
-	   ("keywords" . "")
-	   ("choice" . "Search")
-	   ("startmonth" . "Jul")
-	   ("startday" . "25")
-	   ("startyear" . "1996")
-	   ("endmonth" . "Aug")
-	   ("endday" . "24")
-	   ("endyear" . "1996")
-	   ("mode" . "Quick")
-	   ("verbosity" . "Verbose")
-	   ("ranking" . "Relevance")
-	   ("first" . "1")
-	   ("last" . "25")
-	   ("score" . "50")))))
-    (setq buffer-file-name nil))
+  (url-insert-file-contents
+   (concat
+    (nnweb-definition 'address)
+    "?"
+    (nnweb-encode-www-form-urlencoded
+     `(("search" . "advanced")
+       ("querytext" . ,search)
+       ("subj" . "")
+       ("name" . "")
+       ("login" . "")
+       ("host" . "")
+       ("organization" . "")
+       ("groups" . "")
+       ("keywords" . "")
+       ("choice" . "Search")
+       ("startmonth" . "Jul")
+       ("startday" . "25")
+       ("startyear" . "1996")
+       ("endmonth" . "Aug")
+       ("endday" . "24")
+       ("endyear" . "1996")
+       ("mode" . "Quick")
+       ("verbosity" . "Verbose")
+       ("ranking" . "Relevance")
+       ("first" . "1")
+       ("last" . "25")
+       ("score" . "50")))))
+  (setq buffer-file-name nil)
   t)
 
 ;;;
@@ -668,21 +667,21 @@
     (nnweb-remove-markup)))
 
 (defun nnweb-altavista-search (search &optional part)
-  (prog1
-      (url-insert-file-contents
-       (concat
-	(nnweb-definition 'address)
-	"?"
-	(nnweb-encode-www-form-urlencoded
-	 `(("pg" . "aq")
-	   ("what" . "news")
-	   ,@(when part `(("stq" . ,(int-to-string (* part 30)))))
-	   ("fmt" . "d")
-	   ("q" . ,search)
-	   ("r" . "")
-	   ("d0" . "")
-	   ("d1" . "")))))
-    (setq buffer-file-name nil)))
+  (url-insert-file-contents
+   (concat
+    (nnweb-definition 'address)
+    "?"
+    (nnweb-encode-www-form-urlencoded
+     `(("pg" . "aq")
+       ("what" . "news")
+       ,@(when part `(("stq" . ,(int-to-string (* part 30)))))
+       ("fmt" . "d")
+       ("q" . ,search)
+       ("r" . "")
+       ("d0" . "")
+       ("d1" . "")))))
+  (setq buffer-file-name nil)
+  t)
 
 (provide 'nnweb)
 
--- a/lisp/mule/isearch-mule.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/mule/isearch-mule.el	Mon Aug 13 09:32:43 2007 +0200
@@ -49,6 +49,7 @@
 ;; #### This is far from working in XEmacs.
 
 (eval-when-compile (require 'quail))
+(eval-when-compile (require 'egg))
 
 
 ;;;###autoload
@@ -68,7 +69,18 @@
 (define-key isearch-mode-map "\C-\\" 'isearch-fep-egg)
 (define-key isearch-mode-map "\M-k"  'isearch-fep-egg)
 (define-key isearch-mode-map "\C-o"  'isearch-fep-canna)
-;;  (define-key isearch-mode-map "\C-\]" 'isearch-fep-quail)
+;(define-key isearch-mode-map "\C-\]" 'isearch-fep-quail)
+
+(put 'isearch-fep-string	'isearch-command t)
+(put 'isearch-fep-egg		'isearch-command t)
+(put 'isearch-fep-canna		'isearch-command t)
+(put 'isearch-fep-prompt-string	'isearch-command t)
+(put 'isearch-fep-prompt-egg	'isearch-command t)
+(put 'isearch-fep-prompt-canna	'isearch-comnand t)
+(put 'isearch-fep-read-string	'isearch-command t)
+(put 'isearch-fep-read-egg	'isearch-command t)
+(put 'isearch-fep-read-canna	'isearch-command t)
+;(put 'isearch-fep-quail		'isearch-command t)
 
 (defun isearch-fep-mode ()
   (let ((command this-command)
@@ -101,6 +113,7 @@
 		       (message "%s%s"
 				(isearch-message-prefix) isearch-message))
 		      (t
+		       (ding)
 		       (call-interactively current-command))))
 	    (setq isearch-fep-prompt nil)
 	    (message "%s%s" (isearch-message-prefix) isearch-message)))))))
@@ -153,7 +166,7 @@
 
 (defun isearch-fep-prompt-egg ()
   (if (featurep 'egg)
-      (format "[%s]" (map-indicator its:*current-map*))
+      (format "[%s]->" (map-indicator its:*current-map*))
     (setq isearch-fep-mode nil)
     (message "No EGG!! ")
     (sit-for 1)
@@ -180,11 +193,12 @@
 		(egg:*input-mode* t)
 		(egg:*mode-on* t)
 		(self-insert-after-hook 'isearch-exit-minibuffer-egg))
-	    (setq unread-command-events (listify-key-sequence first-str))
+	    (setq unread-command-events (mil-listify-key-sequence first-str))
 	    (unwind-protect
 		(read-from-minibuffer (isearch-message))
 	      (setq egg:henkan-mode-in-use nil)
-	      (setq disable-undo nil)))))
+	      ;;(setq disable-undo nil)
+	      ))))
     ""))
 
 
@@ -218,7 +232,7 @@
 	      (canna:*japanese-mode-in-minibuffer* t)
 	      (canna:*fence-mode* nil)
 	      (self-insert-after-hook 'isearch-exit-minibuffer-canna))
-	  (setq unread-command-events (listify-key-sequence first-str))
+	  (setq unread-command-events (mil-listify-key-sequence first-str))
 	  (unwind-protect
 	      (read-from-minibuffer (isearch-message))
 	    ;XEmacs change:
@@ -250,7 +264,7 @@
     (setq unread-command-events
 	  (nconc unread-command-events
 		 (cons (character-to-event ?\\)
-		       (listify-key-sequence first-str)))
+		       (mil-listify-key-sequence first-str)))
     (unwind-protect
 	(read-from-minibuffer
 	 (concat isearch-fep-prompt (isearch-message)))
--- a/lisp/mule/mule-files.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/mule/mule-files.el	Mon Aug 13 09:32:43 2007 +0200
@@ -63,7 +63,7 @@
   'buffer-file-coding-system-for-read)
 
 (defvar buffer-file-coding-system-alist
-  '(("\\.\\(el\\|emacs\\|info\\|texi\\)$" . iso-2022-8)
+  '(("\\.\\(el\\|emacs\\|info\\(-[0-9]+\\)?\\|texi\\)$" . iso-2022-8)
     ("\\(ChangeLog\\|CHANGES-beta\\)$" . iso-2022-8)
     ("\\.\\(gz\\|Z\\)$" . no-conversion)
     ("/spool/mail/.*$" . convert-mbox-coding-system))
--- a/lisp/mule/mule-misc.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/mule/mule-misc.el	Mon Aug 13 09:32:43 2007 +0200
@@ -266,9 +266,9 @@
     (if (not (null func))
 	(funcall func)))
   (setq current-language-environment env)
-  (if (fboundp 'egg)
+  (if (featurep 'egg)
       (egg-lang-switch-callback))
-;;  (if (fboundp 'quail)
+;;  (if (featurep 'quail)
 ;;      (quail-lang-switch-callback))
 )
 
--- a/lisp/prim/about.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/prim/about.el	Mon Aug 13 09:32:43 2007 +0200
@@ -80,7 +80,7 @@
   (view-mode nil 'kill-buffer)		;; assume the new view-less
   (let* ((buffer-read-only nil)
          (emacs-short-version (concat emacs-major-version "." emacs-minor-version))
-         (emacs-about-version (format "version %s; April 1997" emacs-short-version))
+         (emacs-about-version (format "version %s; May 1997" emacs-short-version))
 	 (indent-tabs-mode t)
 	 )
     (erase-buffer)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/prim/featurep.el	Mon Aug 13 09:32:43 2007 +0200
@@ -0,0 +1,65 @@
+;;; featurep.el --- Support functions for reader conditionals
+
+;; Copyright 1997 Naggum Software
+
+;; Author: Erik Naggum <erik@naggum.no>
+;; Keywords: internal
+
+;; This file is not (yet) part of GNU Emacs, but distributed under the
+;; same conditions as GNU Emacs, and is useless without 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., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; The #+ and #- reader macros require support code to work properly until
+;; `featurep' is enhanced in the C code.  This support code is written in
+;; Lisp to make it easier to experiment with the code.
+
+;;; Code:
+
+(eval-when-compile (require 'cl))
+
+(provide (if (string-match "XEmacs" emacs-version) 'xemacs 'emacs))
+
+(defvar featurep-emacs-version nil
+  "The version number of this Emacs, as a floating-point number.")
+
+(defun featurep (fexp)
+  "Return non-nil if feature expression FEXP is true."
+  (typecase fexp
+    (symbol (memq fexp features))       ;original definition
+    (number (>= (or featurep-emacs-version
+                    (setq featurep-emacs-version
+                      (+ emacs-major-version
+                         (/ emacs-minor-version 100.0))))
+                fexp))
+    (list (case (pop fexp)
+            (not (let ((negate (pop fexp)))
+                   (if fexp
+                     (signal 'invalid-read-syntax (list fexp))
+                     (not (featurep negate)))))
+            (and (while (and fexp (featurep (car fexp)))
+                   (pop fexp))
+                 (null fexp))
+            (or (while (and fexp (not (featurep (car fexp))))
+                  (pop fexp))
+                fexp)
+            (t (signal 'invalid-read-syntax (list fexp)))))
+    (t (signal 'invalid-read-syntax (list fexp)))))
+
+;;; featurep.el ends here
+
--- a/lisp/prim/keydefs.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/prim/keydefs.el	Mon Aug 13 09:32:43 2007 +0200
@@ -369,12 +369,11 @@
 
 (define-key global-map "\M-\C-l" 'switch-to-other-buffer)
 
-;; Default binding of "Backspace" is the same as delete.
+;; Default binding of "Backspace" is no longer the same as delete.
 ;; Default binding of "Control-h" is help.
-(define-key global-map 'backspace '[delete])
-(define-key global-map '(meta backspace) '[(meta delete)])
-(define-key global-map '(control backspace) '[(control delete)])
-(define-key global-map '(control meta backspace) '[(control meta delete)])
+(define-key global-map 'backspace "\C-?")
+(define-key global-map '(meta backspace) "\e\C-?")
+
 
 (define-key global-map "\M-\C-z" 'activate-region)
 
--- a/lisp/prim/loadup.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/prim/loadup.el	Mon Aug 13 09:32:43 2007 +0200
@@ -78,6 +78,7 @@
      (load-gc "replace") 		; match-string used in version.el.
      (load-gc "version.el")		; Ignore compiled-by-mistake version.elc
      (load-gc "cl")
+     (load-gc "featurep")
      (load-gc "widget")
      (load-gc "custom") ; Before the world so everything can be customized
      (load-gc "cus-start") ; for customization of builtin variables
--- a/lisp/prim/sound.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/prim/sound.el	Mon Aug 13 09:32:43 2007 +0200
@@ -130,8 +130,8 @@
 nVolume (0 for default): ")
   (unless (symbolp sound-name)
     (error "sound-name not a symbol"))
-  (unless (null volume)
-    (integerp volume) (error "volume not an integer or nil"))
+  (unless (or (null volume) (integerp volume))
+    (error "volume not an integer or nil"))
   (let (buf
 	data
 	(file (locate-file filename  default-sound-directory-list  sound-ext)))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/utils/delbs.el	Mon Aug 13 09:32:43 2007 +0200
@@ -0,0 +1,58 @@
+;;; delbs.el --- a small lisp package to allow you to swap around DEL/BS keys
+
+;; Copyright (C) 1997 Gary Foster
+
+;; Author: Gary Foster <Gary.Foster@corp.sun.com>
+;; Keywords: lisp, terminals
+
+;; This file is part of XEmacs.
+
+;; XEmacs 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.
+
+;; XEmacs 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 XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: not in FSF.
+
+;;; Commentary:
+
+;;   This package should, *theoretically*, serve to quieten the DEL/BS rwars
+;;     a little.  By using this package, you can have DEL and BS both do the
+;;     same function (normally delete one char to the left) or you can have
+;;     then bound separately (DEL --> delete-char, BS --> delete-backward-char)
+;;     with all appropriate Meta bindings in each mode.
+;;
+;; Author: Gary Foster <Gary.Foster@corp.sun.com>
+;; Credits due to: Per Abrahamsen <abraham@dina.kvl.dk>
+
+;;; Code:
+
+(defun delbs-enable-delete-forward ()
+  "Set up the delete key to delete forward, and backspace to delete backward."
+  (interactive)
+  (define-key key-translation-map [backspace] "\C-?")
+  (define-key key-translation-map [delete] "\C-d")
+  (define-key key-translation-map [(meta backspace)] "\M-\C-?")
+  (define-key key-translation-map [(meta delete)] "\M-d"))
+  
+(defun delbs-disable-delete-forward ()
+  "Return the DEL/BS key mappings to the XEmacs default"
+  (interactive)
+  (define-key key-translation-map [backspace] [backspace])
+  (define-key key-translation-map [delete] [delete])
+  (define-key key-translation-map [(meta backspace)] [(meta backspace)])
+  (define-key key-translation-map [(meta delete)] [(meta delete)]))
+
+(provide 'delbs)
+
+;;; delbs.el ends here
--- a/lisp/utils/finder-inf.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/utils/finder-inf.el	Mon Aug 13 09:32:43 2007 +0200
@@ -574,10 +574,6 @@
         "alternate summary mode interfaces for Gnus"
         nil
         "lisp/gnus/")
-    ("gnus-score.el"
-        "scoring code for Gnus"
-        (news)
-        "lisp/gnus/")
     ("gnus-setup.el"
         "Initialization & Setup for Gnus 5"
         (news)
@@ -1602,6 +1598,10 @@
         "Lisp interface to the C \"face\" structure"
         (faces internal)
         "lisp/prim/")
+    ("featurep.el"
+        "Support functions for reader conditionals"
+        (internal)
+        "lisp/prim/")
     ("files-nomule.el"
         "file I/O stubs when not under Mule."
         nil
@@ -2198,6 +2198,10 @@
         "rebind backspace and delete to be correct"
         (terminals)
         "lisp/utils/")
+    ("delbs.el"
+        "a small lisp package to allow you to swap around DEL/BS keys"
+        (lisp  terminals)
+        "lisp/utils/")
     ("derived.el"
         "allow inheritance of major modes."
         nil
@@ -2266,6 +2270,10 @@
         "highlighting message headers."
         (mail  news)
         "lisp/utils/")
+    ("lib-complete.el"
+        "Completion on the lisp search path"
+        (lisp  extensions)
+        "lisp/utils/")
     ("live-icon.el"
         "make frame icons represent the current frame contents"
         nil
@@ -2406,6 +2414,14 @@
         "Cascading Style Sheet parser"
         nil
         "lisp/w3/")
+    ("devices.el"
+        "XEmacs device API emulation"
+        nil
+        "lisp/w3/")
+    ("dsssl-flow.el"
+        "DSSSL flow objects"
+        nil
+        "lisp/w3/")
     ("dsssl.el"
         "DSSSL parser"
         nil
@@ -2566,6 +2582,10 @@
         "Printing support for emacs-w3"
         (faces  help  printing  hypermedia)
         "lisp/w3/")
+    ("w3-props.el"
+        "Additional text property stuff"
+        (faces)
+        "lisp/w3/")
     ("w3-script.el"
         "Scripting support"
         (hypermedia  scripting)
--- a/lisp/version.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/version.el	Mon Aug 13 09:32:43 2007 +0200
@@ -25,7 +25,7 @@
 (defconst emacs-version "20.2"
   "Version numbers of this version of Emacs.")
 
-(setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid (beta3)")))
+(setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid (beta4)")))
 
 (defconst emacs-major-version
   (progn (or (string-match "^[0-9]+" emacs-version)
@@ -61,7 +61,10 @@
 	  "XEmacs %s [Lucid] (%s%s) of %s %s on %s"
 	  (substring emacs-version 0 (string-match " XEmacs" emacs-version))
 	  system-configuration
-	  (cond ((featurep 'mule) ", Mule") (t ""))
+	  (cond ((or (and (fboundp 'featurep)
+			  (featurep 'mule))
+		     (memq 'mule features)) ", Mule")
+		(t ""))
 	  (substring emacs-build-time 0
 		     (string-match " *[0-9]*:" emacs-build-time))
 	  (substring emacs-build-time
--- a/lisp/vm/vm-autoload.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/vm/vm-autoload.el	Mon Aug 13 09:32:43 2007 +0200
@@ -2209,7 +2209,7 @@
 
 (autoload (quote vm-mode) "vm-startup" "Major mode for reading mail.
 
-This is VM 6.29.
+This is VM 6.30.
 
 Commands:
    h - summarize folder contents
--- a/lisp/vm/vm-digest.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/vm/vm-digest.el	Mon Aug 13 09:32:43 2007 +0200
@@ -433,19 +433,22 @@
 						    nil t))))))
 		   (setq prev-sep (point)
 			 after-prev-sep (point))
-		 ;; eat preceding newlines
-		 (while (= (preceding-char) ?\n)
-		   (delete-char -1))
-		 ;; put one back
-		 (insert ?\n)
-		 ;; delete the digest separator
-		 ;; insert a trailing message separator
-		 ;; insert the leading separator
+		 ;; if this isn't the first message, delete the
+		 ;; digest separator goop and insert a trailing message
+		 ;; separator of the proper type.
 		 (if prev-sep
 		     (progn
+		       ;; eat preceding newlines
+		       (while (= (preceding-char) ?\n)
+			 (delete-char -1))
+		       ;; put one back
+		       (insert ?\n)
+		       ;; delete the digest separator
 		       (delete-region (match-beginning 0) (point))
+		       ;; insert a trailing message separator
 		       (insert (vm-trailing-message-separator folder-type))))
 		 (setq prev-sep (point))
+		 ;; insert the leading separator
 		 (insert (vm-leading-message-separator folder-type))
 		 (setq after-prev-sep (point))
 		 ;; eat trailing newlines
--- a/lisp/vm/vm-folder.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/vm/vm-folder.el	Mon Aug 13 09:32:43 2007 +0200
@@ -508,7 +508,7 @@
 		  (set-buffer temp-buffer)
 		  (if (file-readable-p file)
 		      (condition-case nil
-			  (let ((overriding-file-coding-system 'binary))
+			  (let ((coding-system-for-read 'binary))
 			    (insert-file-contents file nil 0 4096))
 			(wrong-number-of-arguments
 			 (call-process "sed" file temp-buffer nil
@@ -2618,7 +2618,7 @@
 	     ;; enable-local-variables == nil disables them for newer Emacses
 	     (let ((inhibit-local-variables t)
 		   (enable-local-variables nil)
-		   (overriding-file-coding-system 'no-conversion))
+		   (coding-system-for-read 'no-conversion))
 	       (find-file-noselect crash-box)))
        (save-excursion
 	 (set-buffer crash-buf)
@@ -2949,7 +2949,7 @@
 	     (vm-save-restriction
 	      (widen)
 	      (goto-char (point-max))
-	      (let ((overriding-file-coding-system 'binary))
+	      (let ((coding-system-for-read 'binary))
 		(insert-file-contents folder))))
 	   (setq mcount (length vm-message-list))
 	   (if (vm-assimilate-new-messages)
--- a/lisp/vm/vm-mime.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/vm/vm-mime.el	Mon Aug 13 09:32:43 2007 +0200
@@ -825,7 +825,7 @@
 	     (make-local-variable 'scroll-in-place)
 	     (setq scroll-in-place nil)
 	     (and vm-xemacs-mule-p
-		  (set-file-coding-system 'binary t))
+		  (set-buffer-file-coding-system 'binary t))
 	     (cond (vm-fsfemacs-19-p
 		    ;; need to do this outside the let because
 		    ;; loading disp-table initializes
@@ -859,6 +859,8 @@
 	(set-buffer b)
 	(widen)
 	(let ((buffer-read-only nil)
+	      ;; disable read-only text properties
+	      (inhibit-read-only t)
 	      (modified (buffer-modified-p)))
 	  (unwind-protect
 	      (progn
@@ -890,7 +892,7 @@
 (fset 'vm-presentation-mode 'vm-mode)
 (put 'vm-presentation-mode 'mode-class 'special)
 
-(defvar file-coding-system)
+(defvar buffer-file-coding-system)
 
 (defun vm-determine-proper-charset (beg end)
   (save-excursion
@@ -904,8 +906,9 @@
 		     "us-ascii")
 		    ((cdr charsets)
 		     (or (car (cdr
-			       (assoc (coding-system-name file-coding-system)
-				      vm-mime-mule-coding-to-charset-alist)))
+			       (assq (coding-system-name
+				      buffer-file-coding-system)
+				     vm-mime-mule-coding-to-charset-alist)))
 			 "iso-2022-jp"))
 		    (t
 		     (or (car (cdr
@@ -1341,15 +1344,15 @@
 	     (vm-mime-transfer-decode-region layout start end)
 	     (setq tempfile (vm-make-tempfile-name))
 	     (let ((buffer-file-type buffer-file-type)
-		   file-coding-system)
+		   buffer-file-coding-system)
 	       ;; Tell DOS/Windows NT whether the file is binary
 	       (setq buffer-file-type (not (vm-mime-text-type-p layout)))
 	       ;; Tell XEmacs/MULE not to mess with the bits unless
 	       ;; this is a text type.
 	       (if vm-xemacs-mule-p
 		   (if (vm-mime-text-type-p layout)
-		       (set-file-coding-system 'no-conversion nil)
-		     (set-file-coding-system 'binary t)))
+		       (set-buffer-file-coding-system 'no-conversion nil)
+		     (set-buffer-file-coding-system 'binary t)))
 	       (write-region start end tempfile nil 0))
 	     (delete-region start end)
 	     (save-excursion
@@ -1532,7 +1535,13 @@
 
 (defun vm-mime-display-internal-message/rfc822 (layout)
   (if (vectorp layout)
-      (vm-mime-display-internal-text/plain layout)
+      (let ((start (point)))
+	(vm-mime-insert-mime-headers layout)
+	(insert ?\n)
+	(save-restriction
+	  (narrow-to-region start (point))
+	  (vm-decode-mime-encoded-words))
+	(vm-mime-display-internal-multipart/mixed layout))
     (goto-char (vm-extent-start-position layout))
     (setq layout (vm-extent-property layout 'vm-mime-layout))
     (set-buffer (generate-new-buffer
@@ -1931,8 +1940,8 @@
 	    ;; this is a text type.
 	    (if vm-xemacs-mule-p
 		(if (vm-mime-text-type-p layout)
-		    (set-file-coding-system 'no-conversion nil)
-		  (set-file-coding-system 'binary t)))
+		    (set-buffer-file-coding-system 'no-conversion nil)
+		  (set-buffer-file-coding-system 'binary t)))
 	    (vm-mime-insert-mime-body layout)
 	    (vm-mime-transfer-decode-region layout (point-min) (point-max))
 	    (or (not (file-exists-p file))
@@ -2458,6 +2467,8 @@
 	 (error "don't know how to MIME encode composition for %s"
 		(emacs-version)))))
 
+(defvar enriched-mode)
+
 (defun vm-mime-xemacs-encode-composition ()
   (save-restriction
     (widen)
@@ -2468,6 +2479,7 @@
     (let ((8bit nil)
 	  (just-one nil)
 	  (boundary-positions nil)
+	  (enriched (and (boundp 'enriched-mode) enriched-mode))
 	  already-mimed layout e e-list boundary
 	  type encoding charset params description disposition object
 	  opoint-min)
@@ -2495,8 +2507,15 @@
       (if (null e-list)
 	  (progn
 	    (narrow-to-region (point) (point-max))
+	    ;; support enriched-mode for text/enriched composition
+	    (if enriched
+		(let ((enriched-initial-annotation ""))
+		  (enriched-encode (point-min) (point-max))))
 	    (setq charset (vm-determine-proper-charset (point-min)
 						       (point-max)))
+	    (if vm-xemacs-mule-p
+		(encode-coding-region (point-min) (point-max)
+				      buffer-file-coding-system))
 	    (setq encoding (vm-determine-proper-content-transfer-encoding
 			    (point-min)
 			    (point-max))
@@ -2510,7 +2529,9 @@
 	    (vm-reorder-message-headers
 	     nil nil "\\(Content-Type:\\|Content-Transfer-Encoding\\|MIME-Version:\\)")
 	    (insert "MIME-Version: 1.0\n")
-	    (insert "Content-Type: text/plain; charset=" charset "\n")
+	    (if enriched
+		(insert "Content-Type: text/enriched; charset=" charset "\n")
+	      (insert "Content-Type: text/plain; charset=" charset "\n"))
 	    (insert "Content-Transfer-Encoding: " encoding "\n")
 	    (vm-add-mail-mode-header-separator))
 	(while e-list
@@ -2518,8 +2539,14 @@
 	  (if (or just-one (= (point) (extent-start-position e)))
 	      nil
 	    (narrow-to-region (point) (extent-start-position e))
+	    (if enriched
+		(let ((enriched-initial-annotation ""))
+		  (enriched-encode (point-min) (point-max))))
 	    (setq charset (vm-determine-proper-charset (point-min)
 						       (point-max)))
+	    (if vm-xemacs-mule-p
+		(encode-coding-region (point-min) (point-max)
+				      buffer-file-coding-system))
 	    (setq encoding (vm-determine-proper-content-transfer-encoding
 			    (point-min)
 			    (point-max))
@@ -2528,7 +2555,9 @@
 							   (point-max)
 							   t))
 	    (setq boundary-positions (cons (point-marker) boundary-positions))
-	    (insert "Content-Type: text/plain; charset=" charset "\n")
+	    (if enriched
+		(insert "Content-Type: text/enriched; charset=" charset "\n")
+	      (insert "Content-Type: text/plain; charset=" charset "\n"))
 	    (insert "Content-Transfer-Encoding: " encoding "\n\n")
 	    (widen))
 	  (goto-char (extent-start-position e))
@@ -2538,11 +2567,11 @@
 	  (cond ((bufferp object)
 		 (insert-buffer-substring object))
 		((stringp object)
-		 (let ((overriding-file-coding-system 'no-conversion)
-		       ;; don't let file-coding-system be changed
+		 (let ((coding-system-for-read 'no-conversion)
+		       ;; don't let buffer-file-coding-system be changed
 		       ;; by insert-file-contents-literally.  The
 		       ;; value we bind to it to here isn't important.
-		       (file-coding-system 'no-conversion))
+		       (buffer-file-coding-system 'no-conversion))
 		   (insert-file-contents-literally object))))
 	  ;; gather information about the object from the extent.
 	  (if (setq already-mimed (extent-property e 'vm-mime-encoded))
@@ -2652,8 +2681,14 @@
 	;; extent, if any.
 	(if (or just-one (= (point) (point-max)))
 	    nil
+	  (if enriched
+	      (let ((enriched-initial-annotation ""))
+		(enriched-encode (point) (point-max))))
 	  (setq charset (vm-determine-proper-charset (point)
 						     (point-max)))
+	  (if vm-xemacs-mule-p
+	      (encode-coding-region (point) (point-max)
+				    buffer-file-coding-system))
 	  (setq encoding (vm-determine-proper-content-transfer-encoding
 			  (point)
 			  (point-max))
@@ -2663,7 +2698,9 @@
 							 t))
 	  (setq 8bit (or 8bit (equal encoding "8bit")))
 	  (setq boundary-positions (cons (point-marker) boundary-positions))
-	  (insert "Content-Type: text/plain; charset=" charset "\n")
+	  (if enriched
+	      (insert "Content-Type: text/enriched; charset=" charset "\n")
+	    (insert "Content-Type: text/plain; charset=" charset "\n"))
 	  (insert "Content-Transfer-Encoding: " encoding "\n\n")
 	  (goto-char (point-max)))
 	(setq boundary (vm-mime-make-multipart-boundary))
@@ -2742,6 +2779,7 @@
     (let ((8bit nil)
 	  (just-one nil)
 	  (boundary-positions nil)
+	  (enriched (and (boundp 'enriched-mode) enriched-mode))
 	  already-mimed layout o o-list boundary
 	  type encoding charset params description disposition object
 	  opoint-min)
@@ -2769,6 +2807,10 @@
       (if (null o-list)
 	  (progn
 	    (narrow-to-region (point) (point-max))
+	    ;; support enriched-mode for text/enriched composition
+	    (if enriched
+		(let ((enriched-initial-annotation ""))
+		  (enriched-encode (point-min) (point-max))))
 	    (setq charset (vm-determine-proper-charset (point-min)
 						       (point-max)))
 	    (setq encoding (vm-determine-proper-content-transfer-encoding
@@ -2784,7 +2826,9 @@
 	    (vm-reorder-message-headers
 	     nil nil "\\(Content-Type:\\|Content-Transfer-Encoding\\|MIME-Version:\\)")
 	    (insert "MIME-Version: 1.0\n")
-	    (insert "Content-Type: text/plain; charset=" charset "\n")
+	    (if enriched
+		(insert "Content-Type: text/enriched; charset=" charset "\n")
+	      (insert "Content-Type: text/plain; charset=" charset "\n"))
 	    (insert "Content-Transfer-Encoding: " encoding "\n")
 	    (vm-add-mail-mode-header-separator))
 	(while o-list
@@ -2792,6 +2836,21 @@
 	  (if (or just-one (= (point) (overlay-start o)))
 	      nil
 	    (narrow-to-region (point) (overlay-start o))
+	    ;; support enriched-mode for text/enriched composition
+	    (if enriched
+		(let ((enriched-initial-annotation ""))
+		  (save-excursion
+		    ;; insert/delete trick needed to avoid
+		    ;; enriched-mode tags from seeping into the
+		    ;; attachment overlays.  I really wish
+		    ;; front-advance / rear-aadvance overlay
+		    ;; endpoint properties actually worked.
+		    (goto-char (point-max))
+		    (insert-before-markers "\n")
+		    (enriched-encode (point-min) (1- (point)))
+		    (goto-char (point-max))
+		    (delete-char -1)
+		    '(goto-char (point-min)))))
 	    (setq charset (vm-determine-proper-charset (point-min)
 						       (point-max)))
 	    (setq encoding (vm-determine-proper-content-transfer-encoding
@@ -2802,7 +2861,9 @@
 							   (point-max)
 							   t))
 	    (setq boundary-positions (cons (point-marker) boundary-positions))
-	    (insert "Content-Type: text/plain; charset=" charset "\n")
+	    (if enriched
+		(insert "Content-Type: text/enriched; charset=" charset "\n")
+	      (insert "Content-Type: text/plain; charset=" charset "\n"))
 	    (insert "Content-Transfer-Encoding: " encoding "\n\n")
 	    (widen))
 	  (goto-char (overlay-start o))
@@ -2935,6 +2996,10 @@
 	;; extent, if any.
 	(if (or just-one (= (point) (point-max)))
 	    nil
+	  ;; support enriched-mode for text/enriched composition
+	  (if enriched
+	      (let ((enriched-initial-annotation ""))
+		(enriched-encode (point) (point-max))))
 	  (setq charset (vm-determine-proper-charset (point)
 						     (point-max)))
 	  (setq encoding (vm-determine-proper-content-transfer-encoding
@@ -2946,7 +3011,9 @@
 							 t))
 	  (setq 8bit (or 8bit (equal encoding "8bit")))
 	  (setq boundary-positions (cons (point-marker) boundary-positions))
-	  (insert "Content-Type: text/plain; charset=" charset "\n")
+	  (if enriched
+	      (insert "Content-Type: text/enriched; charset=" charset "\n")
+	    (insert "Content-Type: text/plain; charset=" charset "\n"))
 	  (insert "Content-Transfer-Encoding: " encoding "\n\n")
 	  (goto-char (point-max)))
 	(setq boundary (vm-mime-make-multipart-boundary))
--- a/lisp/vm/vm-misc.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/vm/vm-misc.el	Mon Aug 13 09:32:43 2007 +0200
@@ -440,11 +440,11 @@
   (vm-multiple-frames-possible-p))
 
 (defun vm-menu-support-possible-p ()
-  (or (and (boundp 'window-system)
-	   (or (eq window-system 'x)
-	       (eq window-system 'ns)      ;; NextStep
-	       (eq window-system 'win32)))
-      (and (fboundp 'device-type) (eq (device-type) 'x))))
+  (cond (vm-xemacs-p
+	 (featurep 'menubar))
+	(vm-fsfemacs-19-p
+	 (fboundp 'menu-bar-mode))
+	(t nil)))
 
 (defun vm-toolbar-support-possible-p ()
   (and vm-xemacs-p
--- a/lisp/vm/vm-mouse.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/vm/vm-mouse.el	Mon Aug 13 09:32:43 2007 +0200
@@ -222,7 +222,7 @@
 	       ;; one, whatever that is.
 	       (setq buffer-file-type nil)
 	       (and vm-xemacs-mule-p
-		    (set-file-coding-system 'no-conversion nil))
+		    (set-buffer-file-coding-system 'no-conversion nil))
 	       (write-region (point-min) (point-max)
 			     (concat "/tmp/Mosaic." pid)
 			     nil 0)
--- a/lisp/vm/vm-pop.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/vm/vm-pop.el	Mon Aug 13 09:32:43 2007 +0200
@@ -192,7 +192,7 @@
 		(get-buffer-create (format "trace of POP session to %s" host)))
 	  ;; Tell XEmacs/MULE not to mess with the text.
 	  (and vm-xemacs-mule-p
-	       (set-file-coding-system 'binary t))
+	       (set-buffer-file-coding-system 'binary t))
 	  ;; clear the trace buffer of old output
 	  (save-excursion
 	    (set-buffer process-buffer)
--- a/lisp/vm/vm-reply.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/vm/vm-reply.el	Mon Aug 13 09:32:43 2007 +0200
@@ -438,19 +438,19 @@
       (let ((this-command this-command))
 	(save-excursion
 	  (mail-send))))
+    ;; be careful, something could have killed the composition
+    ;; buffer inside mail-send.
+    (if (eq (current-buffer) composition-buffer)
+	(progn
+	  (vm-rename-current-mail-buffer)
+	  (vm-keep-mail-buffer (current-buffer))))
     (cond ((eq vm-system-state 'replying)
 	   (vm-mail-mark-replied))
 	  ((eq vm-system-state 'forwarding)
 	   (vm-mail-mark-forwarded))
 	  ((eq vm-system-state 'redistributing)
 	   (vm-mail-mark-redistributed)))
-    (vm-display nil nil '(vm-mail-send) '(vm-mail-send))
-    ;; be careful, something could have killed the composition
-    ;; buffer inside mail-send.
-    (if (eq (current-buffer) composition-buffer)
-	(progn
-	  (vm-rename-current-mail-buffer)
-	  (vm-keep-mail-buffer (current-buffer))))))
+    (vm-display nil nil '(vm-mail-send) '(vm-mail-send))))
 
 (defun vm-mail-mode-get-header-contents (header-name-regexp)
   (let ((contents nil)
--- a/lisp/vm/vm-startup.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/vm/vm-startup.el	Mon Aug 13 09:32:43 2007 +0200
@@ -63,7 +63,7 @@
 			    (inhibit-local-variables t)
 			    (enable-local-variables nil)
 			    ;; for XEmacs/Mule
-			    (overriding-file-coding-system 'no-conversion))
+			    (coding-system-for-read 'no-conversion))
 			(message "Reading %s..." file)
 			(prog1 (find-file-noselect file)
 			  ;; update folder history
@@ -80,25 +80,25 @@
       ;; the file coding system and decoding it.
       ;; This is only possible if a file is visited and then vm-mode
       ;; is run on it afterwards.
-      (defvar file-coding-system)
+      (defvar buffer-file-coding-system)
       (if (and vm-xemacs-mule-p
-	       (not (eq (get-coding-system file-coding-system)
+	       (not (eq (get-coding-system buffer-file-coding-system)
 			(get-coding-system 'no-conversion-unix)))
-	       (not (eq (get-coding-system file-coding-system)
+	       (not (eq (get-coding-system buffer-file-coding-system)
 			(get-coding-system 'no-conversion-dos)))
-	       (not (eq (get-coding-system file-coding-system)
+	       (not (eq (get-coding-system buffer-file-coding-system)
 			(get-coding-system 'no-conversion-mac)))
-	       (not (eq (get-coding-system file-coding-system)
+	       (not (eq (get-coding-system buffer-file-coding-system)
 			(get-coding-system 'binary))))
 	  (let ((buffer-read-only nil)
 		(omodified (buffer-modified-p)))
 	    (unwind-protect
 		(progn
 		  (encode-coding-region (point-min) (point-max)
-					file-coding-system)
-		  (set-file-coding-system 'no-conversion nil)
+					buffer-file-coding-system)
+		  (set-buffer-file-coding-system 'no-conversion nil)
 		  (decode-coding-region (point-min) (point-max)
-					file-coding-system))
+					buffer-file-coding-system))
 	      (set-buffer-modified-p omodified))))
       (vm-check-for-killed-summary)
       (vm-check-for-killed-presentation)
@@ -276,7 +276,7 @@
 (defun vm-mode (&optional read-only)
   "Major mode for reading mail.
 
-This is VM 6.29.
+This is VM 6.30.
 
 Commands:
    h - summarize folder contents
--- a/lisp/vm/vm-thread.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/vm/vm-thread.el	Mon Aug 13 09:32:43 2007 +0200
@@ -42,13 +42,14 @@
 	;; no need to schedule reindents of reparented messages
 	;; unless there were already messages present.
 	(schedule-reindents message-list)
-	parent parent-sym id id-sym date refs old-parent-sym)
+	m parent parent-sym id id-sym date refs old-parent-sym)
     (while mp
-      (setq parent (vm-th-parent (car mp))
-	    id (vm-su-message-id (car mp))
+      (setq m (car mp)
+	    parent (vm-th-parent m)
+	    id (vm-su-message-id m)
 	    id-sym (intern id vm-thread-obarray)
-	    date (vm-so-sortable-datestring (car mp)))
-      (put id-sym 'messages (cons (car mp) (get id-sym 'messages)))
+	    date (vm-so-sortable-datestring m))
+      (put id-sym 'messages (cons m (get id-sym 'messages)))
       (if (and (null (cdr (get id-sym 'messages)))
 	       schedule-reindents)
 	  (vm-thread-mark-for-summary-update (get id-sym 'children)))
@@ -65,7 +66,7 @@
 			(let ((kids (get old-parent-sym 'children))
 			      (msgs (get id-sym 'messages)))
 			  (while msgs
-			    (setq kids (delq (car msgs) kids)
+			    (setq kids (delq m kids)
 				  msgs (cdr msgs)))
 			  kids ))
 		   (set id-sym parent-sym)
@@ -73,13 +74,13 @@
 		       (vm-thread-mark-for-summary-update
 			(get id-sym 'messages)))))
 	    (put parent-sym 'children
-		 (cons (car mp) (get parent-sym 'children))))
+		 (cons m (get parent-sym 'children))))
 	(if (not (boundp id-sym))
 	    (set id-sym nil)))
       ;; use the references header to set parenting information
       ;; for ancestors of this message.  This does not override
       ;; a parent pointer for a message if it already exists.
-      (if (cdr (setq refs (vm-th-references (car mp))))
+      (if (cdr (setq refs (vm-th-references m)))
 	  (let (parent-sym id-sym msgs)
 	    (setq parent-sym (intern (car refs) vm-thread-obarray)
 		  refs (cdr refs))
@@ -99,17 +100,17 @@
 	  ;; inhibit-quit because we need to make sure the asets
 	  ;; below are an atomic group.
 	  (let* ((inhibit-quit t)
-		 (subject (vm-so-sortable-subject (car mp)))
+		 (subject (vm-so-sortable-subject m))
 		 (subject-sym (intern subject vm-thread-subject-obarray)))
 	    ;; if this subject never seen before create the
 	    ;; information vector.
 	    (if (not (boundp subject-sym))
 		(set subject-sym
-		     (vector id-sym (vm-so-sortable-datestring (car mp))
-			     nil (list (car mp))))
+		     (vector id-sym (vm-so-sortable-datestring m)
+			     nil (list m)))
 	      ;; this subject seen before 
 	      (aset (symbol-value subject-sym) 3
-		    (cons (car mp) (aref (symbol-value subject-sym) 3)))
+		    (cons m (aref (symbol-value subject-sym) 3)))
 	      (if (string< date (aref (symbol-value subject-sym) 1))
 		  (let* ((vect (symbol-value subject-sym))
 			 (i-sym (aref vect 0)))
@@ -139,8 +140,7 @@
 		;; using the parent information.
 		(if (null parent)
 		    (aset (symbol-value subject-sym) 2
-			  (cons (car mp)
-				(aref (symbol-value subject-sym) 2))))))))
+			  (cons m (aref (symbol-value subject-sym) 2))))))))
       (setq mp (cdr mp) n (1+ n))
       (if (zerop (% n modulus))
 	  (message "Building threads... %d" n)))
@@ -148,19 +148,20 @@
 	(message "Building threads... done"))))
 
 (defun vm-thread-mark-for-summary-update (message-list)
-  (while message-list
-    ;; if thread-list is null then we've already marked this
-    ;; message, or it doesn't need marking.
-    (if (null (vm-thread-list-of (car message-list)))
-	nil
-      (vm-mark-for-summary-update (car message-list) t)
-      (vm-set-thread-list-of (car message-list) nil)
-      (vm-set-thread-indentation-of (car message-list) nil)
-      (vm-thread-mark-for-summary-update
-       (get (intern (vm-su-message-id (car message-list))
-		    vm-thread-obarray)
-	    'children)))
-    (setq message-list (cdr message-list))))
+  (let (m)
+    (while message-list
+      (setq m (car message-list))
+      ;; if thread-list is null then we've already marked this
+      ;; message, or it doesn't need marking.
+      (if (null (vm-thread-list-of m))
+	  nil
+	(vm-mark-for-summary-update m t)
+	(vm-set-thread-list-of m nil)
+	(vm-set-thread-indentation-of m nil)
+	(vm-thread-mark-for-summary-update
+	 (get (intern (vm-su-message-id m) vm-thread-obarray)
+	      'children)))
+      (setq message-list (cdr message-list)))))
 
 (defun vm-thread-list (message)
   (let ((done nil)
@@ -211,27 +212,28 @@
 (defun vm-unthread-message (message &optional message-changing)
   (save-excursion
     (let ((mp (cons message (vm-virtual-messages-of message)))
-	  id-sym subject-sym vect p-sym)
+	  m id-sym subject-sym vect p-sym)
       (while mp
+	(setq m (car mp))
 	(let ((inhibit-quit t))
-	  (vm-set-thread-list-of (car mp) nil)
-	  (vm-set-thread-indentation-of (car mp) nil)
-	  (set-buffer (vm-buffer-of (car mp)))
-	  (setq id-sym (intern (vm-su-message-id (car mp)) vm-thread-obarray)
-		subject-sym (intern (vm-so-sortable-subject (car mp))
+	  (vm-set-thread-list-of m nil)
+	  (vm-set-thread-indentation-of m nil)
+	  (set-buffer (vm-buffer-of m))
+	  (setq id-sym (intern (vm-su-message-id m) vm-thread-obarray)
+		subject-sym (intern (vm-so-sortable-subject m)
 				    vm-thread-subject-obarray))
 	  (if (boundp id-sym)
 	      (progn
-		(put id-sym 'messages (delq (car mp) (get id-sym 'messages)))
+		(put id-sym 'messages (delq m (get id-sym 'messages)))
 		(vm-thread-mark-for-summary-update (get id-sym 'children))
 		(setq p-sym (symbol-value id-sym))
 		(and p-sym (put p-sym 'children
-				(delq (car mp) (get p-sym 'children))))
+				(delq m (get p-sym 'children))))
 		(if message-changing
 		    (set id-sym nil))))
 	  (if (and (boundp subject-sym) (setq vect (symbol-value subject-sym)))
 	      (if (not (eq id-sym (aref vect 0)))
-		  (aset vect 2 (delq (car mp) (aref vect 2)))
+		  (aset vect 2 (delq m (aref vect 2)))
 		(if message-changing
 		    (if (null (cdr (aref vect 3)))
 			(makunbound subject-sym)
@@ -243,7 +245,7 @@
 			(while p
 			  (if (and (string-lessp (vm-so-sortable-datestring (car p))
 						 oldest-date)
-				   (not (eq (car mp) (car p))))
+				   (not (eq m (car p))))
 			      (setq oldest-msg (car p)
 				    oldest-date (vm-so-sortable-datestring (car p))))
 			  (setq p (cdr p)))
@@ -252,7 +254,7 @@
 			(aset vect 1 oldest-date)
 			(setq children (delq oldest-msg (aref vect 2)))
 			(aset vect 2 children)
-			(aset vect 3 (delq (car mp) (aref vect 3)))
+			(aset vect 3 (delq m (aref vect 3)))
 			;; I'm not sure there aren't situations
 			;; where this might loop forever.
 			(let ((inhibit-quit nil))
--- a/lisp/vm/vm-vars.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/vm/vm-vars.el	Mon Aug 13 09:32:43 2007 +0200
@@ -454,9 +454,9 @@
 Note that some types are processed specially, and this variable does not
 apply to them.
 
-   multipart/digest, message/news and message/rfc822 messages are
-   always displayed as a button to avoid automatically visiting a
-   new folder while you are moving around in the current folder.
+   multipart/digest messages are always displayed as a button to
+   avoid automatically visiting a new folder while you are moving
+   around in the current folder.
 
    message/partial messages are always displayed as a button,
    because there always needs to be a way to trigger the assembly
--- a/lisp/vm/vm-version.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/vm/vm-version.el	Mon Aug 13 09:32:43 2007 +0200
@@ -2,7 +2,7 @@
 
 (provide 'vm-version)
 
-(defconst vm-version "6.29"
+(defconst vm-version "6.30"
   "Version number of VM.")
 
 (defun vm-version ()
--- a/lisp/vm/vm-window.el	Mon Aug 13 09:31:48 2007 +0200
+++ b/lisp/vm/vm-window.el	Mon Aug 13 09:32:43 2007 +0200
@@ -134,7 +134,7 @@
 	    (set-buffer (setq work-buffer (get-buffer-create "*vm-wconfig*")))
 	    ;; for XEmacs/MULE
 	    (and vm-xemacs-mule-p
-		 (set-file-coding-system 'no-conversion))
+		 (set-buffer-file-coding-system 'no-conversion))
 	    (erase-buffer)
 	    (print vm-window-configurations (current-buffer))
 	    (write-region (point-min) (point-max) file nil 0))
--- a/man/ChangeLog	Mon Aug 13 09:31:48 2007 +0200
+++ b/man/ChangeLog	Mon Aug 13 09:32:43 2007 +0200
@@ -1,3 +1,7 @@
+Wed Apr 30 18:13:16 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* lispref/lispref.texi: Correct release dates.
+
 Sat Apr 19 20:48:00 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* lispref/files.texi (File Name Expansion): Update documentation
--- a/man/gnus.texi	Mon Aug 13 09:31:48 2007 +0200
+++ b/man/gnus.texi	Mon Aug 13 09:32:43 2007 +0200
@@ -1,7 +1,7 @@
 \input texinfo                  @c -*-texinfo-*-
 
 @setfilename gnus
-@settitle Gnus 5.4.46 Manual
+@settitle Gnus 5.4.50 Manual
 @synindex fn cp
 @synindex vr cp
 @synindex pg cp
@@ -287,7 +287,7 @@
 @tex
 
 @titlepage
-@title Gnus 5.4.46 Manual
+@title Gnus 5.4.50 Manual
 
 @author by Lars Magne Ingebrigtsen
 @page
@@ -323,7 +323,7 @@
 spool or your mbox file.  All at the same time, if you want to push your
 luck.
 
-This manual corresponds to Gnus 5.4.46.
+This manual corresponds to Gnus 5.4.50.
 
 @end ifinfo
 
@@ -8453,20 +8453,58 @@
 server.
 
 @findex nntp-open-rlogin
+@findex nntp-open-telnet
 @findex nntp-open-network-stream
 @item nntp-open-connection-function
 @vindex nntp-open-connection-function
-This function is used to connect to the remote system.  Two pre-made
+This function is used to connect to the remote system.  Three pre-made
 functions are @code{nntp-open-network-stream}, which is the default, and
 simply connects to some port or other on the remote system.  The other
-is @code{nntp-open-rlogin}, which does an rlogin on the remote system,
-and then does a telnet to the @sc{nntp} server available there.
+two are @code{nntp-open-rlogin}, which does an @samp{rlogin} on the
+remote system, and then does a @samp{telnet} to the @sc{nntp} server
+available there, and @code{nntp-open-telnet}, which does a @samp{telnet}
+to the remote system and then another @samp{telnet} to get to the
+@sc{nntp} server.
+
+@code{nntp-open-rlogin}-related variables:
+
+@table @code
 
 @item nntp-rlogin-parameters
 @vindex nntp-rlogin-parameters
-If you use @code{nntp-open-rlogin} as the
-@code{nntp-open-connection-function}, this list will be used as the
-parameter list given to @code{rsh}.
+This list will be used as the parameter list given to @code{rsh}.
+
+@item nntp-rlogin-user-name
+@vindex nntp-rlogin-user-name
+User name on the remote system.
+
+@end table
+
+@code{nntp-open-telnet}-related variables:
+
+@table @code
+@item nntp-telnet-command
+@vindex nntp-telnet-command
+Command used to start @samp{telnet}.
+
+@item nntp-telnet-switches
+@vindex nntp-telnet-switches
+List of strings to be used as the switches to the telnet command.
+
+@item nntp-telnet-user-name
+@vindex nntp-telnet-user-name
+User name to log in on the remote system as.
+
+@item nntp-telnet-passwd
+@vindex nntp-telnet-passwd
+Password to use when logging in.
+
+@item nntp-telnet-parameters
+@vindex nntp-telnet-parameters
+A list of strings that will be executed as a command after logging in
+via telnet.
+
+@end table
 
 @item nntp-end-of-line
 @vindex nntp-end-of-line
@@ -10971,7 +11009,8 @@
  (eval (ding)))
 @end lisp
 
-This example demonstrates absolutely everything about a score file. 
+This example demonstrates most score file elements.  For a different
+approach, see @pxref{Advanced Scoring}.
 
 Even though this looks much like lisp code, nothing here is actually
 @code{eval}ed.  The lisp reader is used to read this form, though, so it
@@ -13114,6 +13153,11 @@
 
 @end table
 
+Using NoCeM could potentially be a memory hog.  If you have many living
+(i. e., subscribed or unsubscribed groups), your Emacs process will grow
+big.  If this is a problem, you should kill off all (or most) of your
+unsubscribed groups (@pxref{Subscription Commands}).
+
 
 @node Picons
 @section Picons
@@ -14028,6 +14072,7 @@
 Luc Van Eycken,
 Sam Falkner,
 Paul Franklin, 
+Arne Georg Gleditsch,
 David S. Goldberg,
 D. Hall, 
 Magnus Hammerin,
@@ -14035,6 +14080,7 @@
 Hisashige Kenji, @c Hisashige
 Marc Horowitz,
 Gunnar Horrigmo,
+Brad Howes,
 François Felix Ingrand,
 Ishikawa Ichiro, @c Ishikawa
 Lee Iverson, 
@@ -14096,6 +14142,7 @@
 Teddy,
 Chuck Thompson,
 Philippe Troin,
+Aaron M. Ucko,
 Jan Vroonhof,
 Barry A. Warsaw,
 Christoph Wedler,
--- a/man/lispref/lispref.texi	Mon Aug 13 09:31:48 2007 +0200
+++ b/man/lispref/lispref.texi	Mon Aug 13 09:32:43 2007 +0200
@@ -15,7 +15,7 @@
 GNU Emacs Lisp Reference Manual v2.4, June 1995
 XEmacs Lisp Programmer's Manual (for 19.13) Third Edition, July 1995
 XEmacs Lisp Reference Manual (for 19.14 and 20.0) v3.1, March 1996
-XEmacs Lisp Reference Manual (for 19.15 and 20.1) v3.2, April 1997
+XEmacs Lisp Reference Manual (for 19.15 and 20.1, 20.2) v3.2, April, May 1997
 @c Please REMEMBER to update edition number in *four* places in this file
 @c                 and also in *one* place in intro.texi
 
@@ -75,7 +75,7 @@
 @c and also in the file intro.texi.
 @c This manual documents XEmacs 19.14 and 20.0 and was based on the
 @c documentation for FSF Emacs 19.29 (v2.4).
-@subtitle Version 3.2 (for XEmacs 19.15 and 20.1), April 1997
+@subtitle Version 3.2 (for XEmacs 19.15 and 20.1, 20.2), April, May 1997
 
 @author by Ben Wing
 @author
@@ -89,8 +89,8 @@
 Copyright @copyright{} 1995, 1996 Ben Wing.
 @sp 2
 Version 3.2 @*
-Revised for XEmacs Versions 19.15 and 20.1,@*
-April, 1997.@*
+Revised for XEmacs Versions 19.15 and 20.1, 20.2,@*
+April, May 1997.@*
 
 Permission is granted to make and distribute verbatim copies of this
 manual provided the copyright notice and this permission notice are
--- a/man/message.texi	Mon Aug 13 09:31:48 2007 +0200
+++ b/man/message.texi	Mon Aug 13 09:32:43 2007 +0200
@@ -1,7 +1,7 @@
 \input texinfo                  @c -*-texinfo-*-
 
 @setfilename message
-@settitle Message 5.4.46 Manual
+@settitle Message 5.4.50 Manual
 @synindex fn cp
 @synindex vr cp
 @synindex pg cp
@@ -39,7 +39,7 @@
 @tex
 
 @titlepage
-@title Message 5.4.46 Manual
+@title Message 5.4.50 Manual
 
 @author by Lars Magne Ingebrigtsen
 @page
@@ -79,7 +79,7 @@
 * Key Index::         List of Message mode keys.
 @end menu
 
-This manual corresponds to Message 5.4.46.  Message is distributed with
+This manual corresponds to Message 5.4.50.  Message is distributed with
 the Gnus distribution bearing the same version number as this manual
 has. 
 
--- a/src/ChangeLog	Mon Aug 13 09:31:48 2007 +0200
+++ b/src/ChangeLog	Mon Aug 13 09:32:43 2007 +0200
@@ -1,3 +1,24 @@
+Thu May  1 18:59:20 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* glyphs-x.c (Fmake_subwindow): Update error message.
+
+Wed Apr 30 18:07:18 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* lread.c: New variable featurep.
+	(read1): Add processing for #- and #+.
+	(read_list_conser): Handle case where a feature test has removed a 
+	portion of the input stream.
+	(vars_of_lread): New feature `xemacs'.
+
+	* fns.c (Ffeaturep): Remove function when using #-, #+ feature
+	reader syntax.
+
+	* Makefile.in.in (lisp): Put features.elc in the dump list.
+
+Thu May  1 05:24:25 1997  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* buffer.c (Fmake_indirect_buffer): Don't pretend it's there.
+
 Fri Apr 25 10:53:07 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* glyphs-x.c: libpng already includes setjmp.h, so don't attempt
--- a/src/Makefile.in.in	Mon Aug 13 09:31:48 2007 +0200
+++ b/src/Makefile.in.in	Mon Aug 13 09:32:43 2007 +0200
@@ -1199,7 +1199,7 @@
     here because we do not want things to appear to be out-of-date just 
     because the version number has been incremented. -- D.N.G. 8/28/93]
  */
-lisp=   ${lispdir}paths.el \
+lisp=   ${lispdir}paths.el ${lispdir}prim/featurep.elc \
 	${lispdir}prim/loaddefs.elc ${lispdir}prim/auto-autoloads.elc \
         ${lispdir}prim/loadup.el ${lispdir}prim/subr.elc \
         ${lispdir}prim/cmdloop.elc CMDLOOP_LISP \
--- a/src/buffer.c	Mon Aug 13 09:31:48 2007 +0200
+++ b/src/buffer.c	Mon Aug 13 09:32:43 2007 +0200
@@ -648,6 +648,7 @@
   return finish_init_buffer (b, name);
 }
 
+#if 0 /* #### implement this!  Need various changes in insdel.c */
 DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, 2, 2,
        "bMake indirect buffer (to buffer): \nBName of indirect buffer: ", /*
 Create and return an indirect buffer for buffer BASE, named NAME.
@@ -659,10 +660,6 @@
 */
        (base_buffer, name))
 {
-  error ("make-indirect-buffer not yet implemented, oops");
-  return Qnil;
-
-#if 0 /* #### implement this!  Need various changes in insdel.c */
   Lisp_Object buf;
   REGISTER struct buffer *b;
 
@@ -699,8 +696,8 @@
   init_buffer_text (b, 1);
 
   return finish_init_buffer (b, name);
+}
 #endif /* 0 */
-}
 
 
 static void
@@ -1917,7 +1914,9 @@
   DEFSUBR (Fget_buffer);
   DEFSUBR (Fget_file_buffer);
   DEFSUBR (Fget_buffer_create);
+#if 0
   DEFSUBR (Fmake_indirect_buffer);
+#endif
 
   DEFSUBR (Fgenerate_new_buffer_name);
   DEFSUBR (Fbuffer_name);
--- a/src/fns.c	Mon Aug 13 09:31:48 2007 +0200
+++ b/src/fns.c	Mon Aug 13 09:32:43 2007 +0200
@@ -45,6 +45,9 @@
 #include "frame.h"
 #include "systime.h"
 
+/* NOTE: This symbol is also used in lread.c */
+#define FEATUREP_SYNTAX
+
 Lisp_Object Qstring_lessp;
 Lisp_Object Qidentity;
 
@@ -3320,6 +3323,7 @@
 
 Lisp_Object Vfeatures;
 
+#ifndef FEATUREP_SYNTAX
 DEFUN ("featurep", Ffeaturep, 1, 1, 0, /*
 Return t if FEATURE is present in this Emacs.
 Use this to conditionalize execution of lisp code based on the
@@ -3332,6 +3336,7 @@
   CHECK_SYMBOL (feature);
   return NILP (Fmemq (feature, Vfeatures)) ? Qnil : Qt;
 }
+#endif
 
 DEFUN ("provide", Fprovide, 1, 1, 0, /*
 Announce that FEATURE is a feature of the current Emacs.
@@ -3467,7 +3472,9 @@
   DEFSUBR (Fmapc_internal);
   DEFSUBR (Fmapconcat);
   DEFSUBR (Fload_average);
+#ifndef FEATUREP_SYNTAX
   DEFSUBR (Ffeaturep);
+#endif
   DEFSUBR (Frequire);
   DEFSUBR (Fprovide);
 }
--- a/src/glyphs-x.c	Mon Aug 13 09:31:48 2007 +0200
+++ b/src/glyphs-x.c	Mon Aug 13 09:32:43 2007 +0200
@@ -3616,7 +3616,7 @@
   XSetWindowAttributes xswa;
   Mask valueMask = 0;
 
-  error ("subwindows are not functional in 19.14; they will be in 19.15");
+  error ("subwindows are not functional in 20.2; they may be again someday");
 
   f = decode_x_frame (frame);
 
--- a/src/lread.c	Mon Aug 13 09:31:48 2007 +0200
+++ b/src/lread.c	Mon Aug 13 09:32:43 2007 +0200
@@ -73,6 +73,13 @@
 
 int puke_on_fsf_keys;
 
+/* This symbol is also used in fns.c */
+#define FEATUREP_SYNTAX
+
+#ifdef FEATUREP_SYNTAX
+static Lisp_Object Qfeaturep;
+#endif
+
 /* non-zero if inside `load' */
 int load_in_progress;
 
@@ -2369,7 +2376,26 @@
 	      return Fsignal (Qinvalid_read_syntax,
 		    list1 (build_string ("Cannot read unreadable object")));
 	    }
-
+#ifdef FEATUREP_SYNTAX
+	  case '+':
+	  case '-':
+	    {
+	      Lisp_Object fexp, obj, tem;
+	      struct gcpro gcpro1, gcpro2;
+
+	      fexp = read0(readcharfun);
+	      obj = read0(readcharfun);
+
+	      /* the call to `featurep' may GC. */
+	      GCPRO2(fexp, obj);
+	      tem = call1(Qfeaturep, fexp);
+	      UNGCPRO;
+
+	      if (c == '+' && NILP(tem)) goto retry;
+	      if (c == '-' && !NILP(tem)) goto retry;
+	      return obj;
+	    }
+#endif
 	  default:
 	    {
 	      unreadchar (readcharfun, c);
@@ -2583,10 +2609,12 @@
 	return (state);
       else
 	unreadchar (readcharfun, ch);
+#ifdef FEATUREP_SYNTAX
       if (ch == ']')
 	syntax_error ("\"]\" in a list");
       else if (ch == ')')
 	syntax_error ("\")\" in a vector");
+#endif
       state = ((conser) (readcharfun, state, len));
     }
 }
@@ -2618,6 +2646,18 @@
       free_cons (XCONS (tem));
       tem = Qnil;
       ch = XCHAR (elt);
+#ifdef FEATUREP_SYNTAX
+      if (ch == s->terminator) /* deal with #+, #- reader macros */
+	{
+	  unreadchar (readcharfun, s->terminator);
+	  goto done;
+	}
+      else if (ch == ']')
+	syntax_error ("']' in a list");
+      else if (ch == ')')
+	syntax_error ("')' in a vector");
+      else
+#endif
       if (ch != '.')
 	signal_simple_error ("BUG! Internal reader error", elt);
       else if (!s->allow_dotted_lists)
@@ -3130,6 +3170,12 @@
   /* So that early-early stuff will work */
   Ffset (Qload, intern ("load-internal"));
 
+#ifdef FEATUREP_SYNTAX
+  Qfeaturep = intern("featurep");
+  staticpro(&Qfeaturep);
+  Fprovide(intern("xemacs"));
+#endif
+
 #ifdef LISP_BACKQUOTES
   old_backquote_flag = new_backquote_flag = 0;
 #endif