]> git.eshelyaron.com Git - emacs.git/commitdiff
(x-gtk-map-stock): Check if FILE is a string.
authorJan Djärv <jan.h.d@swipnet.se>
Thu, 22 Nov 2007 08:42:12 +0000 (08:42 +0000)
committerJan Djärv <jan.h.d@swipnet.se>
Thu, 22 Nov 2007 08:42:12 +0000 (08:42 +0000)
lisp/ChangeLog
lisp/term/x-win.el

index b050d2a5faa52fec613bf4322bdbc934a0c77de9..565975fa008fcd2b06db4361acebfb010097c2a9 100644 (file)
@@ -1,3 +1,7 @@
+2007-11-22  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * term/x-win.el (x-gtk-map-stock): Check if FILE is a string.
+
 2007-11-21  Juanma Barranquero  <lekktu@gmail.com>
 
        * textmodes/paragraphs.el (forward-sentence): Doc fix.
index 8de5b902e18cbd615685d2062636210c06e53c6b..cdb4c9711f8f4461ede9d60ddeccd9aa9e76004b 100644 (file)
@@ -2603,15 +2603,18 @@ The list elements are either the symbol name for the alist or the alist itself."
 
 (defun x-gtk-map-stock (file)
   "Map icon with file name FILE to a Gtk+ stock name, using `x-gtk-stock-map'."
-  (let* ((file-sans (file-name-sans-extension file))
-        (key (and (string-match "/\\([^/]+/[^/]+/[^/]+$\\)" file-sans)
-                  (match-string 1 file-sans)))
-        (value))
-    (mapc (lambda (elem)
-           (let ((assoc (if (symbolp elem) (symbol-value elem) elem)))
-             (or value (setq value (assoc-string (or key file-sans) assoc)))))
-           icon-map-list)
-    (and value (cdr value))))
+  (if (stringp file)
+      (let* ((file-sans (file-name-sans-extension file))
+            (key (and (string-match "/\\([^/]+/[^/]+/[^/]+$\\)" file-sans)
+                      (match-string 1 file-sans)))
+            (value))
+       (mapc (lambda (elem)
+               (let ((assoc (if (symbolp elem) (symbol-value elem) elem)))
+                 (or value (setq value (assoc-string (or key file-sans)
+                                                     assoc)))))
+             icon-map-list)
+       (and value (cdr value)))
+    nil))
 
 ;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78
 ;;; x-win.el ends here