summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2007-11-22 08:35:31 +0000
committerJan Djärv <jan.h.d@swipnet.se>2007-11-22 08:35:31 +0000
commitd2ea686304322d9184a6a29590111793d7ffeb42 (patch)
tree4247ec95e28ae6d4cc0200691fd2cbcd60ec5d51
parent8b6f8091d7b609c12a1710289cac3f70f79c92d8 (diff)
downloademacs-d2ea686304322d9184a6a29590111793d7ffeb42.tar.gz
(x-gtk-map-stock): Check if FILE is a string.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/term/x-win.el21
2 files changed, 16 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fb88bdb0de1..d1a752feabd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2007-11-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
+
+ * term/x-win.el (x-gtk-map-stock): Check if FILE is a string.
+
2007-11-22 Glenn Morris <rgm@gnu.org>
* dos-fns.el (int86):
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index f058c877ab8..6cc64829434 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -2672,15 +2672,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)