XFaces add ons...

Mark Warren 415-506-4639 (mwarren@us.oracle.com)
Thu, 27 Jan 1994 10:12:42 -0800

At someone's suggestion, I hacked together these two bits of emacs
lisp code to automatically add an X-Face: header to both my email and
new postings. I'm not sure how widespread gnus and/or emacs mail tools
are used, but it probably wouldn't hurt to put something like this in
your X-Faces distribution. What does the faces list think?

;;
;; This will override the default behaviour of mail-signature whereby
;; the .signature file is added at the end of a mail message. Instead,
;; the signature will be added at point.
;;
(add-hook 'mail-setup-hook
'(lambda ()
(defun mail-signature (&optional here)
"Sign letter with contents of ~/.signature at point and add an
X-Face header. If optional argument HERE is given, do not insert the
X-Face: header as well."
(interactive "P")
(save-excursion
(insert-file-contents (expand-file-name "~/.signature"))
(if (not here) (face-adder))
))))

(defun face-adder ()
(save-excursion
(goto-char (point-min))
(search-forward mail-header-separator)
(beginning-of-line nil)
(insert "X-Face:")
(insert-file "~/.face")
(re-search-forward "RIPEM key on server")
(insert "
The X-Face header is my picture! Get `faces' from cs.indiana.edu")
))

(setq news-inews-hook
; Add my face image to the header of all news postings
'(lambda ()
(save-excursion
(goto-char (point-min))
(search-forward mail-header-separator)
(beginning-of-line nil)
(insert "X-Face:")
(insert-file "~/.face"))))