Re[1]: [cedet-semantic] bug in senator-search-tag-name
Brought to you by:
zappo
|
From: Eric M. L. <er...@si...> - 2006-01-06 12:19:58
|
Hi,
I think that it is supposed to find partial names since it is a
utility for other types of search, like word-searh, though I'm not
positive. Hopefully David Ponce can provide some insight.
Thanks
Eric
>>> Raul Acevedo <ra...@ca...> seems to think that:
>While using JDEE to develop Java code in Emacs, I found a bug in
>senator-search-tag-name. Finding the definition of the following symbol
>from another class fails:
>
> FooBar foo;
>
>It fails in senator-search-tag-name, because it neglects to add "\\>" to
>the end of the regexp it uses. So instead of finding foo, it finds
>FooBar. Adding "\\>" to the regexp fixes it:
>
>(defun senator-search-tag-name (tag)
> "Search for TAG name in current buffer.
>Limit the search to TAG bounds.
>If found, set point to the end of the name, and return point. The
>beginning of the name is at (match-beginning 0).
>Return nil if not found, that is if TAG name doesn't come from the
>source."
> (let ((name (semantic-tag-name tag)))
> (setq name (if (string-match "\\`\\([^[]+\\)[[]" name)
> (match-string 1 name)
> name))
> (goto-char (semantic-tag-start tag))
> (when (re-search-forward (concat
> ;; the tag name is expected at the
> ;; beginning of a word or after a
> ;; whitespace or a punctuation
> "\\(\\<\\|\\s-+\\|\\s.\\)"
> (regexp-quote name) "\\>")
> (semantic-tag-end tag)
> t)
> (goto-char (match-beginning 0))
> (search-forward name))))
>
>Raul
[ ... ]
--
Eric Ludlam: za...@gn..., er...@si...
Home: http://www.ludlam.net Siege: www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: www.gnu.org
|