Voder-Vocoder

The Log of Hal Canary

Navigation: Home | THE LOG | Log Archives | Resume | Contact Info | Public Key | SSL | Math Applets | Site Map | WP Backend | RSS2 | Atom

« | »

search and replace for elisp.

When mutt is told to gpg sign an email, it will use Quoted-Printable Content-Transfer-Encoding, which will replace " \n" with "=20\n", an escape sequence of some sort. (ASCII " " is 0x20.)

I'd rather replace " \n" with "\n" anyways. Here's some elisp code to do just that:

;; ~/.emacs ;;
(defun hal1 () (interactive)
  (auto-mega-replace  " \n" "\n"))
(defun auto-mega-replace (arg1 arg2)
  (save-excursion
    (beginning-of-buffer)
    (while (search-forward arg1)
      (beginning-of-buffer)
      (perform-replace arg1 arg2
        nil nil nil)
      (beginning-of-buffer))))

[edited 2003-02-20]

Hal Canary | Computers & Code | 2004-02-18 13:56:59 UTC
Permanent Link Comments Off | No Comments

Comments are closed.
Email me your comments — h3 at halcanary dot org.

Copyright 1997-2007 by Hal Canary.
mailto: h3 at halcanary dot org
xmpp:halcanary@jabber.org
aim:halwcanary
http://halcanary.org