[gnus git] branch master updated: n0-17-269-g4804271 =1= gnus-art.el (article-date-ut): Work properly even when there are things like Date header in the body; work for forwarded parts.

Katsumi Yamaoka <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  48042713b1281704e409a0ced5ed80d93796c812 (commit)
      from  250de0bb9c335dca2bb226fa9572465273009425 (commit)


- Log -----------------------------------------------------------------
commit 48042713b1281704e409a0ced5ed80d93796c812
Author: Katsumi Yamaoka <[email protected]>
Date:   Fri Sep 9 10:16:31 2011 +0000

    gnus-art.el (article-date-ut): Work properly even when
     there are things like Date header in the body;
     work for forwarded parts.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 397c5d9..54b688d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-09  Katsumi Yamaoka  <[email protected]>
+
+	* gnus-art.el (article-date-ut): Work properly even when there are
+	things like Date header in the body; work for forwarded parts.
+
 2011-09-05  Andrew Cohen  <[email protected]>
 
 	* gnus-sum.el (gnus-summary-exit): Ensure we kill the proper
diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el
index 9d962fc..39abad7 100644
--- a/lisp/gnus-art.el
+++ b/lisp/gnus-art.el
@@ -3429,12 +3429,10 @@ possible values."
 	 (visible-date (mail-fetch-field "Date"))
 	 pos date bface eface)
     (save-excursion
-      (save-restriction
 	(goto-char (point-min))
 	(when (re-search-forward "^Date:" nil t)
 	  (setq bface (get-text-property (point-at-bol) 'face)
 		eface (get-text-property (1- (point-at-eol)) 'face)))
-	(goto-char (point-min))
 	;; Delete any old Date headers.
 	(if date-position
 	    (progn
@@ -3445,6 +3443,17 @@ possible values."
 			       (gnus-article-forward-header)
 			       (point)))
 	      (article-transform-date date type bface eface))
+	(save-restriction
+	  (widen)
+	  (goto-char (point-min))
+	  (while (or (get-text-property (setq pos (point)) 'original-date)
+		     (and (setq pos (next-single-property-change
+				     (point) 'original-date))
+			  (goto-char pos)))
+	    (narrow-to-region pos (if (search-forward "\n\n" nil t)
+				      (1+ (match-beginning 0))
+				    (point-max)))
+	    (goto-char (point-min))
 	  (while (re-search-forward "^Date:" nil t)
 	    (setq date (get-text-property (match-beginning 0) 'original-date))
 	    (delete-region (point-at-bol) (progn
@@ -3454,7 +3463,9 @@ possible values."
 		     visible-date)
 	    (setq date visible-date))
 	  (when date
-	    (article-transform-date date type bface eface)))))))
+	      (article-transform-date date type bface eface))
+	    (goto-char (point-max))
+	    (widen)))))))
 
 (defun article-transform-date (date type bface eface)
   (dolist (this-type (cond

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog   |    5 ++++
 lisp/gnus-art.el |   61 +++++++++++++++++++++++++++++++----------------------
 2 files changed, 41 insertions(+), 25 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.