run-or-raise title matching

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

run-or-raise title matching

J David Smith
Hi,

I was hacking around on my .stumpwmrc and stumbled upon something interesting: the :title matching does substring-level matching. For example, from my config:

(defcommand urxvtc () ()
    (run-or-raise "urxvtc" '(:title "urxvt")))
(defcommand emacs () ()
    (run-or-raise "urxvtc -e urxvt-new-emacs" '(:title "urxvt-new-emacs)))

bound to `s-w c' and `s-w e', respectively. When I launch emacs first with `s-w e`, `s-w c` switches to it. However, when I launch urxvt first with `s-w c`, I can then launch emacs and switch between them with the binding for urxvt.

I have no reason to believe that this is unintended behavior (such substring matching is a nice feature in almost every use case). 

My question is this: is there a built-in way to override this behavior?

 -- J. David Smith

P.S. I've got my rc working beautifully, I ask this out of curiosity.

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: run-or-raise title matching

Shawn Betts-3
I'm pretty sure the string you supply can be a regex. So presumably
(run-or-raise "urxvtc" (:title "^unrxvt$")) would match exactly that
string.

-shawn

On Tue, Oct 1, 2013 at 12:16 PM, J. David Smith <[hidden email]> wrote:

> Hi,
>
> I was hacking around on my .stumpwmrc and stumbled upon something
> interesting: the :title matching does substring-level matching. For example,
> from my config:
>
> (defcommand urxvtc () ()
>     (run-or-raise "urxvtc" '(:title "urxvt")))
> (defcommand emacs () ()
>     (run-or-raise "urxvtc -e urxvt-new-emacs" '(:title "urxvt-new-emacs)))
>
> bound to `s-w c' and `s-w e', respectively. When I launch emacs first with
> `s-w e`, `s-w c` switches to it. However, when I launch urxvt first with
> `s-w c`, I can then launch emacs and switch between them with the binding
> for urxvt.
>
> I have no reason to believe that this is unintended behavior (such substring
> matching is a nice feature in almost every use case).
>
> My question is this: is there a built-in way to override this behavior?
>
>  -- J. David Smith
>
> P.S. I've got my rc working beautifully, I ask this out of curiosity.
>
> _______________________________________________
> Stumpwm-devel mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
>

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel