[Top][All Lists]

[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 <address@hidden> 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)
     (forward-char -1)
     (goto-char (if (accept-process-output nil 2)
                    (1+ (point))

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


reply via email to

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