From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: [patch] Run occur command restricted to a region Date: Sat, 31 Dec 2016 01:20:28 +0200 Organization: LINKOV.NET Message-ID: <874m1lm1uz.fsf@mail.linkov.net> References: <87vau3jl6f.fsf@gmail.com> <87shp6uwvj.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1483140800 8064 195.159.176.226 (30 Dec 2016 23:33:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 30 Dec 2016 23:33:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu) Cc: Emacs developers To: Tino Calancha Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 31 00:33:16 2016 Return-path: Envelope-to: ged-emacs-devel@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 1cN6fj-0001Mu-52 for ged-emacs-devel@m.gmane.org; Sat, 31 Dec 2016 00:33:15 +0100 Original-Received: from localhost ([::1]:41847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cN6fo-0002IY-1r for ged-emacs-devel@m.gmane.org; Fri, 30 Dec 2016 18:33:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cN6en-0002IO-5t for emacs-devel@gnu.org; Fri, 30 Dec 2016 18:32:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cN6ek-0000wW-67 for emacs-devel@gnu.org; Fri, 30 Dec 2016 18:32:17 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:56899 helo=homiemail-a12.g.dreamhost.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cN6ek-0000vH-0L for emacs-devel@gnu.org; Fri, 30 Dec 2016 18:32:14 -0500 Original-Received: from homiemail-a12.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a12.g.dreamhost.com (Postfix) with ESMTP id 0828226206C; Fri, 30 Dec 2016 15:32:13 -0800 (PST) Original-Received: from localhost.linkov.net (m83-178-3-130.cust.tele2.ee [83.178.3.130]) (Authenticated sender: jurta@jurta.org) by homiemail-a12.g.dreamhost.com (Postfix) with ESMTPA id 0582226206B; Fri, 30 Dec 2016 15:32:11 -0800 (PST) In-Reply-To: (Tino Calancha's message of "Fri, 30 Dec 2016 11:47:48 +0900 (JST)") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 69.163.253.7 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211013 Archived-At: >> Maybe we should use the same logic of other related commands in replac= e.el >> how-many, keep-lines, flush-lines that limit the affected lines to the >> active region, or when the region is not active, take only lines after >> the current line. Then we don't need separate commands, and no keys f= or them. > Yeah, that is a source of confusion when using those tools: > 1) Commands like `how-many' or `flush-lines' by default apply to the li= nes > after point; they accept optional arguments to cover a region as wel= l. > 2) OTOH `occur' by default uses the entire buffer; it doesn't accept > arguments to select a region. > > It's a nice thing if all related tools follow similar defaults. Command > `occur' is also used in `multi-occur', to search in multiple buffers: i= n > that case you must search in the entire buffers. Like other commands, =E2=80=98occur=E2=80=99 could handle the active regi= on, but please show this fact in the header of the output *Occur* buffer, so the users will immediately notice the scope of the output.