Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
842 views
in Technique[技术] by (71.8m points)

emacs - How do I set the height of the SLIME REPL?

When I start SLIME (M-x slime), the SLIME REPL window takes up the bottom half of the frame. Is there a setting for changing the default height of the REPL? I want the REPL window to take up less than half of the height of the frame.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...