# HG changeset patch # User Jan Dj¸«£rv # Date 1195720520 0 # Node ID 2a94c16792c663d547c70a2001d62ec0648870de # Parent ae9d728a4db25974c2edf258836845edd6168820 (x-gtk-map-stock): Check if FILE is a string. diff -r ae9d728a4db2 -r 2a94c16792c6 lisp/term/x-win.el --- 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)