From 7d73127461d1d8681daf9f2e0a1dcce1efd6a7a3 Mon Sep 17 00:00:00 2001 From: vsc Date: Thu, 9 Aug 2001 14:00:51 +0000 Subject: [PATCH] make Yap run under Emacs/WIN32 git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@135 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/iopreds.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/C/iopreds.c b/C/iopreds.c index 4a27b43a0..99764ee44 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -347,6 +347,8 @@ unix_upd_stream_info (StreamDesc * s) #if _MSC_VER || defined(__MINGW32__) { struct _stat buf; + char *emacs_env = getenv("EMACS"); + if (_fstat(YP_fileno(s->u.file.file), &buf) == -1) { return; } @@ -354,6 +356,11 @@ unix_upd_stream_info (StreamDesc * s) s->status |= Tty_Stream_f|Reset_Eof_Stream_f|Promptable_Stream_f; /* make all console descriptors unbuffered */ setvbuf(s->u.file.file, NULL, _IONBF, 0); + } else if (emacs_env != NULL && strcmp(emacs_env,"t") == 0) { + /* emacs communicates with sub-processes via a pipe */ + s->status |= Tty_Stream_f|Reset_Eof_Stream_f|Promptable_Stream_f; + /* make all console descriptors unbuffered */ + setvbuf(s->u.file.file, NULL, _IONBF, 0); } return; } @@ -867,7 +874,6 @@ ReadlineGetc(int sno) in_getc = TRUE; /* Do it the gnu way */ if (sigsetjmp(readline_jmpbuf, TRUE)) { - printf("hello\n"); if (PrologMode & InterruptMode) { PrologMode &= ~InterruptMode; ProcessSIGINT();