One very nice emacs feature is its text formatting functions. Combining the Snow Leopard Automator Services with emacs' scripting capabilities, one can easily, from any application, refill a paragraph to lines of 70 characters and indent list items:
tmp=/tmp/emacsmail`date "+%s"`.txt cat /dev/stdin | tr '\r' '\n' > $tmp /usr/bin/emacs -batch $tmp \ -eval "(prefer-coding-system 'utf-8)" \ -eval '(setq paragraph-start "\\-\\|$" paragraph-separate "$")' \ -eval '(fill-region (point-min) (point-max) nil)' \ -eval '(untabify (point-min) (point-max))' \ -f save-buffer cat $tmp
Provided that Aquamacs is installed, one can also edit text interactively with this version of the service:
tmp=/tmp/emacsmail`date "+%s"`.txt cat /dev/stdin | tr '\r' '\n' > $tmp /Applications/Aquamacs\ Emacs.app/Contents/MacOS/Aquamacs\ Emacs \ -eval "(prefer-coding-system 'utf-8)" \ $tmp cat $tmpHitting Control-X Control-S Control-X Control-C will quit Aquamacs and pipe its buffer in place of the previously selected text.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20091012041837512