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: Re: collect-string Date: Fri, 03 Dec 2010 17:56:51 -0500 Message-ID: References: <20101202.170351.142719949.Takaaki.Ota@am.sony.com> <20101203.143147.319196666.Takaaki.Ota@am.sony.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1291417040 32241 80.91.229.12 (3 Dec 2010 22:57:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 3 Dec 2010 22:57:20 +0000 (UTC) Cc: stephen@xemacs.org, emacs-devel@gnu.org To: Tak Ota Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 03 23:57:11 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 1POeYv-0000kY-NQ for ged-emacs-devel@m.gmane.org; Fri, 03 Dec 2010 23:57:09 +0100 Original-Received: from localhost ([127.0.0.1]:58479 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POeYv-0003Lh-D0 for ged-emacs-devel@m.gmane.org; Fri, 03 Dec 2010 17:57:09 -0500 Original-Received: from [140.186.70.92] (port=36007 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POeYq-0003LS-MP for emacs-devel@gnu.org; Fri, 03 Dec 2010 17:57:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1POeYp-0004ym-LJ for emacs-devel@gnu.org; Fri, 03 Dec 2010 17:57:04 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:39531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1POeYp-0004yY-DP for emacs-devel@gnu.org; Fri, 03 Dec 2010 17:57:03 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id oB3MuxU7029572; Fri, 3 Dec 2010 17:56:59 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 81F58A8364; Fri, 3 Dec 2010 17:56:51 -0500 (EST) In-Reply-To: <20101203.143147.319196666.Takaaki.Ota@am.sony.com> (Tak Ota's message of "Fri, 3 Dec 2010 14:31:47 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3698=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:133375 Archived-At: >> > ! '(0) >> > ! ;; construct a list of subexpression integers >> > ! (mapcar 'string-to-number >> > ! (split-string >> > ! (let ((default (car occur-collect-submatch-history))) >> > ! (read-from-minibuffer >> > ! (format "Subexpressions to collect (default %s): " default) >> > ! "" nil nil 'occur-collect-submatch-history default) >> > ! (car occur-collect-submatch-history))))) >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> >> This should be `default', right? > No, this is the new input value as read-from-minibuffer prepends this > value to the history. Oh, right, there's more parens than I thought. You should use `read-string' instead, which will take care of this ugliness. >> Hmm... I didn't think of NLINES turning into a list of submatch-numbers, >> but that makes me think that maybe we should go one step further and >> turn it into a string, like the ones used in replace-match. > This is truly brilliant. Thank you very much. I love this idea > bouncing process. See below. It's not always as successful, sadly. But yes, it turned out very well this time. Stefan