home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / functions / my-mail-aliases.el < prev    next >
Encoding:
Text File  |  1993-02-01  |  1.5 KB  |  54 lines

  1. ; Path: hal.com!olivea!pagesat!netsys!ukma!psuvax1!atlantis.psu.edu!howland.reston.ans.net!paladin.american.edu!europa.asd.contel.com!uunet!Cadence.COM!daled
  2. ; From: daled@cadence.com (Dale DePriest)
  3. ; Newsgroups: gnu.emacs.sources
  4. ; Subject: mail aliases
  5. ; Date: 20 Jan 93 19:56:05 GMT
  6. ; Organization: Cadence Design Systems
  7. ; The routine permits you to see the expansion of the aliases at any time
  8. ; during the composition of your mail.  I have bound it to C-c C-a with
  9. ; the meaning alias expansion.  The aliases themselves are already supported
  10. ; is sent.  I only provided a hook to permit you to see them ahead of time.
  11. ; ---Cut here-------------
  12.  
  13. ;; LCD Archive Entry:
  14. ;; my-mail-aliases|Dale DePriest|daled@cadence.com|
  15. ;; Expand aliases in outgoung mail headers.|
  16. ;; 93-01-20||~/functions/my-mail-aliases.el.Z|
  17.  
  18. (setq mail-mode-hook '(lambda ()
  19.     (define-key mail-mode-map "\C-c\C-a" 'my-mail-aliases)))
  20.  
  21. (defun my-mail-aliases ()
  22. "Expand local mail aliases so user can view them."
  23.   (interactive)
  24. (if mail-aliases
  25.   (save-excursion
  26.   (goto-char (point-min))
  27.   (re-search-forward
  28.      (concat "^" (regexp-quote mail-header-separator) "\n"))
  29.      (replace-match "\n")
  30.      (backward-char 1)
  31.   (setq delimline (point-marker))
  32.   (expand-mail-aliases (point-min) delimline)
  33.   (goto-char delimline)
  34.   (insert mail-header-separator ""))))
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. --
  49.     _      _     Dale DePriest          San Jose, California
  50.    /`) _  //     daled@Cadence.COM        voice: (408) 428-5249
  51.  o/_/ (_(_X_(`     
  52.