Browse files

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

  • Loading branch information...
tkf committed Aug 26, 2012
1 parent 751633b commit d2c5c891e6fbf0c4b9a6795f55d82247e5955cbf
Showing with 8 additions and 2 deletions.
  1. +8 −2 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))
(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))

0 comments on commit d2c5c89

Please sign in to comment.