nethack-el-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nethack-el-devel] Yes its perverse


From: Ryan Yeske
Subject: Re: [Nethack-el-devel] Yes its perverse
Date: 10 Oct 2003 16:36:23 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

"William LaForest" <address@hidden> writes:

> But unfortunately I am forced to use Windows on my machine.  I have
> been trying to get nethack.el to work but have not had much success.
> 
> With some work I was able to get nethack to compile and install the
> unix version under cygwin (after I used the approprate nethack-el
> source patch of course).  When I start it up from rxvt I don't get
> anything at all but I assumed this might be because it was compile for
> "lisp graphics".  The problem is that I am getting the same sort of
> thing under emacs.  It runs the process but nothing seems to happen.
> If I run the nethack mode again in emacs I get a message saying that
> "Nethack process already running..."
> 
> Perhaps I should have compiled the winnt version instead?  I'm not
> sure.... Has anyone out there done this or have any ideas?

Hey Will,

Thanks for the report.  I think there was mention of this exact same
thing before, I don't know if that person solved the problem.

BTW, if you run nethack from the commandline, you should see output;
there's no need to try it in emacs to see that its failing.

You should see something like: 
...
(nhapi-yn-function "Shall I pick a character for you? [ynq] " "ynq" 121 )
...

Maybe the winnt version would work, but I can see no reason that the
cygwin version shouldnt work as well.

A wild guess is that output is not being flushed...  under linux, at
least, stdout seems to be automatically flushed when stdin is read.

Try applying the patch below which will explicitly flush stdout before
reading stdin.

If that doesn't work, could you perhaps run nethack through gdb at see
whats going on?

Ryan




Index: winlisp.c
===================================================================
RCS file: /usr/local/cvsroot/nethack/win/lisp/winlisp.c,v
retrieving revision 1.61
diff -c -r1.61 winlisp.c
*** winlisp.c   2003/09/19 20:29:10     1.61
--- winlisp.c   2003/10/10 23:33:02
***************
*** 436,441 ****
--- 436,442 ----
    char line[BUFSZ];
    int rv;
    printf ("%s> ", prompt);
+   fflush(stdin);
    fgets (line, BUFSZ, stdin);
    rv = sscanf (line, "%d", i);
    if (rv != 1) *i = -1;
***************
*** 458,463 ****
--- 459,465 ----
    (*str)[0] = '\0';
  
    printf ("%s> ", prompt);
+   fflush(stdin);
  
    do
      {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]