about summary refs log tree commit diff
path: root/Src/Zle/zle_thingy.c
diff options
context:
space:
mode:
authorAndrew Main <zefram@users.sourceforge.net>2001-09-03 01:39:19 +0000
committerAndrew Main <zefram@users.sourceforge.net>2001-09-03 01:39:19 +0000
commitb73d71105eaca6ae001a3e836ab08406ef188789 (patch)
tree691753f67199df3b7c9cfdaec6b5dd88cb14bf18 /Src/Zle/zle_thingy.c
parente8f8c3abee5763d58cfcb8eb89e50ec40dbcfde2 (diff)
downloadzsh-b73d71105eaca6ae001a3e836ab08406ef188789.tar.gz
zsh-b73d71105eaca6ae001a3e836ab08406ef188789.tar.xz
zsh-b73d71105eaca6ae001a3e836ab08406ef188789.zip
15734: zle -K option to select a keymap, and zle KEYMAP parameter to
examine the current selection.
Diffstat (limited to 'Src/Zle/zle_thingy.c')
-rw-r--r--Src/Zle/zle_thingy.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c
index f5acb73b4..dd2aea40d 100644
--- a/Src/Zle/zle_thingy.c
+++ b/Src/Zle/zle_thingy.c
@@ -339,6 +339,7 @@ bin_zle(char *name, char **args, char *ops, int func)
 	{ 'R', bin_zle_refresh, 0, -1 },
 	{ 'M', bin_zle_mesg, 1, 1 },
 	{ 'U', bin_zle_unget, 1, 1 },
+	{ 'K', bin_zle_keymap, 1, 1 },
 	{ 'I', bin_zle_invalidate, 0, 0 },
 	{ 0,   bin_zle_call, 0, -1 },
     };
@@ -465,6 +466,17 @@ bin_zle_unget(char *name, char **args, char *ops, char func)
 }
 
 /**/
+static int
+bin_zle_keymap(char *name, char **args, char *ops, char func)
+{
+    if (!zleactive) {
+	zwarnnam(name, "can only be called from widget function", NULL, 0);
+	return 1;
+    }
+    return selectkeymap(*args, 0);
+}
+
+/**/
 static void
 scanlistwidgets(HashNode hn, int list)
 {