In emacs you may use fit-window-to-buffer and call it (or a function using it) from a hook:
(defun flux-fit-slime-repl ()
;; uncomment the following line:
;; (interactive)
;; if you want to call
;; flux-fit-slime-repl yourself to experiment
(fit-window-to-buffer))
(add-hook 'slime-connected-hook 'flux-fit-slime-repl 'append)
The final argument to add-hook above, append
, asks that this hook be placed at the end of the slime-connected hooks as we want slime to be done printing the welcome before we resize.
If you'd rather call fit-window-to-buffer
from the lisp side, you could
allow swank to send code to emacs by customizing slime-enable-evaluate-in-emacs
in emacs prior to calling this in the slime repl:
(swank::eval-in-emacs '(swank-io-package::fit-window-to-buffer))
Add the line above to ~/.swank.lisp
in order to have it evaluated when slime starts.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…