]> git.eshelyaron.com Git - emacs.git/commitdiff
(x-gtk-map-stock): Don't let the tool bar destroy
authorNick Roberts <nickrob@snap.net.nz>
Sat, 23 Aug 2008 15:50:06 +0000 (15:50 +0000)
committerNick Roberts <nickrob@snap.net.nz>
Sat, 23 Aug 2008 15:50:06 +0000 (15:50 +0000)
match data in process filters.

lisp/term/x-win.el

index 1cfdeaf084b22e42ede013770744cbf8adf7065c..a8813aeb91760b6774aa6ee77fd5a4778fb712c2 100644 (file)
@@ -1669,16 +1669,17 @@ 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'."
   (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)))
+      (save-match-data
+       (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)