João Távora writes: > On Fri, Nov 24, 2023 at 9:51 PM Jonas Bernoulli wrote: > >> Also, have you considered throwing in a >> (not (string-equal (match-string 1) sname)) >> >> to avoid having to call `shorthands--mismatch-from-end' at all? > > Where and how this be thrown in? How would you know what to highlight > in the shorthand printed form? There can be many shorthand prefixes > in a given file. But do show some code. Please see the attached patch, inspired by Jonas's comment. >> Maybe you have, but concluded it is cheaper to do a bit too much work >> for non-shorthands, than to effectively repeat some work for shorthands. > > Maybe. Not sure this is more work (string-equal must still compare > every character right?), but, in summary, I'm not married to this > implementation. I somewhat appreciate that I could still read it > after not having looked at it for a couple years, but feel free to > change it. I haven't done any benchmarking - I'm curious to learn how to benchmark font lock though! Thanks!! Joseph