help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: *shell*: annoying behavior with long output


From: Thien-Thi Nguyen
Subject: Re: *shell*: annoying behavior with long output
Date: 18 May 2004 01:07:53 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

bill <please_post@nomail.com> writes:

> Is there a way to tell the Emacs shell to keep the cursor at the
> top of the output in such a way that the top screenful of output
> is what is visible of the *shell* buffer immediately after executing
> a command?

you can try this (eval via M-: in *shell* buffer):

(local-set-key "\C-m"
  '(lambda () (interactive)
     (comint-send-input)
     (forward-char -1)
     (goto-char (if (accept-process-output nil 2)
                    (1+ (point))
                  (point-max)))))

this waits for 2 seconds.  if something shows up in that time,
move point to the head of the output, else the end of the buffer
as usual.  (this only works if your shell prompt is empty, since
`accept-process-output' does not distinguish between that kind of
output and output from the command.  sigh, heuristics...)

thi


reply via email to

[Prev in Thread] Current Thread [Next in Thread]