help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs insert icrement numbers


From: Jim Ottaway
Subject: Re: emacs insert icrement numbers
Date: Thu, 17 Aug 2006 22:58:50 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Regards,

Pascal Bourguignon <pjb@informatimago.com> writes:

> With latest versions (>=22), you can use \,form in the the substitutions.
>
> For example, select a region and:
>
> M-x replace-regexp RET \(.*\) RET 
>     \,(progn(defvar n 0)(format "%3d " (incf n)))\1 RET
>

Or

M-x replace-regexp RET ^ RET \,\#  

[there are two spaces after the '\#'. I don't know why it needs 2 rather
than one, though]

-- 
Jim Ottaway





reply via email to

[Prev in Thread] Current Thread [Next in Thread]