From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Robert Brown Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#2057: 23.0.60; delete key and deletechar Date: Thu, 16 Apr 2009 11:10:13 -0400 Message-ID: Reply-To: Robert Brown , 2057@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1239895469 17565 80.91.229.12 (16 Apr 2009 15:24:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Apr 2009 15:24:29 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org To: 2057@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 16 17:25:48 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LuTT2-0005Q0-55 for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Apr 2009 17:25:32 +0200 Original-Received: from localhost ([127.0.0.1]:60462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LuTRc-000418-Ny for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Apr 2009 11:24:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LuTRZ-00040L-2q for bug-gnu-emacs@gnu.org; Thu, 16 Apr 2009 11:24:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LuTRU-0003yT-Vw for bug-gnu-emacs@gnu.org; Thu, 16 Apr 2009 11:24:00 -0400 Original-Received: from [199.232.76.173] (port=57686 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LuTRU-0003yF-BY for bug-gnu-emacs@gnu.org; Thu, 16 Apr 2009 11:23:56 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:44744) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LuTRT-0004tZ-FZ for bug-gnu-emacs@gnu.org; Thu, 16 Apr 2009 11:23:55 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3GFNpEt013358; Thu, 16 Apr 2009 08:23:53 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n3GFK3BO012151; Thu, 16 Apr 2009 08:20:03 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Robert Brown Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 16 Apr 2009 15:20:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2057 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123989472710574 (code B ref -1); Thu, 16 Apr 2009 15:20:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 16 Apr 2009 15:12:07 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3GFBxGq010557 for ; Thu, 16 Apr 2009 08:12:00 -0700 Original-Received: from mail.gnu.org ([199.232.76.166]:52548 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LuTFu-0007FF-OZ for emacs-pretest-bug@gnu.org; Thu, 16 Apr 2009 11:11:58 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LuTFr-0003Rt-C5 for emacs-pretest-bug@gnu.org; Thu, 16 Apr 2009 11:11:58 -0400 Original-Received: from smtp-out.google.com ([216.239.45.13]:49354) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LuTFq-0003FR-VL for emacs-pretest-bug@gnu.org; Thu, 16 Apr 2009 11:11:55 -0400 Original-Received: from zps35.corp.google.com (zps35.corp.google.com [172.25.146.35]) by smtp-out.google.com with ESMTP id n3GFAFKI003100; Thu, 16 Apr 2009 08:10:15 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1239894616; bh=1z50hCx4fjoQELr02XQ+8rINbog=; h=DomainKey-Signature:Date:Message-Id:From:To:Subject:CC: X-System-Of-Record; b=spXPVbBmF58V8s47xqShEzqEk36n22kOaprX/C/7FXro 40iXWXSvTy4jLn4pO25WwDdTfqgayUAKcR+PsVDoNQ== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=date:message-id:from:to:subject:cc:x-system-of-record; b=Qb6ny96LcJGAteI+QTdp667k0gtRrY3tuB5dLizFjNXSKmJqCbHY5zfC4n5k5OEAH OMMfVOBgxVbYcDs5WiDvQ== Original-Received: from paradicsom.nyc.corp.google.com.google.com (paradicsom.nyc.corp.google.com [172.26.104.255]) by zps35.corp.google.com with ESMTP id n3GFADo6008607; Thu, 16 Apr 2009 08:10:14 -0700 X-System-Of-Record: true X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 16 Apr 2009 11:24:00 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:27241 gmane.emacs.pretest.bugs:24289 Archived-At: 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)));