bug-gnu-emacs
[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: Dan Jacobson
Subject: Re: comint-interrupt-subjob also kills pending input
Date: 15 Jun 2002 06:51:53 +0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

>>>>> "RMS" == Richard Stallman <rms@gnu.org> 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



reply via email to

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