* gnus-cache.el (gnus-cache-possibly-enter-article): Use it.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 19 May 2004 15:40:37 +0000 (15:40 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 19 May 2004 15:40:37 +0000 (15:40 +0000)
* nnheader.el (nnheader-get-lines-and-char): New function.

lisp/ChangeLog
lisp/gnus-cache.el
lisp/nnheader.el

index ba9da03..8970f8a 100644 (file)
@@ -1,3 +1,9 @@
+2004-05-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-cache.el (gnus-cache-possibly-enter-article): Use it.
+
+       * nnheader.el (nnheader-get-lines-and-char): New function.
+
 2004-05-19  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * gnus-msg.el (gnus-summary-followup-with-original): Document
index 5ff49fa..45c65b9 100644 (file)
@@ -153,7 +153,8 @@ it's not cached."
   (when (and (or force (not (eq gnus-use-cache 'passive)))
             (numberp article)
             (> article 0))             ; This might be a dummy article.
-    (let ((number article) file headers)
+    (let ((number article)
+         file headers lines-chars)
       ;; If this is a virtual group, we find the real group.
       (when (gnus-virtual-group-p group)
        (let ((result (nnvirtual-find-group-art
@@ -183,9 +184,12 @@ it's not cached."
              (let ((coding-system-for-write gnus-cache-coding-system))
                (gnus-write-buffer file)
                (gnus-cache-update-file-total-fetched-for group file))
+             (setq lines-chars (nnheader-get-lines-and-char))
              (nnheader-remove-body)
              (setq headers (nnheader-parse-naked-head))
              (mail-header-set-number headers number)
+             (mail-header-set-lines headers (car lines-chars))
+             (mail-header-set-chars headers (cadr lines-chars))
              (gnus-cache-change-buffer group)
              (set-buffer (cdr gnus-cache-buffer))
              (goto-char (point-max))
index 9e12f11..11d118e 100644 (file)
@@ -641,6 +641,14 @@ the line could be found."
      (point-max)))
   (goto-char (point-min)))
 
+(defun nnheader-get-lines-and-char ()
+  "Return the number of lines and chars in the article body."
+  (goto-char (point-min))
+  (if (not (re-search-forward "\n\r?\n" nil t))
+      (list 0 0)
+    (list (count-lines (point) (point-max))
+         (- (point-max) (point)))))
+
 (defun nnheader-remove-body ()
   "Remove the body from an article in this current buffer."
   (goto-char (point-min))