[Top][All Lists]

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

Re: Saving match data

From: Eli Zaretskii
Subject: Re: Saving match data
Date: Sat, 08 Oct 2016 09:25:41 +0300

> From: Michael Heerdegen <address@hidden>
> Cc: address@hidden,  address@hidden
> Date: Sat, 08 Oct 2016 06:02:44 +0200
> Well, what currently looks like (using some fantasy function names)
> #+begin_src emacs-lisp
> (progn
>   (search-forward "test")
>   (save-match-data
>     (do-this)
>     (maybe-change-match-data-here)
>     (do-that))
>   (use-the-match-data))
> #+end_src
> could become something like
> #+begin_src emacs-lisp
> (with-match-data data
>      (search-forward "test")
>    (do-this)
>    (maybe-change-match-data-here)
>    (do-that)
>    (use-match-data data
>       (use-the-match-data)))
> #+end_src

This just replaces one macro with 2 different ones, and doesn't make
the code more elegant or readable, or bring any new benefits, does it?
Or am I missing something?

> Honestly, I don't really want to propose to change things, if either in
> this direction, or at all... as long as we don't invest too much time to
> consolidate what we have now (like ensuring tons of function to not
> change match data).

I don't see why we would need to do anything with tons of functions.
The stuff works, doesn't it?

reply via email to

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