Allow using functions as treatment predicates.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Fri, 19 Jul 2013 14:01:28 +0000 (16:01 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Fri, 19 Jul 2013 14:01:28 +0000 (16:01 +0200)
lisp/ChangeLog
lisp/gnus-art.el
texi/ChangeLog
texi/gnus.texi

index ba82929..413f9bd 100644 (file)
@@ -1,3 +1,8 @@
+2013-07-19  Geoff Kuenning  <geoff@cs.hmc.edu>  (tiny change)
+
+       * gnus-art.el (gnus-treat-predicate): Allow functions as predicates
+       (bug#13384).
+
 2013-07-18  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-start.el (gnus-clean-old-newsrc): Remove the newsrc cleanups
index 181e64a..aa4b286 100644 (file)
@@ -8420,6 +8420,8 @@ For example:
        (not (gnus-treat-predicate (car val))))
        ((eq pred 'typep)
        (equal (car val) gnus-treat-type))
+       ((functionp pred)
+       (funcall pred))
        (t
        (error "%S is not a valid predicate" pred)))))
    ((eq val t)
index 370d09a..25c0ec8 100644 (file)
@@ -1,3 +1,7 @@
+2013-07-19  Geoff Kuenning  <geoff@cs.hmc.edu>  (tiny change)
+
+       * gnus.texi (Customizing Articles): Document function predicates.
+
 2013-07-08  Tassilo Horn  <tsdh@gnu.org>
 
        * gnus.texi (lines): Correct description of
index 7e6802d..85e9f95 100644 (file)
@@ -11858,6 +11858,11 @@ predicate.  The following predicates are recognized: @code{or},
     (typep "text/x-vcard"))
 @end lisp
 
+@item
+A function: the function is called with no arguments and should return
+@code{nil} or non-@code{nil}.  The current article is available in the
+buffer named by @code{gnus-article-buffer}.
+
 @end enumerate
 
 You may have noticed that the word @dfn{part} is used here.  This refers