X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lisp%2Fnnmh.el;h=d9f107de16d79339e9f08a0c3ac1b8ecbb4a78ec;hb=f30e92e077b73ab05a2d8f6a230fbcea61eb7493;hp=8ac6e4452a5cea6f27c57c1d400b29fa05a00ca4;hpb=097cf341cfee92e9d5d30de9bdbc14a50ddfe414;p=elisp%2Fgnus.git- diff --git a/lisp/nnmh.el b/lisp/nnmh.el index 8ac6e44..d9f107d 100644 --- a/lisp/nnmh.el +++ b/lisp/nnmh.el @@ -1,8 +1,9 @@ ;;; nnmh.el --- mhspool access for Gnus -;; Copyright (C) 1995,96,97 Free Software Foundation, Inc. +;; Copyright (C) 1995,96,97,98,99 Free Software Foundation, Inc. -;; Author: Lars Magne Ingebrigtsen -;; Masanobu UMEDA +;; Author: Lars Magne Ingebrigtsen +;; Masanobu UMEDA +;; MORIOKA Tomohiko ;; Keywords: news, mail ;; This file is part of GNU Emacs. @@ -104,15 +105,39 @@ (and large (zerop (% count 20)) - (message "nnmh: Receiving headers... %d%%" + (nnheader-message 5 "nnmh: Receiving headers... %d%%" (/ (* count 100) number)))) (when large - (message "nnmh: Receiving headers...done")) + (nnheader-message 5 "nnmh: Receiving headers...done")) - (nnheader-fold-continuation-lines) + ;; (nnheader-fold-continuation-lines) 'headers)))) +(deffoo nnmh-retrieve-parsed-headers (articles + dependencies + &optional newsgroup server fetch-old + force-new) + (save-excursion + (set-buffer nntp-server-buffer) + (let* ((file nil) + (number (length articles)) + (large (and (numberp nnmail-large-newsgroup) + (> number nnmail-large-newsgroup))) + (count 0) + (pathname-coding-system 'binary) + (case-fold-search t) + ;;beg + article + headers header id end ref lines chars ctype in-reply-to + (cur (current-buffer))) + (nnmh-possibly-change-directory newsgroup server) + ;; We don't support fetching by Message-ID. + (nnheader-retrieve-headers-from-directory + articles nnmh-current-directory dependencies + fetch-old force-new large "nnmh") + ))) + (deffoo nnmh-open-server (server &optional defs) (nnoo-change-server 'nnmh server defs) (when (not (file-exists-p nnmh-directory)) @@ -229,8 +254,8 @@ (expand-file-name nnmh-toplev)))) dir) (nnheader-replace-chars-in-string - (gnus-decode-coding-string (substring dir (match-end 0)) - nnmail-pathname-coding-system) + (decode-coding-string (substring dir (match-end 0)) + nnmail-pathname-coding-system) ?/ ?.)) (apply 'max files) (apply 'min files))))))) @@ -242,15 +267,9 @@ (deffoo nnmh-request-expire-articles (articles newsgroup &optional server force) (nnmh-possibly-change-directory newsgroup server) - (let* ((active-articles - (mapcar - (function - (lambda (name) - (string-to-int name))) - (directory-files nnmh-current-directory nil "^[0-9]+$" t))) - (is-old t) + (let* ((is-old t) article rest mod-time) - (nnmail-activate 'nnmh) + (nnheader-init-server-buffer) (while (and articles is-old) (setq article (concat nnmh-current-directory @@ -270,7 +289,7 @@ (push (car articles) rest)))) (push (car articles) rest))) (setq articles (cdr articles))) - (message "") + (nnheader-message 5 "") (nconc rest articles))) (deffoo nnmh-close-group (group &optional server) @@ -300,25 +319,24 @@ (deffoo nnmh-request-accept-article (group &optional server last noinsert) (nnmh-possibly-change-directory group server) - (nnmail-check-syntax) + (if (and (not (equal group "queue")) + (not (equal group "draft"))) + (nnmail-check-syntax)) (when nnmail-cache-accepted-message-ids (nnmail-cache-insert (nnmail-fetch-field "message-id"))) + (nnheader-init-server-buffer) (prog1 (if (stringp group) - (and - (nnmail-activate 'nnmh) - (if noinsert - (nnmh-active-number group) - (car (nnmh-save-mail - (list (cons group (nnmh-active-number group))) - noinsert)))) - (and - (nnmail-activate 'nnmh) - (let ((res (nnmail-article-group 'nnmh-active-number))) - (if (and (null res) - (yes-or-no-p "Moved to `junk' group; delete article? ")) - 'junk - (car (nnmh-save-mail res noinsert)))))) + (if noinsert + (nnmh-active-number group) + (car (nnmh-save-mail + (list (cons group (nnmh-active-number group))) + noinsert))) + (let ((res (nnmail-article-group 'nnmh-active-number))) + (if (and (null res) + (yes-or-no-p "Moved to `junk' group; delete article? ")) + 'junk + (car (nnmh-save-mail res noinsert))))) (when (and last nnmail-cache-accepted-message-ids) (nnmail-cache-close)))) @@ -335,7 +353,7 @@ t))) (deffoo nnmh-request-create-group (group &optional server args) - (nnmail-activate 'nnmh) + (nnheader-init-server-buffer) (unless (assoc group nnmh-group-alist) (let (active) (push (list group (setq active (cons 1 0))) @@ -466,7 +484,7 @@ (setq active (cons 1 0)) (push (list group active) nnmh-group-alist) (unless (file-exists-p dir) - (make-directory dir)) + (gnus-make-directory dir)) ;; Find the highest number in the group. (let ((files (sort (mapcar @@ -542,7 +560,7 @@ (setq articles (sort articles (lambda (art1 art2) (> (car art1) (car art2))))) ;; Finally write this list back to the .nnmh-articles file. - (nnheader-temp-write nnmh-file + (with-temp-file nnmh-file (insert ";; Gnus article active file for " group "\n\n") (insert "(setq nnmh-newsgroup-articles '") (gnus-prin1 articles)