From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Convert a keyboard macro to equivalent Lisp code Date: Mon, 07 Jun 2010 16:11:39 -0400 Message-ID: References: <87fx11mfd3.fsf@mail.jurta.org> <87bpbn55au.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1275941528 27758 80.91.229.12 (7 Jun 2010 20:12:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Jun 2010 20:12:08 +0000 (UTC) Cc: emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 07 22:12:07 2010 connect(): No such file or directory 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.69) (envelope-from ) id 1OLifo-0008Tw-T5 for ged-emacs-devel@m.gmane.org; Mon, 07 Jun 2010 22:12:07 +0200 Original-Received: from localhost ([127.0.0.1]:52042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLifk-0002F1-4f for ged-emacs-devel@m.gmane.org; Mon, 07 Jun 2010 16:11:48 -0400 Original-Received: from [140.186.70.92] (port=49529 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLifd-0002EY-Tv for emacs-devel@gnu.org; Mon, 07 Jun 2010 16:11:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLifc-0007Y2-Pt for emacs-devel@gnu.org; Mon, 07 Jun 2010 16:11:41 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:54032 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLifc-0007Xt-Ml for emacs-devel@gnu.org; Mon, 07 Jun 2010 16:11:40 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAG7vDExFpYBi/2dsb2JhbACeHXLAWIUXBIxn X-IronPort-AV: E=Sophos;i="4.53,380,1272859200"; d="scan'208";a="67538153" Original-Received: from 69-165-128-98.dsl.teksavvy.com (HELO pastel.home) ([69.165.128.98]) by ironport2-out.pppoe.ca with ESMTP; 07 Jun 2010 16:11:39 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 246C48175; Mon, 7 Jun 2010 16:11:39 -0400 (EDT) In-Reply-To: <87bpbn55au.fsf@mail.jurta.org> (Juri Linkov's message of "Mon, 07 Jun 2010 21:35:57 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:125609 Archived-At: > To get useful results, some commands should provide their arguments > explicitly in the interactive spec instead of relying on global > variables. So instead of useless `(self-insert-command 1)' typing `A' > will record `(self-insert-command 1 65)' with the following patch. > The same is for isearch. This will break all Elisp calls to self-insert-command (grep finds more than 100 of them in lisp/**/*.el) ;-( So I think it's not an option. Better would be to have your command-recording code provide hooks such that commands like self-insert-command can teach it how to turn them into Elisp code (in the case of self-insert-command it should probably use `insert'). Of course, even better would be if the code run during macro recording is the code generated (so if the behavior is different from the normal command's behavior, you might see it during recording). Stefan