unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: John Mastro <john.b.mastro@gmail.com>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Incomplete input and comint-send-input
Date: Fri, 4 Mar 2016 15:37:08 -0800	[thread overview]
Message-ID: <CAOj2CQQFNj3ULsM2z_-pV4xAUq4_t-vpGyzVYJ6T+H+WAfQi1A@mail.gmail.com> (raw)

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


                 reply	other threads:[~2016-03-04 23:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAOj2CQQFNj3ULsM2z_-pV4xAUq4_t-vpGyzVYJ6T+H+WAfQi1A@mail.gmail.com \
    --to=john.b.mastro@gmail.com \
    --cc=help-gnu-emacs@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.
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).