changeset 97642:4332a13750d7

(x-gtk-map-stock): Don't let the tool bar destroy match data in process filters.
author Nick Roberts <nickrob@snap.net.nz>
date Sat, 23 Aug 2008 15:50:06 +0000
parents 7f22f71742f0
children b0ed9b78b8a4
files lisp/term/x-win.el
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/x-win.el	Sat Aug 23 15:46:54 2008 +0000
+++ b/lisp/term/x-win.el	Sat Aug 23 15:50:06 2008 +0000
@@ -1669,16 +1669,17 @@
 (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)