X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fnnmh.el;h=1b660f903c679423b5a308572b1d10f552d05c27;hb=f9e54240fc63f1ead8962e2afbc9b75e53994cd5;hp=fb1ad637dc330dd3e3928c003a78c8c3cd5078a2;hpb=a707b63af25b91cb730c12e65156ca364bf49a44;p=elisp%2Fgnus.git- diff --git a/lisp/nnmh.el b/lisp/nnmh.el index fb1ad63..1b660f9 100644 --- a/lisp/nnmh.el +++ b/lisp/nnmh.el @@ -4,7 +4,8 @@ ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen -;; Masanobu UMEDA +;; Masanobu UMEDA +;; MORIOKA Tomohiko ;; Keywords: news, mail ;; This file is part of GNU Emacs. @@ -32,11 +33,13 @@ ;;; Code: +(eval-when-compile (require 'cl)) +(eval-when-compile (require 'gnus-clfns)) + (require 'nnheader) (require 'nnmail) (require 'gnus-start) (require 'nnoo) -(eval-when-compile (require 'cl)) (nnoo-declare nnmh) @@ -86,6 +89,7 @@ as unread by Gnus.") (> number nnmail-large-newsgroup))) (count 0) (file-name-coding-system nnmail-pathname-coding-system) + (pathname-coding-system nnmail-pathname-coding-system) beg article) (nnmh-possibly-change-directory newsgroup server) ;; We don't support fetching by Message-ID. @@ -118,9 +122,34 @@ as unread by Gnus.") (when large (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) + (file-name-coding-system 'binary) + (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)) @@ -145,6 +174,7 @@ as unread by Gnus.") nil (concat nnmh-current-directory (int-to-string id)))) (file-name-coding-system nnmail-pathname-coding-system) + (pathname-coding-system nnmail-pathname-coding-system) (nntp-server-buffer (or buffer nntp-server-buffer))) (and (stringp file) (file-exists-p file) @@ -157,6 +187,7 @@ as unread by Gnus.") (nnmh-possibly-change-directory group server) (let ((pathname (nnmail-group-pathname group nnmh-directory)) (file-name-coding-system nnmail-pathname-coding-system) + (pathname-coding-system nnmail-pathname-coding-system) dir) (cond ((not (file-directory-p pathname)) @@ -200,6 +231,7 @@ as unread by Gnus.") (nnheader-insert "") (nnmh-possibly-change-directory nil server) (let ((file-name-coding-system nnmail-pathname-coding-system) + (pathname-coding-system nnmail-pathname-coding-system) (nnmh-toplev (file-truename (or dir (file-name-as-directory nnmh-directory))))) (nnmh-request-list-1 nnmh-toplev)) @@ -240,8 +272,8 @@ as unread by Gnus.") (expand-file-name nnmh-toplev)))) dir) (nnheader-replace-chars-in-string - (mm-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))))))) @@ -265,6 +297,13 @@ as unread by Gnus.") (setq is-old (nnmail-expired-article-p newsgroup mod-time force))) (progn + ;; Allow a special target group. -- jcn + (unless (eq nnmail-expiry-target 'delete) + (with-temp-buffer + (nnmh-request-article (car articles) + newsgroup server (current-buffer)) + (nnmail-expiry-target-group + nnmail-expiry-target newsgroup))) (nnheader-message 5 "Deleting article %s in %s..." article newsgroup) (condition-case () @@ -305,7 +344,9 @@ as unread by Gnus.") (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) @@ -412,7 +453,8 @@ as unread by Gnus.") (nnmh-open-server server)) (when newsgroup (let ((pathname (nnmail-group-pathname newsgroup nnmh-directory)) - (file-name-coding-system nnmail-pathname-coding-system)) + (file-name-coding-system nnmail-pathname-coding-system) + (pathname-coding-system nnmail-pathname-coding-system)) (if (file-directory-p pathname) (setq nnmh-current-directory pathname) (error "No such newsgroup: %s" newsgroup))))) @@ -462,6 +504,7 @@ as unread by Gnus.") (let ((active (cadr (assoc group nnmh-group-alist))) (dir (nnmail-group-pathname group nnmh-directory)) (file-name-coding-system nnmail-pathname-coding-system) + (pathname-coding-system nnmail-pathname-coding-system) file) (unless active ;; The group wasn't known to nnmh, so we just create an active