[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: putting double quotes efficiently
From: |
C K Kashyap |
Subject: |
Re: putting double quotes efficiently |
Date: |
Mon, 3 Jun 2013 17:22:54 +0530 |
Thanks Andreas,
This is exactly what I was looking for -
(defun kash-util-quotes (beg end st en)
(interactive "r*\nsStart Pattern: \nsEnd Pattern: \n")
(save-excursion
(save-restriction
(string-rectangle beg end st)
; (narrow-to-region beg end)
(goto-char beg)
(replace-regexp "$" en)
)))
Thanks,
Kashyap
On Mon, Jun 3, 2013 at 2:40 PM, Andreas Röhler <
andreas.roehler@easy-emacs.de> wrote:
> Am 03.06.2013 10:03, schrieb C K Kashyap:
>
> Thanks Andreas,
>> This works.
>> Although I'd still like to know how to write custom function that work
>> over
>> a marked region.
>>
>
> For example that way:
>
> (defun my-New-Command (beg end)
> (interactive "r*")
> (save-excursion
> (save-restriction
> (narrow-to-region beg end)
> (goto-char beg)
> (DO-What-I-Want...
>
> Recommend a walk through Info section Elisp, you will find plenty of
> useful stuff.
>
> Cheers,
>
> Andreas
>
- putting double quotes efficiently, C K Kashyap, 2013/06/03
- Re: putting double quotes efficiently, Andreas Röhler, 2013/06/03
- Re: putting double quotes efficiently, Andreas Röhler, 2013/06/03
- Message not available
- narrowing considered harmful (was: putting double quotes efficiently), Stefan Monnier, 2013/06/13
- Re: narrowing considered harmful, Leo Liu, 2013/06/13
- Re: narrowing considered harmful, Stefan Monnier, 2013/06/14
- Re: narrowing considered harmful, Leo Liu, 2013/06/14
- Re: narrowing considered harmful, Stefan Monnier, 2013/06/14
- Re: narrowing considered harmful, Leo Liu, 2013/06/16
- Re: narrowing considered harmful, Stefan Monnier, 2013/06/17
- RE: narrowing considered harmful, Drew Adams, 2013/06/17
- Re: narrowing considered harmful, Stefan Monnier, 2013/06/17