From ad29bc74ca9d4e1768698d4002b49c234624e359 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sat, 14 Nov 2020 22:36:13 +0200 Subject: [PATCH] * lisp/progmodes/xref.el (xref-goto-xref): Prefix arg quits the *xref* buffer. (bug#44611) --- etc/NEWS | 7 +++++++ lisp/progmodes/xref.el | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 0f7b64ddd16..7aa54882508 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -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 --- 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." (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"))) -- 2.39.5