Joerg Mertens <
[email protected]> writes:
Julieta Shem <[email protected]> writes:
Joerg Mertens <[email protected]> writes:
Julieta Shem <[email protected]> writes:
Speaking of which, here's something very annoying about the Python
REPL
on the GNU EMACS --- it keeps the prompt at the bottom of the
window.
If you C-l so that you move it to the middle of the screen, it goes
there, but type another expression and RET and it moves again to
the
bottom. (``Who told you to scroll?'')
There are two variables with which you can change this behaviour:
comint-scroll-to-bottom-on-output and
comint-scroll-to-bottom-on-input
I guess you want to setq them to nil.
It does look like I want to set them to nil, but so far no effect on
the
*Python* buffer, having closed it restarted it. (Thanks!)
You're right. The variables that works here (for shell mode, at least) is
comint-scroll-show-maximum-output
I also set the other two but they default to nil anyway so
they dont't change anything.
A little reflection shows that the motion is relative to the window.
It's seems more like the effect of (recenter -1). Evaluate this
function on your GNU EMACS. It'll recenter your buffer moving your
point to the base of the window.
We could now read the Python mode and see whether it recenters at any
point in the code. Indeed, we find...
--8<---------------cut here---------------start------------->8---
(defun python-comint-postoutput-scroll-to-bottom (output)
"Faster version of `comint-postoutput-scroll-to-bottom'.
Avoids `recenter' calls until OUTPUT is completely sent."
(when (and (not (string= "" output))
(python-shell-comint-end-of-output-p
(ansi-color-filter-apply output)))
(comint-postoutput-scroll-to-bottom output))
output)
(defun comint-postoutput-scroll-to-bottom (_string)
"Go to the end of buffer in some or all windows showing it.
Do not scroll if the current line is the last line in the buffer.
Depends on the value of `comint-move-point-for-output' and `comint-scroll-show-maximum-output'.
This function should be in the list `comint-output-filter-functions'."
(let* ((current (current-buffer))
(process (get-buffer-process current)))
(unwind-protect
(cond
((null process))
((bound-and-true-p follow-mode)
(follow-comint-scroll-to-bottom))
(t
(dolist (w (get-buffer-window-list current nil t))
(comint-adjust-window-point w process)
;; Optionally scroll to the bottom of the window.
(and comint-scroll-show-maximum-output
(eq (window-point w) (point-max))
(with-selected-window w
(recenter (- -1 scroll-margin)))))))
(set-buffer current))))
--8<---------------cut here---------------end--------------->8---
So the culprit is comint-scroll-show-maximum-output. I get what I like
with
(setq comint-scroll-show-maximum-output nil).
Thank you so much.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)