unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* keybinding trouble
@ 2013-02-08 16:31 Frederik
  2013-02-08 16:40 ` Drew Adams
  0 siblings, 1 reply; 4+ messages in thread
From: Frederik @ 2013-02-08 16:31 UTC (permalink / raw)
  To: help-gnu-emacs

Hi there!

I try to bind the flyspell function flyspell-auto-correct-previous-word
to a key. First I tried to bind it to `C-.' but it seems that this
doesn't work in terminals. So came up with the following which doesn't
work, the key sequence stays "unknown" to emacs -- but I don't have a
clue why.

(eval-after-load 'flyspell-mode
	'(define-key flyspell-mode-map (kbd "C-c f")
         	'flyspell-auto-correct-previous-word))

I also tried "\C-c f", "C-c ." and "\C-c ." -- none of them works,
neither in GTK emacs nor in terminal mode.

Any hint is appreciated!
Regards

-- 
Frederik




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

* RE: keybinding trouble
  2013-02-08 16:31 Frederik
@ 2013-02-08 16:40 ` Drew Adams
  2013-02-08 17:01   ` Frederik
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2013-02-08 16:40 UTC (permalink / raw)
  To: 'Frederik', help-gnu-emacs

> (eval-after-load 'flyspell-mode
> 	'(define-key flyspell-mode-map (kbd "C-c f")
>          	'flyspell-auto-correct-previous-word))
> 
> I also tried "\C-c f", "C-c ." and "\C-c ." -- none of them works,
> neither in GTK emacs nor in terminal mode.

(kbd "C-c f") and (kbd "C-c .") are reasonable.
For just a string, lose the space: "\C-cf" and "\C-c.".

Does just loading flyspell-mode define the keymap?  Is the feature or library
actually named `flyspell-mode' and not `flyspell'?  (In my emacs -Q, there is
only flyspell.el.)

You can check the bindings for a given keymap using `C-h M-k'
(`describe-keymap'), from `help-fns+.el':
http://www.emacswiki.org/emacs-en/download/help-fns%2b.el




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

* Re: keybinding trouble
       [not found] <mailman.19346.1360341084.855.help-gnu-emacs@gnu.org>
@ 2013-02-08 16:43 ` Michael Heerdegen
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Heerdegen @ 2013-02-08 16:43 UTC (permalink / raw)
  To: help-gnu-emacs

Frederik <freak.fred@gmail.com> writes:

> (eval-after-load 'flyspell-mode
> 	'(define-key flyspell-mode-map (kbd "C-c f")
>          	'flyspell-auto-correct-previous-word))

Please have a look at the doc of `eval-after-load'.  Your first argument
'flyspell-mode is not a name of a file or feature.  You want 'flyspell
or "flyspell".


Regards,

Michael.



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

* Re: keybinding trouble
  2013-02-08 16:40 ` Drew Adams
@ 2013-02-08 17:01   ` Frederik
  0 siblings, 0 replies; 4+ messages in thread
From: Frederik @ 2013-02-08 17:01 UTC (permalink / raw)
  To: help-gnu-emacs


> For just a string, lose the space: "\C-cf" and "\C-c.".
Thanks Drew!

The following works:
(eval-after-load 'flyspell
	'(define-key flyspell-mode-map (kbd "\C-cf")
		'flyspell-auto-correct-previous-word))

Also thanks to Michael!


-- 
Frederik




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

end of thread, other threads:[~2013-02-08 17:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.19346.1360341084.855.help-gnu-emacs@gnu.org>
2013-02-08 16:43 ` keybinding trouble Michael Heerdegen
2013-02-08 16:31 Frederik
2013-02-08 16:40 ` Drew Adams
2013-02-08 17:01   ` Frederik

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).