Commit graph

196 commits

Author SHA1 Message Date
Dmitry Gutov
36b3abc672 ; Add the necessary argument (bug#42967) 2020-08-27 11:33:52 +03:00
Dmitry Gutov
1a167f5a7a ; Bump xref version 2020-08-27 00:56:16 +03:00
Dmitry Gutov
c601211e0d Unbreak dired-do-find-regexp in Emacs 26
* lisp/progmodes/xref.el (xref--show-xrefs):
Support the old convention (bug#42967).
2020-08-27 00:56:16 +03:00
Dmitry Gutov
7f6dba00ed Unbreak xref-goto-xref in Emacs 26
* lisp/progmodes/xref.el (xref-goto-xref):
Call next-error-found only if it's defined (bug#42981).
2020-08-27 00:56:16 +03:00
Dmitry Gutov
319463920c Unbreak project-find-regexp in Emacs 26.3 (bug#42765)
* lisp/progmodes/project.el: Depend on xref.  Bump the version.

* lisp/progmodes/xref.el: Remove 'project' from the list of
dependencies.  Depending on Emacs 26.3 already ensures that some
version is available.  Bump the version.
(xref--process-file-region): Move from project.el with a rename.
Update the sole caller.
(xref-backend-references): Make compatible with old project.el.
Update the docstring.
2020-08-14 17:21:55 +03:00
Basil L. Contovounesios
a4d3897d8f Replace some uses of cl-mapcan with mapcan
* lisp/progmodes/project.el (project-files, project-files):
* lisp/progmodes/xref.el (xref-backend-references)
(xref--convert-hits):
* test/lisp/emacs-lisp/package-tests.el
(package-test-strip-version): Replace cl-mapcan with equivalent
calls to mapcan.
2020-06-21 14:33:16 +01:00
Dmitry Gutov
f929258646 Change xref-find-apropos to pass PATTERN to backend verbatim
* lisp/progmodes/xref.el (xref-backend-apropos): Rename this
generic's second arg to PATTERN, to clarify that it should be
handled entirely in the backend, with no pre-processing by the
command.
(xref-find-apropos): Update accordingly, but keep compatibility
with backends in older Emacs versions.
(xref-apropos-regexp): Extract from xref-find-apropos.

* lisp/progmodes/etags.el (xref-backend-apropos): Use it here.

* lisp/progmodes/elisp-mode.el (xref-backend-apropos): And here.
2020-06-01 05:28:43 +03:00
Dmitry Gutov
5044c19001 project.el: A project has only one main root now
Practice shows that the vast majority of projects only use one main
root.  The users of this API very often make this assumption as well.
The rest of the "roots" should be possible to express through
project-external-roots.

* lisp/progmodes/project.el: Update the commentary.
Only 4 non-obsolete generics now.
(project-root): Replacement for `project-roots'.
All callers updated.  Implementations too.
(project-roots): Declare obsolete.
(project-external-roots): Simplify the docstring.
(project-ignores): Update the docstring.
(project-find-regexp): Omit the second arg to project-files.
(project--dir-ignores): Simplify.
(project-compile): Simplify, remove outdated comment.

* lisp/cedet/ede.el: Add a FIXME.
2020-05-23 04:54:42 +03:00
Stefan Monnier
b5ec24a4f1 * lisp/progmodes/xref.el: Fix first line syntax
(xref--find-ignores-arguments): Simplify.
2020-05-15 14:49:46 -04:00
João Távora
5d97d2683a ; Tweak version numbers in lisp/progmodes/xref.el
Hopefully this aids in getting the package correctly listed in GNU
ELPA.

* lisp/progmodes/xref.el (Version): Bump to 1.0.1
(Package-Requires): Require project 0.1.1.
2020-05-15 15:20:54 +01:00
João Távora
9ebf51999c Turn Eldoc, Xref and Project into GNU ELPA :core packages
The new packages state they require Emacs 26.3 to function, but a
small part of project.el breaks this "soft" rule: the two functions
requiring fileloop.el are incompatible with Emacs 26.3.

* lisp/jsonrpc.el: Tweak comment near Package-Requires.

* lisp/emacs-lisp/eldoc.el: Add Version and Package-Requires.

* lisp/progmodes/flymake.el: Add comment near Package-Requires.

* lisp/progmodes/project.el: Add Version and Package-Requires.

* lisp/progmodes/xref.el: Add Version and Package-Requires.
2020-05-13 11:31:35 +01:00
Dmitry Gutov
ac3da1dd96 Handle project--files-in-directory finding no files better
* lisp/progmodes/project.el (project--find-regexp-in-files):
Signal user-error when passed an empty list of files.

* lisp/progmodes/xref.el (xref-matches-in-files):
Make sure FILES is not empty.
2020-03-30 23:16:27 +03:00
Dmitry Gutov
e898442be3 Honor tags-case-fold-search during xref identifer completion
* etc/NEWS: New entry.

* lisp/progmodes/etags.el (tags-case-fold-search):
Mark as safe-local.
(find-tag--completion-ignore-case):
Extract from tags-completion-at-point-function, find-tag-tag and
etags--xref-find-definitions.
(xref-backend-identifier-completion-ignore-case):
New method. Use it here as well.

* lisp/progmodes/xref.el
(xref-backend-identifier-completion-ignore-case): New generic.
(xref--read-identifier): Use it here.
2020-01-18 00:23:46 +03:00
Dmitry Gutov
b46c75b16c xref-matches-in-files: Big Tramp speed-up
* lisp/progmodes/xref.el (xref-matches-in-files):
Greatly improve performance with remote files using Tramp
(bug#34343).
2020-01-07 16:30:37 +03:00
Paul Eggert
365e01cc9f Update copyright year to 2020
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2020-01-01 00:59:52 +00:00
Dmitry Gutov
70fe552c61 ; xref-references-in-directory: Autoload as well 2019-12-29 15:46:44 +03:00
Dmitry Gutov
43f66c3368 Extract xref-matches-in-files from project--find-regexp-in-files
* lisp/progmodes/xref.el (xref-matches-in-files): Extract from
project--find-regexp-in-files.

* lisp/dired-aux.el (dired-do-find-regexp): Also use it here.
2019-12-29 15:46:44 +03:00
Dmitry Gutov
65af18d86e 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.
2019-12-29 15:46:44 +03:00
Dmitry Gutov
98788bf976 ; Improve the docstring some more 2019-12-29 15:46:44 +03:00
Dmitry Gutov
c190e91a1e Improve docstrings
* lisp/progmodes/xref.el (xref-collect-matches)
(xref-collect-references): Improve docstrings.
2019-12-29 15:46:44 +03:00
Dmitry Gutov
d915b8c3f1 Don't require semantic/fw
* lisp/progmodes/xref.el (xref-collect-matches): Don't require
semantic/fw, we haven't been using semantic-find-file-noselect
here for a while.
2019-12-28 19:37:22 +03:00
Dmitry Gutov
50a0126402 Do some renames for clarity
* lisp/progmodes/xref.el (xref--last-file-buffer):
Rename from xref--last-visiting-buffer.  Update users.
(xref--find-file-buffer): Rename from xref--find-buffer-visiting
to match the standard function that gets called inside.  Ditto.
2019-12-28 19:30:39 +03:00
Dmitry Gutov
8224ed7d40 (xref--find-buffer-visiting): Speed up by using get-file-buffer
* lisp/progmodes/xref.el (xref--find-buffer-visiting):
Speed up by using get-file-buffer.
(xref--collect-matches): Remove the condition on remote-id.
(https://lists.gnu.org/archive/html/emacs-devel/2019-12/msg00753.html)
2019-12-27 19:17:48 +03:00
Dmitry Gutov
e1e0a7a751 xref--collect-matches: Speed up on remote
* lisp/progmodes/xref.el (xref--collect-matches):
Don't call find-buffer-visiting on remote file names, it's pretty
slow (bug#34343).
2019-12-27 17:19:00 +03:00
Dmitry Gutov
9ea9ac9a61 Apply the 'xref-group' property properly
* lisp/progmodes/xref.el (xref--insert-xrefs):
Apply the 'xref-group' property properly (bug#36974).
2019-12-24 22:30:02 +02:00
Stephen Leake
3aa8f4d44c In xref-location-marker, handle deleted file or outdated xref location nicely
* lisp/progmodes/xref.el (xref-location-marker): Add ignore-errors.
2019-10-20 06:39:02 -07:00
Juanma Barranquero
41ba8231ef lisp/*.el: Fix typos and improve some docstrings
* lisp/auth-source.el (auth-source-backend-parse-parameters)
(auth-source-search-collection)
(auth-source-secrets-listify-pattern)
(auth-source--decode-octal-string, auth-source-plstore-search):
* lisp/registry.el (registry-lookup)
(registry-lookup-breaks-before-lexbind)
(registry-lookup-secondary, registry-lookup-secondary-value)
(registry-search, registry-delete, registry-size, registry-full)
(registry-insert, registry-reindex, registry-prune)
(registry-collect-prune-candidates):
* lisp/subr.el (nbutlast, process-live-p):
* lisp/tab-bar.el (tab-bar-list):
* lisp/cedet/ede/linux.el (ede-linux--get-archs)
(ede-linux--include-path, ede-linux-load):
* lisp/erc/erc-log.el (erc-log-all-but-server-buffers):
* lisp/erc/erc-pcomplete.el (pcomplete-erc-commands)
(pcomplete-erc-ops, pcomplete-erc-not-ops, pcomplete-erc-nicks)
(pcomplete-erc-all-nicks, pcomplete-erc-channels)
(pcomplete-erc-command-name, pcomplete-erc-parse-arguments):
* lisp/eshell/em-term.el (eshell-visual-command-p):
* lisp/gnus/gnus-cache.el (gnus-cache-fully-p):
* lisp/gnus/nnmail.el (nnmail-get-active)
(nnmail-fancy-expiry-target):
* lisp/mail/mail-utils.el (mail-string-delete):
* lisp/mail/supercite.el (sc-hdr, sc-valid-index-p):
* lisp/net/ange-ftp.el (ange-ftp-use-smart-gateway-p):
* lisp/net/nsm.el (nsm-save-fingerprint-maybe)
(nsm-network-same-subnet, nsm-should-check):
* lisp/net/rcirc.el (rcirc-looking-at-input):
* lisp/net/tramp-cache.el (tramp-get-hash-table):
* lisp/net/tramp-compat.el (tramp-compat-process-running-p):
* lisp/net/tramp-smb.el (tramp-smb-get-share)
(tramp-smb-get-localname, tramp-smb-read-file-entry)
(tramp-smb-get-cifs-capabilities, tramp-smb-get-stat-capability):
* lisp/net/zeroconf.el (zeroconf-list-service-names)
(zeroconf-list-service-types, zeroconf-list-services)
(zeroconf-get-host, zeroconf-get-domain)
(zeroconf-get-host-domain):
* lisp/nxml/rng-xsd.el (rng-xsd-compile)
(rng-xsd-make-date-time-regexp, rng-xsd-convert-date-time):
* lisp/obsolete/erc-hecomplete.el (erc-hecomplete)
(erc-command-list, erc-complete-at-prompt):
* lisp/org/ob-scheme.el (org-babel-scheme-get-buffer-impl):
* lisp/org/ob-shell.el (org-babel--variable-assignments:sh-generic)
(org-babel--variable-assignments:bash_array)
(org-babel--variable-assignments:bash_assoc)
(org-babel--variable-assignments:bash):
* lisp/org/org-clock.el (org-day-of-week):
* lisp/progmodes/cperl-mode.el (cperl-char-ends-sub-keyword-p):
* lisp/progmodes/gud.el (gud-find-c-expr, gud-innermost-expr)
(gud-prev-expr, gud-next-expr):
* lisp/textmodes/table.el (table--at-cell-p, table--probe-cell)
(table--get-cell-justify-property)
(table--get-cell-valign-property)
(table--put-cell-justify-property)
(table--put-cell-valign-property): Fix typos.

* lisp/so-long.el (fboundp): Doc fix.
(so-long-mode-line-info, so-long-mode)
(so-long--check-header-modes): Fix typos.

* lisp/emulation/viper-mous.el (viper-surrounding-word)
(viper-mouse-click-get-word): Fix typos.
(viper-mouse-click-search-word): Doc fix.

* lisp/erc/erc-backend.el (erc-forward-word, erc-word-at-arg-p)
(erc-bounds-of-word-at-point): Fix typos.
(erc-decode-string-from-target, define-erc-response-handler):
Refill docstring.

* lisp/erc/erc-dcc.el (pcomplete/erc-mode/DCC): Fix typo.
(erc-dcc-get-host, erc-dcc-auto-mask-p, erc-dcc-get-file):
Doc fixes.

* lisp/erc/erc-networks.el (erc-network-name): Fix typo.
(erc-determine-network): Refill docstring.

* lisp/net/dbus.el (dbus-list-hash-table)
(dbus-string-to-byte-array, dbus-byte-array-to-string)
(dbus-check-event): Fix typos.
(dbus-introspect-get-property): Doc fix.

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler):
Rename ARGS to ARGUMENTS.  Doc fix.
(tramp-adb-sh-fix-ls-output, tramp-adb-execute-adb-command)
(tramp-adb-find-test-command): Fix typos.

* lisp/net/tramp.el (tramp-set-completion-function)
(tramp-get-completion-function)
(tramp-completion-dissect-file-name)
(tramp-completion-dissect-file-name1)
(tramp-get-completion-methods, tramp-get-completion-user-host)
(tramp-get-inode, tramp-get-device, tramp-mode-string-to-int)
(tramp-call-process, tramp-call-process-region)
(tramp-process-lines): Fix typos.
(tramp-interrupt-process): Doc fix.

* lisp/org/ob-core.el (org-babel-named-src-block-regexp-for-name)
(org-babel-named-data-regexp-for-name): Doc fix.
(org-babel-src-block-names, org-babel-result-names): Fix typos.

* lisp/progmodes/inf-lisp.el (lisp-input-filter): Doc fix.
(lisp-fn-called-at-pt): Fix typo.

* lisp/progmodes/xref.el (xref-backend-identifier-at-point):
Doc fix.
(xref-backend-identifier-completion-table): Fix typo.
2019-10-20 12:12:27 +02:00
Damien Cassou
1071dfe181 Add imenu support to xref
* lisp/progmodes/xref.el (xref--imenu-prev-index-position)
(xref--imenu-extract-index-name): Add functions to get imenu support.
(xref--xref-buffer-mode): Set imenu variables to the new functions.
* etc/NEWS: Add corresponding entry (bug#36974).
2019-08-23 06:30:46 +02:00
Juri Linkov
cad5418f18 ; Fix typoes. 2019-08-15 00:06:07 +03:00
Eli Zaretskii
385416af6a Fix recent commit in xref.el
* lisp/progmodes/xref.el (xref-file-name-display): Doc fix.

* etc/NEWS: Fix the corresponding entry.
2019-07-25 19:32:25 +03:00
Stephen Leake
d590b27ee4 Add xref-file-name-display
* lisp/progmodes/xref.el (xref-file-name-display): New user variable.
(xref-location-group): Use it.

* etc/NEWS: Mention it.
2019-07-17 09:17:36 -07:00
Fritz Stelzer
235ca1b4db Make xref-show-xrefs-function a defcustom
* lisp/progmodes/xref.el (xref-show-xrefs-function): Make into a
defcustome (bug#29206).

* lisp/progmodes/xref.el (xref-show-definitions-function): Ditto.

Copyright-paperwork-exempt: yes
2019-06-25 13:10:07 +02:00
Dmitry Gutov
83095a89f6 Fix regressions in xref-find-definitions and ...-other-window
* lisp/progmodes/xref.el:
(xref--display-buffer-in-other-window)
(xref--display-buffer-in-window): New functions.
(xref--show-pos-in-buf): Use them (bug#33870)
2019-06-16 03:50:54 +03:00
Dmitry Gutov
5f5555da87 Unbreak saving xref--original-window, etc
* lisp/progmodes/xref.el (xref--show-xref-buffer)
(xref--show-defs-buffer-at-bottom): Move major mode calls earlier.
So that local variable values are not lost.
2019-06-10 03:11:59 +03:00
Dmitry Gutov
4f479aeb4b Rename xref--pop-to-location to xref-pop-to-location
* lisp/progmodes/xref.el (xref-pop-to-location):
Rename from xref-pop-to-location.  So that third-party
xref-show-definitions-function implementations can use it safely
(bug#36144).  Update all callers.
2019-06-09 17:14:46 +03:00
Dmitry Gutov
ec563971ec Add a built-in alternative for xref-show-definitions-function
* lisp/progmodes/xref.el (xref--transient-buffer-mode-map):
New variable.
(xref--transient-buffer-mode): New major mode.
(xref--button-map): Remove the RET binding (it was unnecessary in
the first place).
(xref--show-common-initialize):
Extract from xref--show-xref-buffer.
(xref--show-defs-buffer-at-bottom): New function.
2019-06-09 17:14:46 +03:00
Dmitry Gutov
a01693a45c Rename xref-refresh-results to xref-revert-buffer
* lisp/progmodes/xref.el (xref-revert-buffer): Rename from
'xref-refresh-results' (https://debbugs.gnu.org/35737#40).
2019-05-30 20:09:53 +03:00
Dmitry Gutov
b367a3dee1 ; Remove unused piece of code and update a docstring 2019-05-30 20:09:53 +03:00
Dmitry Gutov
2be225c3a0 ; Minor docstring change 2019-05-26 01:49:00 +03:00
Dmitry Gutov
5ce082d636 ; xref--create-fetcher: Add some further clarification 2019-05-26 00:18:51 +03:00
Dmitry Gutov
d0df779224 Expand some xref documentation
* lisp/progmodes/xref.el (xref-show-xrefs-function)
(xref-show-definitions-function, xref--create-fetcher):
Add or extend the docstring.
2019-05-26 00:18:51 +03:00
Dmitry Gutov
157d506dd7 Rename xref--revert-xref-buffer to xref-refresh-results
* lisp/progmodes/xref.el (xref-refresh-results):
Rename from xref--revert-xref-buffer (bug#35702).
2019-05-25 00:43:44 +03:00
Dmitry Gutov
e309818ece Support reverting in xref-find-definitions results as well
* lisp/progmodes/xref.el (xref--show-xref-buffer): Expect the
first argument to always be a function (bug#35702).  Handle a
FETCHED-XREFS entry in ALIST.
(xref--show-defs-buffer): Update accordingly.
(xref--create-fetcher): Extract from xref--find-xrefs.
(xref--find-definitions): Use it.
2019-05-25 00:43:44 +03:00
Dmitry Gutov
62349fe82a Support "reverting" Xref buffers (bug#35702)
* lisp/progmodes/xref.el (xref--fetcher): New variable.
(xref--xref-buffer-mode-map): Add binding for 'g'.
(xref--revert-xref-buffer): New command.
(xref--show-xref-buffer): Accept a function as the first argument.
(xref--show-xrefs): Same.
(xref--find-xrefs): Pass the above a fetcher function.

* lisp/progmodes/project.el (project-find-regexp)
(project-or-external-find-regexp): Same.

* lisp/dired-aux.el (dired-do-find-regexp): Same.
2019-05-24 04:50:44 +03:00
Dmitry Gutov
1cadab78e2 Make xref-find-definitions more customizable
* lisp/progmodes/xref.el (xref--show-defs-buffer): New function.
Move a bit of logic from xref--show-defs to make it more
customizable.
(xref--push-markers): New function, extracted from
xref--show-xrefs.
(xref-show-definitions-function): Set to the new function.
2019-05-23 01:30:50 +03:00
Dmitry Gutov
49a363c875 Separate xref-find-definitions' behavior from other commands
* lisp/progmodes/xref.el (xref-show-definitions-function):
New variable.
(xref--show-defs): Split off from xref--show-xrefs.
(xref--find-definitions): Use it.
(xref--not-found-error): New function.
(xref--show-xrefs): Simplify.  Show the list buffer even when
there is just one item in the list.  Remove the last argument.

* lisp/dired-aux.el (dired-do-find-regexp): Update accordingly.
2019-05-23 01:29:33 +03:00
Dmitry Gutov
d17ae7f5af xref--find-ignores-arguments: Return "" if IGNORES is nil 2019-05-03 02:48:44 +03:00
Dmitry Gutov
f2b395c4c5 (xref--mouse-2): Fix not to jump to the next line
* lisp/progmodes/xref.el (xref--mouse-2): Fix not to jump to the
next line.
2019-05-03 01:53:11 +03:00
Dmitry Gutov
5ff4bfaeec Fix an "empty identifier" problem
* lisp/progmodes/xref.el (xref--read-identifier): Abort on empty
input if there is no default
(https://lists.gnu.org/archive/html/help-gnu-emacs/2019-05/msg00012.html).
2019-05-03 01:53:11 +03:00
Juri Linkov
ed2b0bdfe2 New faces in xref (bug#23179)
* lisp/progmodes/xref.el (xref-file-header, xref-line-number)
(xref-match):  New faces.
(xref--insert-xrefs, xref--collect-matches-1): Use them.
2019-04-14 00:54:14 +03:00