Thread View: news.software.nn
3 messages
3 total messages
Started by Dennis Cottel
Thu, 01 Jul 1993 15:23
make save overwrite vs. append?
Author: Dennis Cottel
Date: Thu, 01 Jul 1993 15:23
Date: Thu, 01 Jul 1993 15:23
6 lines
998 bytes
998 bytes
Is there a handy way to make a save operation which will overwrite the contents of the selected file rather than appending to it? This is useful for saving the most recent version of FAQ files, etc. Dennis Cottel, dennis@nosc.mil, (619) 553-1645 NCCOSC, RDT&E Division, Code 782 Bayside, San Diego, CA 92152-5000
Re: make save overwrite vs. append?
Author: Nancy McGough
Date: Thu, 08 Jul 1993 23:38
Date: Thu, 08 Jul 1993 23:38
34 lines
2260 bytes
2260 bytes
dennis@woodstock.nosc.mil (Dennis Cottel) writes: >Is there a handy way to make a save operation which will overwrite >the contents of the selected file rather than appending to it? This >is useful for saving the most recent version of FAQ files, etc. Here's a macro (invoked with ;F) that will save the current article to a file named +FAQs/newsgroup.name.FAQ where + stands for your news directory (default is ~/News) and FAQs is the name of a subdirectory in that directory. # Next 2 lines establish semicolon (;) as macro prefix key (aliased to mac). make map mac map both ; prefix mac # Overwrite and save FAQ in +FAQs/newsgroup.name.FAQ map mac F ( ?show save-full "| cat > +FAQs/$G.FAQ" ) You might want to reset some variables so that digesting and undigesting will work on the saved article. I'm not sure what's needed because I can't find any digests to test this on, but my guess is that you might need to unset embedded-header-escape and mail-format -- does anyone know? Also, what is the definition of a digested article? Does it need to contain lines that begin with "From: " and "Subject: " in order for nn's "G %" to work on it? Ideally no one would need to save FAQs because they would be sitting in news.answers and the appropriate newsgroup not expiring until an update came along. Unfortunately this isn't the way things work... Nancy
Re: make save overwrite vs. append?
Author: Nancy McGough
Date: Sun, 11 Jul 1993 21:41
Date: Sun, 11 Jul 1993 21:41
53 lines
2492 bytes
2492 bytes
Here's a revised version of my ;F macro that asks whether you want to overwrite or append your *.FAQ folder. The append option is useful when the FAQ comes via a number of articles. I've unset embedded-header-escape so that the FAQ will be presented as a split digest when you read the folder. I don't think that you can use "G %" to split/unsplit digests in a folder -- when I try I get the message "Cannot split articles inside a folder" -- does anyone know? If you want to play around with this, a good FAQ to try it on is the one in comp.unix.questions -- it comes in 7 parts and is in digest form (i.e., contains lines that start with "Subject: " -- is that the definition of a digest?). Enjoy, Suggestions welcome, Nancy (in the midst of a macro mania!) # Next 2 lines establish semicolon (;) as macro prefix key (aliased to mac). make map mac map both ; prefix mac define 0 echo "Not available in this mode" break end # Use at end of macros that temporarily change variables. define 100 :load 2>/dev/null #Reestablish settings; don't show errors end # Overwrite and save FAQ map mac F ( ?menu macro 0 :unset embedded-header-escape macro 70 :set embedded-header-escape ~ #Restore default macro 100 #Restore non-default settings ) # 70 is ascii F (for FAQ) define 70 prompt "Do you want to overwrite +FAQs/$G.FAQ?" ?yes save-full "|cat> +FAQs/$G.FAQ" return prompt "Do you want to append +FAQs/$G.FAQ?" ?no return save-full "|cat>> +FAQs/$G.FAQ" return end
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