changeset 59974:bb6a99f86b5d

* xfns.c (Fx_backspace_delete_keys_p): Added comment about the reason for the approach in the code.
author Jan Djärv <jan.h.d@swipnet.se>
date Mon, 07 Feb 2005 12:50:38 +0000
parents b1a9da0dcd80
children 501c2e5945ff
files src/ChangeLog src/xfns.c
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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  <jan.h.d@swipnet.se>
+
+	* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
+	reason for the approach in the code.
+
 2005-02-07  Kim F. Storm  <storm@cua.dk>
 
 	* undo.c (Fprimitive_undo): Record max one dummmy apply element.
--- 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)