Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!apple!oliveb!bbn!gateway!THEORY.LCS.MIT.EDU!bard From: bard@THEORY.LCS.MIT.EDU Newsgroups: comp.emacs Subject: Zippy hook Message-ID: <8907071644.AA01756@toucan.LCS.MIT.EDU> Date: 7 Jul 89 16:44:01 GMT Sender: news@bbn.COM Organization: BBN news/mail gateway Lines: 33 > > so, here it is: questions, et. al. to me: rodney@ipl.rpi.edu > > (defun add-zippyism () > (save-excursion > X-Zippy: .. My pants just went on a wild rampage through > a Long Island Bowling Alley!! > (search-forward "--tex") > (beginning-of-line) > (insert "X-Zippy: ") > (insert (yow)) > (insert "\n"))) > There's a problem with this code, as your attempt to mail it demonstrates: it may find the wrong "--tex" in the mail buffer. There's a mail function (mail-position-on-field "X-Zippy") which looks for and if necessary creates a mail field named X-Zippy. So here's an alternate version: (defun add-zippyism () (save-excursion (mail-position-on-field "X-Zippy") (insert (yow)))) (You could have found this out by looking at the code for sendmail.el -- probably in about the same place you found the mail-setup-hook variable. -- Bard the emacs gargoyle