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

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

Re: Operate on region string


From: David Combs
Subject: Re: Operate on region string
Date: Sat, 14 Oct 2006 22:23:30 +0000 (UTC)

In article <87lkogz0kj.fsf@thalassa.informatimago.com>,
Pascal Bourguignon  <pjb@informatimago.com> wrote:
>Hadron Quark <hadronquark@gmail.com> writes:
>>> But if you want the best performances, emacs is optimized to work in
>>> the buffers, not on strings.  So if you can do it, better to directly
>>> modify the buffer:
>>>
>>> (defun my-command (start end)
>>>   (interactive "r")
>>>   (do-work-on-region start end))
>>
>> this is what I wanted to know : what is the best way to "do-work-on-region"?
>
>You need to learn the emacs lisp functions, notably those who work on
>the buffers and on the strings.
>
>Most of the functions that work on the buffers are actually commands
>that are also bound to some keys and that you use.
>
>For example, if you want to remove every other character in the region, 
>you can do it manually with C-f C-d C-f C-d ...
>
>You can know what functions are called when you type C-f or C-d:
>
>    C-h k C-f
>    C-h k C-d
>
Easy way to do that:  define the seq as a macro,
  then do "insert-macro" (or whatever it's called) --
  that code shows the function-NAMES too.


David




reply via email to

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