]> git.eshelyaron.com Git - emacs.git/commit
Perform xref searches without visiting unopened files
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 12 Apr 2016 18:08:22 +0000 (21:08 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 12 Apr 2016 18:08:56 +0000 (21:08 +0300)
commitcc0b713210a4ae3e273571f8c829122db2b143cf
treee511f08acafd5d691a4943b2c90163213fa828c6
parent50455754b558d1689bbbb596e05631f2789b1350
Perform xref searches without visiting unopened files

* lisp/progmodes/xref.el (xref-collect-references): Instead of
calling `semantic-symref-find-references-by-name', use
`semantic-symref-instantiate' and `semantic-symref-perform-search'
directly.  Ask for `line-and-text' results (bug#23223).
(xref-collect-matches): Include the line text in the "hit"
structure.
(xref--convert-hits): New function, split off from
`xref-collect-references' and `xref-collect-matches', to convert
"hits" to xref instance list.  Create a temporary buffer here, to
use it for post-processing all hit lines.
(xref--collect-matches): Use a different approach for non-visited
files.  Insert the line text into the temp buffer, apply the
file's major mode the best we can without reading its whole
contents, syntax-propertize, and search in the result.
(xref--collect-matches-1): Extract, to handle the common logic
between two cases.
(xref--find-buffer-visiting): New function, a wrapper around
`find-buffer-visiting' to amortize its cost.

* lisp/cedet/semantic/symref/idutils.el
(semantic-symref-idutils--line-re): New constant.
(semantic-symref-parse-tool-output-one-line): Support result type
`line-and-text'.

* lisp/cedet/semantic/symref/grep.el
(semantic-symref-grep--line-re)
(semantic-symref-parse-tool-output-one-line): Same.

* lisp/cedet/semantic/symref/cscope.el
(semantic-symref-cscope--line-re)
(semantic-symref-parse-tool-output-one-line): Same.

* lisp/cedet/semantic/symref/global.el
(semantic-symref-global--line-re)
(semantic-symref-parse-tool-output-one-line): Same.
lisp/cedet/semantic/symref/cscope.el
lisp/cedet/semantic/symref/global.el
lisp/cedet/semantic/symref/grep.el
lisp/cedet/semantic/symref/idutils.el
lisp/progmodes/xref.el