all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Brown <brown@google.com>
To: 2057@emacsbugs.donarmstrong.com
Cc: emacs-pretest-bug@gnu.org
Subject: bug#2057: 23.0.60; delete key and deletechar
Date: Thu, 16 Apr 2009 11:10:13 -0400	[thread overview]
Message-ID: <u9atz4od48a.fsf@paradicsom.nyc.corp.google.com> (raw)


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)));






             reply	other threads:[~2009-04-16 15:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-16 15:10 Robert Brown [this message]
2009-04-16 16:19 ` bug#2057: 23.0.60; delete key and deletechar 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
2009-01-25 23:01 Robert Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=u9atz4od48a.fsf@paradicsom.nyc.corp.google.com \
    --to=brown@google.com \
    --cc=2057@emacsbugs.donarmstrong.com \
    --cc=emacs-pretest-bug@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.