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: Christopher Dimech
Subject: Re: Adding String to Beginning of Lines
Date: Tue, 10 Nov 2020 15:38:39 +0100

Correct,  the replacement.  Because in .el files, the replacement will be
";; + ", in other languages, it is dependent on the symbol for comments
(e.g. "!! +" for fortran code .f)


> Sent: Tuesday, November 10, 2020 at 3:16 PM
> From: "Michael Heerdegen" <michael_heerdegen@web.de>
> To: help-gnu-emacs@gnu.org
> Subject: Re: Adding String to Beginning of Lines
>
> Christopher Dimech <dimech@gmx.com> writes:
>
> > I now have got 'rec-cont', which lets me pass a string.
> > How can I add a dafault  if I don't pass a regex in the
> > mini-buffer.
> >
> > (defun rec-cont (beg end regex)
> >   (interactive "r\ns rec-cont regex: ")
> >   (replace-regexp "^" regex nil beg end))
> >   ;; (replace-regexp "^" ";; + " nil beg end))
>
> Eh - Are you speaking about a default for the replacement, the
> TO-STRING, you want to insert?  Because your regexp is always "^" as far
> as I understand.
>
> Michael.
>
>
>



reply via email to

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