X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;ds=sidebyside;f=lisp%2Fnnspool.el;h=d4eba69a74cf312de2b1bb571b8b1eeb2dcaf527;hb=8c5920bae3428e75881d20f6ea8893ed79cea7cc;hp=dd3d89cca9393ea511ce9e756bf040af2678af1a;hpb=29d88dc82d12421f6616ab1dcd11a3035a0875ee;p=gnus diff --git a/lisp/nnspool.el b/lisp/nnspool.el index dd3d89cca..d4eba69a7 100644 --- a/lisp/nnspool.el +++ b/lisp/nnspool.el @@ -1,8 +1,11 @@ ;;; nnspool.el --- spool access for GNU Emacs -;; Copyright (C) 1988,89,90,93,94,95,96,97,98 Free Software Foundation, Inc. + +;; Copyright (C) 1988, 1989, 1990, 1993, 1994, 1995, 1996, 1997, 1998, +;; 2000, 2002, 2003 +;; Free Software Foundation, Inc. ;; Author: Masanobu UMEDA -;; Lars Magne Ingebrigtsen +;; Lars Magne Ingebrigtsen ;; Keywords: news ;; This file is part of GNU Emacs. @@ -47,7 +50,10 @@ If you are using Cnews, you probably should set this variable to nil.") (defvoo nnspool-nov-directory (concat nnspool-spool-directory "over.view/") "Local news nov directory.") -(defvoo nnspool-lib-dir "/usr/lib/news/" +(defvoo nnspool-lib-dir + (if (file-exists-p "/usr/lib/news/active") + "/usr/lib/news/" + "/var/lib/news/") "Where the local news library files are stored.") (defvoo nnspool-active-file (concat nnspool-lib-dir "active") @@ -66,8 +72,8 @@ If you are using Cnews, you probably should set this variable to nil.") "Local news active date file.") (defvoo nnspool-large-newsgroup 50 - "The number of the articles which indicates a large newsgroup. -If the number of the articles is greater than the value, verbose + "The number of articles which indicates a large newsgroup. +If the number of articles is greater than the value, verbose messages will be shown to indicate the current status.") (defvoo nnspool-nov-is-evil nil @@ -136,15 +142,20 @@ there.") (setq beg (point)) (inline (nnheader-insert-head file)) (goto-char beg) - (search-forward "\n\n" nil t) - (forward-char -1) - (insert ".\n") + (if (search-forward "\n\n" nil t) + (progn + (forward-char -1) + (insert ".\n")) + (goto-char (point-max)) + (if (bolp) + (insert ".\n") + (insert "\n.\n"))) (delete-region (point) (point-max))) (and do-message (zerop (% (incf count) 20)) (nnheader-message 5 "nnspool: Receiving headers... %d%%" - (/ (* count 100) number)))) + (/ (* count 100) number)))) (when do-message (nnheader-message 5 "nnspool: Receiving headers...done")) @@ -294,8 +305,8 @@ there.") (read (current-buffer))) seconds)) (push (buffer-substring - (match-beginning 1) (match-end 1)) - groups) + (match-beginning 1) (match-end 1)) + groups) (zerop (forward-line -1)))) (erase-buffer) (while groups @@ -320,7 +331,8 @@ there.") () (nnheader-report 'nnspool "") (set-process-sentinel proc 'nnspool-inews-sentinel) - (process-send-region proc (point-min) (point-max)) + (mm-with-unibyte-current-buffer + (process-send-region proc (point-min) (point-max))) ;; We slap a condition-case around this, because the process may ;; have exited already... (ignore-errors @@ -352,7 +364,7 @@ there.") (let ((nov (nnheader-group-pathname nnspool-current-group nnspool-nov-directory ".overview")) (arts articles) - (nnheader-file-coding-system nnspool-file-coding-system) + (nnheader-file-coding-system nnspool-file-coding-system) last) (if (not (file-exists-p nov)) () @@ -433,8 +445,8 @@ there.") (set-buffer nntp-server-buffer) (erase-buffer) (condition-case () - (let ((nnheader-file-coding-system nnspool-file-coding-system)) - (nnheader-insert-file-contents file) + (let ((coding-system-for-read nnspool-file-coding-system)) + (mm-insert-file-contents file) t) (file-error nil))) @@ -448,7 +460,7 @@ there.") (nnheader-report 'nnspool "No such newsgroup: %s" group))))) (defun nnspool-article-pathname (group &optional article) - "Find the path for GROUP." + "Find the file name for GROUP." (nnheader-group-pathname group nnspool-spool-directory article)) (provide 'nnspool)