unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
@ 2015-07-27 10:46 Artur Malabarba
  2015-07-27 15:44 ` Glenn Morris
  2015-08-08  9:03 ` Eli Zaretskii
  0 siblings, 2 replies; 13+ messages in thread
From: Artur Malabarba @ 2015-07-27 10:46 UTC (permalink / raw)
  To: 21139

1. Set `comint-scroll-to-bottom-on-output` and
`comint-scroll-to-bottom-on-input` to nil via the customize interface
(or via `setq-default`)
2. Run `M-x shell`
3. Run a couple of shell commands so you have enough output to fill
the screen (`ls -al ~/` should do it).
4. Hit `C-l` twice so point is at the top of the screen.
5. Type `date` on the prompt and hit `RET`.
6. The window scrolls until point is at the bottom.


It would seem that, by setting those variables to nil, the window
should not scroll. If this is not intended to be the case, then these
variables' docstrings are unclear to me.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
  2015-07-27 10:46 bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input Artur Malabarba
@ 2015-07-27 15:44 ` Glenn Morris
  2015-07-27 17:01   ` Artur Malabarba
  2015-08-08  9:03 ` Eli Zaretskii
  1 sibling, 1 reply; 13+ messages in thread
From: Glenn Morris @ 2015-07-27 15:44 UTC (permalink / raw)
  To: bruce.connor.am; +Cc: 21139

Artur Malabarba wrote:

> 1. Set `comint-scroll-to-bottom-on-output` and
> `comint-scroll-to-bottom-on-input` to nil via the customize interface
> (or via `setq-default`)
> 2. Run `M-x shell`
> 3. Run a couple of shell commands so you have enough output to fill
> the screen (`ls -al ~/` should do it).
> 4. Hit `C-l` twice so point is at the top of the screen.
> 5. Type `date` on the prompt and hit `RET`.
> 6. The window scrolls until point is at the bottom.

I think this is a misunderstanding.
Try (in a shell buffer with more than one page of output present):

sleep 5; date

and scroll Emacs to the top of the shell buffer before the sleep ends.
Compare the behaviour with comint-move-point-for-output nil and non-nil.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
  2015-07-27 15:44 ` Glenn Morris
@ 2015-07-27 17:01   ` Artur Malabarba
  2015-07-28 19:55     ` Glenn Morris
  0 siblings, 1 reply; 13+ messages in thread
From: Artur Malabarba @ 2015-07-27 17:01 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 21139

> I think this is a misunderstanding.
> Try (in a shell buffer with more than one page of output present):
>
> sleep 5; date
>
> and scroll Emacs to the top of the shell buffer before the sleep ends.
> Compare the behaviour with comint-move-point-for-output nil and non-nil.

Thanks, that helped understant what the output variable is supposed to
do, and it does match the docstring (which explains that it's about
the point, not the window).

But what about the input variable?
If I set it to nil, the window still scrolls whenever I hit RET. And
the docstring seems to say it shouldn't:

> Controls whether input to interpreter causes window to scroll.
> If nil, then do not scroll.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
  2015-07-27 17:01   ` Artur Malabarba
@ 2015-07-28 19:55     ` Glenn Morris
  0 siblings, 0 replies; 13+ messages in thread
From: Glenn Morris @ 2015-07-28 19:55 UTC (permalink / raw)
  To: bruce.connor.am; +Cc: 21139

Artur Malabarba wrote:

> But what about the input variable?

