From: yamaoka Date: Thu, 10 Jun 2004 06:38:32 +0000 (+0000) Subject: Sync to No Gnus 200406100638. X-Git-Tag: t-gnus-6_17_4-quimby-~868 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=b9304ba9cb3ac9068fa75eb34e3e21506115ffb8;p=elisp%2Fgnus.git- Sync to No Gnus 200406100638. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9310c3f..6d4c8ed 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2004-06-10 Katsumi Yamaoka + * gnus-util.el (gnus-remove-text-with-property): Make it slightly + fast. + * gnus-ems.el (gnus-remove-image): Don't use message-text-with-property; remove only the image found first. diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index c81206d..65707dd 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -222,12 +222,15 @@ is slower." (defun gnus-remove-text-with-property (prop) "Delete all text in the current buffer with text property PROP." - (save-excursion - (goto-char (point-min)) - (while (not (eobp)) - (while (get-text-property (point) prop) - (delete-char 1)) - (goto-char (next-single-property-change (point) prop nil (point-max)))))) + (let ((start (point-min)) + end) + (unless (get-text-property start prop) + (setq start (next-single-property-change start prop))) + (while start + (setq end (text-property-any start (point-max) prop nil)) + (delete-region start (or end (point-max))) + (setq start (when end + (next-single-property-change start prop)))))) (defun gnus-newsgroup-directory-form (newsgroup) "Make hierarchical directory name from NEWSGROUP name."