[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[STUMP] [PATCH] Make select-group match by number first then name.
From: |
Scott Wolchok |
Subject: |
[STUMP] [PATCH] Make select-group match by number first then name. |
Date: |
Sat, 21 Jun 2008 16:09:22 -0700 |
Sorry if this comes through twice, I think git-send-email doesn't work
right for me.
---
command.lisp | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/command.lisp b/command.lisp
index cb01aa3..43686c0 100644
--- a/command.lisp
+++ b/command.lisp
@@ -277,16 +277,19 @@ alias name for the command that is only
accessible interactively."
(defun select-group (screen query)
"Attempt to match string QUERY against group number or partial name."
- (let (match
- (num (ignore-errors (parse-integer query))))
- (labels ((match (grp)
+ (let ((num (ignore-errors (parse-integer query)))
+ match)
+ (labels ((match-by-name (grp)
(let* ((name (group-name grp))
(end (min (length name) (length query))))
;; try by name or number
- (or (string-equal name query :end1 end :end2 end)
- (eql (group-number grp) num)))))
+ (string-equal name query :end1 end :end2 end)))
+ (match-by-number (grp)
+ (eql (group-number grp) num)))
(unless (null query)
- (setf match (find-if #'match (screen-groups screen))))
+ (let ((groups (screen-groups screen)))
+ (setf match (or (find-if #'match-by-number groups)
+ (find-if #'match-by-name groups)))))
match)))
(define-stumpwm-type :group (input prompt)
--
1.5.5.4
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [STUMP] [PATCH] Make select-group match by number first then name.,
Scott Wolchok <=