I would like to scan through a (latex) document and recursively delete -- WITH QUERY -- all consecutive, repeated words that need not be on the same line and/or the same case. Here is a simple example of the sort of texts I have in mind.
This is an example Example of the sort of texts I would would like to handle. I have found two previous emacs.stackexchange posts on this topic:
regexp to find two consecutive and identical words not necessarily in the same line
Find and remove consecutive duplicated words while ignoring case
Is there a way to combine these two AND add
- the ability to delete the duplicate word, with query -- ie ask me before deleting it
- recursively run through the whole document (eg like flyspell)
Bonus request: Is it possible to highlight the repeated word (eg like flyspell)?
I'm complete newbie to regexp; thanks for your patience and help!