[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r103045: gnus-art.el (article-transfo
From: |
Katsumi Yamaoka |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r103045: gnus-art.el (article-transform-date): Rewrite to still work when there are several rfc2822 parts. |
Date: |
Mon, 31 Jan 2011 07:27:07 +0000 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 103045
author: Lars Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Mon 2011-01-31 07:27:07 +0000
message:
gnus-art.el (article-transform-date): Rewrite to still work when there are
several rfc2822 parts.
modified:
lisp/gnus/ChangeLog
lisp/gnus/gnus-art.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog 2011-01-31 04:41:38 +0000
+++ b/lisp/gnus/ChangeLog 2011-01-31 07:27:07 +0000
@@ -1,5 +1,8 @@
2011-01-31 Lars Ingebrigtsen <address@hidden>
+ * 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.
=== modified file 'lisp/gnus/gnus-art.el'
--- a/lisp/gnus/gnus-art.el 2011-01-31 04:41:38 +0000
+++ b/lisp/gnus/gnus-art.el 2011-01-31 07:27:07 +0000
@@ -3420,62 +3420,50 @@
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)
- 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)
- (delete-region (point)
- (progn
- (gnus-article-forward-header)
- (point))))
- (while (re-search-forward "^Date:" nil t)
- (delete-region (point-at-bol) (progn
- (gnus-article-forward-header)
- (point)))))
- (dolist (this-type (cond
- ((null type)
- (list 'ut))
- ((atom type)
- (list type))
- (t
- 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))
- '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))))))
+ (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)))
+ (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)))
+ (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))
+ ((atom type)
+ (list type))
+ (t
+ type)))
+ (insert (article-make-date-line date (or this-type 'ut)) "\n")
+ (forward-line -1)
+ (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.
+ (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))))
(defun article-make-date-line (date type)
"Return a DATE line of TYPE."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r103045: gnus-art.el (article-transform-date): Rewrite to still work when there are several rfc2822 parts.,
Katsumi Yamaoka <=