;ELC ;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:47:38 2003 ;;; from file /home/pot/gnu/emacs-pretest.new/lisp/mail/mailalias.el ;;; in Emacs version 21.3 ;;; with bytecomp version 2.85.4.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`mailalias.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\302\303\304\305\306\307%\207" [require sendmail custom-declare-group mailalias nil "Expanding mail aliases" :group mail] 6) #@58 *List of files from which to determine valid user names. (custom-declare-variable 'mail-passwd-files ''("/etc/passwd") '(#$ . -775) :type '(repeat string) :group 'mailalias) #@66 *Shell command to retrieve text to add to `/etc/passwd', or nil. (custom-declare-variable 'mail-passwd-command 'nil '(#$ . -955) :type '(choice string (const nil)) :group 'mailalias) #@85 Alist of mail address directory entries. When t this still needs to be initialized. (defvar mail-directory-names t (#$ . 1144)) (byte-code "\301B\302\301!\204\f\303\301\207" [current-load-list mail-address-field-regexp boundp "^\\(Resent-\\)?\\(To\\|From\\|CC\\|BCC\\|Reply-to\\):"] 2) #@240 *Alist of header field and expression to return alist for completion. The expression may reference the variable `pattern' which will hold the string being completed. If not on matching header, `mail-complete-function' gets called instead. (custom-declare-variable 'mail-complete-alist '(cons '("^\\(Resent-\\)?\\(To\\|From\\|CC\\|BCC\\|Reply-to\\):" mail-get-names pattern) '(("Newsgroups:" if (boundp 'gnus-active-hashtb) gnus-active-hashtb (if (boundp news-group-article-assoc) news-group-article-assoc)) ("Followup-To:" mail-sentto-newsgroups))) '(#$ . -1441) :type 'alist :group 'mailalias) (put 'mail-complete-alist 'risky-local-variable t) #@277 *Specifies how \[mail-complete] formats the full name when it completes. If `nil', they contain just the return address like: king@grassland.com If `parens', they look like: king@grassland.com (Elvis Parsley) If `angles', they look like: Elvis Parsley  (custom-declare-variable 'mail-complete-style ''angles '(#$ . -2094) :type '(choice (const angles) (const parens) (const nil)) :group 'mailalias) #@73 *Function to call when completing outside `mail-complete-alist'-header. (custom-declare-variable 'mail-complete-function ''ispell-complete-word '(#$ . -2522) :type '(choice function (const nil)) :group 'mailalias) #@102 *Function to get completions from directory service or `nil' for none. See `mail-directory-requery'. (custom-declare-variable 'mail-directory-function 'nil '(#$ . -2743) :type '(choice function (const nil)) :group 'mailalias) #@160 *When non-`nil' call `mail-directory-function' for each completion. In that case, one argument gets passed to the function, the partial string entered so far. (custom-declare-variable 'mail-directory-requery 'nil '(#$ . -2976) :type 'boolean :group 'mailalias) #@577 *Shell command to get the list of names from a mail directory. This value is used when the value of `mail-directory-function' is `mail-directory-process'. The value should be a list of the form (COMMAND ARG ...), where each of the list elements is evaluated. When `mail-directory-requery' is non-nil, during evaluation of these elements, the variable `pattern' contains the partial input being completed. The value might look like this: '(remote-shell-program "HOST" "-nl" "USER" "COMMAND") or like this: '(remote-shell-program "HOST" "-n" "COMMAND '^" pattern "'") (custom-declare-variable 'mail-directory-process 'nil '(#$ . -3244) :type 'sexp :group 'mailalias) (put 'mail-directory-process 'risky-local-variable t) #@66 *List of (HOST SERVICE) for stream connection to mail directory. (custom-declare-variable 'mail-directory-stream 'nil '(#$ . -3979) :type 'sexp :group 'mailalias) (put 'mail-directory-stream 'risky-local-variable t) #@283 *How to interpret the output of `mail-directory-function'. Three types of values are possible: - nil means to gather each line as one name - regexp means first \(grouping\) in successive matches is name - function called at beginning of buffer that returns an alist of names (custom-declare-variable 'mail-directory-parser 'nil '(#$ . -4202) :type '(choice (const nil) regexp function) :group 'mailalias) (put 'mail-directory-parser 'risky-local-variable t) #@246 Alist of local users, aliases and directory entries as available. Elements have the form (MAILNAME) or (MAILNAME . FULLNAME). If the value means t, it means the real value should be calculated for the next use. this is used in `mail-complete'. (defvar mail-names t (#$ . 4674)) #@66 Alist of local users. When t this still needs to be initialized. (defvar mail-local-names t (#$ . 4959)) #@326 Expand all mail aliases in suitable header fields found between BEG and END. If interactive, expand in header fields. Suitable header fields are `To', `From', `CC' and `BCC', `Reply-to', and their `Resent-' variants. Optional second arg EXCLUDE may be a regular expression defining text to be removed from alias expansions. (defalias 'expand-mail-aliases #[(beg end &optional exclude) "\306 \210\307=\203\310\311 \210\212 b\210\312 \n\310\223\310\307\313\f\n\307#)\203\314\310w\210`\310\211\211\211\211\313\315\n\316#\210\317 \210\320\310x\210\321 b\210`W\203` \203p @AZV\203p A\211\204]\313\322\307#\203\206\323\224`Z\202\217\324!\323\325\"\310 !\326! \"\204\371\326!\"A\211 \203\371!ZB Bb\210 c\210\"\203\350\327\"\330Q\321 #b\210\313#\n\307#\203\344\331\332!\210\202\324\nb\210*``Z\\|\210b\210\202b\210u\210*\202O\310\211\223\210.\202\n\310\211\223*\207" [mail-aliases beg end case-fold-search mail-address-field-regexp disabled-aliases sendmail-sync-aliases t nil build-mail-aliases make-marker re-search-forward " " "^[^ ]" move beginning-of-line " \n" point-marker "[ ]*[\n,][ ]*" 0 marker-position buffer-substring-no-properties assoc "\\b\\(" "\\)\\b" replace-match "" seplen epos pos end1 beg1 translation string exclude regexp] 7 (#$ . 5071) (save-excursion (list (goto-char (point-min)) (mail-header-end)))]) #@140 Read mail aliases from personal aliases file and set `mail-aliases'. By default, this is the file specified by `mail-personal-alias-file'. (defalias 'build-mail-aliases #[(&optional file) "\306\206 !\307\307p\310\216\311\312!\211q\210\203\251\313!\2031\212\313!q\210\314ed\")c\210\202Q\315!\203>\316!\210\202Q\315\317P\211!\203O\316!\210\202Q\307db\210h\320=\204]\321 \210eb\210m\204\201\307\210h\322U\203{\323\324!\210\323\325!\210\326c\210\202`\325u\210\202`eb\210\327\330\307\331#\203\243\327\332!\210\314\333\224\333\225\"\334 \210\335c\210\334 \210\202\307\211\204eb\210\327\336\307\331#\203\335\337\340!\341\307w\210`$\307%\307\210\314$`\"\211%\342\232\204\331\343 %\331#\210+\202\254\n+\207" [file mail-personal-alias-file mail-aliases obuf buffer name expand-file-name nil ((byte-code "\203\302!\210 q\207" [buffer obuf kill-buffer] 2)) generate-new-buffer " mailrc" get-file-buffer buffer-substring-no-properties file-exists-p insert-file-contents "~/" 10 newline 92 delete-char -1 1 32 re-search-forward "^source[ ]+" t "\\S-+" 0 beginning-of-line "# " "^\\(a\\|alias\\|g\\|group\\)[ ]+\\([^ \n]+\\)" match-string 2 " " "" define-mail-alias start value] 5 (#$ . 6507)]) #@360 Define NAME as a mail alias that translates to DEFINITION. This means that sending a message to NAME will actually send to DEFINITION. Normally, the addresses in DEFINITION must be separated by commas. If FROM-MAILRC-FILE is non-nil, then addresses in DEFINITION can be separated by spaces; an address can contain spaces if it is quoted with double-quotes. (defalias 'define-mail-alias #[(name definition &optional from-mailrc-file) "\204\306 \210 \307=\203\310\311\n!\203\312 \210\313\314 \"\203% \315\225\310O\313\316 \"\2032 \315\211\224O\310 \317\232?\205;\315 G\310\211\211\203\333\310\203\205 H\320=\203{\313\321 #T\205s\322\225\307)\202\214\313\323 #\202\214\313\324 #  O\315 ! \205\245\315\225U?\205\245\315\225\203\320\313\325! #\203\320\326\317\307\211!$!\203\311S\315\225 \202\254!B*\202J\327\330\237\331#\332\" \"\211\203\363\f \241\202\376\" B B\307\211#.\207" [from-mailrc-file mail-aliases mail-personal-alias-file definition tem end sendmail-sync-aliases t nil file-exists-p build-mail-aliases string-match "\\`[ \n,]+" 0 "[ \n,]+\\'" "" 34 "[^\\]\\(\\([\\][\\]\\)*\\)\"[ ,]*" 1 "[ ,]+" "[ \n,]*,[ \n,]*" "[\\]" replace-match mapconcat identity ", " assoc convert-backslash L start result found pos temp name mail-names] 7 (#$ . 7749) "sDefine mail alias: \nsDefine %s as mail alias for: "]) #@215 Perform completion on header field or word preceding point. Completable headers are according to `mail-complete-alist'. If none matches current header, calls `mail-complete-function' and passes prefix arg if any. (defalias 'mail-complete #[(arg) "\306 \210\307=\203\310\311 !\203\312 \210\n\313\314 W\203\340\212\315\316\310\307#\203C \203C\317 @@!\203< @A\310\211\202' A\211\204*\f)\203\340`\212\320\310x\210`)\211# {$\310%\321\f!\322$ \"\211%\307=\206\334%\204|\323\324$\"\210\325 \202\334$%\230\204\311# |\210\326%&\"\211'A\203\302(\327=\203\251%\330'A\331\261\202\305(\332=\203\274'A\333%\334\261\202\305%c\202\305%c)\202\334\323\335!\210\336\220\337\340$ \"!\221\210\323\341\342\",\202\344)\f!)\207" [mail-aliases mail-personal-alias-file mail-complete-alist list arg end sendmail-sync-aliases t nil file-exists-p build-mail-aliases 0 mail-header-end re-search-backward "^[^ ]" looking-at "^ <,:" eval try-completion message "Can't find completion for \"%s\"" ding assoc parens " (" ")" angles " <" ">" "Making completion list..." "*Completions*" display-completion-list all-completions "Making completion list...%s" "done" beg pattern completion mail-names alist-elt mail-complete-style mail-complete-function] 6 (#$ . 9171) "P"]) #@199 Fetch local users and global mail addresses for completion. Consults `/etc/passwd' and a directory service if one is set up via `mail-directory-function'. PATTERN is the string we want to complete. (defalias 'mail-get-names #[(pattern) "\306=\203[\212\307\310!q\210 \211\203\"\311\n@\312\211\211\306%\210\nA\211\204) \2031\313\f\312\306\312 &\210\314 \210\312m\204V\315\316!\203O\317\300\320\321!\322\323\320\324!!!B\"\210\325\324!\210\2026\326p!\210)\306=\204i\306=\203\270\312 \203\203\306=\203\203\327!\205\200\"!!\204\214\204\230\306=\203\267\330\331#:\205\245\332\333#\":\205\253\206\262#\334\")\207" [mail-local-names mail-passwd-files files mail-passwd-command shell-file-name shell-command-switch t generate-new-buffer " passwd" insert-file-contents nil call-process beginning-of-buffer looking-at "\\+?\\([^:@\n+]+\\):[^:\n]*:\\([^\n:]*\\):" add-to-list match-string 1 user-full-name string-to-int 2 beginning-of-line kill-buffer mail-directory sort append mapcar #[(a) "@C\207" [a] 1] #[(a b) "@\227 @\227\231\207" [a b] 2] mail-names mail-directory-names directory mail-directory-function mail-directory-requery pattern mail-aliases] 8 (#$ . 10473)]) #@142 Call directory to get names matching PATTERN or all if `nil'. Calls `mail-directory-function' and applies `mail-directory-parser' to output. (defalias 'mail-directory #[(pattern) "\212\304\305!\210\306\307!q\210 !\210\310b\210\311 ;\203)\312 \311\313#\203L\314\310!\nB\202 \2033 \202Lm\204L`\311y\210n\203D`S\202E`{\nB\2023\315p!\210\304\316!\210\n*\207" [mail-directory-function pattern directory mail-directory-parser message "Querying directory..." generate-new-buffer " *mail-directory*" 1 nil re-search-forward t match-string kill-buffer "Querying directory...done"] 4 (#$ . 11703)]) #@81 Run a shell command to output names in directory. See `mail-directory-process'. (defalias 'mail-directory-process #[(pattern) "\301\302\303@!\304\305\304\306\303A\"&\207" [mail-directory-process apply call-process eval nil t mapcar] 9 (#$ . 12314)]) #@76 Open a stream to retrieve names in directory. See `mail-directory-stream'. (defalias 'mail-directory-stream #[(pattern) "\302\303\304\305\306p $\307\"\210?\205\310\311!\210\202\f)\207" [mailalias-done mail-directory-stream nil set-process-sentinel apply open-network-stream "mailalias" #[(x x) "\301\211\207" [mailalias-done t] 2] sit-for 0.1] 6 (#$ . 12573)]) #@65 Return all entries from Newsgroups: header as completion alist. (defalias 'mail-sentto-newsgroups #[nil "\212\302\303\304\"\205&`\305\306\305x\307W\203$` {CB\310\305x\210`\202\f*)\207" [list point mail-position-on-field "newsgroups" t nil "^:, \n" 0 ", \n"] 3 (#$ . 12946)]) (provide 'mailalias)