From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: query-replace in isearch (was Re: should search ring contain duplicates?) Date: Sun, 21 May 2006 00:39:57 +0200 Message-ID: References: <200605030727.k437R2Wx009975@amrm2.ics.uci.edu> <87bqufwbls.fsf@jurta.org> <200605031504.k43F49hr001544@scanner2.ics.uci.edu> <87wtcslqoj.fsf@jurta.org> <87slng8c5p.fsf@jurta.org> <87ac9ekbw6.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1148164954 29313 80.91.229.2 (20 May 2006 22:42:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 20 May 2006 22:42:34 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 21 00:42:30 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fha9T-0005Ba-Hy for ged-emacs-devel@m.gmane.org; Sun, 21 May 2006 00:42:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fha9T-0006DM-4e for ged-emacs-devel@m.gmane.org; Sat, 20 May 2006 18:42:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fha9G-0006Ca-Ne for emacs-devel@gnu.org; Sat, 20 May 2006 18:42:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fha9F-0006C1-Dr for emacs-devel@gnu.org; Sat, 20 May 2006 18:42:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fha9F-0006Bx-5D for emacs-devel@gnu.org; Sat, 20 May 2006 18:42:13 -0400 Original-Received: from [195.41.46.236] (helo=pfepb.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FhaCs-00028I-8q for emacs-devel@gnu.org; Sat, 20 May 2006 18:45:58 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepb.post.tele.dk (Postfix) with SMTP id 9CDB9A50014; Sun, 21 May 2006 00:42:05 +0200 (CEST) Original-To: Juri Linkov In-Reply-To: <87ac9ekbw6.fsf@jurta.org> (Juri Linkov's message of "Fri, 19 May 2006 06:05:57 +0300") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:54898 Archived-At: Juri Linkov 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 http://www.cua.dk