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

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

Re: replace-regexp


From: Emanuel Berg
Subject: Re: replace-regexp
Date: Sat, 08 May 2021 23:59:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier via Users list for the GNU Emacs text editor wrote:

>> (defun md-latex (beg end)
>>   (interactive "r")
>>   (save-excursion
>>     (goto-char beg)
>>     (while (re-search-forward "_\\(.*\\)_" end t)
>>       (setq end (copy-marker end t))
>>       (replace-match "\\\\textit{\\1}") )))
>
> Almost: move the (setq end (copy-marker end t)) outside
> the loop.

What does it do to end that makes it work?

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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