comparison lisp/gnus/nnml.el @ 19969:5f1ab3dd344d

*** empty log message ***
author Lars Magne Ingebrigtsen <larsi@gnus.org>
date Wed, 24 Sep 1997 01:50:24 +0000
parents f929cdcccb60
children a862fb5ba4a5
comparison
equal deleted inserted replaced
19968:88dd57f50303 19969:5f1ab3dd344d
36 (eval-when-compile (require 'cl)) 36 (eval-when-compile (require 'cl))
37 37
38 (nnoo-declare nnml) 38 (nnoo-declare nnml)
39 39
40 (defvoo nnml-directory message-directory 40 (defvoo nnml-directory message-directory
41 "Mail spool directory.") 41 "Spool directory for the nnml mail backend.")
42 42
43 (defvoo nnml-active-file 43 (defvoo nnml-active-file
44 (concat (file-name-as-directory nnml-directory) "active") 44 (concat (file-name-as-directory nnml-directory) "active")
45 "Mail active file.") 45 "Mail active file.")
46 46
472 ;;; Internal functions. 472 ;;; Internal functions.
473 473
474 (defun nnml-article-to-file (article) 474 (defun nnml-article-to-file (article)
475 (nnml-update-file-alist) 475 (nnml-update-file-alist)
476 (let (file) 476 (let (file)
477 (when (setq file (cdr (assq article nnml-article-file-alist))) 477 (if (setq file (cdr (assq article nnml-article-file-alist)))
478 (concat nnml-current-directory file)))) 478 (concat nnml-current-directory file)
479 ;; Just to make sure nothing went wrong when reading over NFS --
480 ;; check once more.
481 (when (file-exists-p
482 (setq file (concat nnml-current-directory "/"
483 (number-to-string article))))
484 (nnml-update-file-alist t)
485 file))))
479 486
480 (defun nnml-deletable-article-p (group article) 487 (defun nnml-deletable-article-p (group article)
481 "Say whether ARTICLE in GROUP can be deleted." 488 "Say whether ARTICLE in GROUP can be deleted."
482 (let (path) 489 (let (path)
483 (when (setq path (nnml-article-to-file article)) 490 (when (setq path (nnml-article-to-file article))
767 (goto-char (point-min)) 774 (goto-char (point-min))
768 (progn 775 (progn
769 (search-forward "\n\n" nil t) 776 (search-forward "\n\n" nil t)
770 (setq chars (- (point-max) (point))) 777 (setq chars (- (point-max) (point)))
771 (max 1 (1- (point))))) 778 (max 1 (1- (point)))))
772 (when (and (not (= 0 chars)) ; none of them empty files... 779 (unless (zerop (buffer-size))
773 (not (= (point-min) (point-max))))
774 (goto-char (point-min)) 780 (goto-char (point-min))
775 (setq headers (nnml-parse-head chars (caar files))) 781 (setq headers (nnml-parse-head chars (caar files)))
776 (save-excursion 782 (save-excursion
777 (set-buffer nov-buffer) 783 (set-buffer nov-buffer)
778 (goto-char (point-max)) 784 (goto-char (point-max))
798 (when (and (setq num (ignore-errors (read (current-buffer)))) 804 (when (and (setq num (ignore-errors (read (current-buffer))))
799 (numberp num)) 805 (numberp num))
800 (setf (car active) num))))))) 806 (setf (car active) num)))))))
801 t)) 807 t))
802 808
803 (defun nnml-update-file-alist () 809 (defun nnml-update-file-alist (&optional force)
804 (unless nnml-article-file-alist 810 (when (or (not nnml-article-file-alist)
811 force)
805 (setq nnml-article-file-alist 812 (setq nnml-article-file-alist
806 (nnheader-article-to-file-alist nnml-current-directory)))) 813 (nnheader-article-to-file-alist nnml-current-directory))))
807 814
808 (provide 'nnml) 815 (provide 'nnml)
809 816