emacs-devel
[Top][All Lists]
Advanced

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

Re: should search ring contain duplicates?


From: Kim F. Storm
Subject: Re: should search ring contain duplicates?
Date: Wed, 10 May 2006 11:34:41 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Juri Linkov <address@hidden> 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 <address@hidden> http://www.cua.dk





reply via email to

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