summaryrefslogtreecommitdiff
path: root/lisp/mail/mailalias.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2005-03-26 02:13:35 +0000
committerRichard M. Stallman <rms@gnu.org>2005-03-26 02:13:35 +0000
commitf62504368a56b3170b623e2331a4cecd17dfe8c5 (patch)
treefd2960cbf03f3313716d67389d01885767b6632b /lisp/mail/mailalias.el
parentc7c63bf77e070cf9d271ff1141eb47604da7b713 (diff)
downloademacs-f62504368a56b3170b623e2331a4cecd17dfe8c5.tar.gz
(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.
Diffstat (limited to 'lisp/mail/mailalias.el')
-rw-r--r--lisp/mail/mailalias.el24
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."
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.
+is evaluated. COMMAND should evaluate to a string. When
+`mail-directory-requery' is non-nil, during evaluation of these
+elements, the variable `pattern' contains the partial input being
+completed. `pattern' is nil when `mail-directory-requery' is nil.
The value might look like this:
@@ -149,7 +150,7 @@ Three types of values are possible:
"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'.")
+for the next use. This is used in `mail-complete'.")
(defvar mail-local-names t
"Alist of local users.
@@ -469,7 +470,9 @@ PATTERN is the string we want to complete."
mail-aliases))
(if (consp mail-local-names)
mail-local-names)
- (or directory mail-directory-names))
+ (or directory
+ (when (consp mail-directory-names)
+ mail-directory-names)))
(lambda (a b)
;; should cache downcased strings
(string< (downcase (car a))
@@ -478,8 +481,10 @@ PATTERN is the string we want to complete."
(defun mail-directory (pattern)
- "Call directory to get names matching PATTERN or all if nil.
-Calls `mail-directory-function' and applies `mail-directory-parser' to output."
+ "Use mail-directory facility to get user names matching PATTERN.
+If PATTERN is nil, get all the defined user names.
+This function calls `mail-directory-function' to query the directory,
+then uses `mail-directory-parser' to parse the output it returns."
(save-excursion
(message "Querying directory...")
(set-buffer (generate-new-buffer " *mail-directory*"))
@@ -509,8 +514,9 @@ Calls `mail-directory-function' and applies `mail-directory-parser' to output."
(defun mail-directory-process (pattern)
"Run a shell command to output names in directory.
See `mail-directory-process'."
- (apply 'call-process (eval (car mail-directory-process)) nil t nil
- (mapcar 'eval (cdr mail-directory-process))))
+ (when (consp mail-directory-process)
+ (apply 'call-process (eval (car mail-directory-process)) nil t nil
+ (mapcar 'eval (cdr mail-directory-process)))))
;; This should handle a dialog. Currently expects port to spit out names.
(defun mail-directory-stream (pattern)