* Curiostiy question re: keybinding ??
@ 2007-07-23 19:32 William Case
2007-07-24 20:51 ` Nikolaj Schumacher
0 siblings, 1 reply; 3+ messages in thread
From: William Case @ 2007-07-23 19:32 UTC (permalink / raw)
To: EMACS List
Hi;
Found the following hint in the emacs FAQ. "To interactively bind keys
for all modes, type `M-x global-set-key <RET> KEY CMD <RET>'
Use the following "trick": First bind the key interactively, then
immediately type `C-x <ESC> <ESC> C-a C-k C-g'". Then I yanked
to .emacs.
Used it; it works. However, I get the following;
(global-set-key "^Cc" 'compile) ;; Ctrl-c
(global-set-key "\363" 'shell-command) ;; Meta (Alt)-s
(global-set-key (quote [8388723]) (quote shell)) ;; Super (Win)-s
(global-set-key (quote [8388631]) (quote kill-whole-line)) ;;
Ctrl-Super-w
I replaced the (quote "command") with 'compile and 'shell-command in the
first and second line. It reads even easier. I like the formulation of
the keys as "^Cc"; they are simple to understand and make common sense.
But why did emacs generate the various numerical forms. Is this the
best/fastest way to do a binding?
It would be hard to remember what the numbers mean with out some
comments or a lot of memorization.
Is the first line binding style going out of use (replaced by the kbd
keyword) or coming in? What would be the ^C (Ctrl) equivalent for Meta
-- ^M; and, Super -- ^s; and, Shift -- ^,? What about Fx keys and
others?
This is not a complaint, nor I am I looking for a big dissertation. I
have been to all the info, wiki and tidy sites. Just wondering.
--
Regards Bill
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Curiostiy question re: keybinding ??
2007-07-23 19:32 Curiostiy question re: keybinding ?? William Case
@ 2007-07-24 20:51 ` Nikolaj Schumacher
2007-07-24 21:10 ` William Case
0 siblings, 1 reply; 3+ messages in thread
From: Nikolaj Schumacher @ 2007-07-24 20:51 UTC (permalink / raw)
To: help-gnu-emacs
William Case <billlinux@rogers.com> wrote:
> It would be hard to remember what the numbers mean with out some
> comments or a lot of memorization.
Don't bother with it. Use describe-key and describe-function to look up
keys, if you dynamically bind the keys. If you define them by hand (or
by text rather), use whatever you can read best.
> Is the first line binding style going out of use (replaced by the kbd
> keyword) or coming in? What would be the ^C (Ctrl) equivalent for Meta
> -- ^M; and, Super -- ^s; and, Shift -- ^,? What about Fx keys and
> others?
Actually I don't think it ever was in style. The most common way I
probably is "\C-c\M-c\S-e"\, etc. Not everything can be expressed like
that, though. Using kbd is more powerful, but only the numerical form
is complete, as some special keys (say multimedia keys...) haven't been
assigned a name.
Check out http://tiny-tools.sourceforge.net/emacs-keys.html as well.
regards,
Nikolaj Schumacher
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Curiostiy question re: keybinding ??
2007-07-24 20:51 ` Nikolaj Schumacher
@ 2007-07-24 21:10 ` William Case
0 siblings, 0 replies; 3+ messages in thread
From: William Case @ 2007-07-24 21:10 UTC (permalink / raw)
To: Nikolaj Schumacher; +Cc: help-gnu-emacs
Hi Nikolaj
Thanks for your reply.
On Tue, 2007-07-24 at 22:51 +0200, Nikolaj Schumacher wrote:
> William Case <billlinux@rogers.com> wrote:
>
> > It would be hard to remember what the numbers mean with out some
> > comments or a lot of memorization.
>
> Don't bother with it. Use describe-key and describe-function to look up
> keys, if you dynamically bind the keys. If you define them by hand (or
> by text rather), use whatever you can read best.
>
> > Is the first line binding style going out of use (replaced by the kbd
> > keyword) or coming in? What would be the ^C (Ctrl) equivalent for Meta
> > -- ^M; and, Super -- ^s; and, Shift -- ^,? What about Fx keys and
> > others?
>
> Actually I don't think it ever was in style. The most common way I
> probably is "\C-c\M-c\S-e"\, etc. Not everything can be expressed like
> that, though. Using kbd is more powerful, but only the numerical form
> is complete, as some special keys (say multimedia keys...) haven't been
> assigned a name.
>
> Check out http://tiny-tools.sourceforge.net/emacs-keys.html as well.
Been there lots. It was just that (to me) the nice simple "^Cc" looked
intriguing. Personally I have been using the vector [(...)] for a
couple of years. I will play on my scratch sheet to see what I can get
to work in the way of "...".
Thanks again for your time.
--
Regards Bill,
Emacs 22.0.990.1 Fedora 7
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-24 21:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-23 19:32 Curiostiy question re: keybinding ?? William Case
2007-07-24 20:51 ` Nikolaj Schumacher
2007-07-24 21:10 ` William Case
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).