[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposal: Bind backspace and delete like DEL in view-mode

From: Kim F. Storm
Subject: Re: Proposal: Bind backspace and delete like DEL in view-mode
Date: 23 Dec 2001 00:07:22 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

address@hidden (Kai Großjohann) writes:

> address@hidden (Kim F. Storm) writes:
> > I don't know, but maybe it would make more sense to put those
> > mappings into something similar to the keyboard-translate-table
> > which is done FIRST rather than "MAYBE LATER".
> I'm not sure what to do here.  What about people who want C-i and
> <tab> to be different?  If you unconditionally convert <tab> into TAB
> (which is the same as C-i), then you lose that feature.
> Right now, people can bind (kbd "TAB") or (kbd "<tab>"), as they like.
But if someone binds <tab> in global-map, any minor mode keymap which only
has a binding for TAB will no longer work - as the binding in global-map
will take precedence over the mapping of <tab> to TAB in function-key-map.

> But let's talk specifically about DEL.  It really seems that it's not
> so easy to rebind DEL: newbies are wont to do something wrong there,
> as many newbies come from the PC world where they think of the keys
> <backspace> and <delete>, and DEL being (more or less) the same as
> <backspace> is surely a surprise to them.
> For this case, it might be useful to set things up the other way
> round: do
> (define-key function-key-map (kbd "<backspace>") nil)
> (define-key function-key-map (kbd "DEL") (kbd "<backspace>"))
> and then bind (kbd "<backspace>") rather than (kbd "DEL") in all mode
> maps.  What do people think about this?
It seems like a really good idea.

The only drawback I can think of is that any explicit binding of DEL
in global-map will then break the mapping of <backspace> the same way
that an explicit binding of <backspace> breaks DEL mappings now.

Consequently, existing (correct) bindings of DEL in global-map will
no longer DTRT :-(

I'm still not sure what is the best solution, but having define-key
look up keys in function-key-map and see if they map to DEL - and then
bind to DEL instead - does seem to DTRT in all practical cases.
And it could do the same for TAB, RET and LFD.

For the expert user, there could be a new optional argument to
define-key to inhibit this behaviour.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]