From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#5481: 23.1; insert-kbd-macro: does not write key-binding code Date: Wed, 03 Mar 2010 15:45:33 -0500 Message-ID: <87tysxyw0i.fsf@stupidchicken.com> References: <2f987f0d1001260935j6af42c95oad99250fec836326@mail.gmail.com> <2f987f0d1003030632x7176f6e0ke4a568837268de23@mail.gmail.com> <87635ds7zw.fsf@stupidchicken.com> <2f987f0d1003030820v7ddc620dub9a8ee1ef86e88d8@mail.gmail.com> <87ocj5tiny.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1267649658 492 80.91.229.12 (3 Mar 2010 20:54:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 3 Mar 2010 20:54:18 +0000 (UTC) Cc: 5481@debbugs.gnu.org, Dani Moncayo To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 03 21:54:11 2010 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.69) (envelope-from ) id 1Nmva6-0004c0-Bz for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Mar 2010 21:54:10 +0100 Original-Received: from localhost ([127.0.0.1]:46565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nmva5-0004VT-P8 for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Mar 2010 15:54:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nmva2-0004VE-5I for bug-gnu-emacs@gnu.org; Wed, 03 Mar 2010 15:54:06 -0500 Original-Received: from [140.186.70.92] (port=42473 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nmva1-0004V2-35 for bug-gnu-emacs@gnu.org; Wed, 03 Mar 2010 15:54:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nmva0-0003fb-Ol for bug-gnu-emacs@gnu.org; Wed, 03 Mar 2010 15:54:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37860) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nmva0-0003fX-KI for bug-gnu-emacs@gnu.org; Wed, 03 Mar 2010 15:54:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NmvSE-00037z-7M; Wed, 03 Mar 2010 15:46:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Mar 2010 20:46:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5481 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5481-submit@debbugs.gnu.org id=B5481.126764914012015 (code B ref 5481); Wed, 03 Mar 2010 20:46:02 +0000 Original-Received: (at 5481) by debbugs.gnu.org; 3 Mar 2010 20:45:40 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NmvRs-00037k-MB for submit@debbugs.gnu.org; Wed, 03 Mar 2010 15:45:40 -0500 Original-Received: from pantheon-po25.its.yale.edu ([130.132.50.119]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NmvRr-00037f-B5 for 5481@debbugs.gnu.org; Wed, 03 Mar 2010 15:45:39 -0500 Original-Received: from furry (dhcp128036014112.central.yale.edu [128.36.14.112]) (authenticated bits=0) by pantheon-po25.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o23KjYCr003695 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 3 Mar 2010 15:45:34 -0500 Original-Received: by furry (Postfix, from userid 1000) id BEE46C05D; Wed, 3 Mar 2010 15:45:34 -0500 (EST) In-Reply-To: (Stefan Monnier's message of "Wed, 03 Mar 2010 15:13:49 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (gnu/linux) X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 03 Mar 2010 15:46:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org 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:35408 Archived-At: Stefan Monnier writes: >> I see the problem. On further examination, there was already code in >> macro.el that was supposed to handle this, but it was broken. I've >> checked in a fix. Thanks for the bug report, and for the follow-up. > [...] >> * src/keymap.c (Fwhere_is_internal): Use Fequal to compare >> definitions, so that keyboard macros are correctly handled >> (Bug#5481). > > Could you explain why Fequal is necessary there? It should only make > a difference if we're comparing one macro (ie. vector) against another > identical macro, but IIUC that shouldn't be the case here. We are indeed comparing one macro against another macro. For a macro bound to a key, (key-binding KEY-BOUND-TO-A-MACRO) returns the lambda form of the macro. The function where_is_internal_1 uses Fequal (keymap.c:3001), and it locates the correct binding if you give the lambda form as the `definition' argument. But the binding found by where_is_internal was tossed aside in Fwhere_is_internal because the result of shadow_lookup was compared using EQ---clearly an incorrect step. That's the part I changed.