From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Saving match data Date: Sat, 08 Oct 2016 09:25:41 +0300 Message-ID: <83a8eficgq.fsf@gnu.org> References: <87twd0j7fi.fsf@web.de> <83zimrokuj.fsf@gnu.org> <87y42b3hni.fsf@web.de> <83ponnojv6.fsf@gnu.org> <87twcz3geb.fsf@web.de> <83mviro2jr.fsf@gnu.org> <87y41zv66z.fsf@web.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1475907995 11331 195.159.176.226 (8 Oct 2016 06:26:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 8 Oct 2016 06:26:35 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 08 08:26:31 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsl5L-0000Vc-5t for ged-emacs-devel@m.gmane.org; Sat, 08 Oct 2016 08:26:15 +0200 Original-Received: from localhost ([::1]:39480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsl5J-0001sa-8e for ged-emacs-devel@m.gmane.org; Sat, 08 Oct 2016 02:26:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsl4n-0001sR-P3 for emacs-devel@gnu.org; Sat, 08 Oct 2016 02:25:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsl4j-0003uV-Bq for emacs-devel@gnu.org; Sat, 08 Oct 2016 02:25:40 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsl4j-0003tR-9a; Sat, 08 Oct 2016 02:25:37 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2364 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bsl4g-00088S-4t; Sat, 08 Oct 2016 02:25:35 -0400 In-reply-to: <87y41zv66z.fsf@web.de> (message from Michael Heerdegen on Sat, 08 Oct 2016 06:02:44 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:208075 Archived-At: > From: Michael Heerdegen > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > 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?