From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: keyboard macro question Date: Fri, 02 Oct 2009 22:15:26 +0200 Message-ID: <87y6ntlfhd.fsf@thinkpad.tsdh.de> References: <578073a3-391f-481d-9d05-303bfef8e01c@x37g2000yqj.googlegroups.com> <4ac61330$0$288$14726298@news.sunsite.dk> <877hvd3bsi.fsf@newsguy.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1254514587 13142 80.91.229.12 (2 Oct 2009 20:16:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Oct 2009 20:16:27 +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 22:16:20 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 1MtoY4-0001po-KV for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Oct 2009 22:16:16 +0200 Original-Received: from localhost ([127.0.0.1]:53738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtoY4-0002sQ-1L for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Oct 2009 16:16:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtoXd-0002sL-KC for help-gnu-emacs@gnu.org; Fri, 02 Oct 2009 16:15:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtoXZ-0002q4-4L for help-gnu-emacs@gnu.org; Fri, 02 Oct 2009 16:15:49 -0400 Original-Received: from [199.232.76.173] (port=33820 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtoXY-0002pt-Uy for help-gnu-emacs@gnu.org; Fri, 02 Oct 2009 16:15:44 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:49808) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MtoXY-0000Ok-Hv for help-gnu-emacs@gnu.org; Fri, 02 Oct 2009 16:15:44 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1MtoXX-0001ew-13 for help-gnu-emacs@gnu.org; Fri, 02 Oct 2009 22:15:43 +0200 Original-Received: from p54af28dc.dip0.t-ipconnect.de ([84.175.40.220]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 02 Oct 2009 22:15:42 +0200 Original-Received: from tassilo by p54af28dc.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 02 Oct 2009 22:15:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 27 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p54af28dc.dip0.t-ipconnect.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:BQclJk8FiNHo3pQ+moYwY0Dk5kA= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:68629 Archived-At: Harry Putnam writes: Hi Harry, > To reproduce: > Create macro of: > C-u 1 C-x r n a > C-x r i a > C-x r + a The first part (setting register a to 1) must not be part of the macro, but must be done beforehand. Else, each time the macro executes, register a will be set to 1, then you insert the 1, and then you increment it to 2. So here's how to do it: C-u 1 C-x r n a ;; Set register a to 1 F3 ;; Start definition of a macro C-x r i a ;; insert value of register a C-x r + a ;; Increment register a F4 ;; End macro definition Then any additional F4 will insert 2, 3, 4, 5, 6, ... Bye, Tassilo