Pergunta

I love emacs and I am trying to get the best setup for python development. I am currently using elpy mode along with the python3.4 interpreter, and it works great. One thing that bugs me lately is how my prompt defaults to the middle of the buffer. There is a lot of wasted space this because of this.

Does anyone know how to tell emacs to keep my prompt at the bottom, like a normal shell prompt? I imagine it's something like:

(setq prompt-on-bottom-of-buffer t)

Here are my settings for comint-output-filter-functions:

(setq comint-output-filter-functions 'comint-truncate-buffer
                                comint-buffer-maximum-size 1000
                                comint-scroll-show-maximum-output t
                                comint-input-ring-size 500
                                comint-scroll-to-bottom-on-input t)
Foi útil?

Solução

Pretty much ;)

(setq comint-scroll-to-bottom-on-input t)

Outras dicas

Question is quite old, but there is another variable to this puzzle which is comint-move-point-for-output

And also, python-inferior-mode resets comint-output-filter-functions locally, so it's advised in documentation to rewrite/override it using inferior-python-mode-hook. Since python-inferior-mode already sets comint-postoutput-scroll-to-bottom, we only need to do one thing:

(add-hook 'inferior-python-mode-hook
  (lambda ()
    (setq comint-move-point-for-output t)))
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top