diff options
| author | Juri Linkov | 2020-11-14 22:36:13 +0200 |
|---|---|---|
| committer | Juri Linkov | 2020-11-14 22:36:13 +0200 |
| commit | ad29bc74ca9d4e1768698d4002b49c234624e359 (patch) | |
| tree | c42158473818310fe0bf35df67e083caa2edf0e8 | |
| parent | 844e82f5a837a16c64e32ff9dd41a9e9b3ad3432 (diff) | |
| download | emacs-ad29bc74ca9d4e1768698d4002b49c234624e359.tar.gz emacs-ad29bc74ca9d4e1768698d4002b49c234624e359.zip | |
* lisp/progmodes/xref.el (xref-goto-xref): Prefix arg quits the *xref* buffer.
(bug#44611)
| -rw-r--r-- | etc/NEWS | 7 | ||||
| -rw-r--r-- | lisp/progmodes/xref.el | 6 |
2 files changed, 10 insertions, 3 deletions
| @@ -1134,6 +1134,13 @@ project's root directory, respectively. | |||
| 1134 | +++ | 1134 | +++ |
| 1135 | *** New user option 'project-list-file'. | 1135 | *** New user option 'project-list-file'. |
| 1136 | 1136 | ||
| 1137 | ** xref | ||
| 1138 | |||
| 1139 | --- | ||
| 1140 | *** Prefix arg of 'xref-goto-xref' quits the *xref* buffer. | ||
| 1141 | So typing 'C-u RET' in the *xref* buffer quits its window | ||
| 1142 | before navigating to the selected location. | ||
| 1143 | |||
| 1137 | ** json.el | 1144 | ** json.el |
| 1138 | 1145 | ||
| 1139 | --- | 1146 | --- |
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index a1c4c08c263..e1dd6e56bbf 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el | |||
| @@ -600,9 +600,9 @@ SELECT is `quit', also quit the *xref* window." | |||
| 600 | 600 | ||
| 601 | (defun xref-goto-xref (&optional quit) | 601 | (defun xref-goto-xref (&optional quit) |
| 602 | "Jump to the xref on the current line and select its window. | 602 | "Jump to the xref on the current line and select its window. |
| 603 | Non-interactively, non-nil QUIT means to first quit the *xref* | 603 | Non-interactively, non-nil QUIT, or interactively, with prefix argument |
| 604 | buffer." | 604 | means to first quit the *xref* buffer." |
| 605 | (interactive) | 605 | (interactive "P") |
| 606 | (let* ((buffer (current-buffer)) | 606 | (let* ((buffer (current-buffer)) |
| 607 | (xref (or (xref--item-at-point) | 607 | (xref (or (xref--item-at-point) |
| 608 | (user-error "No reference at point"))) | 608 | (user-error "No reference at point"))) |