From: William Case <billlinux@rogers.com>
To: Matthew Flaschen <matthew.flaschen@gatech.edu>
Cc: emacs <help-gnu-emacs@gnu.org>
Subject: Re: Binding same command to two separte keys??
Date: Fri, 13 Apr 2007 16:17:32 -0400 [thread overview]
Message-ID: <1176495452.3065.121.camel@CASE> (raw)
In-Reply-To: <461FD736.2080709@gatech.edu>
Ok guys, now I am really totally confused.
I have been using emacs for 2 years. I have read the Wiki, printed out
the tiny-tools site and read and re-read the info pages.
Over the last 2 years I have written about 10 keybinding functions, that
are in my .emacs, and that I use all the time. They have always been in
the form of (global-set-key [(M-s)] 'shell-command). Now 'kbd' shows
up, and '?\' to replace it. And, whats a #' for, that replaces the
single '.
I just want to get consistent. I plan to do a fair amount of work with
emacs shortly. Up to now I haven't worried much because I used my emacs
21.4 only for trivial text editing.
So ... in (global-set-key (kbd "M-s") #'shell-command)
Does ?\ = kbd ?
Does [ ] replace ( ) ?
Are the " " necessary or not necessary ?
Does the # have a special meaning or is it always used now?
Where do I find the kbd documentation that I already haven't looked at?
Do symbols like F3 still require < > ?
What syntax would work for both standard emacs functions and my own user
functions?
Emacs 22 is going to show up when I upgrade to Fedora 7. Is keybinding
going to be different again?
On Fri, 2007-04-13 at 15:17 -0400, Matthew Flaschen wrote:
> Karl Hegbloom wrote:
> > On Fri, 2007-04-13 at 15:02 -0400, William Case wrote:
> >> I have set (global-set-key [(M-s)] 'shell-command) in my .emacs.
> >> I also want to keep the M-! shell-command binding
> >>
> >> Nothing happens when I use M-s, nor do I get an error message.
> >
> > I think that the syntax of the expression describing the key is
> > incorrect.
>
> The correct syntax is:
>
> [?\M-s]
It works.
> Try looking at the documentation of the `kbd' macro (F1 f
> > kbd). You can use it there, like:
> > (global-set-key (kbd "M-s") #'shell-command)
It also works.
> There's no need for kbd here. It's unnecessary overhead.
>
I know there are several ways to do this -- but I need to know, for me,
some way that is consistent. I am partial to ?\ unless it has lots of
exceptions (i.e ?\C, ?\S, ?\s ??) -- if so, I'll use 'kbd' throughout.
Sorry if I sound a little grouchy, but right now my emacs frustration
knows no bounds and I am unable to make sense of anything that I read.
It is like day one, two years ago, all over again. I thought I had this
simple task -- binding functions to keys worked out.
> _______________________________________________
> help-gnu-emacs mailing list
> help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
--
Regards Bill
next prev parent reply other threads:[~2007-04-13 20:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-13 19:02 Binding same command to two separte keys?? William Case
2007-04-13 19:12 ` Karl Hegbloom
2007-04-13 19:17 ` Matthew Flaschen
2007-04-13 20:17 ` William Case [this message]
2007-04-13 21:04 ` Matthew Flaschen
2007-04-13 21:55 ` David Hansen
2007-04-13 22:23 ` Matthew Flaschen
2007-04-14 0:44 ` David Hansen
[not found] ` <mailman.2052.1176495874.7795.help-gnu-emacs@gnu.org>
2007-04-13 21:41 ` Rjjd
2007-04-14 3:52 ` Matthew Flaschen
[not found] ` <mailman.2061.1176522998.7795.help-gnu-emacs@gnu.org>
2007-04-15 3:32 ` Tim X
2007-04-13 21:55 ` Joost Kremers
2007-04-14 9:26 ` Reiner Steib
2007-04-16 10:17 ` Kai Grossjohann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1176495452.3065.121.camel@CASE \
--to=billlinux@rogers.com \
--cc=help-gnu-emacs@gnu.org \
--cc=matthew.flaschen@gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).