>From 6b104ce82d22bc0d7844d7922186b477cf265f90 Mon Sep 17 00:00:00 2001 From: Ben Spencer Date: Thu, 17 Mar 2011 07:24:46 +0000 Subject: [PATCH] Use *group-number-map* in select-group. --- command.lisp | 23 +++++++++++------------ 1 files changed, 11 insertions(+), 12 deletions(-) diff --git a/command.lisp b/command.lisp index 07d1d60..5e43edc 100644 --- a/command.lisp +++ b/command.lisp @@ -409,18 +409,17 @@ then describes the symbol." (defun select-group (screen query) "Attempt to match string QUERY against group number or partial name." - (let ((num (ignore-errors (parse-integer query)))) - (labels ((match-whole (grp) - (string-equal (group-name grp) query)) - (match-partial (grp) - (let* ((end (min (length (group-name grp)) (length query)))) - (string-equal (group-name grp) query :end1 end :end2 end))) - (match-num (grp) - (eql (group-number grp) num))) - (when query - (or (find-if #'match-whole (screen-groups screen)) - (find-if #'match-partial (screen-groups screen)) - (find-if #'match-num (screen-groups screen))))))) + (labels ((match-num (grp) + (string-equal (princ-to-string (group-map-number grp)) query)) + (match-whole (grp) + (string-equal (group-name grp) query)) + (match-partial (grp) + (let* ((end (min (length (group-name grp)) (length query)))) + (string-equal (group-name grp) query :end1 end :end2 end)))) + (when query + (or (find-if #'match-num (screen-groups screen)) + (find-if #'match-whole (screen-groups screen)) + (find-if #'match-partial (screen-groups screen)))))) (define-stumpwm-type :group (input prompt) (let ((match (select-group (current-screen) -- 1.7.2.3