]> git.eshelyaron.com Git - emacs.git/commitdiff
(undigestify-rmail-message): Strip "^- " which is
authorRichard M. Stallman <rms@gnu.org>
Thu, 20 Apr 1995 02:31:16 +0000 (02:31 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 20 Apr 1995 02:31:16 +0000 (02:31 +0000)
added by some digest makers to the beginning of lines.

lisp/mail/undigest.el

index 78e555538903de1f5e87bb0a90de454ffa3bc05d..b80a5f4a48b5ad22d6dda9be92feaa60f2dc5bed 100644 (file)
@@ -99,9 +99,22 @@ Leaves original message, deleted, before the undigestified messages."
                                      (progn (search-forward "\n\n"
                                                             nil 'move)
                                             (point))))
-                 (if (mail-fetch-field "To") nil
+                 (if (mail-fetch-field "To")
+                     nil
                    (goto-char (point-min))
-                   (insert "To: " digest-name "\n"))))))
+                   (insert "To: " digest-name "\n")))
+               ;; Digestifiers may insert `- ' on lines that start with `-'.
+               ;; Undo that.
+               (save-excursion
+                 (goto-char (point-min))
+                 (if (re-search-forward
+                      "\n\n----------------------------*\n*"
+                      nil t)
+                     (let ((end (point-marker)))
+                       (goto-char (point-min))
+                       (while (re-search-forward "^- " end t)
+                         (delete-char -2)))))
+               )))
          (setq error nil)
          (message "Message successfully undigestified")
          (let ((n rmail-current-message))