X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fnnmh.el;h=769d8652fa2297fc1c43ccbdfa2023f1c49ca17a;hb=55bc8c3145813effa0a57df9326c683eb77dbbe6;hp=8ac6e4452a5cea6f27c57c1d400b29fa05a00ca4;hpb=28e17e69957af33ccd27165fd6bfd5d487ec0a31;p=gnus diff --git a/lisp/nnmh.el b/lisp/nnmh.el index 8ac6e4452..769d8652f 100644 --- a/lisp/nnmh.el +++ b/lisp/nnmh.el @@ -1,7 +1,7 @@ ;;; nnmh.el --- mhspool access for Gnus -;; Copyright (C) 1995,96,97 Free Software Foundation, Inc. +;; Copyright (C) 1995,96,97,98 Free Software Foundation, Inc. -;; Author: Lars Magne Ingebrigtsen +;; Author: Lars Magne Ingebrigtsen ;; Masanobu UMEDA ;; Keywords: news, mail @@ -104,11 +104,11 @@ (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) 'headers)))) @@ -229,8 +229,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) + (mm-decode-coding-string (substring dir (match-end 0)) + nnmail-pathname-coding-system) ?/ ?.)) (apply 'max files) (apply 'min files))))))) @@ -242,15 +242,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 +264,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) @@ -303,22 +297,19 @@ (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 +326,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 +457,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 +533,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)