emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch] Run occur command restricted to a region


From: Juri Linkov
Subject: Re: [patch] Run occur command restricted to a region
Date: Sat, 31 Dec 2016 01:20:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu)

>> Maybe we should use the same logic of other related commands in replace.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 for 
>> 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 lines
>    after point; they accept optional arguments to cover a region as well.
> 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: in
> that case you must search in the entire buffers.

Like other commands, ‘occur’ could handle the active region,
but please show this fact in the header of the output *Occur* buffer,
so the users will immediately notice the scope of the output.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]