define append_article_save (file) { % Saves the current article to the named file, appending if the file % exists. if (is_group_mode) return (); % this only works in article mode set_input_string (file); % put filename in the response stack call ("save"); % save article (into file) } define complete_filename (file) { % Append the name of the file to ${HOME}/News/ % unless it starts with ~ or / if ((file[0] == '~') or (file[0] == '/')) return (file); Sprintf ("%s/%s/%s", getenv("HOME"), get_variable_value("save_directory"), file, 3); } define get_file_for_group (group) { % Assign a name of an output folder based on the group name. % I don't like to have all those really long file names. % If the group isn't on the list, leave it the way it is. switch (group) {case "de.comp.text.tex" : "tex.txt"; } {case "de.comp.lang.perl" : "perl-de.txt"; } {case "de.comp.os.unix.linux.misc" : "lin.txt"; } {case "de.comp.os.unix.linux.hardware" : "lin.txt"; } {case "de.comp.os.unix.x11" : "lin.txt"; } {case "comp.emacs.xemacs" : "xemacs.txt"; } {case "gnu.emacs.vm.info" : "xemacs.txt"; } {case "de.comp.os.unix" : "unix2.txt"; } {case "de.rec.tv.simpsons" : "simpsons.txt"; } {case "comp.compression" : "Wavelets.txt"; } {case "de.sci.mathematik" : "math.txt"; } {case "de.rec.music.misc" : "musik1.txt"; } {case "news.software.readers" : "slrn1.txt"; } {case "de.comp.security" : "security1.txt"; } {case "de.comm.infosystems.www.authoring" : "html1.txt"; } {case "de.comm.infosystems.www.servers" : "www1.txt"; } {case "de.comp.lang.java" : "java.txt"; } {group; } return (); } define my_save () { % Saves article into a folder based on some criteria. % Offers the folder name to edit. if (is_group_mode) return (); variable group = current_newsgroup; variable subject = strlow(extract_article_header ("Subject")); % First, pick a folder name based on group. variable file = get_file_for_group (group); % Then treat some special subjects separately. if (is_substr (subject, "jed")) file = "jed"; if (is_substr (subject, "slrn")) file = "slrn"; % Not very likely that I'll edit the name, % if I don't like it, I'll just type in a new one. file = read_mini ("Append to folder", file, ""); append_article_save (complete_filename (file)); } definekey ("my_save", "o", "article");