From: Kevin Le Gouguec <kevin.le-gouguec@insa-lyon.fr>
To: Drew Adams <drew.adams@oracle.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Fixing key bindings on some terminals
Date: Mon, 26 May 2014 22:14:55 +0200 (CEST) [thread overview]
Message-ID: <1683962821.713364.1401135295297.JavaMail.root@insa-lyon.fr> (raw)
In-Reply-To: <0606347e-794d-4d5f-9b57-897a14e41fc1@default>
Woah, never realized ^? actually was the control character for DEL. Thanks!
Okay so I do not want to bind DEL to "help-command". I'd like "help-command" to be bound to "hold control then hit '?'". Right now doing this results in "delete-char", and trying to "describe-key" "C-?" gives me the description for "C-d".
I tried using
(global-set-key (kbd "DEL") 'help-command)
But C-? still forward-deleted characters, and "describe-key" still told me I typed C-d. So I'm not sure what Terminator sends to Emacs when I hit C-? :/
Of course this is all in Terminator ; XTerm works fine. I.e. these lines...
(global-set-key (kbd "C-?") 'help-command)
(define-key help-map (kbd "C-?") 'help-for-help)
... actually do what I expect them to do.
Not sure what my options are. I don't know how hard it'd be to change Terminator to behave like XTerm when it comes to key presses. I guess it's just a matter of time before I switch to having one XTerm running Emacs with a bunch of terminals inside...
----- Original Message -----
From: "Drew Adams" <drew.adams@oracle.com>
To: "Kevin Le Gouguec" <kevin.le-gouguec@insa-lyon.fr>
Cc: help-gnu-emacs@gnu.org
Sent: Monday, May 26, 2014 8:32:41 PM
Subject: RE: Fixing key bindings on some terminals
> <snip>
Actually, the *character* `CONTROL ?' (aka ^?, an ASCII control char)
*is* `DEL' (old name `DELETE'). And it is not the key `<backspace>',
the key `<delete>', or the key `C-?'.
That is (for the last part), it might be (and probably is) the case
that when you hold Control and hit `?', you keyboard does not send a
CONTROL ? character but something else. Yes, this is confusing.
If you do `C-h k C-i', that is, hold Control and hit `i', Emacs always
writes `TAB'. But the same does not happen for `C-?' (holding Control
and hitting `?'). Emacs distinguishes the character ^? (aka `DEL')
from the key that is sent from your keyboard when you hold Control and
hit `?'.
So `C-h k C-?' (holding Control and hitting `?') typically tells
you that "C-? is undefined". It does not tell you that `DELL' is
bound to...
If you want `DEL') to invoke `help-command' then bind it to
`help-command':
(global-set-key (kbd "DEL") 'help-command)
(define-key help-map (kbd "DEL") 'help-for-help) ; for `DEL DEL'
Then you can use, for example, `DEL f' for `describe-function' and
`DEL DEL' for `help-for-help'.
You might need to bind `DEL' in additional keymaps also, as some
modes bind `DEL' to other commands. For example, in Emacs Lisp
mode `DEL' is bound to `backward-delete-char-untabify'.
> <snip>
Sorry, I know nothing about Terminator.
An ASCII-based terminal should be able to handle `DEL'. But it might
not be able to handle the key that your keyboard sends when you hold
down Control and hit `?'.
If your teminal can handle Control + `?' then you can bind it just as
you did:
(global-set-key (kbd "C-?") 'help-command)
(define-key help-map (kbd "C-?") 'help-for-help)
The fact that this does not work for you tells me that your terminal
does not recognize the key combination Control + `?'. (That would be
the case for any ASCII terminal.)
next prev parent reply other threads:[~2014-05-26 20:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1659521050.517588.1401091680002.JavaMail.root@insa-lyon.fr>
2014-05-26 8:32 ` Fixing key bindings on some terminals Kevin Le Gouguec
2014-05-26 15:18 ` Drew Adams
2014-05-26 15:50 ` Kevin Le Gouguec
2014-05-26 18:32 ` Drew Adams
2014-05-26 20:14 ` Kevin Le Gouguec [this message]
2014-05-26 21:51 ` Drew Adams
2014-05-26 22:39 ` Stefan Monnier
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=1683962821.713364.1401135295297.JavaMail.root@insa-lyon.fr \
--to=kevin.le-gouguec@insa-lyon.fr \
--cc=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
/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.