Make this work on files that don't have dots in their names.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 30 Aug 2010 20:40:24 +0000 (22:40 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 30 Aug 2010 20:40:24 +0000 (22:40 +0200)
lisp/ChangeLog
lisp/gnus-xmas.el

index bd4660f..6ca9328 100644 (file)
@@ -1,5 +1,8 @@
 2010-08-30  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-xmas.el (gnus-xmas-create-image): Make this work on files that
+       don't have dots in their names.
+
        * gnus-art.el (gnus-article-view-part): Doc fix.
 
        * gnus-html.el (gnus-html-put-image): Use gnus-create-image to be
index b533818..6281238 100644 (file)
@@ -933,9 +933,11 @@ XEmacs compatibility workaround."
        (featurep (if (eq type 'pbm) 'xbm type))))
 
 (defun gnus-xmas-create-image (file &optional type data-p &rest props)
-  (let ((type (if type
-                 (symbol-name type)
-               (car (last (split-string file "[.]")))))
+  (let ((type (cond
+              (type
+               (symbol-name type))
+              ((string-match "[.]" file)
+               (car (last (split-string file "[.]"))))))
        (face (plist-get props :face))
        glyph)
     (when (equal type "pbm")
@@ -957,8 +959,9 @@ XEmacs compatibility workaround."
                (insert-file-contents-literally file))
              (make-glyph
               (vector
-               (or (intern type)
-                   (mm-image-type-from-buffer))
+               (if type
+                   (intern type)
+                 (mm-image-type-from-buffer))
                :data (buffer-string))))))
     (when face
       (set-glyph-face glyph face))