summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorNick Roberts <nickrob@snap.net.nz>2008-08-23 15:50:06 +0000
committerNick Roberts <nickrob@snap.net.nz>2008-08-23 15:50:06 +0000
commite2cb56be555404f08bbe0626c1b598377f8b7770 (patch)
treeca32f9aa9a8191e57fb78f2569c8f41a3e99d9b0 /lisp
parent7131d2616670d2541e4ea165c98a57038be5da87 (diff)
(x-gtk-map-stock): Don't let the tool bar destroy
match data in process filters.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/term/x-win.el21
1 files changed, 11 insertions, 10 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 1cfdeaf084..a8813aeb91 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -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)