+
+ (gnus-set-mode-line 'summary)
+
+ (if beg
+ (let ((nunreads (- unreads (length gnus-newsgroup-unreads))))
+ (or (eq nunreads 0)
+ (gnus-message 6 "Marked %d articles as read" nunreads))
+ nunreads)
+ 0))))
+
+;; Parse a Gnus killfile.
+(defun gnus-score-insert-help (string alist idx)
+ (save-excursion
+ (pop-to-buffer "*Score Help*")
+ (buffer-disable-undo (current-buffer))
+ (erase-buffer)
+ (insert string ":\n\n")
+ (while alist
+ (insert (format " %c: %s\n" (caar alist) (nth idx (car alist))))
+ (setq alist (cdr alist)))))
+
+(defun gnus-kill-parse-gnus-kill-file ()
+ (goto-char (point-min))
+ (gnus-kill-file-mode)
+ (let (beg form)
+ (while (progn
+ (setq beg (point))
+ (setq form (ignore-errors (read (current-buffer)))))
+ (unless (listp form)
+ (error "Illegal kill entry (possibly rn kill file?): %s" form))
+ (if (or (eq (car form) 'gnus-kill)
+ (eq (car form) 'gnus-raise)
+ (eq (car form) 'gnus-lower))
+ (progn
+ (delete-region beg (point))
+ (insert (or (eval form) "")))
+ (save-excursion
+ (set-buffer gnus-summary-buffer)
+ (ignore-errors (eval form)))))
+ (and (buffer-modified-p)
+ gnus-kill-save-kill-file
+ (save-buffer))
+ (set-buffer-modified-p nil)))
+
+;; Parse an rn killfile.
+(defun gnus-kill-parse-rn-kill-file ()
+ (goto-char (point-min))
+ (gnus-kill-file-mode)
+ (let ((mod-to-header
+ '((?a . "")
+ (?h . "")
+ (?f . "from")
+ (?: . "subject")))
+ ;;(com-to-com
+ ;; '((?m . " ")
+ ;; (?j . "X")))
+ pattern modifier commands)
+ (while (not (eobp))
+ (if (not (looking-at "[ \t]*/\\([^/]*\\)/\\([ahfcH]\\)?:\\([a-z=:]*\\)"))
+ ()
+ (setq pattern (buffer-substring (match-beginning 1) (match-end 1)))
+ (setq modifier (if (match-beginning 2) (char-after (match-beginning 2))
+ ?s))
+ (setq commands (buffer-substring (match-beginning 3) (match-end 3)))
+
+ ;; The "f:+" command marks everything *but* the matches as read,
+ ;; so we simply first match everything as read, and then unmark
+ ;; PATTERN later.
+ (when (string-match "\\+" commands)
+ (gnus-kill "from" ".")
+ (setq commands "m"))
+
+ (gnus-kill
+ (or (cdr (assq modifier mod-to-header)) "subject")
+ pattern
+ (if (string-match "m" commands)
+ '(gnus-summary-mark-as-unread nil " ")
+ '(gnus-summary-mark-as-read nil "X"))
+ nil t))
+ (forward-line 1))))