Thread View: news.software.readers
3 messages
3 total messages
Started by John E. Davis
Sun, 13 Jul 1997 00:00
Re: slrn macro - file save?
Author: John E. Davis
Date: Sun, 13 Jul 1997 00:00
Date: Sun, 13 Jul 1997 00:00
26 lines
1302 bytes
1302 bytes
On 13 Jul 1997 06:12:30 GMT, Bek Oberin <gossamer@glasswings.com.au>
wrote:
>I'm trying to write what I assumed would be a very simple
>macro - I want to append the current article to a specific
>file (/home/gossamer/quotes/new).
There are several ways to do this. One is to use the intrinsic
function `article_as_string' and then use slang intrinsics fopen,
fclose, and fputs to write to the file, e.g.,
define my_save_article ()
{
variable fp, str;
str = article_as_string ();
fp = fopen ("/home/gossamer/quotes/new", "a");
() = fputs (str, fp);
() = fclose (fp);
}
Another is to pipe the article to 'cat >> /home/gossamer/quotes/new'.
--John
Re: slrn macro - file save?
Author: Byrial Jensen
Date: Wed, 16 Jul 1997 00:00
Date: Wed, 16 Jul 1997 00:00
54 lines
2279 bytes
2279 bytes
Bek Oberin <gossamer@glasswings.com.au> wrote:
>define startup_hook ()
>{
> % fix header window size
> if ( SCREEN_HEIGHT <= 30 )
> {
> set_article_window_size ( SCREEN_HEIGHT - 7 );
> message(Sprintf ("Screen height: %d", SCREEN_HEIGHT, 1));
> }
>}
>
>I prefer a 3-line header window when I'm in a shorter screen, to leave
>more room for the message. Only that isn't working and I can't figure
>out why. It correctly print "Screen height: 30" on the status line,
>but doesn't set the article window size :(
Some variables relating to window sizes are only initialized then the
article window is created for the first time. Therefore unfortunately
set_article_window_size have no effect when it is called from
startup_hook or even from the initial call of resize_screen_hook.
I had a little doubt about how to fix this, but try to change your
startup_hook to a resize_screen_hook, and apply the following patch.
Regards,
- Byrial
--- art.c.org Wed Jul 16 10:36:15 1997
+++ art.c Wed Jul 16 20:29:51 1997
@@ -263,7 +263,19 @@
/*{{{ SIGWINCH and window resizing functions */
static void art_winch (void) /*{{{*/
{
- static int rows;
+ static int rows = 0;
+
+#if SLRN_HAS_SLANG
+ /* Check to see if rows is still 0. If so, this is the first
+ * call here and we should run resize_screen_hook to allow it
+ * to change the initial Article_Window_Nrows.
+ */
+ if (rows == 0)
+ {
+ rows = SLtt_Screen_Rows;
+ SLang_run_hooks ("resize_screen_hook", NULL, NULL);
+ }
+#endif
if ((rows != SLtt_Screen_Rows)
|| (Article_Window_Nrows <= 0)
Re: slrn macro - file save?
Author: A. Deckers
Date: Fri, 18 Jul 1997 00:00
Date: Fri, 18 Jul 1997 00:00
17 lines
1214 bytes
1214 bytes
In <slrn5sup00.551.gossamer@penguin.glasswings.com.au>, Bek Oberin <gossamer@glasswings.com.au> wrote: [...] >JED, is this something you can work into the regular SLRN? I'll >get withdrawal symptoms if it stops working next time I upgrade! >*grins* JED's away/on holidays for the next 3 weeks or so. IIRC the lastest slrn release announcement included words to this effect. Alain -- I-hate-cyber-promo@man.ac.uk (Alain Deckers)
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