From: drya (Daniel Ryan)

Subject: Re: xemacs lisp listener buffer max size

Date: 1997-10-7 19:19


Thanks for all the responses and suggestions.

Especially to Hans whose defadvice solution (below)
works very well.

- Dan

 
> From <ISI.EDU at hans> Tue Oct 7 13:52:06 1997 > Date: Tue, 7 Oct 1997 11:49:39 -0700 > From: Hans Chalupsky <ISI.EDU at hans> > To: <mickey at dryan> (Daniel Ryan) > Cc: <cs.berkeley.edu, at allegro-cl> <n-a-n-o.com at kr> > Subject: Re: xemacs lisp listener buffer max size >
> > Exactly the problem. We have an application that must run continuously > > for *months* while still displaying output to the buffer (thus we > > can't completely turn off output), yet not eventually die because > > a buffer fills up.
>
> > - Dan
> > Try this (assuming you use the Franz ACL/Emacs interface): > > (defvar max-acl-buffer-size 1000000 > "Maximal number of output bytes saved in the ACL buffer.") > > (defadvice fi::subprocess-filter (before restrict-acl-buffer-size act pre com) > "Restrict the buffer size of the ACL buffer to about `max-acl-buffer-size'." > (let ((buffer (process-buffer (ad-get-arg 0)))) > (cond ((and buffer (eq buffer (get-buffer fi:common-lisp-buffer-name))) > (save-excursion > (set-buffer buffer) > (if (> (point-max) max-acl-buffer-size) > (delete-region > 1 (- (point-max) > (truncate (* 0.9 max-acl-buffer-size)))))))))) > > Enjoy, > > Hans > > ------------------------------------------------------------------------------ > Hans Chalupsky USC Information Sciences Institute > <isi.edu at hans> 4676 Admiralty Way > (310) 822-1511 Ext.745 Marina del Rey, CA 90292 > ------------------------------------------------------------------------------ >