about summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-04-23 23:13:47 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-04-23 23:13:47 +0000
commit85f25bb845ae50fb1e75edd71c83a63e582abadd (patch)
tree4250f472e66c239c9043dbbebd94e914bdf76367 /Src/Zle
parent9b844cfe738ba9dad19d9df3e6ca63e4dba78e61 (diff)
downloadzsh-85f25bb845ae50fb1e75edd71c83a63e582abadd.tar.gz
zsh-85f25bb845ae50fb1e75edd71c83a63e582abadd.tar.xz
zsh-85f25bb845ae50fb1e75edd71c83a63e582abadd.zip
users/10172: new zle command read-command
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/iwidgets.list1
-rw-r--r--Src/Zle/zle_keymap.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/Src/Zle/iwidgets.list b/Src/Zle/iwidgets.list
index cc9ef20f9..5be5a474f 100644
--- a/Src/Zle/iwidgets.list
+++ b/Src/Zle/iwidgets.list
@@ -86,6 +86,7 @@
 "quoted-insert", quotedinsert, ZLE_MENUCMP | ZLE_KEEPSUFFIX
 "quote-line", quoteline, 0
 "quote-region", quoteregion, 0
+"read-command", readcommand, 0
 "recursive-edit", recursiveedit, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL
 "redisplay", redisplay, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL
 "redo", redo, ZLE_KEEPSUFFIX
diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
index 7b1f9e1ad..1d5e6ed2d 100644
--- a/Src/Zle/zle_keymap.c
+++ b/Src/Zle/zle_keymap.c
@@ -1441,3 +1441,16 @@ zlesetkeymap(int mode)
 	return;
     linkkeymap(km, "main", 0);
 }
+
+/**/
+mod_export int
+readcommand(UNUSED(char **args))
+{
+    Thingy thingy = getkeycmd();
+
+    if (!thingy)
+	return 1;
+
+    setsparam("REPLY", ztrdup(thingy->nam));
+    return 0;
+}