[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
- replace-regexp, Emanuel Berg, 2021/05/06
- Re: replace-regexp, Tassilo Horn, 2021/05/07
- Re: replace-regexp, Emanuel Berg, 2021/05/07
- Re: replace-regexp, Emanuel Berg, 2021/05/07
- Re: replace-regexp, Emanuel Berg, 2021/05/07
- Re: replace-regexp, Yuri Khan, 2021/05/08
- Re: replace-regexp, Stefan Monnier, 2021/05/08
- Re: replace-regexp, Emanuel Berg, 2021/05/08
- Re: replace-regexp, Stefan Monnier, 2021/05/08
- Re: replace-regexp,
Emanuel Berg <=
- Re: replace-regexp, Tassilo Horn, 2021/05/08
- Re: replace-regexp, Emanuel Berg, 2021/05/08
- RE: [External] : Re: replace-regexp, Drew Adams, 2021/05/08
- Re: replace-regexp, Emanuel Berg, 2021/05/08
- Re: replace-regexp, Emanuel Berg, 2021/05/08
- Re: replace-regexp, Stefan Monnier, 2021/05/08
- Re: replace-regexp, Emanuel Berg, 2021/05/08
- Re: replace-regexp, Stefan Monnier, 2021/05/08
- Re: replace-regexp, Emanuel Berg, 2021/05/08
- Re: replace-regexp, Stefan Monnier, 2021/05/08