Add CALCURSE_{EDITOR,PAGER,MERGETOOL} environment variables
Support environment variables specific to calcurse to override $EDITOR, $PAGER and $MERGETOOL. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
parent
d20f9a5d2e
commit
74d90e7cbc
12
src/vars.c
12
src/vars.c
@ -130,19 +130,25 @@ void vars_init(void)
|
||||
datefmt_str[3] = _("yyyy-mm-dd");
|
||||
|
||||
/* Default external editor and pager */
|
||||
ed = getenv("VISUAL");
|
||||
ed = getenv("CALCURSE_EDITOR");
|
||||
if (ed == NULL || ed[0] == '\0')
|
||||
ed = getenv("VISUAL");
|
||||
if (ed == NULL || ed[0] == '\0')
|
||||
ed = getenv("EDITOR");
|
||||
if (ed == NULL || ed[0] == '\0')
|
||||
ed = DEFAULT_EDITOR;
|
||||
conf.editor = ed;
|
||||
|
||||
pg = getenv("PAGER");
|
||||
pg = getenv("CALCURSE_PAGER");
|
||||
if (pg == NULL || pg[0] == '\0')
|
||||
pg = getenv("PAGER");
|
||||
if (pg == NULL || pg[0] == '\0')
|
||||
pg = DEFAULT_PAGER;
|
||||
conf.pager = pg;
|
||||
|
||||
mt = getenv("MERGETOOL");
|
||||
mt = getenv("CALCURSE_MERGETOOL");
|
||||
if (mt == NULL || mt[0] == '\0')
|
||||
mt = getenv("MERGETOOL");
|
||||
if (mt == NULL || mt[0] == '\0')
|
||||
mt = DEFAULT_MERGETOOL;
|
||||
conf.mergetool = mt;
|
||||
|
Loading…
x
Reference in New Issue
Block a user