make Yap run under Emacs/WIN32

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@135 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2001-08-09 14:00:51 +00:00
parent 6f9edf13a4
commit 7d73127461
1 changed files with 7 additions and 1 deletions

View File

@ -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();