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: William LaForest
Subject: Re: [Nethack-el-devel] Yes its perverse
Date: Tue, 14 Oct 2003 09:20:13 -0400

I just double checked to see if the cygwin compiled binary without the
nethack-el patch was working and actually had the same exact problem as
before.  I also tried your additional patch which uses explicit flushes and
did not have any luck.  (I assumed that you meant fflush(stdout) rather than
fflish(stdin)).

I'm going to give the windows console version a go next.

     -Will


----- Original Message -----
From: "Ryan Yeske" <address@hidden>
To: "William LaForest" <address@hidden>
Cc: <address@hidden>
Sent: Friday, October 10, 2003 7:36 PM
Subject: Re: [Nethack-el-devel] Yes its perverse


> "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]