;;; gnus-kill.el --- kill commands for Gnus
-;; Copyright (C) 1995,96,97 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
+;; Free Software Foundation, Inc.
;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
-;; Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
+;; Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news
;; This file is part of GNU Emacs.
;;; Code:
+(eval-when-compile (require 'cl))
+
(require 'gnus)
(require 'gnus-art)
(require 'gnus-range)
:type 'boolean)
(defcustom gnus-winconf-kill-file nil
- "What does this do, Lars?"
+ "What does this do, Lars?
+I don't know, Per."
:group 'gnus-score-kill
:type 'sexp)
(setq major-mode 'gnus-kill-file-mode)
(setq mode-name "Kill")
(lisp-mode-variables nil)
- (run-hooks 'emacs-lisp-mode-hook 'gnus-kill-file-mode-hook))
+ (gnus-run-hooks 'emacs-lisp-mode-hook 'gnus-kill-file-mode-hook))
(defun gnus-kill-file-edit-file (newsgroup)
"Begin editing a kill file for NEWSGROUP.
()
(gnus-message 6 "Processing kill file %s..." (car kill-files))
(find-file (car kill-files))
- (gnus-add-current-to-buffer-list)
(goto-char (point-min))
(if (consp (ignore-errors (read (current-buffer))))
(defun gnus-score-insert-help (string alist idx)
(save-excursion
(pop-to-buffer "*Score Help*")
- (buffer-disable-undo (current-buffer))
+ (buffer-disable-undo)
(erase-buffer)
(insert string ":\n\n")
(while alist
(setq beg (point))
(setq form (ignore-errors (read (current-buffer)))))
(unless (listp form)
- (error "Illegal kill entry (possibly rn kill file?): %s" form))
+ (error "Invalid 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))
(?h . "")
(?f . "from")
(?: . "subject")))
- (com-to-com
- '((?m . " ")
- (?j . "X")))
+ ;;(com-to-com
+ ;; '((?m . " ")
+ ;; (?j . "X")))
pattern modifier commands)
(while (not (eobp))
(if (not (looking-at "[ \t]*/\\([^/]*\\)/\\([ahfcH]\\)?:\\([a-z=:]*\\)"))
;; It's on the form (regexp . date).
(if (zerop (gnus-execute field (car kill-list)
command nil (not all)))
- (when (> (gnus-days-between date (cdr kill-list))
+ (when (> (days-between date (cdr kill-list))
gnus-kill-expiry-days)
(setq regexp nil))
(setcdr kill-list date))
(setq kdate (cdr kill))
(if (zerop (gnus-execute
field (car kill) command nil (not all)))
- (when (> (gnus-days-between date kdate)
+ (when (> (days-between date kdate)
gnus-kill-expiry-days)
;; Time limit has been exceeded, so we
;; remove the match.
(not (consp (cdadr (nth 2 object))))))
(concat "\n" (gnus-prin1-to-string object))
(save-excursion
- (set-buffer (get-buffer-create "*Gnus PP*"))
- (buffer-disable-undo (current-buffer))
+ (set-buffer (gnus-get-buffer-create "*Gnus PP*"))
+ (buffer-disable-undo)
(erase-buffer)
(insert (format "\n(%S %S\n '(" (nth 0 object) (nth 1 object)))
(let ((klist (cadr (nth 2 object)))
;;;###autoload
(defun gnus-batch-score ()
"Run batched scoring.
-Usage: emacs -batch -l gnus -f gnus-batch-score <newsgroups> ...
-Newsgroups is a list of strings in Bnews format. If you want to score
-the comp hierarchy, you'd say \"comp.all\". If you would not like to
-score the alt hierarchy, you'd say \"!alt.all\"."
+Usage: emacs -batch -l ~/.emacs -l gnus -f gnus-batch-score"
(interactive)
(let* ((gnus-newsrc-options-n
(gnus-newsrc-parse-options
(mapconcat 'identity command-line-args-left " "))))
(gnus-expert-user t)
(nnmail-spool-file nil)
+ (mail-sources nil)
(gnus-use-dribble-file nil)
(gnus-batch-mode t)
- group newsrc entry
+ info group newsrc entry
;; Disable verbose message.
gnus-novice-user gnus-large-newsgroup
gnus-options-subscribe gnus-auto-subscribed-groups
(gnus-slave)
;; Apply kills to specified newsgroups in command line arguments.
(setq newsrc (cdr gnus-newsrc-alist))
- (while (setq group (car (pop newsrc)))
- (setq entry (gnus-gethash group gnus-newsrc-hashtb))
- (when (and (<= (gnus-info-level (car newsrc)) gnus-level-subscribed)
+ (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)))))
- ;;(eq (gnus-matches-options-n group) 'subscribe)
- )
- (gnus-summary-read-group group nil t nil t)
+ (not (zerop (car entry))))))
+ (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.