;; dip.el ;; ;; Emacs-Lisp functions to help manage Diplomacy games. ;; ;; Usage: ;; - Set dip-address to the email address you use for communication ;; with the judges. ;; - Set dip-password to the judge password you use for your games. ;; - Set dip-game-alist to a list of your games. As set here, you ;; are France in game foo___ on judge USEF, and England in game ;; bar___ on judge USTR. ;; ;; M-x dip-mail prompts you for a game and starts composing a message ;; to the appropriate judge with everything already filled in. ;; ;; Version 1.0: First public release ;; Please send bug reports to dfan@dfan.org. (require 'message) ;;;; ;; ;; These three variables have to be set by the user! (defvar dip-address "me@my.domain" "The email address used for all judges.") (defvar dip-password "password" "The password used for all games.") (defvar dip-game-alist '(("foo___" . ("USEF" "F")) ("bar___" . ("USTR" "E"))) "An alist mapping game names to a list of information about that game. The list contains two elements: judge name, and power abbreviation.") ;; end of variables that the user must set ;; ;;;; (defvar dip-judge-alist '(("USEF" . "usef@diplom.org") ("CAMA" . "judge@cs.umanitoba.ca") ("USIN" . "judge@thekleimans.com") ("USTR" . "ustr@diplom.org") ("FROG" . "juge@frog.goa.com") ("DEAC" . "schieri@gmx.de") ("USBR" . "judge@braincells.com") ("SEPO" . "judge@astrogator.se") ("USCH" . "judge@chorn.com") ("USVG" . "usvg@thekleimans.com") ("DEDO" . "dedo@emilie.nef.wh.uni-dortmund.de") ("USBT" . "usbt@thekleimans.com") ("USAT" . "usat@thekleimans.com")) "An alist mapping judge names to email addresses.") (defvar dip-history-list nil "History list for minibuffer.") (defun dip-mail (&optional game) "Start composing a message about GAME to the appropriate Diplomacy judge." (interactive) (or game (setq game (completing-read "Send mail in game: " dip-game-alist nil t nil 'dip-history-list))) (message game) ;; Ensure game is in dip-game-list (let ((game-info (assoc game dip-game-alist))) (if (null game-info) (error "%s not in game list" game)) (message-mail (cdr (assoc (cadr game-info) dip-judge-alist)) game `((From . ,dip-address))) (insert "signon " (caddr game-info) game " " dip-password "\n\nsignoff\n") (forward-line -2)))