[Top][All Lists]

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

Re: DEL vs Backspace

From: Stefan Kangas
Subject: Re: DEL vs Backspace
Date: Sun, 25 Apr 2021 19:45:14 -0500

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Maybe we could start by adding a DEL => backspace remapping *without*
> removing the backspace => DEL remapping?

Interesting idea.

If I understand you correctly, that would mean something like:

    (define-key function-key-map [?\C-?] [backspace])

And that would allow you to bind keys to `[backspace]' and have them
work also on the terminal?

(The above translation doesn't seem to actually work.  I'm not sure if
I'm doing something wrong, or if this is just not supported.)

> Still, as modes start changing their keymaps to place bindings on
> `backspace` we'll end up with situations where a minor modes has
> a mapping for DEL and the major mode has a different mapping for
> `backspace` and they'll end up chosen based on the incidental "tty or
> GUI?" distinction rather than based on the minor modes bindings's
> precedence over major modes's.

The only idea I have would be to add byte-compiler warnings for
`global-set-key' and `define-key' like:

    Deprecated binding to `"DEL"', use `[backspace]' instead

But perhaps there would still exist reasons why someone would want to
specifically bind "DEL"?

> This said, such problems already exist since a fair number of modes
> mistakently bind commands to `tab` instead of TAB or to `return` instead
> of RET, leading to overriding minor-vs-major precedence rules.

reply via email to

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