Re: [PATCH] Change <delete> to delete forward in the editor menu.
Vincent Lefevre <[email protected]> Wed, 29 Jul 2026 19:50:08 +0200
| Newsgroups | gmane.mail.mutt.devel |
|---|---|
| Message-ID | <[email protected]> |
On 2026-07-28 22:03:51 -0300, Jim via Mutt-dev wrote: > On Tue, Jul 28, 2026 at 23:37 (+0200), Vincent Lefevre wrote: > > On 2026-07-26 22:33:44 -0300, Jim via Mutt-dev wrote: > >> On my system XLookupString gives the same character (for the > >> backspace and delete keys) as listed for the keysym. > > > What do you mean? > > I interpreted what you wrote to mean is that in some / many cases what > XLookupString tells is different than what the keysym would suggest. > > In my case, using xev, pressing the key with the left-pointing arrow gives > me: > > KeyPress event, serial 33, synthetic NO, window 0x2e00001, > root 0x6ab, subw 0x0, time 491853741, (98,101), root:(327,274), > state 0x0, keycode 22 (keysym 0xff08, BackSpace), same_screen YES, > XLookupString gives 1 bytes: (08) " > XmbLookupString gives 1 bytes: (08) " > XFilterEvent returns: False > > and pressing the key marked "delete" gives me: > > KeyPress event, serial 36, synthetic NO, window 0x2e00001, > root 0x6ab, subw 0x0, time 491855878, (98,101), root:(327,274), > state 0x0, keycode 119 (keysym 0xffff, Delete), same_screen YES, > XLookupString gives 1 bytes: (7f) "" > XmbLookupString gives 1 bytes: (7f) "" > XFilterEvent returns: False > > So what I meant was that regardless of whether a program looks at the > keysym or the value given by XLookupString, the program would (on my > system) get the same thing. This is not how terminals behave under Linux: the BackSpace key (detected via keysym 0xff08) gives the 7f byte (which has the effect to delete backward), and the Delete key (detected via keysym 0xffff) gives an escape sequence that has the effect to delete forward. If these terminals were just looking at XLookupString, the result would have been different. > (Well, at least for anyone who thinks that "Delete" means the > character with code 127, and "BackSpace" means the character with > code 8. But perhaps some/many/most people don't have that > association (?).) In any case, the historical behavior of the character of code 8 is to move the cursor backward, without erasing. To avoid confusion with the historical behavior, the BackSpace key should probably have been named "delete backward" and the Delete key "delete forward". But most people do not know the historical behavior, so they are not confused with the current naming. -- Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)