aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiha Rihtaršič2022-06-19 15:29:59 +0200
committerDmitry Gutov2022-06-20 03:44:14 +0300
commit9c359b0cec5248871fb0ddb9f1f3bc84fffd4dd5 (patch)
tree756011c3b0d47a3b27d2062df832aec907e93193
parent28bfd4db69c357b708e7b711c947122faf499368 (diff)
downloademacs-9c359b0cec5248871fb0ddb9f1f3bc84fffd4dd5.tar.gz
emacs-9c359b0cec5248871fb0ddb9f1f3bc84fffd4dd5.zip
xref-goto-xref: Set input focus in addition to selecting window
* lisp/progmodes/xref.el (xref--show-location): Set input focus in addition to selecting displayed window (Bug#55983).
-rw-r--r--lisp/progmodes/xref.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 683589d71c6..0213ab3cc58 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -645,9 +645,15 @@ SELECT is `quit', also quit the *xref* window."
645 (xref-buffer (current-buffer))) 645 (xref-buffer (current-buffer)))
646 (cond (select 646 (cond (select
647 (if (eq select 'quit) (quit-window nil nil)) 647 (if (eq select 'quit) (quit-window nil nil))
648 (select-window 648 (let* ((old-frame (selected-frame))
649 (with-current-buffer xref-buffer 649 (window (with-current-buffer xref-buffer
650 (xref--show-pos-in-buf marker buf)))) 650 (xref--show-pos-in-buf marker buf)))
651 (frame (window-frame window)))
652 ;; If we chose another frame, make sure it gets input
653 ;; focus.
654 (unless (eq frame old-frame)
655 (select-frame-set-input-focus frame))
656 (select-window window)))
651 (t 657 (t
652 (save-selected-window 658 (save-selected-window
653 (xref--with-dedicated-window 659 (xref--with-dedicated-window