summaryrefslogtreecommitdiff
path: root/lisp/progmodes/xref.el
Commit message (Collapse)AuthorAgeFilesLines
* Say 'All results processed' at the endDmitry Gutov2016-05-081-1/+3
| | | | | | * lisp/progmodes/xref.el (xref--query-replace-1): Say 'All results processed' at the end if the user hadn't cancelled the process (bug#23284).
* `nreverse' the marker pairs listDmitry Gutov2016-05-051-1/+1
| | | | | * lisp/progmodes/xref.el (xref--buf-pairs-iterator): `nreverse' the marker pairs list for each buffer before returning.
* shell-quote-argument DIR when appropriateDmitry Gutov2016-05-051-2/+3
| | | | | | | | | * lisp/progmodes/project.el (project-file-completion-table): `shell-quote-argument' DIR as well. * lisp/progmodes/xref.el (xref--rgrep-command): Pass DIR through `shell-quote-argument' (bug#23453). Thanks for Kaushal Modi for pointing out the problem. Assert that DIR doesn't start with `~'.
* Rework xref-query-replace-in-resultsDmitry Gutov2016-05-051-50/+81
| | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/xref.el (xref-query-replace-in-results): Collect all xrefs from the buffer first, then delegate most of the processing to the value returned by xref--buf-pairs-iterator. (xref--buf-pairs-iterator): New function. Return an "iterator" which partitions returned markers into buffers, and only processes markers from one buffer at a time. When an xref is out of date, skip it with a message instead of signaling error (bug#23284). (xref--outdated-p): Extract from xref--buf-pairs-iterator. Trim CR from both strings before comparing. (xref--query-replace-1): Remove the variable current-buf, no need to track it anymore. Simplify the filter-predicate and search functions accordingly. Iterate over buffer-markers pairs returned by the iterator, and call `perform-replace' for each of them. Use multi-query-replace-map (bug#23284). Use `switch-to-buffer' every time after the first, in order not to jump between windows. * test/automated/xref-tests.el (xref--buf-pairs-iterator-groups-markers-by-buffers-1) (xref--buf-pairs-iterator-groups-markers-by-buffers-2) (xref--buf-pairs-iterator-cleans-up-markers): New tests.
* Handle "empty line" regexp in xref searchesDmitry Gutov2016-05-041-1/+5
| | | | | | | | | * lisp/progmodes/xref.el (xref--collect-matches-1): Stop after one match if re-search-forward doesn't move point (bug#23426). * test/automated/xref-tests.el (xref-collect-matches-finds-an-empty-line-regexp-match): Uncomment test.
* Clear buffer-undo-list when showing xrefsDmitry Gutov2016-05-041-1/+3
| | | | | | * lisp/progmodes/xref.el (xref--show-xref-buffer): Clear buffer-undo-list and temporarily bind it to t while rendering the buffer contents.
* `nreverse' Grep hits before passing them to xref--convert-hitsDmitry Gutov2016-05-021-1/+1
| | | | | | * lisp/progmodes/xref.el (xref-collect-matches): `nreverse' hits before passing them to xref--convert-hits. Fixes a regression from cc0b7132.
* Perform xref searches without visiting unopened filesDmitry Gutov2016-04-121-57/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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/progmodes/xref.el (xref-buffer-name, xref--window):Glenn Morris2016-03-171-6/+5
| | | | Move definitions before use.
* Make sure to use case-sensitive searchDmitry Gutov2016-03-031-0/+1
| | | | | * lisp/progmodes/xref.el (xref-collect-references): Make sure to use case-sensitive search.
* Uncomment the next-error-function integration in xrefDmitry Gutov2016-02-291-4/+2
| | | | | | * lisp/progmodes/xref.el (xref--xref-buffer-mode): Uncomment the next-error-function integration (http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20489#110).
* Kill off xref--display-historyDmitry Gutov2016-02-221-30/+1
| | | | | | | | | | Now that the core workflow keeps the xref window visible, there's less value in storing this history. And it never was comprehensive enough to undo scrolling changes. * lisp/progmodes/xref.el (xref--display-history) (xref--save-to-history, xref-quit): Remove. (xref--show-pos-in-buf): Update accordingly. (xref--xref-buffer-mode-map): Remove xref-quit binding.
* Keep the xref buffer visible until the user quits it explicitlyDmitry Gutov2016-02-221-32/+52
| | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/xref.el (xref--pop-to-location): Rename WINDOW argument to ACTION. (xref--with-dedicated-window): New macro. (xref--show-pos-in-buf): Rename from `xref--display-position'. Add and handle new argument, SELECTED. Use the above macro. (xref--show-location): Add SELECTED argument. (xref-show-location-at-point): Make an effort to avoid the original window when showing the location. (xref-goto-xref): Don't quit the xref window (bug#20487 and http://lists.gnu.org/archive/html/emacs-devel/2016-01/msg01133.html). (xref--query-replace-1): Use xref--with-dedicated-window as well. (xref--next-error-function): Call xref--show-location instead of xref--pop-to-location. (xref--show-xrefs): Rename WINDOW argument to DISPLAY-ACTION. Only pass that value to xref--pop-to-location. Pass the current selected window to xref-show-xrefs-function as the `window' property. (xref--find-xrefs, xref--find-definitions): Rename WINDOW argument to DISPLAY-ACTION as well.
* Improve project-find-fileStephen Leake2016-01-291-0/+4
| | | | | | | | | | | | | * lisp/progmodes/project.el (project-file-completion-table): New. (project-find-file, project-or-external-find-file): Default to filename at point. (project-file-completion-table): New, split out from project--find-file-in. (project-find-file-in): Renamed from project--find-file-in, use project-file-completion-table. * lisp/progmodes/xref.el (ede-minor-mode): New declaration. (xref--find-ignores-arguments): Add doc string.
* Rename xref-query-replace to xref-query-replace-in-resultsDmitry Gutov2016-01-241-2/+2
| | | | | | | | | | | | * lisp/progmodes/xref.el(xref-query-replace): Rename to xref-query-replace-in-results. (http://lists.gnu.org/archive/html/emacs-devel/2016-01/msg01240.html) * lisp/progmodes/xref.el (xref--xref-buffer-mode-map): * lisp/dired-aux.el (dired-do-find-regexp-and-replace): * doc/emacs/dired.texi (Operating on Files): * doc/emacs/maintaining.texi (Xref Commands) (Identifier Search, Identifier Search): Update accordingly.
* Comment out next-error-function integration in xrefDmitry Gutov2016-01-231-2/+4
| | | | | | * lisp/progmodes/xref.el (xref--xref-buffer-mode): Comment out next-error-function integration (http://lists.gnu.org/archive/html/emacs-devel/2016-01/msg01286.html).
* In xref-collect-references, force backends to respect the 'dir' argStephen Leake2016-01-221-1/+7
| | | | | * lisp/progmodes/xref.el (xref-collect-references): Force symref backends to use `default-directory'.
* Add xref-based replacements for Dired search commandsDmitry Gutov2016-01-181-22/+43
| | | | | | | | | | | | | | | | * lisp/dired-aux.el (dired-do-find-regexp) (dired-do-find-regexp-and-replace): New commands. http://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00864.html * lisp/dired.el (dired-mode-map): Change bindings for `A' and `Q' to the new commands. * lisp/progmodes/xref.el (xref-query-replace) (xref-collect-matches): Add progress reporters. (xref--find-ignores-arguments): Return nil for zero ignores. (xref--show-xrefs): Add an optional argument. (xref-collect-matches): Drop the assert. 'find' accepts a regular file in place of directory argument, too.
* Add some missing version tags.Glenn Morris2016-01-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/electric.el (electric-quote-comment) (electric-quote-string, electric-quote-paragraph): * lisp/epg-config.el (epg-gpgconf-program): * lisp/rect.el (rectangle-preview): * lisp/emacs-lisp/check-declare.el (check-declare-ext-errors): * lisp/emacs-lisp/package.el (package-selected-packages) (package-hidden-regexps): * lisp/erc/erc.el (erc-network-hide-list, erc-channel-hide-list): * lisp/eshell/em-term.el (eshell-destroy-buffer-when-process-dies): * lisp/gnus/mml-sec.el (mml1991-signers, mml2015-signers) (mml-smime-signers, mml1991-encrypt-to-self, mml2015-encrypt-to-self) (mml-smime-encrypt-to-self, mml2015-sign-with-sender) (mml-smime-sign-with-sender, mml2015-always-trust) (mml-secure-fail-when-key-problem, mml-secure-key-preferences): * lisp/net/browse-url.el (browse-url-conkeror-new-window-is-buffer) (browse-url-conkeror-arguments): * lisp/net/newst-reader.el (newsticker-download-logos): * lisp/progmodes/gud.el (gud-guiler-command-name): * lisp/progmodes/prog-mode.el (prettify-symbols-unprettify-at-point): * lisp/progmodes/project.el (project-vc): * lisp/progmodes/python.el (python-indent-guess-indent-offset-verbose) (python-shell-remote-exec-path, python-shell-first-prompt-hook) (python-shell-completion-native-disabled-interpreters) (python-shell-completion-native-enable) (python-shell-completion-native-output-timeout) (python-shell-completion-native-try-output-timeout): * lisp/progmodes/xref.el (xref): * lisp/term/screen.el (xterm-screen-extra-capabilities): * lisp/term/xterm.el (xterm-max-cut-length): Add missing version tags.
* Improve doc strings and prompts in xref.elEli Zaretskii2016-01-091-10/+12
| | | | | | * lisp/progmodes/xref.el (xref-backend-functions) (xref-find-definitions): Doc fixes. (xref-query-replace): Doc fix. Improve prompts for arguments.
* Add project-find-file and project-or-external-find-fileDmitry Gutov2016-01-071-18/+25
| | | | | | | | | | | | | | * lisp/minibuffer.el (completion-category-defaults): Add `project-file' category. * lisp/progmodes/project.el (project-find-file) (project-or-external-find-file): New commands. (project--find-file-in): New private function. * lisp/progmodes/xref.el (xref-collect-matches): Use `expand-file-name' on DIR, to expand the tildes. (xref--find-ignores-arguments): Extract from `xref--rgrep-command'.
* Spelling fixPaul Eggert2016-01-031-1/+1
|
* ; Clarify that xref is still experimentalDmitry Gutov2016-01-031-0/+5
|
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* Undo ill-advised changeDmitry Gutov2015-12-301-1/+1
| | | | | | * lisp/progmodes/xref.el (xref-collect-matches): Undo ill-advised change. The hits come in the order that `find' produces them in, which isn't alphabetical.
* Rename project-library-roots to project-external-rootsDmitry Gutov2015-12-281-2/+2
| | | | | | | | | | | | | | | | | | * lisp/progmodes/project.el (project-library-roots): Rename to project-external-roots. (project-library-roots-function): Rename to project-vc-external-roots-function. Only use it in the VC backend, for now. Update project-external-roots accordingly. (project-vc-library-roots): Remove. (project-or-libraries-find-regexp): Rename to project-or-external-find-regexp. * lisp/progmodes/elisp-mode.el (elisp-library-roots): Rename to elisp-load-path-roots. * lisp/progmodes/etags.el (etags-library-roots): Remove. Use an anonymous function for the default value of project-vc-external-roots-function.
* APPEND etags--xref-backend to xref-backend-functionsDmitry Gutov2015-12-021-2/+3
| | | | | | * lisp/progmodes/xref.el (xref-backend-functions): Use APPEND when adding the default element (http://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00061.html).
* Autoload etags when using its xref backendDmitry Gutov2015-11-271-3/+1
| | | | | | * lisp/progmodes/xref.el (xref--etags-backend): Rename to etags--xref-backend. Move to etags.el. Autoload. (Bug#22026)
* Add xref--etags-backend to xref-backing-functions using add-hookDmitry Gutov2015-11-211-3/+5
| | | | | | | | | * lisp/progmodes/xref.el (xref-backend-functions): Move the default value into a separate `add-hook' call (bug#21964). * lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Don't declare the xref-backend-functions variable. It doesn't make any difference.
* Improve doc stringStephen Leake2015-11-171-2/+3
| | | | * lisp/progmodes/xref.el (xref-backend-references): Improve doc string.
* Unify the absolutely equal xref-backend-references implementationsDmitry Gutov2015-11-151-2/+12
| | | | | | | | | | | * lisp/progmodes/elisp-mode.el (xref-backend-references): Remove. * lisp/progmodes/etags.el (xref-backend-references): Remove. * lisp/progmodes/xref.el (xref-backend-references): Define the default implementation.
* Update project-find-regexp for the new xref APIDmitry Gutov2015-11-151-0/+1
| | | | | | | * lisp/progmodes/project.el (project--read-regexp): Update to use the new xref API methods. * lisp/progmodes/xref.el (xref-find-backend): Autoload.
* Fix replacing a match with a shorter stringDmitry Gutov2015-11-151-7/+10
| | | | | | | | In effect, partially reverting fe973fc. * lisp/progmodes/xref.el (xref-query-replace): Store the end of each match as a marker again, instead of length. (xref--query-replace-1): Update accordingly.
* * lisp/progmodes/xref.el (xref-pop-marker-stack): Downgrade errorsArtur Malabarba2015-11-141-2/+2
| | | | Signal user-errors instead.
* ; Update xref-etags-mode for the latest changeDmitry Gutov2015-11-141-8/+3
|
* Use generic dispatch for xref backendsDmitry Gutov2015-11-141-39/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/xref.el (xref-backend-functions): New variable. (xref-find-function): Remove. (xref-find-backend) (xref--etags-backend): New functions. (xref-identifier-at-point-function) (xref-identifier-completion-table-function): Remove. (xref-backend-definitions, xref-backend-references) (xref-backend-apropos, xref-backend-identifier-at-point) (xref-backend-identifier-completion-table): New generic functions. * lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Add `elisp--xref-backend' to the beginning of `xref-backend-functions', locally. Delete references to removed functions and vars. (elisp-xref-find): Remove. (elisp--xref-backend): New function. (elisp--xref-find-references, elisp--xref-find-apropos) (elisp--xref-identifier-completion-table): Turn into appropriately named generic methods. * lisp/progmodes/etags.el (etags-xref-find): Remove. (xref-backend-identifier-completion-table) (xref-backend-references, xref-backend-definitions) (xref-backend-apropos): New generic methods.
* Handle multiple matches on the same line; add highlightingDmitry Gutov2015-11-141-21/+23
| | | | | | | | * lisp/progmodes/xref.el (xref-location-marker): Interpret the column value in characters. (xref--collect-matches): Rename from `xref--collect-match'. Search for all matches in the hit line. Add `highlight' face to the matched region in the summary. Update both callers.
* Replace xref-match-bounds with xref-match-lengthDmitry Gutov2015-11-141-52/+47
| | | | | | | | | | | | | | | Relying on xref-location-marker to point to the beginning of the match * lisp/progmodes/xref.el (xref-match-bounds): Remove. (xref-match-length): Add. (xref-make-match): Change the arguments. (xref--match-buffer-bounds): Remove. (xref-match-item): Store length, instead of end-column. (xref-pulse-momentarily) (xref--collect-match) (xref--query-replace-1): Update accordingly. (xref-query-replace): Ditto. And check that the search results are up-to-date.
* Move and rename xref-find-regexp to the project packageDmitry Gutov2015-11-081-44/+20
| | | | | | | | | | | | | * lisp/progmodes/project.el (project-find-regexp) (project--read-regexp) (project--find-regexp-in): New functions. * lisp/progmodes/xref.el (xref--find-xrefs): Extract from xref--show-xrefs. Use in existing callers in place of that function. (xref--show-xrefs): Only do the "show" part. (xref-find-regexp): Rename, more or less, to project-or-libraries-find-regexp.
* Abolish temporary buffer management for xrefDmitry Gutov2015-11-061-41/+6
| | | | | | | | | * lisp/progmodes/xref.el (xref--temporary-buffers) (xref--current) (xref--inhibit-mark-current) (xref--mark-selected): Remove. Remove all references. (xref--show-xrefs): Do not construct the list of the temporary buffers, nor pass it along.
* Rename "search path" to "library roots"Dmitry Gutov2015-11-061-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-seq.el (cl-set-difference): Retain the order of the elements from CL-LIST1. * test/automated/cl-lib-tests.el (cl-lib-test-set-functions): Update WRT to the above change. * lisp/progmodes/project.el (project-search-path-function): Rename to project-library-roots-function, update the documentation and references. (project-search-path): Likewise, to project-library-roots. (project-roots): Clarify documentation. (project-vc-search-path): Likewise, to project-vc-library-roots. (project-library-roots): In addition to the renames, thread the results through file-name-as-directory. (project-prune-directories): Accept a variable number of arguments. Rename to project-combine-directories. (project-subtract-directories): New function. * lisp/progmodes/elisp-mode.el (elisp--xref-find-references): Append project-roots and project-library-roots together. * lisp/progmodes/etags.el (etags--xref-find-references): Ditto.
* * lisp/progmodes/xref.el: require semantic/symref during compilation.Stephen Leake2015-11-061-0/+3
|
* * lisp/progmodes/xref.el: Doc fixesJuanma Barranquero2015-11-041-6/+6
| | | | | | (xref-make-file-location, xref-make-buffer-location, xref-make) (xref-make-bogus-location, xref-make-match): Add cross-references. (xref--insert-xrefs): Fix typo in docstring.
* Fix some more docstring etc. quoting problemsPaul Eggert2015-09-031-2/+2
| | | | | | | | | | | | | | | | | | | Mostly these fixes prevent the transliteration of apostrophes that should stay apostrophes. Also, prefer curved quotes in Bahá’í proper names, as that’s the preferred Bahá’í style and these names are chock-full of non-ASCII characters anyway. * lisp/emacs-lisp/eieio-core.el (eieio-defclass-autoload) (eieio-defclass-internal): * lisp/emacs-lisp/eieio.el (defclass): * lisp/hi-lock.el (hi-lock-mode): Don’t transliterate Lisp apostrophes when generating a doc string or diagnostic. * lisp/international/mule-diag.el (list-coding-systems-1): * lisp/international/ogonek.el (ogonek-jak, ogonek-how): * lisp/mail/sendmail.el (sendmail-query-user-about-smtp): * lisp/vc/ediff-mult.el (ediff-redraw-registry-buffer): * lisp/vc/ediff-ptch.el (ediff-fixup-patch-map): Substitute quotes before putting them in the help buffer.
* elisp--xref-find-definitions handle cl-defstuct default constructorStephen Leake2015-08-111-3/+12
| | | | | | | | | | | | | | | | | | * lisp/progmodes/elisp-mode.el (elisp-xref-find): Add FIXME. (elisp--xref-format-extra): Rename from elisp--xref-format-cl-defmethod. (elisp--xref-find-definitions): Handle cl-defstuct default constructor. * test/automated/elisp-mode-tests.el (xref-elisp-test-run): Split out from xref-elisp-test for ease of debugging. (xref-elisp-deftest): Rename from xref-elisp-test. (find-defs-constructor): New test. (find-defs-defgeneric-el): Match batch test config. (compile): Required for find-defs compilation-minor-mode test. (find-defs-defvar-el): Match code change. (find-defs-face-el): Match code change. * lisp/progmodes/xref.el (xref-find-function, xref-find-definitions): Improve doc string.
* ; Fix xref--show-location, after regression in ee50e62Dmitry Gutov2015-08-101-11/+12
|
* Add project-vc-search-path and project-vc-ignoresDmitry Gutov2015-08-101-4/+4
| | | | | | | | | | * lisp/progmodes/project.el (project-vc): New group. (project-vc-search-path, project-vc-ignores): New variables. (project--value-in-dir): Utility function. (project-search-path, project-ignores): Use them. * lisp/progmodes/xref.el (xref--rgrep-command): Only replace `./' at bos. Don't add extra `/'. Don't prepend with `*' if replaced.
* Preserve window point in xref-find-definitions-other-windowDmitry Gutov2015-08-051-21/+26
| | | | | | | | | | | Fix the problem reported by Ingo Logmar in http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00152.html * lisp/progmodes/xref.el (xref--goto-char): Extract from xref--goto-location. (xref--pop-to-location): Use it. Replace xref--goto-location with a direct xref-location-marker call. (xref--show-location): Likewise. (xref--display-position): Use xref--goto-char.
* Add a second argument to project-ignoresDmitry Gutov2015-08-021-1/+2
| | | | | | | | | | * lisp/progmodes/project.el (project-ignores): Add a second argument DIR. * lisp/progmodes/project.el (project-ignores): Only include the VC ignores if DIR is the VC root. * lisp/progmodes/xref.el (xref-find-regexp): Update accordingly.
* Rename project-directories to project-rootsDmitry Gutov2015-07-311-4/+6
| | | | | | | | | | | * lisp/progmodes/project.el (project-search-path-function) (project-search-path): Update the docstring. (project-directories): Rename to `project-roots', update all callers and implementations accordingly. (project-root): Remove. * lisp/progmodes/xref.el (xref-find-regexp): Use * instead of *.* as the default file mask.