From tiltonj@erols.com Wed Oct 24 13:51:59 2001
Path: ulcc.ac.uk!server3.netnews.ja.net!newspeer.clara.net!news.clara.net!feed2.onemain.com!feed1.onemain.com!feeder.qis.net!feed2.news.rcn.net!feed1.news.rcn.net!rcn!not-for-mail
From: tiltonj@erols.com (Jay Tilton)
Newsgroups: rec.games.roguelike.nethack
Subject: Re: /oC in BoH: explosion not in ^P
Date: Wed, 24 Oct 2001 03:43:42 GMT
Organization: none yet
Lines: 72
Message-ID: <3bd6382e.336372473@news.erols.com>
References: <87snci6oiu.fsf@dgp.toronto.edu> <3bce0f6d_4@news1.prserv.net> <87d73l6fd7.fsf@dgp.toronto.edu> <3bcf6589.472552741@news.erols.com> <walker.1003503648@cantina.clinet.fi>
X-Trace: UmFuZG9tSVYoOB1/PT7K3E1aIzSGnGHHbloLE0H7GXSAzf0JZZh1q4ssaIqe8rrT
X-Complaints-To: abuse@rcn.com
NNTP-Posting-Date: 24 Oct 2001 03:44:07 GMT
X-Newsreader:  Forte Free Agent 1.21/32.243
Xref: ulcc.ac.uk rec.games.roguelike.nethack:149976

On 19 Oct 2001 18:08:33 +0300, Jukka Lahtinen <walker@clinet.fi.no.sp.am.invalid> wrote:

[Synopsis: patching vanilla so all messages go to ^P history,
even after cancelling --More-- by pressing <ESC>.]

>Even if some interfaces don't use win/tty/topl.c, at least a patch done
>there will not harm those interfaces any way. 
>It just wouldn't affect them any way.
>
>So, just go ahead.

Fair enough.  Here's a diff.  It changes a couple of tests for
cancelled message window that would preclude all processing of a
new message, i.e. concatenating short lines, adding the old line
to the history, putting breaks in the new line, and finally
displaying the message.  The desired behavior would be to do all
that, but suppress the actual display if messages have been
cancelled, which the code takes care of already.

diff -auwr nethack-3.3.1-orig\win\tty\topl.c nethack-3.3.1-test\win\tty\topl.c
--- nethack-3.3.1-orig\win\tty\topl.c	Sun Jan 30 14:24:48 2000
+++ nethack-3.3.1-test\win\tty\topl.c	Sun Oct 21 16:53:40 2001
@@ -147,7 +147,8 @@
 	/* If there is room on the line, print message on same line */
 	/* But messages like "You die..." deserve their own line */
 	n0 = strlen(bp);
-	if(ttyDisplay->toplin == 1 && cw->cury == 0 &&
+	if(	(ttyDisplay->toplin == 1 || cw->flags & WIN_STOP) &&
+		cw->cury == 0 &&
 	    n0 + (int)strlen(toplines) + 3 < CO-8 &&  /* room for --More-- */
 	    (notdied = strncmp(bp, "You die", 7))) {
 		Strcat(toplines, "  ");
@@ -156,7 +157,8 @@
 		if(!(cw->flags & WIN_STOP))
 		    addtopl(bp);
 		return;
-	} else if(!(cw->flags & WIN_STOP)) {
+	}
+	if(!(cw->flags & WIN_STOP)) {
 	    if(ttyDisplay->toplin == 1) more();
 	    else if(cw->cury) {	/* for when flags.toplin == 2 && cury > 1 */
 		docorner(1, cw->cury+1); /* reset cury = 0 if redraw screen */
diff -auwr nethack-3.3.1-orig\win\tty\wintty.c nethack-3.3.1-test\win\tty\wintty.c
--- nethack-3.3.1-orig\win\tty\wintty.c	Fri Jul 21 20:59:28 2000
+++ nethack-3.3.1-test\win\tty\wintty.c	Sun Oct 21 16:52:52 2001
@@ -1703,8 +1703,10 @@
 	return;
     }
 
-    if(str == (const char*)0 || (cw->flags & WIN_CANCELLED))
-	return;
+    if( str == (const char*)0 ||
+        /* Ignore cancel for message, but not others */
+        ( (cw->flags & WIN_CANCELLED) && (cw->type != NHW_MESSAGE) )
+    ) return;
     if(cw->type != NHW_MESSAGE)
 	str = compress_str(str);
 
 

>With Pasi Kallinen's alternative tty_doprev_message in
>the same source file 

The one in the thread "tips for a Qt/X11 -> tty convert?"
that spews the whole message history to screen?

Pasi may not wish to accept blame for that one.  :) 

Especially since it introduces a bug that can adversely affect
gameplay, as well as a couple irritating glitches.  See my new
followup under that thread for the new fix.


