diff options
| author | Dmitry Gutov | 2019-12-29 15:44:08 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2019-12-29 15:46:44 +0300 |
| commit | 65af18d86eed140100c98c1bf3076f805f2bcc06 (patch) | |
| tree | 7cc2026b60ed7b848e0584c043fed0d101ccd1ba /lisp | |
| parent | 98788bf9768fec915c745aae8c9196636ffeaecc (diff) | |
| download | emacs-65af18d86eed140100c98c1bf3076f805f2bcc06.tar.gz emacs-65af18d86eed140100c98c1bf3076f805f2bcc06.zip | |
Rename xref-collect-references and xref-collect-matches
* lisp/progmodes/xref.el (xref-references-in-directory): Rename
from xref-collect-references. Update the sole caller.
(xref-matches-in-directory): Rename from xref-collect-matches.
Update all callers (all of them are in the /tests/ dir).
* test/lisp/progmodes/xref-tests.el (xref-tests-data-dir):
Don't use the EMACS_TEST_DIRECTORY env var. It doesn't work when
running interactively.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/xref.el | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index a9d41258471..9f010eb83bf 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el | |||
| @@ -261,7 +261,7 @@ find a search tool; by default, this uses \"find | grep\" in the | |||
| 261 | `project-current' roots." | 261 | `project-current' roots." |
| 262 | (cl-mapcan | 262 | (cl-mapcan |
| 263 | (lambda (dir) | 263 | (lambda (dir) |
| 264 | (xref-collect-references identifier dir)) | 264 | (xref-references-in-directory identifier dir)) |
| 265 | (let ((pr (project-current t))) | 265 | (let ((pr (project-current t))) |
| 266 | (append | 266 | (append |
| 267 | (project-roots pr) | 267 | (project-roots pr) |
| @@ -1129,7 +1129,7 @@ and just use etags." | |||
| 1129 | (declare-function grep-expand-template "grep") | 1129 | (declare-function grep-expand-template "grep") |
| 1130 | (defvar ede-minor-mode) ;; ede.el | 1130 | (defvar ede-minor-mode) ;; ede.el |
| 1131 | 1131 | ||
| 1132 | (defun xref-collect-references (symbol dir) | 1132 | (defun xref-references-in-directory (symbol dir) |
| 1133 | "Find all references to SYMBOL in directory DIR. | 1133 | "Find all references to SYMBOL in directory DIR. |
| 1134 | Return a list of xref values. | 1134 | Return a list of xref values. |
| 1135 | 1135 | ||
| @@ -1160,8 +1160,13 @@ and when." | |||
| 1160 | (xref--convert-hits (semantic-symref-perform-search inst) | 1160 | (xref--convert-hits (semantic-symref-perform-search inst) |
| 1161 | (format "\\_<%s\\_>" (regexp-quote symbol))))) | 1161 | (format "\\_<%s\\_>" (regexp-quote symbol))))) |
| 1162 | 1162 | ||
| 1163 | (define-obsolete-function-alias | ||
| 1164 | 'xref-collect-references | ||
| 1165 | #'xref-references-in-directory | ||
| 1166 | "27.1") | ||
| 1167 | |||
| 1163 | ;;;###autoload | 1168 | ;;;###autoload |
| 1164 | (defun xref-collect-matches (regexp files dir ignores) | 1169 | (defun xref-matches-in-directory (regexp files dir ignores) |
| 1165 | "Find all matches for REGEXP in directory DIR. | 1170 | "Find all matches for REGEXP in directory DIR. |
| 1166 | Return a list of xref values. | 1171 | Return a list of xref values. |
| 1167 | Only files matching some of FILES and none of IGNORES are searched. | 1172 | Only files matching some of FILES and none of IGNORES are searched. |
| @@ -1207,6 +1212,11 @@ IGNORES is a list of glob patterns for files to ignore." | |||
| 1207 | hits))) | 1212 | hits))) |
| 1208 | (xref--convert-hits (nreverse hits) regexp))) | 1213 | (xref--convert-hits (nreverse hits) regexp))) |
| 1209 | 1214 | ||
| 1215 | (define-obsolete-function-alias | ||
| 1216 | 'xref-collect-matches | ||
| 1217 | #'xref-matches-in-directory | ||
| 1218 | "27.1") | ||
| 1219 | |||
| 1210 | (defun xref--rgrep-command (regexp files dir ignores) | 1220 | (defun xref--rgrep-command (regexp files dir ignores) |
| 1211 | (require 'find-dired) ; for `find-name-arg' | 1221 | (require 'find-dired) ; for `find-name-arg' |
| 1212 | (defvar grep-find-template) | 1222 | (defvar grep-find-template) |