Function: gnus-summary-limit-to-age

gnus-summary-limit-to-age is an interactive and byte-compiled function defined in gnus-sum.el.gz.

Signature

(gnus-summary-limit-to-age AGE &optional YOUNGER-P)

Documentation

Limit the summary buffer to articles that are older than (or equal) AGE days.

Days are counted from midnight to midnight, and now to the previous midnight counts as day one. If YOUNGER-P (the prefix) is non-nil, limit the summary buffer to articles that are younger than AGE days.

Probably introduced at or before Emacs version 30.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-sum.el.gz
(defun gnus-summary-limit-to-age (age &optional younger-p)
  "Limit the summary buffer to articles that are older than (or equal) AGE days.
Days are counted from midnight to midnight, and now to the
previous midnight counts as day one.  If YOUNGER-P (the prefix)
is non-nil, limit the summary buffer to articles that are younger
than AGE days."
  (interactive
   (let* ((younger current-prefix-arg)
	  (days (read-number
                 (if younger "Limit to articles younger than days: "
                   "Limit to articles older than days: "))))
     (list days younger))
   gnus-summary-mode)
  (prog1
      (let* ((data gnus-newsgroup-data)
             (now (append '(0 0 0) (cdddr (decode-time))))
             (delta (make-decoded-time :day (* -1 (- age 1))))
             (cutoff (encode-time (decoded-time-add now delta)))
	     articles d date is-younger)
	(while (setq d (pop data))
	  (when (and (mail-header-p (gnus-data-header d))
		     (setq date (mail-header-date (gnus-data-header d))))
	    (setq is-younger (time-less-p
			      cutoff
			      (gnus-date-get-time date)))
	    (when (if younger-p
		      is-younger
		    (not is-younger))
	      (push (gnus-data-number d) articles))))
	(gnus-summary-limit (nreverse articles)))
    (gnus-summary-position-point)))