unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Incomplete input and comint-send-input
@ 2016-03-04 23:37 John Mastro
  0 siblings, 0 replies; only message in thread
From: John Mastro @ 2016-03-04 23:37 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

Hello Emacsers,

In at least some comint-derived modes, ‘comint-send-input’ seems to
behave differently when the input is incomplete. Is that right? If so,
how does it do it?

Specifically, in Emacs 25's ‘inferior-scheme-mode’, if I enter this and
press ‘RET’, the input is sent to the subprocess:

    (define (add1 n) (+ n 1))

However, if I enter this incomplete input, then ‘comint-send-input’
appears to simply enter a newline:

    (define (add1

I feel like I'm probably missing something terribly obvious, but I
stepped through ‘comint-send-input’ and didn't see anything that
behaved differently in those two cases or even tried to distinguish
between them.

The context is this[1] question on Emacs.SE, where the asker would like
to define a command that behaves like ‘newline-and-indent’ if the input
is incomplete or ‘comint-send-input’ if it is complete. The question
lead me to wonder how comint does what it does, but so far my research
has left me unenlightened.

Thanks

[1]
https://emacs.stackexchange.com/questions/20732/how-do-i-enable-indentation-in-an-inferior-scheme/

-- 
john


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-03-04 23:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-04 23:37 Incomplete input and comint-send-input John Mastro

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