X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fnnml.el;h=25b3913591ab889b7b0c339101a7f568faefe27c;hb=fda79fc773c3018266173a6c4ea3776685845c1d;hp=0f08c73828ecaf2ab4d19a4fc554113916cf461c;hpb=e99c48d8ba2e5e9cd01540025319fa8c1fc3c1fd;p=gnus diff --git a/lisp/nnml.el b/lisp/nnml.el index 0f08c7382..25b391359 100644 --- a/lisp/nnml.el +++ b/lisp/nnml.el @@ -4,7 +4,7 @@ ;; Author: Simon Josefsson (adding MARKS) ;; Lars Magne Ingebrigtsen -;; Masanobu UMEDA +;; Masanobu UMEDA ;; Keywords: news, mail ;; This file is part of GNU Emacs. @@ -299,7 +299,8 @@ marks file will be regenerated properly by Gnus.") (setq articles (gnus-sorted-intersection articles active-articles)) (while (and articles is-old) - (if (and (setq article (nnml-article-to-file (setq number (pop articles)))) + (if (and (setq article (nnml-article-to-file + (setq number (pop articles)))) (setq mod-time (nth 5 (file-attributes article))) (nnml-deletable-article-p group number) (setq is-old (nnmail-expired-article-p group mod-time force @@ -368,7 +369,7 @@ marks file will be regenerated properly by Gnus.") (nnmail-check-syntax) (let (result) (when nnmail-cache-accepted-message-ids - (nnmail-cache-insert (nnmail-fetch-field "message-id"))) + (nnmail-cache-insert (nnmail-fetch-field "message-id") group)) (if (stringp group) (and (nnmail-activate 'nnml) @@ -521,7 +522,7 @@ marks file will be regenerated properly by Gnus.") (expand-file-name file nnml-current-directory) (when (not nnheader-directory-files-is-safe) ;; Just to make sure nothing went wrong when reading over NFS -- - ;; check once more. + ;; check once more. (when (file-exists-p (setq file (expand-file-name (number-to-string article) nnml-current-directory))) @@ -700,16 +701,10 @@ marks file will be regenerated properly by Gnus.") (unless (zerop (buffer-size)) (narrow-to-region (goto-char (point-min)) - (if (re-search-forward "\n\r?\n" nil t) (1- (point)) (point-max)))) - ;; Fold continuation lines. - (goto-char (point-min)) - (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t) - (replace-match " " t t)) - ;; Remove any tabs; they are too confusing. - (subst-char-in-region (point-min) (point-max) ?\t ? ) - ;; Remove any ^M's; they are too confusing. - (subst-char-in-region (point-min) (point-max) ?\r ? ) - (let ((headers (nnheader-parse-head t))) + (if (re-search-forward "\n\r?\n" nil t) + (1- (point)) + (point-max)))) + (let ((headers (nnheader-parse-naked-head))) (mail-header-set-chars headers chars) (mail-header-set-number headers number) headers)))) @@ -739,8 +734,8 @@ marks file will be regenerated properly by Gnus.") (when (buffer-name (cdar nnml-nov-buffer-alist)) (set-buffer (cdar nnml-nov-buffer-alist)) (when (buffer-modified-p) - (nnmail-write-region 1 (point-max) nnml-nov-buffer-file-name - nil 'nomesg)) + (nnmail-write-region (point-min) (point-max) + nnml-nov-buffer-file-name nil 'nomesg)) (set-buffer-modified-p nil) (kill-buffer (current-buffer))) (setq nnml-nov-buffer-alist (cdr nnml-nov-buffer-alist))))) @@ -829,7 +824,7 @@ marks file will be regenerated properly by Gnus.") (progn (re-search-forward "\n\r?\n" nil t) (setq chars (- (point-max) (point))) - (max 1 (1- (point))))) + (max (point-min) (1- (point))))) (unless (zerop (buffer-size)) (goto-char (point-min)) (setq headers (nnml-parse-head chars (caar files))) @@ -841,7 +836,7 @@ marks file will be regenerated properly by Gnus.") (setq files (cdr files))) (save-excursion (set-buffer nov-buffer) - (nnmail-write-region 1 (point-max) nov nil 'nomesg) + (nnmail-write-region (point-min) (point-max) nov nil 'nomesg) (kill-buffer (current-buffer)))))) (defun nnml-nov-delete-article (group article) @@ -892,7 +887,7 @@ Use the nov database for that directory if available." (defun nnml-current-group-article-to-file-alist () "Return an alist of article/file pairs in the current group. Use the nov database for the current group if available." - (if (or gnus-nov-is-evil + (if (or gnus-nov-is-evil nnml-nov-is-evil (not (file-exists-p (expand-file-name nnml-nov-file-name @@ -984,8 +979,8 @@ Use the nov database for the current group if available." (error "Cannot write to %s (%s)" err)))))) (defun nnml-open-marks (group server) - (let ((file (expand-file-name - nnml-marks-file-name + (let ((file (expand-file-name + nnml-marks-file-name (nnmail-group-pathname group nnml-directory)))) (if (file-exists-p file) (condition-case err @@ -1010,7 +1005,8 @@ Use the nov database for the current group if available." (push (cons 'read (gnus-info-read info)) nnml-marks) (dolist (el gnus-article-unpropagated-mark-lists) (setq nnml-marks (gnus-remassoc el nnml-marks))) - (nnml-save-marks group server))))) + (nnml-save-marks group server) + (nnheader-message 7 "Bootstrapping marks for %s...done" group))))) (provide 'nnml)