GNU bug report logs - #21957
24.5; Make occur search within regions when there is one

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: b4283@HIDDEN; dated Thu, 19 Nov 2015 07:03:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 21957 <at> debbugs.gnu.org:


Received: (at 21957) by debbugs.gnu.org; 23 Nov 2015 01:29:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 22 20:29:39 2015
Received: from localhost ([127.0.0.1]:48688 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a0fwo-0001OP-Qu
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2015 20:29:39 -0500
Received: from aserp1040.oracle.com ([141.146.126.69]:27428)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <drew.adams@HIDDEN>) id 1a0fwm-0001OH-PC
 for 21957 <at> debbugs.gnu.org; Sun, 22 Nov 2015 20:29:37 -0500
Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])
 by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id
 tAN1TY5W018002
 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Mon, 23 Nov 2015 01:29:34 GMT
Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])
 by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id tAN1TYFh008103
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL);
 Mon, 23 Nov 2015 01:29:34 GMT
Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20])
 by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id tAN1TXLx008641;
 Mon, 23 Nov 2015 01:29:33 GMT
MIME-Version: 1.0
Message-ID: <99d74c5d-0047-4d4e-970e-008bc4a12b62@default>
Date: Sun, 22 Nov 2015 17:29:26 -0800 (PST)
From: Drew Adams <drew.adams@HIDDEN>
To: Juri Linkov <juri@HIDDEN>, Artur Malabarba <bruce.connor.am@HIDDEN>
Subject: RE: bug#21957: 24.5; Make occur search within regions when there is
 one
References: <87si42sdau.fsf@HIDDEN>
 <87ziy9tu1m.fsf@HIDDEN> <56500129.9090307@HIDDEN>
 <CAAdUY-KXwschiY9V0Fq_YmjDjR7MdY82d458LKYSzgHtM6KeRQ@HIDDEN>
 <87io4t5zto.fsf@HIDDEN>
