(article-display-face): Improve the efficiency.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 1 Jul 2005 08:53:32 +0000 (08:53 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 1 Jul 2005 08:53:32 +0000 (08:53 +0000)
lisp/ChangeLog
lisp/gnus-art.el

index f5275fa..674f345 100644 (file)
@@ -1,3 +1,7 @@
+2005-07-01  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (article-display-face): Improve the efficiency.
+
 2005-06-30  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-art.el (article-display-face): Correct the position in
index 52fd833..0896592 100644 (file)
@@ -2162,28 +2162,26 @@ unfolded."
       ;; read-only.
       (if (and wash-face-p (memq 'face gnus-article-wash-types))
          (gnus-delete-images 'face)
-       (let ((from (gnus-article-goto-header "from"))
-             face faces)
-         (save-excursion
+       (let (face faces from)
+         (save-current-buffer
            (when (and wash-face-p
-                      (progn
-                        (goto-char (point-min))
-                        (not (re-search-forward "^Face:[\t ]*" nil t)))
-                      (gnus-buffer-live-p gnus-original-article-buffer))
+                      (gnus-buffer-live-p gnus-original-article-buffer)
+                      (not (re-search-forward "^Face:[\t ]*" nil t)))
              (set-buffer gnus-original-article-buffer))
            (save-restriction
              (mail-narrow-to-head)
              (while (gnus-article-goto-header "Face")
                (push (mail-header-field-value) faces))))
          (when faces
-           (unless from
-             (insert "From:")
-             (setq from (point))
-             (insert "[no `from' set]\n"))
-           (dolist (face faces)
-             (let ((png (gnus-convert-face-to-png face))
-                   image)
-               (when png
+           (goto-char (point-min))
+           (let ((from (gnus-article-goto-header "from"))
+                 png image)
+             (unless from
+               (insert "From:")
+               (setq from (point))
+               (insert "[no `from' set]\n"))
+             (while faces
+               (when (setq png (gnus-convert-face-to-png (pop faces)))
                  (setq image
                        (apply 'gnus-create-image png 'png t
                               (cdr (assq 'png gnus-face-properties-alist))))