gnu.emacs.help
[Top] [All Lists]

Re: length of query-replace-history list

Subject: Re: length of query-replace-history list
From: "B. T. Raven"
Date: Thu, 1 Jun 2006 10:29:35 -0500
Newsgroups: gnu.emacs.help
"Kevin Rodgers" <ihs_4664@xxxxxxxxx> wrote in message
news:mailman.2489.1149100587.9609.help-gnu-emacs@xxxxxxxxxx
> 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.


_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@xxxxxxx
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

<Prev in Thread] Current Thread [Next in Thread>