Hi Dmitry, maintainters, Here are two patches to fix what I believe is a small but annoying bug in xref.el. I'll try to explain as clearly as possible: As you know, if the user presses 'M-.' in a single-ref definition, he/she is transported to a new buffer. But there are other situations: when xref-find-definitions finds more than one definition, a list is shown in an *xref* buffer, normally in a new window. When the user selects an "xref" with xref-goto-xref, a buffer and window switch happen. Anyway, so far so good. The problem is there is also 'C-x 4 .' and 'C-x 5 .' for xref-find-definitions-other-window and xref-find-definitions-other-frame respectively. These work just fine when an *xref* buffer isn't needed, but when it is, the original intent of using another window or frame will be lost when the user eventually selects a definition. It shouldn't be so, in my opinion. The first patch I attach (0001-Honor-window....patch) fixes this bug. I hope it is readable enough but I can explain how it works in detail. I also attach a second patch (0002-Quit-the....patch), that does not really fix a bug, but changes the behavior of xref-goto-xref to something much nicer: it quits the *xref* window before going to the reference. This brings a nice result: As always 'M-.' switches buffers if there is only one definition. Now, if there is more than one, the final state after selecting one of these definitions is the same as if there had only been one in the first place. I think this makes sense because it preserves the expectations of the user who probably wants M-. to behave as predictably as possible. Here's hoping you're not really confused by this report, João