[mew-int 00904] Re: Is it possible to use fortune in signature with Mew?

Bastien Guerry baztien at example.com
Tue Jun 18 23:03:13 JST 2002


Le 18 Jun 2002, Arnaud Vandyck <arnaud.vandyck at example.com> a écrit: 

> I do not know how to use fortune with emacs (except M-x fortune), but
> is it possible that my signature add a fortune cookie automatically
> with Mew?

I use this to add a random fortune with "\C-c t" in draft mode.
I found this on the web (can't remember were: search "mew fortune") 

---

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; my-fortune
;;

(defun my-fortune ()
  "insert fortune program output"
   (interactive)
   (save-excursion
     (goto-char (point-max))
     (shell-command-on-region 
      (point) 
      (point-max) 
      "fortune" t))) ;; here is the shell-command with no args

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; my-mail-signature
;;

(defun my-mail-signature ()
   "insert ~/.signature and fortune at end."
   (interactive)
   (save-excursion
     (goto-char (point-max))
     (insert-file-contents  (expand-file-name  "~/.signature")) 
     (goto-char (point-max))
     (my-fortune)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; define binding for draft-mode
;;

(setq mew-draft-mode-hook
      '(lambda ()
       (define-key mew-draft-body-map "\C-ct" 'my-mail-signature)))

---

Hope this could help. 

--Bastien



More information about the Mew-int mailing list