From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: yzhh Newsgroups: gmane.emacs.devel Subject: Is there a plan to record kbd macro as elisp code? Date: Sat, 27 Oct 2007 09:28:17 +0000 (UTC) Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1193486753 7194 80.91.229.12 (27 Oct 2007 12:05:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Oct 2007 12:05:53 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 27 14:05:56 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 1IlkQ0-0001xY-1I for ged-emacs-devel@m.gmane.org; Sat, 27 Oct 2007 14:05:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IlkPr-0007Zi-21 for ged-emacs-devel@m.gmane.org; Sat, 27 Oct 2007 08:05:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IlkPo-0007YF-6Q for emacs-devel@gnu.org; Sat, 27 Oct 2007 08:05:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IlkPl-0007Rb-KR for emacs-devel@gnu.org; Sat, 27 Oct 2007 08:05:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IlkPl-0007RO-B9 for emacs-devel@gnu.org; Sat, 27 Oct 2007 08:05:17 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IlkPk-0001ZM-Rh for emacs-devel@gnu.org; Sat, 27 Oct 2007 08:05:17 -0400 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1IlkPX-0001Ec-8S for emacs-devel@gnu.org; Sat, 27 Oct 2007 12:05:03 +0000 Original-Received: from 211.90.238.185 ([211.90.238.185]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Oct 2007 12:05:03 +0000 Original-Received: from yezonghui by 211.90.238.185 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Oct 2007 12:05:03 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 21 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 211.90.238.185 (Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.7 (like Gecko) (Debian)) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:81836 Archived-At: Hi, Recording kbd macro as elisp code can be useful. The following are some benefits: 1. Editing elisp code is more clear than editing key sequences, and supports complex controlstructures. 2. elisp code is more portable than key sequences. Sharing with others who have different key bindings is ok for elisp, but not for key sequences. 3. It can be used as a means ot learn emacs commands in elisp form. I tried to build a modified emacs that stores every command sent to 'execute-command' into a list, when 'defining-kbd-macro' is on. But the result is a list that still leaves out things like horizontal movements. And isearch is not recorded right (one search recorded as many isearch commands, without information of what's being searched). So I know the modification required is not simple, far beyond a quick and dirty patch. Out of curiosity I want to know whether there is a plan for this feature in the future.