(gnus-summary-kill-thread): Allow universal prefix zero
[gnus] / lisp / flow-fill.el
index 7355dbd..e924605 100644 (file)
@@ -1,7 +1,7 @@
 ;;; flow-fill.el --- interpret RFC2646 "flowed" text
 
 ;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;;   2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <jas@pdc.kth.se>
 ;; Keywords: mail
@@ -98,16 +98,18 @@ RFC 2646 suggests 66 characters for readability."
       t)))
 
 ;;;###autoload
-(defun fill-flowed (&optional buffer)
+(defun fill-flowed (&optional buffer delete-space)
   (save-excursion
     (set-buffer (or (current-buffer) buffer))
     (goto-char (point-min))
     ;; Remove space stuffing.
-    (while (re-search-forward "^ " nil t)
+    (while (re-search-forward "^\\( \\|>+ $\\)" nil t)
       (delete-char -1)
       (forward-line 1))
     (goto-char (point-min))
     (while (re-search-forward " $" nil t)
+      (when delete-space
+       (delete-char -1))
       (when (save-excursion
              (beginning-of-line)
              (looking-at "^\\(>*\\)\\( ?\\)"))