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: how-many/count-matches for non-interactive use Date: Wed, 20 Oct 2004 09:28:53 -0400 (EDT) Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <87pt3m5vqk.fsf@oak.pohoyda.family> <87zn2mh5jk.fsf-monnier+emacs@gnu.org> <87is99nznd.fsf-monnier+emacs@gnu.org> <200410172053.i9HKrdL01136@raven.dms.auburn.edu> <200410190158.i9J1wrH25523@raven.dms.auburn.edu> <200410200114.i9K1EBr28373@raven.dms.auburn.edu> Reply-To: bob@rattlesnake.com NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1098279081 3407 80.91.229.6 (20 Oct 2004 13:31:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 20 Oct 2004 13:31:21 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 20 15:31:04 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CKGYR-0005U3-00 for ; Wed, 20 Oct 2004 15:31:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CKGfp-0003j9-Mk for ged-emacs-devel@m.gmane.org; Wed, 20 Oct 2004 09:38:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CKGfZ-0003fW-ML for emacs-devel@gnu.org; Wed, 20 Oct 2004 09:38:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CKGfY-0003eq-3M for emacs-devel@gnu.org; Wed, 20 Oct 2004 09:38:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CKGfX-0003eD-Oc for emacs-devel@gnu.org; Wed, 20 Oct 2004 09:38:23 -0400 Original-Received: from [69.168.110.189] (helo=rattlesnake.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CKGXH-0004Co-KK for emacs-devel@gnu.org; Wed, 20 Oct 2004 09:29:51 -0400 Original-Received: by rattlesnake.com via sendmail from stdin id (Debian Smail3.2.0.115) Wed, 20 Oct 2004 09:28:53 -0400 (EDT) Original-To: emacs-devel@gnu.org In-reply-to: <200410200114.i9K1EBr28373@raven.dms.auburn.edu> (message from Luc Teirlinck on Tue, 19 Oct 2004 20:14:11 -0500 (CDT)) 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:28664 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28664 As Luc Teirlinck said, A keyboard macro is a poor man's Lisp function. Ten or twelve years ago, GNU Emacs Calc contained a function that converted keyboard macros to GNU Emacs Lisp functions. It might be useful to focus again on this. Such a conversion function might help novices and those who put short expressions in their .emacs files. The original conversion function was not very good. It did not print the resulting defun right and it did not take arguments. It changed a few commands to others. But it was good enough as a beginning. For example, if I remember rightly, the conversion function could take a keyboard macro named `foo' C-x ( C-s Emacs C-b C-b C-b C-b C-b GNU C-n C-a C-x ) and create a function that looked like this: (defun foo () (interactive) (search-forward "Emacs") (backward-char) (backward-char) (backward-char) (backward-char) (backward-char) (insert "G") (insert "N") (insert "U") (insert " ") (next-line) (beginning-of-line)) (except that the result was more poorly pretty printed), rather than this: C-s Emacs 5*C-b GNU SPC C-n C-a or (fset 'foo (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ("EmacsGNU " 0 "%d")) arg))) I lost interest in the function and now cannot find it. Either I have not looked well enough or it has been removed from the sources. Interestingly, the `kmacro-edit-macro-repeat' command (`C-x C-k C-e') lists command names as comments. Perhaps the fairly deficient conversion function transmogrified into this command. -- Robert J. Chassell bob@rattlesnake.com GnuPG Key ID: 004B4AC8 http://www.rattlesnake.com http://www.teak.cc