[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating a "shortcut" key for "C-c C-"
From: |
Bill Clementson |
Subject: |
Re: Creating a "shortcut" key for "C-c C-" |
Date: |
Wed, 23 Apr 2003 03:45:17 GMT |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
"Stefan Monnier" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:
> > Maybe it works to do
> > (global-set-key (kbd "<f4>") (kbd "C-c C-x @ c"))
>
> That won't work: the C-x @ c thingy works in function-key-map,
> i.e. before almost all keymaps.
> Furthermore, (define-key function-key-map [f8] "\C-c\C-x@c") won't work
> either because the output of function-key-map is not fed back to
> function-key-map.
> And I can't think of any map that applies before function-key-map and
> that can do such mapping.
>
> But you can do:
>
> (defun C-cC- (prompt)
(vconcat "\C-c" (event-apply-control-modifier prompt)))
> (define-key function-key-map [f8] 'C-cC-)
Sounds great; unfortunately, it doesn't work for me :-(
When I evaluate the above forms, I tried pressing "f8-n" in a buffer
that has a keybinding to "C-c C-n". I thought that the "f8-n" keybinding
would result in the execution of the same command that was bound to "C-c
C-n". Unfortunately, the only thing that happened was that an "n" was
inserted into the buffer. When I run the command "describe-key" on
"f8-n", it says that "n runs the command self-insert-command
(self-insert-command N)". Am I missing some step?
Thanks for your help.
--
Bill Clementson