[gnus git] branch master updated: =1= (article-transform-date): Rewrite to still work when there are several rfc2822 parts.
Lars Magne Ingebrigtsen <[email protected]>
| Newsgroups | gmane.emacs.gnus.cvs |
|---|---|
| Message-ID | <[email protected]> |
via 370c215c8ab52a6d4e8c9be8e497de3c7f4760b7 (commit)
from 8943cf1ad32a11652fe72ef4d34025f9618176ec (commit)
- Log -----------------------------------------------------------------
commit 370c215c8ab52a6d4e8c9be8e497de3c7f4760b7
Author: Lars Magne Ingebrigtsen <[email protected]>
Date: Sun Jan 30 23:18:14 2011 -0800
(article-transform-date): Rewrite to still work when there are several rfc2822 parts.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c029694..2407e1b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2011-01-31 Lars Ingebrigtsen <[email protected]>
+ * gnus-art.el (article-transform-date): Rewrite to still work when
+ there are several rfc2822 parts.
+
* nnimap.el (nnimap-wait-for-response): Wait for results in a more
secure manner.
diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el
index 0fdd6bd..5d32c09 100644
--- a/lisp/gnus-art.el
+++ b/lisp/gnus-art.el
@@ -3420,23 +3420,6 @@ possible values."
pos date bface eface)
(save-excursion
(save-restriction
- (widen)
- (goto-char (point-min))
- (while (or (setq date (get-text-property (setq pos (point))
- 'original-date))
- (when (setq pos (next-single-property-change
- (point) 'original-date))
- (setq date (get-text-property pos 'original-date))
- t))
- (narrow-to-region
- pos (if (setq pos (text-property-any pos (point-max)
- 'original-date nil))
- (progn
- (goto-char pos)
- (if (or (bolp) (eobp))
- (point)
- (1+ (point))))
- (point-max)))
(goto-char (point-min))
(when (re-search-forward "^Date:" nil t)
(setq bface (get-text-property (point-at-bol) 'face)
@@ -3446,14 +3429,21 @@ possible values."
(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))))
+ (point)))
+ (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)))))
+ (point)))
+ (article-transform-date date type bface eface)
+ (forward-line 1)))))))
+
+(defun article-transform-date (date type bface eface)
(dolist (this-type (cond
((null type)
(list 'ut))
@@ -3463,19 +3453,17 @@ possible values."
type)))
(insert (article-make-date-line date (or this-type 'ut)) "\n")
(forward-line -1)
- (put-text-property (line-beginning-position)
- (1+ (line-beginning-position))
+ (beginning-of-line)
+ (put-text-property (point) (1+ (point))
+ 'original-date date)
+ (put-text-property (point) (1+ (point))
'gnus-date-type this-type)
;; Do highlighting.
- (beginning-of-line)
(when (looking-at "\\([^:]+\\): *\\(.*\\)$")
(put-text-property (match-beginning 1) (1+ (match-end 1))
'face bface)
(put-text-property (match-beginning 2) (match-end 2)
- 'face eface)))
- (put-text-property (point-min) (1- (point-max)) 'original-date date)
- (goto-char (point-max))
- (widen))))))
+ 'face eface))))
(defun article-make-date-line (date type)
"Return a DATE line of TYPE."
-----------------------------------------------------------------------
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 | 3 ++
lisp/gnus-art.el | 98 +++++++++++++++++++++++------------------------------
2 files changed, 46 insertions(+), 55 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