In-Reply-To: <87io4t5zto.fsf@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9  (901082) [OL
 12.0.6691.5000 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: userv0021.oracle.com [156.151.31.71]
X-Spam-Score: -2.9 (--)
X-Debbugs-Envelope-To: 21957
Cc: 21957 <at> debbugs.gnu.org, Li Ian-Xue <b4283@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.9 (--)

> > 1. If the selected region has multiple lines, it would search only
> >    inside the region.
> > 2. If the selected region has one line or less, it would use the
> >    region as the search string.
> > 3. If there's no selection it do the usual occur.
>=20
> This is a useful heuristic, not sure how intuitive it is.
>=20
> BTW, I recall Drew asked how to do the same in Isearch, but I see no way
> because in Isearch it's useful to mark the beginning of the region, and
> extend it using Isearch commands by putting the end of the region where
> Isearch ends.

No, I don't think that was me.  Or not quite, if by that you
mean something I might have said about searching the region.

I'm not in favor of things such as the automatic switching
among #1, #2, and #3, above.  I prefer to let users pick
whether to search the region, regardless of its size or
whether it contains a newline char.  The combination of 1,2,3
above is _not_ a useful heuristic, IMO.  It can be useful to
do any of those things, but I don't think it is useful to
couple them together in a "dwimish" way.

I'm also not in favor of Isearch just picking up the region as
the search string (regardless of whether it contains newlines).
I prefer that users yank the region into the search string if
they want to search with it.  (I also give them another command
('C-M-y') to yank the secondary selection, which is typically
not at point, and which doesn't change until you change it
explicitly.)

IOW, I think it is better to have users explicitly say what
behavior they want, instead of dwimming them around.

FWIW, in Isearch+ these features are related to the region:

1. Option 'isearchp-restrict-to-region-flag' restricts
   searching to the active region (regardless of its size or
   the presence of a newline).  You can toggle this during
   Isearch using 'C-x n'.

2. Option 'isearchp-deactivate-region-flag' causes the active
   region to be deactivated (removing highlighting).  That
   makes it easier to see what is being searched.

3. If you also use library `modeline-posn.el' then when you
   search the active region you can keep that restriction for
   query-replacement invoked from Isearch.

4. Non-nil option 'isearchp-set-region-flag' selects the
   last search target as the region when you exit Isearch.
   You can toggle this during Isearch using 'C-SPC'.  If you
   also use library `replace+.el' then you can similarly
   select the last replacement as the region when you
   query-replace etc.

5. You can put a text or overlay property on the text in the
   region, and then later search the zones of text that have
   that property (they need not be contiguous).

6. If you also use library `zones.el' then you can search
   multiple zones defined by their limits (buffer positions
   or markers in any buffers), instead of by properties.
   You can add the active region to a set of such zones,
   using 'C-x n a'.  You can coalesce such zones, uniting
   their overlaps.  (That happens anyway when you search a
   set of zones.)

7. When you search zones of any kind, non-nil option
   'isearchp-dim-non-prop-zones-flag' dims the pieces of
   text that are not being searched.  You can toggle this
   during Isearch using 'C-M-D' (aka 'C-M-S-d').

8. You can search zones defined by text/overlays/buffer
   limits as described above, or you can search the
   complement.  You can toggle searching the complement
   using 'C-M-~' during Isearch.

http://www.emacswiki.org/emacs/IsearchPlus
http://www.emacswiki.org/emacs/Zones
http://www.emacswiki.org/emacs/ReplacePlus
http://www.emacswiki.org/emacs/ModeLinePosition




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21957; Package emacs. Full text available.

Message received at 21957 <at> debbugs.gnu.org:


Received: (at 21957) by debbugs.gnu.org; 23 Nov 2015 00:54:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 22 19:54:15 2015
Received: from localhost ([127.0.0.1]:48683 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a0fOY-0000VL-Gx
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2015 19:54:14 -0500
Received: from mail-lb0-f182.google.com ([209.85.217.182]:36795)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <arturmalabarba@HIDDEN>) id 1a0fOD-0000UZ-Ta
 for 21957 <at> debbugs.gnu.org; Sun, 22 Nov 2015 19:54:12 -0500
Received: by lbblt2 with SMTP id lt2so87955449lbb.3
 for <21957 <at> debbugs.gnu.org>; Sun, 22 Nov 2015 16:53:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:reply-to:sender:in-reply-to:references:date:message-id
 :subject:from:to:cc:content-type;
 bh=FitageHn0LxPko6OyN5Yd48R3Yw4Aqm53pRHIKj+5Ro=;
 b=MS47bn4KXLQnIxv+S9SsMAehL3Q4nfx61c+A0wtrz68FIdM5VJI72RCjySB254x4xx
 YfgI7qiWObgg2H3FgOI8TRvFZ2bHIUv8MbuJ2aU4TuUnznYwGXxUOjtUO95LrZvFHvDN
 LOidFGxkX4v28DSoIRPtq9qfoP7z3X4K5DdWlZNVFMBe2xtrnoP1mJsWj4+EIrpEwyjv
 Je2Li3GhS0loAfqbybZYUrHl7O3MbKwPmaAcfxc7vT4oHhWpzQfrHh2ND86S/s2bnQ1M
 u9eGDPF9fJGU2OdPZcwo7ljjpxKeD9Rn/5giFWOrorRX9Y6RiG2ewo932f2CFHdyobnR
 Eaeg==
MIME-Version: 1.0
X-Received: by 10.112.130.195 with SMTP id og3mr8225051lbb.69.1448240032883;
 Sun, 22 Nov 2015 16:53:52 -0800 (PST)
Received: by 10.112.202.99 with HTTP; Sun, 22 Nov 2015 16:53:52 -0800 (PST)
Received: by 10.112.202.99 with HTTP; Sun, 22 Nov 2015 16:53:52 -0800 (PST)
In-Reply-To: <87io4t5zto.fsf@HIDDEN>
References: <87si42sdau.fsf@HIDDEN>
 <87ziy9tu1m.fsf@HIDDEN> <56500129.9090307@HIDDEN>
 <CAAdUY-KXwschiY9V0Fq_YmjDjR7MdY82d458LKYSzgHtM6KeRQ@HIDDEN>
 <87io4t5zto.fsf@HIDDEN>
Date: Mon, 23 Nov 2015 00:53:52 +0000
X-Google-Sender-Auth: pG8724PW-wAVpy3ifmoLBV_ZIGI
Message-ID: <CAAdUY-J_NJaH=c1yvEgqrn2gkdwXoRHVvoXmDaz14-2gdNY25g@HIDDEN>
Subject: Re: bug#21957: 24.5;
 Make occur search within regions when there is one
From: Artur Malabarba <bruce.connor.am@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Content-Type: multipart/alternative; boundary=047d7b3a83aab5b0d805252aa855
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 21957
Cc: 21957 <at> debbugs.gnu.org, Drew Adams <drew.adams@HIDDEN>,
 Li Ian-Xue <b4283@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: bruce.connor.am@HIDDEN
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--047d7b3a83aab5b0d805252aa855
Content-Type: text/plain; charset=UTF-8

> BTW, I recall Drew asked how to do the same in Isearch, but I see no way
> because in Isearch it's useful to mark the beginning of the region, and
> extend it using Isearch commands by putting the end of the region where
> Isearch ends.

Technically that's not necessary. Isearch always pushes the mark for you
anyway, even though it doesn't activate the region. But most people don't
know that, and even though I know it I frequently forget and activate
region before isearch.

Anyway, I don't see why it would be a problem. Just add an item to do a
regular search if the region is empty.

--047d7b3a83aab5b0d805252aa855
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p dir=3D"ltr">&gt; BTW, I recall Drew asked how to do the same in Isearch,=
 but I see no way<br>
&gt; because in Isearch it&#39;s useful to mark the beginning of the region=
, and<br>
&gt; extend it using Isearch commands by putting the end of the region wher=
e<br>
&gt; Isearch ends.</p>
<p dir=3D"ltr">Technically that&#39;s not necessary. Isearch always pushes =
the mark for you anyway, even though it doesn&#39;t activate the region. Bu=
t most people don&#39;t know that, and even though I know it I frequently f=
orget and activate region before isearch. </p>
<p dir=3D"ltr">Anyway, I don&#39;t see why it would be a problem. Just add =
an item to do a regular search if the region is empty.</p>

--047d7b3a83aab5b0d805252aa855--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21957; Package emacs. Full text available.

Message received at 21957 <at> debbugs.gnu.org:


Received: (at 21957) by debbugs.gnu.org; 23 Nov 2015 00:27:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 22 19:27:23 2015
Received: from localhost ([127.0.0.1]:48675 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a0eyZ-0008G6-Ac
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2015 19:27:23 -0500
Received: from sub3.mail.dreamhost.com ([69.163.253.7]:58596
 helo=homiemail-a39.g.dreamhost.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <juri@HIDDEN>) id 1a0eyV-0008Ft-4r
 for 21957 <at> debbugs.gnu.org; Sun, 22 Nov 2015 19:27:19 -0500
Received: from homiemail-a39.g.dreamhost.com (localhost [127.0.0.1])
 by homiemail-a39.g.dreamhost.com (Postfix) with ESMTP id 0001A15006D;
 Sun, 22 Nov 2015 16:27:17 -0800 (PST)
Received: from localhost.linkov.net (m91-131-172-22.cust.tele2.ee
 [91.131.172.22]) (Authenticated sender: jurta@HIDDEN)
 by homiemail-a39.g.dreamhost.com (Postfix) with ESMTPA id B1118150069;
 Sun, 22 Nov 2015 16:27:16 -0800 (PST)
From: Juri Linkov <juri@HIDDEN>
To: Artur Malabarba <bruce.connor.am@HIDDEN>
Subject: Re: bug#21957: 24.5;
 Make occur search within regions when there is one
Organization: LINKOV.NET
References: <87si42sdau.fsf@HIDDEN>
 <87ziy9tu1m.fsf@HIDDEN> <56500129.9090307@HIDDEN>
 <CAAdUY-KXwschiY9V0Fq_YmjDjR7MdY82d458LKYSzgHtM6KeRQ@HIDDEN>
Date: Mon, 23 Nov 2015 02:22:59 +0200
In-Reply-To: <CAAdUY-KXwschiY9V0Fq_YmjDjR7MdY82d458LKYSzgHtM6KeRQ@HIDDEN>
 (Artur Malabarba's message of "Sun, 22 Nov 2015 12:13:31 +0000")
Message-ID: <87io4t5zto.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 21957
Cc: 21957 <at> debbugs.gnu.org, Drew Adams <drew.adams@HIDDEN>,
 Li Ian-Xue <b4283@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

> I've been thinking it might be nice to have an occur-dwim command.
>
> 1. If the selected region has multiple lines, it would search only inside
> the region.
> 2. If the selected region has one line or less, it would use the region as
> the search string.
> 3. If there's no selection it do the usual occur.

This is a useful heuristic, not sure how intuitive it is.

BTW, I recall Drew asked how to do the same in Isearch, but I see no way
because in Isearch it's useful to mark the beginning of the region, and
extend it using Isearch commands by putting the end of the region where
Isearch ends.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21957; Package emacs. Full text available.

Message received at 21957 <at> debbugs.gnu.org:


Received: (at 21957) by debbugs.gnu.org; 22 Nov 2015 12:13:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 22 07:13:53 2015
Received: from localhost ([127.0.0.1]:47673 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a0TWj-0003sQ-Bk
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2015 07:13:53 -0500
Received: from mail-lf0-f47.google.com ([209.85.215.47]:34270)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <arturmalabarba@HIDDEN>) id 1a0TWO-0003ry-Hb
 for 21957 <at> debbugs.gnu.org; Sun, 22 Nov 2015 07:13:51 -0500
Received: by lffu14 with SMTP id u14so92973997lff.1
 for <21957 <at> debbugs.gnu.org>; Sun, 22 Nov 2015 04:13:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:reply-to:sender:in-reply-to:references:date:message-id
 :subject:from:to:cc:content-type;
 bh=KadmYTnEqxUp4NWxdC4J7UWqTQ7oY7QishtijXqH0Xw=;
 b=oUYq6+qei7pLJ2SClSObhtrUUzb4WUt1n4+BPAl/VR41NArgE1f05LdDnno1GLW0rn
 kxFaKRQFUSqRuedmdDdSZteXH90VOllKUsUoLxyI2RfHqjOCEUBtTBWiDXMPq626Rxlb
 VouG7clL3+a8+79UyY5rn/WsKVZ5O5w9N0Wy1NuEydMLdpkQF6yluXckIY/YUpK8jkYx
 ORWxvzco0bFcJCOipcxYyopcwDEKI0CGSEDOzD44rIMIOUUMS90dtvucsrO52NbUJisv
 cgrUdi4/LDSLSxVBD3YVId5wS6DDe5f+xhD2mG9cEuh9oEtelSSYsDuxK9gIVpnaI/qS
 PDKA==
MIME-Version: 1.0
X-Received: by 10.25.19.69 with SMTP id j66mr9224742lfi.25.1448194411690; Sun,
 22 Nov 2015 04:13:31 -0800 (PST)
Received: by 10.112.202.99 with HTTP; Sun, 22 Nov 2015 04:13:31 -0800 (PST)
Received: by 10.112.202.99 with HTTP; Sun, 22 Nov 2015 04:13:31 -0800 (PST)
In-Reply-To: <56500129.9090307@HIDDEN>
References: <87si42sdau.fsf@HIDDEN>
 <87ziy9tu1m.fsf@HIDDEN> <56500129.9090307@HIDDEN>
Date: Sun, 22 Nov 2015 12:13:31 +0000
X-Google-Sender-Auth: PSgTPEa9LleY-r_zt4BpTF242YU
Message-ID: <CAAdUY-KXwschiY9V0Fq_YmjDjR7MdY82d458LKYSzgHtM6KeRQ@HIDDEN>
Subject: Re: bug#21957: 24.5;
 Make occur search within regions when there is one
From: Artur Malabarba <bruce.connor.am@HIDDEN>
To: Li Ian-Xue <b4283@HIDDEN>
Content-Type: multipart/alternative; boundary=001a114069d479815f0525200948
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 21957
Cc: 21957 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: bruce.connor.am@HIDDEN
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--001a114069d479815f0525200948
Content-Type: text/plain; charset=UTF-8

I've been thinking it might be nice to have an occur-dwim command.

1. If the selected region has multiple lines, it would search only inside
the region.
2. If the selected region has one line or less, it would use the region as
the search string.
3. If there's no selection it do the usual occur.

--001a114069d479815f0525200948
Content-Type: text/html; charset=UTF-8

<p dir="ltr">I&#39;ve been thinking it might be nice to have an occur-dwim command.</p>
<p dir="ltr">1. If the selected region has multiple lines, it would search only inside the region. <br>
2. If the selected region has one line or less, it would use the region as the search string. <br>
3. If there&#39;s no selection it do the usual occur. </p>

--001a114069d479815f0525200948--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21957; Package emacs. Full text available.

Message received at 21957 <at> debbugs.gnu.org:


Received: (at 21957) by debbugs.gnu.org; 21 Nov 2015 05:29:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 21 00:29:38 2015
Received: from localhost ([127.0.0.1]:46575 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a00jy-0008DF-Hh
	for submit <at> debbugs.gnu.org; Sat, 21 Nov 2015 00:29:38 -0500
Received: from [128.199.246.141] (port=41324 helo=itsuwa.org)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <b4283@HIDDEN>) id 1a00je-0008Ck-DE
 for 21957 <at> debbugs.gnu.org; Sat, 21 Nov 2015 00:29:37 -0500
Received: from 36-236-127-213.dynamic-ip.hinet.net ([36.236.127.213]
 helo=[192.168.1.109])
 by itsuwa.org with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128)
 (Exim 4.80) (envelope-from <b4283@HIDDEN>)
 id 1a00jc-00047v-RS; Sat, 21 Nov 2015 13:29:16 +0800
Subject: Re: bug#21957: 24.5; Make occur search within regions when there is
 one
To: Juri Linkov <juri@HIDDEN>
References: <87si42sdau.fsf@HIDDEN>
 <87ziy9tu1m.fsf@HIDDEN>
From: Li Ian-Xue <b4283@HIDDEN>
Message-ID: <56500129.9090307@HIDDEN>
Date: Sat, 21 Nov 2015 13:29:13 +0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <87ziy9tu1m.fsf@HIDDEN>
Content-Type: text/plain; charset=big5
Content-Transfer-Encoding: 8bit
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has
 identified this incoming email as possible spam.  The original message
 has been attached to this so you can view it (if it isn't spam) or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Yes, that is what I did when I found out `occur' doesn't do
 regions. A friend of mine suggested that a combination of narrowing (C-x
 n w) and M-s o should do the trick, and it did. Nevertheless still I would
 still prefer `occur' to accept a regional parameter, as it would be much
 straight forward mode of operation. [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS
X-Debbugs-Envelope-To: 21957
Cc: 21957 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has
 identified this incoming email as possible spam.  The original message
 has been attached to this so you can view it (if it isn't spam) or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Yes, that is what I did when I found out `occur' doesn't do
    regions. A friend of mine suggested that a combination of narrowing (C-x
   n w) and M-s o should do the trick, and it did. Nevertheless still I would
    still prefer `occur' to accept a regional parameter, as it would be much
   straight forward mode of operation. [...] 
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  1.3 RDNS_NONE              Delivered to internal network by a host with no rDNS

Yes, that is what I did when I found out `occur' doesn't do regions. A
friend of mine suggested
that a combination of narrowing (C-x n w) and M-s o should do the trick,
and it did.

Nevertheless still I would still prefer `occur' to accept a regional
parameter,
as it would be much straight forward mode of operation.

Thank you.

Juri Linkov 於 西元2015年11月20日 08:04 寫道:
>> This is a wish request.
>>
>> The current occur implementation doesn't include a `region' version
>> which search only within the current region mark by user, instead it
>> operates on the entire buffer.
>>
>> It would come in handy if occur searchs within regions as well. Such
>> behavior is desired, for example, when listing the occurances of a
>> symbol in the body of a function definition.
> Do you think it would suit your needs when you first narrow the buffer
> (e.g. to the body of a function with C-x n d) before running occur?





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21957; Package emacs. Full text available.

Message received at 21957 <at> debbugs.gnu.org:


Received: (at 21957) by debbugs.gnu.org; 20 Nov 2015 00:06:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 19 19:06:06 2015
Received: from localhost ([127.0.0.1]:45336 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZzZDK-0006Wn-4U
	for submit <at> debbugs.gnu.org; Thu, 19 Nov 2015 19:06:06 -0500
Received: from sub3.mail.dreamhost.com ([69.163.253.7]:42519
 helo=homiemail-a18.g.dreamhost.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <juri@HIDDEN>) id 1ZzZDI-0006Wb-16
 for 21957 <at> debbugs.gnu.org; Thu, 19 Nov 2015 19:06:04 -0500
Received: from homiemail-a18.g.dreamhost.com (localhost [127.0.0.1])
 by homiemail-a18.g.dreamhost.com (Postfix) with ESMTP id 9B0A625006B;
 Thu, 19 Nov 2015 16:06:02 -0800 (PST)
Received: from localhost.linkov.net (82.131.20.219.cable.starman.ee
 [82.131.20.219]) (Authenticated sender: jurta@HIDDEN)
 by homiemail-a18.g.dreamhost.com (Postfix) with ESMTPA id C8A3A250069;
 Thu, 19 Nov 2015 16:06:01 -0800 (PST)
From: Juri Linkov <juri@HIDDEN>
To: b4283@HIDDEN
Subject: Re: bug#21957: 24.5;
 Make occur search within regions when there is one
Organization: LINKOV.NET
References: <87si42sdau.fsf@HIDDEN>
Date: Fri, 20 Nov 2015 02:04:53 +0200
In-Reply-To: <87si42sdau.fsf@HIDDEN>
 (b4283@HIDDEN's message of "Thu, 19 Nov 2015 14:39:37 +0800")
Message-ID: <87ziy9tu1m.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 21957
Cc: 21957 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

> This is a wish request.
>
> The current occur implementation doesn't include a `region' version
> which search only within the current region mark by user, instead it
> operates on the entire buffer.
>
> It would come in handy if occur searchs within regions as well. Such
> behavior is desired, for example, when listing the occurances of a
> symbol in the body of a function definition.

Do you think it would suit your needs when you first narrow the buffer
(e.g. to the body of a function with C-x n d) before running occur?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21957; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 19 Nov 2015 07:02:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 19 02:02:11 2015
Received: from localhost ([127.0.0.1]:44126 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZzJEQ-0003Cq-Kc
	for submit <at> debbugs.gnu.org; Thu, 19 Nov 2015 02:02:11 -0500
Received: from eggs.gnu.org ([208.118.235.92]:48475)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <b4283@HIDDEN>) id 1ZzJEO-0003Ci-Ug
 for submit <at> debbugs.gnu.org; Thu, 19 Nov 2015 02:02:09 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <b4283@HIDDEN>) id 1ZzJEN-0002vj-Fw
 for submit <at> debbugs.gnu.org; Thu, 19 Nov 2015 02:02:08 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:35209)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <b4283@HIDDEN>) id 1ZzJEN-0002ve-DF
 for submit <at> debbugs.gnu.org; Thu, 19 Nov 2015 02:02:07 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58476)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <b4283@HIDDEN>) id 1ZzJEM-0006sD-7L
 for bug-gnu-emacs@HIDDEN; Thu, 19 Nov 2015 02:02:07 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <b4283@HIDDEN>) id 1ZzJEI-0002vK-5x
 for bug-gnu-emacs@HIDDEN; Thu, 19 Nov 2015 02:02:06 -0500
