🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #8206

Re: six trn questions

#8206
From: Wayne Davison
Date: Wed, 23 Mar 1994 18:43
53 lines
2435 bytes
According to Damien Neil <damien@b63519.student.cwru.edu>:
> Is there any way to take this macro and make it the default action on
> the last page of the thread pager? -X appears to only reference the
> original meaning of a letter, not any other meaning bound by a macro.

This is an interesting oversight in [t]rn -- while you can macro what
the user types, you can't macro the command that gets entered as the
default for pressing space.  Thus, if you bound a macro to 'X' you
could type it in the thread selector, but if the 'X' command was the
default answer to pressing space it executes the old meaning of 'X'.

I've got a trial fix for this appended in the following patch.  It
makes all areas of trn re-interpret the default answer to a command
as though the user typed it.  I haven't thoroughly tested this yet
to see if it has any unexpected consequences, though it does indeed
work.
-- 
Wayne Davison
davison@borland.com
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index:rt-select.c
@@ -181,4 +181,6 @@
 #ifdef CONDSUB
     getcmd(buf);
+    if (*buf == ' ')
+	setdef(buf, sel_at_end? &end_char : &page_char);
     ch = *buf;
 #else
@@ -203,10 +205,4 @@
 	goto reinp_selector;
     }
-    if (ch == ' ') {
-	if (sel_at_end)
-	    ch = end_char;
-	else
-	    ch = page_char;
-    }
     in_select = index(sel_chars, ch);
     if (in_select) {
Index:util.c
@@ -488,8 +488,8 @@
     {
 	if (*dflt == '^' && isupper(dflt[1]))
-	    *buffer = Ctl(dflt[1]);
+	    pushchar(Ctl(dflt[1]));
 	else
-	    *buffer = *dflt;
-	lastchar = *buffer;
+	    pushchar(*dflt);
+	getcmd(buffer);
     }
 }
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Technical Details
Message-ID: <Cn4s0t.E20@borland.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!newsserver.jvnc.net!yale.edu!yale!gumby!newsxfer.itd.umich.edu!gatech!concert!decwrl!borland.com!davison
References: <2mm3ta$78k@engnews2.Eng.Sun.COM> <Cn39BB.9B7@borland.com> <2mo2e1$hbn@usenet.INS.CWRU.Edu>

Show Full Headers
Complete Article Headers
Message-ID: <Cn4s0t.E20@borland.com>
Subject: Re: six trn questions
Date: Wed, 23 Mar 1994 18:43:40 GMT
From: davison@borland.com (Wayne Davison)
References: <2mm3ta$78k@engnews2.Eng.Sun.COM> <Cn39BB.9B7@borland.com> <2mo2e1$hbn@usenet.INS.CWRU.Edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!newsserver.jvnc.net!yale.edu!yale!gumby!newsxfer.itd.umich.edu!gatech!concert!decwrl!borland.com!davison
Newsgroups: news.software.readers
Organization: Borland International
Lines: 53