Index: trunk/src/sch-rnd/build_run.c =================================================================== --- trunk/src/sch-rnd/build_run.c (revision 2546) +++ trunk/src/sch-rnd/build_run.c (revision 2547) @@ -37,6 +37,8 @@ #include #include +#include "emergency.h" + extern void sch_rnd_main_uninit(void); void csch_quit_app(void) @@ -44,13 +46,7 @@ /* save data if necessary. It not needed, then don't trigger EmergencySave * via our atexit() registering of csch_emergency_save(). We presumably wanted to * exit here and thus it is not an emergency. */ -TODO("implemnent this, but for multiple sheets:"); -#if 0 - if (sheet->changed && conf_core.editor.save_in_tmp) - csch_emergency_save(); - else - csch_disable_emergency_save(); -#endif + sch_rnd_emergency_save(); if (rnd_gui->do_exit == NULL) { sch_rnd_main_uninit(); Index: trunk/src/sch-rnd/conf_core.h =================================================================== --- trunk/src/sch-rnd/conf_core.h (revision 2546) +++ trunk/src/sch-rnd/conf_core.h (revision 2547) @@ -10,7 +10,7 @@ RND_CFT_INTEGER backup_interval; /* TODO: time between two backups in seconds; 0 means disabled (no backups) */ RND_CFT_LIST library_search_paths; /* TODO: ordered list of paths that are each recursively searched for symbol files */ - RND_CFT_STRING emergency_name; /* TODO: file name template for emergency save anonymous .sch files (when sch-rnd crashes); optional field: %ld --> pid; must be shorter than 240 characters. Don't do emergency save if this item is empty. */ + RND_CFT_STRING emergency_name; /* file name template for emergency save anonymous .sch files (when sch-rnd crashes); optional field: first %ld --> pid, second %ld --> sheet uid; must be shorter than 240 characters. Don't do emergency save if this item is empty. */ RND_CFT_STRING backup_name; /* TODO: file name template for periodic backup of board files; optional fields (the usual % substitutions work) */ RND_CFT_BOOLEAN keep_save_backups; /* TODO: a copy is made before a save operation overwrites an existing file; if this setting is true, keep the copy even after a successful save */ Index: trunk/src/sch-rnd/sch-rnd-conf.lht =================================================================== --- trunk/src/sch-rnd/sch-rnd-conf.lht (revision 2546) +++ trunk/src/sch-rnd/sch-rnd-conf.lht (revision 2547) @@ -18,6 +18,7 @@ {/usr/share/fonts/truetype} {/usr/local/share/fonts/truetype} } + emergency_name = {SCH.%ld-%ld.save} ha:debug { draw_text_bbox = 0 draw_arc_bbox = 0