jmc icon indicating copy to clipboard operation
jmc copied to clipboard

#unaction does not work for regexp actions

Open mlengle opened this issue 1 year ago • 2 comments

Steps to reproduce:

#act {/[\d+]/}{test}; #act; #unact {/[\d+]/}; #act

probably there's a bug around "/" escaping

mlengle avatar Nov 07 '22 18:11 mlengle

It's related to TinTin legacy feature of 'bulk/wildcard unaction', e.g. #unact {*axe*} removes all actions that contain 'axe' substring. This feature requires some method of escaping asterisk, and uses backslash for this purpose, thus first argument of act and unact has somewhat different syntax (in act asterisk and backslash are just asterisk and backslash, without special meaning).

In your case #unact {/[\\d+]/} should work, I think.

I agree that this syntax difference is counter intuitive, but I am not sure that it should be fixed, because 'fix' will brake backward compatibility (if there is someone who use this feature with mass-removing actions). And I think there are many other places with such logic in TinTin's legacy.

konelav avatar Nov 09 '22 14:11 konelav

I think main problem here is the lack of the documentation for the very basic stuff like this. Otherwise I'm ok about keeping it as it is now

mlengle avatar Nov 09 '22 14:11 mlengle