1

I can be remarkably consistent with my misspellings some times; in these instances while running ispell, I'd like to be able to hit something like C-u <correction number> (for instance) to replace all instances of the mispelling at once.

Is there a way to tell ispell to not only replace the current word with a suggestion, but all future instances of that word with the same correction?

(As if I were to exit, then run query-replace and then hit ! to replace all occurrences.)

Thanks in advance.

2 Answers 2

4

If you switch on ispell-query-replace-choices by M-x customize-option ispell uses query-replace if it finds multiple occurrences of the miss-spelled word after you choose a replacement.

After the first correction it will go to the next occurrence and query you with the menu of query-replace-regexp. The most important menu choices are:

  • ! replace all occurrences of the miss-spelled word with the chosen correction
  • y replace this occurrence and go to the next occurrence
  • q continue with the normal Ispell command loop
1
  • Is there a customize-option-free solution? Only using init-file?
    – Name
    Aug 15, 2022 at 15:34
1

Using ispell-buffer, after replacing the first instance you can press "R" - which... yup, gives you query and replace. Not quite as convenient as what you're looking for but almost...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.