T.83.0: remove 'mark-interrupt' command

There's no point having both 'interrupt' and 'mark-interrupt', as it only
ever makes sense to use one or the other depending on the current timer
state.  Merge them into a single command (interrupt), and for compatibility
bind both 'R' and 'r' to that command.
This commit is contained in:
Felicity Tarnell 2014-03-05 15:55:06 +00:00
parent d9223f4603
commit 3560996263
4 changed files with 41 additions and 32 deletions

28
tts.c
View file

@ -250,7 +250,6 @@ static void ksync(void);
static void kexec(void);
static void kmerge(void);
static void kint(void);
static void kmarkint(void);
typedef struct function {
const WCHAR *fn_name;
@ -283,7 +282,6 @@ static function_t funcs[] = {
{ WIDE("execute"), kexec, WIDE("execute a configuration command") },
{ WIDE("merge"), kmerge, WIDE("merge marked entries into current entry") },
{ WIDE("interrupt"), kint, WIDE("split current entry into new entry")},
{ WIDE("mark-interrupt"), kmarkint, WIDE("start interrupt timer for current entry")}
};
typedef struct tkey {
@ -679,7 +677,7 @@ char rcfile[PATH_MAX + 1];
bind_key(WIDE("<DOWN>"), WIDE("next"));
bind_key(WIDE(":"), WIDE("execute"));
bind_key(WIDE("M"), WIDE("merge"));
bind_key(WIDE("r"), WIDE("mark-interrupt"));
bind_key(WIDE("r"), WIDE("interrupt"));
bind_key(WIDE("R"), WIDE("interrupt"));
/*
@ -1426,6 +1424,16 @@ time_t duration;
entry_t *en;
WCHAR *name;
if (!itime) {
if (!running) {
drawstatus(WIDE("No running entry."));
return;
}
itime = time(NULL);
return;
}
if (!running) {
drawstatus(WIDE("No running entry."));
return;
@ -1462,20 +1470,6 @@ WCHAR *name;
free(name);
}
void
kmarkint()
{
if (itime) {
kint();
} else {
if (!running) {
drawstatus(WIDE("No running entry."));
return;
}
itime = time(NULL);
}
}
void
ksearch()
{