Subject: RE: bug#11378: 24.1.50; Suggestion: Let M-i in isearch cycle `search-invisible'

From: Drew Adams <[email-masked]>
Date: Thu, 30 May 2013 06:34:53 -0700 (PDT)

> > I understand that approach.  I disagree, that's all.
> 
> It's no surprise that you disagree because both preferences make sense:

And we agree about that.

> (1) Start each new search afresh with default values.
> 
> (2) Keep the current search state for subsequent searches.
> 
> There are more possible preferences:
> 
> (3) Someone even might prefer to keep the current search state
>     within the confines of the current buffer (easy to do with
>     `make-local-variable' on the transient search variables).
> 
> (4) Reuse the previous search values only for the repeated search
>     `C-s C-s'.  This what the variable `isearch-last-case-fold-search'
>     is used for.  But why `isearch-last-case-fold-search' only?
>     Other search variables could be supported too.
> 
> This suggests two new customizable options: one to define which search
> variables to keep for the next search to be able to choose the behavior
> between (1) and (2) for every search variable, and another option for (4)
> to choose which search variables to keep for the repeated search `C-s C-s'
> (its default value could reuse the last case-fold only as it currently
> does).

As has often been the case, we think similarly (but differently too) here.
In my previous msg I mentioned a different way to combine both possibilities
(1: start with default vs 2: start from last)).  Not limited to Isearch,
and togglable between the two start-with behaviors.

When I get some time I'll throw something together and try it.  Maybe
let a (particular) prefix arg on the toggle command toggle also the current
start-with behavior.  E.g., a macro would define a user option and associated
variables, plus a toggle command usable for both start-with behaviors.