1 |
;;; nnmh.el --- mhspool access for Gnus |
;;; nnmh.el --- mhspool access for Gnus |
2 |
|
|
3 |
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002 |
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003 |
4 |
;; Free Software Foundation, Inc. |
;; Free Software Foundation, Inc. |
5 |
|
|
6 |
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
7 |
;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet> |
;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet> |
8 |
;; Keywords: news, mail |
;; Keywords: news, mail |
9 |
|
|
10 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
41 |
(nnoo-declare nnmh) |
(nnoo-declare nnmh) |
42 |
|
|
43 |
(defvoo nnmh-directory message-directory |
(defvoo nnmh-directory message-directory |
44 |
"*Mail spool directory.") |
"Mail spool directory.") |
45 |
|
|
46 |
(defvoo nnmh-get-new-mail t |
(defvoo nnmh-get-new-mail t |
47 |
"*If non-nil, nnmh will check the incoming mail file and split the mail.") |
"If non-nil, nnmh will check the incoming mail file and split the mail.") |
48 |
|
|
49 |
(defvoo nnmh-prepare-save-mail-hook nil |
(defvoo nnmh-prepare-save-mail-hook nil |
50 |
"*Hook run narrowed to an article before saving.") |
"Hook run narrowed to an article before saving.") |
51 |
|
|
52 |
(defvoo nnmh-be-safe nil |
(defvoo nnmh-be-safe nil |
53 |
"*If non-nil, nnmh will check all articles to make sure whether they are new or not. |
"If non-nil, nnmh will check all articles to make sure whether they are new or not. |
54 |
Go through the .nnmh-articles file and compare with the actual |
Go through the .nnmh-articles file and compare with the actual |
55 |
articles in this folder. The articles that are \"new\" will be marked |
articles in this folder. The articles that are \"new\" will be marked |
56 |
as unread by Gnus.") |
as unread by Gnus.") |
239 |
(file-truename (file-name-as-directory |
(file-truename (file-name-as-directory |
240 |
(expand-file-name nnmh-toplev)))) |
(expand-file-name nnmh-toplev)))) |
241 |
dir) |
dir) |
242 |
(nnheader-replace-chars-in-string |
(mm-string-as-multibyte |
243 |
(mm-decode-coding-string (substring dir (match-end 0)) |
(mm-encode-coding-string |
244 |
nnmail-pathname-coding-system) |
(nnheader-replace-chars-in-string |
245 |
?/ ?.)) |
(substring dir (match-end 0)) |
246 |
|
?/ ?.) |
247 |
|
nnmail-pathname-coding-system))) |
248 |
(apply 'max files) |
(apply 'max files) |
249 |
(apply 'min files))))))) |
(apply 'min files))))))) |
250 |
t) |
t) |
290 |
(deffoo nnmh-close-group (group &optional server) |
(deffoo nnmh-close-group (group &optional server) |
291 |
t) |
t) |
292 |
|
|
293 |
(deffoo nnmh-request-move-article |
(deffoo nnmh-request-move-article (article group server |
294 |
(article group server accept-form &optional last) |
accept-form &optional last) |
295 |
(let ((buf (get-buffer-create " *nnmh move*")) |
(let ((buf (get-buffer-create " *nnmh move*")) |
296 |
result) |
result) |
297 |
(and |
(and |
316 |
(nnmh-possibly-change-directory group server) |
(nnmh-possibly-change-directory group server) |
317 |
(nnmail-check-syntax) |
(nnmail-check-syntax) |
318 |
(when nnmail-cache-accepted-message-ids |
(when nnmail-cache-accepted-message-ids |
319 |
(nnmail-cache-insert (nnmail-fetch-field "message-id"))) |
(nnmail-cache-insert (nnmail-fetch-field "message-id") |
320 |
|
group |
321 |
|
(nnmail-fetch-field "subject") |
322 |
|
(nnmail-fetch-field "from"))) |
323 |
(nnheader-init-server-buffer) |
(nnheader-init-server-buffer) |
324 |
(prog1 |
(prog1 |
325 |
(if (stringp group) |
(if (stringp group) |
427 |
(file-name-coding-system nnmail-pathname-coding-system)) |
(file-name-coding-system nnmail-pathname-coding-system)) |
428 |
(if (file-directory-p pathname) |
(if (file-directory-p pathname) |
429 |
(setq nnmh-current-directory pathname) |
(setq nnmh-current-directory pathname) |
430 |
(error "No such newsgroup: %s" newsgroup))))) |
(nnheader-report 'nnmh "Not a directory: %s" nnmh-directory))))) |
431 |
|
|
432 |
(defun nnmh-possibly-create-directory (group) |
(defun nnmh-possibly-create-directory (group) |
433 |
(let (dir dirs) |
(let (dir dirs) |