aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/sciteco.1.in12
-rw-r--r--src/core-commands.c3
-rw-r--r--src/qreg-commands.c12
3 files changed, 25 insertions, 2 deletions
diff --git a/doc/sciteco.1.in b/doc/sciteco.1.in
index 82c3376..78f5748 100644
--- a/doc/sciteco.1.in
+++ b/doc/sciteco.1.in
@@ -501,6 +501,18 @@ In order to execute a stand-alone script or custom profile macro:
.EE
.RE
.
+.ig \" FIXME: Requires --quiet to be an useful example
+.LP
+In order to query the installation path of the standard library,
+which is useful for authors of third-party macro packages:
+.RS
+.SCITECO_TT
+.EX
+@PACKAGE@ -qe ':G[$SCITECOPATH]'
+.SCITECO_TT_END
+.EE
+.RE
+..
.
.SH SEE ALSO
.
diff --git a/src/core-commands.c b/src/core-commands.c
index 257e29d..e67aa2f 100644
--- a/src/core-commands.c
+++ b/src/core-commands.c
@@ -595,7 +595,8 @@ teco_state_start_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
['['] = {&teco_state_pushqreg},
[']'] = {&teco_state_popqreg,
.modifier_colon = 1},
- ['G'] = {&teco_state_getqregstring},
+ ['G'] = {&teco_state_getqregstring,
+ .modifier_colon = 1},
['Q'] = {&teco_state_queryqreg,
.modifier_colon = 1},
['U'] = {&teco_state_setqreginteger,
diff --git a/src/qreg-commands.c b/src/qreg-commands.c
index a1da5f9..e9f80fb 100644
--- a/src/qreg-commands.c
+++ b/src/qreg-commands.c
@@ -545,6 +545,11 @@ teco_state_getqregstring_got_register(teco_machine_main_t *ctx, teco_qreg_t *qre
if (!qreg->vtable->get_string(qreg, &str.data, &str.len, NULL, error))
return NULL;
+ if (teco_machine_main_eval_colon(ctx)) {
+ teco_interface_msg_literal(TECO_MSG_USER, str.data, str.len);
+ return &teco_state_start;
+ }
+
sptr_t pos = teco_interface_ssm(SCI_GETCURRENTPOS, 0, 0);
if (str.len > 0) {
@@ -565,10 +570,15 @@ teco_state_getqregstring_got_register(teco_machine_main_t *ctx, teco_qreg_t *qre
}
/*$ G Gq get paste
- * Gq -- Insert Q-Register string
+ * Gq -- Insert or print Q-Register string
+ * :Gq
*
* Inserts the string of Q-Register <q> into the buffer
* at its current position.
+ * If colon-modified prints the string as a message
+ * (i.e. to the terminal and/or in the message area) instead
+ * of modifying the current buffer.
+ *
* Specifying an undefined <q> yields an error.
*/
TECO_DEFINE_STATE_EXPECTQREG(teco_state_getqregstring);