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: Michael Heerdegen
Subject: Re: Adding String to Beginning of Lines
Date: Tue, 10 Nov 2020 15:16:03 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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]