# HG changeset patch # User Jan Dj¸«£rv # Date 1195720919 0 # Node ID 6f9e3cd1681eed0ea0e35573ee01f8f516521c7c # Parent bd1fcc60391ba70cdf8c09d2ac5a0be69e1a4b34 (x-gtk-map-stock): Check if FILE is a string. diff -r bd1fcc60391b -r 6f9e3cd1681e lisp/term/x-win.el --- a/lisp/term/x-win.el Thu Nov 22 08:40:20 2007 +0000 +++ b/lisp/term/x-win.el Thu Nov 22 08:41:59 2007 +0000 @@ -2603,15 +2603,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)) ;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78 ;;; x-win.el ends here