[Top][All Lists]

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

Re: History for query replace pairs

From: Josh
Subject: Re: History for query replace pairs
Date: Sat, 9 Aug 2014 18:18:56 -0700

On Fri, Aug 8, 2014 at 4:38 PM, Juri Linkov <address@hidden> wrote:
> The question is: how could it be integrated into the current
> query-replace interface, that is how could the user choose
> from a history of defaults (if he does not want to choose the
> latest default which he can access with RET).

Since the default values are displayed in a special format
using an arrow

  Query replace (default from1 -> to1):

a history navigation key should bring the pair into the minibuffer
in the same format like

  Query replace (default from1 -> to1): from2 -> to2

I've often wished for the sort of pair-wise history Tom described
myself, and thought a bit about possible UIs.  So far, the idea I
find most appealing is a history ring whose elements are
single-line yasnippet-style snippets with `from' and `to' fields
that defaulted to the values for that history element.  So after
the first M-p the minibuffer could look something like
  Query replace (TAB for next field, RET to accept): [|from1] -> [to1]
with the point at the start of the from1 field.  Entering any text
would replace from1, while hitting TAB would advance the point
to the to1 field, which would behave similarly.  Entering RET
at any time would commit the current from and to values in
whatever state they were in.  Subsequent M-p's would cycle
through previous pairs as you would expect.  Hitting RET
immediately after any M-p would accept the current default
pair and replacing or editing one or both fields would be
convenient as well. 

I'm afraid I have no clue about how to go about implementing
such behavior though :)


reply via email to

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