;;
;; $Id: mail-abbrevs.el,v 1.25 1999/01/02 02:37:04 ejb Exp $
;; $Source: /home/ejb/elisp/q/RCS/mail-abbrevs.el,v $
;; $Author: ejb $
;;
;; Mail abbreviations
;;
;; All mail abbreviations start with _ to reduce likelihood of conflict with 
;; an actual email address.
;;

(defun q-define-mail-abbrev (&rest args)
  "short-hand for defining multiple mail abbreviations at once"
  (if (= (% (length args) 2) 1)
      (error "q-define-mail-abbrev called with odd number of arguments")
  )
  (while (not (null args))
    (let ((alias (car args))
	  (expansion (car (cdr args)))
	 )
      (setq args (cdr (cdr args)))
      (if (not (string-match "^_" alias))
	  (error (concat "q-define-mail-abbrev: "
			 alias " does not start with _"
		 )
	  )
      )
      (define-mail-abbrev alias expansion)
    )
  )
)

(defun q-mail-concat (&rest args)
  "concatenate addresses, separating by commas"
  (let ((result ""))
    (while args
      (if (not (equal result ""))
	  (setq result (concat result ", "))
      )
      (setq result (concat result (car args)))
      (setq args (cdr args))
    )
    result
  )
)

(let ((ace "apexace@ad1.vsnl.net.in")
      (aca "apexaca@ad1.vsnl.net.in")
     )
  (q-define-mail-abbrev
    
   ;; 
   ;; Personal 
   ;;
    
   "_l"
   "paradis@ql.org"
 
   "_lq"
   "paradis@ql.org"
 
   "_lpage"
   "lpage@ql.org"
 
   "_lw"
   "lisab@sprint.net"
 
   "_fg"
   "fgarcia@alum.mit.edu"
 
   "_hig"
   "vnbridges@juno.com"
 
   "_oatmeal"
   "elnoble@aol.com"
 
   "_pather"
   "dberkenb@capaccess.org"
 
   "_auntlaura"
   "lnobes@aol.com"
 
   "_emacsp"
   "emacs-pretest-bug@gnu.org"

   "_emacs"
   "gnu-emacs-bug@gnu.org"

   "_joel"
   "joel@mcquillan.com"

   "_dgreen"
   "dgreen@superliminal.com"

   "_dhatch"
   "hatch@hell.engr.sgi.com"

   ;;
   ;; Apex-related
   ;;
 
   "_ace"
   ace

   "_software"
   (q-mail-concat
    "ejb@apexinc.com"
    "ldd@apexinc.com"
    "aravind@apexinc.com"
    "cage@apexinc.com"
    "wyao@apexinc.com"
    "sajid@apexinc.com"
    "srini@apexinc.com"
    "shashi@apexinc.com"
   )

   ;; End of aliases
  )
)
