+2001-06-09 TSUCHIYA Masatoshi <tsuchiya@pine.kuee.kyoto-u.ac.jp>
+
+ * lisp/nnshimbun.el (top-level): Updated comments.
+ (nnshimbun): New customize group.
+ (nnshimbun-keep-last-article): Defined as customize variable.
+ (nnshimbun-keep-unparsable-dated-articles): Ditto.
+ (nnshimbun-insert-nov): Use `when' instead of `if'.
+ (gnus-group-shimbun-server-history): Imported from
+ `gnus-group.el'.
+ (gnus-group-make-shimbun-group): Ditto.
+
+ * lisp/gnus-group.el (gnus-group-make-shimbun-group): Its real
+ definition is moved to `nnshimbun.el' and autload code is added.
+ (gnus-group-shimbun-server-history): Its definition is moved to
+ `nnshimbun.el'.
+
2001-06-08 TSUCHIYA Masatoshi <tsuchiya@pine.kuee.kyoto-u.ac.jp>
* lisp/nnshimbun.el (nnshimbun-use-entire-index): Removed.
(nnwarchive-login ,login))))
(gnus-group-make-group group method)))
-(defvar gnus-group-shimbun-server-history nil)
-
-(defun gnus-group-make-shimbun-group ()
- "Create a nnshimbun group."
- (interactive)
- (require 'nnshimbun)
- (let* ((minibuffer-setup-hook
- (append minibuffer-setup-hook '(beginning-of-line)))
- (alist
- (apply 'nconc
- (mapcar
- (lambda (d)
- (and (stringp d)
- (file-directory-p d)
- (delq nil
- (mapcar
- (lambda (f)
- (and (string-match "^sb-\\(.*\\)\\.el$" f)
- (list (match-string 1 f))))
- (directory-files d)))))
- load-path)))
- (server (completing-read
- "Shimbun address: "
- alist nil t
- (or (car gnus-group-shimbun-server-history)
- (caar alist))
- 'gnus-group-shimbun-server-history))
- (groups)
- (nnshimbun-pre-fetch-article))
- (require (intern (concat "sb-" server)))
- (when (setq groups (intern-soft (concat "shimbun-" server "-groups")))
- (gnus-group-make-group
- (completing-read "Group name: "
- (mapcar 'list (symbol-value groups))
- nil t nil)
- (list 'nnshimbun server)))))
+(autoload 'gnus-group-make-shimbun-group
+ "nnshimbun" "Create a nnshimbun group." t)
(defun gnus-group-make-archive-group (&optional all)
"Create the (ding) Gnus archive group of the most recent articles.
;; http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/
;; If you would like to use this module in Gnus (not T-gnus), put this
-;; file into the lisp/ directory in the Gnus source tree and run
-;; `make install'. And then, copy the function definition of
-;; `gnus-group-make-shimbun-group' from the file gnus-group.el of
-;; T-gnus to somewhere else, for example .gnus file as follows:
-;;
-;;(eval-after-load "gnus-group"
-;; '(if (not (fboundp 'gnus-group-make-shimbun-group))
-;; (defun gnus-group-make-shimbun-group ()
-;; "Create a nnshimbun group."
-;; [...a function definition...])))
+;; file into the lisp/ directory in the Gnus source tree and run `make
+;; install'. And then, put the following expression into your ~/.gnus.
-;;; Definitions:
+;; (autoload 'gnus-group-make-shimbun-group
+;; "nnshimbun" "Create a nnshimbun group." t)
-(gnus-declare-backend "nnshimbun" 'address)
-(eval-when-compile (require 'cl))
+;;; Definitions:
+(eval-when-compile (require 'cl))
(require 'nnheader)
(require 'nnmail)
(require 'nnoo)
(require 'message)
+;; Customize variables
+(defgroup nnshimbun nil
+ "Reading Web Newspapers with Gnus."
+ :group 'gnus)
+
+(defcustom nnshimbun-keep-last-article t
+ "*If non-nil, nnshimbun will never delete a group's last article.
+It can be marked expirable, so it will be deleted when it is no
+longer last."
+ :group 'nnshimbun
+ :type 'boolean)
+
+(defcustom nnshimbun-keep-unparsable-dated-articles t
+ "*If non-nil, nnshimbun will never delete articles whose NOV date is unparsable."
+ :group 'nnshimbun
+ :type 'boolean)
+
+
+;; Define baekend
+(gnus-declare-backend "nnshimbun" 'address)
(nnoo-declare nnshimbun)
(defvoo nnshimbun-directory (nnheader-concat gnus-directory "shimbun/")
(insert "Xref: " xref "\t")
(when id
(insert "X-Nnshimbun-Id: " id "\t")))
- (if id
- (insert "\tX-Nnshimbun-Id: " id "\t")))
+ (when id
+ (insert "\tX-Nnshimbun-Id: " id "\t")))
;; Replace newlines with spaces in the current NOV line.
(while (progn
- (beginning-of-line)
+ (forward-line 0)
(> (point) start))
(backward-delete-char 1)
(insert " "))
(forward-line 1)
(forward-line 0)
(setq found t))))
- (if found
- (if nov
- (nnheader-parse-nov)
- ;; We return the article number.
- (ignore-errors (read (current-buffer))))))))
+ (when found
+ (if nov
+ (nnheader-parse-nov)
+ ;; We return the article number.
+ (ignore-errors (read (current-buffer))))))))
(defun nnshimbun-open-nov (group)
(let ((buffer (cdr (assoc group nnshimbun-nov-buffer-alist))))
(kill-buffer (current-buffer)))
(setq nnshimbun-nov-buffer-alist (cdr nnshimbun-nov-buffer-alist)))))
-(defvar nnshimbun-keep-last-article t
- "*If non-nil, nnshimbun will never delete a group's last article. It
-can be marked expirable, so it will be deleted when it is no longer
-last.")
-
-(defvar nnshimbun-keep-unparsable-dated-articles t
- "*If non-nil, nnshimbun will never delete articles whose NOV date is
-unparsable.")
-
(deffoo nnshimbun-request-expire-articles (articles group
&optional server force)
"Do expiration for the specified ARTICLES in the nnshimbun GROUP.
id))
+
+;;; Command to create nnshimbun group
+
+(defvar gnus-group-shimbun-server-history nil)
+
+;;;###autoload
+(defun gnus-group-make-shimbun-group ()
+ "Create a nnshimbun group."
+ (interactive)
+ (require 'nnshimbun)
+ (let* ((minibuffer-setup-hook
+ (append minibuffer-setup-hook '(beginning-of-line)))
+ (alist
+ (apply 'nconc
+ (mapcar
+ (lambda (d)
+ (and (stringp d)
+ (file-directory-p d)
+ (delq nil
+ (mapcar
+ (lambda (f)
+ (and (string-match "^sb-\\(.*\\)\\.el$" f)
+ (list (match-string 1 f))))
+ (directory-files d)))))
+ load-path)))
+ (server (completing-read
+ "Shimbun address: "
+ alist nil t
+ (or (car gnus-group-shimbun-server-history)
+ (caar alist))
+ 'gnus-group-shimbun-server-history))
+ (groups)
+ (nnshimbun-pre-fetch-article))
+ (require (intern (concat "sb-" server)))
+ (when (setq groups (intern-soft (concat "shimbun-" server "-groups")))
+ (gnus-group-make-group
+ (completing-read "Group name: "
+ (mapcar 'list (symbol-value groups))
+ nil t nil)
+ (list 'nnshimbun server)))))
+
+
(provide 'nnshimbun)
;;; nnshimbun.el ends here.