Subject: bug#21957: 24.5; Make occur search within regions when there is one

From: Juri Linkov <[email-masked]>
Date: Mon, 23 Nov 2015 02:22:59 +0200

> 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.