* gnus-registry.el: added brief explanation of basics
[gnus] / lisp / nnfolder.el
index 37dc786..ae1d696 100644 (file)
@@ -1,5 +1,5 @@
 ;;; nnfolder.el --- mail folder access for Gnus
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org> (adding MARKS)
@@ -202,7 +202,7 @@ the group.  Then the marks file will be regenerated properly by Gnus.")
                        (goto-char (match-end 0))
                        (setq num (string-to-int
                                   (buffer-substring
-                                   (point) (progn (end-of-line) (point)))))
+                                   (point) (gnus-point-at-eol))))
                        (goto-char start)
                        (< num article)))
                      ;; Check that we are before an article with a
@@ -212,7 +212,7 @@ the group.  Then the marks file will be regenerated properly by Gnus.")
                      (progn
                        (setq num (string-to-int
                                   (buffer-substring
-                                   (point) (progn (end-of-line) (point)))))
+                                   (point) (gnus-point-at-eol))))
                        (> num article))
                      ;; Discard any article numbers before the one we're
                      ;; now looking at.
@@ -285,9 +285,8 @@ the group.  Then the marks file will be regenerated properly by Gnus.")
            (cons nnfolder-current-group
                  (if (search-forward (concat "\n" nnfolder-article-marker)
                                      nil t)
-                     (string-to-int
-                      (buffer-substring
-                       (point) (progn (end-of-line) (point))))
+                     (string-to-int (buffer-substring
+                                     (point) (gnus-point-at-eol)))
                    -1))))))))
 
 (deffoo nnfolder-request-group (group &optional server dont-check)
@@ -483,8 +482,7 @@ the group.  Then the marks file will be regenerated properly by Gnus.")
                 (concat "^" nnfolder-article-marker)
                 (save-excursion (and (search-forward "\n\n" nil t) (point)))
                 t)
-          (delete-region (progn (beginning-of-line) (point))
-                         (progn (forward-line 1) (point))))
+          (gnus-delete-line))
         (setq result (eval accept-form))
         (kill-buffer buf)
         result)
@@ -510,9 +508,9 @@ the group.  Then the marks file will be regenerated properly by Gnus.")
          result art-group)
       (goto-char (point-min))
       (when (looking-at "X-From-Line: ")
-       (save-match-data
-         (mail-header-unfold-field))
-       (replace-match "From "))
+       (replace-match "From ")
+       (while (progn (forward-line) (looking-at "[ \t]"))
+         (delete-char -1)))
       (with-temp-buffer
        (let ((nnmail-file-coding-system nnfolder-active-file-coding-system)
              (nntp-server-buffer (current-buffer)))
@@ -526,7 +524,9 @@ the group.  Then the marks file will be regenerated properly by Gnus.")
        (while (re-search-backward (concat "^" nnfolder-article-marker) nil t)
          (delete-region (point) (progn (forward-line 1) (point))))
        (when nnmail-cache-accepted-message-ids
-         (nnmail-cache-insert (nnmail-fetch-field "message-id") group))
+         (nnmail-cache-insert (nnmail-fetch-field "message-id") 
+                              group
+                              (nnmail-fetch-field "subject")))
        (setq result (if (stringp group)
                         (list (cons group (nnfolder-active-number group)))
                       (setq art-group
@@ -1046,7 +1046,7 @@ This command does not work if you use short group names."
     (nnheader-message 5 "")))
 
 (defun nnfolder-group-pathname (group)
-  "Make pathname for GROUP."
+  "Make file name for GROUP."
   (setq group
        (mm-encode-coding-string group nnmail-pathname-coding-system))
   (let ((dir (file-name-as-directory (expand-file-name nnfolder-directory))))
@@ -1150,13 +1150,7 @@ This command does not work if you use short group names."
        (if (search-forward "\n\n" e t) (setq e (1- (point)))))
       (with-temp-buffer
        (insert-buffer-substring buf b e)
-       ;; 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 ? )
-       (let ((headers (nnheader-parse-head t)))
+       (let ((headers (nnheader-parse-naked-head)))
          (mail-header-set-chars headers chars)
          (mail-header-set-number headers number)
          headers)))))