[Top][All Lists]

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

Re: History for query replace pairs

From: Ted Zlatanov
Subject: Re: History for query replace pairs
Date: Mon, 03 Nov 2014 19:59:13 -0500
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

On Tue, 04 Nov 2014 01:46:47 +0200 Juri Linkov <address@hidden> wrote: 

>> This feature seems stalled, is this issue the only thing blocking it?
JL> The only blocking thing is to decide whether to move through the history
JL> of replacements using M-p or M-n.  This patch implements a sequence of M-n
JL> to insert replacement pairs, but it's easy to change just one line from

JL> (read-from-minibuffer
JL>  prompt nil nil nil query-replace-from-history-variable defaults t)))))

JL> to

JL> (read-from-minibuffer
JL>  prompt nil nil nil 'defaults nil t)

JL> then M-p will move through replacement pairs instead of previous
JL> single history strings `from' or `to'.

I'd rather use M-p as the default because the new behavior is IMO much
better.  But it's really no big deal, we can switch it later.

JL> Maybe this choice should be customizable?

OK with me, and probably most Emacs-like :)

JL> The patch uses "\0" as a separator that is highly unlikely to occur in
JL> the replacement strings.

Ah, much better than my suggestion.

JL> Also for better displaying of special characters in the minibuffer,
JL> the following patch modifies isearch-text-char-description used by
JL> query-replace-descr to put a formatted display property on special 
JL> instead of changing them.  This patch also works better for isearch,
JL> because it keep the faces on the special characters in the failed string.

Nice, I like it.


reply via email to

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