From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#26338: 26.0.50; Collect all matches for REGEXP in current buffer Date: Thu, 06 Apr 2017 01:03:04 +0300 Organization: LINKOV.NET Message-ID: <871st6342v.fsf@localhost> References: <8737dr6kxx.fsf@calancha-pc> <87h926cvgl.fsf@localhost> <87k272ow7g.fsf@calancha-pc> <87fuhpcbem.fsf@localhost> <87lgrheyvn.fsf@calancha-pc> <87pogsmefn.fsf@jane> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1491429976 16137 195.159.176.226 (5 Apr 2017 22:06:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 5 Apr 2017 22:06:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (x86_64-pc-linux-gnu) Cc: 26338@debbugs.gnu.org, Marcin Borkowski To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 06 00:06:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1cvt44-0003T8-6L for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Apr 2017 00:06:08 +0200 Original-Received: from localhost ([::1]:42597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvt4A-0001hs-1V for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Apr 2017 18:06:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvt41-0001gR-TH for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 18:06:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvt3y-0003dV-NA for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 18:06:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35952) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cvt3y-0003dR-KI for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 18:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cvt3y-0003ve-BB for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 18:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Apr 2017 22:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26338 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26338-submit@debbugs.gnu.org id=B26338.149142993715065 (code B ref 26338); Wed, 05 Apr 2017 22:06:02 +0000 Original-Received: (at 26338) by debbugs.gnu.org; 5 Apr 2017 22:05:37 +0000 Original-Received: from localhost ([127.0.0.1]:34151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvt3Z-0003uv-2Z for submit@debbugs.gnu.org; Wed, 05 Apr 2017 18:05:37 -0400 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:33199 helo=homiemail-a23.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvt3X-0003un-F4 for 26338@debbugs.gnu.org; Wed, 05 Apr 2017 18:05:36 -0400 Original-Received: from homiemail-a23.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTP id 92A534B006D; Wed, 5 Apr 2017 15:05:33 -0700 (PDT) Original-Received: from localhost.linkov.net (m91-131-168-2.cust.tele2.ee [91.131.168.2]) (Authenticated sender: jurta@jurta.org) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTPA id 87E334B0063; Wed, 5 Apr 2017 15:05:32 -0700 (PDT) In-Reply-To: (Tino Calancha's message of "Wed, 5 Apr 2017 20:58:51 +0900 (JST)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131298 Archived-At: >> Sorry if this was said already, but why a macro and not a map-like >> function? > No special reason. It's the second idea which came to my mind after > my initial proposal was declined. Maybe because is shorter to do: > (with-collect-matches regexp) > than > (foo-collect-matches regexp nil #'identity) > > if you are just interested in the list of matches. Implementing it as > a map function might be also nice. Don't see a big enthusiasm on > the proposal, though :-( > > So far people think that it's easy to write a while loop. I wonder if they > think the same about the existence of `dolist': the should > never use it and always write a `while' loop instead. Don't think they > do that anyway. > > I will repeat it once more. I find nice, having an operator returning > a list with matches for REGEXP. If such operator, in addition, accepts > a body of code or a function, then i find this operator very nice > and elegant. A mapcar-like function presumes a lambda where you can process every match as you need, but going this way you'd have a temptation to implement an analogous API from other programming languages like e.g. https://apidock.com/ruby/String/scan