Subject: Re: bug#32790: 27.0.50; point jumps unexpectedly after delete-window

From: Juri Linkov <[email-masked]>
Date: Wed, 07 Nov 2018 23:44:27 +0200

>>> IME the windmove user community is quite small.  Don't we expect
>>> directional buffer display to attract more users than that?  Per se
>>> S-M-<right> C-x 4 C-o is a pain to type.  So we could provide
>>> attractive key bindings because windmove is pretty independent in this
>>> regard.  And we should advertise them in the user manual.
>>
>> What key bindings are more attractive in your opinion?
>
> What I meant here is that if a user has typed a (customizable
> directional) prefix like S-M-<right> the next key should already
> supply all that's needed for the most common usages of the prefix.

I see now how this relates to your example above ‘S-M-<right> C-x 4 C-o’.
And I agree that it's really a pain to type such long key sequences as
‘S-M-<right> C-x 4 .’

Shouldn't xref support a shorter and easier to type key sequence
‘S-M-<right> M-.’ with the following patch:

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 6b1421a6f7..6aab174bcf 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -425,7 +425,7 @@ xref--pop-to-location
                    (xref-location-marker (xref-item-location item))))
          (buf (marker-buffer marker)))
     (cl-ecase action
-      ((nil)  (switch-to-buffer buf))
+      ((nil)  (pop-to-buffer-same-window buf))
       (window (pop-to-buffer buf t))
       (frame  (let ((pop-up-frames t)) (pop-to-buffer buf t))))
     (xref--goto-char marker))

> Note that in its current form windmove.el is practically not needed
> any more - most of its job is now done by 'window-in-direction'.  All
> that remains in practice are its keybindings.

Then maybe all unused code should be removed including
windmove-other-window-loc, windmove-reference-loc,
windmove-wrap-loc-for-movement, windmove-constrain-loc-for-movement,
etc.