emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105696: gnus-art.el (article-date-ut


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105696: gnus-art.el (article-date-ut): Work properly even when
Date: Fri, 09 Sep 2011 10:18:45 +0000
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105696
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Fri 2011-09-09 10:18:45 +0000
message:
  gnus-art.el (article-date-ut): Work properly even when
   there are things like Date header in the body;
   work for forwarded parts.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-art.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2011-09-05 22:07:34 +0000
+++ b/lisp/gnus/ChangeLog       2011-09-09 10:18:45 +0000
@@ -1,3 +1,8 @@
+2011-09-09  Katsumi Yamaoka  <address@hidden>
+
+       * 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  <address@hidden>
 
        * gnus-sum.el (gnus-summary-exit): Ensure we kill the proper

=== modified file 'lisp/gnus/gnus-art.el'
--- a/lisp/gnus/gnus-art.el     2011-09-04 22:17:09 +0000
+++ b/lisp/gnus/gnus-art.el     2011-09-09 10:18:45 +0000
@@ -3429,32 +3429,43 @@
         (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
-             (goto-char date-position)
-             (setq date (get-text-property (point) 'original-date))
-             (delete-region (point)
-                            (progn
-                              (gnus-article-forward-header)
-                              (point)))
+      (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)))
+      ;; Delete any old Date headers.
+      (if date-position
+         (progn
+           (goto-char date-position)
+           (setq date (get-text-property (point) 'original-date))
+           (delete-region (point)
+                          (progn
+                            (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
+                                             (gnus-article-forward-header)
+                                             (point))))
+           (when (and (not date)
+                      visible-date)
+             (setq date visible-date))
+           (when date
              (article-transform-date date type bface eface))
-         (while (re-search-forward "^Date:" nil t)
-           (setq date (get-text-property (match-beginning 0) 'original-date))
-           (delete-region (point-at-bol) (progn
-                                           (gnus-article-forward-header)
-                                           (point))))
-         (when (and (not date)
-                    visible-date)
-           (setq date visible-date))
-         (when date
-           (article-transform-date date type bface eface)))))))
+           (goto-char (point-max))
+           (widen)))))))
 
 (defun article-transform-date (date type bface eface)
   (dolist (this-type (cond


reply via email to

[Prev in Thread] Current Thread [Next in Thread]