4

I want to check the spelling in a buffer. I do that by M-x ispell. When it finds nd in the folowing example:

apple a nd orange

I hit the left or right arrow key, in order to move the cursor to the space after a in the buffer and then delete the extra space between a and nd. But it seems that I exit ispell when I hit my arrow key. How can I do my edit without exiting ispell?

Currently, if I restart M-x ispell, it will start from the beginning of the buffer, rather than from where I was last time. To start from where I was last time, I select the region from where I was to the end of buffer, and then M-x ispell.

How can I continue from where I was left last time more efficiently?

Andrew Swann
  • 3,436
  • 2
  • 15
  • 43
Tim
  • 4,987
  • 7
  • 31
  • 60
  • If you have skipped with the `a` option [accept for this session], it will not ask you again for the word that you skipped. The instructions at the bottom of the window state: *Spell-checking suspended; use `C-u M-x ispell-word` to resume*. Did you try that? – lawlist Mar 07 '15 at 03:32
  • How can I suspend the spell checking, so that I can edit the buffer directly, and then resume the spell checking? – Tim Mar 07 '15 at 05:01
  • I normally use the arrow key to exit ispell (which preserves the option to resume), but other keys may also serve to exit ispell and permit resuming. To resume ispell where you left off, the message that gets displayed at the bottom of the window -- `C-u M-x ispell-word` is the answer to your question -- press the control key and while depressing it, press the letter `u` one time -- then press the escape key and then press the letter `x` -- then type `ispell-word` and press the return key. – lawlist Mar 07 '15 at 06:16

1 Answers1

7

You should use recursive-edit for this.

Enter recursive-edit with C-r; make your changes to the buffer and then exit again with C-M-c.

This is a general mechanism in emacs for escaping to make changes whilst you are in the middle of running a query replace type operation; this includes ispell.

Andrew Swann
  • 3,436
  • 2
  • 15
  • 43
  • What's the difference between using `C-r` (recursive edit) and using `ispell`'s `X` and `C-u x=` to resume? – Geremia Jun 18 '19 at 20:06
  • 2
    @Geremia They seem to be very similar, I wasn't aware `ispell` had its own version; but the standard binding for the resumption command is `C-u M-$` . It is not clear to me there is much advantage to using `ispell`'s version; it means remember a new resumption sequence. – Andrew Swann Jun 19 '19 at 07:18