From: Drew Adams <drew.adams@oracle.com>
To: Kevin Le Gouguec <kevin.le-gouguec@insa-lyon.fr>
Cc: help-gnu-emacs@gnu.org
Subject: RE: Fixing key bindings on some terminals
Date: Mon, 26 May 2014 11:32:41 -0700 (PDT) [thread overview]
Message-ID: <0606347e-794d-4d5f-9b57-897a14e41fc1@default> (raw)
In-Reply-To: <1356362528.658159.1401119418980.JavaMail.root@insa-lyon.fr>
> > See option `normal-erase-is-backspace' for this part, at least.
>
> Thanks, didn't know about that one!
>
> This leaves getting C-? to work has "help-command" with Terminator. Right
> now it behaves like DEL or BACKSPACE, i.e. it deletes forward, since I set
> "normal-erase-is-backspace" to t.
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'.
> To sum up, with "normal-erase-is-backspace" on:
> - With Terminator, "describe-key" "C-?" returns "C-d".
> - With XTerm, "describe-key" "C-?" prints "C-?-" and waits for completion.
>
> I tried to dig some more and apparently this has to do with Terminator being
> an ASCII-based terminal, like gnome-terminal. I haven't read enough to know
> for sure, so right now I guess my options are:
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 18:32 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 [this message]
2014-05-26 20:14 ` Kevin Le Gouguec
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=0606347e-794d-4d5f-9b57-897a14e41fc1@default \
--to=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
--cc=kevin.le-gouguec@insa-lyon.fr \
/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.