Thread View: news.software.readers
17 messages
17 total messages
Started by Michael DeBusk
Tue, 05 Jun 2007 07:04
[SLRN] Custom filename for My_Posts
Author: Michael DeBusk
Date: Tue, 05 Jun 2007 07:04
Date: Tue, 05 Jun 2007 07:04
20 lines
1826 bytes
1826 bytes
In my .slrnrc is the following entry, which defines the location and filename for copies of my own posts: % Filename where articles you have posted are archived. set save_posts "news/My_Posts" At the end of each month, I rename My_Posts to My_Posts_yyyymm, with "yyyy" being the four-digit year and "mm" being the two-digit month. Then I touch a new My_Posts and start the whole thing over. I'm wondering if there's a way to configure slrn to do this without my having to think about it. The first thing that comes to mind is running the text editor in a shell script that does the job, but perhaps there might be a macro that might do a better job. Thanks for any suggestions. -- The "mypacks.net" address from which this message was sent is legitimate and not spam-trapped. It is, however, disposable.
Re: [SLRN] Custom filename for My_Posts
Author: Troy Piggins
Date: Tue, 05 Jun 2007 07:35
Date: Tue, 05 Jun 2007 07:35
34 lines
2514 bytes
2514 bytes
* Michael DeBusk is quoted & my replies are inline below :
> In my .slrnrc is the following entry, which defines the location and
> filename for copies of my own posts:
>
> % Filename where articles you have posted are archived.
> set save_posts "news/My_Posts"
>
> At the end of each month, I rename My_Posts to My_Posts_yyyymm, with
> "yyyy" being the four-digit year and "mm" being the two-digit month.
> Then I touch a new My_Posts and start the whole thing over.
>
> I'm wondering if there's a way to configure slrn to do this without my
> having to think about it. The first thing that comes to mind is running
> the text editor in a shell script that does the job, but perhaps there
> might be a macro that might do a better job.
Try something like this untested macro. Not sure about escaping
the "/" in the set_string_variable line. If it doesn't work, try
"\/" first, or even "\\/".
define monthly_myposts () {
variable tm = localtime (_time ());
set_string_variable ("save_posts", sprintf ("news/My_Posts_%04d%02d", tm.tm_year - 100, tm.tm_mon + 1));
}
define post_hook () {
() = monthly_myposts ();
}
--
Troy Piggins | http://piggo.com/~troy
slrn macros and howto: ___ | __ __ ,-O (o- O
http://piggo.com/~troy/slrn |___ | |/ |/ | O ) //\ O
RLU#415538 ___| | | | | `-O V_/_ OOO
Re: [SLRN] Custom filename for My_Posts
Author: Dan C
Date: Tue, 05 Jun 2007 13:29
Date: Tue, 05 Jun 2007 13:29
14 lines
1713 bytes
1713 bytes
On Tue, 05 Jun 2007 07:04:25 +0000, Michael DeBusk wrote: > I'm wondering if there's a way to configure slrn to do this without my > having to think about it. The first thing that comes to mind is running > the text editor in a shell script that does the job, but perhaps there > might be a macro that might do a better job. An obvious choice would be to have 'cron' do it every month. man crontab -- "Ubuntu" -- an African word, meaning "Slackware is too hard for me".
Re: [SLRN] Custom filename for My_Posts
Author: SINNER
Date: Tue, 05 Jun 2007 14:47
Date: Tue, 05 Jun 2007 14:47
19 lines
1751 bytes
1751 bytes
* Dan C wrote in news.software.readers: > On Tue, 05 Jun 2007 07:04:25 +0000, Michael DeBusk wrote: > >> I'm wondering if there's a way to configure slrn to do this without my >> having to think about it. The first thing that comes to mind is running >> the text editor in a shell script that does the job, but perhaps there >> might be a macro that might do a better job. > > An obvious choice would be to have 'cron' do it every month. > > man crontab > My thinking also. Easier to shell script it if you arent familiar with s- lang. -- David
Re: [SLRN] Custom filename for My_Posts
Author: Michael DeBusk
Date: Thu, 07 Jun 2007 17:30
Date: Thu, 07 Jun 2007 17:30
10 lines
1516 bytes
1516 bytes
On Tue, 05 Jun 2007 08:29:55 -0500, Dan C <youmustbejoking@lan.invalid> wrote: > An obvious choice would be to have 'cron' do it every month. It would be an obvious choice. I'm wondering what would happen if I had the file open at the time the cron job ran, though. -- The "mypacks.net" address from which this message was sent is legitimate and not spam-trapped. It is, however, disposable.
Re: [SLRN] Custom filename for My_Posts
Author: Adam Funk
Date: Thu, 07 Jun 2007 20:06
Date: Thu, 07 Jun 2007 20:06
39 lines
2325 bytes
2325 bytes
On 2007-06-05, Michael DeBusk wrote:
> In my .slrnrc is the following entry, which defines the location and
> filename for copies of my own posts:
>
> % Filename where articles you have posted are archived.
> set save_posts "news/My_Posts"
>
> At the end of each month, I rename My_Posts to My_Posts_yyyymm, with
> "yyyy" being the four-digit year and "mm" being the two-digit month.
> Then I touch a new My_Posts and start the whole thing over.
>
> I'm wondering if there's a way to configure slrn to do this without my
> having to think about it. The first thing that comes to mind is running
> the text editor in a shell script that does the job, but perhaps there
> might be a macro that might do a better job.
In file of macros that my .slrnrc interprets, I have the following:
define post_hook ()
{
variable tm = localtime (_time ());
set_string_variable ("save_posts",
sprintf ("/home/adam/News/sent/%d%02d%02d-%02d%02d%02d.news",
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec));
}
(and the same again in "define followup_hook" and "define
post_file_hook"), because I prefer one file for each post.
You could try like this:
set_string_variable ("save_posts",
sprintf ("/home/michael/news/My_Posts_%d%02d",
tm.tm_year + 1900, tm.tm_mon + 1));
and I think you'd get something similar to what you want.
Re: [SLRN] Custom filename for My_Posts
Author: Michael DeBusk
Date: Fri, 08 Jun 2007 05:53
Date: Fri, 08 Jun 2007 05:53
21 lines
1774 bytes
1774 bytes
On Thu, 7 Jun 2007 21:06:22 +0100, Adam Funk <a24061@ducksburg.com> wrote:
> You could try like this:
>
> set_string_variable ("save_posts",
> sprintf ("/home/michael/news/My_Posts_%d%02d",
> tm.tm_year + 1900, tm.tm_mon + 1));
>
> and I think you'd get something similar to what you want.
It does look like what I'm after, though to know for sure I'll have to
look at some s-lang docs.
I imagine I should comment out the save_posts line in my .slrnrc. Is
that correct?
Thank you kindly. :)
--
The "mypacks.net" address from which this message was sent is
legitimate and not spam-trapped. It is, however, disposable.
Re: [SLRN] Custom filename for My_Posts
Author: Michael DeBusk
Date: Fri, 08 Jun 2007 05:59
Date: Fri, 08 Jun 2007 05:59
13 lines
1711 bytes
1711 bytes
On Tue, 05 Jun 2007 17:35:41 +1000, Troy Piggins <usenet-0706@piggo.com> wrote: > Try something like this untested macro. Not sure about escaping > the "/" in the set_string_variable line. If it doesn't work, try > "\/" first, or even "\\/". You and Adam Funk suggested an almost identical solution, and it looks like exactly what I want. I guess it's time for me to look into a little s-lang programming. Thank you. (We'll see how it goes in about three weeks!) -- The "mypacks.net" address from which this message was sent is legitimate and not spam-trapped. It is, however, disposable.
Re: [SLRN] Custom filename for My_Posts
Author: Troy Piggins
Date: Fri, 08 Jun 2007 06:14
Date: Fri, 08 Jun 2007 06:14
27 lines
2274 bytes
2274 bytes
* Michael DeBusk is quoted & my replies are inline below :
> On Thu, 7 Jun 2007 21:06:22 +0100, Adam Funk <a24061@ducksburg.com> wrote:
>
>> You could try like this:
>>
>> set_string_variable ("save_posts",
>> sprintf ("/home/michael/news/My_Posts_%d%02d",
>> tm.tm_year + 1900, tm.tm_mon + 1));
>>
>> and I think you'd get something similar to what you want.
>
> It does look like what I'm after, though to know for sure I'll have to
> look at some s-lang docs.
>
> I imagine I should comment out the save_posts line in my .slrnrc. Is
> that correct?
Well, it doesn't matter. It will be set to whatever your macro
sets it to. If it was me, I'd have it set as My_Posts in
.slrnrc, and if anything ever ended up in there, you'd know to
look for a problem in your macro :)
--
Troy Piggins | http://piggo.com/~troy
slrn macros and howto: ___ | __ __ ,-O (o- O
http://piggo.com/~troy/slrn |___ | |/ |/ | O ) //\ O
RLU#415538 ___| | | | | `-O V_/_ OOO
Re: [SLRN] Custom filename for My_Posts
Author: Troy Piggins
Date: Fri, 08 Jun 2007 06:18
Date: Fri, 08 Jun 2007 06:18
34 lines
2395 bytes
2395 bytes
* Michael DeBusk is quoted & my replies are inline below : > On Tue, 05 Jun 2007 17:35:41 +1000, Troy Piggins <usenet-0706@piggo.com> wrote: > >> Try something like this untested macro. Not sure about escaping >> the "/" in the set_string_variable line. If it doesn't work, try >> "\/" first, or even "\\/". > > You and Adam Funk suggested an almost identical solution, and it looks > like exactly what I want. I guess it's time for me to look into a little > s-lang programming. Thank you. (We'll see how it goes in about three weeks!) Docs I refer to all the time: slrn: http://slrn.sourceforge.net/manual/slrn-manual.html http://slrn.sourceforge.net/docs/slrnfuns.html s-lang: http://www.s-lang.org/doc/html/slang.html http://www.s-lang.org/doc/html/cslang.html http://www.s-lang.org/doc/html/slangfun.html And to make it easier to view them from within slrn: http://piggo.com/~troy/slrn.php#manuals :) -- Troy Piggins | http://piggo.com/~troy slrn macros and howto: ___ | __ __ ,-O (o- O http://piggo.com/~troy/slrn |___ | |/ |/ | O ) //\ O RLU#415538 ___| | | | | `-O V_/_ OOO
Re: [SLRN] Custom filename for My_Posts
Author: Michael DeBusk
Date: Fri, 08 Jun 2007 07:59
Date: Fri, 08 Jun 2007 07:59
15 lines
1784 bytes
1784 bytes
On Fri, 08 Jun 2007 16:14:46 +1000, Troy Piggins <usenet-0706@piggo.com> wrote: > > I imagine I should comment out the save_posts line in my .slrnrc. Is > > that correct? > > Well, it doesn't matter. It will be set to whatever your macro > sets it to. If it was me, I'd have it set as My_Posts in > .slrnrc, and if anything ever ended up in there, you'd know to > look for a problem in your macro :) I'm trying that now. Let's find out. :) -- The "mypacks.net" address from which this message was sent is legitimate and not spam-trapped. It is, however, disposable.
Re: [SLRN] Custom filename for My_Posts
Author: Michael DeBusk
Date: Fri, 08 Jun 2007 08:02
Date: Fri, 08 Jun 2007 08:02
9 lines
1535 bytes
1535 bytes
On Fri, 08 Jun 2007 07:59:51 GMT, Michael DeBusk <chinos6398@mypacks.net> wrote: > I'm trying that now. Let's find out. :) Correction: NOW I'm trying it out. -- The "mypacks.net" address from which this message was sent is legitimate and not spam-trapped. It is, however, disposable.
Re: [SLRN] Custom filename for My_Posts
Author: Michael DeBusk
Date: Fri, 08 Jun 2007 08:04
Date: Fri, 08 Jun 2007 08:04
10 lines
1672 bytes
1672 bytes
On Fri, 08 Jun 2007 08:02:18 GMT, Michael DeBusk <chinos6398@mypacks.net> wrote: > Correction: NOW I'm trying it out. It didn't work. Still posted to the file My_Posts. I will try it now with the assignment line commented out. -- The "mypacks.net" address from which this message was sent is legitimate and not spam-trapped. It is, however, disposable.
Re: [SLRN] Custom filename for My_Posts
Author: Michael DeBusk
Date: Fri, 08 Jun 2007 08:11
Date: Fri, 08 Jun 2007 08:11
11 lines
1889 bytes
1889 bytes
On Fri, 08 Jun 2007 08:04:51 GMT, Michael DeBusk <chinos6398@mypacks.net> wrote: > It didn't work. Still posted to the file My_Posts. I will try it now > with the assignment line commented out. That still didn't work. The message did not get saved at all. I'll keep looking; maybe I made a typo somewhere. -- The "mypacks.net" address from which this message was sent is legitimate and not spam-trapped. It is, however, disposable.
Re: [SLRN] Custom filename for My_Posts
Author: Adam Funk
Date: Fri, 08 Jun 2007 09:49
Date: Fri, 08 Jun 2007 09:49
32 lines
2150 bytes
2150 bytes
On 2007-06-08, Troy Piggins wrote:
> * Michael DeBusk is quoted & my replies are inline below :
>> On Thu, 7 Jun 2007 21:06:22 +0100, Adam Funk <a24061@ducksburg.com> wrote:
>>
>>> You could try like this:
>>>
>>> set_string_variable ("save_posts",
>>> sprintf ("/home/michael/news/My_Posts_%d%02d",
>>> tm.tm_year + 1900, tm.tm_mon + 1));
>>>
>>> and I think you'd get something similar to what you want.
>>
>> It does look like what I'm after, though to know for sure I'll have to
>> look at some s-lang docs.
>>
>> I imagine I should comment out the save_posts line in my .slrnrc. Is
>> that correct?
>
> Well, it doesn't matter. It will be set to whatever your macro
> sets it to. If it was me, I'd have it set as My_Posts in
> .slrnrc, and if anything ever ended up in there, you'd know to
> look for a problem in your macro :)
I agree. I have these lines
set save_posts "News/sent/sent.news"
interpret ".slrn/macros.sl"
in ~/.slrnrc, and the stuff I pasted earlier in ~/.slrn/macros.sl, so
that sent.news would trap anything that my funny code missed (so far,
so good).
Re: [SLRN] Custom filename for My_Posts
Author: Troy Piggins
Date: Tue, 19 Jun 2007 05:03
Date: Tue, 19 Jun 2007 05:03
16 lines
2168 bytes
2168 bytes
* Michael DeBusk is quoted & my replies are inline below : > On Fri, 08 Jun 2007 08:04:51 GMT, Michael DeBusk <chinos6398@mypacks.net> wrote: > >> It didn't work. Still posted to the file My_Posts. I will try it now >> with the assignment line commented out. > > That still didn't work. The message did not get saved at all. I'll keep > looking; maybe I made a typo somewhere. Perhaps you should post what you are trying? ie post the full macro. -- Troy Piggins | http://piggo.com/~troy slrn macros and howto: ___ | __ __ ,-O (o- O http://piggo.com/~troy/slrn |___ | |/ |/ | O ) //\ O RLU#415538 ___| | | | | `-O V_/_ OOO
Re: [SLRN] Custom filename for My_Posts
Author: Michael DeBusk
Date: Thu, 28 Jun 2007 06:57
Date: Thu, 28 Jun 2007 06:57
20 lines
2126 bytes
2126 bytes
On Tue, 19 Jun 2007 15:03:32 +1000, Troy Piggins <usenet-0706@piggo.com> wrote:
> Perhaps you should post what you are trying? ie post the full macro.
This is what I last tried. I haven't done anything with it since I last
posted about it.
define post_hook ()
{
variable tm = localtime (_time ());
set_string_variable ("save_posts",
sprintf ("/home/michael/news/My_Posts_%d%02d",
tm.tm_year + 1900, tm.tm_mon + 1));
}
--
The "mypacks.net" address from which this message was sent is
legitimate and not spam-trapped. It is, however, disposable.
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