* Binding f2 u
@ 2010-02-09 16:25 Steve Wainstead
2010-02-09 21:02 ` Eduard Wiebe
0 siblings, 1 reply; 3+ messages in thread
From: Steve Wainstead @ 2010-02-09 16:25 UTC (permalink / raw
To: help-gnu-emacs; +Cc: wainstead
I'm trying to bind "f2 u" to a custom function. After spelunking the
*Help* and googling, it seems F2 is the prefix key for the sparse
keymap "2C-command," or else "2c-mode-map."
By default, when one starts emacs -q -nw, f2-s starts two column mode;
so something must live in the global map? Because I cannot bind
anything to either 2C-command or 2c-mode-map:
(define-key 2C-command "u" 'sw-update-builds)
or
(define-key 2c-mode-map "u" 'sw-update-builds)
These fail because 2C-command and 2c-mode-map are void, while:
(define-key ctl-x-map "9" 'sw-update-builds)
does work. How can I bind to f2-u without wiping out the existing mode
map, which seems to be undefined even after I load 2 column mode? I'll
wind up just creating my own sparse keymap for f2 otherwise.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Binding f2 u
2010-02-09 16:25 Binding f2 u Steve Wainstead
@ 2010-02-09 21:02 ` Eduard Wiebe
2010-02-09 22:01 ` Steve Wainstead
0 siblings, 1 reply; 3+ messages in thread
From: Eduard Wiebe @ 2010-02-09 21:02 UTC (permalink / raw
To: help-gnu-emacs
Steve Wainstead <wainstead@gmail.com> writes:
Hi,
> I'm trying to bind "f2 u" to a custom function. After spelunking the
> *Help* and googling, it seems F2 is the prefix key for the sparse
> keymap "2C-command," or else "2c-mode-map."
>
> By default, when one starts emacs -q -nw, f2-s starts two column mode;
> so something must live in the global map? Because I cannot bind
> anything to either 2C-command or 2c-mode-map:
>
> (define-key 2C-command "u" 'sw-update-builds)
> or
> (define-key 2c-mode-map "u" 'sw-update-builds)
>
> These fail because 2C-command and 2c-mode-map are void, while:
>
> (define-key ctl-x-map "9" 'sw-update-builds)
>
> does work. How can I bind to f2-u without wiping out the existing mode
> map, which seems to be undefined even after I load 2 column mode? I'll
> wind up just creating my own sparse keymap for f2 otherwise.
How about this:
(global-set-key (kbd "<f2> u") (lambda () (interactive) (message "YES")))
--
Eduard Wiebe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Binding f2 u
2010-02-09 21:02 ` Eduard Wiebe
@ 2010-02-09 22:01 ` Steve Wainstead
0 siblings, 0 replies; 3+ messages in thread
From: Steve Wainstead @ 2010-02-09 22:01 UTC (permalink / raw
To: help-gnu-emacs
On Feb 9, 4:02 pm, Eduard Wiebe <use...@pusto.de> wrote:
> How about this:
>
> (global-set-key (kbd "<f2> u") (lambda () (interactive) (message "YES")))
Works! thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-02-09 22:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-09 16:25 Binding f2 u Steve Wainstead
2010-02-09 21:02 ` Eduard Wiebe
2010-02-09 22:01 ` Steve Wainstead
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.