Basic Function [SOLVED]

I’ve some problems with this function:

[code]DestroyFunc EditFvwm2rc
AddToFunc EditFvwm2rc

  • I Any (.fvwm2rc*) Raise
  • I TestRc (NoMatch) Exec exec scite .fvwm/.fvwm2rc[/code]
    It seems that when scite is already opened the “raise” part is ignored.

in man fvwm i found this example:

AddToFunc ToggleXterm + I Any (my_xtermwindow) Close + I TestRc (NoMatch) Exec xterm -T my_xtermwindow
It’is similar to what i want but doesn’t work. The “Close” command is ignored. (btw with xterm the right option is “-name” and not “-T”)

Where is the error?

[color=red]Edited by theBlackDragon:
–> Moved from Basic questions[/color]

You’re suffering from the idea that matching on a partial title like that is a good idea. Woops. Read this:

edulinux.homeunix.org/~n6tadam/f … styles.txt

Note that I would (having read that URL) change your function to read something like this:

[code]DestroyFunc EditFvwm2rc
AddToFunc EditFvwm2rc

  • I Any (classname) Raise
  • I None (classname) Exec exec scite .fvwm/.fvwm2rc[/code]

Read that URL above. Your error is lack of comprehension.

– Thomas Adam

I’know that “part_of_the_title*” isn’t a good thing but i get the same problem even with classname

[code]DestroyFunc EditFvwm2rc
AddToFunc EditFvwm2rc

  • I Any (Scite) Raise
  • I TestRc (NoMatch) Exec exec scite .fvwm/.fvwm2rc[/code]
    For this reason i posted the man fvwm example that doesn’t use “*” and doesn’t work.

thanks for your help :wink:

The man page example uses “all”, not “any”:

[code]AddToFunc ToggleXterm

  • I All (my_xtermwindow) Close
  • I TestRc (NoMatch) Exec xterm -T my_xtermwindow[/code]
    Any is executed in the context of the root window rather than what the condition matches on. You could also use the “next” or “prev” functions.

It does, and there’s perfectly valid reasons why you should want this in preference over ‘All’. It’s usually not appropriate to hit all windows with the given condition — and changing its running context is but a trivial matter.

– Thomas Adam

If you don’t want to hit all windows then like I said, use the ‘next’ function. I was just pointing out the reason it wasn’t doing as he expected. I would have thought that the whole reason for writing this function was so that there would only be one instance of scite editing the file at the same time, in that case next/all would do about the same thing.

As for the condition, you can match the name exactly with (feel free to correct me :wink: ) (“.fvwm2rc - SciTE”|“.fvwm2rc * SciTE”). If matching by class, then to prevent this from interfering with other instances of scite, you could specify the class when loading scite with “scite --class=scitefvwm ~/.fvwm/.fvwm2rc”.

After doing everything the URL says, it still doesn’t work (not that it’s not good information).

How? If he knew this, he wouldn’t be asking what’s wrong.

Yup, or:

DestroyFunc somefunc
AddToFunc   somefunc
+ I None (sometitle) Exec exec scite --options
+ I TestRc (NoMatch) Next (sometitle) FlipFocus

Assuming that was the title, then yes. :) Is it still a good thing? Not really. Your idea of specifying a unique class name is much better. That’s probably the only thing going for Scite at the moment. :P

– Thomas Adam

Yes, that was the point.

Now it works with:

[code]DestroyFunc EditFvwm2rc
AddToFunc EditFvwm2rc

  • I All (scite_fvwm2rc) Raise
  • I TestRc (NoMatch) Exec exec scite --class=scite_fvwm2rc $[HOME]/.fvwm/.fvwm2rc[/code]

thank you :slight_smile: