From 9f3162c81831404d152fe79960e70711bdcc1948 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 10 Jun 2004 02:38:14 +0000 Subject: [PATCH] Synch to No Gnus 200406100237. --- lisp/ChangeLog | 8 ++++++++ lisp/gnus-ems.el | 32 ++++++++++++++++++-------------- lisp/gnus-xmas.el | 5 +++-- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index be435dd..9310c3f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2004-06-10 Katsumi Yamaoka + + * gnus-ems.el (gnus-remove-image): Don't use + message-text-with-property; remove only the image found first. + + * gnus-smas.el (gnus-xmas-remove-image): Remove only the image + found first. + 2004-06-09 Jesper Harder * message.el (message-send-mail-with-sendmail): Use with-current-buffer. diff --git a/lisp/gnus-ems.el b/lisp/gnus-ems.el index 5ea1f4f..bca77f7 100644 --- a/lisp/gnus-ems.el +++ b/lisp/gnus-ems.el @@ -49,8 +49,6 @@ (autoload 'nnheader-find-etc-directory "nnheader")) (autoload 'smiley-region "smiley") -;; Fixme: shouldn't require message -(autoload 'message-text-with-property "message") (defun gnus-kill-all-overlays () "Delete all overlays in the current buffer." @@ -230,18 +228,24 @@ glyph)) (defun gnus-remove-image (image &optional category) - (let ((regions (message-text-with-property 'display)) - start end) - (while regions - (setq start (caar regions) - end (cdar regions) - regions (cdr regions)) - (when (and (equal (get-text-property start 'display) image) - (equal (get-text-property start 'gnus-image-category) - category)) - (put-text-property start end 'display nil) - (when (get-text-property start 'gnus-image-text-deletable) - (delete-region start end)))))) + "Remove the image matching IMAGE and CATEGORY found first." + (let ((start (point-min)) + val end) + (while (and (not end) + (or (setq val (get-text-property start 'display)) + (and (setq start + (next-single-property-change start 'display)) + (setq val (get-text-property start 'display))))) + (setq end (next-single-property-change start 'display)) + (if (and (equal val image) + (equal (get-text-property start 'gnus-image-category) + category)) + (progn + (put-text-property start end 'display nil) + (when (get-text-property start 'gnus-image-text-deletable) + (delete-region start end))) + (setq start end + end nil))))) (defun-maybe assoc-ignore-case (key alist) "Like `assoc', but assumes KEY is a string and ignores case when comparing." diff --git a/lisp/gnus-xmas.el b/lisp/gnus-xmas.el index 92d9d8e..f13a1e4 100644 --- a/lisp/gnus-xmas.el +++ b/lisp/gnus-xmas.el @@ -914,12 +914,13 @@ Warning: Don't insert text immediately after the image." glyph) (defun gnus-xmas-remove-image (image &optional category) + "Remove the image matching IMAGE and CATEGORY found first." (map-extents (lambda (ext unused) (when (equal (extent-end-glyph ext) image) (set-extent-property ext 'invisible nil) - (set-extent-property ext 'end-glyph nil)) - nil) + (set-extent-property ext 'end-glyph nil) + t)) nil nil nil nil nil 'gnus-image category)) (defun gnus-xmas-assq-delete-all (key alist) -- 1.7.10.4