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

Madhu enometh at meer.net
Tue Dec 4 10:17:00 UTC 2007


* "Terrence Brannon"
| I'm wondering if there is some way to tell SLIME to not try to report
| all output  from the inferior lisp?

In addition to Gary King's suggestions, you probably could also use
DEFPARMATER, instead of SETQ, when evaluating forms via slime.  This
would return just the symbol and not the value. i.e.

(defparameter *d* (gendata))

| My emacs buffer-menu shows the
| slime-repl as huge and ever-growing:
|
|      * *slime-repl sbc: 123816001  REPL

If you were worried about buffer size and wanted to automatically
truncate the buffer, comint can do that for you. See C-h f
comint-truncate-buffer

Typically you could define a function like:

(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))

and add it to the mode hooks.

However SLIME does not use inferior-lisp-mode to start up the inferior
lisp, so you cannot add it to `inferior-lisp-mode-hook'.  Instead SLIME
uses `slime-start-lisp', but that does not [currently] call any hook
functions.  So one could resort to an an ugly hack like:

(add-hook 'comint-exec-hook
          (lambda ()
            (when (and (boundp 'name)
                       (string-match "inferior-lisp" name))
              ;;XXX hack depends on comint-exec using a parameter `name'
              (my-setup-comint-truncation))))

[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.]

--
Madhu




More information about the slime-devel mailing list