Received: from [128.199.246.141] (port=39553 helo=itsuwa.org)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <b4283@HIDDEN>) id 1ZzJEH-0002sw-Qc
 for bug-gnu-emacs@HIDDEN; Thu, 19 Nov 2015 02:02:02 -0500
Received: from 125-227-241-199.hinet-ip.hinet.net ([125.227.241.199]
 helo=ipass-lix01)
 by itsuwa.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.80) (envelope-from <b4283@HIDDEN>) id 1ZzIsx-0004hB-1W
 for bug-gnu-emacs@HIDDEN; Thu, 19 Nov 2015 14:39:59 +0800
From: b4283@HIDDEN
To: bug-gnu-emacs@HIDDEN
Subject: 24.5; Make occur search within regions when there is one
Date: Thu, 19 Nov 2015 14:39:37 +0800
Message-ID: <87si42sdau.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic]
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)


This is a wish request.

The current occur implementation doesn't include a `region' version
which search only within the current region mark by user, instead it
operates on the entire buffer.

It would come in handy if occur searchs within regions as well. Such
behavior is desired, for example, when listing the occurances of a
symbol in the body of a function definition.



In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6)
 of 2015-09-10 on foutrelis
Windowing system distributor `The X.Org Foundation', version 11.0.11704000
System Description:	Arch Linux

Configured using:
 `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong
 --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'

