Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: sfcontext for completion widgets



Thanks to Bart's last question I realised that I forgot to define a
shell function context for completion widgets.

Bye
 Sven

--- os/zsh.h	Thu Jan 28 15:49:19 1999
+++ Src/zsh.h	Thu Jan 28 18:03:03 1999
@@ -780,6 +780,7 @@
 #define SFC_HOOK     2		/* one of the special functions */
 #define SFC_WIDGET   3		/* user defined widget */
 #define SFC_COMPLETE 4		/* called from completion code */
+#define SFC_CWIDGET  5		/* new style completion widget */
 
 /* node in list of function call wrappers */
 
--- os/Zle/zle_tricky.c	Thu Jan 28 15:49:26 1999
+++ Src/Zle/zle_tricky.c	Thu Jan 28 18:04:57 1999
@@ -3199,7 +3199,7 @@
     if ((list = getshfunc(fn)) != &dummy_list) {
 	LinkList args = newlinklist();
 	char **p, *tmp;
-	int aadd = 0, usea = 1, icf = incompfunc;
+	int aadd = 0, usea = 1, icf = incompfunc, osc = sfcontext;
 	
 	addlinknode(args, fn);
 	
@@ -3276,9 +3276,11 @@
 	incompfunc = 1;
 	startparamscope();
 	makecompparamsptr();
+	sfcontext = SFC_CWIDGET;
 	NEWHEAPS(compheap) {
 	    doshfunc(fn, list, args, 0, 1);
 	} OLDHEAPS;
+	sfcontext = osc;
 	endparamscope();
 	lastcmd = 0;
 	incompfunc = icf;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author