unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#2057: 23.0.60; delete key and deletechar
@ 2009-04-16 15:10 Robert Brown
  2009-04-16 16:19 ` Dan Nicolaescu
  2009-04-16 18:45 ` Stefan Monnier
  0 siblings, 2 replies; 8+ messages in thread
From: Robert Brown @ 2009-04-16 15:10 UTC (permalink / raw)
  To: 2057; +Cc: emacs-pretest-bug


I believe the following patch may be the right fix for bug 2057.  When
looking at the key sequences generated by function keys, Emacs should only
register those that generate two or more ASCII characters.

My termcap entry, xterm-color, contains "kD=\177", which means that the
delete *function* key generates code 177.

The function key mapping code in term.c incorrectly creates a translation
that maps charcter code 177 to deletechar.  The translation is incorrect
because the normal backspace/delete key on my keyboard also generates code
177.  Once the translation is set up, hitting backspace/delete causes Emacs
to delete characters to the right instead of to the left, since Emacs thinks
I'm hitting the delete *function* key.

bob

====================


--- src/term.c.~1~      2009-04-13 14:57:19.000000000 -0400
+++ src/term.c  2009-04-16 10:59:32.000000000 -0400
@@ -1410,7 +1410,7 @@
   for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++)
     {
       char *sequence = tgetstr (keys[i].cap, address);
-      if (sequence)
+      if (sequence && strlen(sequence) > 1)
        Fdefine_key (kboard->Vinput_decode_map, build_string (sequence),
                     Fmake_vector (make_number (1),
                                   intern (keys[i].name)));






^ permalink raw reply	[flat|nested] 8+ messages in thread
* bug#2057: 23.0.60; delete key and deletechar
@ 2009-04-16 15:33 Robert Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Robert Brown @ 2009-04-16 15:33 UTC (permalink / raw)
  To: 2057; +Cc: emacs-pretest-bug


On second thought, maybe the real bug is with the termcap entry.  Hitting
the function key labeled delete on my keyboard generates:

   escape [ 3 ~

not character 177.  Maybe function keys always generate multi-character
sequences, so there's generally no confusion between the function key and a
normal key.

bob

====================


--- src/term.c.~1~      2009-04-13 14:57:19.000000000 -0400
+++ src/term.c  2009-04-16 10:59:32.000000000 -0400
@@ -1410,7 +1410,7 @@
   for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++)
     {
       char *sequence = tgetstr (keys[i].cap, address);
-      if (sequence)
+      if (sequence && strlen(sequence) > 1)
        Fdefine_key (kboard->Vinput_decode_map, build_string (sequence),
                     Fmake_vector (make_number (1),
                                   intern (keys[i].name)));







^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-04-16 18:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200904161817.n3GIHmJn015568@godzilla.ics.uci.edu>
2009-01-25 23:01 ` bug#2057: 23.0.60; delete key and deletechar Robert Brown
2009-04-16 18:30   ` bug#2057: marked as done (23.0.60; delete key and deletechar) Emacs bug Tracking System
2009-04-16 15:10 bug#2057: 23.0.60; delete key and deletechar Robert Brown
2009-04-16 16:19 ` Dan Nicolaescu
2009-04-16 17:54   ` Robert Brown
2009-04-16 18:45 ` Stefan Monnier
2009-04-16 18:54   ` Robert Brown
  -- strict thread matches above, loose matches on Subject: below --
2009-04-16 15:33 Robert Brown

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).