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

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

Re: Visitor here is a gedit user; how to interest him in Emacs?


From: David Kastrup
Subject: Re: Visitor here is a gedit user; how to interest him in Emacs?
Date: Wed, 08 Dec 2010 15:23:17 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

dkcombs@panix.com (David Combs) writes:

> In article <i3dqfp$tmq$1@news.onet.pl>,
> Marc Mientki  <mientki@nonet.com> wrote:
>>Am 05.08.2010 08:12, schrieb David Combs:
>>
>>> every time I try to show him some Emacs concep, he says
>>> that he can do that in gedit also.
>>
>>Then let it do the following. C code is given with matrix declaration as:
>>   int matrix[3][3];
>>
>>but someone has used the 1-based indexing instead of C 0-based:
>>
>>   matrix[1][1] = 2;
>>   matrix[1][2] = 6;
>>   matrix[1][3] = 1;
>>   matrix[2][1] = 9;
>>   matrix[2][2] = 5;
>>   matrix[2][2] = 12;
>>   matrix[3][1] = 11;
>>   matrix[3][2] = 0;
> ...
> ...
>
> OK -- now, to show him the POWER of emacs, PLEASE, PLEASE
> show the solution to the problem, ie via keyboard macros,
> functions, commands, etc.

Hm?  That's not particularly hard.

C-M-% \<matrix\[\([0-9]+\)]\[\([0-9]+\)] RET
matrix[\,(1- \#1)][\,(1- \#2)] RET

> And I bet we'll ALL learn some nice technique from
> your implementation.

I doubt it.  That's more basic than the more complex examples in the
Emacs manual for regexp replacement.

-- 
David Kastrup


reply via email to

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