From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#48523: 27.2; kbd macro fails evaluation Date: Wed, 19 May 2021 11:20:53 -0400 Message-ID: References: <87tumyzut3.fsf@yandex.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20766"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 48523@debbugs.gnu.org To: Colin Baxter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 19 17:22:14 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljO1T-0005AK-Mw for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 May 2021 17:22:11 +0200 Original-Received: from localhost ([::1]:36408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljO1S-0006eb-Ox for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 May 2021 11:22:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljO1K-0006eS-5d for bug-gnu-emacs@gnu.org; Wed, 19 May 2021 11:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48927) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ljO1J-0003rL-Tn for bug-gnu-emacs@gnu.org; Wed, 19 May 2021 11:22:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ljO1J-0006er-Pc for bug-gnu-emacs@gnu.org; Wed, 19 May 2021 11:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 May 2021 15:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48523 X-GNU-PR-Package: emacs Original-Received: via spool by 48523-submit@debbugs.gnu.org id=B48523.162143766725510 (code B ref 48523); Wed, 19 May 2021 15:22:01 +0000 Original-Received: (at 48523) by debbugs.gnu.org; 19 May 2021 15:21:07 +0000 Original-Received: from localhost ([127.0.0.1]:60468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ljO0R-0006dO-DK for submit@debbugs.gnu.org; Wed, 19 May 2021 11:21:07 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:14587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ljO0L-0006cR-Fk for 48523@debbugs.gnu.org; Wed, 19 May 2021 11:21:05 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E6D21440B76; Wed, 19 May 2021 11:20:55 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 881F5440A71; Wed, 19 May 2021 11:20:54 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1621437654; bh=m1f4ZfYn6L7ywy2kbtb6B4mOSgWRDVo7POEXNcCrfaM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=KDVrFPH/PpHsCIdf5eTy70nmTaNuJEhZvPvKCP+ZXyuhF1qkx8crcCuM98/pvXYkU VgtumumI8iLdnSXD+RlOb5UsiXMF35adPMtR1hXOW1m+4QcDc5Dzj9jK8vDDEJARbp 65YApzR1aveaqxc6l8awqfkuB2eOHwwKLX0QTsIw+Ce56QF3buJdapDb9y2gd9CA2X 6C7EOanVH/rMIFNfOFnBUvRNY3Hfmgcs6pTuQ9L2xe6doBoaQ/J57hezVjBf7ZankV FfTRKj1+b5AHYiCuy2eQAPaUXCQ83UwPMBRJfDRH7UnQ/nPx5zlh3VG8YRYb1KhISr CXauwz8bg7qSw== Original-Received: from alfajor (76-10-140-76.dsl.teksavvy.com [76.10.140.76]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4770D120760; Wed, 19 May 2021 11:20:54 -0400 (EDT) In-Reply-To: <87tumyzut3.fsf@yandex.com> (Colin Baxter's message of "Wed, 19 May 2021 15:01:44 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:206896 Archived-At: > This gives: > > #+begin_src elisp > (fset 'myfullstop > (kmacro-lambda-form [?\C-x ?8 return ?F ?U ?L ?L ?W ?I ?D ?T ?H ? ?F > ?U ?L ?L ? ?S ?T ?O ?P return] 0 "%d")) > #+end_src > > > An eval (C-j with point at end) of the above expression gives the error: > > ----- Begin -------- > > Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 1) 3) I installed the patch below which should fix this blunder, thanks. Stefan diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 3700a1964a6..afc486f4edc 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el @@ -782,17 +782,23 @@ kmacro-end-call-mouse ;; executing the macro later on (but that's controversial...) ;;;###autoload -(defun kmacro-lambda-form (mac) +(defun kmacro-lambda-form (mac &optional counter format) "Create lambda form for macro bound to symbol or key." - ;; FIXME: This should be a "funcallable struct"! - (lambda (&optional arg) - "Keyboard macro." - ;; We put an "unused prompt" as a special marker so - ;; `kmacro-extract-lambda' can see it's "one of us". - (interactive "pkmacro") - (if (eq arg 'kmacro--extract-lambda) - (cons 'kmacro--extract-lambda mac) - (kmacro-exec-ring-item mac arg)))) + ;; Apparently, there are two different ways this is called: + ;; either `counter' and `format' are both provided and `mac' is a vector, + ;; or only `mac' is provided, as a list (MAC COUNTER FORMAT). + ;; The first is used from `insert-kbd-macro' and `edmacro-finish-edit', + ;; while the second is used from within this file. + (let ((mac (if counter (list mac counter format) mac))) + ;; FIXME: This should be a "funcallable struct"! + (lambda (&optional arg) + "Keyboard macro." + ;; We put an "unused prompt" as a special marker so + ;; `kmacro-extract-lambda' can see it's "one of us". + (interactive "pkmacro") + (if (eq arg 'kmacro--extract-lambda) + (cons 'kmacro--extract-lambda mac) + (kmacro-exec-ring-item mac arg))))) (defun kmacro-extract-lambda (mac) "Extract kmacro from a kmacro lambda form."