fophillips dot orgJuly 30th, 2008Top-posting

Top posting is the bane of internet mailing lists, the horrors of which are made clear in this example:

A: Because it messes up the order in which people normally read text.

Q: Why is top-posting such a bad thing?

A: Top-posting.

Q: What is the most annoying thing in e-mail?

Luckily GNU Emacs provides tools to combat top-posting and other uglifications like badly wrapped lines in uglify.el packaged with the gnus email client.

I made a mutt.el emacs-lisp file with this in it (thanks to #emacs):

(defun deuglify ()
  "Deuglify messages in batch mode"
  (with-current-buffer
      (get-buffer-create "*Article*")
    (condition-case nil
        (while t
          (insert
           (read-string "") "\n"))
      (error))
    (gnus-outlook-deuglify-article t)
    (princ (buffer-string))
    )
  )

Which provides a function (deuglify) that will be invoked in Emacs’ batch mode, like so:

/usr/bin/emacs --batch --load ~/.emacs.d/elisp/mutt.el --eval '(deuglify)'

We can then use procmail which is used by a number of MTAs to create a recipe to pipe all of our messages through:

:0fbhw
| /usr/bin/emacs --batch --load ~/.emacs.d/elisp/mutt.el --eval '(deuglify)'

This will pipe the message headers and body into Emacs and output a pretty email into your inbox you have defined.

emacs, lisp, mutt

Comment
§

July 2008


June 2008


May 2008