Variable: nnmail-expiry-wait-function

nnmail-expiry-wait-function is a customizable variable defined in nnmail.el.gz.

Value

nil

Documentation

Function to determine how old articles should be before they are expired.

The function is called with the name of the group that the expiry is to be performed in, and should return a value supported by nnmail-expiry-wait, which it overrides. If this variable is nil, the value of nnmail-expiry-wait is used instead.

E.g.:

(setq nnmail-expiry-wait-function
      (lambda (group)
        (cond ((string-match-p "private" group) 31)
              ((string-match-p "junk" group) 1)
              ((string-match-p "important" group) 'never)
              (t 7))))

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnmail.el.gz
(defcustom nnmail-expiry-wait-function nil
  "Function to determine how old articles should be before they are expired.
The function is called with the name of the group that the expiry
is to be performed in, and should return a value supported by
`nnmail-expiry-wait', which it overrides.  If this variable is
nil, the value of `nnmail-expiry-wait' is used instead.

E.g.:

\(setq nnmail-expiry-wait-function
      (lambda (group)
        (cond ((string-match-p \"private\" group) 31)
              ((string-match-p \"junk\" group) 1)
              ((string-match-p \"important\" group) \\='never)
              (t 7))))"
  :group 'nnmail-expire
  :type '(choice (const :tag "nnmail-expiry-wait" nil)
                 (function :tag "Custom function")))