From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: length of query-replace-history list Date: Thu, 1 Jun 2006 10:29:35 -0500 Organization: UseNetServer.com Message-ID: <4da72$447f07d9$49fa79b$23416@DIALUPUSA.NET> References: <933ba$447dc666$49fa4f5$15189@DIALUPUSA.NET> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1149176514 11533 80.91.229.2 (1 Jun 2006 15:41:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 1 Jun 2006 15:41:54 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 01 17:41:53 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FlpJ1-0000qf-Ap for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Jun 2006 17:41:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FlpJ0-00010j-Qm for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Jun 2006 11:41:50 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!newscon02.news.prodigy.com!prodigy.net!atl-c08.usenetserver.com!news.usenetserver.com!pc02.usenetserver.com!DIALUPUSA.NET!not-for-mail Original-Newsgroups: gnu.emacs.help X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Original-X-Complaints-To: abuse@usenetserver.com Original-Lines: 56 Original-X-Trace: 4da72447f07d9a13a023e23416 Original-Xref: shelby.stanford.edu gnu.emacs.help:139682 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35306 Archived-At: "Kevin Rodgers" wrote in message news:mailman.2489.1149100587.9609.help-gnu-emacs@gnu.org... > B. T. Raven wrote: > > Is it possible to set the maximum length of this variable to 2? I want to > > write the from and to strings either to an association list or to a buffer > > with one dotted pair per line. Maybe this is equivalent to repeatedly > > setqing it to nil. ?? > > ,----[ C-h v history-length RET ] > | history-length is a variable defined in `C source code'. > | Its value is 30 > | > | Documentation: > | *Maximum length for history lists before truncation takes place. > | A number means that length; t means infinite. Truncation takes place > | just after a new element is inserted. Setting the history-length > | property of a history variable overrides this default. > | > | You can customize this variable. > | > | [back] > `---- > > So (put 'query-replace-history 'history-length 2) > > -- > Kevin > > > Thanks, Kevin. Now that I understand what's going on, it doesn't seem like it's worth while just to save a few hundred bytes. I had an idea to save the qrh into a saved association list, something like: (setq sal (cons (cons (cadr query-replace-history) (car query-replace-history)) sal)) The idea is to re-load this later and run query replace in batch mode on other files. I have no idea how to do this in detail but it seems possible and it would be very useful to me. Maybe instead of setting it to 2, I'll set it to t, and then then figure out how to manipulate the resulting flat list of strings after an hours' long session of query-replacing. Since for my needs this list (sal) of dotted pairs would be a few thousand elements long, it is probably not the best data structure to use. Could something along this line be done with a hash table? Thanks again, Ed.