all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Sending EOF in process-send-string
@ 2009-12-01 21:27 Stefan Monnier
  2009-12-03  1:23 ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2009-12-01 21:27 UTC (permalink / raw)
  To: emacs-devel

Could someone explain to me exactly why

	  /* If we sent just part of the string, put in an EOF (C-d)
	     to force it through, before we send the rest.  */
	  if (len > 0)
	    Fprocess_send_eof (proc);

is the right thing to do in process.c:send_process ?

I have no knowledge of tty programming, but reading the tcsetattr
manpage, I get the impression that this EOF char only needs to be sent
if the tty is in ICANON mode (and even then, it's not necessary for
correctness, but only to make our text immediately `read'able to the
other end without having to wait for an EOL).  Apparently in ICANON
mode, this EOF char will not be passed on to the other end, so it seems
OK to send it.

OTOH, if the tty is in raw mode, the EOF char will be seen by the other
end, which is not what we want (and seems to be a cause of bugs in
inferior-process modes, worked around in various ways, typically with
something like "use a temp file is the input is too long").

A related question is: why does child_setup_tty set ICANON even though
the comments say "It should not echo or do line-editing, since that is done
in Emacs".


        Stefan "who's tempted to remove both the Fprocess_send_eof and
                the setting to ICANON"




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Sending EOF in process-send-string
  2009-12-01 21:27 Sending EOF in process-send-string Stefan Monnier
@ 2009-12-03  1:23 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2009-12-03  1:23 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Maybe you are right that the EOF is needed only in certain modes.
I remember struggling to find a way to deal with the condition in
which the tty and Emacs are both waiting and the buffer is full.

    A related question is: why does child_setup_tty set ICANON even though
    the comments say "It should not echo or do line-editing, since that is done
    in Emacs".

Unforunately I don't remember the answer to that.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-03  1:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-01 21:27 Sending EOF in process-send-string Stefan Monnier
2009-12-03  1:23 ` Richard Stallman

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.