all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* *shell* jumps up and down
@ 2013-03-24 17:39 Bob Proulx
  2013-03-24 18:04 ` W. Greenhouse
  0 siblings, 1 reply; 4+ messages in thread
From: Bob Proulx @ 2013-03-24 17:39 UTC (permalink / raw)
  To: help-gnu-emacs

After completion of a command the last line of the output is moved to
the last line in the buffer.  But anything that causes the buffer to
scroll causes it to center due to "Automatic Scrolling".  With short
command lines there is no problem.  But with any command line that
exceeds the width of the terminal then automatic scrolling centers
it.  The effect is that the *shell* buffer jumps up and down.

The width does not matter but assume an 80 column width for the
following test case.

  M-x shell
  $ echo Anything that is shorter than the terminal width.  All okay.
  $ M-p RET   ; all okay
  $ M-p RET   ; all okay
  $ echo Anything that is longer than the terminal width.  Causes the window to do "Automatic Scrolling" and center it.  Then RET (Enter) causes it to jump to the bottom.
  $ M-p RET   ; up, down
  $ M-p RET   ; up, down
  $ M-p RET   ; up, down

The problem is the interaction of "Automatic Scrolling" and something
in shell.el that tries to display the bottom of the buffer at the
bottom of the screen.  If I set (setq scroll-conservatively 10000)
then the problem is changed into a different behavior and mostly
avoids the jumping.  But I actually like the "Automatic Scrolling"
behavior.  What I don't like is the shell mode behavior of trying to
put the last line on the bottom of the screen.

I browsed through shell.el but couldn't see where it was doing this.
Does anyone know how to tell or modify the inferior shell process
window to not display the buffer at the very bottom and just let emacs
do what it would normally do?

Thanks,
Bob



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

* Re: *shell* jumps up and down
  2013-03-24 17:39 *shell* jumps up and down Bob Proulx
@ 2013-03-24 18:04 ` W. Greenhouse
  2013-03-24 18:38   ` Bob Proulx
  0 siblings, 1 reply; 4+ messages in thread
From: W. Greenhouse @ 2013-03-24 18:04 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Bob,

Bob Proulx <bob-5cAygf9QrE/QT0dZR+AlfA@public.gmane.org> writes:

> I browsed through shell.el but couldn't see where it was doing this.
> Does anyone know how to tell or modify the inferior shell process
> window to not display the buffer at the very bottom and just let emacs
> do what it would normally do?

Looks like it's a comint-wide problem, not just shell.el.

I did some testing, and it seems--in Emacs 24.2, anyway--that this
behavior is triggered by the combination of a `scroll-conservatively'
value of <100 and `comint-scroll-show-maximum-output' set to t (which is
the default).  Changing either of these lets Emacs scrolling behavior do
the same thing it does in the rest of Emacs.

This works in 24, anyway, but the scrolling stuff does seem to be in a
state of flux; I've noticed that erc-scrolltobottom-mode does some
jumping around now in 24, for example.  Possibly one of the NEWS items
under "Scrolling changes" covers this, but if so, I don't understand.

Best,
Will

-- 
BOFH excuse #292:

We ran out of dial tone and we're and waiting for the phone company to
deliver another bottle.




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

* Re: *shell* jumps up and down
  2013-03-24 18:04 ` W. Greenhouse
@ 2013-03-24 18:38   ` Bob Proulx
  2013-04-02 18:11     ` Bob Proulx
  0 siblings, 1 reply; 4+ messages in thread
From: Bob Proulx @ 2013-03-24 18:38 UTC (permalink / raw)
  To: help-gnu-emacs

W. Greenhouse wrote:
> Looks like it's a comint-wide problem, not just shell.el.

Ah!  Comint!  I should have looked there.  That was the right place.

> I did some testing, and it seems--in Emacs 24.2, anyway--that this
> behavior is triggered by the combination of a `scroll-conservatively'
> value of <100 and `comint-scroll-show-maximum-output' set to t (which is
> the default).  Changing either of these lets Emacs scrolling behavior do
> the same thing it does in the rest of Emacs.

The problem seems to be with comint-scroll-show-maximum-output
interacting badly with automatic scrolling.  Either by themself would
be okay.  But the combination of them together is annoying.

Thank you for pointing me to comint-scroll-show-maximum-output!  That
is the answer for my problem.  I have done this and then the annoyance
I noted is fixed.  At least so far with my minimal use and testing.

  (setq comint-scroll-show-maximum-output nil)

But for the archive I could definite see people liking the opposite
behavior desiring this opposite behavior fix.  Each to their own.

  (setq scroll-conservatively 10000)

> This works in 24, anyway, but the scrolling stuff does seem to be in a
> state of flux; I've noticed that erc-scrolltobottom-mode does some
> jumping around now in 24, for example.  Possibly one of the NEWS items
> under "Scrolling changes" covers this, but if so, I don't understand.

I tested this on Emacs 24 (Debian Unstable and Wheezy 7) and Emacs 23
(Debian Stable Squeeze 6) and both behave the same and the same fix
addresses both of them nicely.  My sanity is restored!

I haven't been using erc but have been thinking about it.  I will keep
an eye open for problems there.

Thanks!
Bob



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

* Re: *shell* jumps up and down
  2013-03-24 18:38   ` Bob Proulx
@ 2013-04-02 18:11     ` Bob Proulx
  0 siblings, 0 replies; 4+ messages in thread
From: Bob Proulx @ 2013-04-02 18:11 UTC (permalink / raw)
  To: help-gnu-emacs

Bob Proulx wrote:
> W. Greenhouse wrote:
> > I did some testing, and it seems--in Emacs 24.2, anyway--that this
> > behavior is triggered by the combination of a `scroll-conservatively'
> > value of <100 and `comint-scroll-show-maximum-output' set to t (which is
> > the default).  Changing either of these lets Emacs scrolling behavior do
> > the same thing it does in the rest of Emacs.
> 
> The problem seems to be with comint-scroll-show-maximum-output
> interacting badly with automatic scrolling.  Either by themself would
> be okay.  But the combination of them together is annoying.
> ...
> I tested this on Emacs 24 (Debian Unstable and Wheezy 7) and Emacs 23
> (Debian Stable Squeeze 6) and both behave the same and the same fix
> addresses both of them nicely.  My sanity is restored!

I tested this with an older emacs 21 and the problem does not exist
there.  This problem of comint-scroll-show-maximum-output has appears
to have been introduced in emacs 22.  It wasn't there in previous
releases.

Bob



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

end of thread, other threads:[~2013-04-02 18:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-24 17:39 *shell* jumps up and down Bob Proulx
2013-03-24 18:04 ` W. Greenhouse
2013-03-24 18:38   ` Bob Proulx
2013-04-02 18:11     ` Bob Proulx

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.