Synch to No Gnus 200504280959.
[elisp/gnus.git-] / lisp / gnus-art.el
index 14d0144..c4fee02 100644 (file)
@@ -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)
@@ -4444,6 +4442,7 @@ This function is exclusively used by `gnus-mime-save-part-and-strip'
 and `gnus-mime-delete-part', and not provided at run-time normally."
     (gnus-article-edit-article
      `(lambda ()
+       (buffer-disable-undo)
        (erase-buffer)
        (let ((mail-parse-charset (or gnus-article-charset
                                      ',gnus-newsgroup-charset))
@@ -5038,7 +5037,7 @@ N is the numerical prefix."
          (set-window-point window point)))
       (let ((handles ihandles)
            (inhibit-read-only t)
-           handle date)
+           handle)
        (cond (handles)
              ((setq handles (mm-dissect-buffer nil gnus-article-loose-mime))
               (when gnus-article-emulate-mime