Index: trunk/src/conf_core.h =================================================================== --- trunk/src/conf_core.h (revision 5917) +++ trunk/src/conf_core.h (revision 5918) @@ -105,6 +105,8 @@ CFT_LIST preferred_gui; /* if set, try GUI HIDs in this order when no GUI is explicitly selected */ + CFT_STRING save_final_fallback_fmt;/* when a new file is created (by running pcb-rnd with the file name) there won't be a known format; pcb-rnd will guess from the file name (extension) but eventhat may fail. This format is the final fallback that'll be used if no other guessing mechanism worked. The user can override this by save as. */ + /***** automatically set (in postproc) *****/ CFT_BOOLEAN have_regex; /* whether we have regex compiled in */ struct path { Index: trunk/src/pcb-conf.lht =================================================================== --- trunk/src/pcb-conf.lht (revision 5917) +++ trunk/src/pcb-conf.lht (revision 5918) @@ -115,6 +115,7 @@ # rat_path = {} # rat_command = {} li:preferred_gui = { gtk; lesstif } + save_final_fallback_fmt = lihata } # rc ha:design { Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 5917) +++ trunk/src/plug_io.c (revision 5918) @@ -253,7 +253,6 @@ for(n = pcb_plug_io_chain; n != NULL; n = n->next) { if (n->default_extension != NULL) { int elen = strlen(n->default_extension); - printf("save cmp: %d < %d: '%s' == '%s'\n", elen , fn_len, end-elen, n->default_extension); if ((elen < fn_len) && (strcmp(end-elen, n->default_extension) == 0)) return n; } @@ -260,8 +259,14 @@ } } /* no file name or format hint, or file name not recognized: choose the ultimate default */ -#warning TODO: make this configurable - fmt = "lihata"; + fmt = conf_core.rc.save_final_fallback_fmt; + if (fmt == NULL) { + pcb_message(PCB_MSG_WARNING, "Saving a file with unknown format: failed to guess format from file name, no value configured in rc/save_final_fallback_fmt - CAN NOT SAVE FILE, try save as.\n"); + return NULL; + } + else + pcb_message(PCB_MSG_WARNING, "Saving a file with unknown format: failed to guess format from file name, falling back to %s as configured in rc/save_final_fallback_fmt\n", fmt); + } len = pcb_find_io(available, sizeof(available)/sizeof(available[0]), typ, 1, fmt);