Important settings:
  value of $LC_CTYPE: zh_TW.UTF-8
  value of $LANG: zh_TW.UTF-8
  value of $XMODIFIERS: @im=gcin
  locale-coding-system: utf-8-unix

Major mode: C++/l

Minor modes in effect:
  shell-dirtrack-mode: t
  nyan-mode: t
  global-linum-mode: t
  linum-mode: t
  ido-everywhere: t
  show-paren-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent messages:

Load-path shadows:

Features:
(shadow sort gnus-util mail-extr emacsbug message idna format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils shell pcomplete grep+ grep compile comint
ansi-color etags ring misearch multi-isearch cc-langs cc-mode-expansions
cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs smooth-scrolling vc-git quail help-mode jka-compr
expand-region text-mode-expansions er-basic-expansions thingatpt
expand-region-core expand-region-custom nyan-mode buffer-move linum
edmacro kmacro cl-loaddefs cl-lib ido xemacs-theme paren delsel
cus-start cus-load windmove afternoon-theme-autoloads
cherry-blossom-theme-autoloads colorsarenice-theme-autoloads
geiser-autoloads helm-autoloads js2-mode-autoloads info easymenu
php-mode-autoloads rust-mode-autoloads advice help-fns
toml-mode-autoloads package epg-config time-date china-util tooltip
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 727609 127367)
 (symbols 48 27690 0)
 (miscs 40 1313 683)
 (strings 32 121297 25891)
 (string-bytes 1 1561851)
 (vectors 16 91267)
 (vector-slots 8 1181120 133080)
 (floats 8 89 446)
 (intervals 56 7376 3100)
 (buffers 960 23)
 (heap 1024 75181 2588))




Acknowledgement sent to b4283@HIDDEN:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#21957; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.