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

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

Re: arithemtic in buffers


From: David Kastrup
Subject: Re: arithemtic in buffers
Date: Thu, 10 Aug 2006 17:28:31 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"Drew Adams" <address@hidden> writes:

>     I need to increase the value of the last digit on each line by one. Is
>     there an automagic way to do this via emacs? Do I use regular
>     expressions, M-x calculator, both, or something else to do it? Any
>     help would be much appreciated
>     
> http://www.emacswiki.org/cgi-bin/wiki/ReplaceCount
>
> http://www.emacswiki.org/cgi-bin/wiki/IncrementNumber
>
> http://www.emacswiki.org/cgi-bin/wiki/NumbersInRegisters
>
> http://www.emacswiki.org/cgi-bin/wiki/EmacsKeyboardMacroCounter
>
> http://www.emacswiki.org/cgi-bin/wiki/KeyboardMacrosTricks
>
> How did I find those pages? Searched for "increment". HTH

Personally, I have a preference for using \, in a regexp replacement,
like

C-M-% [0-9]$ RET \,(1+ \#&) RET

Of course, this is glossing over the fact that there is no good way to
increase a 9.

And it requires a developer version of Emacs.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


reply via email to

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