emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master ace8f2e: Make gnus-alter-articles-to-read-function


From: Eric Abrahamsen
Subject: [Emacs-diffs] master ace8f2e: Make gnus-alter-articles-to-read-function a constant lambda
Date: Thu, 28 Dec 2017 15:30:12 -0500 (EST)

branch: master
commit ace8f2ed4d6ea49d179333f8e7455e5208417da7
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Make gnus-alter-articles-to-read-function a constant lambda
    
    * lisp/gnus/gnus-sum.el (gnus-alter-articles-to-read-function):
      Default to a no-op lambda form, mention the use of `add-function' in
      the docstring.
    * lisp/gnus/gnus-sum.el (gnus-articles-to-read): Check if the option
      value is callable.
---
 lisp/gnus/gnus-sum.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 4dee306..c434505 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -1266,9 +1266,13 @@ For example: ((1 . cn-gb-2312) (2 . big5))."
   :type 'boolean
   :group 'gnus-summary-marks)
 
-(defcustom gnus-alter-articles-to-read-function nil
-  "Function to be called to alter the list of articles to be selected."
-  :type '(choice (const nil) function)
+(defcustom gnus-alter-articles-to-read-function
+  (lambda (_group article-list) article-list)
+  "Function to be called to alter the list of articles to be selected.
+This option defaults to a lambda form that simply returns the
+list of articles unchanged.  Use `add-function' to set one or
+more custom filter functions."
+  :type 'function
   :group 'gnus-summary)
 
 (defcustom gnus-orphan-score nil
@@ -5914,7 +5918,7 @@ If SELECT-ARTICLES, only select those articles from 
GROUP."
          (setq articles (nthcdr (- number select) articles))))
       (setq gnus-newsgroup-unselected
            (gnus-sorted-difference gnus-newsgroup-unreads articles))
-      (when gnus-alter-articles-to-read-function
+      (when (functionp gnus-alter-articles-to-read-function)
        (setq articles
              (sort
               (funcall gnus-alter-articles-to-read-function



reply via email to

[Prev in Thread] Current Thread [Next in Thread]