Ilya Zakharevich wrote: > [A complimentary Cc of this posting was sent to Kevin Rodgers > ], who wrote in article > : > >>What commands are invoked by `x' and `q' in ispell-region? >> >>You could advise those commands to throw to a tag that you establish >>with catch. > > No such command. See `ispell-command-loop'. Of course, one could > advise ispell-command-loop itself to propagate ispell-quit (which is > going to be reset to nil later) to, e.g., ispell-quit-pos. > > Is it possible to do advising "locally" (like let()ting), so it is > automatically undone when the calling function exits? Ah, ispell-command-loop. I should have remembered that, since I had to rewrite the whole thing in order to implement a simple change I wanted (to index the *Choices* buffer with numbers instead of characters). To keep it clean, I extracted those command characters into their own keymap. If you start with what I wrote (ispell-command-loop.el, which I'm attaching), then you could get access to those anonymous commands like this: (defconst ispell-x-command (lookup-key ispell-command-loop-map "x")) (defconst ispell-q-command (lookup-key ispell-command-loop-map "q")) And then modify the bindings to do what you want: (define-key ispell-command-loop-map "x" (lambda () (interactive) (throw 'my-tag (funcall ispell-x-command)))) (define-key ispell-command-loop-map "q" (lambda () (interactive) (throw 'my-tag (funcall ispell-q-command)))) -- Kevin Rodgers