emacs-devel
[Top][All Lists]
Advanced

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

Re: query-replace in isearch (was Re: should search ring contain duplica


From: Juri Linkov
Subject: Re: query-replace in isearch (was Re: should search ring contain duplicates?)
Date: Fri, 12 May 2006 00:52:38 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

>>  This requires adding a new
>> argument KEEP-ALL to `add-to-history'. Its meaning is the same as the
>> argument KEEP-ALL of `read-from-minibuffer'.
>
> That makes sense for the same reason as it makes sense
> in read-from-minibuffer.
>
> But didn't you just argue that we could remove keep-all from that
> function?

`read-from-minibuffer' already has too many arguments, and I think adding
a new very specific argument (used for a special history handling just in
one specific place in Emacs) to this general function was not a good thing.

I'm trying to find a better replacement for KEEP-ALL.  There are currently
two alternative variants of keeping empty and duplicate elements
in the history:

1. Instead of using the KEEP-ALL argument bind `history-delete-duplicates'
to a special value `keep-all' before calling `read-from-minibuffer'.

2. Tell `read-from-minibuffer' not to add a new element to the history
list, and add it later by calling `add-to-history' with the KEEP-ALL
argument.

I like the latter.  In my latest patch I preserve the original history
list before calling `read-from-minibuffer', and overwrite the history list
modified by `read-from-minibuffer' with the old original value.  After that,
`add-to-history' adds a new element to the original history list.

However, I admit such preserving is not a good solution, because
in the minibuffer the user can use own commands to modify the history
list, and this modified history list gets overwritten with the old value.

What about a special value of `history-length' (e.g. nil) to tell
`read-from-minibuffer' not to add a new element to the history list
(with the intention to add it later by `add-to-history')?

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





reply via email to

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