emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: comint-interrupt-subjob also kills pending input


From: Richard Stallman
Subject: Re: comint-interrupt-subjob also kills pending input
Date: Fri, 14 Jun 2002 09:47:35 -0600 (MDT)

    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 via email to

[Prev in Thread] Current Thread [Next in Thread]