Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improve ne2wm:win-ring-push (C-u support)

  • Loading branch information...
commit d2c5c891e6fbf0c4b9a6795f55d82247e5955cbf 1 parent 751633b
@tkf authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 ne2wm-utils.el
View
10 ne2wm-utils.el
@@ -166,12 +166,18 @@ Examples:
(defun ne2wm:win-ring-push (arg)
- (interactive "p")
+ "Switch the current window with the next window.
+If universal prefix argument (C-u) is given, switch with the
+previous window instead. If numerical prefix argument (e.g.,
+M-2) is given, switch with the ARG-th next window."
+ (interactive "P")
(let* ((ring (ne2wm:win-ring-get))
(cur-wname (ne2wm:current-wname-in-list ring))
(next-wname
(when cur-wname
- (ne2wm:find-next-in-seq ring cur-wname arg))))
+ (ne2wm:find-next-in-seq ring cur-wname
+ (when (numberp arg) arg)
+ (and arg (listp arg))))))
(if (not next-wname)
(message "Not in win-ring windows %S." ring)
(let ((cur-buf (e2wm:pst-buffer-get cur-wname))
Please sign in to comment.
Something went wrong with that request. Please try again.