From: yamaoka Date: Mon, 25 Apr 2005 07:22:55 +0000 (+0000) Subject: Synch to No Gnus 200504250722. X-Git-Tag: t-gnus-6_17_4-quimby-~496 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07a6dada6e030f51ce7d18f1e8a1a1ab956799ab;p=elisp%2Fgnus.git- Synch to No Gnus 200504250722. --- diff --git a/ChangeLog b/ChangeLog index bc1baaf..8e716bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,9 +2,9 @@ * 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 diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 424409a..05741af 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,10 +3,8 @@ * 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 diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 14d0144..f4a41d9 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -3262,21 +3262,19 @@ This format is defined by the `gnus-article-time-format' variable." (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)