diff lisp/cedet/semantic/util.el @ 104492:8db96f200ac8

Synch to Eric Ludlam's upstream CEDET repository. * cedet/semantic/db.el (semanticdb-get-buffer): Wrap find-file in save-match-data. * cedet/semantic/db-global.el (semanticdb-test-gnu-global): Wrap find-file in save-match-data. * cedet/semantic/util.el (semantic-file-tag-table) (semantic-recursive-find-nonterminal-by-name): Wrap find-file in save-match-data. * cedet/semantic/tag.el (semantic-tag-buffer): Wrap find-file in save-match-data. * cedet/semantic/tag-file.el (semantic-go-to-tag): Wrap the "goto" part with save-match-data. * cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string): Save match data around calling the major mode to enable. * cedet/semantic/format.el (semantic-format-tag-short-doc-default): Wrap find-file in save-match-data. * cedet/semantic/fw.el (semantic-find-file-noselect): Wrap find-file in save-match-data
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 19 Sep 2009 17:25:30 +0000
parents d634157e6a91
children 90ca5d588aa9
line wrap: on
line diff
--- a/lisp/cedet/semantic/util.el	Sun Sep 13 16:18:01 2009 +0000
+++ b/lisp/cedet/semantic/util.el	Sat Sep 19 17:25:30 2009 +0000
@@ -68,19 +68,20 @@
    and use it to get tags from files not in memory.
 If FILE is not loaded, and semanticdb is not available, find the file
    and parse it."
-  (if (find-buffer-visiting file)
-      (save-excursion
-	(set-buffer (find-buffer-visiting file))
-	(semantic-fetch-tags))
-    ;; File not loaded
-    (if (and (require 'semantic/db-mode)
-	     (semanticdb-minor-mode-p))
-	;; semanticdb is around, use it.
-	(semanticdb-file-stream file)
-      ;; Get the stream ourselves.
-      (save-excursion
-	(set-buffer (find-file-noselect file))
-	(semantic-fetch-tags)))))
+  (save-match-data
+    (if (find-buffer-visiting file)
+	(save-excursion
+	  (set-buffer (find-buffer-visiting file))
+	  (semantic-fetch-tags))
+      ;; File not loaded
+      (if (and (require 'semantic/db-mode)
+	       (semanticdb-minor-mode-p))
+	  ;; semanticdb is around, use it.
+	  (semanticdb-file-stream file)
+	;; Get the stream ourselves.
+	(save-excursion
+	  (set-buffer (find-file-noselect file))
+	  (semantic-fetch-tags))))))
 
 (semantic-alias-obsolete 'semantic-file-token-stream
 			 'semantic-file-tag-table)
@@ -161,7 +162,8 @@
 	(let ((fn (semantic-dependency-tag-file (car includelist))))
 	  (if (and fn (not (member fn unfound)))
 	      (save-excursion
-		(set-buffer (find-file-noselect fn))
+		(save-match-data
+		  (set-buffer (find-file-noselect fn)))
 		(message "Scanning %s" (buffer-file-name))
 		(setq stream (semantic-fetch-tags))
 		(setq found (semantic-find-first-tag-by-name name stream))