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: should search ring contain duplicates? Date: Wed, 10 May 2006 11:34:41 +0200 Message-ID: References: <200605030727.k437R2Wx009975@amrm2.ics.uci.edu> <87bqufwbls.fsf@jurta.org> <8764kezswj.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 1147253820 18494 80.91.229.2 (10 May 2006 09:37:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 May 2006 09:37:00 +0000 (UTC) Cc: dann@ics.uci.edu, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 10 11:36:54 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 1Fdl7g-0004V7-KM for ged-emacs-devel@m.gmane.org; Wed, 10 May 2006 11:36:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fdl7g-0007eu-4V for ged-emacs-devel@m.gmane.org; Wed, 10 May 2006 05:36:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fdl7T-0007eo-Vi for emacs-devel@gnu.org; Wed, 10 May 2006 05:36:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fdl7S-0007ec-Oj for emacs-devel@gnu.org; Wed, 10 May 2006 05:36:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fdl7S-0007eZ-LQ for emacs-devel@gnu.org; Wed, 10 May 2006 05:36:34 -0400 Original-Received: from [195.41.46.237] (helo=pfepc.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fdl8i-0004jo-IE for emacs-devel@gnu.org; Wed, 10 May 2006 05:37:52 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (unknown [80.165.4.124]) by pfepc.post.tele.dk (Postfix) with SMTP id 4C71B8A007A; Wed, 10 May 2006 11:36:20 +0200 (CEST) Original-To: Juri Linkov In-Reply-To: <8764kezswj.fsf@jurta.org> (Juri Linkov's message of "Tue, 09 May 2006 23:47:48 +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:54183 Archived-At: Juri Linkov writes: >> Below is a tested patch that removes `keep-all' from `read-from-minibuffer', Did you test that with your changes, it still fixes the original problem which was the reason for the original change? http://lists.gnu.org/archive/html/emacs-pretest-bug/2004-11/msg00287.html >> adds duplicate replacement strings to the query-replace history explicitly, >> and fixes more places where the value of `history-delete-duplicates' >> is not taken into account yet (namely, `repeat-complex-command', >> `call-interactively'). > > What is the decision about my patch? Is it OK to remove the argument > `keep-all' and to fix other history handling places? Modulo fixing the original problem, then you should install your patch. But pls. consider using add-to-history instead of explicitly testing for history-delete-duplicates. BTW, add-to-history should probably be fixed to _not_ add an element which is already at the head of the history. Index: subr.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/subr.el,v retrieving revision 1.509 diff -c -b -r1.509 subr.el *** subr.el 10 May 2006 01:58:37 -0000 1.509 --- subr.el 10 May 2006 09:35:21 -0000 *************** *** 1138,1143 **** --- 1138,1145 ---- tail) (if history-delete-duplicates (setq history (delete newelt history))) + (unless (and history + (equal (car history) newlet)) (setq history (cons newelt history)) (when (integerp maxelt) (if (= 0 maxelt) *************** *** 1145,1151 **** (setq tail (nthcdr (1- maxelt) history)) (when (consp tail) (setcdr tail nil)))) ! (set history-var history))) ;;;; Mode hooks. --- 1147,1153 ---- (setq tail (nthcdr (1- maxelt) history)) (when (consp tail) (setcdr tail nil)))) ! (set history-var history)))) -- Kim F. Storm http://www.cua.dk