]> code.delx.au - gnu-emacs/blobdiff - lisp/term/x-win.el
Merge from emacs--devo--0
[gnu-emacs] / lisp / term / x-win.el
index eb2e559a0d1e1c42524dff4be93d03372458a98a..ffd2a98c6b0cf3d43f61e6d93abab0e32103186c 100644 (file)
@@ -2576,15 +2576,18 @@ If you don't want stock icons, set the variable to nil."
 
 (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))
 
 (provide 'x-win)