other-window-in-any-frame now accepts negative args (from phob on reddit)
This commit is contained in:
parent
5acad3ea7f
commit
177b6c893d
1 changed files with 13 additions and 8 deletions
21
emacs
21
emacs
|
|
@ -401,14 +401,19 @@ switch to that frame first using `select-frame-set-input-focus'.
|
|||
|
||||
If N is non-nil switch to the nth next window."
|
||||
(interactive "p")
|
||||
(while (> arg 0)
|
||||
(let ((window (next-window (selected-window) nil 'visible)))
|
||||
(when (not (member window (window-list)))
|
||||
(dolist (frame (delq (selected-frame) (frame-list)))
|
||||
(when (member window (window-list frame))
|
||||
(select-frame-set-input-focus frame))))
|
||||
(select-window window))
|
||||
(decf arg)))
|
||||
(setq arg (or arg 1))
|
||||
(let ((gt-or-lt (if (> arg 0) #'> #'<))
|
||||
(sign (if (> arg 0) 1 -1)))
|
||||
(while (apply gt-or-lt arg '(0))
|
||||
(let ((window (if (= sign 1)
|
||||
(next-window (selected-window) nil 'visible)
|
||||
(previous-window (selected-window) nil 'visible))))
|
||||
(when (not (member window (window-list)))
|
||||
(dolist (frame (delq (selected-frame) (frame-list)))
|
||||
(when (member window (window-list frame))
|
||||
(select-frame-set-input-focus frame))))
|
||||
(select-window window))
|
||||
(setq arg (- arg sign)))))
|
||||
|
||||
;; Reload the .emacs file with a minimum of effort,
|
||||
;; first saving histories with Persistent
|
||||
|
|
|
|||
Loading…
Reference in a new issue