xwem-devel
[Top] [All Lists]

Re: Tip: Switching to clients specified by MATCH-SPEC

From: Zajcev Evgeny <zevlg@xxxxxxxxx>
Subject: Re: Tip: Switching to clients specified by MATCH-SPEC
Date: Tue, 15 Feb 2005 21:46:04 +0300
Cc: XWEM Devel <xwem-devel@xxxxxxxx>
User-agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4 (Corporate Culture, linux)
Zajcev Evgeny <zevlg@xxxxxxxxx> writes:

> Firstly lets create a function to find the client among all clients
> managed by xwem:
>
>     (defun my-find-client (match-spec)
>       "Return client that matches MATCH-SPEC."
>       (let ((cls (xwem-clients-list)))
>         (while (and cls (not (xwem-cl-match-p (car cls) (list match-spec))))
>           (setq cls (cdr cls)))
>         (car cls)))

I found more nifty way to do it:

    (defun my-find-client (match-spec)
      "Return first client that matches MATCH-SPEC."
      (car (xwem-clients-list
            (lambda (cl) (xwem-cl-match-p cl match-spec)))))

-- 
lg

<Prev in Thread] Current Thread [Next in Thread>