I assume it's supposed to work like in a terminal emulator:
scroll back to look at earlier output, typing new input does not jump to
the end.
But in Emacs, when you scroll back to look at earlier output and start
typing, if this option is nil then input is entered at point, not the
end of the buffer. The whole thing seems kind of nonsensical.
It only works sensibly if the option is non-nil.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
  2015-07-27 10:46 bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input Artur Malabarba
  2015-07-27 15:44 ` Glenn Morris
@ 2015-08-08  9:03 ` Eli Zaretskii
  2015-08-08 18:01   ` Artur Malabarba
  1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2015-08-08  9:03 UTC (permalink / raw)
  To: bruce.connor.am; +Cc: 21139

> Date: Mon, 27 Jul 2015 11:46:56 +0100
> From: Artur Malabarba <bruce.connor.am@gmail.com>
> 
> 1. Set `comint-scroll-to-bottom-on-output` and
> `comint-scroll-to-bottom-on-input` to nil via the customize interface
> (or via `setq-default`)
> 2. Run `M-x shell`
> 3. Run a couple of shell commands so you have enough output to fill
> the screen (`ls -al ~/` should do it).
> 4. Hit `C-l` twice so point is at the top of the screen.
> 5. Type `date` on the prompt and hit `RET`.
> 6. The window scrolls until point is at the bottom.
> 
> 
> It would seem that, by setting those variables to nil, the window
> should not scroll. If this is not intended to be the case, then these
> variables' docstrings are unclear to me.

The variable comint-scroll-to-bottom-on-output
(a.k.a. comint-move-point-for-output) control whether _point_ moves.
In the scenario you described, point does not move, it stays at EOB.
What happens is that the window is scrolled to place point on the last
line of the window; this is controlled by another variable,
comint-scroll-show-maximum-output, which attempts to show as much of
the shell buffer as possible.  if you set it to nil, you will have
what you want in this scenario.

IOW, this doesn't look like a bug, but intended behavior, and you need
to customize another variable to have what you want.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
  2015-08-08  9:03 ` Eli Zaretskii
@ 2015-08-08 18:01   ` Artur Malabarba
  2015-08-09  2:26     ` Glenn Morris
  0 siblings, 1 reply; 13+ messages in thread
From: Artur Malabarba @ 2015-08-08 18:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 21139-done

THanks Eli. Indeed, that's what I was looking for.
I'll close this now.

2015-08-08 10:03 GMT+01:00 Eli Zaretskii <eliz@gnu.org>:
>> Date: Mon, 27 Jul 2015 11:46:56 +0100
>> From: Artur Malabarba <bruce.connor.am@gmail.com>
>>
>> 1. Set `comint-scroll-to-bottom-on-output` and
>> `comint-scroll-to-bottom-on-input` to nil via the customize interface
>> (or via `setq-default`)
>> 2. Run `M-x shell`
>> 3. Run a couple of shell commands so you have enough output to fill
>> the screen (`ls -al ~/` should do it).
>> 4. Hit `C-l` twice so point is at the top of the screen.
>> 5. Type `date` on the prompt and hit `RET`.
>> 6. The window scrolls until point is at the bottom.
>>
>>
>> It would seem that, by setting those variables to nil, the window
>> should not scroll. If this is not intended to be the case, then these
>> variables' docstrings are unclear to me.
>
> The variable comint-scroll-to-bottom-on-output
> (a.k.a. comint-move-point-for-output) control whether _point_ moves.
> In the scenario you described, point does not move, it stays at EOB.
> What happens is that the window is scrolled to place point on the last
> line of the window; this is controlled by another variable,
> comint-scroll-show-maximum-output, which attempts to show as much of
> the shell buffer as possible.  if you set it to nil, you will have
> what you want in this scenario.
>
> IOW, this doesn't look like a bug, but intended behavior, and you need
> to customize another variable to have what you want.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
  2015-08-08 18:01   ` Artur Malabarba
@ 2015-08-09  2:26     ` Glenn Morris
  2015-08-09  9:05       ` Artur Malabarba
  0 siblings, 1 reply; 13+ messages in thread
From: Glenn Morris @ 2015-08-09  2:26 UTC (permalink / raw)
  To: 21139; +Cc: bruce.connor.am

Artur Malabarba wrote:

> THanks Eli. Indeed, that's what I was looking for.
> I'll close this now.

But you previously asked about the -input functionality too, and I
agreed that it seemed broken to me.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
  2015-08-09  2:26     ` Glenn Morris
