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

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

Re: elisp how to insert text at end of each line


From: Teemu Likonen
Subject: Re: elisp how to insert text at end of each line
Date: Wed, 10 Apr 2013 20:39:43 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

acomber [2013-04-10 10:28:29 -07:00] wrote:

> I tried:
>
>   (while (search-forward "\n")
>      (insert "My text to insert")
>   )

Try this instead:

    (while (re-search-forward "$" nil t)
      (insert "foo")
      (goto-char (1+ (point))))

Attachment: pgpBcY6ZiQWEL.pgp
Description: PGP signature


reply via email to

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