all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dan Jacobson <jidanni@deadspam.com>
Subject: Re: comint-interrupt-subjob also kills pending input
Date: 15 Jun 2002 06:51:53 +0800	[thread overview]
Message-ID: <m2d6utfp86.fsf@jidanni.org> (raw)
In-Reply-To: 200206141547.g5EFlZf08916@aztec.santafe.edu

>>>>> "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	other threads:[~2002-06-14 22:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-13 21:23 comint-interrupt-subjob also kills pending input Dan Jacobson
2002-06-14 12:59 ` Miles Bader
2002-06-14 15:47 ` Richard Stallman
2002-06-14 22:51   ` Dan Jacobson [this message]
2002-06-17  2:21   ` 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-19 23:01         ` Dan Jacobson
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

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

  git send-email \
    --in-reply-to=m2d6utfp86.fsf@jidanni.org \
    --to=jidanni@deadspam.com \
    --cc=kindly_remove_this_part_first_jidanni@ms46.hinet.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.