Commit graph

363 commits

Author SHA1 Message Date
Dmitry Gutov
391420d0c0 xref-backend-references: Avoid finding duplicates
* lisp/progmodes/xref.el (xref-backend-references):
Cull subdirectories of other elements (bug#66683).
2023-10-23 23:51:20 +03:00
Juri Linkov
2cdf80bb8f * lisp/progmodes/xref.el: Show the number of matches on mode-line (bug#66332)
(xref-num-matches-found, xref-num-matches-face, xref-mode-line-matches):
New variables.
(xref--show-xref-buffer): Set xref-num-matches-found to the length of xrefs,
and buffer-local mode-line-process to xref-mode-line-matches.
2023-10-09 21:03:03 +03:00
Dmitry Gutov
f735eb9628 xref.el: Ensure that the return value is the buffer
* lisp/progmodes/xref.el (xref--show-xrefs, xref--show-defs):
Ensure the return value of the funcall is returned (bug#65631).
2023-09-02 04:59:20 +03:00
Dmitry Gutov
17188e07ab Don't push to Xref history when search ends with error
* lisp/progmodes/xref.el (xref--push-markers):
Add new arguments (bug#65631).
(xref--show-xrefs, xref--show-defs): Use them.
2023-09-01 04:37:54 +03:00
Dmitry Gutov
128ed5c9f1 Add one more mouse-set-point call to functions xref-find-*-at-mouse
* lisp/progmodes/xref.el (xref-find-definitions-at-mouse)
(xref-find-references-at-mouse): Call mouse-set-point to ensure
that the search is initiated at the same place where
xref-backend-identifier-at-point was called (bug#65578).
2023-08-31 03:22:56 +03:00
Dmitry Gutov
0bd58dd2d6 xref-find-references-and-replace: Use identifier-at-point in prompt
* lisp/progmodes/xref.el (xref-find-references-and-replace):
Use identifier-at-point in prompt as defined by backend (bug#63939).
2023-08-12 03:39:32 +03:00
Eli Zaretskii
f1ce49d148 Merge from origin/emacs-29
3899acbb33 ; * src/fringe.c: Fix description of large circle.  (Bug#...
2b10e1827d sql: add missing postgresql types
9ac1259278 Fix display of menu-bar bindings of commands in *Help* bu...
ecdd3a9efa Improve Completion Example section in the Emacs manual
626e1ac62b Improve 'message-server-alist' docstring
327986936c Add index entry for fallback modes
1c4783c330 ; * etc/NEWS: Copyedits and grammar fixes.
3d6f755331 xref-search-program-alist: Fix searching larger file list...
1b8b2cf61b Fix typo and inaccuracy in the ELisp Reference manual
df17682ebf ; Support 'dart-ts-mode' in Eglot
e0dc60e078 ; Fix typos in gdb-mi.el
60560cc7ad Fix description of lexical environment's internals
1456adf424 ; Eglot: fix a typo in a customization type
2f59595f5f ; * etc/NEWS: Grammar fixes.
596b780ab7 Update to Org 9.6.4-2-g0f6ae7
a0b04a2247 Documentation copyedits for 'package-install-upgrade-buil...
580d8278c5 Allow upgrading built-in packages with 'package-install'
329304c23f ; * src/term.c (init_tty): Fix last change.  (Bug#62877)
200dbf7d30 Minor changes in c-ts-mode.el's support of DEFUNs
9686b015a0 Fix strike-through attribute support on TTY frames
39035fbfc5 Avoid crashes in 'describe-keymap' due to shadowing

# Conflicts:
#	etc/NEWS
#	lisp/progmodes/c-ts-mode.el
#	lisp/progmodes/eglot.el
2023-04-21 07:29:14 -04:00
Dmitry Gutov
3d6f755331 xref-search-program-alist: Fix searching larger file lists on MS Windows
* lisp/progmodes/xref.el (xref-search-program-alist):
Add '-s 10000' to xargs' options when on Windows or DOS.
Apparently the xargs port doesn't currently know how to obey the
system-wide limits (https://debbugs.gnu.org/bug=61667#521).
2023-04-19 01:29:50 +03:00
Philip Kaludercic
e8790f4293 Have Xref inherit input method when reading identifiers
* lisp/progmodes/xref.el (xref--read-identifier): Set
INHERIT-INPUT-METHOD flag to non-nil.  (Bug#61299)
2023-03-27 00:05:59 +02:00
Dmitry Gutov
6de00e4df9 ; Fix xref-match's :version since the default value did change 2023-03-23 02:44:54 +02:00
Eli Zaretskii
a4a9ffdd80 Fix the documentation of various aspects of adding Xref history
* lisp/progmodes/xref.el (xref-marker-ring-length)
(xref-set-marker-ring-length):
* lisp/progmodes/etags.el (tags-location-ring-length)
(find-tag-marker-ring): Add doc strings saying the variables are
unused.

* etc/NEWS: Enhance the description of the change which made Xref
marker stack unlimited in its length.

* doc/emacs/maintaining.texi (Looking Up Identifiers): Add back
text lost when xref forward history was added in bug#38797.
Explain the difference between 'C-M-,' and 'M-.'.  Improve
wording (Bug#62229)
2023-03-17 10:14:41 +02:00
Juri Linkov
4b6f2a7028 * lisp/progmodes/xref.el: Bump the version. 2023-03-13 20:21:47 +02:00
Juri Linkov
24c8b146bb * lisp/progmodes/xref.el (xref--xref-buffer-mode): Split up 'setq-local'.
xref.el needs to support 26.1, but an arbitrary number of variables
in 'setq-local' was added in Emacs 27.1 (bug#62162).
2023-03-13 19:39:32 +02:00
Dmitry Gutov
b5bea14ca1 * lisp/progmodes/xref.el: Bump the version. 2023-02-19 19:01:33 +02:00
Dmitry Gutov
a5b5f73d88 xref--insert-xrefs: Use 'shadow' for the line number colon
* lisp/progmodes/xref.el (xref--insert-xrefs): Use face 'shadow' for
the line number colon instead of continuing it face (bug#61340).

(cherry picked from commit d6d25a3c22)
2023-02-19 19:01:33 +02:00
Juri Linkov
6b90877359 * lisp/progmodes/xref.el (xref--insert-xrefs): Remove extra space (bug#61340).
(cherry picked from commit 643a11c6e5)
2023-02-19 19:01:33 +02:00
Mattias Engdegård
25c65e6b58 Backport: Fix xref-clear-marker-stack refactoring mistake
* lisp/progmodes/xref.el (xref-clear-marker-stack):
Clear the history correctly.  Changing a lexical variable has no effect.

(cherry picked from commit dfdc0f5fb7)
2023-02-19 19:01:33 +02:00
Dmitry Gutov
8a36a0f44a ; xref.el: Bump version 2023-01-10 02:07:12 +02:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Juri Linkov
40c23c11e8 * lisp/outline.el: Fix the value 'insert' of outline-minor-mode-use-buttons.
(outline--insert-button): Keep text properties around point
on the inserted whitespace placeholder.

* lisp/apropos.el (apropos-mode):
* lisp/progmodes/xref.el (xref--xref-buffer-mode):
Change outline-minor-mode-use-buttons from t to 'insert'.
2022-12-12 19:37:02 +02:00
Dmitry Gutov
99463478e5 * lisp/progmodes/xref.el (xref--outdated-p): Fix broken docstring. 2022-11-28 03:07:15 +02:00
Juanma Barranquero
7ee71ab6e5 ; * lisp/progmodes/xref.el: Fix some typos 2022-11-27 17:30:27 +01:00
Juanma Barranquero
31cfd6d311 Fix xref interaction with which-func (bug#59575)
* lisp/progmodes/xref.el (xref--add-log-current-defun):
New function.
(xref--xref-buffer-mode): Assign it buffer-locally to
`add-log-current-defun-function'.
2022-11-27 14:58:45 +01:00
Juanma Barranquero
41d2365d58 Fix xref to correctly display Windows absolute filenames
* lisp/progmodes/xref.el (xref--group-name-for-display):
Use `file-name-absolute-p' instead of faking it. (Discussed
in bug#59628.)
2022-11-27 14:20:22 +01:00
Eli Zaretskii
af54523431 ; Fix doc strings in xref.el
* lisp/progmodes/xref.el (xref-history-storage)
(xref-global-history, xref-window-local-history): Doc fixes.
2022-11-25 15:29:10 +02:00
Ackerley Tng
65f35b7f6f Add support for window-local xref history
* lisp/progmodes/xref.el (xref-history-storage):
New user option (bug#59381).
(xref--make-xref-history): New function.
(xref--history): Use it.
(xref-global-history, xref-window-local-history): New function.
(xref--get-history): New function.
(xref--push-backward, xref--push-forward)
(xref-push-marker-stack, xref-go-back, xref-go-forward)
(xref-clear-marker-stack, xref-marker-stack-empty-p)
(xref-forward-history-empty-p):	Use it.
2022-11-25 02:58:50 +02:00
Dmitry Gutov
c38f3b1ce1 xref--search-property: Jump over entries hidden by outline-minor-mode
* lisp/progmodes/xref.el (xref--search-property):
Jump over entries hidden by e.g. outline-minor-mode (bug#49731).
2022-11-23 20:25:45 +02:00
Juri Linkov
3573ebfa6d * lisp/progmodes/xref.el: Support outline-minor-mode (bug#49731)
(xref--xref-buffer-mode): Set buffer-local variables outline-minor-mode-cycle,
outline-minor-mode-use-buttons, outline-search-function, outline-level
as settings for enabling outline-minor-mode in xref output buffers where
outline headings are xref groups, and their lines can be hidden by
outline commands.
2022-11-23 10:38:28 +02:00
Stephen Leake
1772d88c1f Call xref--analyze with correct project
* lisp/progmodes/xref.el (xref-show-definitions-buffer-at-bottom):
Call xref--analyze with correct project.
2022-11-16 09:52:09 -08:00
Eli Zaretskii
4aeb80ccec ; Improve message text in xref.el
* lisp/progmodes/xref.el (xref--query-replace-1): Improve text of
user-error.
2022-10-15 14:43:21 +03:00
Eli Zaretskii
28904d78a5 ; Fix last change. 2022-10-10 11:09:43 +03:00
Eli Zaretskii
e016e60a04 ; Clarify correct use of 'xref-query-replace-in-results'
* lisp/progmodes/xref.el (xref--query-replace-1): Improve the
user-error message.
(xref-query-replace-in-results): Clarify restrictions in the doc
string.

* doc/emacs/maintaining.texi (Xref Commands, Identifier Search):
Clarify the correct usage of 'xref-query-replace-in-results'.
2022-10-10 11:05:18 +03:00
Dmitry Gutov
e0f137f079 * lisp/progmodes/xref.el: Bump the version. 2022-09-12 00:45:37 +03:00
Dmitry Gutov
6edff5ac33 xref-matches-in-files: Use with-connection-local-variables
* lisp/progmodes/xref.el (xref-matches-in-files):
Use with-connection-local-variables (bug#57385).
2022-08-27 01:09:47 +03:00
Dmitry Gutov
1b99f2908b * lisp/progmodes/xref.el: Bump the version. 2022-07-23 21:13:39 +03:00
Dmitry Gutov
38d5e346df Support new "binary file matches" format in Ripgrep 13
* lisp/progmodes/xref.el (xref-matches-in-files):
Support new "binary file matches" format in Ripgrep 13
(bug#56624).
2022-07-23 15:23:56 +03:00
Miha Rihtaršič
9c359b0cec xref-goto-xref: Set input focus in addition to selecting window
* lisp/progmodes/xref.el (xref--show-location): Set input focus in
addition to selecting displayed window (Bug#55983).
2022-06-20 03:44:14 +03:00
Eli Zaretskii
640e52d8fa ; Fix mistakes in 'declare function' forms
* lisp/progmodes/gdb-mi.el (tooltip-show):
* lisp/vc/vc-git.el (grep-expand-template):
* lisp/cedet/semantic/imenu.el (pulse-momentary-highlight-one-line):
* lisp/mail/feedmail.el (smtpmail-via-smtp):
* lisp/mail/rmail.el (rmail-mime-entity-truncated):
* lisp/mail/rmailsum.el (rmail-cease-edit):
* lisp/progmodes/gud.el (speedbar-toggle-line-expansion)
(speedbar-edit-line):
* lisp/autoinsert.el (sgml-tag):
* lisp/comint.el (url-host, url-type, url-filename):
* lisp/progmodes/elisp-mode.el (xref-make, xref-item-location):
* lisp/vc/vc-hooks.el (vc-responsible-backend):
* lisp/cedet/semantic/complete.el (tooltip-show):
* lisp/doc-view.el (tooltip-show):
* lisp/follow.el (mwheel-scroll):
* lisp/term/pgtk-win.el (pgtk-set-resource):
* lisp/progmodes/cperl-mode.el (Info-find-node):
* lisp/lpr.el (print-region-function):
* lisp/w32-fns.el (w32-version, w32-read-registry):
* lisp/emacs-lisp/checkdoc.el (ispell-correct-p, checkdoc-dired):
* lisp/progmodes/xref.el (apropos-parse-pattern):
* lisp/cus-edit.el (apropos-parse-pattern):
* lisp/obsolete/gs.el (x-change-window-property):
* lisp/x-dnd.el (x-change-window-property):
* lisp/xwidget.el (make-xwidget):
* lisp/transient.el (info, Man-find-section, Man-next-section)
(Man-getpage-in-background):
* lisp/frame.el (x-device-class, pgtk-device-class):
* lisp/textmodes/texinfo.el (flymake--log-1):
* lisp/term/x-win.el (x-internal-focus-input-context): Fix
'declare function' errors uncovered by 'check-declare'.
2022-05-14 16:19:12 +03:00
Lars Ingebrigtsen
44243af8f2 Use xref-goto-xref as the xref mouse binding
* lisp/progmodes/xref.el (xref--button-map): Keep the
xref-goto-xref binding instead of select-and-show to be more
similar to grep buffers.
2022-05-02 10:01:55 +02:00
Lars Ingebrigtsen
4290f64dc9 Make the xref--button-map more regular
* lisp/progmodes/xref.el (xref--button-map): Remove the mouse-1
binding (bug#35353).
2022-04-30 13:38:18 +02:00
Lars Ingebrigtsen
1b71c995da Avoid binding mouse-1 in xref when mouse-1 doesn't follow links
* lisp/progmodes/xref.el (xref--button-map): Avoid binding mouse-1
when `mouse-1-click-follows-link' is nil (bug#35353).
2022-04-29 14:01:30 +02:00
Eli Zaretskii
b8f4a1e0ed ; * lisp/progmodes/xref.el (xref-query-replace-in-results): Fix last change. 2022-04-28 18:41:53 +03:00
Eli Zaretskii
b3023de543 Merge from origin/emacs-28
# Conflicts:
#	lisp/progmodes/xref.el
2022-04-28 18:37:34 +03:00
Lars Ingebrigtsen
bbf389ea6d Audit quoting the quote character in doc strings
* test/src/regex-emacs-tests.el (regex-tests-compare):
(regex-tests-compare):
(regex-tests-match):
* test/lisp/xml-tests.el (xml-parse-tests--qnames):
* test/lisp/mh-e/mh-thread-tests.el (mh-thread-tests-before-from):
* test/lisp/cedet/srecode-utest-template.el (srecode-utest-map-reset):
* test/lisp/calc/calc-tests.el (calc-tests-equal):
* lisp/window.el (get-lru-window):
(get-mru-window):
(get-largest-window):
(quit-restore-window):
(display-buffer):
* lisp/vc/vc-rcs.el (vc-rcs-consult-headers):
* lisp/url/url-auth.el (url-digest-auth-build-response):
* lisp/tutorial.el (tutorial--find-changed-keys):
* lisp/transient.el (transient-suffix-object):
* lisp/textmodes/rst.el (rst-insert-list-new-item):
* lisp/textmodes/bibtex.el (bibtex-clean-entry):
* lisp/tab-bar.el (tab-bar--key-to-number):
(toggle-frame-tab-bar):
* lisp/ses.el (ses-recalculate-cell):
(ses-define-local-printer):
(ses-prin1):
* lisp/progmodes/xref.el (xref--find-ignores-arguments):
* lisp/progmodes/verilog-mode.el (verilog-single-declaration-end):
* lisp/progmodes/tcl.el (tcl-mode-hook):
* lisp/progmodes/gdb-mi.el (gdb-get-buffer-create):
* lisp/progmodes/elisp-mode.el (elisp--xref-make-xref):
* lisp/play/dunnet.el (dun-room-objects):
* lisp/outline.el (outline--cycle-state):
* lisp/org/ox-publish.el (org-publish-find-property):
* lisp/org/ox-html.el (org-html--unlabel-latex-environment):
* lisp/org/org-table.el (org-table-collapse-header):
* lisp/org/org-plot.el (org--plot/prime-factors):
* lisp/org/org-agenda.el (org-agenda--mark-blocked-entry):
(org-agenda-set-restriction-lock):
* lisp/org/ob-lua.el (org-babel-lua-read-string):
* lisp/org/ob-julia.el (org-babel-julia-evaluate-external-process):
(org-babel-julia-evaluate-session):
* lisp/org/ob-core.el (org-babel-default-header-args):
* lisp/obsolete/mouse-sel.el (mouse-select):
(mouse-select-secondary):
* lisp/net/tramp.el (tramp-methods):
* lisp/net/eww.el (eww-accept-content-types):
* lisp/net/dictionary-connection.el (dictionary-connection-status):
* lisp/minibuffer.el (completion-flex--make-flex-pattern):
* lisp/mh-e/mh-mime.el (mh-have-file-command):
* lisp/mh-e/mh-limit.el (mh-subject-to-sequence):
(mh-subject-to-sequence-threaded):
(mh-subject-to-sequence-unthreaded):
* lisp/mail/feedmail.el (feedmail-queue-buffer-file-name):
(feedmail-vm-mail-mode):
* lisp/ls-lisp.el (ls-lisp--sanitize-switches):
* lisp/keymap.el (key-valid-p):
* lisp/international/ccl.el (ccl-compile-branch-blocks):
* lisp/image/image-converter.el (image-convert):
* lisp/gnus/spam.el (spam-backend-check):
* lisp/gnus/nnselect.el (nnselect-generate-artlist):
* lisp/gnus/nnmairix.el (nnmairix-widget-other):
* lisp/gnus/message.el (message-mailto):
* lisp/gnus/gnus-sum.el (gnus-collect-urls-from-article):
* lisp/gnus/gnus-search.el (gnus-search-prepare-query):
* lisp/frame.el (frame-size-history):
* lisp/eshell/esh-var.el (eshell-parse-variable-ref):
* lisp/eshell/em-dirs.el (eshell-expand-multiple-dots):
* lisp/erc/erc-backend.el (erc-bounds-of-word-at-point):
* lisp/emulation/cua-rect.el (cua--rectangle-operation):
* lisp/emacs-lisp/text-property-search.el (text-property-search-forward):
* lisp/emacs-lisp/package.el (package-desc-suffix):
* lisp/emacs-lisp/faceup.el (faceup-test-explain):
* lisp/emacs-lisp/comp.el (comp-curr-allocation-class):
(comp-alloc-class-to-container):
(comp-add-cstrs):
(comp-remove-type-hints-func):
(batch-byte+native-compile):
* lisp/emacs-lisp/cl-macs.el (cl--optimize):
* lisp/elec-pair.el (electric-pair--syntax-ppss):
* lisp/doc-view.el (doc-view-doc-type):
* lisp/cedet/semantic/symref.el (semantic-symref-tool-alist):
(semantic-symref-hit-to-tag-via-db):
(semantic-symref-hit-to-tag-via-buffer):
* lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-get-overlay):
* lisp/cedet/semantic/java.el (semantic-java-doc-keywords-map):
* lisp/cedet/semantic/find.el (semantic-brute-find-tag-by-function):
* lisp/cedet/semantic/db.el (semanticdb-project-predicate-functions):
* lisp/cedet/semantic.el (semantic-working-type):
* lisp/cedet/ede/files.el (ede-flush-directory-hash):
* lisp/calc/calc.el (calc--header-line):
* lisp/auth-source.el (auth-source-pick-first-password):
(auth-source--decode-octal-string):
* etc/themes/modus-themes.el (modus-themes--paren):
(modus-themes--agenda-habit):
* admin/cus-test.el (cus-test-vars-with-changed-state): Fix
quoting in doc strings.  In code examples, the ' character is
quoted with \\=, and regularize 'foo to `foo', and quote strings
like "foo" instead of 'foo'.
2022-04-22 16:17:22 +02:00
Eli Zaretskii
16d1ab02af Add minimum instructions to 'query-replace' commands
* lisp/vc/vc-dir.el (vc-dir-query-replace-regexp):
* lisp/textmodes/reftex-global.el (reftex-query-replace-document):
* lisp/progmodes/project.el (project-query-replace-regexp):
* lisp/progmodes/etags.el (tags-query-replace):
* lisp/progmodes/ebrowse.el (ebrowse-tags-query-replace):
* lisp/isearch.el (isearch-query-replace, isearch-occur):
* lisp/emulation/viper-cmd.el (viper-query-replace):
* lisp/dired-aux.el (dired-do-query-replace-regexp)
(dired-do-find-regexp-and-replace):
* lisp/progmodes/xref.el (xref-query-replace-in-results):
* lisp/replace.el (query-replace, query-replace-regexp)
(query-replace-regexp-eval, map-query-replace-regexp): Add minimal
instructions for dealing with matches, with a link to the command
that shows the full instructions.  (Bug#55050)
2022-04-21 14:54:45 +03:00
Lars Ingebrigtsen
4d60d9face Add a doc string to xref-current-item
* lisp/progmodes/xref.el (xref-after-jump-hook): Link to it.
(xref-current-item): Add a doc string to the now-public variable.
2022-04-17 12:17:30 +02:00
Dmitry Gutov
d62b43f760 * lisp/progmodes/xref.el (xref-search-program): Fix typo. 2022-04-02 04:34:52 +03:00
Manuel Uberti
9468ab2570 Support ugrep in xref-search-program-alist
* lisp/progmodes/xref.el
(xref-search-program-alist)
(xref-search-program): Add entries for ugrep (bug#54608).
2022-04-02 04:31:33 +03:00
Philipp Stephani
6ed3f04e5a Fix a use of 'cl-defgeneric'.
* lisp/progmodes/xref.el (xref-match-length): Use 'cl-defmethod'
instead of 'cl-defgeneric'.
2022-03-17 12:58:52 +01:00
Dmitry Gutov
890b08e415 * lisp/progmodes/xref.el: Bump the version. 2022-03-03 04:55:23 +02:00