From 3b7a85d1f938b1f12c871f41988bb68a4172c1d4 Mon Sep 17 00:00:00 2001 From: Matt Spear Date: Mon, 28 Mar 2011 21:06:48 -0700 Subject: [PATCH] make window-number work appropriately --- command.lisp | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/command.lisp b/command.lisp index 5e43edc..bfda624 100644 --- a/command.lisp +++ b/command.lisp @@ -345,15 +345,13 @@ then describes the symbol." (let ((n (or (argument-pop input) (completing-read (current-screen) prompt - (mapcar 'prin1-to-string - (mapcar 'window-number - (group-windows (current-group)))))))) + (mapcar 'window-map-number + (group-windows (current-group))))))) (when n - (handler-case - (parse-integer n) - (parse-error (c) - (declare (ignore c)) - (throw 'error "Number required.")))))) + (let ((indx (position (elt n 0) *window-number-map*))) + (if indx + indx + (throw 'error (format NIL "Invalid window index: ~A" n))))))) (define-stumpwm-type :number (input prompt) (let ((n (or (argument-pop input) -- 1.7.4.1