Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!julius.cs.uiuc.edu!wuarchive!sdd.hp.com!hplabs!otter.hpl.hp.com!hpltoad!anorman!ange From: ange@hplb.hpl.hp.com (Andy Norman) Newsgroups: comp.emacs Subject: Re: Shell output Message-ID: Date: 20 Nov 90 09:27:04 GMT References: Sender: news@hplb.hpl.hp.com (Usenet News Administrator) Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 44 In-Reply-To: kgk@cs.brown.edu's message of 18 Nov 90 20:37:36 GMT Nntp-Posting-Host: anorman.hpl.hp.com >>>>> "Keiji" == kgk@cs.brown.edu (Keiji Kanazawa) writes: Keiji> The standard behavior of GNU emacs using the supplied shell mode is Keiji> that when the cursor is not in a shell buffer, the shell output does Keiji> not scroll past the bottom of the visible portion of the buffer. Is Keiji> there some switch to make a visible shell buffer scroll, even if the Keiji> cursor is not in the shell buffer? No, but the patch below might do what you want. -- ange -- ange@hplb.hpl.hp.com (setq shell-mode-hook 'bolt-on-filter) (defun bolt-on-filter () "Add a process filter to the process attached to the current buffer." (let ((proc (get-buffer-process (current-buffer)))) (if proc (set-process-filter proc 'generic-pop-up-filter)))) (defun generic-pop-up-filter (proc str) "Handle all output from the process. If the process buffer is visible, try to keep the end on screen." (let* ((buf (process-buffer proc)) (win (get-buffer-window buf))) (if win (let ((cur (selected-window))) (unwind-protect (let (moving) (select-window win) (setq moving (= (point) (process-mark proc))) (save-excursion (goto-char (process-mark proc)) (insert str) (set-marker (process-mark proc) (point))) (if moving (goto-char (process-mark proc)))) (select-window cur))) (save-excursion (set-buffer buf) (goto-char (process-mark proc)) (insert str) (set-marker (process-mark proc) (point))))))