mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-03 19:03:24 +00:00
Make windmove repetition more robust
Munge this-command when we hit a movement barrier so we override only on the very next command instead of at the end of a sequence of movement commands that didn't encounter a barrier. * (windmove-do-window-select): Use last-command to remember that we hit a barrier.
This commit is contained in:
parent
1a9c2a9505
commit
269d337f91
1 changed files with 10 additions and 3 deletions
|
@ -385,11 +385,13 @@ the second invocation will override the `no-other-window' property.
|
||||||
CALLING-COMMAND is the command that called this function, used to detect
|
CALLING-COMMAND is the command that called this function, used to detect
|
||||||
repeated commands."
|
repeated commands."
|
||||||
(let* ((repeated-command
|
(let* ((repeated-command
|
||||||
(and calling-command (eq last-command calling-command)))
|
(and calling-command
|
||||||
|
windmove-allow-repeated-command-override
|
||||||
|
(eq last-command
|
||||||
|
(intern (format "%s-override" calling-command)))))
|
||||||
(other-window (windmove-find-other-window dir arg window)))
|
(other-window (windmove-find-other-window dir arg window)))
|
||||||
|
|
||||||
(when (and (null other-window)
|
(when (and (null other-window) repeated-command)
|
||||||
repeated-command windmove-allow-repeated-command-override)
|
|
||||||
(setf other-window (window-in-direction dir window t arg windmove-wrap-around t)))
|
(setf other-window (window-in-direction dir window t arg windmove-wrap-around t)))
|
||||||
|
|
||||||
;; Create window if needed
|
;; Create window if needed
|
||||||
|
@ -411,6 +413,11 @@ repeated commands."
|
||||||
windmove-allow-repeated-command-override)
|
windmove-allow-repeated-command-override)
|
||||||
(let ((test-window (window-in-direction dir window t arg windmove-wrap-around t)))
|
(let ((test-window (window-in-direction dir window t arg windmove-wrap-around t)))
|
||||||
(when test-window
|
(when test-window
|
||||||
|
;; Remember that we stopped at a boundary so we don't override
|
||||||
|
;; a no-other-window before telling the user about it during a
|
||||||
|
;; multi-command movement sequence.
|
||||||
|
(setf this-command
|
||||||
|
(intern (format "%s-override" calling-command)))
|
||||||
(user-error "No window %s (repeat to override)" dir))))
|
(user-error "No window %s (repeat to override)" dir))))
|
||||||
|
|
||||||
(cond ((null other-window)
|
(cond ((null other-window)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue