Index: trunk/src/libcschem/cnc_text_dyn.c =================================================================== --- trunk/src/libcschem/cnc_text_dyn.c (revision 2015) +++ trunk/src/libcschem/cnc_text_dyn.c (revision 2016) @@ -61,6 +61,22 @@ return fn; } +static const char *get_prjname(csch_sheet_t *sheet) +{ + const char *fn = sheet->hidlib.filename, *tmp, *prj; + + if (fn == NULL) + return ""; + + prj = rnd_conf_get_project_conf_name(NULL, fn, &tmp); + if (prj == NULL) + return ""; + + TODO("save project file's mtime and reload it if needed\n"); + + return ""; +} + static int csch_text_render_str_cb(void *ctx, gds_t *s, const char **input) { const csch_text_t *text = ctx; @@ -82,6 +98,10 @@ val = get_filename(text->hdr.sheet); goto append; } + if (strcmp(key, "project.name") == 0) { + val = get_prjname(text->hdr.sheet); + goto append; + } path = key; attrs = get_attribs(&path, text);