changeset 58060:4cbffc256922

Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-679 Merge from gnus--rel--5.10 Patches applied: * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-69 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-70 Update from CVS 2004-11-07 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/gnus-msg.el (gnus-configure-posting-styles): Don't cause the "Args out of range" error. Reported by Arnaud Giersch <arnaud.giersch@free.fr>.
author Miles Bader <miles@gnu.org>
date Tue, 09 Nov 2004 04:38:27 +0000
parents ede0c20bdb75
children 3f48c4fde605
files lisp/gnus/ChangeLog lisp/gnus/gnus-msg.el
diffstat 2 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Mon Nov 08 23:52:54 2004 +0000
+++ b/lisp/gnus/ChangeLog	Tue Nov 09 04:38:27 2004 +0000
@@ -1,3 +1,9 @@
+2004-11-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-msg.el (gnus-configure-posting-styles): Don't cause the
+	"Args out of range" error.  Reported by Arnaud Giersch
+	<arnaud.giersch@free.fr>.
+
 2004-11-04  Richard M. Stallman  <rms@gnu.org>
 
 	* spam.el (spam group): Add :version.
--- a/lisp/gnus/gnus-msg.el	Mon Nov 08 23:52:54 2004 +0000
+++ b/lisp/gnus/gnus-msg.el	Tue Nov 09 04:38:27 2004 +0000
@@ -1871,11 +1871,13 @@
 	    (when (and filep v)
 	      (setq v (with-temp-buffer
 			(insert-file-contents v)
-			(goto-char (point-max))
-			(skip-chars-backward "\n")
-			(delete-region (+ (point) (if (bolp) 0 1))
-				       (point-max))
-			(buffer-string))))
+			(buffer-substring
+			 (point-min)
+			 (progn
+			   (goto-char (point-max))
+			   (if (zerop (skip-chars-backward "\n"))
+			       (point)
+			     (1+ (point))))))))
 	    (setq results (delq (assoc element results) results))
 	    (push (cons element v) results))))
       ;; Now we have all the styles, so we insert them.