Function: gnus-agent-expire

gnus-agent-expire is an autoloaded, interactive and byte-compiled function defined in gnus-agent.el.gz.

Signature

(gnus-agent-expire &optional ARTICLES GROUP FORCE)

Documentation

Expire all old articles.

If you want to force expiring of certain articles, this function can take ARTICLES, GROUP and FORCE parameters as well.

The articles on which the expiration process runs are selected as follows:
  if ARTICLES is null, all read and unmarked articles.
  if ARTICLES is t, all articles.
  if ARTICLES is a list, just those articles.
Setting GROUP will limit expiration to that group. FORCE is equivalent to setting the expiration predicates to true.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-agent.el.gz
(defun gnus-agent-expire (&optional articles group force)
  "Expire all old articles.
If you want to force expiring of certain articles, this function can
take ARTICLES, GROUP and FORCE parameters as well.

The articles on which the expiration process runs are selected as follows:
  if ARTICLES is null, all read and unmarked articles.
  if ARTICLES is t, all articles.
  if ARTICLES is a list, just those articles.
Setting GROUP will limit expiration to that group.
FORCE is equivalent to setting the expiration predicates to true."
  (interactive)

  (if group
      (gnus-agent-expire-group group articles force)
    (if (or (not (eq articles t))
            (yes-or-no-p "Are you sure that you want to expire all \
articles in every agentized group? "))
        (let ((methods (gnus-agent-covered-methods))
              ;; Bind gnus-agent-expire-current-dirs to enable tracking
              ;; of agent directories.
              (gnus-agent-expire-current-dirs nil)
              ;; Bind gnus-agent-expire-stats to enable tracking of
              ;; expiration statistics across all groups
              (gnus-agent-expire-stats (list 0 0 0.0))
              gnus-command-method overview orig)
          (setq overview (gnus-get-buffer-create " *expire overview*"))
          (unwind-protect
              (while (setq gnus-command-method (pop methods))
                (let ((active-file (gnus-agent-lib-file "active")))
                  (when (file-exists-p active-file)
                    (with-temp-buffer
                      (nnheader-insert-file-contents active-file)
                      (gnus-active-to-gnus-format
                       gnus-command-method
                       (setq orig (gnus-make-hashtable
                                   (count-lines (point-min) (point-max))))))
                    (dolist (expiring-group (gnus-groups-from-server
                                             gnus-command-method))
                      (let ((active (gethash expiring-group orig)))
                        (when active
                          (save-excursion
                            (gnus-agent-expire-group-1
                             expiring-group overview active articles force))))))))
            (kill-buffer overview))
          (gnus-agent-expire-unagentized-dirs)
          (gnus-message 4 "%s" (gnus-agent-expire-done-message))))))