2010-08-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
+ * gnus-html.el (gnus-html-put-image): Use gnus-put-image.
+
+ * gnus-ems.el (gnus-put-image): Have gnus-put-image take an optional
+ point parameter.
+
* gnus-group.el (gnus-group-completing-read): Add 'substring to
completion-styles for group selection.
(setq props (plist-put props :background (face-background face))))
(apply 'create-image file type data-p props)))
-(defun gnus-put-image (glyph &optional string category)
- (let ((point (point)))
- (insert-image glyph (or string " "))
- (put-text-property point (point) 'gnus-image-category category)
- (unless string
- (put-text-property (1- (point)) (point)
- 'gnus-image-text-deletable t))
+(defun gnus-put-image (glyph &optional string category point)
+ (let ((point (or point (point))))
+ (save-excursion
+ (goto-char point)
+ (put-image glyph point)
+ (put-text-property point (point) 'gnus-image-category category)
+ (unless string
+ (put-text-property (1- (point)) (point)
+ 'gnus-image-text-deletable t)))
glyph))
(defun gnus-remove-image (image &optional category)
(= (car (image-size image t)) 30)
(= (cdr (image-size image t)) 30))))
(progn
- (put-image image point)
+ (gnus-put-image image nil nil point)
t)
(when (fboundp 'find-image)
- (put-image (find-image '((:type xpm :file "lock-broken.xpm")))
- point))
+ (gnus-put-image (find-image '((:type xpm :file "lock-broken.xpm")))
+ nil nil point))
nil)))
(defun gnus-html-prune-cache ()