aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core-commands.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-05-24 16:24:49 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-05-24 17:22:52 +0300
commit6e3da17a2fae11af9ae00d9b59bd0d752022e16b (patch)
treeaf0d64f08536ac193b30a8092a8c9c337eaf81e4 /src/core-commands.c
parent4b266c9616f4eb359be71c44b9b2fa3373265bb0 (diff)
downloadsciteco-6e3da17a2fae11af9ae00d9b59bd0d752022e16b.tar.gz
<EI> has been repurposed and is the macro file inclusion (indirect file) command now
* Improves DEC TECO-11 compatibility. * <EM> 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.
Diffstat (limited to 'src/core-commands.c')
-rw-r--r--src/core-commands.c32
1 files changed, 13 insertions, 19 deletions
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,
+ "<EM> command is deprecated - use <EI> 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)