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."
|
If N is non-nil switch to the nth next window."
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
(while (> arg 0)
|
(setq arg (or arg 1))
|
||||||
(let ((window (next-window (selected-window) nil 'visible)))
|
(let ((gt-or-lt (if (> arg 0) #'> #'<))
|
||||||
(when (not (member window (window-list)))
|
(sign (if (> arg 0) 1 -1)))
|
||||||
(dolist (frame (delq (selected-frame) (frame-list)))
|
(while (apply gt-or-lt arg '(0))
|
||||||
(when (member window (window-list frame))
|
(let ((window (if (= sign 1)
|
||||||
(select-frame-set-input-focus frame))))
|
(next-window (selected-window) nil 'visible)
|
||||||
(select-window window))
|
(previous-window (selected-window) nil 'visible))))
|
||||||
(decf arg)))
|
(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,
|
;; Reload the .emacs file with a minimum of effort,
|
||||||
;; first saving histories with Persistent
|
;; first saving histories with Persistent
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue