Subject: Re: bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input

From: Eli Zaretskii <[email-masked]>
Date: Tue, 11 Aug 2015 21:51:45 +0300

> Date: Mon, 10 Aug 2015 10:26:17 +0100
> From: Artur Malabarba <[email-masked]>
> Cc: Glenn Morris <[email-masked]>, [email-masked]
> 
> > AFAICS, it moves point to EOB if it is not already there, when user
> > input is expected.
> 
> What's an exmaple of 'input is expected'? When the shell prompt is displayed?
> 
> I've set all 3 variables to nil, but my cursor is still moved to the
> end of the buffer when the output+prompt are displayed, no matter
> where it was before. (Tested by runnning 'sleep 2; date' and then
> moving the point around.)

Not sure why you consider the scenario you described relevant for what
comint-scroll-to-bottom-on-input controls.  The scenario that I think
is relevant is this:

  . M-x shell
  . move point back to some place in the buffer other than the last
    shell prompt
  . type something

When comint-scroll-to-bottom-on-input is non-nil, point moves to the
last shell prompt before your input is inserted; when the variable is
nil, whatever you type is inserted where point was, without moving it
anywhere.

This behavior seems consistent with the doc string of
comint-preinput-scroll-to-bottom, the only function that references
that variable:

    Go to the end of buffer in all windows showing it.
  Movement occurs if point in the selected window is not after the process mark,
  and `this-command' is an insertion command.  Insertion commands recognized
  are `self-insert-command', `comint-magic-space', `yank', and `hilit-yank'.
  Depends on the value of `comint-scroll-to-bottom-on-input'.