From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: comint-interrupt-subjob also kills pending input Date: Fri, 14 Jun 2002 09:47:35 -0600 (MDT) Sender: emacs-devel-admin@gnu.org Message-ID: <200206141547.g5EFlZf08916@aztec.santafe.edu> References: Reply-To: rms@gnu.org NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1024069799 8445 127.0.0.1 (14 Jun 2002 15:49:59 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 14 Jun 2002 15:49:59 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17ItKp-0002C6-00 for ; Fri, 14 Jun 2002 17:49:59 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17Itje-0007dU-00 for ; Fri, 14 Jun 2002 18:15:38 +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 17ItKa-0002uw-00; Fri, 14 Jun 2002 11:49:44 -0400 Original-Received: from pele.santafe.edu ([192.12.12.119]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17ItIW-0002as-00; Fri, 14 Jun 2002 11:47:36 -0400 Original-Received: from aztec.santafe.edu (aztec [192.12.12.49]) by pele.santafe.edu (8.11.6+Sun/8.11.6) with ESMTP id g5EFlZQ10901; Fri, 14 Jun 2002 09:47:35 -0600 (MDT) Original-Received: (from rms@localhost) by aztec.santafe.edu (8.10.2+Sun/8.9.3) id g5EFlZf08916; Fri, 14 Jun 2002 09:47:35 -0600 (MDT) X-Authentication-Warning: aztec.santafe.edu: rms set sender to rms@aztec using -f Original-To: jidanni@ms46.hinet.net In-Reply-To: (message from Dan Jacobson on 14 Jun 2002 05:23:01 +0800) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:4864 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:4864 Interrupt the current subjob. This command __also kills the pending input__ between the process-mark and point. This is for compatibility with a shell running in an ordinary terminal. Typing C-c there has the same effect. In Emacs, you can yank it back with M-y. You can't do that in an ordinary terminal. However, perhaps it would be better to treat that text as a previous input. It has never been sent to the shell, and should not be, but it could be treated as if it had been. Please try these two replacement functions. (defun comint-interrupt-subjob () "Interrupt the current subjob. This command also kills the pending input between the process-mark and point." (interactive) (comint-skip-input) (interrupt-process nil comint-ptyp)) (defun comint-skip-input () "Skip all pending input, from last stuff output by interpreter to point. This means mark it as if it had been sent as input, without sending it." (let ((comint-input-sender 'ignore) (comint-input-filter-functions nil)) (comint-send-input t)) (end-of-line) (let ((pos (point)) (marker (process-mark (get-buffer-process (current-buffer))))) (insert " " (key-description (this-command-keys))) (if (= marker pos) (set-marker marker (point)))))