Indent.
[gnus] / lisp / nnml.el
index 976b75a..25b3913 100644 (file)
@@ -4,7 +4,7 @@
 
 ;; Author: Simon Josefsson <simon@josefsson.org> (adding MARKS)
 ;;      Lars Magne Ingebrigtsen <larsi@gnus.org>
-;;     Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
+;;     Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 ;; Keywords: news, mail
 
 ;; This file is part of GNU Emacs.
@@ -369,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)
@@ -522,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)))
@@ -701,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))))
@@ -740,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)))))
@@ -830,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)))
@@ -842,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)
@@ -893,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
@@ -985,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