diff options
| author | Dmitry Gutov | 2019-12-09 16:27:28 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2019-12-09 16:27:28 +0200 |
| commit | bb8f46d55bb369589ae475e47ad948da88c0d31d (patch) | |
| tree | c1f33490ca3e6ffc305115b0c2f94675b9d39312 | |
| parent | aed9584a0e26abead740805e48dcfecc00bc7ce8 (diff) | |
| download | emacs-bb8f46d55bb369589ae475e47ad948da88c0d31d.tar.gz emacs-bb8f46d55bb369589ae475e47ad948da88c0d31d.zip | |
project-find-regexp: Default to symbol at point
* lisp/progmodes/project.el (project--read-regexp):
Don't rely on the Xref backend to provide the default value.
| -rw-r--r-- | lisp/progmodes/project.el | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 5627a215739..e45cb5db127 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el | |||
| @@ -389,7 +389,6 @@ DIRS must contain directory names." | |||
| 389 | 389 | ||
| 390 | (declare-function grep-read-files "grep") | 390 | (declare-function grep-read-files "grep") |
| 391 | (declare-function xref--show-xrefs "xref") | 391 | (declare-function xref--show-xrefs "xref") |
| 392 | (declare-function xref-backend-identifier-at-point "xref") | ||
| 393 | (declare-function xref--find-ignores-arguments "xref") | 392 | (declare-function xref--find-ignores-arguments "xref") |
| 394 | (declare-function xref--regexp-to-extended "xref") | 393 | (declare-function xref--regexp-to-extended "xref") |
| 395 | (declare-function xref--convert-hits "xref") | 394 | (declare-function xref--convert-hits "xref") |
| @@ -506,8 +505,8 @@ pattern to search for." | |||
| 506 | (delete-file infile))))) | 505 | (delete-file infile))))) |
| 507 | 506 | ||
| 508 | (defun project--read-regexp () | 507 | (defun project--read-regexp () |
| 509 | (let ((id (xref-backend-identifier-at-point (xref-find-backend)))) | 508 | (let ((sym (thing-at-point 'symbol))) |
| 510 | (read-regexp "Find regexp" (and id (regexp-quote id))))) | 509 | (read-regexp "Find regexp" (and sym (regexp-quote sym))))) |
| 511 | 510 | ||
| 512 | ;;;###autoload | 511 | ;;;###autoload |
| 513 | (defun project-find-file () | 512 | (defun project-find-file () |