# HG changeset patch # User Jan Dj¸«£rv # Date 1107780638 0 # Node ID bb6a99f86b5d0ebc636cf2f63b1d7c5f70f7c034 # Parent b1a9da0dcd807fe44b92cbb53fb8b7173f8aba7b * xfns.c (Fx_backspace_delete_keys_p): Added comment about the reason for the approach in the code. diff -r b1a9da0dcd80 -r bb6a99f86b5d src/ChangeLog --- a/src/ChangeLog Mon Feb 07 11:44:57 2005 +0000 +++ b/src/ChangeLog Mon Feb 07 12:50:38 2005 +0000 @@ -1,3 +1,8 @@ +2005-02-07 Jan Dj,Ad(Brv + + * xfns.c (Fx_backspace_delete_keys_p): Added comment about the + reason for the approach in the code. + 2005-02-07 Kim F. Storm * undo.c (Fprimitive_undo): Record max one dummmy apply element. diff -r b1a9da0dcd80 -r bb6a99f86b5d src/xfns.c --- a/src/xfns.c Mon Feb 07 11:44:57 2005 +0000 +++ b/src/xfns.c Mon Feb 07 12:50:38 2005 +0000 @@ -5403,6 +5403,22 @@ return Qnil; } + /* In this code we check that the keyboard has physical keys with names + that start with BKSP (Backspace) and DELE (Delete), and that they + generate keysym XK_BackSpace and XK_Delete respectively. + This function is used to test if normal-erase-is-backspace should be + turned on. + An alternative approach would be to just check if XK_BackSpace and + XK_Delete are mapped to any key. But if any of those are mapped to + some non-intuitive key combination (Meta-Shift-Ctrl-whatever) and the + user doesn't know about it, it is better to return false here. + It is more obvious to the user what to do if she/he has two keys + clearly marked with names/symbols and one key does something not + expected (i.e. she/he then tries the other). + The cases where Backspace/Delete is mapped to some other key combination + are rare, and in those cases, normal-erase-is-backspace can be turned on + manually. */ + have_keys = Qnil; kb = XkbGetMap (dpy, XkbAllMapComponentsMask, XkbUseCoreKbd); if (kb)