Using regular expressions to perform text replacements can be tricky.
Without robust undo support or version control,
a preview of the changes,
or checking every replacement before it’s being made,
you can end up with false-positive matches and mess things up. Now Emacs 30.1 released and ships with yet another way to perform mass text replacements more safely:
Use run-of-the-mill diffs to show the changes that would be made if you applied a regular expression-based replacement.
I love the ingenuity of this idea, because it is so obvious.
The other day, Michael Schechter complained Scrivener’s outliner feature lacked a focus mode. To this, Aaron Mahnkelaconically replied: Yeah, I still don’t understand the need. Type out an outline, paste it into
your document, and then type above it. It will always be visible right below
your book text. Why turn the folders into an outline?
After CriticMarkup was released with a toolkit including Sublime Text 2 theme and commands, I simply ported the easy stuff to TextMate. Since Sublime Text bundle files are heavily inspired by TextMate (to ensure compatibility with the popular Mac all-purpose editor, I suppose), this wasn’t a very complicated task.