From 11c58c4fc495ea4f7bff52ca077fd3e4382aa900 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 28 Feb 2018 03:38:37 +0200 Subject: [PATCH] Fix xref--next-error-function behavior WRT current buffer * lisp/progmodes/xref.el (xref--show-location): Make sure to make the target window selected at the end, and its buffer current (bug#20489). --- lisp/progmodes/xref.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index e0f5b2d3670..1c1fc597c50 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -501,8 +501,9 @@ SELECT is `quit', also quit the *xref* window." (xref-buffer (current-buffer))) (cond (select (if (eq select 'quit) (quit-window nil nil)) - (with-current-buffer xref-buffer - (select-window (xref--show-pos-in-buf marker buf)))) + (select-window + (with-current-buffer xref-buffer + (xref--show-pos-in-buf marker buf)))) (t (save-selected-window (xref--with-dedicated-window -- 2.39.5