home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / emacs / sources / 954 next >
Encoding:
Text File  |  1993-01-21  |  1.4 KB  |  54 lines

  1. Newsgroups: gnu.emacs.sources
  2. Path: sparky!uunet!Cadence.COM!daled
  3. From: daled@cadence.com (Dale DePriest)
  4. Subject: mail aliases
  5. Message-ID: <1993Jan20.195605.20847@Cadence.COM>
  6. Sender: usenet@Cadence.COM (Usenet News)
  7. Nntp-Posting-Host: cds9172.cadence.com
  8. Organization: Cadence Design Systems
  9. Distribution: gnu.emacs.sources
  10. Date: Wed, 20 Jan 1993 19:56:05 GMT
  11. Lines: 41
  12.  
  13. The routine permits you to see the expansion of the aliases at any time
  14. during the composition of your mail.  I have bound it to C-c C-a with
  15. the meaning alias expansion.  The aliases themselves are already supported
  16. from entires in .mailrc and send mail will already expand them as the mail
  17. is sent.  I only provided a hook to permit you to see them ahead of time.
  18.  
  19. ---Cut here-------------
  20. (setq mail-mode-hook '(lambda ()
  21.     (define-key mail-mode-map "\C-c\C-a" 'my-mail-aliases)))
  22.  
  23. (defun my-mail-aliases ()
  24. "Expand local mail aliases so user can view them."
  25.   (interactive)
  26. (if mail-aliases
  27.   (save-excursion
  28.   (goto-char (point-min))
  29.   (re-search-forward
  30.      (concat "^" (regexp-quote mail-header-separator) "\n"))
  31.      (replace-match "\n")
  32.      (backward-char 1)
  33.   (setq delimline (point-marker))
  34.   (expand-mail-aliases (point-min) delimline)
  35.   (goto-char delimline)
  36.   (insert mail-header-separator ""))))
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. --
  51.     _      _     Dale DePriest          San Jose, California
  52.    /`) _  //     daled@Cadence.COM        voice: (408) 428-5249
  53.  o/_/ (_(_X_(`     
  54.