Hello Arash,
> It still doesn't solve the issue Al has `rainbow-delimiters` (I guess), > but should unbreak the fontification and give somewhat better results. Thanks! The fontification is indeed better, though a bit inconsistent (nevertheless I think the behaviour is better for me personally, even with the inconsistency). This command: \href{pre\cmd{test}post}{foo} has the correct character class for the braces around `test` and `foo` but not the braces of `href` for some reason. Also, a command like: \href{pre\cmd{{my}test}post}{foo} changes the font of the href argument completely. -- Al