From 7f6dba00edcccd6510185108a5c4bbb010393230 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 27 Aug 2020 00:47:18 +0300 Subject: [PATCH] Unbreak xref-goto-xref in Emacs 26 * lisp/progmodes/xref.el (xref-goto-xref): Call next-error-found only if it's defined (bug#42981). --- lisp/progmodes/xref.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index bbf899e7017..4da7b4ef301 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -608,7 +608,10 @@ buffer." (user-error "No reference at point"))) (xref--current-item xref)) (xref--show-location (xref-item-location xref) (if quit 'quit t)) - (next-error-found buffer (current-buffer)))) + (if (fboundp 'next-error-found) + (next-error-found buffer (current-buffer)) + ;; Emacs < 27 + (setq next-error-last-buffer buffer)))) (defun xref-quit-and-goto-xref () "Quit *xref* buffer, then jump to xref on current line." -- 2.39.2