about summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-09-09 10:12:42 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-09-09 10:12:42 +0000
commit6b1dc0f701754f244cd090c8ec74db5af4a418ed (patch)
tree1a6da686de0cdef82b578853c3ece22c4911db32 /Src/Zle
parent65bbf722d9061b99c70722fc613ca612d4bd48d6 (diff)
downloadzsh-6b1dc0f701754f244cd090c8ec74db5af4a418ed.tar.gz
zsh-6b1dc0f701754f244cd090c8ec74db5af4a418ed.tar.xz
zsh-6b1dc0f701754f244cd090c8ec74db5af4a418ed.zip
20331: Use internal zlong variables for consistency
20332: Add WIDGETSTYLE zle parameter
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/compctl.c2
-rw-r--r--Src/Zle/zle_params.c61
2 files changed, 40 insertions, 23 deletions
diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c
index 689d28a30..2f2996013 100644
--- a/Src/Zle/compctl.c
+++ b/Src/Zle/compctl.c
@@ -3692,7 +3692,7 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
 	/* We have a pattern to take things from the history. */
 	Patprog pprogc = NULL;
 	char *e, *h, hpatsav;
-	int i = addhistnum(curhist,-1,HIST_FOREIGN), n = cc->hnum;
+	zlong i = addhistnum(curhist,-1,HIST_FOREIGN), n = cc->hnum;
 	Histent he = gethistent(i, GETHIST_UPWARD);
 
 	/* Parse the pattern, if it isn't the null string. */
diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
index f0f1cde95..efbad97f5 100644
--- a/Src/Zle/zle_params.c
+++ b/Src/Zle/zle_params.c
@@ -55,43 +55,45 @@ static struct zleparam {
 } zleparams[] = {
     { "BUFFER",  PM_SCALAR,  FN(set_buffer),  FN(get_buffer),
 	zleunsetfn, NULL },
-    { "CURSOR",  PM_INTEGER, FN(set_cursor),  FN(get_cursor),
-	zleunsetfn, NULL },
-    { "MARK",  PM_INTEGER, FN(set_mark),  FN(get_mark),
-	zleunsetfn, NULL },
-    { "LBUFFER", PM_SCALAR,  FN(set_lbuffer), FN(get_lbuffer),
-	zleunsetfn, NULL },
-    { "RBUFFER", PM_SCALAR,  FN(set_rbuffer), FN(get_rbuffer),
+    { "BUFFERLINES", PM_INTEGER | PM_READONLY, NULL, FN(get_bufferlines),
+        zleunsetfn, NULL },
+    { "CONTEXT", PM_SCALAR | PM_READONLY, NULL, FN(get_context),
 	zleunsetfn, NULL },
-    { "PREBUFFER",  PM_SCALAR | PM_READONLY,  NULL,  FN(get_prebuffer),
+    { "CURSOR",  PM_INTEGER, FN(set_cursor),  FN(get_cursor),
 	zleunsetfn, NULL },
-    { "WIDGET", PM_SCALAR | PM_READONLY, NULL, FN(get_widget),
-        zleunsetfn, NULL },
-    { "LASTWIDGET", PM_SCALAR | PM_READONLY, NULL, FN(get_lwidget),
+    { "CUTBUFFER", PM_SCALAR, FN(set_cutbuffer), FN(get_cutbuffer),
+	unset_cutbuffer, NULL },
+    { "HISTNO", PM_INTEGER, FN(set_histno), FN(get_histno),
         zleunsetfn, NULL },
     { "KEYMAP", PM_SCALAR | PM_READONLY, NULL, FN(get_keymap),
         zleunsetfn, NULL },
     { "KEYS", PM_SCALAR | PM_READONLY, NULL, FN(get_keys),
         zleunsetfn, NULL },
-    { "NUMERIC", PM_INTEGER | PM_UNSET, FN(set_numeric), FN(get_numeric),
-        unset_numeric, NULL },
-    { "HISTNO", PM_INTEGER, FN(set_histno), FN(get_histno),
+    { "killring", PM_ARRAY, FN(set_killring), FN(get_killring),
+	unset_killring, NULL },
+    { "LASTSEARCH", PM_SCALAR | PM_READONLY, NULL, FN(get_lsearch),
         zleunsetfn, NULL },
-    { "BUFFERLINES", PM_INTEGER | PM_READONLY, NULL, FN(get_bufferlines),
+    { "LASTWIDGET", PM_SCALAR | PM_READONLY, NULL, FN(get_lwidget),
         zleunsetfn, NULL },
+    { "LBUFFER", PM_SCALAR,  FN(set_lbuffer), FN(get_lbuffer),
+	zleunsetfn, NULL },
+    { "MARK",  PM_INTEGER, FN(set_mark),  FN(get_mark),
+	zleunsetfn, NULL },
+    { "NUMERIC", PM_INTEGER | PM_UNSET, FN(set_numeric), FN(get_numeric),
+        unset_numeric, NULL },
     { "PENDING", PM_INTEGER | PM_READONLY, NULL, FN(get_pending),
         zleunsetfn, NULL },
-    { "CUTBUFFER", PM_SCALAR, FN(set_cutbuffer), FN(get_cutbuffer),
-	unset_cutbuffer, NULL },
-    { "killring", PM_ARRAY, FN(set_killring), FN(get_killring),
-	unset_killring, NULL },
+    { "POSTDISPLAY", PM_SCALAR, FN(set_postdisplay), FN(get_postdisplay),
+	zleunsetfn, NULL },
+    { "PREBUFFER",  PM_SCALAR | PM_READONLY,  NULL,  FN(get_prebuffer),
+	zleunsetfn, NULL },
     { "PREDISPLAY", PM_SCALAR, FN(set_predisplay), FN(get_predisplay),
 	zleunsetfn, NULL },
-    { "POSTDISPLAY", PM_SCALAR, FN(set_postdisplay), FN(get_postdisplay),
+    { "RBUFFER", PM_SCALAR,  FN(set_rbuffer), FN(get_rbuffer),
 	zleunsetfn, NULL },
-    { "LASTSEARCH", PM_SCALAR | PM_READONLY, NULL, FN(get_lsearch),
+    { "WIDGET", PM_SCALAR | PM_READONLY, NULL, FN(get_widget),
         zleunsetfn, NULL },
-    { "CONTEXT", PM_SCALAR | PM_READONLY, NULL, FN(get_context),
+    { "WIDGETSTYLE", PM_SCALAR | PM_READONLY, NULL, FN(get_widgetstyle),
 	zleunsetfn, NULL },
     { NULL, 0, NULL, NULL, NULL, NULL }
 };
@@ -280,6 +282,21 @@ get_widget(UNUSED(Param pm))
 
 /**/
 static char *
+get_widgetstyle(UNUSED(Param pm))
+{
+    Widget widget = bindk->widget;
+    int flags = widget->flags;
+
+    if (flags & WIDGET_INT)
+	return ".internal";	/* Don't see how this can ever be returned... */
+    else if (flags & WIDGET_NCOMP)
+	return widget->u.comp.wid;
+    else
+	return widget->u.fnnam;
+}
+
+/**/
+static char *
 get_lwidget(UNUSED(Param pm))
 {
     return (lbindk ? lbindk->nam : "");