- (while (re-search-forward regexp nd t)
- (let* ((start (match-beginning group))
- (end (match-end group))
- (glyph (smiley-create-glyph (buffer-substring start end)
- file)))
- (when glyph
- (mapcar 'delete-annotation (annotations-at end))
- (let ((ext (make-extent start end))
- (ant (make-annotation glyph end 'text)))
- ;; set text extent params
- (set-extent-property ext 'end-open t)
- (set-extent-property ext 'start-open t)
- (set-extent-property ext 'invisible t)
- (set-extent-property ext 'keymap smiley-map)
- (set-extent-property ext 'mouse-face smiley-mouse-face)
- (set-extent-property ext 'intangible t)
- ;; set annotation params
- (set-extent-property ant 'mouse-face smiley-mouse-face)
- (set-extent-property ant 'keymap smiley-map)
- ;; remember each other
- (set-extent-property ant 'smiley-extent ext)
- (set-extent-property ext 'smiley-annotation ant)
- ;; Help
- (set-extent-property
- ext 'help-echo
- "button2 toggles smiley, button3 pops up menu")
- (set-extent-property
- ant 'help-echo
- "button2 toggles smiley, button3 pops up menu")
- (set-extent-property ext 'balloon-help
- "Mouse button2 - toggle smiley
-Mouse button3 - menu")
- (set-extent-property ant 'balloon-help
- "Mouse button2 - toggle smiley
-Mouse button3 - menu"))
- (when (smiley-end-paren-p start end)
- (make-annotation ")" end 'text))
- (goto-char end)))))))))
+ (while (re-search-forward (car entry) end t)
+ (setq string (match-string group))
+ (goto-char (match-end group))
+ (delete-region (match-beginning group) (match-end group))
+ (when image
+ (push image images)
+ (gnus-add-wash-type 'smiley)
+ (gnus-add-image 'smiley image)
+ (gnus-put-image image string 'smiley))))
+ images))))