Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!sri-spam!mordor!lll-lcc!ptsfa!varian!zehntel!ed@zinfandel From: ed%zinfandel@zehntel.UUCP (Ed Hirgelt) Newsgroups: comp.emacs Subject: GNUemacs - kill-output-from-shell mods Message-ID: <143@zehntel.UUCP> Date: Thu, 12-Mar-87 19:44:53 EST Article-I.D.: zehntel.143 Posted: Thu Mar 12 19:44:53 1987 Date-Received: Sat, 14-Mar-87 10:25:26 EST Sender: news@zehntel.UUCP Reply-To: ed@zehntel.UUCP (Ed Hirgelt) Organization: Zehntel Inc., Walnut Creek CA Lines: 23 Keywords: shell-mode, kill-output-from-shell, GNUemacs The standard behavior of shell.el's kill-output-from-shell has been annoying me (version 18.36). The output flushed message behaved just like I typed is as a command and I didn't get the shell prompt for the next command. The version below solves the problem by being more careful about what it tosses away. After moving to the end of the buffer, it backs up to the start of the next line, then kills everything back to the end of the last input. Finally it moves the point back to the end of the file. (defun kill-output-from-shell () "Kill all output from shell since last input." (interactive) (goto-char (point-max)) (beginning-of-line) (kill-region last-input-end (point)) (insert "*** output flushed ***\n") (goto-char (point-max))) Ed Hirgelt Zehntel Automation Systems {ihnp4 ucbvax}!zehntel!ed 2625 Shadelands Drive zehntel!ed@Berkeley.ARPA Walnut Creek, Ca 94598