diff options
Diffstat (limited to 'src/core-commands.c')
| -rw-r--r-- | src/core-commands.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/core-commands.c b/src/core-commands.c index e0b2f89..47809e2 100644 --- a/src/core-commands.c +++ b/src/core-commands.c @@ -2151,6 +2151,11 @@ teco_state_ecommand_flags(teco_machine_main_t *ctx, GError **error) * .IP 5: * Height of the command line view in lines. * Must not be smaller than 1. + * .IP 6: + * Backup interval in seconds or 0 if backups are disabled. + * After changing the interval, the new value may become + * active only after the previous interval expires. + * Backups are not created in batch mode. * . * .IP -1: * Type of the last mouse event (\fBread-only\fP). @@ -2204,7 +2209,8 @@ teco_state_ecommand_properties(teco_machine_main_t *ctx, GError **error) EJ_MEMORY_LIMIT, EJ_INIT_COLOR, EJ_CARETX, - EJ_CMDLINE_HEIGHT + EJ_CMDLINE_HEIGHT, + EJ_BACKUP_INTERVAL }; static teco_int_t caret_x = 0; @@ -2255,6 +2261,17 @@ teco_state_ecommand_properties(teco_machine_main_t *ctx, GError **error) teco_undo_guint(teco_cmdline.height) = value; break; + case EJ_BACKUP_INTERVAL: + if (value < 0 || value > G_MAXUINT) { + g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED, + "Invalid backup interval %" TECO_INT_FORMAT "s " + "for <EJ>", value); + return; + } + teco_undo_guint(teco_ring_backup_interval) = value; + /* FIXME: Perhaps signal the interface to reprogram timers */ + break; + default: g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED, "Cannot set property %" TECO_INT_FORMAT " " @@ -2314,6 +2331,10 @@ teco_state_ecommand_properties(teco_machine_main_t *ctx, GError **error) teco_expressions_push(teco_cmdline.height); break; + case EJ_BACKUP_INTERVAL: + teco_expressions_push(teco_ring_backup_interval); + break; + default: g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED, "Invalid property %" TECO_INT_FORMAT " " |
