unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* binding flyspell-correct-word to a key?
@ 2006-05-19 11:58 emacs user
  2006-05-19 15:41 ` Kevin Rodgers
  0 siblings, 1 reply; 3+ messages in thread
From: emacs user @ 2006-05-19 11:58 UTC (permalink / raw)


would anyone happen to know how to bind flyspell-correct-word to a key
under xterm with no X-windows?  thanks...  EU

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: binding flyspell-correct-word to a key?
  2006-05-19 11:58 binding flyspell-correct-word to a key? emacs user
@ 2006-05-19 15:41 ` Kevin Rodgers
  2006-05-19 18:45   ` David Hansen
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Rodgers @ 2006-05-19 15:41 UTC (permalink / raw)


emacs user wrote:
> would anyone happen to know how to bind flyspell-correct-word to a key
> under xterm with no X-windows?  thanks...  EU

You can't, because that command requires an event argument via
(interactive "e"), and the Emacs Lisp manual explains the `e' code:

      The first or next mouse event in the key sequence that invoked the
      command.  More precisely, `e' gets events that are lists, so you
      can look at the data in the lists.  *Note Input Events::.  No I/O.

      You can use `e' more than once in a single command's interactive
      specification.  If the key sequence that invoked the command has N
      events that are lists, the Nth `e' provides the Nth such event.
      Events that are not lists, such as function keys and ASCII
      characters, do not count where `e' is concerned.

Maybe you could define a new command that calls flyspell-correct-word
with a synthetic generated event, and then bind the new command to a 
key.  (The event is passed to mouse-set-point and flyspell-emacs-popup,
so it would have to satisfy whatever requirements/assumptions those
functions have.)

-- 
Kevin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: binding flyspell-correct-word to a key?
  2006-05-19 15:41 ` Kevin Rodgers
@ 2006-05-19 18:45   ` David Hansen
  0 siblings, 0 replies; 3+ messages in thread
From: David Hansen @ 2006-05-19 18:45 UTC (permalink / raw)


On Fri, 19 May 2006 09:41:45 -0600 Kevin Rodgers wrote:

> emacs user wrote:
>> would anyone happen to know how to bind flyspell-correct-word to a key
>> under xterm with no X-windows?  thanks...  EU
>
> You can't, because that command requires an event argument via
> (interactive "e"), and the Emacs Lisp manual explains the
> `e' code:
>
> [...]
>
> Maybe you could define a new command that calls flyspell-correct-word
> with a synthetic generated event, and then bind the new
> command to a key.  (The event is passed to mouse-set-point
> and flyspell-emacs-popup,

or just use

,----[ C-h f flyspell-auto-correct-word RET ]
| flyspell-auto-correct-word is an interactive compiled Lisp function in `flyspell.el'.
| It is bound to C-., M-TAB.
| (flyspell-auto-correct-word)
| 
| Correct the current word.
| This command proposes various successive corrections for the current word.
| 
`----

David

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-19 18:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-19 11:58 binding flyspell-correct-word to a key? emacs user
2006-05-19 15:41 ` Kevin Rodgers
2006-05-19 18:45   ` David Hansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).