* lisp/progmodes/xref.el (xref-goto-xref): Prefix arg quits the *xref* buffer.

(bug#44611)
This commit is contained in:
Juri Linkov 2020-11-14 22:36:13 +02:00
parent 844e82f5a8
commit ad29bc74ca
2 changed files with 10 additions and 3 deletions

View file

@ -1134,6 +1134,13 @@ project's root directory, respectively.
+++
*** New user option 'project-list-file'.
** xref
---
*** Prefix arg of 'xref-goto-xref' quits the *xref* buffer.
So typing 'C-u RET' in the *xref* buffer quits its window
before navigating to the selected location.
** json.el
---

View file

@ -600,9 +600,9 @@ SELECT is `quit', also quit the *xref* window."
(defun xref-goto-xref (&optional quit)
"Jump to the xref on the current line and select its window.
Non-interactively, non-nil QUIT means to first quit the *xref*
buffer."
(interactive)
Non-interactively, non-nil QUIT, or interactively, with prefix argument
means to first quit the *xref* buffer."
(interactive "P")
(let* ((buffer (current-buffer))
(xref (or (xref--item-at-point)
(user-error "No reference at point")))