From 1cfe37610253c20a4fcb0d937c29e70894ecc4f5 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 22 Nov 2024 16:59:07 +0300 Subject: the search mode and current radix are mapped to __local__ Q-Registers ^X and ^R now (refs #17) * This way the search mode and radix are local to the current macro frame, unless the macro was invoked with :Mq. If colon-modified, you can reproduce the same effect by calling [.^X 0^X ... ].^X * The radix register is cached in the Q-Reg table as an optimization. This could be done with the other "special" registers as well, but at the cost of larger stack frames. * In order to allow constructs like [.^X typed with upcarets, the Q-Register specification syntax has been extended: ^c is the corresponding control code instead of the register "^". --- src/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 4d0e4e9..40191b4 100644 --- a/src/main.c +++ b/src/main.c @@ -390,6 +390,11 @@ main(int argc, char **argv) teco_qreg_view = teco_view_new(); teco_view_setup(teco_qreg_view); + /* + * FIXME: "_" and "-" should perhaps be in the local Q-Reg table, so you don't + * have to back them up on the Q-Reg stack in portable macros. + * DEC TECO has them in the global table, though. + */ /* search string and status register */ teco_qreg_table_insert(&teco_qreg_table_globals, teco_qreg_plain_new("_", 1)); /* replacement string register */ @@ -402,7 +407,7 @@ main(int argc, char **argv) teco_initialize_environment(); teco_qreg_table_t local_qregs; - teco_qreg_table_init(&local_qregs, TRUE); + teco_qreg_table_init_locals(&local_qregs, TRUE); if (!teco_ring_edit_by_name(NULL, &error)) { g_fprintf(stderr, "Error editing unnamed file: %s\n", -- cgit v1.2.3