stumpwm-devel
[Top][All Lists]
Advanced

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

[STUMP] Seaching commands


From: Michael Raskin
Subject: [STUMP] Seaching commands
Date: Sun, 06 Mar 2011 19:43:38 +0300

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)))))







reply via email to

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