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

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

Re: Adding String to Beginning of Lines


From: tomas
Subject: Re: Adding String to Beginning of Lines
Date: Tue, 10 Nov 2020 12:10:24 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Nov 10, 2020 at 11:43:45AM +0100, Christopher Dimech wrote:
> 
> I have a paragraph and want to add a string to the beginning of each line 
> after selecting
> the paragraph region.
> 
> GNU is an operating system that is free software—that is, it respects users' 
> freedom. The
> GNU operating system consists of GNU packages (programs specifically released 
> by the GNU 
> Project) as well as free software released by third parties. The development 
> of GNU made
> it possible to use a computer without software that would trample your 
> freedom.
> 
> Example, passing ';; + ' as argument to a function to get
> 
> ;; + GNU is an operating system that is free software—that is, it respects 
> users' freedom. The
> ;; + GNU operating system consists of GNU packages (programs specifically 
> released by the GNU 
> ;; + Project) as well as free software released by third parties. The 
> development of GNU made
> ;; + it possible to use a computer without software that would trample your 
> freedom.

 - Select the region
 - M-x query-replace-regexp "^" → ";; + "
 - Profit!

Wrapping that up in a function is left as an exercise to the
reader :-)

Cheers
-- t

Attachment: signature.asc
Description: Digital signature


reply via email to

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