emacs-devel
[Top][All Lists]
Advanced

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

Re: Isearch: retrieve last successful search string from when you quit (


From: Nix
Subject: Re: Isearch: retrieve last successful search string from when you quit (`C-g')
Date: Tue, 02 Oct 2012 12:29:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

On 1 Oct 2012, Drew Adams told this:
> This is a one-off, occasional thing - nowhere near as frequent as reusing a
> search that you actually followed.  Just imagine saving your search rings
> persistently (e.g. via savehist.el), to see the folly of saving each 
> successful
> but abandoned search string.

If you're trying to avoid having unsuccessful searches crowd successful
ones out of he history, the right solution is presumably to have two
rings, one for successful searches, one for unsuccessful ones, and have
the default 'back in search' option merge the two rings at runtime.
(This is easily implementable by making each entry in each ring a pair
of (counter . value), incrementing the counter on each ring insertion,
and taking from whichever ring has the lowest counter value for the next
item on each ring pop.)

This has the benefit that it is easy to have two keybindings to navigate
each ring independently, if you so desire.

-- 
NULL && (void)



reply via email to

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