From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Recording a macro that preserves timing Date: Thu, 04 Oct 2012 09:33:27 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1349401981 25673 80.91.229.3 (5 Oct 2012 01:53:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Oct 2012 01:53:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 05 03:53:06 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TJx4g-0005tv-QG for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Oct 2012 03:51:34 +0200 Original-Received: from localhost ([::1]:49201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJla4-00082e-LQ for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Oct 2012 09:35:12 -0400 Original-Received: by 10.66.87.161 with SMTP id az1mr1621867pab.38.1349357608474; Thu, 04 Oct 2012 06:33:28 -0700 (PDT) Original-Path: usenet.stanford.edu!kr7no4365445pbb.0!news-out.google.com!t10ni23609663pbh.0!nntp.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe02.iad.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) Cancel-Lock: sha1:2ERzBaVV9hEnrQDbvAGy6woaiBk= Original-Lines: 18 Original-X-Complaints-To: abuse@UsenetServer.com Original-NNTP-Posting-Date: Thu, 04 Oct 2012 13:33:27 UTC X-Received-Bytes: 1332 Original-Xref: usenet.stanford.edu gnu.emacs.help:194716 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87058 Archived-At: > How difficult would such elisp code be to make? Not sure. I'd recommend you look at kmacro.el. I'd suggest you change kmacro-start-macro to add a pre-command-hook that records the time of every command, and then in kmacro-end-macro record those timings alongside the actual macro. Maybe you could combine the two into a normal macro, but this requires some trick because macros contain sequences of *events* (like key-presses) rather than commands, so you can't directly add code into them. But you could use a special `macro-wait' event, and add a binding for it in the global-map. Otherwise, you'll need to write a new function to run your macros. Stefan