[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to automatically increment an index array
From: |
Klaus Zeitler |
Subject: |
Re: How to automatically increment an index array |
Date: |
Fri, 27 Jun 2008 09:23:17 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (usg-unix-v) |
>>>>> "Francis" == Francis Moreau <francis.moro@gmail.com> writes:
Francis>
Francis> I have this problem: in a buffer, *scratch* for example I have:
Francis>
Francis> [8735b450] = xxx,
Francis> [0x15] = xxx,
Francis> [0x16] = xxx,
Francis>
Francis> After running a 'magic' command I'd like to calculate the new
Francis> array indexes as follow:
Francis>
Francis> [8735b450] = xxx,
Francis> [8735b454] = xxx,
Francis> [8735b458] = xxx,
Francis> ...
I would recommend a keyboard macro. You start by inserting a number into
a register (with number-to-register). Then go to your first line, delete
the chars between '[' and ']', insert register, increment register, move to
next line and so on.
Just look in info for "Keeping Numbers in Registers" (A nice feature IMHO :-).
HTH
Klaus
--
-------------------------------------
| Klaus Zeitler Alcatel-Lucent |
-------------------------------------
---
The secret to creativity is knowing how to
hide your sources. -- Albert Einstein