Eli Zaretskii writes: > Thanks, sounds like a good optimization to me. Splendid! I cleaned it up a bit and ran a few tests against the original function using an empty string, a string without anything to replace and a string requiring many replacements. It seems to behave just as the original. I use cl-flet and (eval-when-compile (require 'cl-lib)). I hope that is ok. Regards, Raffael