<<< Date Index >>>     <<< Thread Index >>>

Re: Problems with save-hook



* DervishD <raul@xxxxxxxxxxxx> [2004-02-24 15:13 +0100]:
>     Hi Nicolas :)
> 
>     I'm afraid I've called you 'Nicholas' in past messages. Sorry O:)
> 
>  * Nicolas Rachinsky <list@xxxxxxxxxxxx> dixit:
> > >     Only the first one works (I've tested changing the box it saves
> > > to.) the rest simply got ignored. I haven't a 'default_hook', because
> > > I want more control on matching and because I like it. I've tested
> > > with other expressions, like '^.*Movement.*$', etc... so it doesn't
> > > seems to be a problem with regex. How can I debug it?
> > ~A _is_ a default hook.
> 
>     I was talking about the 'default_hook' variable, sorry O:)

Ah. But if you use an expression like '^.*Movement.*$', you will use
$default_hook. But you can use $default_hook, by supplying simple
regexs and complicated patterns at the same time (in different hooks,
of course, but they may be of the same type.

> > And IIRC then the first matching save-hook terminates the search
> > (unlike e.g. folder-hooks). Try reversing the order of the hooks.
> 
>     Where in the manual can I consult the order of matching in the
> hooks?

Good question. I don't know it. But it seems I guessed right every
time I had multiple matching hooks. I would try the following rule
(but I don't know if it's correct for all types of hooks): If the hook
executes a command, all matching hooks are used. If it just sets
something which would be changed by the next matching hook, the first
matching hook terminates the search.

> Currently I don't know if the default hook must be the first
> or the last :(

You're using default hook for two different things in an attempt to
confuse us, aren't you? :-)

The answer depends on the type of the hook. I must admit, I don't even
know all the possible types of hook, I just looked into the manual
once again and was impressed by the number of different types of
hooks.

Nicolas