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: Kim F. Storm
Subject: Re: query-replace in isearch (was Re: should search ring contain duplicates?)
Date: Sun, 21 May 2006 00:39:57 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Juri Linkov <address@hidden> writes:

>> I'm trying to find a better replacement for KEEP-ALL.
>
> I want to remind that for add-to-history to be usable in several places
> there should be a way for read-from-minibuffer not to add a new
> element to the history list, thus allowing add-to-history to perform
> this task itself afterwards.
>
> I see two ways to do this:
>
> 1. before calling read-from-minibuffer to change a global variable
>    (either `history-delete-duplicates' or `history-length') to a special
>    value.
>
> 2. to change the argument KEEP-ALL to DONT-KEEP so that if DONT-KEEP
>    is t, then read-from-minibuffer doesn't add a new element to the
>    history list, and the calling code can add it by the explicit call
>    of add-to-history (with any necessary arguments including the value t
>    for KEEP-ALL argument of add-to-history).

Can't you let-bind the history variable around the call to
read-from-minibuffer, i.e.

  (let ((history-var history-var))
    (read-from-minibuffer .... 'history-var ...))
  (add-to-history 'history-var ...)

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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