comparison lisp/gnus/nnmh.el @ 82951:0fde48feb604

Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
author Andreas Schwab <schwab@suse.de>
date Thu, 22 Jul 2004 16:45:51 +0000
parents 695cf19ef79e
children 88db2adda4b7 cce1c0ee76ee
comparison
equal deleted inserted replaced
56503:8bbd2323fbf2 82951:0fde48feb604
1 ;;; nnmh.el --- mhspool access for Gnus 1 ;;; nnmh.el --- mhspool access for Gnus
2 2
3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002 3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003
4 ;; Free Software Foundation, Inc. 4 ;; Free Software Foundation, Inc.
5 5
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> 6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7 ;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet> 7 ;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
8 ;; Keywords: news, mail 8 ;; Keywords: news, mail
9 9
10 ;; This file is part of GNU Emacs. 10 ;; This file is part of GNU Emacs.
11 11
12 ;; GNU Emacs is free software; you can redistribute it and/or modify 12 ;; GNU Emacs is free software; you can redistribute it and/or modify
39 (eval-when-compile (require 'cl)) 39 (eval-when-compile (require 'cl))
40 40
41 (nnoo-declare nnmh) 41 (nnoo-declare nnmh)
42 42
43 (defvoo nnmh-directory message-directory 43 (defvoo nnmh-directory message-directory
44 "*Mail spool directory.") 44 "Mail spool directory.")
45 45
46 (defvoo nnmh-get-new-mail t 46 (defvoo nnmh-get-new-mail t
47 "*If non-nil, nnmh will check the incoming mail file and split the mail.") 47 "If non-nil, nnmh will check the incoming mail file and split the mail.")
48 48
49 (defvoo nnmh-prepare-save-mail-hook nil 49 (defvoo nnmh-prepare-save-mail-hook nil
50 "*Hook run narrowed to an article before saving.") 50 "Hook run narrowed to an article before saving.")
51 51
52 (defvoo nnmh-be-safe nil 52 (defvoo nnmh-be-safe nil
53 "*If non-nil, nnmh will check all articles to make sure whether they are new or not. 53 "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 54 Go through the .nnmh-articles file and compare with the actual
55 articles in this folder. The articles that are \"new\" will be marked 55 articles in this folder. The articles that are \"new\" will be marked
56 as unread by Gnus.") 56 as unread by Gnus.")
57 57
58 58
237 (string-match 237 (string-match
238 (regexp-quote 238 (regexp-quote
239 (file-truename (file-name-as-directory 239 (file-truename (file-name-as-directory
240 (expand-file-name nnmh-toplev)))) 240 (expand-file-name nnmh-toplev))))
241 dir) 241 dir)
242 (nnheader-replace-chars-in-string 242 (mm-string-as-multibyte
243 (mm-decode-coding-string (substring dir (match-end 0)) 243 (mm-encode-coding-string
244 nnmail-pathname-coding-system) 244 (nnheader-replace-chars-in-string
245 ?/ ?.)) 245 (substring dir (match-end 0))
246 ?/ ?.)
247 nnmail-pathname-coding-system)))
246 (apply 'max files) 248 (apply 'max files)
247 (apply 'min files))))))) 249 (apply 'min files)))))))
248 t) 250 t)
249 251
250 (deffoo nnmh-request-newgroups (date &optional server) 252 (deffoo nnmh-request-newgroups (date &optional server)
286 (nconc rest articles))) 288 (nconc rest articles)))
287 289
288 (deffoo nnmh-close-group (group &optional server) 290 (deffoo nnmh-close-group (group &optional server)
289 t) 291 t)
290 292
291 (deffoo nnmh-request-move-article 293 (deffoo nnmh-request-move-article (article group server
292 (article group server accept-form &optional last) 294 accept-form &optional last)
293 (let ((buf (get-buffer-create " *nnmh move*")) 295 (let ((buf (get-buffer-create " *nnmh move*"))
294 result) 296 result)
295 (and 297 (and
296 (nnmh-deletable-article-p group article) 298 (nnmh-deletable-article-p group article)
297 (nnmh-request-article article group server) 299 (nnmh-request-article article group server)
312 314
313 (deffoo nnmh-request-accept-article (group &optional server last noinsert) 315 (deffoo nnmh-request-accept-article (group &optional server last noinsert)
314 (nnmh-possibly-change-directory group server) 316 (nnmh-possibly-change-directory group server)
315 (nnmail-check-syntax) 317 (nnmail-check-syntax)
316 (when nnmail-cache-accepted-message-ids 318 (when nnmail-cache-accepted-message-ids
317 (nnmail-cache-insert (nnmail-fetch-field "message-id"))) 319 (nnmail-cache-insert (nnmail-fetch-field "message-id")
320 group
321 (nnmail-fetch-field "subject")
322 (nnmail-fetch-field "from")))
318 (nnheader-init-server-buffer) 323 (nnheader-init-server-buffer)
319 (prog1 324 (prog1
320 (if (stringp group) 325 (if (stringp group)
321 (if noinsert 326 (if noinsert
322 (nnmh-active-number group) 327 (nnmh-active-number group)
420 (when newsgroup 425 (when newsgroup
421 (let ((pathname (nnmail-group-pathname newsgroup nnmh-directory)) 426 (let ((pathname (nnmail-group-pathname newsgroup nnmh-directory))
422 (file-name-coding-system nnmail-pathname-coding-system)) 427 (file-name-coding-system nnmail-pathname-coding-system))
423 (if (file-directory-p pathname) 428 (if (file-directory-p pathname)
424 (setq nnmh-current-directory pathname) 429 (setq nnmh-current-directory pathname)
425 (error "No such newsgroup: %s" newsgroup))))) 430 (nnheader-report 'nnmh "Not a directory: %s" nnmh-directory)))))
426 431
427 (defun nnmh-possibly-create-directory (group) 432 (defun nnmh-possibly-create-directory (group)
428 (let (dir dirs) 433 (let (dir dirs)
429 (setq dir (nnmail-group-pathname group nnmh-directory)) 434 (setq dir (nnmail-group-pathname group nnmh-directory))
430 (while (not (file-directory-p dir)) 435 (while (not (file-directory-p dir))