From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#26338: 26.0.50; Collect all matches for REGEXP in current buffer Date: Sat, 8 Apr 2017 22:42:41 +0900 (JST) Message-ID: References: <8737dr6kxx.fsf@calancha-pc> <87h926cvgl.fsf@localhost> <87k272ow7g.fsf@calancha-pc> <87fuhpcbem.fsf@localhost> <87lgrheyvn.fsf@calancha-pc> <87pogsmefn.fsf@jane> <874ly3vw1p.fsf@users.sourceforge.net> <943bd0fd-c4ad-48f4-a803-f832b5bf0edf@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-967213713-1491658964=:16237" X-Trace: blaine.gmane.org 1491659008 29866 195.159.176.226 (8 Apr 2017 13:43:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 8 Apr 2017 13:43:28 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: Marcin Borkowski , Tino Calancha , 26338@debbugs.gnu.org, npostavs@users.sourceforge.net, Juri Linkov To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 08 15:43:21 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 1cwqe1-00068b-Et for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Apr 2017 15:43:13 +0200 Original-Received: from localhost ([::1]:54889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwqe7-0002Wo-3L for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Apr 2017 09:43:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwqdw-0002Va-BM for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 09:43:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cwqdq-0002Qi-Rp for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 09:43:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39071) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cwqdq-0002QZ-Nc for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 09:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cwqdq-00078m-Fk for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 09:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Apr 2017 13:43: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.149165897427432 (code B ref 26338); Sat, 08 Apr 2017 13:43:01 +0000 Original-Received: (at 26338) by debbugs.gnu.org; 8 Apr 2017 13:42:54 +0000 Original-Received: from localhost ([127.0.0.1]:37270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwqdh-00078N-Po for submit@debbugs.gnu.org; Sat, 08 Apr 2017 09:42:53 -0400 Original-Received: from mail-pf0-f174.google.com ([209.85.192.174]:33791) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwqdf-000783-DF for 26338@debbugs.gnu.org; Sat, 08 Apr 2017 09:42:52 -0400 Original-Received: by mail-pf0-f174.google.com with SMTP id s16so15558316pfs.0 for <26338@debbugs.gnu.org>; Sat, 08 Apr 2017 06:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=C+0oPa1fEOZ/WSGH4ibcPujtSUJV2wex2PKyCKB0aVw=; b=dXWM2UCe8vFBCb6Puo7v9lRwEMsGIGJzt39g2NBbAzS/NHfObskwWisExSb8xRt1+v ORieB5wv0/73t17Kmf7A4WDED3+m5571xgkdIQj6bKcR8FP0x8ezz7pMu9S6YRwanfC/ tQRRPh25HCpJHvq0+VUuobUAK/itBf6Uxxxt5sKY8OqpQ4sKZRpDCwkVCx2uLa30sD+B nBRRyYNNPqdIxYuldT2TXBW+UvX/lh185JLmQ5rFxdgSdji0RH+la/Xn4tQUzINyMq/Q Id0AKYdulmXy9iT/ne2SYPvbhIokSL4sUsFcZHaJLOG50foYK3JRxCg3E8CREP0jRxFm vS4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=C+0oPa1fEOZ/WSGH4ibcPujtSUJV2wex2PKyCKB0aVw=; b=GiNBLRZe6k5g8BeBhzk1U4BOhee5uRFiMkbf/TrGVo95IVNG4eCvLQNHpOJij9bEZv NEqgEA0yuiNK8xEh0NksMi7x1NRTs1XRmLfpcpxv86GLCGQFVbNUcDWZBDxqfqXmywAV xvNRWR86fz2/Oxnwo+eTcialJlX9+YOx6/9tY+QBrl2Dc/B0dYPe3br/1vfv5W3asbEM LHuPvC4FexWuOXg3WUHXYNFzjTGufBnilyrBoZYYflzxrXoMBhrMXT4z+67hsrzPNCJE SbvdbRFR1oDM/NpxMfrKW3s4EuH0Cz8fLZNlYM+fbWGxHoRsE5EKTGKhlLIWU50WB9fc sz4g== X-Gm-Message-State: AFeK/H3v0YV1WEQDGEi2ObWQekYXk40qa1E1Rb0LuoG7dxIW6+hH9/OoBrZW+8dB6s2OrA== X-Received: by 10.99.209.85 with SMTP id c21mr46944936pgj.147.1491658965665; Sat, 08 Apr 2017 06:42:45 -0700 (PDT) Original-Received: from calancha-pc (222.139.137.133.dy.bbexcite.jp. [133.137.139.222]) by smtp.gmail.com with ESMTPSA id 78sm15255608pfm.134.2017.04.08.06.42.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Apr 2017 06:42:45 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: 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:131360 Archived-At: --8323329-967213713-1491658964=:16237 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Sat, 8 Apr 2017, Philipp Stephani wrote: > > > Tino Calancha schrieb am Sa., 8. Apr. 2017 um 06:46 Uhr: > > > On Fri, 7 Apr 2017, Drew Adams wrote: > > >>> 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. > >> > >> Your proposals looks nice to me ;-) > > > > (Caveat: I have not been following this thread.) > > > > I think that `cl-loop' should be as close to Common Lisp `loop' > > as we can reasonably make it.  We should _not_ be adding other > > features to it or changing its behavior away from what it is > > supposedly emulating. > > > > If you want, create a _different_ macro that is Emacs-specific, > > with whatever behavior you want.  Call it whatever you want > > that will not be confused with Common Lisp emulation. > > > > Please keep `cl-' for Common Lisp emulation.  We've already > > seen more than enough tampering with this - people adding > > their favorite thing to the `cl-' namespace.  Not good. > Drew, i respect your opinion; but so far the change > would just extend `cl-loop' which as you noticed has being already > extended before. > For instance, we have: > cl-loop for x being the overlays/buffers ... > > Don't see a problem to have those things.  > > > I do. They couple the idea of an iterable with a looping construct, and such coupling is bad for various reasons: > - Coupling of unrelated entities is always an antipattern. > - For N iterables and M looping constructs, you need to implement N*M integrations. > Instead this should use an iterable, e.g. a generator function (iter-defun). cl-loop supports these out of the box. Then, you don't like (as Drew, but for different reasons) that we have: cl-loop for x being the buffers ... but it seems you are fine having iter-by clause in cl-loop, which seems an Emacs extension (correctme if i am wrong). So in principle, you are happy with adding useful extensions to CL, not just keep it an emulation as Drew wants. Your point is about performance. I am driven by easy to write code. Maybe you can provide an example about how to write those things using the iter-by cl-loop clause. --8323329-967213713-1491658964=:16237--