From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Benjamin Newsgroups: gmane.emacs.help Subject: keyboard macro question Date: Fri, 2 Oct 2009 07:05:40 -0700 (PDT) Organization: http://groups.google.com Message-ID: <578073a3-391f-481d-9d05-303bfef8e01c@x37g2000yqj.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1254494452 8201 80.91.229.12 (2 Oct 2009 14:40:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Oct 2009 14:40:52 +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 02 16:40:45 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MtjJM-000729-Hc for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Oct 2009 16:40:44 +0200 Original-Received: from localhost ([127.0.0.1]:40250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtjJM-000828-3v for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Oct 2009 10:40:44 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!x37g2000yqj.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: 128.183.110.112 Original-X-Trace: posting.google.com 1254492340 21355 127.0.0.1 (2 Oct 2009 14:05:40 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 2 Oct 2009 14:05:40 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x37g2000yqj.googlegroups.com; posting-host=128.183.110.112; posting-account=k71GrQgAAABoaExIto65pVL3WbVinnYS User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009061118 Fedora/3.0.11-1.fc9 Firefox/3.0.11, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:173508 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:68621 Archived-At: I use keyboard macros fairly frequently, but I often run into a situation where I would like to increment a number in the macro, e.g., if I start with: tmp tmp tmp tmp and I want to end with: tmp1 tmp2 tmp3 tmp4 I know how to create the macro where it would result in: tmp1 tmp1 tmp1 tmp1 Is there a way to make the number increment each time the macro is executed? Otherwise I am forced to step down through each line and manually put the numbers in 1, 2, 3, 4, ... Naturally this is a greatly shortened example for illustration purposes, and often the incrementing takes place within a longer statement e.g., tmp(:,1) = function(x,y). My interest here is how to increment or decrement the number in a more automatic fashion. I don't mind doing something other than macros, or even external commands (perl/sed/awk, etc.) to assist with this. Thanks, -Ben