From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Is there a plan to record kbd macro as elisp code? Date: Sun, 28 Oct 2007 12:54:46 +0200 Organization: JURTA Message-ID: <87r6jfecmx.fsf@jurta.org> References: <87y7doxmcw.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1193569018 11135 80.91.229.12 (28 Oct 2007 10:56:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Oct 2007 10:56:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: yzhh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 28 11:57:00 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Im5pA-000700-US for ged-emacs-devel@m.gmane.org; Sun, 28 Oct 2007 11:56:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Im5p1-0002Am-Tc for ged-emacs-devel@m.gmane.org; Sun, 28 Oct 2007 06:56:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Im5oy-00029A-MU for emacs-devel@gnu.org; Sun, 28 Oct 2007 06:56:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Im5oy-00028P-3e for emacs-devel@gnu.org; Sun, 28 Oct 2007 06:56:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Im5ox-00028G-QS for emacs-devel@gnu.org; Sun, 28 Oct 2007 06:56:43 -0400 Original-Received: from gnome.kiev.sovam.com ([212.109.32.24]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Im5ox-0007oB-9A for emacs-devel@gnu.org; Sun, 28 Oct 2007 06:56:43 -0400 Original-Received: from relay02.kiev.sovam.com ([62.64.120.197]) by gnome.kiev.sovam.com with esmtp (Exim 4.67 (FreeBSD)) (envelope-from ) id 1Im5ov-000KNR-Kv; Sun, 28 Oct 2007 12:56:41 +0200 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay02.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1Im5ou-000Ijd-HG; Sun, 28 Oct 2007 12:56:41 +0200 In-Reply-To: (yzhh's message of "Sun\, 28 Oct 2007 06\:49\:13 +0000 \(UTC\)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) X-Scanner-Signature: 7b6940144bc5d56bdacd12344196c2df X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 1690 [Oct 27 2007] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 25 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release X-detected-kernel: by monty-python.gnu.org: FreeBSD 6.x (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:81928 Archived-At: > Basically, I did these: > Add a variable (V)kbd-macro-command-history, insert commands into it on ervey > ocurrence of possible insertion into command-history (that's guarded by > record_flag), when defining-kbd-macro is on. So it's not complete. You have to > M-x eval-expression kbd-macro-command-history to see the recorded thing, in > reverse order. And its length is guarded by history-length. Thanks for your code! I see you collect executed commands together with their arguments into a new list of commands. This is fine. But I think it's better to add a new variable `this-command-args' that contains the arguments of the current command because this variable could be useful for other purposes as well, and it allows collecting commands with their arguments in Lisp that improves the flexibility of this approach. -- Juri Linkov http://www.jurta.org/emacs/