From a1e0942eb0babe515890b6c71a4c1e8a8b6bf7be Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 19 Sep 2000 12:05:10 +0000 Subject: [PATCH] Synch with Gnus. --- lisp/ChangeLog | 8 +++ lisp/mail-source.el | 138 +++++++++++++++++++++++++++++++++++++++++++++++++-- lisp/nnmail.el | 7 +-- 3 files changed, 147 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 074a1aa..fd23d5a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2000-09-19 Dave Love + + * nnmail.el (nnmail-cache-accepted-message-ids): Default to nil. + (nnmail-get-new-mail): Test `sources' in top-level conditional. + + * mail-source.el (mail-sources): Change default to '((file)). + Add useful custom type. + 2000-09-18 Kai Gro,A_(Bjohann * gnus-util.el (gnus-time-iso8601): Correct doc string (four digit diff --git a/lisp/mail-source.el b/lisp/mail-source.el index 9d936c3..0680a37 100644 --- a/lisp/mail-source.el +++ b/lisp/mail-source.el @@ -37,11 +37,142 @@ "The mail-fetching library." :group 'gnus) -(defcustom mail-sources nil +(defcustom mail-sources '((file)) "*Where the mail backends will look for incoming mail. -This variable is a list of mail source specifiers." +This variable is a list of mail source specifiers. +See Info node `(gnus)Mail Source Specifiers'." :group 'mail-source - :type 'sexp) + ;; This specification should be tidied up, particularly to avoid + ;; constant items appearing. (Perhaps there's scope for improvment + ;; in the widget code.) + :type `(repeat + (choice (const :tag "Default spool file" (file)) + (list :tag "Specified spool file" + (const file) + (const :value :path) + file) + (cons :tag "Several files in a directory" + (const directory) + (choice + :tag "Options" + (const :tag "None" nil) + (repeat + (choice + (list :inline t :tag "path" + (const :value :path) directory) + (list :inline t :tag "suffix" + (const :value :suffix) string) + (list :inline t :tag "predicate" + (const :value :predicate) function) + (list :inline t :tag "prescript" + (const :value :prescript) string) + (list :inline t :tag "postscript" + (const :value :postscript) string) + (list :inline t :tag "plugged" + (const :value :plugged) boolean))))) + (cons :tag "POP3 server" + (const pop) + (choice + :tag "Options" + (const :tag "None" nil) + (repeat + (choice + (list :inline t :tag "server" + (const :value :server) string) + (list :inline t :tag "port" + (const :value :port) (choice number string)) + (list :inline t :tag "user" + (const :value :user) string) + (list :inline t :tag "password" + (const :value :password) string) + (list :inline t :tag "program" + (const :value :program) string) + (list :inline t :tag "prescript" + (const :value :prescript) string) + (list :inline t :tag "postscript" + (const :value :postscript) string) + (list :inline t :tag "function" + (const :value :function) function) + (list :inline t :tag "authentication" + (const :value :authentication) + (choice (const password) + (const apop))) + (list :inline t :tag "plugged" + (const :value :plugged) boolean))))) + (cons :tag "Maildir (qmail, postfix...)" + (const maildir) + (choice + :tag "Options" + (const :tag "None" nil) + (repeat + (choice + (list :inline t :tag "path" + (const :value :path) directory) + (list :inline t :tag "plugged" + (const :value :plugged) boolean))))) + (cons :tag "IMAP server" + (const imap) + (choice + :tag "Options" + (const :tag "None" nil) + (repeat + (choice + (list :inline t :tag "server" + (const :value :server) string) + (list :inline t :tag "port" + (const :value :port) + (choice number string)) + (list :inline t :tag "user" + (const :value :user) string) + (list :inline t :tag "password" + (const :value :password) string) + (list :inline t :tag "stream" + (const :value :stream) + (choice ,@(progn (require 'imap) + (mapcar + (lambda (a) + (list 'const (car a))) + imap-stream-alist)))) + (list :inline t :tag "authenticator" + (const :value :authenticator) + (choice ,@(progn (require 'imap) + (mapcar + (lambda (a) + (list 'const (car a))) + imap-authenticator-alist)))) + (list :inline t :tag "mailbox" + (const :value :mailbox) string) + (list :inline t :tag "predicate" + (const :value :predicate) function) + (list :inline t :tag "fetchflag" + (const :value :fetchflag) string) + (list :inline t :tag "dontexpunge" + (const :value :dontexpunge) boolean) + (list :inline t :tag "plugged" + (const :value :plugged) ))))) + (cons :tag "Webmail server" + (const webmail) + (choice + :tag "Options" + (const :tag "None" nil) + (repeat + (choice + (list :inline t :tag "subtype" + (const :value :subtype) + ;; Should be generated from + ;; `webmail-type-definition', but we + ;; can't require webmail without W3. + (choice (const hotmail) (const yahoo) + (const netaddress) (const netscape) + (const my-deja))) + (list :inline t :tag "user" + (const :value :user) string) + (list :inline t :tag "password" + (const :value :password) string) + (list :inline t :tag "dontexpunge" + (const :value :dontexpunge) boolean) + (list :inline t :tag "plugged" + (const :value :plugged) boolean)))))))) (defcustom mail-source-primary-source nil "*Primary source for incoming mail. @@ -604,6 +735,7 @@ This only works when `display-time' is enabled." (if on (progn (require 'time) + ;; display-time-mail-function is an Emacs 21 feature. (setq display-time-mail-function #'mail-source-new-mail-p) ;; Set up the main timer. (setq mail-source-report-new-mail-timer diff --git a/lisp/nnmail.el b/lisp/nnmail.el index cdf997e..14b91ea 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -193,7 +193,7 @@ The return value should be `delete' or a group name (a string)." :group 'nnmail :type 'boolean) -(defcustom nnmail-spool-file '((file)) +(defcustom nnmail-spool-file nil "*Where the mail backends will look for incoming mail. This variable is a list of mail source specifiers. This variable is obsolete; `mail-sources' should be used instead." @@ -234,7 +234,7 @@ links, you could set this variable to `copy-file' instead." '(nnheader-ms-strip-cr) nil) "*Hook that will be run after the incoming mail has been transferred. -The incoming mail is moved from `nnmail-spool-file' (which normally is +The incoming mail is moved from the specified spool file (which normally is something like \"/usr/spool/mail/$user\") to the user's home directory. This hook is called after the incoming mail box has been emptied, and can be used to call any mail box programs you have @@ -1523,7 +1523,8 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." (new 0) (total 0) incoming incomings source) - (when (nnmail-get-value "%s-get-new-mail" method) + (when (and (nnmail-get-value "%s-get-new-mail" method) + sources) (while (setq source (pop sources)) ;; Be compatible with old values. (cond -- 1.7.10.4