stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [STUMP] Seaching commands


From: Friedrich Delgado
Subject: Re: [STUMP] Seaching commands
Date: Sun, 6 Mar 2011 21:45:28 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

That looks useful to me.

However there's a lot of duplicate code in those three functions. When
I try it one day I'd probably feel like factoring out the duplicate
parts.

Just my 2ยข

Michael Raskin schrieb:
> I hereby resend code to search titles and tags by regexp.
> 
> This can be included in either a separate contrib file or in the end of 
> window-tags.lisp
> 
> 
> (defcommand search-tag (tag-regex) ((:rest "Tag regex to select: "))
>   (only)
>   (fclear)
>   (let*
>    (
>     (current (current-group (current-screen)))
>     (tag-store (find-group (current-screen) ".tag-store")))
>    (loop for w in (screen-windows (current-screen)) do
>          (if
>           (find-if (lambda (s) (cl-ppcre:scan (concatenate 'string "(?i)" 
> tag-regex) s)) (window-tags w))
>           (move-window-to-group w current)
>           (move-window-to-group w tag-store)))))
> (defcommand search-tag-pull (tag-regex) ((:rest "Tag regex to pull: "))
>   (only)
>   (fclear)
>   (let*
>    (
>     (current (current-group (current-screen)))
>     (tag-store (find-group (current-screen) ".tag-store")))
>    (loop for w in (screen-windows (current-screen)) do
>          (if
>           (find-if (lambda (s) (cl-ppcre:scan (concatenate 'string "(?i)" 
> tag-regex) s)) (window-tags w))
>           (move-window-to-group w current)
>           (progn)))))
> 
> (defcommand select-by-title-regexp (regex) ((:rest "Title regex to select: "))
>   (only)
>   (fclear)
>   (let*
>    (
>     (current (current-group (current-screen)))
>     (tag-store (find-group (current-screen) ".tag-store")))
>    (loop for w in (screen-windows (current-screen)) do
>          (if (cl-ppcre:scan regex (window-title w))
>              (move-window-to-group w current)
>              (move-window-to-group w tag-store)))))
> (defcommand pull-by-title-regexp (regex) ((:rest "Title regex to select: "))
>   (only)
>   (fclear)
>   (let*
>    (
>     (current (current-group (current-screen)))
>     (tag-store (find-group (current-screen) ".tag-store")))
>    (loop for w in (screen-windows (current-screen)) do
>          (if (cl-ppcre:scan regex (window-title w))
>              (move-window-to-group w current)
>              (progn)))))

-- 
        Friedrich Delgado <address@hidden>
                             TauPan on Ircnet and Freenode ;)

Attachment: pgpx0CH_5_JM9.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]