The difference between the two functions is about what you need to type to go to the reference. One will just use the current tag (ie - who calls me) and the other pulls the default from the symbol under point (ie - who also calls this). Otherwise, you are right, they are the same.
To be honest, I don't recall the intent of the flags combinations or symref symbols very well, and am open to any suggestions that make this better. It does seem like some combination of -s and -r together would be best, since the general case of getting everything would be best, though Darren suggests they are mutually exclusive. My man page on global appears to allow them to be used together.
If you find something that works well, we should check in the change.
On 03/26/2011 10:07 PM, York Zhao wrote:
Hi Eric & David,
Logically, I don't see any difference between 'semantic-symref' and
'semantic-symref-symbol because eventually they both call
'cedet-gnu-global-search (searchtext texttype type scope)' with exactly
the same arguments. In both cases, the arguments are: texttype=symbol,
type=line, scope=project. So, what's the difference between these two
On the other hand, regarding my previous complaint of
'semantic-symref-symbol' command not working for me, I have figured out
the reason. Since the symbol I searched for was a C++ class member
variable, and it seems that the GNU Global doesn't consider member
variable as 'TAG' thus member variable were never put into the file
'GTAGS', which was the reason why neither 'semantic-symref-symbol' nor
'semantic-symref' could find it. As an experiment, I changed
(defun cedet-gnu-global-search (searchtext texttype type scope)Hi
"Perform a search with GNU Global, return the created buffer.
SEARCHTEXT is text to find.
TEXTTYPE is the type of text, such as 'regexp, 'string, 'tagname,
'tagregexp, or 'tagcompletions.
TYPE is the type of search, meaning that SEARCHTEXT is compared to
filename, tagname (tags table), references (uses of a tag) , or
symbol (uses of something not in the tag table.)
SCOPE is the scope of the search, such as 'project or 'subdirs."
(let ((flgs (cond ((eq type 'file)
((eq scope 'project)
((eq scope 'target)
(stflag (cond ((or (eq texttype 'tagname)
(eq texttype 'tagregexp))
((eq texttype 'tagcompletions)
((eq texttype 'regexp)
;; York's experient begins
((eq texttype 'symbol)
;; York's experient ends
(cedet-gnu-global-call (list (concat flgs scopeflgs stflag)
My change made 'semantic-symref-symbol' work but then 'semantic-symref'
stopped working as both these two functions called
'cedet-gnu-global-search' with exactly the same arguments. What are your