Commit graph

315 commits

Author SHA1 Message Date
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
Stefan Kangas
1de7382b57 Merge from origin/emacs-28
e77fc8262a Update to Org 9.5.2-22-g33543d
9bce4b67f1 ; * lisp/help.el (with-help-window): Doc fix.  (Bug#54170)
558b03a958 Add explicit '--no-heading' for ripgrep
2022-02-28 06:33:06 +01:00
Dmitry Gutov
558b03a958 Add explicit '--no-heading' for ripgrep
* lisp/progmodes/xref.el (xref-search-program-alist):
Add explicit '--no-heading' for ripgrep (bug#54177).
2022-02-27 15:28:04 +02:00
Dmitry Gutov
018eeb655a Drop the visited file modtime check for remote xref hits
* lisp/progmodes/xref.el (xref--hits-remote-id): New variable.
(xref--convert-hits, xref--collect-matches)
(xref--find-file-buffer): Use it (bug#54025).
2022-02-26 02:27:30 +02:00
Dmitry Gutov
fa2b60615b xref--find-file-buffer: Check modified-p and modtime
* lisp/progmodes/xref.el (xref--find-file-buffer):
Check whether the buffer contents match what's on disk
(bug#54025).
2022-02-25 03:35:51 +02:00
Dmitry Gutov
0f67a3df0e Unbreak project switcher when inside *xref* buffer
* lisp/progmodes/xref.el (xref--ensure-default-directory):
New function.
(xref--show-xref-buffer, xref-show-definitions-buffer-at-bottom):
Use it (bug#53626).
2022-02-23 03:53:16 +02:00
Dmitry Gutov
f0ac4b7797 Bump xref.el version.
* lisp/progmodes/xref.el: Bump version to 1.4.0.
2022-02-21 04:15:39 +02:00
Dmitry Gutov
3d106897fd Public-ize xref-show-xrefs
* lisp/progmodes/xref.el (xref-show-xrefs):
New function (wrapper for an older, private one, bug#42967).
2022-02-21 03:57:27 +02:00
Dmitry Gutov
3d2c213ce9 Public-ize xref-current-item
* lisp/progmodes/xref.el (xref--current-item):
Rename to 'xref-current-item' (bug#53956).  Update all references.
2022-02-21 02:59:50 +02:00
Stefan Monnier
7a9b5e7504 * lisp/progmodes/xref.el (xref--marker-ring): Fix typo 2022-02-07 13:37:09 -05:00
Juri Linkov
749ba35bf5 * lisp/replace.el (query-replace-read-from-default): New variable.
(query-replace-read-from-regexp-default): New variable.
(query-replace-read-from): Use new variables.

* lisp/progmodes/project.el (project-query-replace-regexp):
Let-bind query-replace-read-from-regexp-default to find-tag-default-as-regexp.

* lisp/progmodes/xref.el (xref-find-references-and-replace):
Let-bind query-replace-read-from-default to find-tag-default.

https://lists.gnu.org/archive/html/emacs-devel/2022-01/msg01909.html
2022-02-01 22:08:22 +02:00
Stefan Kangas
8df828e405 Merge from origin/emacs-28
5990148860 * lisp/simple.el (undo-no-redo): Fix customization group
ac2cdb8a46 * lisp/progmodes/xref.el (xref-file-name-display): Fix doc...
c05864dd25 Avoid another segfault in 'face_at_buffer_position'
2022-01-15 06:47:59 +01:00
Philipp Stephani
ac2cdb8a46 * lisp/progmodes/xref.el (xref-file-name-display): Fix docstring. 2022-01-14 22:01:06 +01:00
Juri Linkov
102dd6e59b * lisp/progmodes/xref.el (xref-query-replace-in-results): Fix prefix-arg.
Use current-prefix-arg.
2022-01-14 10:18:43 +02:00
Dmitry Gutov
c7bf60465a xref-find-references-and-replace: New command
* lisp/progmodes/xref.el (xref-find-references-and-replace):
New command.
2022-01-14 04:38:39 +02:00
Dmitry Gutov
b2cc03d572 Steamline xref-query-replace-in-results
* lisp/progmodes/xref.el (xref-query-replace-in-results):
Steamline the most common scenario
(https://lists.gnu.org/archive/html/emacs-devel/2022-01/msg00864.html).
2022-01-14 04:30:25 +02:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Stefan Kangas
6a17bb4879 Merge from origin/emacs-28
04be23f19f Improve Xref documentation
edb1d491d9 * lisp/net/shr.el (shr-expand-url): Also strip trailing wh...
2021-12-24 06:30:41 +01:00
Dmitry Gutov
04be23f19f Improve Xref documentation
* lisp/progmodes/xref.el (xref-item): Add docstring for 'summary'.
Fix typo in the header Commentary.
2021-12-24 03:25:22 +02:00
Mattias Engdegård
f41c6a70e7 Avoid adding duplicates to Xref history
* lisp/progmodes/xref.el (xref--push-backward, xref--push-forward):
New functions.
(xref-push-marker-stack, xref-go-back, xref-go-forward): Use them.
2021-11-18 12:22:01 +01:00
Stefan Kangas
b4c6ab8cb6 Merge from origin/emacs-28
42d4e24ff3 ; Fix typos
0d0125daae Improve documentation of 'decode-coding-region'
2021-11-13 07:00:30 +01:00
Stefan Kangas
42d4e24ff3 ; Fix typos 2021-11-12 13:59:58 +01:00
Mattias Engdegård
51929066d5 Revert "* lisp/progmodes/xref.el (xref-pop-marker-stack): Don't obsolete."
This reverts commit f56408a6f0.

As commented by Dmitry Gutov in [1], obsoleting `xref-pop-marker-stack`
makes sense.

[1] https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01870.html
2021-11-04 10:14:15 +01:00
Mattias Engdegård
f56408a6f0 * lisp/progmodes/xref.el (xref-pop-marker-stack): Don't obsolete. 2021-10-26 10:10:02 +02:00
Mattias Engdegård
d8caa3d9fb Rename xref-pop-marker-stack to xref-go-back (bug#38797)
It is the natural name after the addition of `xref-go-forward`.
The old name is retained as an alias.

* lisp/progmodes/xref.el (xref-pop-marker-stack): Rename.
(xref-go-forward, xref-quit-and-pop-marker-stack)
(xref-find-definitions):
* lisp/menu-bar.el (menu-bar-goto-menu):
* lisp/progmodes/etags.el (find-tag-marker-ring, pop-tag-mark):
* lisp/progmodes/prog-mode.el (prog-context-menu):
* doc/emacs/maintaining.texi (Looking Up Identifiers):
* etc/NEWS:
Use the new name.
2021-10-25 20:45:18 +02:00
Mattias Engdegård
65b34f688c Add xref forward history (bug#38797)
Make it possible to go forward as well as back in the Xref history.
The new `xref-go-forward` is bound to `C-M-,`.

* lisp/progmodes/etags.el (find-tag-marker-ring-length): Update.
(tags-location-ring-length): New.
(find-tag-marker-ring): Keep as dummy.
(tags-location-ring, tags-reset-tags-tables):
Use `tags-location-ring-length` instead of `xref-marker-ring-length`.
* lisp/progmodes/xref.el (xref-marker-ring-length, xref-marker-ring)
(xref-set-marker-ring-length):
Make obsolete.
(xref--history, xref-go-forward, xref-forward-history-empty-p): New.
(xref-push-marker-stack, xref-pop-marker-stack)
(xref-clear-marker-stack, xref-marker-stack-empty-p):
Use `xref--history`.
* lisp/menu-bar.el (menu-bar-goto-menu): Add Forward entry.
* doc/emacs/maintaining.texi (Looking Up Identifiers): Document.
* etc/NEWS: Announce.
2021-10-25 17:34:37 +02:00
Dmitry Gutov
766108f48d xref.el: Better compatibility with outdated Emacs 28 builds
* lisp/progmodes/xref.el:
Ensure better compatibility with outdated Emacs 28 builds as well
(like the pgtk branch).  Bump the version.
2021-10-20 01:04:17 +03:00
Dmitry Gutov
41c262af32 * lisp/progmodes/xref.el: Bump version. 2021-10-19 17:42:25 +03:00
Dmitry Gutov
cd4bb98540 Fix Emacs 26 support in xref.el
* lisp/progmodes/xref.el (xref--defstruct): New macro.
(xref-item, xref-match-item): Use it in definitions.
2021-10-19 17:33:08 +03:00
Glenn Morris
cc202c713b Merge from origin/emacs-28
394209c1a0 (origin/emacs-28) ; Fix indentation in etc/NEWS
81f20e8b89 Fix thinko in ls-lisp--insert-directory
ec9f25bd35 Mention that RET means "yes" in y-or-n-p
00eb21c897 ; * src/dispextern.h (struct glyph_string): Comment on NCH...
20eb3644ba Rewrite Antinews for Emacs 28
3a9b881603 ; * etc/NEWS: Rearrange the "incompatible changes" sections.
ebb7e26013 ; * etc/NEWS: Fix a typo.
315fe20086 ; * src/Makefile.in (../native-lisp): Add comment.
47cbd103f5 * lisp/bindings.el (mode-line-position): Improve tooltip.
35a752863a * lisp/progmodes/xref.el: Bump the version.
bbcd8cc1a9 Slight simplificaiton
e139dd1b1e Fix doc strings of 2 categories
59782839cb (xref--collect-matches-1): Remove some intermediate alloca...
1c7d056f4d ; Fix two typos where em dash was written as en dash

# Conflicts:
#	etc/NEWS
2021-10-09 07:50:36 -07:00
Dmitry Gutov
35a752863a * lisp/progmodes/xref.el: Bump the version. 2021-10-09 04:38:11 +03:00
Dmitry Gutov
bbcd8cc1a9 Slight simplificaiton
* lisp/progmodes/xref.el (xref--insert-xrefs):
Compute log only once.  Use 'dolist'.
2021-10-09 04:33:02 +03:00
Dmitry Gutov
59782839cb (xref--collect-matches-1): Remove some intermediate allocations
* lisp/progmodes/xref.el: (xref--collect-matches-1):
Rewrite to remove some intermediate allocations.
Modest performance improvement.
2021-10-08 18:44:54 +03:00
Glenn Morris
2bc37c14db Merge from origin/emacs-28
af01b674ce (origin/emacs-28) ; Fix spacing in previous commit
915e044d60 Use the correct label in the warning
6e83a4100a ; * admin/make-tarball.txt: Should configure --with-native...
525602d682 ; * etc/TODO (display): Add entry about Default_Ignorables.
65de510c16 ; Fix 'restore-buffer-modified-p' doc string typo
9d8202b45e Add Emacs 27 compatibility hack
89d64fca75 Pacify GCC 10.3 -Wmaybe-uninitialized
bb8ef1aa30 * lisp/tab-bar.el (tab-detach, tab-window-detach): New ali...
7ae70054aa ; * src/composite.h (LGSTRING_FONT): Add comment about its...
1af00e67d6 Include the refcards in the release tarball
3c29fb705c ; * src/Makefile.in (../native-lisp): Make the long recipe...
2021-10-08 07:50:28 -07:00
Dmitry Gutov
9d8202b45e Add Emacs 27 compatibility hack
* lisp/progmodes/xref.el: Add Emacs 27 compatibility hack, for the
standalone version of this package.
2021-10-08 05:23:19 +03:00
Glenn Morris
1b11fcae92 Merge from origin/emacs-28
1ccd3eb721 (origin/emacs-28) ; Fix typo in etc/NEWS
0f28ee94ac * NEWS: Mention rcirc connects to #emacs by default
aacafbe267 Refactor mh-utils-tests macro 'with-mh-test-env'
ead5c5cc51 Avoid using variable before it has been initialized
b2c50d7cf3 Clarify docstring of blink-matching-paren
d2a34cabcf ; Very minor touch-up to a recent change
36a7ce4393 ; * doc/emacs/trouble.texi (After a Crash): Fix typo.
1cd1b2835b * doc/misc/gnus.texi (Loose Threads): Use regexp-opt in ex...
9f041cdfac Bump project.el version
ad2287e659 Retain compatibility with older project.el projects
d86b2e59c7 native-comp-available-p is the definitive test
1b383ac424 Minor fix of a recently installed documentation change
4d76765b6c Fix md5 issue in recent Gnulib merge
18308b739a Tweak recent 'configure' fix

# Conflicts:
#	etc/NEWS
2021-10-06 07:50:33 -07:00
Dmitry Gutov
ad2287e659 Retain compatibility with older project.el projects
* lisp/progmodes/xref.el (xref--analyze):
Retain compatibility with older project.el and its compatible
project definitions (for standalone Xref from ELPA).
2021-10-05 19:50:55 +03:00
Stefan Kangas
6640942221 Use format-prompt for many more prompts
* lisp/bookmark.el (bookmark-completing-read):
* lisp/calc/calc-prog.el (calc-user-define-formula):
* lisp/calc/calc-store.el (calc-permanent-variable):
* lisp/calc/calc-units.el (calc-convert-units)
(calc-convert-exact-units, calc-convert-temperature):
* lisp/cedet/semantic/complete.el
(semantic-complete-read-tag-engine):
* lisp/cus-edit.el (customize-read-group):
* lisp/dired-aux.el (dired-do-chxxx):
* lisp/dired-x.el (dired-mark-unmarked-files):
* lisp/emacs-lisp/debug.el (cancel-debug-on-entry)
(cancel-debug-on-variable-change):
* lisp/emacs-lisp/edebug.el (edebug-cancel-on-entry)
(edebug-remove-instrumentation):
* lisp/epa.el (epa-read-file-name, epa-export-keys):
* lisp/faces.el (read-face-name):
* lisp/format.el (format-decode-buffer, format-decode-region):
* lisp/gnus/gnus-art.el (gnus-read-save-file-name):
* lisp/gnus/gnus-util.el (gnus-completing-read):
* lisp/gnus/message.el (message-check-news-header-syntax):
* lisp/info.el (Info-follow-reference):
* lisp/international/mule-diag.el (describe-font)
(describe-fontset):
* lisp/international/quail.el (quail-show-keyboard-layout):
* lisp/language/cyril-util.el
(standard-display-cyrillic-translit):
* lisp/mail/rmailkwd.el (rmail-read-label):
* lisp/mail/rmailmm.el (rmail-mime-save):
* lisp/mail/rmailout.el (rmail-output-read-file-name):
* lisp/man.el (Man-goto-section, Man-follow-manual-reference):
* lisp/menu-bar.el (emacs-index--prompt):
* lisp/net/ange-ftp.el (ange-ftp-get-passwd):
* lisp/proced.el (proced-send-signal):
* lisp/progmodes/cpp.el (cpp-choose-face):
* lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation):
* lisp/progmodes/etags.el (visit-tags-table)
(visit-tags-table-buffer):
* lisp/progmodes/grep.el (grep-read-files):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/pascal.el (pascal-goto-defun):
* lisp/progmodes/prolog.el (prolog-read-predicate):
* lisp/progmodes/sql.el (sql-get-login-ext):
* lisp/ses.el (ses-define-local-printer):
* lisp/textmodes/artist.el (artist-figlet-choose-font):
* lisp/textmodes/tex-mode.el (tex-compile):
* lisp/vc/diff.el (diff):
* lisp/vc/ediff-ptch.el (ediff-prompt-for-patch-file):
* lisp/vc/ediff-util.el (ediff-read-file-name):
* lisp/vc/pcvs.el (cvs-mode-mark-on-state):
* lisp/vc/vc.el (vc-diff-build-argument-list-internal)
(vc-revision-other-window, vc-retrieve-tag):
* lisp/wid-edit.el: Prefer format-prompt unconditionally.

* lisp/org/org-capture.el (org-capture-fill-template):
* lisp/org/org-refile.el (org-refile-get-location):
* lisp/progmodes/python.el (python-eldoc-at-point):
* lisp/progmodes/verilog-mode.el (verilog-surelint-off)
(verilog-goto-defun):
* lisp/progmodes/xref.el (xref--read-identifier): Prefer format-prompt
when it is fboundp.
2021-10-05 03:44:56 +02:00
Dmitry Gutov
205eb7f801 ; s/class/type 2021-10-01 03:05:56 +03:00
Dmitry Gutov
86da812afb Migrate Xref off EIEIO
To improve performance and flexibility (bug#50777).

* lisp/progmodes/xref.el (xref-location): Remove.
(xref-file-location): Change to cl-struct.
(xref-buffer-location, xref-bogus-location): Ditto.
(xref-item, xref-match-item): Same.
And update all method definitions accordingly.
(xref--insert-xrefs): Don't use 'oref', use 'xref-item-location'.
(xref--insert-xrefs, xref-show-definitions-completing-read):
Insetad of 'with-slots', use 'xref-item-summary' and
'xref-item-location'.

* lisp/progmodes/etags.el (xref-etags-location):
Change from EIEIO class into a cl-struct.
(xref-etags-apropos-location): Ditto.
Update all method definitions.

* test/lisp/progmodes/elisp-mode-tests.el (xref-elisp-test-run):
Avoid using 'oref'.
2021-10-01 00:02:21 +03:00
Mattias Engdegård
32de11d8de ; Remove various duplicated words
* doc/lispref/searching.texi (Extending Rx):
* doc/lispref/strings.texi (Creating Strings):
* doc/misc/modus-themes.org (Measure color contrast (DIY)):
* etc/NEWS:
* lisp/find-file.el (ff-find-other-file):
* lisp/gnus/gnus-group.el (gnus-group-suspend):
* lisp/progmodes/cc-langs.el (c-ml-string-any-closer-re):
* lisp/progmodes/flymake.el (flymake-list-only-diagnostics):
* lisp/progmodes/xref.el (xref--group-name-for-display):
* lisp/transient.el (transient-child, transient-files)
(transient-infix-value):
* src/alloc.c:
* src/regex-emacs.c (regex_compile):

Remove duplicate words in comments, documentation etc.
2021-09-25 20:25:01 +02:00
Lars Ingebrigtsen
bcbae720d5 'xref-search-program'-related doc string fixes
* lisp/progmodes/xref.el (xref-search-program): Mention what this
variable controls.
(xref-matches-in-files): Mention the variables that controls it.
2021-09-25 11:54:13 +02:00
Dmitry Gutov
e646cb4e7a A bit less overhead when converting hits
* lisp/progmodes/xref.el (xref--collect-matches):
Move 'remote-id' and 'syntax-needed' definitions to the caller
function.  Bind 'inhibit-modification-hooks' to t (bug#50733).
2021-09-23 21:45:16 +03:00
Dmitry Gutov
90a7233199 More per-match overhead reduction
* lisp/progmodes/xref.el (xref--show-common-initialize)
(xref-revert-buffer): Inhibit modification hooks (bug#50733).
(xref--insert-xrefs): Cosmetics (no measurable difference here).
2021-09-23 20:37:11 +03:00
Dmitry Gutov
d0e9b88bf7 xref-matches-in-files: Decrease per match and per group overhead
* lisp/progmodes/xref.el (xref-search-program-alist):
Add '--null' argument for slightly faster parsing and probably
better behavior with weirder file names.
(xref--alistify): Don't accept TEST argument, use 'assoc' instead
of 'cl-assoc', use a tash table during sorting (bug#50733).
2021-09-23 20:37:10 +03:00
Stefan Kangas
aebba085cb ; More minor stylistic fixes found by checkdoc 2021-09-22 20:26:40 +02:00
Dmitry Gutov
9ca737c419 xref-matches-in-files: Move sorting to Lisp
For better compatibility with different systems.
Performance is unaffected, except in very pathological cases
(~100000 matches), and even then the overhead of 'sort' is comparable.

* lisp/progmodes/xref.el (xref-search-program-alist):
Drop the piping through 'sort'.
(xref-matches-in-files): Sort here instead.
Do that to both searchers' output as well now.
2021-09-17 15:39:36 +03:00
Stefan Kangas
63f419f133 ; Minor stylistic fixes found by checkdoc 2021-09-16 19:37:07 +02:00