Mercurial > emacs
diff lisp/cedet/semantic/tag-file.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 | d66016869489 |
children | bbd7017a25d9 |
line wrap: on
line diff
--- a/lisp/cedet/semantic/tag-file.el Sun Sep 13 16:18:01 2009 +0000 +++ b/lisp/cedet/semantic/tag-file.el Sat Sep 19 17:25:30 2009 +0000 @@ -45,29 +45,30 @@ parent tag that has position information. PARENT can also be a `semanticdb-table' object." (:override - (cond ((semantic-tag-in-buffer-p tag) - ;; We have a linked tag, go to that buffer. - (set-buffer (semantic-tag-buffer tag))) - ((semantic-tag-file-name tag) - ;; If it didn't have a buffer, but does have a file - ;; name, then we need to get to that file so the tag - ;; location is made accurate. - (set-buffer (find-file-noselect (semantic-tag-file-name tag)))) - ((and parent (semantic-tag-p parent) (semantic-tag-in-buffer-p parent)) - ;; The tag had nothing useful, but we have a parent with - ;; a buffer, then go there. - (set-buffer (semantic-tag-buffer parent))) - ((and parent (semantic-tag-p parent) (semantic-tag-file-name parent)) - ;; Tag had nothing, and the parent only has a file-name, then - ;; find that file, and switch to that buffer. - (set-buffer (find-file-noselect (semantic-tag-file-name parent)))) - ((and parent (featurep 'semantic/db) - (semanticdb-table-child-p parent)) - (set-buffer (semanticdb-get-buffer parent))) - (t - ;; Well, just assume things are in the current buffer. - nil - )) + (save-match-data + (cond ((semantic-tag-in-buffer-p tag) + ;; We have a linked tag, go to that buffer. + (set-buffer (semantic-tag-buffer tag))) + ((semantic-tag-file-name tag) + ;; If it didn't have a buffer, but does have a file + ;; name, then we need to get to that file so the tag + ;; location is made accurate. + (set-buffer (find-file-noselect (semantic-tag-file-name tag)))) + ((and parent (semantic-tag-p parent) (semantic-tag-in-buffer-p parent)) + ;; The tag had nothing useful, but we have a parent with + ;; a buffer, then go there. + (set-buffer (semantic-tag-buffer parent))) + ((and parent (semantic-tag-p parent) (semantic-tag-file-name parent)) + ;; Tag had nothing, and the parent only has a file-name, then + ;; find that file, and switch to that buffer. + (set-buffer (find-file-noselect (semantic-tag-file-name parent)))) + ((and parent (featurep 'semantic/db) + (semanticdb-table-child-p parent)) + (set-buffer (semanticdb-get-buffer parent))) + (t + ;; Well, just assume things are in the current buffer. + nil + ))) ;; We should be in the correct buffer now, try and figure out ;; where the tag is. (cond ((semantic-tag-with-position-p tag)