[Top][All Lists]

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

Isearch: retrieve last successful search string from when you quit (`C-g

From: Drew Adams
Subject: Isearch: retrieve last successful search string from when you quit (`C-g')
Date: Sun, 30 Sep 2012 14:09:50 -0700

I sometimes isearch for a term but ultimately decide not to go to any of its
locations, at least not for the moment.  That is, I hit `C-g' after navigating
around a bit to check things out.

In some cases, the search string for this might have required a bit of typing.
Or maybe it came from multiple `C-w's at search startup, and maybe I later moved
away from that start location, so it would be cumbersome to try to get back that
search string again, for another search.

I guess for a long time I've sub-thought, without considering it consciously,
that it might be good to get back that last successful search string -- the one
I was searching with when I hit `C-g' to quit searching -- for reuse later.  But
it's not saved on the search rings (which makes sense), so it is not available.
`C-g' means bye-bye.

In Isearch+, I added a key (`M-g') to retrieve on demand that last successful
search string (for `C-s') or regexp (for `C-M-s') that was current at the time I
canceled with `C-g'.  To me, it seems handy.

Retrieval is a yank, not a replacement of your current search string.  So you
can append the retrieved string to whatever you are already looking for (or you
can search for just the retrieved string/regexp).

If this sounds like something with wider appeal, let me know - the patch to
isearch.el would be trivial.  You can try it quickly by loading isearch+.el.

reply via email to

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