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

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

Re: How to change a variable amount of characters


From: Teemu Likonen
Subject: Re: How to change a variable amount of characters
Date: Tue, 21 Jul 2009 19:33:45 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

On 2009-07-21 09:21 (-0700), Decebal wrote:

> For example I would like to change all the spaces at the beginnen of a
> line to an underscore.
> The following three lines:
>   - first line
>   - second line
>     - more indentation
>
> would become:
> __- first line
> __- second line
> ____- more indentation
>
> Can this be done?

Here's one example. C-M-% and replace

    ^ +

with

    \,(make-string (length \&) ?_)


reply via email to

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