From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dan Jacobson Newsgroups: gmane.emacs.bugs Subject: Re: comint-interrupt-subjob also kills pending input Date: 15 Jun 2002 06:51:53 +0800 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: References: <200206141547.g5EFlZf08916@aztec.santafe.edu> Reply-To: kindly_remove_this_part_first_jidanni@ms46.hinet.net NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1024099394 32331 127.0.0.1 (15 Jun 2002 00:03:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 15 Jun 2002 00:03:14 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17J129-0008PM-00 for ; Sat, 15 Jun 2002 02:03:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17J126-0005IG-00; Fri, 14 Jun 2002 20:03:10 -0400 Original-Received: from mailbox2.ucsd.edu ([132.239.1.54]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17J0zL-0004xG-00 for ; Fri, 14 Jun 2002 20:00:19 -0400 Original-Received: from mail.fu-berlin.de (mail.fu-berlin.de [160.45.11.165]) by mailbox2.ucsd.edu (8.12.1/8.12.1) with ESMTP id g5F00Imf025480 for ; Fri, 14 Jun 2002 17:00:18 -0700 (PDT) Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Sat, 15 Jun 2002 02:00:18 +0200 (MEST) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Sat, 15 Jun 2002 02:00:17 +0200 (MEST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: 61-227-47-9.hinet-ip.hinet.NET!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 45 X-Orig-NNTP-Posting-Host: 61-227-47-9.hinet-ip.hinet.net (61.227.47.9) X-Orig-X-Trace: fu-berlin.de 1024099217 6621911 61.227.47.9 (16 [99749]) X-Orig-Path: localhost.localdomain!nobody User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:2048 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:2048 >>>>> "RMS" == Richard Stallman writes in the "devel" >>>>> group: RMS> Interrupt the current subjob. RMS> This command __also kills the pending input__ RMS> between the process-mark and point. RMS> This is for compatibility with a shell running in an ordinary terminal. RMS> Typing C-c there has the same effect. True. But maybe make a variable to avoid this if a user is picky. RMS> In Emacs, you can yank it back with M-y. You can't do that in an RMS> ordinary terminal. RMS> However, perhaps it would be better to treat that text as a previous RMS> input. It has never been sent to the shell, and should not be, but it RMS> could be treated as if it had been. RMS> Please try these two replacement functions. I did, and: let: Wrong number of arguments: #[nil ...... RMS> (defun comint-interrupt-subjob () RMS> "Interrupt the current subjob. RMS> This command also kills the pending input RMS> between the process-mark and point." RMS> (interactive) RMS> (comint-skip-input) RMS> (interrupt-process nil comint-ptyp)) RMS> (defun comint-skip-input () RMS> "Skip all pending input, from last stuff output by interpreter to point. RMS> This means mark it as if it had been sent as input, without sending it." RMS> (let ((comint-input-sender 'ignore) RMS> (comint-input-filter-functions nil)) RMS> (comint-send-input t)) RMS> (end-of-line) RMS> (let ((pos (point)) RMS> (marker (process-mark (get-buffer-process (current-buffer))))) RMS> (insert " " (key-description (this-command-keys))) RMS> (if (= marker pos) RMS> (set-marker marker (point))))) -- http://jidanni.org/ Taiwan(04)25854780