From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#26338: 26.0.50; Collect all matches for REGEXP in current buffer Date: Wed, 05 Apr 2017 09:11:30 -0400 Message-ID: <874ly3vw1p.fsf@users.sourceforge.net> 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 1491397881 32170 195.159.176.226 (5 Apr 2017 13:11:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 5 Apr 2017 13:11:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 26338@debbugs.gnu.org, Marcin Borkowski , Juri Linkov To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 05 15:11:14 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 1cvkiG-0006s1-Ug for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Apr 2017 15:11:05 +0200 Original-Received: from localhost ([::1]:40506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvkiM-0001JM-Ui for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Apr 2017 09:11:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvkiH-0001JF-Cc for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 09:11:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvkiE-00032d-7g for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 09:11:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35109) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cvkiE-00032X-3Q for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 09:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cvkiD-0004qq-Rk for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 09:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Apr 2017 13:11:01 +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.149139781418592 (code B ref 26338); Wed, 05 Apr 2017 13:11:01 +0000 Original-Received: (at 26338) by debbugs.gnu.org; 5 Apr 2017 13:10:14 +0000 Original-Received: from localhost ([127.0.0.1]:33308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvkhS-0004po-0O for submit@debbugs.gnu.org; Wed, 05 Apr 2017 09:10:14 -0400 Original-Received: from mail-it0-f47.google.com ([209.85.214.47]:32921) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvkhQ-0004pe-PP for 26338@debbugs.gnu.org; Wed, 05 Apr 2017 09:10:13 -0400 Original-Received: by mail-it0-f47.google.com with SMTP id 68so20136675itx.0 for <26338@debbugs.gnu.org>; Wed, 05 Apr 2017 06:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=aBPNhBmr8gbs85FygsG2Jvh0rimstN9oHL9nHyt5qXo=; b=memcPRoDskoGgMdexlyn+xxAuJAQbEKRTm4kzzmDFwuwx1z7xlWGN2w3+brn0Ylr2j ydrXow6k+o6hBNv2zNZZGI23Ut6GZ62JBP/TFRIQme/TJm+glxcvTYPfxgIj+HRfivEA G4VdgqRix1F90mBqcVYmNbqzUCXL2gDXDNgMH7Au+ccOCmmCJ8cfgp8qXZiA3xcD3Xa9 WbYP9I+t9MEOAcTrgtpPD0essQpbkalj+1DuwAvUsABsZ8JaN7PLKIO+AbF/FBlbgaKW RIIkiqCf+YmBSh/uh8wpjnsiMRS3Npls9sgYfS9cshGYhcd+VHiL8fk4xyGBSr0rfK5K Zmow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=aBPNhBmr8gbs85FygsG2Jvh0rimstN9oHL9nHyt5qXo=; b=ieE909h1d4/RQrJp8PpmBerPZKpN+5tTOo0IMLKlJh7Grc56/aOTIevsGxH+HbYqES IbHTORU5mG/t9B0GkfQXMvLbd8Gzvm8iTA2CvGFNAbxop4T7knedlcVKM1mzhBzPMowr Bc6rlvRKfVoLDaNkctSdHcpLjMAGhQTE0Nviqn+NYe6KhSSsV/iDnZn0uLSwEPRy1xZx BiErsentSHySqPelmC0iRSCN8FhFWFa6q01bI2y6hyUrnuhipWbI+tKvvM2AleS9oqP6 i44ZyCJv6LZxJTTeBOQuY/MhIRd2c+A6EOo4xQ7MpzRfJKSDJscX8RTFylZg6UopzV6Y 3TPA== X-Gm-Message-State: AFeK/H2s/YsCN9gSi91Qch/uzigJtbf9ngcMxanPjxlaE2nuFflYjRbs AfI8k8J6pBHdkQ== X-Received: by 10.36.51.212 with SMTP id k203mr20797468itk.6.1491397806961; Wed, 05 Apr 2017 06:10:06 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id c91sm10580865iod.18.2017.04.05.06.10.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Apr 2017 06:10:06 -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:131286 Archived-At: Tino Calancha writes: > > 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. Perhaps a macro that loops over matches? (defmacro domatches (spec &rest body) "Loop over matches to REGEXP. \(fn (MATCH-VAR [GROUP] REGEXP [BOUND]) BODY...)") Or an addition to cl-loop that would allow doing something like (cl-loop for m being the matches of "foo\\|bar" do ...) Then you could easily 'collect m' to get the list of matches if you want that. > I will repeat it once more. I find nice, having an operator returning > a list with matches for REGEXP. I don't think that's come up for me very much, if at all. It seems easier to just operate on the matches directly rather than collecting and then mapping. > If such operator, in addition, > accepts a body of code or a function, then i find this operator very > nice > and elegant. Forcing collection on the looping operator seems inelegant to me.