;;; nnmail.el --- mail support functions for the Gnus mail backends
-;; Copyright (C) 1995-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2016 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news, mail
(autoload 'gnus-add-buffer "gnus")
(autoload 'gnus-kill-buffer "gnus")
-(eval-when-compile
- (autoload 'mail-send-and-exit "sendmail" nil t))
+(autoload 'mail-send-and-exit "sendmail" nil t)
(defgroup nnmail nil
"Reading mail with Gnus."
else, you could do something like this:
(setq nnmail-split-methods
- '((\"mail.4ad\" \"From:.*4ad\")
+ \\='((\"mail.4ad\" \"From:.*4ad\")
(\"mail.junk\" \"From:.*Lars\\\\|Subject:.*buy\")
(\"mail.misc\" \"\")))
(lambda (newsgroup)
(cond ((string-match \"private\" newsgroup) 31)
((string-match \"junk\" newsgroup) 1)
- ((string-match \"important\" newsgroup) 'never)
+ ((string-match \"important\" newsgroup) \\='never)
(t 7))))"
:group 'nnmail-expire
:type '(choice (const :tag "nnmail-expiry-wait" nil)
Example:
\(setq nnmail-fancy-expiry-targets
- '((to-from \"boss\" \"nnfolder:Work\")
+ \\='((to-from \"boss\" \"nnfolder:Work\")
(\"Subject\" \"IMPORTANT\" \"nnfolder:IMPORTANT.%Y.%b\")
(\"from\" \".*\" \"nnfolder:Archive-%Y\")))
E.g.:
-\(add-hook 'nnmail-read-incoming-hook
+\(add-hook \\='nnmail-read-incoming-hook
(lambda ()
(call-process \"/local/bin/mailsend\" nil nil nil
\"read\"
If you use `display-time', you could use something like this:
-\(add-hook 'nnmail-read-incoming-hook
+\(add-hook \\='nnmail-read-incoming-hook
(lambda ()
;; Update the displayed time, since that will clear out
;; the flag that says you have mail.
- (when (eq (process-status \"display-time\") 'run)
+ (when (eq (process-status \"display-time\") \\='run)
(display-time-filter display-time-process \"\"))))"
:group 'nnmail-prepare
:type 'hook)
:type '(choice (const :tag "infinite" nil)
(number :tag "count")))
-(define-widget 'nnmail-lazy 'default
- "Base widget for recursive data structures.
-
-This is copy of the `lazy' widget in Emacs 22.1 provided for compatibility."
- :format "%{%t%}: %v"
- :convert-widget 'widget-value-convert-widget
- :value-create (lambda (widget)
- (let ((value (widget-get widget :value))
- (type (widget-get widget :type)))
- (widget-put widget :children
- (list (widget-create-child-value
- widget (widget-convert type) value)))))
- :value-delete 'widget-children-value-delete
- :value-get (lambda (widget)
- (widget-value (car (widget-get widget :children))))
- :value-inline (lambda (widget)
- (widget-apply (car (widget-get widget :children))
- :value-inline))
- :default-get (lambda (widget)
- (widget-default-get
- (widget-convert (widget-get widget :type))))
- :match (lambda (widget value)
- (widget-apply (widget-convert (widget-get widget :type))
- :match value))
- :validate (lambda (widget)
- (widget-apply (car (widget-get widget :children)) :validate)))
-
-(define-widget 'nnmail-split-fancy 'nnmail-lazy
+(define-widget 'nnmail-split-fancy 'lazy
"Widget for customizing splits in the variable of the same name."
:tag "Split"
:type '(menu-choice :value (any ".*value.*" "misc")
junk: Mail will be deleted. Use with care! Do not submerge in water!
Example:
(setq nnmail-split-fancy
- '(| (\"Subject\" \"MAKE MONEY FAST\" junk)
+ \\='(| (\"Subject\" \"MAKE MONEY FAST\" junk)
...other.rules.omitted...))
FIELD must match a complete field name. VALUE must match a complete
Example:
-\(setq nnmail-split-methods 'nnmail-split-fancy
+\(setq nnmail-split-methods \\='nnmail-split-fancy
nnmail-split-fancy
;; Messages from the mailer daemon are not crossposted to any of
;; the ordinary groups. Warnings are put in a separate group
;; from real errors.
- '(| (\"from\" mail (| (\"subject\" \"warn.*\" \"mail.warning\")
+ \\='(| (\"from\" mail (| (\"subject\" \"warn.*\" \"mail.warning\")
\"mail.misc\"))
;; Non-error messages are crossposted to all relevant
;; groups, but we don't crosspost between the group for the
mm-text-coding-system
"Coding system used in reading inbox")
-(defvar nnmail-pathname-coding-system
- ;; This causes Emacs 22.2 and 22.3 to issue a useless warning.
- ;;(if (and (featurep 'xemacs) (featurep 'file-coding))
- (if (featurep 'xemacs)
- (if (featurep 'file-coding)
- ;; Work around a bug in many XEmacs 21.5 betas.
- ;; Cf. http://thread.gmane.org/gmane.emacs.gnus.general/68134
- (setq file-name-coding-system (coding-system-aliasee 'file-name))))
+(defvar nnmail-pathname-coding-system nil
"*Coding system for file name.")
(defun nnmail-find-file (file)
(setq group (symbol-name group)))
(if (and (numberp (setq max (read buffer)))
(numberp (setq min (read buffer))))
- (push (list (mm-string-as-unibyte group) (cons min max))
+ (push (list (string-as-unibyte group) (cons min max))
group-assoc)))
(error nil))
(widen)
5 "Error in `nnmail-split-methods'; using `bogus' mail group: %S" error-info)
(sit-for 1)
'("bogus")))))
- (setq split (mm-delete-duplicates split))
+ (setq split (delete-dups split))
;; The article may be "cross-posted" to `junk'. What
;; to do? Just remove the `junk' spec. Don't really
;; see anything else to do...
(insert (format "Xref: %s" (system-name)))
(while group-alist
(insert (if (mm-multibyte-p)
- (mm-string-as-multibyte
+ (string-as-multibyte
(format " %s:%d" (caar group-alist) (cdar group-alist)))
- (mm-string-as-unibyte
+ (string-as-unibyte
(format " %s:%d" (caar group-alist) (cdar group-alist)))))
(setq group-alist (cdr group-alist)))
(insert "\n")))
"Read new incoming mail."
(nnmail-get-new-mail-1 method exit-func temp group nil spool-func))
+(defun nnmail-get-new-mail-per-group ()
+ "Tell us whether the mail-sources specify that `nnmail-get-new-mail' should
+be called once per group or once for all groups."
+ (or (assq 'group mail-sources)
+ (assq 'directory mail-sources)))
+
(defun nnmail-get-new-mail-1 (method exit-func temp
group in-group spool-func)
(let* ((sources mail-sources)
sources)
(while (setq source (pop sources))
;; Use group's parameter
- (when (eq (car source) 'group)
+ (when (and (eq (car source) 'group)
+ group)
(let ((mail-sources
(list
(gnus-group-find-parameter
((and (equal header 'to-from)
(or (string-match (cadr regexp-target-pair) from)
(and (string-match (cadr regexp-target-pair) to)
- (let* ((mail-dont-reply-to-names
- (message-dont-reply-to-names))
- (rmail-dont-reply-to-names ; obsolete since 24.1
- mail-dont-reply-to-names))
+ (let ((mail-dont-reply-to-names
+ (message-dont-reply-to-names)))
(equal (if (fboundp 'rmail-dont-reply-to)
(rmail-dont-reply-to from)
(mail-dont-reply-to from)) "")))))
(error "No current split history"))
(with-output-to-temp-buffer "*nnmail split history*"
(with-current-buffer standard-output
- (fundamental-mode)) ; for Emacs 20.4+
- (dolist (elem nnmail-split-history)
- (princ (mapconcat (lambda (ga)
- (concat (car ga) ":" (int-to-string (cdr ga))))
- elem
- ", "))
- (princ "\n"))))
+ (fundamental-mode))
+ (dolist (elem nnmail-split-history)
+ (princ (mapconcat (lambda (ga)
+ (concat (car ga) ":" (int-to-string (cdr ga))))
+ elem
+ ", "))
+ (princ "\n"))))
(defun nnmail-purge-split-history (group)
"Remove all instances of GROUP from `nnmail-split-history'."