* 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 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)
+ ,@forms
+ (goto-char (point-max))
+ (skip-chars-backward "\n")
+ (put-text-property (point-min) (point) 'original-date date)))
;; (defun article-show-all ()
;; "Show all hidden text in the article buffer."
(save-restriction
(article-goto-body)
(narrow-to-region (point-min) (point))
- (setq date (gnus-article-date-value))
- (goto-char (point-max))
- (skip-chars-backward "\n")
- (put-text-property (point-min) (point)
- 'original-date date)
- (gnus-treat-article 'head)
- (goto-char (point-max))
- (skip-chars-backward "\n")
- (put-text-property (point-min) (point)
- 'original-date date))))))))
+ (gnus-article-save-original-date
+ (gnus-treat-article 'head)))))))))
(defcustom gnus-mime-display-multipart-as-mixed nil
"Display \"multipart\" parts as \"multipart/mixed\".