From unknown Sat Jun 21 03:31:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10705: 24.0.93; Collect strings matching regexp from Isearch Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Feb 2012 21:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10705 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 10705@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13282186826784 (code B ref -1); Thu, 02 Feb 2012 21:38:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Feb 2012 21:38:02 +0000 Received: from localhost ([127.0.0.1]:51366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rt4Lx-0001lJ-Lo for submit@debbugs.gnu.org; Thu, 02 Feb 2012 16:38:01 -0500 Received: from eggs.gnu.org ([140.186.70.92]:50136) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rt4Lv-0001l3-28 for submit@debbugs.gnu.org; Thu, 02 Feb 2012 16:37:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rt4LI-0005Qx-J1 for submit@debbugs.gnu.org; Thu, 02 Feb 2012 16:37:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:42175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt4LI-0005Qt-Bc for submit@debbugs.gnu.org; Thu, 02 Feb 2012 16:37:20 -0500 Received: from eggs.gnu.org ([140.186.70.92]:33295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt4LF-00031A-9s for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2012 16:37:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rt4LB-0005Os-LL for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2012 16:37:16 -0500 Received: from ps18281.dreamhost.com ([69.163.218.105]:45879 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt4LB-0005Od-Dh for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2012 16:37:13 -0500 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 584B4451C4E6 for ; Thu, 2 Feb 2012 13:35:57 -0800 (PST) From: Juri Linkov Organization: JURTA Date: Thu, 02 Feb 2012 23:02:03 +0200 Message-ID: <874nvac6us.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Currently `isearch-occur' is not in sync with the interactive specification of `occur' that provides a new feature of `C-u M-x occur RET' that collects the matching strings into the `*Occur*' buffer without line numbers. The following patch syncs code from `occur-read-primary-args' to `isearch-occur'. It doesn't quit Isearch when there are no subexpression in the regexp (it collects the entire match with "\\&"). But in case of subexpression in the regexp, it quits Isearch because it needs to ask for a substituted replacement string using `read-string'. === modified file 'lisp/isearch.el' --- lisp/isearch.el 2012-01-25 17:54:01 +0000 +++ lisp/isearch.el 2012-02-02 21:01:12 +0000 @@ -1467,12 +1467,27 @@ (defun isearch-occur (regexp &optional n Interactively, REGEXP is the current search regexp or a quoted search string. NLINES has the same meaning as in `occur'." (interactive - (list - (cond - (isearch-word (word-search-regexp isearch-string)) - (isearch-regexp isearch-string) - (t (regexp-quote isearch-string))) - (if current-prefix-arg (prefix-numeric-value current-prefix-arg)))) + (let* ((perform-collect (consp current-prefix-arg)) + (regexp (cond + (isearch-word (word-search-regexp isearch-string)) + (isearch-regexp isearch-string) + (t (regexp-quote isearch-string))))) + (list regexp + (if perform-collect + ;; Perform collect operation + (if (zerop (regexp-opt-depth regexp)) + ;; No subexpression so collect the entire match. + "\\&" + ;; Get the regexp for collection pattern. + (isearch-done nil t) + (isearch-clean-overlays) + (let ((default (car occur-collect-regexp-history))) + (read-string + (format "Regexp to collect (default %s): " default) + nil 'occur-collect-regexp-history default))) + ;; Otherwise normal occur takes numerical prefix argument. + (when current-prefix-arg + (prefix-numeric-value current-prefix-arg)))))) (let ((case-fold-search isearch-case-fold-search) ;; Set `search-upper-case' to nil to not call ;; `isearch-no-upper-case-p' in `occur-1'. From unknown Sat Jun 21 03:31:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10705: 24.0.93; Collect strings matching regexp from Isearch Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Feb 2012 07:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10705 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 10705@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 10705-submit@debbugs.gnu.org id=B10705.132825489126729 (code B ref 10705); Fri, 03 Feb 2012 07:42:02 +0000 Received: (at 10705) by debbugs.gnu.org; 3 Feb 2012 07:41:31 +0000 Received: from localhost ([127.0.0.1]:51574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RtDly-0006x4-QV for submit@debbugs.gnu.org; Fri, 03 Feb 2012 02:41:31 -0500 Received: from mtaout21.012.net.il ([80.179.55.169]:43736) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RtDlw-0006wo-7d for 10705@debbugs.gnu.org; Fri, 03 Feb 2012 02:41:29 -0500 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0LYT00M003IHZB00@a-mtaout21.012.net.il> for 10705@debbugs.gnu.org; Fri, 03 Feb 2012 09:40:50 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.124.37.111]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LYT00MJ8401WE80@a-mtaout21.012.net.il>; Fri, 03 Feb 2012 09:40:50 +0200 (IST) Date: Fri, 03 Feb 2012 09:38:53 +0200 From: Eli Zaretskii In-reply-to: <874nvac6us.fsf@mail.jurta.org> X-012-Sender: halo1@inter.net.il Message-id: <83haz8fjsi.fsf@gnu.org> References: <874nvac6us.fsf@mail.jurta.org> X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Juri Linkov > Date: Thu, 02 Feb 2012 23:02:03 +0200 > > Currently `isearch-occur' is not in sync with the interactive specification > of `occur' that provides a new feature of `C-u M-x occur RET' that collects > the matching strings into the `*Occur*' buffer without line numbers. > > The following patch syncs code from `occur-read-primary-args' to `isearch-occur'. Btw, while at that, how about fixing the doc string as well. What it says now, viz. > Interactively, REGEXP is the current search regexp or a quoted search > string. NLINES has the same meaning as in `occur'." is not clear enough: what is a "quoted search string"? I'd suggest to describe explicitly the 3 cases handled by the code: > + (regexp (cond > + (isearch-word (word-search-regexp isearch-string)) > + (isearch-regexp isearch-string) > + (t (regexp-quote isearch-string))))) and refer to the relevant string in each case. From unknown Sat Jun 21 03:31:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10705: 24.0.93; Collect strings matching regexp from Isearch Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Feb 2012 01:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10705 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 10705@debbugs.gnu.org Received: via spool by 10705-submit@debbugs.gnu.org id=B10705.13283176027856 (code B ref 10705); Sat, 04 Feb 2012 01:07:02 +0000 Received: (at 10705) by debbugs.gnu.org; 4 Feb 2012 01:06:42 +0000 Received: from localhost ([127.0.0.1]:52939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RtU5S-00022f-3P for submit@debbugs.gnu.org; Fri, 03 Feb 2012 20:06:42 -0500 Received: from ps18281.dreamhost.com ([69.163.218.105]:59071 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RtU5P-00022W-G1 for 10705@debbugs.gnu.org; Fri, 03 Feb 2012 20:06:40 -0500 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 21B5D451C17F; Fri, 3 Feb 2012 17:04:47 -0800 (PST) From: Juri Linkov Organization: JURTA References: <874nvac6us.fsf@mail.jurta.org> <83haz8fjsi.fsf@gnu.org> Date: Sat, 04 Feb 2012 02:14:15 +0200 In-Reply-To: <83haz8fjsi.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 03 Feb 2012 09:38:53 +0200") Message-ID: <87pqdv1mlk.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) >> Interactively, REGEXP is the current search regexp or a quoted search >> string. NLINES has the same meaning as in `occur'." > > is not clear enough: what is a "quoted search string"? I'd suggest to > describe explicitly the 3 cases handled by the code: > >> + (regexp (cond >> + (isearch-word (word-search-regexp isearch-string)) >> + (isearch-regexp isearch-string) >> + (t (regexp-quote isearch-string))))) > > and refer to the relevant string in each case. Is this better? === modified file 'lisp/isearch.el' --- lisp/isearch.el 2012-02-03 23:50:41 +0000 +++ lisp/isearch.el 2012-02-04 00:10:01 +0000 @@ -1464,8 +1464,11 @@ (defun isearch-query-replace-regexp (&op (defun isearch-occur (regexp &optional nlines) "Run `occur' with regexp to search from the current search string. -Interactively, REGEXP is the current search regexp or a quoted search -string. NLINES has the same meaning as in `occur'." +Interactively, in word search REGEXP is computed from words +without regard to punctuation, in regexp search REGEXP is +the current search regexp, in normal search REGEXP is created +from the current search string quoting all special regexp characters. +NLINES has the same meaning as in `occur'." (interactive (let* ((perform-collect (consp current-prefix-arg)) (regexp (cond BTW, shouldn't this new feature (collecting strings with `C-u M-x occur') be announced in NEWS? From unknown Sat Jun 21 03:31:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10705: 24.0.93; Collect strings matching regexp from Isearch Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Feb 2012 07:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10705 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 10705@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 10705-submit@debbugs.gnu.org id=B10705.132834042422763 (code B ref 10705); Sat, 04 Feb 2012 07:28:01 +0000 Received: (at 10705) by debbugs.gnu.org; 4 Feb 2012 07:27:04 +0000 Received: from localhost ([127.0.0.1]:53046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rta1X-0005v5-HW for submit@debbugs.gnu.org; Sat, 04 Feb 2012 02:27:03 -0500 Received: from mtaout21.012.net.il ([80.179.55.169]:46554) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rta1U-0005uA-W2 for 10705@debbugs.gnu.org; Sat, 04 Feb 2012 02:27:02 -0500 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0LYU00500XT8DD00@a-mtaout21.012.net.il> for 10705@debbugs.gnu.org; Sat, 04 Feb 2012 09:26:17 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.126.139.211]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LYU0053YXZRDF10@a-mtaout21.012.net.il>; Sat, 04 Feb 2012 09:26:16 +0200 (IST) Date: Sat, 04 Feb 2012 09:26:16 +0200 From: Eli Zaretskii In-reply-to: <87pqdv1mlk.fsf@mail.jurta.org> X-012-Sender: halo1@inter.net.il Message-id: <83d39vdppj.fsf@gnu.org> References: <874nvac6us.fsf@mail.jurta.org> <83haz8fjsi.fsf@gnu.org> <87pqdv1mlk.fsf@mail.jurta.org> X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Juri Linkov > Cc: 10705@debbugs.gnu.org > Date: Sat, 04 Feb 2012 02:14:15 +0200 > > >> Interactively, REGEXP is the current search regexp or a quoted search > >> string. NLINES has the same meaning as in `occur'." > > > > is not clear enough: what is a "quoted search string"? I'd suggest to > > describe explicitly the 3 cases handled by the code: > > > >> + (regexp (cond > >> + (isearch-word (word-search-regexp isearch-string)) > >> + (isearch-regexp isearch-string) > >> + (t (regexp-quote isearch-string))))) > > > > and refer to the relevant string in each case. > > Is this better? > > === modified file 'lisp/isearch.el' > --- lisp/isearch.el 2012-02-03 23:50:41 +0000 > +++ lisp/isearch.el 2012-02-04 00:10:01 +0000 > @@ -1464,8 +1464,11 @@ (defun isearch-query-replace-regexp (&op > > (defun isearch-occur (regexp &optional nlines) > "Run `occur' with regexp to search from the current search string. > -Interactively, REGEXP is the current search regexp or a quoted search > -string. NLINES has the same meaning as in `occur'." > +Interactively, in word search REGEXP is computed from words > +without regard to punctuation, in regexp search REGEXP is > +the current search regexp, in normal search REGEXP is created > +from the current search string quoting all special regexp characters. > +NLINES has the same meaning as in `occur'." When you say "in word search" etc., you actually mean "when invoked after a word search command", right? If so, I suggest the following wording: Run `occur' using the last search string as the regexp. Interactively, REGEXP is constructed using the search string from the last search command. If the last search command was a word search, REGEXP is computed from the search words disregarding punctuation. If the last search command was a regular expression search, REGEXP is the regular expression used in that search. If the last search command searched for a string, REGEXP is constructed by quoting all the special characters in that string. > BTW, shouldn't this new feature (collecting strings with `C-u M-x occur') > be announced in NEWS? I think it should be. Thanks. From unknown Sat Jun 21 03:31:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10705: 24.0.93; Collect strings matching regexp from Isearch Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Feb 2012 14:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10705 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "'Eli Zaretskii'" , "'Juri Linkov'" Cc: 10705@debbugs.gnu.org Received: via spool by 10705-submit@debbugs.gnu.org id=B10705.132836654832583 (code B ref 10705); Sat, 04 Feb 2012 14:43:02 +0000 Received: (at 10705) by debbugs.gnu.org; 4 Feb 2012 14:42:28 +0000 Received: from localhost ([127.0.0.1]:53290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rtgot-0008TT-S2 for submit@debbugs.gnu.org; Sat, 04 Feb 2012 09:42:28 -0500 Received: from acsinet15.oracle.com ([141.146.126.227]:52590) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rtgor-0008TF-RA for 10705@debbugs.gnu.org; Sat, 04 Feb 2012 09:42:26 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id q14EfdJA019233 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 4 Feb 2012 14:41:40 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q14Efcop004611 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 Feb 2012 14:41:39 GMT Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q14Efbwm016729; Sat, 4 Feb 2012 08:41:37 -0600 Received: from dradamslap1 (/10.159.50.114) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 04 Feb 2012 06:41:37 -0800 From: "Drew Adams" References: <874nvac6us.fsf@mail.jurta.org> <83haz8fjsi.fsf@gnu.org><87pqdv1mlk.fsf@mail.jurta.org> <83d39vdppj.fsf@gnu.org> Date: Sat, 4 Feb 2012 06:41:30 -0800 Message-ID: <7E3C1D559E2B4290AD5BFC18385BCA27@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-reply-to: <83d39vdppj.fsf@gnu.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: AczjDndzpS6+8BnKQL6eiGAdK2i6pQAOaXkw X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090203.4F2D43A4.00A1,ss=1,re=0.000,fgs=0 X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) > When you say "in word search" etc., you actually mean "when invoked > after a word search command", right? If so, I suggest the following > wording: > > Run `occur' using the last search string as the regexp. > Interactively, REGEXP is constructed using the search string from the > last search command. > > If the last search command was a word search, REGEXP is computed from > the search words disregarding punctuation. If the last search > command was a regular expression search, REGEXP is the regular > expression used in that search. If the last search command searched > for a string, REGEXP is constructed by quoting all the special > characters in that string. +1, with the same assumption ("when you say..."). However: * it should be "the search words, disregarding punctuation" (comma - it is not the words themselves that disregard punctuation) * "ignoring" is better than "disregarding" here And just what do we mean by the computation of REGEXP paying no attention to punctuation? Maybe an "(e.g. ...)" is in order. * "searched for a literal string" (or "searched for a regular string") is perhaps better than "searched for a string" FWIW, the doc string for `isearch-forward-regexp' refers to a literal search as "a regular string search". But I'm not sure that "regular string" is a good choice in such contexts, as it can suggest having something to do with regular expressions. From unknown Sat Jun 21 03:31:17 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Juri Linkov Subject: bug#10705: closed (Re: bug#10705: 24.0.93; Collect strings matching regexp from Isearch) Message-ID: References: <87ty2imljn.fsf@mail.jurta.org> <874nvac6us.fsf@mail.jurta.org> X-Gnu-PR-Message: they-closed 10705 X-Gnu-PR-Package: emacs Reply-To: 10705@debbugs.gnu.org Date: Thu, 23 Feb 2012 00:42:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1329957722-30411-1" This is a multi-part message in MIME format... ------------=_1329957722-30411-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #10705: 24.0.93; Collect strings matching regexp from Isearch which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 10705@debbugs.gnu.org. --=20 10705: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D10705 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1329957722-30411-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 10705-done) by debbugs.gnu.org; 23 Feb 2012 00:41:11 +0000 Received: from localhost ([127.0.0.1]:51657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0Mk9-0007tK-2K for submit@debbugs.gnu.org; Wed, 22 Feb 2012 19:41:10 -0500 Received: from ps18281.dreamhost.com ([69.163.218.105]:60326 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0Mk5-0007tC-O6 for 10705-done@debbugs.gnu.org; Wed, 22 Feb 2012 19:41:07 -0500 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id D0314451C330; Wed, 22 Feb 2012 16:37:04 -0800 (PST) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#10705: 24.0.93; Collect strings matching regexp from Isearch Organization: JURTA References: <874nvac6us.fsf@mail.jurta.org> <83haz8fjsi.fsf@gnu.org> <87pqdv1mlk.fsf@mail.jurta.org> <83d39vdppj.fsf@gnu.org> Date: Thu, 23 Feb 2012 02:38:04 +0200 In-Reply-To: <83d39vdppj.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 04 Feb 2012 09:26:16 +0200") Message-ID: <87ty2imljn.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10705-done Cc: 10705-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Installed, with all the comments from Eli and Drew. Also added a NEWS entry for this feature extracted from the docstring of `occur'. ------------=_1329957722-30411-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 2 Feb 2012 21:38:02 +0000 Received: from localhost ([127.0.0.1]:51366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rt4Lx-0001lJ-Lo for submit@debbugs.gnu.org; Thu, 02 Feb 2012 16:38:01 -0500 Received: from eggs.gnu.org ([140.186.70.92]:50136) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rt4Lv-0001l3-28 for submit@debbugs.gnu.org; Thu, 02 Feb 2012 16:37:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rt4LI-0005Qx-J1 for submit@debbugs.gnu.org; Thu, 02 Feb 2012 16:37:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:42175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt4LI-0005Qt-Bc for submit@debbugs.gnu.org; Thu, 02 Feb 2012 16:37:20 -0500 Received: from eggs.gnu.org ([140.186.70.92]:33295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt4LF-00031A-9s for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2012 16:37:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rt4LB-0005Os-LL for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2012 16:37:16 -0500 Received: from ps18281.dreamhost.com ([69.163.218.105]:45879 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt4LB-0005Od-Dh for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2012 16:37:13 -0500 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 584B4451C4E6 for ; Thu, 2 Feb 2012 13:35:57 -0800 (PST) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: 24.0.93; Collect strings matching regexp from Isearch Organization: JURTA Date: Thu, 02 Feb 2012 23:02:03 +0200 Message-ID: <874nvac6us.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Currently `isearch-occur' is not in sync with the interactive specification of `occur' that provides a new feature of `C-u M-x occur RET' that collects the matching strings into the `*Occur*' buffer without line numbers. The following patch syncs code from `occur-read-primary-args' to `isearch-occur'. It doesn't quit Isearch when there are no subexpression in the regexp (it collects the entire match with "\\&"). But in case of subexpression in the regexp, it quits Isearch because it needs to ask for a substituted replacement string using `read-string'. === modified file 'lisp/isearch.el' --- lisp/isearch.el 2012-01-25 17:54:01 +0000 +++ lisp/isearch.el 2012-02-02 21:01:12 +0000 @@ -1467,12 +1467,27 @@ (defun isearch-occur (regexp &optional n Interactively, REGEXP is the current search regexp or a quoted search string. NLINES has the same meaning as in `occur'." (interactive - (list - (cond - (isearch-word (word-search-regexp isearch-string)) - (isearch-regexp isearch-string) - (t (regexp-quote isearch-string))) - (if current-prefix-arg (prefix-numeric-value current-prefix-arg)))) + (let* ((perform-collect (consp current-prefix-arg)) + (regexp (cond + (isearch-word (word-search-regexp isearch-string)) + (isearch-regexp isearch-string) + (t (regexp-quote isearch-string))))) + (list regexp + (if perform-collect + ;; Perform collect operation + (if (zerop (regexp-opt-depth regexp)) + ;; No subexpression so collect the entire match. + "\\&" + ;; Get the regexp for collection pattern. + (isearch-done nil t) + (isearch-clean-overlays) + (let ((default (car occur-collect-regexp-history))) + (read-string + (format "Regexp to collect (default %s): " default) + nil 'occur-collect-regexp-history default))) + ;; Otherwise normal occur takes numerical prefix argument. + (when current-prefix-arg + (prefix-numeric-value current-prefix-arg)))))) (let ((case-fold-search isearch-case-fold-search) ;; Set `search-upper-case' to nil to not call ;; `isearch-no-upper-case-p' in `occur-1'. ------------=_1329957722-30411-1-- From unknown Sat Jun 21 03:31:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10705: 24.0.93; Collect strings matching regexp from Isearch Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Feb 2012 01:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10705 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 10705@debbugs.gnu.org Received: via spool by 10705-submit@debbugs.gnu.org id=B10705.132995880432108 (code B ref 10705); Thu, 23 Feb 2012 01:01:01 +0000 Received: (at 10705) by debbugs.gnu.org; 23 Feb 2012 01:00:04 +0000 Received: from localhost ([127.0.0.1]:51676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0N2Q-0008LW-En for submit@debbugs.gnu.org; Wed, 22 Feb 2012 20:00:04 -0500 Received: from ps18281.dreamhost.com ([69.163.218.105]:40492 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0N2O-0008Kw-8Z for 10705@debbugs.gnu.org; Wed, 22 Feb 2012 20:00:01 -0500 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id E306A451C330 for <10705@debbugs.gnu.org>; Wed, 22 Feb 2012 16:55:59 -0800 (PST) From: Juri Linkov Organization: JURTA References: <874nvac6us.fsf@mail.jurta.org> Date: Thu, 23 Feb 2012 02:57:04 +0200 In-Reply-To: <874nvac6us.fsf@mail.jurta.org> (Juri Linkov's message of "Thu, 02 Feb 2012 23:02:03 +0200") Message-ID: <87aa4amknz.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) I noticed that another occur's new feature `occur-edit-mode' lacks a menu item. I added it too.