emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: suggestion in query-replace is messed up after cancelation


From: Juri Linkov
Subject: Re: suggestion in query-replace is messed up after cancelation
Date: Sun, 28 May 2006 11:02:00 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

>> Neither one is very good.  However, to do any better
>> we would need to maintain a separate history of pairs to suggest.
>> This would be disconnected from the history list of strings.
>
> This patch should implement this behavior.
>
> + (defvar query-replace-defaults nil
> +   "Default values of FROM-STRING and TO-STRING for `query-replace'.
> + This is a cons cell (FROM-STRING . TO-STRING), or nil if there is
> + no default value.")

What about having a list of cons cells (FROM-STRING . TO-STRING)
of all previous replacements and using new keys (e.g. M-P and M-N)
to access previous/next replacements pairs from the replacement pair
history?

> !       (if (and (zerop (length from)) query-replace-defaults)
>         (progn
>           (set query-replace-from-history-variable
>                (cdr (symbol-value query-replace-from-history-variable)))

We don't need this `set' anymore.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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