Function: gnus-batch-score

gnus-batch-score is an autoloaded, interactive and byte-compiled function defined in gnus-kill.el.gz.

Signature

(gnus-batch-score)

Documentation

Run batched scoring.

Usage: emacs -batch -l ~/.emacs -l gnus -f gnus-batch-score

Key Bindings

Aliases

gnus-batch-kill

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-kill.el.gz
;;;###autoload
(defun gnus-batch-score ()
  "Run batched scoring.
Usage: emacs -batch -l ~/.emacs -l gnus -f gnus-batch-score"
  (interactive)
  (let* ((gnus-newsrc-options-n
	  (gnus-newsrc-parse-options
	   (concat "options -n "
		   (mapconcat #'identity command-line-args-left " "))))
	 (gnus-expert-user t)
	 (mail-sources nil)
	 (gnus-use-dribble-file nil)
	 (gnus-batch-mode t)
	 info group newsrc unread
	 ;; Disable verbose message.
	 gnus-novice-user gnus-large-newsgroup
	 gnus-options-subscribe gnus-auto-subscribed-groups
	 gnus-options-not-subscribe)
    ;; Eat all arguments.
    (setq command-line-args-left nil)
    (gnus-child)
    ;; Apply kills to specified newsgroups in command line arguments.
    (setq newsrc (cdr gnus-newsrc-alist))
    (while (setq info (pop newsrc))
      (setq group (gnus-info-group info)
	    unread (gnus-group-unread group))
      (when (and (<= (gnus-info-level info) gnus-level-subscribed)
		 (and unread
		      (or (eq unread t)
			  (not (zerop unread)))))
	(ignore-errors
	  (gnus-summary-read-group group nil t nil t))
	(when (eq (current-buffer) (get-buffer gnus-summary-buffer))
	  (gnus-summary-exit))))
    ;; Exit Emacs.
    (switch-to-buffer gnus-group-buffer)
    (gnus-group-save-newsrc)))