[slime-devel] Re: win32 SLIME : long time and huge buffer to generate 100, 000 data items

Madhu enometh at meer.net
Tue Dec 4 14:40:06 UTC 2007

[some mistakes here]

*  I wrote
| (defun my-setup-comint-truncation ()
|   (make-variable-buffer-local 'comint-buffer-maximum-size)
|   (make-variable-buffer-local 'comint-output-filter-functions)
|   (add-hook 'comint-output-filter-functions
|             'comint-truncate-buffer))

| [Note regarding `my-setup-comint-truncation', the variables are
|  explicitly made buffer local in so that your other comint buffers are
|  not affected.  Also the default value of comint-buffer-maximum-size is
|  1024, and this may be set in that function.]

This probably isn't the best way to do it, also the docs say:

> Do not use `make-local-variable' to make a hook variable buffer-local.
> Instead, use `add-hook' and specify t for the LOCAL argument.

So For Emacs 21+:

(defun my-setup-comint-truncation ()
  (make-variable-local 'comint-buffer-maximum-size)
  (add-hook 'comint-output-filter-functions 'comint-truncate-buffer nil t))

Otherwise, one has to use
  (make-local-hook 'comint-output-filter-functions)

More information about the slime-devel mailing list