Implement the gnus-put-image/gnus-html-put-image by having the latter set point.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 30 Aug 2010 17:10:08 +0000 (19:10 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 30 Aug 2010 17:10:08 +0000 (19:10 +0200)
lisp/gnus-ems.el
lisp/gnus-html.el
lisp/gnus-xmas.el

index ab9782a..efa7414 100644 (file)
       (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 point)
-  (let ((point (or point (point))))
-    (save-excursion
-      (goto-char 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)
+  (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))
     glyph))
 
 (defun gnus-remove-image (image &optional category)
index 7bfb3cd..099133d 100644 (file)
 (defun gnus-html-put-image (file point)
   (let ((image (ignore-errors
                 (create-image file))))
-    (if (and image
-            ;; Kludge to avoid displaying 30x30 gif images, which
-            ;; seems to be a signal of a broken image.
-            (not (and (eq (getf (cdr image) :type) 'gif)
-                      (= (car (image-size image t)) 30)
-                      (= (cdr (image-size image t)) 30))))
-       (progn
-         (gnus-put-image image nil nil point)
-         t)
-      (when (fboundp 'find-image)
-       (gnus-put-image (find-image '((:type xpm :file "lock-broken.xpm")))
-                       nil nil point))
-      nil)))
+    (save-excursion
+      (goto-char point)
+      (if (and image
+              ;; Kludge to avoid displaying 30x30 gif images, which
+              ;; seems to be a signal of a broken image.
+              (not (and (eq (getf (cdr image) :type) 'gif)
+                        (= (car (image-size image t)) 30)
+                        (= (cdr (image-size image t)) 30))))
+         (progn
+           (gnus-put-image image)
+           t)
+       (when (fboundp 'find-image)
+         (gnus-put-image (find-image '((:type xpm :file "lock-broken.xpm")))))
+       nil))))
 
 (defun gnus-html-prune-cache ()
   (let ((total-size 0)
index 7fe972c..b533818 100644 (file)
@@ -964,24 +964,22 @@ XEmacs compatibility workaround."
       (set-glyph-face glyph face))
     glyph))
 
-(defun gnus-xmas-put-image (glyph &optional string category point)
+(defun gnus-xmas-put-image (glyph &optional string category)
   "Insert STRING, but display GLYPH.
 Warning: Don't insert text immediately after the image."
-  (let ((begin (or point (point)))
+  (let ((begin (point))
        extent)
-    (save-excursion
-      (goto-char begin)
-      (if (and (bobp) (not string))
-         (setq string " "))
-      (if string
-         (insert string)
-       (setq begin (1- begin)))
-      (setq extent (make-extent begin (point)))
-      (set-extent-property extent 'gnus-image category)
-      (set-extent-property extent 'duplicable t)
-      (if string
-         (set-extent-property extent 'invisible t))
-      (set-extent-property extent 'end-glyph glyph)))
+    (if (and (bobp) (not string))
+       (setq string " "))
+    (if string
+       (insert string)
+      (setq begin (1- begin)))
+    (setq extent (make-extent begin (point)))
+    (set-extent-property extent 'gnus-image category)
+    (set-extent-property extent 'duplicable t)
+    (if string
+       (set-extent-property extent 'invisible t))
+    (set-extent-property extent 'end-glyph glyph))
   glyph)
 
 (defun gnus-xmas-remove-image (image &optional category)