From: Jan Djärv Date: Mon, 7 Feb 2005 12:50:38 +0000 (+0000) Subject: * xfns.c (Fx_backspace_delete_keys_p): Added comment about the X-Git-Tag: ttn-vms-21-2-B4~2369 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3a4415260fb5aaac2b188f35479d99d8002c4dba;p=emacs.git * xfns.c (Fx_backspace_delete_keys_p): Added comment about the reason for the approach in the code. --- diff --git a/src/ChangeLog b/src/ChangeLog index 4ca3ed7b56b..2f42beb74c3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 --git a/src/xfns.c b/src/xfns.c index c0461d8c7a9..bc9b4a5c993 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5403,6 +5403,22 @@ usual X keysyms. */) 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)