]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow svg-image to take all create-image PROPS
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 20 Apr 2017 21:23:59 +0000 (23:23 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 21 Apr 2017 04:13:06 +0000 (06:13 +0200)
* lisp/svg.el (svg-image): Allow passing in PROPS when
creating an image for convenience.

lisp/svg.el

index 2295e5f8d49fe8b65b099be4d41c226b37ea3d0d..cb924f8163d7b474e114dd54ee85488c172ad16b 100644 (file)
@@ -222,13 +222,15 @@ otherwise.  IMAGE-TYPE should be a MIME image type, like
    def)
   svg)
 
-(defun svg-image (svg)
-  "Return an image object from SVG."
-  (create-image
+(defun svg-image (svg &rest props)
+  "Return an image object from SVG.
+PROPS is passed on to `create-image' as its PROPS list."
+  (apply
+   #'create-image
    (with-temp-buffer
      (svg-print svg)
      (buffer-string))
-   'svg t))
+   'svg t props))
 
 (defun svg-insert-image (svg)
   "Insert SVG as an image at point.