emacs: Fix email/news quoting.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 16 Mar 2009 15:47:36 +0000 (15:47 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 16 Mar 2009 15:53:02 +0000 (15:53 +0000)
The Message mode's default quoting is `> ' except for blank and quoted
lines, which get `>'.  This is right for blank lines (avoids trailing
spaces), but is wrong for quoted lines.  So, hacketty hack, we fix it to
use `> ' for everything and trim off trailing spaces manually.

emacs

diff --git a/emacs b/emacs
index dcb561d..2d0aaff 100644 (file)
--- a/emacs
+++ b/emacs
 (setq sendmail-program "~/bin/sendmail-hack")
 
 (setq mail-user-agent 'message-user-agent)
-(setq message-signature-separator "^-- \\(\\|\\[mdw\\]\\)$")
+(setq message-signature-separator "^-- \\(\\|\\[mdw\\]\\)$"
+      message-yank-prefix "> "
+      message-yank-cited-prefix "> "
+      message-indent-citation-function '(message-indent-citation
+                                        mdw-trim-spaces-after-citing))
+
+(defun mdw-trim-spaces-after-citing ()
+  (save-excursion
+    (save-restriction
+      (narrow-to-region (point) (mark t))
+      (while (re-search-forward "^> +$" nil t)
+       (replace-match ">")))))
 
 (and (fboundp 'turn-on-gnus-dired-mode)
      (not mdw-fast-startup)