From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Key binding syntax
Date: Mon, 11 Apr 2005 16:24:30 -0600 [thread overview]
Message-ID: <d3et9d$mh3$1@sea.gmane.org> (raw)
In-Reply-To: <16986.60027.717280.145858@dionysus.ucolick.org>
Greg Novak wrote:
> I'm having a difficult time rebinding Shift-tab or Control tab. I've
> tried:
>
> [?\C-tab]
That won't work, because the part that follows ?\C- must be a character,
and the tab symbol represents a function key. If you evaluate that, you
get [20 ab], which is a vector of the Control-t character and the ab
symbol.
> [?\C- tab]
Similarly, that is Control-SPC followed by the tab symbol/function key.
> "\C-<tab>"
> "\C-[tab]"
Those appear to be random guesses. (Within a string, you can only have
characters.)
<tab> is a human-readable output representation for the function key,
not a Lisp-readable input representation. [tab] is a readable input
representation for the function key, but it doesn't have any special
meaning within a string.
> "\C-\t"
If you try to evaluate that, you get an "Invalid modifier in string"
error. That's because the \t character (aka TAB) is already a control
character (Control-i).
I'll admit, I don't know why the analogous vector notation [?\C-\t]
doesn't fail for that same reason.
> as the first argument to local-set-key and none of them seem to work.
> I've read the Emacs manual and the Elisp manual, but I can't find the
> information I need.
I would use [C-tab] and [S-tab], to bind the modified tab function key
(vs. the modified TAB character, which is problematical).
> I also did "apropos-command key" looking for a command where I can hit
> a key and have emacs tell me the exact text that should go into the
> first argument to local-set-key in order to rebind the key. Much like
> describe-key, but telling me how to rebind it, not what the current
> current binding happens to be.
Try typing `C-h k' followed by the key sequence you want to bind, and
then `C-h l'. It will show `C-h k <C-tab> C-h l' in the *Help* buffer.
The idiot-proof way to make use of that information (please note, I'm
not calling you an idiot!) is:
(kbd "<C-tab>")
which evaluates to [C-tab].
> I still think that this function must exist, and I'm just not finding
> it. So before I try to write it myself, I thought I'd consult the
> list...
--
Kevin Rodgers
prev parent reply other threads:[~2005-04-11 22:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-11 21:22 Key binding syntax Greg Novak
2005-04-11 22:07 ` Jesper Harder
2005-04-11 22:11 ` Peter Dyballa
2005-04-11 22:24 ` Kevin Rodgers [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='d3et9d$mh3$1@sea.gmane.org' \
--to=ihs_4664@yahoo.com \
/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.
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.