From: Richard M. Stallman Date: Sat, 26 Mar 2005 02:13:35 +0000 (+0000) Subject: (mail-directory-process): Do nothing if mail-directory-process is an atom. X-Git-Tag: ttn-vms-21-2-B4~1503 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f62504368a56b3170b623e2331a4cecd17dfe8c5;p=emacs.git (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. --- 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)