X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/67ab0163d67fbfeb41c37c8a259f27eeef965520..ba3189039adc8ec5eba5ed3e21d42019a4616b7c:/lisp/cedet/semantic/symref.el diff --git a/lisp/cedet/semantic/symref.el b/lisp/cedet/semantic/symref.el index 61006802c0..994d85c7b2 100644 --- a/lisp/cedet/semantic/symref.el +++ b/lisp/cedet/semantic/symref.el @@ -1,6 +1,6 @@ ;;; semantic/symref.el --- Symbol Reference API -;; Copyright (C) 2008-2011 Free Software Foundation, Inc. +;; Copyright (C) 2008-2014 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam @@ -185,7 +185,7 @@ to perform the search. This was added for use by a test harness." ;;;###autoload (defun semantic-symref-find-tags-by-name (name &optional scope) - "Find a list of references to NAME in the current project. + "Find a list of tags by NAME in the current project. Optional SCOPE specifies which file set to search. Defaults to 'project. Refers to `semantic-symref-tool', to determine the reference tool to use for the current buffer. @@ -324,7 +324,7 @@ Use the `semantic-symref-hit-tags' method to get this list.") (setq ans (list (car files)) files (cdr files)) (dolist (F files) - ;; This algorithm for uniqing the file list depends on the + ;; This algorithm for uniquifying the file list depends on the ;; tool in question providing all the hits in the same file ;; grouped together. (when (not (string= F (car ans))) @@ -356,7 +356,7 @@ already." (lambda (hit) (let* ((line (car hit)) (file (cdr hit)) - (buff (get-file-buffer file)) + (buff (find-buffer-visiting file)) (tag nil) ) (cond @@ -389,9 +389,11 @@ already." (forward-line (1- line)) ;; Search forward for the matching text - (re-search-forward (regexp-quote txt) - (point-at-eol) - t) + (when (re-search-forward (regexp-quote txt) + (point-at-eol) + t) + (goto-char (match-beginning 0)) + ) (setq tag (semantic-current-tag))