unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: comint-interrupt-subjob also kills pending input
Date: Fri, 14 Jun 2002 09:47:35 -0600 (MDT)	[thread overview]
Message-ID: <200206141547.g5EFlZf08916@aztec.santafe.edu> (raw)
In-Reply-To: <m2sn3qnaa2.fsf@jidanni.org> (message from Dan Jacobson on 14 Jun 2002 05:23:01 +0800)

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

       reply	other threads:[~2002-06-14 15:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m2sn3qnaa2.fsf@jidanni.org>
2002-06-14 15:47 ` Richard Stallman [this message]
2002-06-17  2:21   ` comint-interrupt-subjob also kills pending input Miles Bader
2002-06-18  8:10     ` Richard Stallman
2002-06-18 14:55       ` Stefan Monnier
2002-06-19  1:32       ` Miles Bader
2002-06-20 14:34         ` Richard Stallman
2002-06-20 20:02           ` Miles Bader
2002-06-22 22:52             ` Richard Stallman
2002-06-23  0:12               ` Miles Bader
2002-06-24  9:33                 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200206141547.g5EFlZf08916@aztec.santafe.edu \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).