From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: collect-string (was: simple useful functions) Date: Thu, 04 Nov 2010 09:58:20 -0400 Message-ID: References: <87fwvkjwh8.fsf@uwakimon.sk.tsukuba.ac.jp> <20101102.173845.392894510.Takaaki.Ota@am.sony.com> <87zktrasec.fsf@uwakimon.sk.tsukuba.ac.jp> <20101103.110157.309054292.Takaaki.Ota@am.sony.com> <87pqulj0tn.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1288880729 14045 80.91.229.12 (4 Nov 2010 14:25:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 4 Nov 2010 14:25:29 +0000 (UTC) Cc: Tak Ota , emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 04 15:25:25 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PE0km-0003ki-VG for ged-emacs-devel@m.gmane.org; Thu, 04 Nov 2010 15:25:25 +0100 Original-Received: from localhost ([127.0.0.1]:46936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PE0km-0000kf-66 for ged-emacs-devel@m.gmane.org; Thu, 04 Nov 2010 10:25:24 -0400 Original-Received: from [140.186.70.92] (port=51948 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PE0X4-0003SD-H2 for emacs-devel@gnu.org; Thu, 04 Nov 2010 10:11:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PE0Kb-0002G6-Ig for emacs-devel@gnu.org; Thu, 04 Nov 2010 09:58:22 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:60760 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PE0Kb-0002G2-Es for emacs-devel@gnu.org; Thu, 04 Nov 2010 09:58:21 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AogKAAJZ0kzO+LrP/2dsb2JhbACgcIEFcr0nhUYEki0 X-IronPort-AV: E=Sophos;i="4.58,296,1286164800"; d="scan'208";a="81578059" Original-Received: from 206-248-186-207.dsl.teksavvy.com (HELO pastel.home) ([206.248.186.207]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 04 Nov 2010 09:58:20 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id A25D2A8626; Thu, 4 Nov 2010 09:58:20 -0400 (EDT) In-Reply-To: <87pqulj0tn.fsf@uwakimon.sk.tsukuba.ac.jp> (Stephen J. Turnbull's message of "Thu, 04 Nov 2010 11:10:28 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:132357 Archived-At: >> How about rename the command as collect-occur instead of >> collect-string and document it as next? > Wrong namespace. IMO, the name should *start* with occur (but Stefan > and Yidong are final authorities on that). Agreed, namespace cleanliness is one of my favorite forms of anal retentiveness. The way I see it, the suggested collect-string is a variant of occur where the result buffer contains none of the regexp matches's context. So it would make sense to integrate it very tightly with `occur', i.e. make M-x occur do the job of collect-strings for some particular value of its argument NLINES. Currently, NLINES is assumed to be a number and all values of that number have a useful meaning, so we'd have to add this new feature via a non-number value of NLINES. E.g. C-u M-x occur could do the collect-string thingy (which is still an incompatible change since some people may like to use C-u M-x occur to get 4 lines of context, but you can make omelets without breaking eggs). Stefan