From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Convert keyboard macros to Lisp (was: how-many/count-matches for non-interactive use) Date: Fri, 22 Oct 2004 15:54:51 +0300 Organization: JURTA Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <87oeiuc3qc.fsf_-_@jurta.org> 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> <200410200127.i9K1Rpp28384@raven.dms.auburn.edu> <200410210308.i9L38Dm10997@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1098450023 18617 80.91.229.6 (22 Oct 2004 13:00:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 22 Oct 2004 13:00:23 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 22 15:00:14 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 1CKz1h-0005KC-00 for ; Fri, 22 Oct 2004 15:00:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CKz9C-0000Ga-Kx for ged-emacs-devel@m.gmane.org; Fri, 22 Oct 2004 09:07:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CKz94-0000GL-Ii for emacs-devel@gnu.org; Fri, 22 Oct 2004 09:07:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CKz94-0000G9-5d for emacs-devel@gnu.org; Fri, 22 Oct 2004 09:07:50 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CKz94-0000G6-2F for emacs-devel@gnu.org; Fri, 22 Oct 2004 09:07:50 -0400 Original-Received: from [66.33.205.9] (helo=spatula.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CKz1S-0007mg-8I; Fri, 22 Oct 2004 08:59:58 -0400 Original-Received: from mail.jurta.org (80-235-41-143-dsl.mus.estpak.ee [80.235.41.143]) by spatula.dreamhost.com (Postfix) with ESMTP id 560A517D020; Fri, 22 Oct 2004 05:59:52 -0700 (PDT) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Fri, 22 Oct 2004 06:47:03 -0400") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) 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:28727 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28727 Richard Stallman writes: > The discussion seems to have wandered into a tangent about > how to best convert keyboard macros to Lisp. I tend to avoid using keyboard macros as much as possible because when requirements for a macro are changed beyond the macro capabilities all user's efforts on defining a macro are wasted and Lisp code needs to be written from scratch. Bob already mentioned an old command that would convert a keyboard macro to an Emacs Lisp program. I am not aware of such a command, but I think it would be useful. It also might serve as a quick start for writing Lisp code: to generate most of Lisp function calls after typing corresponding keys and add complex Lisp constructs manually later. I imagine that such command can't convert a keyboard macro to Lisp code statically since a keyboard macro may switch buffers where keys have different bindings. It should perform conversion either during macro definition or execution. -- Juri Linkov http://www.jurta.org/emacs/