Commit graph

382 commits

Author SHA1 Message Date
Eshel Yaron
6bc44ccf28 Update 'xref-num-matches-found' when reverting *xref* buffer
* lisp/progmodes/xref.el (xref--insert-xrefs):
Update 'xref-num-matches-found' here...
(xref--show-xref-buffer): ...instead of here (bug#74313).
2024-11-14 04:26:54 +02:00
Stefan Kangas
47c79b62dd Checkdoc fixes in progmodes
* lisp/progmodes/cperl-mode.el (cperl-file-style)
(cperl-continued-brace-offset, cperl-tips-faces):
* lisp/progmodes/eglot.el (eglot-confirm-server-edits, eglot)
(eglot-list-connections-mode, eglot--outstanding-inlay-hints-region)
(eglot--outstanding-inlay-regions-timer):
* lisp/progmodes/etags.el (etags-goto-tag-location)
(etags--xref-apropos-additional):
* lisp/progmodes/flymake.el (flymake-autoresize-margins):
* lisp/progmodes/gdb-mi.el (gdb-mouse-until, gdb-mouse-jump):
* lisp/progmodes/hideif.el (hif-parse-macro-arglist):
* lisp/progmodes/idlw-help.el (idlwave-html-help-location):
* lisp/progmodes/idlwave.el (idlwave-reserved-word-upcase):
* lisp/progmodes/java-ts-mode.el (java-ts-mode--string-highlight-helper):
* lisp/progmodes/js.el (js--chained-expression-p):
* lisp/progmodes/pascal.el (pascal-mode, pascal-comment-area):
* lisp/progmodes/python.el (python--treesit-fontify-union-types):
* lisp/progmodes/ruby-mode.el (ruby-align-chained-calls)
(ruby-block-indent, ruby-rubocop-use-bundler):
* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--prettify-symbols-compose-p):
* lisp/progmodes/verilog-mode.el (verilog-cache-has-lisp)
(verilog-auto-insert-lisp, verilog-highlight-region):
* lisp/progmodes/xref.el (xref--get-history): Various checkdoc fixes.
2024-07-07 17:46:30 +02:00
Juri Linkov
d6afb017de * lisp/progmodes/xref.el (xref-revert-buffer-restore-point): New function.
(xref--xref-buffer-mode): Add xref-revert-buffer-restore-point
to revert-buffer-restore-functions (bug#71466).
2024-06-27 09:42:34 +03:00
Eshel Yaron
82125b1a66
Use 'revert-function' in *xref* buffer
* lisp/progmodes/xref.el (xref--xref-buffer-mode-map): Cease
binding 'g' to 'xref-revert-buffer'.
(xref--xref-buffer-mode): Set 'revert-buffer-function' to...
(xref--revert-buffer): ...this.  New function, renamed from...
(xref-revert-buffer): ...this.  Make it an alias of
'revert-buffer'.
* etc/NEWS: Announce it.
* doc/emacs/maintaining.texi (Xref Commands): Update docs.
2024-06-26 22:59:42 +02:00
Juri Linkov
a2b6e18d60 Use revert-buffer-restore-functions in xref-revert-buffer (bug#49731)
* lisp/progmodes/xref.el (xref-revert-buffer):
When 'revert-buffer-restore-functions' is bound,
use it in the same way as in 'revert-buffer'.
2024-06-05 09:35:50 +03:00
Paul Eggert
3dcac22dd4 Spelling fixes 2024-06-04 22:16:28 -07:00
Dmitry Gutov
cef848fe5f * lisp/progmodes/xref.el: Bump the version to 1.7.0 2024-05-27 01:22:27 +03:00
Dmitry Gutov
7ca238c441 xref-revert-buffer: Make inhibit-modification-hooks binding a bit safer
* lisp/progmodes/xref.el (xref-revert-buffer): Make sure that the
inhibit-modification-hooks binding does not cover xref--fetcher
funcall.  Only the printing step (issue mentioned in bug#53749).
2024-05-26 02:03:13 +03:00
Dmitry Gutov
db039399cc Fix project-find-regexp in remote projects
* lisp/progmodes/xref.el (xref--hits-file-prefix):
New variable.  Something to prepend to each file name (bug#69233).
(xref--convert-hits): Use it to also store the "default directory"
part of the filename conditionally on whether it's remote.
(xref--collect-matches): Use the new variable here.
2024-05-18 03:39:50 +03:00
Dmitry Gutov
646b8da4a5 xref--group-name-for-display: Undo most of the latest change
* lisp/progmodes/xref.el (xref--group-name-for-display):
Remove the DD-SUFFIX parameter, returning the function more like
to how it was (bug#69233).
(xref--analyze, xref--add-log-current-defun):
Revert the previous change accordingly.

* test/lisp/progmodes/xref-tests.el: Undo the last change.
2024-05-18 03:32:48 +03:00
Dmitry Gutov
113bd2082c ; Fix search in remote project with relative file names 2024-05-17 01:06:11 +03:00
Stefan Monnier
85043246f1 (xref--collect-matches): Move inhibit-modification-hooks binding down
* lisp/progmodes/xref.el (xref--collect-matches): Move the
inhibit-modification-hooks binding a little down (bug#53749).
(xref--show-common-initialize): Add sharp-quoting.
2024-05-15 00:22:05 +03:00
Dmitry Gutov
b20d4ab374 Fix 'C-u C-x p g' globally and 'A' in dired-mode
* lisp/progmodes/project.el (project-find-regexp): Ensure the
DEFAULT-DIRECTORY is set correctly for the 'C-u' case (bug#70888).

* lisp/progmodes/project.el (project--files-in-directory):
Ensure that the DIR argument ends with a slash --
'dired-do-find-regexp' passes it differently, for example.

* lisp/progmodes/xref.el (xref--group-name-for-display): Ensure
the project-relative and absolute display modes work well for
groups with "relative" file names.
(xref--analyze, xref--add-log-current-defun): Change accordingly.

* test/lisp/progmodes/project-tests.el
(project-find-regexp-with-prefix): New test.
2024-05-12 20:56:55 +03:00
Dmitry Gutov
86187d43e2 xref--collect-matches: Fix the application of syntax-propertize
* lisp/progmodes/xref.el (xref--collect-matches):
Add syntax-ppss-flush-cache call when needed (bug#53749).
2024-05-09 05:57:07 +03:00
Dmitry Gutov
f60e5f1874 ; xref-matches-in-files: Fix the previous change (bug#70813) 2024-05-07 19:18:47 +03:00
Dmitry Gutov
370b216f08 New variable 'project-files-relative-names'
* lisp/progmodes/project.el (project-files-relative-names):
New variable (bug#69233).
(project--files-in-directory): Honor it.
(project--vc-list-files): Here too.
(project-find-regexp): Use it to improve performance.
(project-or-external-find-regexp): Add a TODO.
(project-find-file): Use it here too.
(project--read-file-cpd-relative, project--read-file-absolute):
Try to handle file lists with absolute and relative files names.
(project-find-file-in): Set default-directory, so relative names
are interpreted correctly.

* lisp/progmodes/xref.el (xref-matches-in-files):
Consider that the first in FILES can be a relative file name.

* test/lisp/progmodes/project-tests.el (project-find-regexp):
New test.

* etc/NEWS: Mention it.
2024-05-05 06:27:55 +03:00
Spencer Baugh
5efa2ddf62 Correctly check buffer mtime when displaying xref matches
This was just a typo: we were checking the modification time of
current-buffer instead of checking the modification time of the
passed-in buffer.

This caused matches to not be shown if they weren't present in
the current in-Emacs state of the buffer.

This was easily reproduced by writing a string to a file outside
Emacs, then searching for that string with
e.g. project-find-regexp.  The string would seemingly not be
found, although in reality it was found, just not displayed.

* lisp/progmodes/xref.el (xref--find-file-buffer):
Check buf, not current-buffer (bug#70008).
2024-03-28 05:23:23 +02:00
Po Lu
ecf08f0621 Merge from savannah/emacs-29
dc4e6b1329 ; Update copyright years in more files
64b3777631 ; Run set-copyright from admin.el
8e1c56ae46 ; Add 2024 to copyright years

# Conflicts:
#	doc/misc/modus-themes.org
#	doc/misc/texinfo.tex
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	etc/themes/modus-operandi-theme.el
#	etc/themes/modus-themes.el
#	etc/themes/modus-vivendi-theme.el
#	lib/alloca.in.h
#	lib/binary-io.h
#	lib/c-ctype.h
#	lib/c-strcasecmp.c
#	lib/c-strncasecmp.c
#	lib/careadlinkat.c
#	lib/cloexec.c
#	lib/close-stream.c
#	lib/diffseq.h
#	lib/dup2.c
#	lib/filemode.h
#	lib/fpending.c
#	lib/fpending.h
#	lib/fsusage.c
#	lib/getgroups.c
#	lib/getloadavg.c
#	lib/gettext.h
#	lib/gettime.c
#	lib/gettimeofday.c
#	lib/group-member.c
#	lib/malloc.c
#	lib/md5-stream.c
#	lib/md5.c
#	lib/md5.h
#	lib/memmem.c
#	lib/memrchr.c
#	lib/nanosleep.c
#	lib/save-cwd.h
#	lib/sha1.c
#	lib/sig2str.c
#	lib/stdlib.in.h
#	lib/strtoimax.c
#	lib/strtol.c
#	lib/strtoll.c
#	lib/time_r.c
#	lib/xalloc-oversized.h
#	lisp/auth-source-pass.el
#	lisp/emacs-lisp/lisp-mnt.el
#	lisp/emacs-lisp/timer.el
#	lisp/info-look.el
#	lisp/jit-lock.el
#	lisp/loadhist.el
#	lisp/mail/rmail.el
#	lisp/net/ntlm.el
#	lisp/net/webjump.el
#	lisp/progmodes/asm-mode.el
#	lisp/progmodes/project.el
#	lisp/progmodes/sh-script.el
#	lisp/textmodes/flyspell.el
#	lisp/textmodes/reftex-toc.el
#	lisp/textmodes/reftex.el
#	lisp/textmodes/tex-mode.el
#	lisp/url/url-gw.el
#	m4/alloca.m4
#	m4/clock_time.m4
#	m4/d-type.m4
#	m4/dirent_h.m4
#	m4/dup2.m4
#	m4/euidaccess.m4
#	m4/fchmodat.m4
#	m4/filemode.m4
#	m4/fsusage.m4
#	m4/getgroups.m4
#	m4/getloadavg.m4
#	m4/getrandom.m4
#	m4/gettime.m4
#	m4/gettimeofday.m4
#	m4/gnulib-common.m4
#	m4/group-member.m4
#	m4/inttypes.m4
#	m4/malloc.m4
#	m4/manywarnings.m4
#	m4/mempcpy.m4
#	m4/memrchr.m4
#	m4/mkostemp.m4
#	m4/mktime.m4
#	m4/nproc.m4
#	m4/nstrftime.m4
#	m4/pathmax.m4
#	m4/pipe2.m4
#	m4/pselect.m4
#	m4/pthread_sigmask.m4
#	m4/readlink.m4
#	m4/realloc.m4
#	m4/sig2str.m4
#	m4/ssize_t.m4
#	m4/stat-time.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/stdio_h.m4
#	m4/stdlib_h.m4
#	m4/stpcpy.m4
#	m4/strnlen.m4
#	m4/strtoimax.m4
#	m4/strtoll.m4
#	m4/time_h.m4
#	m4/timegm.m4
#	m4/timer_time.m4
#	m4/timespec.m4
#	m4/unistd_h.m4
#	m4/warnings.m4
#	nt/configure.bat
#	nt/preprep.c
#	test/lisp/register-tests.el
2024-01-02 10:28:14 +08:00
Po Lu
8e1c56ae46 ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
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