+;;;###autoload
+(defalias 'gnus-batch-kill 'gnus-batch-score)
+;;;###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)
+ (nnmail-spool-file nil)
+ (gnus-use-dribble-file nil)
+ (gnus-batch-mode t)
+ info group newsrc entry
+ ;; 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-slave)
+ ;; 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)
+ entry (gnus-gethash group gnus-newsrc-hashtb))
+ (when (and (<= (gnus-info-level info) gnus-level-subscribed)
+ (and (car entry)
+ (or (eq (car entry) t)
+ (not (zerop (car entry))))))
+ (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)))
+