diff options
| -rw-r--r-- | doc/misc/gnus.texi | 50 | ||||
| -rw-r--r-- | lisp/gnus/gnus-cus.el | 8 | ||||
| -rw-r--r-- | lisp/gnus/nnmail.el | 35 |
3 files changed, 50 insertions, 43 deletions
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index f0458847295..9c3ec41462d 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi | |||
| @@ -2917,9 +2917,9 @@ See also @code{gnus-total-expirable-newsgroups}. | |||
| 2917 | If the group parameter has an element that looks like | 2917 | If the group parameter has an element that looks like |
| 2918 | @code{(expiry-wait . 10)}, this value will override any | 2918 | @code{(expiry-wait . 10)}, this value will override any |
| 2919 | @code{nnmail-expiry-wait} and @code{nnmail-expiry-wait-function} | 2919 | @code{nnmail-expiry-wait} and @code{nnmail-expiry-wait-function} |
| 2920 | (@pxref{Expiring Mail}) when expiring expirable messages. The value | 2920 | settings (@pxref{Expiring Mail}) when expiring expirable messages. |
| 2921 | can either be a number of days (not necessarily an integer) or the | 2921 | The value can be either a number of days (not necessarily an integer), |
| 2922 | symbols @code{never} or @code{immediate}. | 2922 | or one of the symbols @code{never} or @code{immediate}. |
| 2923 | 2923 | ||
| 2924 | @item expiry-target | 2924 | @item expiry-target |
| 2925 | @cindex expiry-target | 2925 | @cindex expiry-target |
| @@ -15826,40 +15826,46 @@ don't really mix very well. | |||
| 15826 | 15826 | ||
| 15827 | @vindex nnmail-expiry-wait | 15827 | @vindex nnmail-expiry-wait |
| 15828 | The @code{nnmail-expiry-wait} variable supplies the default time an | 15828 | The @code{nnmail-expiry-wait} variable supplies the default time an |
| 15829 | expirable article has to live. Gnus starts counting days from when the | 15829 | expirable article has to live. The value of this variable can be |
| 15830 | message @emph{arrived}, not from when it was sent. The default is seven | 15830 | either a number of days (not necessarily an integer), or one of the |
| 15831 | days. | 15831 | symbols @code{immediate} or @code{never}, meaning an article is |
| 15832 | immediately or never expirable, respectively. | ||
| 15832 | 15833 | ||
| 15833 | Gnus also supplies a function that lets you fine-tune how long articles | 15834 | Gnus starts counting days from when the message @emph{arrived}, not |
| 15834 | are to live, based on what group they are in. Let's say you want to | 15835 | from when it was sent. The default is seven days. |
| 15835 | have one month expiry period in the @samp{mail.private} group, a one day | ||
| 15836 | expiry period in the @samp{mail.junk} group, and a six day expiry period | ||
| 15837 | everywhere else: | ||
| 15838 | 15836 | ||
| 15839 | @vindex nnmail-expiry-wait-function | 15837 | @vindex nnmail-expiry-wait-function |
| 15838 | The @code{nnmail-expiry-wait-function} variable lets you fine-tune how | ||
| 15839 | long articles are to live, based on what group they are in. When set | ||
| 15840 | to a function, its returned value, if non-@code{nil}, overrides that | ||
| 15841 | of @code{nnmail-expiry-wait}. Otherwise, the value of | ||
| 15842 | @code{nnmail-expiry-wait} is used instead. | ||
| 15843 | |||
| 15844 | For example, let's say you want to have a one month expiry period in | ||
| 15845 | the @samp{mail.private} group, a one day expiry period in the | ||
| 15846 | @samp{mail.junk} group, and a six day expiry period everywhere else. | ||
| 15847 | This can be achieved as follows: | ||
| 15848 | |||
| 15840 | @lisp | 15849 | @lisp |
| 15841 | (setq nnmail-expiry-wait-function | 15850 | (setq nnmail-expiry-wait-function |
| 15842 | (lambda (group) | 15851 | (lambda (group) |
| 15843 | (cond ((string= group "mail.private") | 15852 | (cond ((string= group "mail.private") |
| 15844 | 31) | 15853 | 31) |
| 15845 | ((string= group "mail.junk") | 15854 | ((string= group "mail.junk") |
| 15846 | 1) | 15855 | 1) |
| 15847 | ((string= group "important") | 15856 | ((string= group "important") |
| 15848 | 'never) | 15857 | 'never) |
| 15849 | (t | 15858 | (t |
| 15850 | 6)))) | 15859 | 6)))) |
| 15851 | @end lisp | 15860 | @end lisp |
| 15852 | 15861 | ||
| 15853 | The group names this function is fed are ``unadorned'' group | 15862 | The group names this function is fed are ``unadorned'' group |
| 15854 | names---no @samp{nnml:} prefixes and the like. | 15863 | names---no @samp{nnml:} prefixes and the like. |
| 15855 | 15864 | ||
| 15856 | The @code{nnmail-expiry-wait} variable and | 15865 | As an alternative to the variables @code{nnmail-expiry-wait} or |
| 15857 | @code{nnmail-expiry-wait-function} function can either be a number (not | 15866 | @code{nnmail-expiry-wait-function}, you can also use the |
| 15858 | necessarily an integer) or one of the symbols @code{immediate} or | 15867 | @code{expiry-wait} group parameter to selectively change the expiry |
| 15859 | @code{never}. | 15868 | period (@pxref{Group Parameters}). |
| 15860 | |||
| 15861 | You can also use the @code{expiry-wait} group parameter to selectively | ||
| 15862 | change the expiry period (@pxref{Group Parameters}). | ||
| 15863 | 15869 | ||
| 15864 | @vindex nnmail-expiry-target | 15870 | @vindex nnmail-expiry-target |
| 15865 | The normal action taken when expiring articles is to delete them. | 15871 | The normal action taken when expiring articles is to delete them. |
diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el index 66fa3e0590f..80459a7d62c 100644 --- a/lisp/gnus/gnus-cus.el +++ b/lisp/gnus/gnus-cus.el | |||
| @@ -140,10 +140,10 @@ rules as described later).") | |||
| 140 | :format "%v")) "\ | 140 | :format "%v")) "\ |
| 141 | When to expire. | 141 | When to expire. |
| 142 | 142 | ||
| 143 | Overrides any `nnmail-expiry-wait' and `nnmail-expiry-wait-function' | 143 | Overrides any `nnmail-expiry-wait' or `nnmail-expiry-wait-function' |
| 144 | when expiring expirable messages. The value can either be a number of | 144 | settings when expiring expirable messages. The value can be |
| 145 | days (not necessarily an integer) or the symbols `never' or | 145 | either a number of days (not necessarily an integer), or one of |
| 146 | `immediate'.") | 146 | the symbols `never' or `immediate'.") |
| 147 | 147 | ||
| 148 | (expiry-target (choice :tag "Expiry Target" | 148 | (expiry-target (choice :tag "Expiry Target" |
| 149 | :value delete | 149 | :value delete |
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index c52bc03e109..0f560d300f9 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el | |||
| @@ -159,32 +159,33 @@ If nil, groups like \"mail.misc\" will end up in directories like | |||
| 159 | 159 | ||
| 160 | (defcustom nnmail-expiry-wait 7 | 160 | (defcustom nnmail-expiry-wait 7 |
| 161 | "Expirable articles that are older than this will be expired. | 161 | "Expirable articles that are older than this will be expired. |
| 162 | This variable can either be a number (which will be interpreted as a | 162 | This variable can be either a number of days (not necessarily an |
| 163 | number of days) -- this doesn't have to be an integer. This variable | 163 | integer), or one of the symbols `immediate' or `never', meaning |
| 164 | can also be `immediate' and `never'." | 164 | an article is immediately or never expirable, respectively. |
| 165 | For more granular control, see `nnmail-expiry-wait-function'." | ||
| 165 | :group 'nnmail-expire | 166 | :group 'nnmail-expire |
| 166 | :type '(choice (const immediate) | 167 | :type '(choice (const :tag "Immediate" immediate) |
| 167 | (number :tag "days") | 168 | (const :tag "Never" never) |
| 168 | (const never))) | 169 | (number :tag "Days"))) |
| 169 | 170 | ||
| 170 | (defcustom nnmail-expiry-wait-function nil | 171 | (defcustom nnmail-expiry-wait-function nil |
| 171 | "Variable that holds function to specify how old articles should be before they are expired. | 172 | "Function to determine how old articles should be before they are expired. |
| 172 | The function will be called with the name of the group that the expiry | 173 | The function is called with the name of the group that the expiry |
| 173 | is to be performed in, and it should return an integer that says how | 174 | is to be performed in, and should return a value supported by |
| 174 | many days an article can be stored before it is considered \"old\". | 175 | `nnmail-expiry-wait', which it overrides. If this variable is |
| 175 | It can also return the values `never' and `immediate'. | 176 | nil, the value of `nnmail-expiry-wait' is used instead. |
| 176 | 177 | ||
| 177 | E.g.: | 178 | E.g.: |
| 178 | 179 | ||
| 179 | \(setq nnmail-expiry-wait-function | 180 | \(setq nnmail-expiry-wait-function |
| 180 | (lambda (newsgroup) | 181 | (lambda (group) |
| 181 | (cond ((string-match \"private\" newsgroup) 31) | 182 | (cond ((string-match-p \"private\" group) 31) |
| 182 | ((string-match \"junk\" newsgroup) 1) | 183 | ((string-match-p \"junk\" group) 1) |
| 183 | ((string-match \"important\" newsgroup) \\='never) | 184 | ((string-match-p \"important\" group) \\='never) |
| 184 | (t 7))))" | 185 | (t 7))))" |
| 185 | :group 'nnmail-expire | 186 | :group 'nnmail-expire |
| 186 | :type '(choice (const :tag "nnmail-expiry-wait" nil) | 187 | :type '(choice (const :tag "nnmail-expiry-wait" nil) |
| 187 | (function :format "%v" nnmail-))) | 188 | (function :tag "Custom function"))) |
| 188 | 189 | ||
| 189 | (defcustom nnmail-expiry-target 'delete | 190 | (defcustom nnmail-expiry-target 'delete |
| 190 | "Variable that says where expired messages should end up. | 191 | "Variable that says where expired messages should end up. |