From 6e3da17a2fae11af9ae00d9b59bd0d752022e16b Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 24 May 2025 16:24:49 +0300 Subject: has been repurposed and is the macro file inclusion (indirect file) command now * Improves DEC TECO-11 compatibility. * is still supported as a synonym, but considered deprecated and is no longer documented. A warning is printed when invoked. It can be repurposed at any time in the future. * `EI$` is not yet supported. I am unsure whether this makes any sense. --- src/core-commands.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to 'src/core-commands.c') diff --git a/src/core-commands.c b/src/core-commands.c index e410742..bb731a1 100644 --- a/src/core-commands.c +++ b/src/core-commands.c @@ -630,7 +630,7 @@ teco_state_start_input(teco_machine_main_t *ctx, gunichar chr, GError **error) ['"'] = {&teco_state_condcommand}, ['E'] = {&teco_state_ecommand, .modifier_at = TRUE, .modifier_colon = 2}, - ['I'] = {&teco_state_insert_building, + ['I'] = {&teco_state_insert_plain, .modifier_at = TRUE}, ['?'] = {&teco_state_help, .modifier_at = TRUE}, @@ -2608,6 +2608,13 @@ teco_state_ecommand_exit(teco_machine_main_t *ctx, GError **error) teco_undo_gboolean(teco_quit_requested) = TRUE; } +static void +teco_state_macrofile_deprecated(teco_machine_main_t *ctx, GError **error) +{ + teco_interface_msg(TECO_MSG_WARNING, + " command is deprecated - use instead"); +} + static teco_state_t * teco_state_ecommand_input(teco_machine_main_t *ctx, gunichar chr, GError **error) { @@ -2623,9 +2630,10 @@ teco_state_ecommand_input(teco_machine_main_t *ctx, gunichar chr, GError **error .modifier_at = TRUE, .modifier_colon = 1}, ['G'] = {&teco_state_egcommand, .modifier_at = TRUE, .modifier_colon = 1}, - ['I'] = {&teco_state_insert_nobuilding, - .modifier_at = TRUE}, - ['M'] = {&teco_state_macrofile, + ['I'] = {&teco_state_indirect, + .modifier_at = TRUE, .modifier_colon = 1}, + /* DEPRECATED: can be repurposed */ + ['M'] = {&teco_state_indirect, teco_state_macrofile_deprecated, .modifier_at = TRUE, .modifier_colon = 1}, ['N'] = {&teco_state_glob_pattern, .modifier_at = TRUE, .modifier_colon = 1}, @@ -2777,21 +2785,7 @@ teco_state_insert_done(teco_machine_main_t *ctx, const teco_string_t *str, GErro * may be better, since it has string building characters * disabled. */ -TECO_DEFINE_STATE_INSERT(teco_state_insert_building); - -/*$ EI - * [c1,c2,...]EI[text]$ -- Insert text without string building characters - * - * Inserts text at the current position in the current - * document. - * This command is identical to the \fBI\fP command, - * except that string building characters are \fBdisabled\fP. - * Therefore it may be beneficial when editing \*(ST - * macros. - */ -TECO_DEFINE_STATE_INSERT(teco_state_insert_nobuilding, - .expectstring.string_building = FALSE -); +TECO_DEFINE_STATE_INSERT(teco_state_insert_plain); static gboolean teco_state_insert_indent_initial(teco_machine_main_t *ctx, GError **error) -- cgit v1.2.3