diff options
| author | Richard M. Stallman | 2005-03-26 02:13:35 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-03-26 02:13:35 +0000 |
| commit | f62504368a56b3170b623e2331a4cecd17dfe8c5 (patch) | |
| tree | fd2960cbf03f3313716d67389d01885767b6632b | |
| parent | c7c63bf77e070cf9d271ff1141eb47604da7b713 (diff) | |
| download | emacs-f62504368a56b3170b623e2331a4cecd17dfe8c5.tar.gz emacs-f62504368a56b3170b623e2331a4cecd17dfe8c5.zip | |
(mail-directory-process): Do nothing if mail-directory-process is an atom.
(mail-get-names): Ignore mail-directory-names if it is an atom.
(mail-directory-process defvar): Doc fix.
(mail-names): Doc fix.
| -rw-r--r-- | lisp/mail/mailalias.el | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el index 18f52e6434f..b520841db3d 100644 --- a/lisp/mail/mailalias.el +++ b/lisp/mail/mailalias.el | |||
| @@ -111,9 +111,10 @@ entered so far." | |||
| 111 | This value is used when the value of `mail-directory-function' | 111 | This value is used when the value of `mail-directory-function' |
| 112 | is `mail-directory-process'. The value should be a list | 112 | is `mail-directory-process'. The value should be a list |
| 113 | of the form (COMMAND ARG ...), where each of the list elements | 113 | of the form (COMMAND ARG ...), where each of the list elements |
| 114 | is evaluated. When `mail-directory-requery' is non-nil, during | 114 | is evaluated. COMMAND should evaluate to a string. When |
| 115 | evaluation of these elements, the variable `pattern' contains | 115 | `mail-directory-requery' is non-nil, during evaluation of these |
| 116 | the partial input being completed. | 116 | elements, the variable `pattern' contains the partial input being |
| 117 | completed. `pattern' is nil when `mail-directory-requery' is nil. | ||
| 117 | 118 | ||
| 118 | The value might look like this: | 119 | The value might look like this: |
| 119 | 120 | ||
| @@ -149,7 +150,7 @@ Three types of values are possible: | |||
| 149 | "Alist of local users, aliases and directory entries as available. | 150 | "Alist of local users, aliases and directory entries as available. |
| 150 | Elements have the form (MAILNAME) or (MAILNAME . FULLNAME). | 151 | Elements have the form (MAILNAME) or (MAILNAME . FULLNAME). |
| 151 | If the value means t, it means the real value should be calculated | 152 | If the value means t, it means the real value should be calculated |
| 152 | for the next use. this is used in `mail-complete'.") | 153 | for the next use. This is used in `mail-complete'.") |
| 153 | 154 | ||
| 154 | (defvar mail-local-names t | 155 | (defvar mail-local-names t |
| 155 | "Alist of local users. | 156 | "Alist of local users. |
| @@ -469,7 +470,9 @@ PATTERN is the string we want to complete." | |||
| 469 | mail-aliases)) | 470 | mail-aliases)) |
| 470 | (if (consp mail-local-names) | 471 | (if (consp mail-local-names) |
| 471 | mail-local-names) | 472 | mail-local-names) |
| 472 | (or directory mail-directory-names)) | 473 | (or directory |
| 474 | (when (consp mail-directory-names) | ||
| 475 | mail-directory-names))) | ||
| 473 | (lambda (a b) | 476 | (lambda (a b) |
| 474 | ;; should cache downcased strings | 477 | ;; should cache downcased strings |
| 475 | (string< (downcase (car a)) | 478 | (string< (downcase (car a)) |
| @@ -478,8 +481,10 @@ PATTERN is the string we want to complete." | |||
| 478 | 481 | ||
| 479 | 482 | ||
| 480 | (defun mail-directory (pattern) | 483 | (defun mail-directory (pattern) |
| 481 | "Call directory to get names matching PATTERN or all if nil. | 484 | "Use mail-directory facility to get user names matching PATTERN. |
| 482 | Calls `mail-directory-function' and applies `mail-directory-parser' to output." | 485 | If PATTERN is nil, get all the defined user names. |
| 486 | This function calls `mail-directory-function' to query the directory, | ||
| 487 | then uses `mail-directory-parser' to parse the output it returns." | ||
| 483 | (save-excursion | 488 | (save-excursion |
| 484 | (message "Querying directory...") | 489 | (message "Querying directory...") |
| 485 | (set-buffer (generate-new-buffer " *mail-directory*")) | 490 | (set-buffer (generate-new-buffer " *mail-directory*")) |
| @@ -509,8 +514,9 @@ Calls `mail-directory-function' and applies `mail-directory-parser' to output." | |||
| 509 | (defun mail-directory-process (pattern) | 514 | (defun mail-directory-process (pattern) |
| 510 | "Run a shell command to output names in directory. | 515 | "Run a shell command to output names in directory. |
| 511 | See `mail-directory-process'." | 516 | See `mail-directory-process'." |
| 512 | (apply 'call-process (eval (car mail-directory-process)) nil t nil | 517 | (when (consp mail-directory-process) |
| 513 | (mapcar 'eval (cdr mail-directory-process)))) | 518 | (apply 'call-process (eval (car mail-directory-process)) nil t nil |
| 519 | (mapcar 'eval (cdr mail-directory-process))))) | ||
| 514 | 520 | ||
| 515 | ;; This should handle a dialog. Currently expects port to spit out names. | 521 | ;; This should handle a dialog. Currently expects port to spit out names. |
| 516 | (defun mail-directory-stream (pattern) | 522 | (defun mail-directory-stream (pattern) |