(message-remove-blank-cited-lines): New function.
authorReiner Steib <Reiner.Steib@gmx.de>
Fri, 26 Oct 2007 21:35:43 +0000 (21:35 +0000)
committerReiner Steib <Reiner.Steib@gmx.de>
Fri, 26 Oct 2007 21:35:43 +0000 (21:35 +0000)
Suggested by Karl Plästerer.

  From: sig...@12move.de (Karl Pflästerer)
  Subject: Kleine Arbeitserleichterung bei zitierten Leerzeilen
  Newsgroups: de.comm.software.gnus
  Date: Fri, 03 Jan 2003 18:21:55 +0100
  Message-ID: <m3adiiup8o.fsf@hamster.pflaesterer.de>

lisp/ChangeLog
lisp/message.el

index e3f97d9..6443809 100644 (file)
@@ -1,3 +1,8 @@
+2007-10-26  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * message.el (message-remove-blank-cited-lines): New function.
+       Suggested by Karl Pl\e,Ad\e(Bsterer.
+
 2007-10-25  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * hashcash.el (mail-add-payment): Replace mapcar called for effect with
index 53f628c..de8e075 100644 (file)
@@ -3518,6 +3518,27 @@ However, if `message-yank-prefix' is non-nil, insert that prefix on each line."
        (forward-line 1))))
   (goto-char start))
 
+(defun message-remove-blank-cited-lines (&optional remove)
+  "Remove cited lines containing only blanks.
+If REMOVE is non-nil, remove newlines, too.
+
+To use this automatically, you may add this function to
+`gnus-message-setup-hook'."
+  (interactive "P")
+  (let ((citexp
+        (concat
+         "^\\("
+         (if (boundp 'message-yank-cited-prefix)
+             (concat message-yank-cited-prefix "\\|"))
+         message-yank-prefix
+         "\\)+ *$"
+         (if remove "\n" ""))))
+    (gnus-message 8 "removing `%s'" citexp)
+    (save-excursion
+      (message-goto-body)
+      (while (re-search-forward citexp nil t)
+       (replace-match "")))))
+
 (defvar message-cite-reply-above nil
   "If non-nil, start own text above the quote.