@ 2015-08-09  9:05       ` Artur Malabarba
  2015-08-09 14:49         ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Artur Malabarba @ 2015-08-09  9:05 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 21139

2015-08-09 3:26 GMT+01:00 Glenn Morris <rgm@gnu.org>:
> Artur Malabarba wrote:
>
>> THanks Eli. Indeed, that's what I was looking for.
>> I'll close this now.
>
> But you previously asked about the -input functionality too, and I
> agreed that it seemed broken to me.

True. Sorry I forgot about your message. The behaviour I was looking
for is that of `comint-scroll-show-maximum-output'. But indeed, I
still don't completely understand what that `input' variable does.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
  2015-08-09  9:05       ` Artur Malabarba
@ 2015-08-09 14:49         ` Eli Zaretskii
  2015-08-10  9:26           ` Artur Malabarba
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2015-08-09 14:49 UTC (permalink / raw)
  To: bruce.connor.am; +Cc: 21139

> Date: Sun, 9 Aug 2015 10:05:07 +0100
> From: Artur Malabarba <bruce.connor.am@gmail.com>
> Cc: 21139@debbugs.gnu.org
> 
> But indeed, I still don't completely understand what that `input'
> variable does.

AFAICS, it moves point to EOB if it is not already there, when user
input is expected.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
  2015-08-09 14:49         ` Eli Zaretskii
@ 2015-08-10  9:26           ` Artur Malabarba
  2015-08-11 18:51             ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Artur Malabarba @ 2015-08-10  9:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 21139

> 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.)





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
  2015-08-10  9:26           ` Artur Malabarba
@ 2015-08-11 18:51             ` Eli Zaretskii
  2015-08-12  5:57               ` Glenn Morris
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2015-08-11 18:51 UTC (permalink / raw)
  To: bruce.connor.am; +Cc: 21139

> Date: Mon, 10 Aug 2015 10:26:17 +0100
> From: Artur Malabarba <bruce.connor.am@gmail.com>
> Cc: Glenn Morris <rgm@gnu.org>, 21139@debbugs.gnu.org
> 
> > 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'.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
  2015-08-11 18:51             ` Eli Zaretskii
@ 2015-08-12  5:57               ` Glenn Morris
  2015-08-12 12:42                 ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Glenn Morris @ 2015-08-12  5:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 21139, bruce.connor.am

Eli Zaretskii wrote:

>   . 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.

The latter behaviour makes no sense to me, as I already said, so I filed
my own report about that (not that I expect anything to result from it).





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
  2015-08-12  5:57               ` Glenn Morris
@ 2015-08-12 12:42                 ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2015-08-12 12:42 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 21139, bruce.connor.am

> From: Glenn Morris <rgm@gnu.org>
> Cc: bruce.connor.am@gmail.com,  21139@debbugs.gnu.org
> Date: Wed, 12 Aug 2015 01:57:25 -0400
> 
> Eli Zaretskii wrote:
> 
> >   . 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.
> 
> The latter behaviour makes no sense to me, as I already said, so I filed
> my own report about that (not that I expect anything to result from it).

Which bug is that?





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-08-12 12:42 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-27 10:46 bug#21139: 25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input Artur Malabarba
2015-07-27 15:44 ` Glenn Morris
2015-07-27 17:01   ` Artur Malabarba
2015-07-28 19:55     ` Glenn Morris
2015-08-08  9:03 ` Eli Zaretskii
2015-08-08 18:01   ` Artur Malabarba
2015-08-09  2:26     ` Glenn Morris
2015-08-09  9:05       ` Artur Malabarba
2015-08-09 14:49         ` Eli Zaretskii
2015-08-10  9:26           ` Artur Malabarba
2015-08-11 18:51             ` Eli Zaretskii
2015-08-12  5:57               ` Glenn Morris
2015-08-12 12:42                 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).