Mercurial > emacs
diff lisp/term/x-win.el @ 86308:2a94c16792c6
(x-gtk-map-stock): Check if FILE is a string.
author | Jan Djärv <jan.h.d@swipnet.se> |
---|---|
date | Thu, 22 Nov 2007 08:35:20 +0000 |
parents | 898d36ac44d1 |
children | 4f4b8e4f7e4e 53108e6cea98 |
line wrap: on
line diff
--- a/lisp/term/x-win.el Thu Nov 22 07:15:14 2007 +0000 +++ b/lisp/term/x-win.el Thu Nov 22 08:35:20 2007 +0000 @@ -2672,15 +2672,18 @@ (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)