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, 14 May 2006 01:13:50 +0200 Message-ID: References: <200605030727.k437R2Wx009975@amrm2.ics.uci.edu> <87bqufwbls.fsf@jurta.org> <200605031504.k43F49hr001544@scanner2.ics.uci.edu> <87wtcslqoj.fsf@jurta.org> <87y7x75wtp.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 1147562160 13546 80.91.229.2 (13 May 2006 23:16:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 13 May 2006 23:16:00 +0000 (UTC) Cc: Juri Linkov , dann@ics.uci.edu, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 14 01:15:58 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 1Ff3Kx-0006ZG-1N for ged-emacs-devel@m.gmane.org; Sun, 14 May 2006 01:15:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ff3Kw-0006ys-Bx for ged-emacs-devel@m.gmane.org; Sat, 13 May 2006 19:15:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ff3Kj-0006xJ-F3 for emacs-devel@gnu.org; Sat, 13 May 2006 19:15:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ff3Ki-0006wD-5H for emacs-devel@gnu.org; Sat, 13 May 2006 19:15:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ff3Kh-0006w5-WC for emacs-devel@gnu.org; Sat, 13 May 2006 19:15:36 -0400 Original-Received: from [195.41.46.236] (helo=pfepb.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Ff3Mj-0000co-RC; Sat, 13 May 2006 19:17:41 -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 D2901A50019; Sun, 14 May 2006 01:15:28 +0200 (CEST) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Sat, 13 May 2006 00:52:44 -0400") 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:54407 Archived-At: Richard Stallman writes: > The old code unconditionally adds a new element to the history list as: > > ! (set query-replace-from-history-variable > ! (cons isearch-string > ! (symbol-value query-replace-from-history-variable))) > > A new argument KEEP-ALL allows to do the same for the new code that uses > `add-to-history': > > ! (add-to-history query-replace-from-history-variable isearch-string nil t) > > If I understand right, add-to-history unconditionally adds a new last > element. Not so? > > It also deletes older elements that match the new one. Only if history-delete-duplicates is non-nil ... but it is nil by default. > Using > add-to-history will treat this new element just like other new > elements on the same history list. That seems right to me. Do you > think it is wrong in this case? It is wrong if history-delete-duplicates is nil; then it unconditionally adds an element even if it is equal to the head of the history. -- Kim F. Storm http://www.cua.dk