* lisp/gnus-art.el (article-update-date-lapsed): Check for
mime-preview-original-major-mode as well.
- (gnus-article-save-original-date): New macro.
- (gnus-article-prepare-mime-display): Use it.
- (gnus-article-prepare-display): Use it.
+ (gnus-article-prepare-mime-display): Use
+ gnus-article-save-original-date.
+ (gnus-article-prepare-display): Ditto.
2005-03-16 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-art.el (article-date-ut): Don't delete X-Sent header when
gnus-article-date-lapsed-new-header is t if date timer is active;
skip headers in which the original date value is empty.
- (gnus-article-date-value): New function.
- (gnus-article-save-original-date): Abolish.
- (gnus-display-mime): Save original date after doing all treatments
- as well.
+ (gnus-article-save-original-date): Redefine it as a macro.
+ (gnus-display-mime): Use it.
2005-04-22 Katsumi Yamaoka <yamaoka@jpl.org>
(interactive (list t))
(article-date-ut 'iso8601 highlight))
-(defun gnus-article-date-value ()
- "Return the value of the date header.
-The buffer is expected to be narrowed to just the header of the article."
- (goto-char (point-min))
- (let* ((case-fold-search t)
- (start (when (and (re-search-forward "^date:[\t\n ]+" nil t)
- (not (bolp)))
- (match-end 0))))
- (when (and start
- (re-search-forward "[\t ]*\n\\(?:[^\t ]\\|\\'\\)" nil t))
- (buffer-substring-no-properties start (match-beginning 0)))))
-
(defmacro gnus-article-save-original-date (&rest forms)
- "Save the original date as a text property."
- `(let ((date (,(symbol-function 'gnus-article-date-value))))
+ "Save the original date as a text property and evaluate FORMS."
+ `(let* ((case-fold-search t)
+ (start (progn
+ (goto-char (point-min))
+ (when (and (re-search-forward "^date:[\t\n ]+" nil t)
+ (not (bolp)))
+ (match-end 0))))
+ (date (when (and start
+ (re-search-forward "[\t ]*\n\\(?:[^\t ]\\|\\'\\)"
+ nil t))
+ (buffer-substring-no-properties start
+ (match-beginning 0)))))
(goto-char (point-max))
(skip-chars-backward "\n")
(put-text-property (point-min) (point) 'original-date date)