🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
2 messages
2 total messages Started by Yeechang Lee Thu, 03 Nov 1994 02:56
How do I use % and MAILCALL?
#12337
Author: Yeechang Lee
Date: Thu, 03 Nov 1994 02:56
17 lines
1466 bytes
Okay, I'm using trn 3.3 under SunOS and put

-EMAILCALL="%`mw -f -C`"

into my .trnrc.  mw -f -C is a command that returns the number of unread
mail messages in my inbox, and I wanted the number of messages printed
instead of the default (Mail) to indicate when a new message arrived. 
However, I instead get the literal string

%`mw -f -C===   xyz messages unread in news.software.readers == read?

(in reverse video, of course.)

What am I doing wrong?  Will appreciate any and all answers.
--   __________________________________________________________________
     Yeechang Lee  (ycl6@columbia.edu)|Nevada Las Vegas Mission 1992-94
     Columbia University/New York City|Celestial Kingdom with Taco Bell
Re: How do I use % and MAILCALL?
#12358
Author: Wayne Davison
Date: Thu, 03 Nov 1994 18:58
51 lines
2642 bytes
According to Yeechang Lee <ycl6@columbia.edu>:
> -EMAILCALL="%`mw -f -C`"

At the moment the string isn't interp'ed, it's just copied into the
prompt line via printf.  I just twiddled the code to enhace this,
and it seems to be ok.  Keep in mind that this command will get
executed at lots of prompts once you receive mail, so don't make
it too slow.

The appended patch will let you check it out.  This is based on
my current source, so don't worry if the line numbers are wrong.
-- 
Wayne Davison
davison@borland.com
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index:art.c
@@ -1010,8 +1010,9 @@
 	    setdfltcmd();
 	    standout();		/* enter standout mode */
+	    interp(buf, sizeof buf, mailcall);
 #ifdef CHARSUBST
-	    printf(prompt,mailcall,current_charsubst(),dfltcmd);
+	    printf(prompt,buf,current_charsubst(),dfltcmd);
 #else
-	    printf(prompt,mailcall,dfltcmd);
+	    printf(prompt,buf,dfltcmd);
 #endif
 			    /* print prompt, whatever it is */
Index:ng.c
@@ -360,8 +360,9 @@
 	standout();			/* enter standout mode */
 	/* print prompt, whatever it is */
+	interp(buf, sizeof buf, mailcall);
 #ifdef CHARSUBST
-	printf(prompt,mailcall,current_charsubst(),dfltcmd);
+	printf(prompt,buf,current_charsubst(),dfltcmd);
 #else
-	printf(prompt,mailcall,dfltcmd);
+	printf(prompt,buf,dfltcmd);
 #endif
 	un_standout();			/* leave standout mode */
Index:rt-select.c
@@ -242,5 +242,6 @@
 		(long)((sel_prior_arts+sel_page_arts)*100 / sel_total_arts),
 		page_char, end_char);
-    sprintf(promptbuf, "%s-- %s %s (%s%s order) -- %s", mailcall,
+    interp(buf, sizeof buf, mailcall);
+    sprintf(promptbuf, "%s-- %s %s (%s%s order) -- %s", buf,
 	    sel_exclusive? "SELECTED" : "Select", sel_mode_string,
 	    sel_direction<0? "reverse " : nullstr, sel_sort_string, cmd_buf);
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads