From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Robert J. Chassell" Newsgroups: gmane.emacs.devel Subject: Re: Emacs manual desribes keyboard macros in the wrong section. Date: Fri, 28 Feb 2003 13:36:12 +0000 (UTC) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <5xheart32c.fsf@kfs2.cua.dk> <5xisv47eu2.fsf@kfs2.cua.dk> Reply-To: bob@rattlesnake.com NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1046439495 25537 80.91.224.249 (28 Feb 2003 13:38:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 28 Feb 2003 13:38:15 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18okhZ-0006Yl-00 for ; Fri, 28 Feb 2003 14:37:25 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18okyy-0003Az-00 for ; Fri, 28 Feb 2003 14:55:24 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18okhc-00046O-08 for emacs-devel@quimby.gnus.org; Fri, 28 Feb 2003 08:37:28 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18okgs-0003bB-00 for emacs-devel@gnu.org; Fri, 28 Feb 2003 08:36:42 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18okgT-0002xZ-00 for emacs-devel@gnu.org; Fri, 28 Feb 2003 08:36:18 -0500 Original-Received: from megalith.rattlesnake.com ([140.186.114.245] helo=localhost) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18okgR-0002ps-00 for emacs-devel@gnu.org; Fri, 28 Feb 2003 08:36:16 -0500 Original-Received: by rattlesnake.com via sendmail from stdin id (Debian Smail3.2.0.114) Fri, 28 Feb 2003 13:36:12 +0000 (UTC) Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:12025 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:12025 > I'm currently working on documenting the enhanced kmacro commands > (ready in 1-2 weeks), ... On a related issue: A decade or more ago, Emacs possessed a command that would convert a keyboard macro to an Emacs Lisp program starting with `defun'. Does this program still exist? If so what is it called? I cannot find it. Here is what I mean. As the manual says, C-x ( C-a C- C-n M-w C-x b f o o C-y C-x b C-x ) defines a macro that copies the current line into the buffer `foo', then returns to the original buffer. The old function, which may have been part of an early version of Emacs Calc, would have produced a `defun' like this (the optional doc string was in the wrong place): (defun sample-kmacro () "" (interactive) (beginning-of-line) (set-mark-command) (next-line) (kill-ring-save) (switch-to-buffer "foo") (yank) (switch-to-buffer (other-buffer))) Does the old function still exist? I would like to see it. I cannot find the old function, and have always thought it interesting as well as useful both in practice and as a teaching tool. Currently, `insert-kbd-macro' produces this: (fset 'sample-kmacro [?\C-a ?\C- ?\C-n ?\M-w ?\C-x ?b ?f ?o ?o return ?\C-y ?\C-x ?b return]) Also, the `Keyboard Macro Editor' in the current distribution, in `....emacs/lisp/edmacro.el', produces this when you type `C-x C-k RET' (kmacro-edit-macro): ;; Keyboard Macro Editor. Press C-c C-c to finish; ;; Press C-x k RET to cancel. ;; Original keys: C-a C-SPC C-n M-w C-x b foo RET C-y C-x b RET Command: last-kbd-macro Key: none Macro: C-a ;; beginning-of-line C-SPC ;; set-mark-command C-n ;; next-line M-w ;; kill-ring-save C-x b ;; switch-to-buffer foo ;; self-insert-command * 3 RET ;; newline C-y ;; yank C-x b ;; switch-to-buffer RET ;; newline As is, the current `insert-kbd-macro' and `kmacro-edit-macro' are fine; but they are not as helpful as a program that converts keystrokes to a `defun'. -- Robert J. Chassell Rattlesnake Enterprises http://www.rattlesnake.com GnuPG Key ID: 004B4AC8 http://www.teak.cc bob@rattlesnake.com