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: Thu, 11 May 2006 12:08:14 +0200 Message-ID: References: <200605030727.k437R2Wx009975@amrm2.ics.uci.edu> <87bqufwbls.fsf@jurta.org> <8764kezswj.fsf@jurta.org> <87ejz1mqvg.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 1147342222 13015 80.91.229.2 (11 May 2006 10:10:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 11 May 2006 10:10:22 +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 Thu May 11 12:10:16 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 1Fe87W-0000Ya-BK for ged-emacs-devel@m.gmane.org; Thu, 11 May 2006 12:10:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fe87V-0001M1-RZ for ged-emacs-devel@m.gmane.org; Thu, 11 May 2006 06:10:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fe87I-0001Lq-Dk for emacs-devel@gnu.org; Thu, 11 May 2006 06:09:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fe87G-0001LX-AC for emacs-devel@gnu.org; Thu, 11 May 2006 06:09:55 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fe87G-0001LO-3r for emacs-devel@gnu.org; Thu, 11 May 2006 06:09:54 -0400 Original-Received: from [195.41.46.235] (helo=pfepa.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fe88k-0004ii-3Z for emacs-devel@gnu.org; Thu, 11 May 2006 06:11:26 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (unknown [80.165.4.124]) by pfepa.post.tele.dk (Postfix) with SMTP id 2985BFAC030; Thu, 11 May 2006 12:09:52 +0200 (CEST) Original-To: Juri Linkov In-Reply-To: <87ejz1mqvg.fsf@jurta.org> (Juri Linkov's message of "Thu, 11 May 2006 01:55:47 +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:54254 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 > > I tested it with all test cases from this thread, but that was before > adding add-to-history to CVS. > >> But pls. consider using add-to-history instead of explicitly testing >> for history-delete-duplicates. > > To use add-to-history there should be a way to tell read-from-minibuffer > not to add new elements to the history list, so add-to-history could > undertake this task itself later. nil as the `hist' argument of > read-from-minibuffer doesn't count because the history list should be > available for M-p. > >> BTW, add-to-history should probably be fixed to _not_ add an element >> which is already at the head of the history. > > Then it becomes a complete duplicate of C code. The intention of add-to-history is to provide the same functionality as the C code -- so that Lisp code can be sure to DTRT when they add stuff to a history list "manually". > Isn't then better > to call the Lisp function add-to-history from the C implementation of > read_minibuf? I have no opinion here. Another approach would be to implement add-to-history in C (it's practically already there), and export it to Lisp. -- Kim F. Storm http://www.cua.dk