* PATCH: zsh-3.1.5-pws-4 + Sven's new completion: dl fix (+ problem)
@ 1999-01-22 9:10 Peter Stephenson
0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 1999-01-22 9:10 UTC (permalink / raw)
To: Zsh hackers list
Here's a patch which allows Sven's patches for the new completion
system to work with dynamic loading when the symbols in zle aren't
directly available from compctl and vice versa. I added a warning
where it wasn't obvious you could be sure the pointers to zle
functions were properly set, however I haven't chased the calling
sequence and it may be this is unnecessary. This all now compiles
OK.
However ---- Sven, I can't find any changes to the widget definitions
in your patches. Have I missed a patch, or should there be some
more hunks to add ZLE_ISCOMP flags to some widgets? Otherwise zle -c
won't recognize widgets as being of the right type to use.
--- Src/Zle/comp1.c.sven2 Thu Jan 21 17:22:23 1999
+++ Src/Zle/comp1.c Thu Jan 21 18:12:17 1999
@@ -41,13 +41,31 @@
/**/
Cmlist cmatcher;
-/* pointers to functions required by zle */
+/* pointers to functions required by zle and defined by compctl */
/**/
void (*printcompctlptr) _((char *, Compctl, int, int));
/**/
Compctl (*compctl_widgetptr) _((char *, char **));
+
+/**/
+void (*makecompparamsptr) _((void));
+
+/* pointers to functions required by compctl and defined by zle */
+
+/**/
+void (*addmatchesptr) _((char *, char *, char *, char *, char *, char *, char *, int, int, int, int, int, char **));
+
+/**/
+char *(*comp_strptr) _((int*,int*));
+
+/**/
+int (*getcpatptr) _((char *, int, char *, int));
+
+/**/
+void (*makecomplistcallptr) _((Compctl));
+
/* Hash table for completion info for commands */
--- Src/Zle/comp1.export.sven2 Thu Jan 21 18:01:03 1999
+++ Src/Zle/comp1.export Thu Jan 21 18:14:39 1999
@@ -1,4 +1,5 @@
#!
+addmatchesptr
cc_compos
cc_default
cc_dummy
@@ -16,16 +17,19 @@
compiprefix
compnmatches
compprefix
+comp_strptr
compsuffix
freecmatcher
freecmlist
freecompcond
freecompctl
+getcpatptr
incompctlfunc
incompfunc
instring
+makecomplistcallptr
+makecompparamsptr
patcomps
printcompctlptr
quotename
rembslash
-
--- Src/Zle/compctl.c.sven2 Thu Jan 21 18:05:57 1999
+++ Src/Zle/compctl.c Thu Jan 21 18:12:44 1999
@@ -1691,7 +1691,7 @@
zerrnam(name, "command names illegal", NULL, 0);
ret = 1;
} else
- makecomplistcall(cc);
+ makecomplistcallptr(cc);
freecompctl(cc);
return ret;
@@ -1796,8 +1796,8 @@
zerrnam(name, "missing completions", NULL, 0);
return 1;
}
- addmatches(ipre, ppre, psuf, prpre, pre, suf, group,
- f, q, m, ns, a, argv);
+ addmatchesptr(ipre, ppre, psuf, prpre, pre, suf, group,
+ f, q, m, ns, a, argv);
return 0;
}
@@ -2022,7 +2022,11 @@
s = cond_str(a, 0);
i = -1;
}
- i = getcpat(comp_str(NULL, NULL), i, s, id);
+ if (!getcpatptr) {
+ zerr("zle not loaded, zle condition not available", NULL, 0);
+ return 1;
+ }
+ i = getcpatptr(comp_strptr(NULL, NULL), i, s, id);
if (i != -1) {
ignore_prefix(i);
return 1;
@@ -2144,6 +2148,7 @@
compctltab->printnode = printcompctlp;
printcompctlptr = printcompctl;
compctl_widgetptr = compctl_widget;
+ makecompparamsptr = makecompparams;
return 0;
}
@@ -2177,6 +2182,7 @@
compctltab->printnode = NULL;
printcompctlptr = NULL;
compctl_widgetptr = NULL;
+ makecompparamsptr = NULL;
return 0;
}
--- Src/Zle/zle_main.c.sven2 Thu Jan 21 18:02:38 1999
+++ Src/Zle/zle_main.c Thu Jan 21 18:04:06 1999
@@ -873,6 +873,11 @@
spaceinlineptr = spaceinline;
zlereadptr = zleread;
+ addmatchesptr = addmatches;
+ comp_strptr = comp_str;
+ getcpatptr = getcpat;
+ makecomplistcallptr = makecomplistcall;
+
/* initialise the thingies */
init_thingies();
@@ -934,6 +939,11 @@
refreshptr = noop_function;
spaceinlineptr = noop_function_int;
zlereadptr = fallback_zleread;
+
+ addmatchesptr = NULL;
+ comp_strptr = NULL;
+ getcpatptr = NULL;
+ makecomplistcallptr = NULL;
return 0;
}
--- Src/Zle/zle_tricky.c.sven2 Thu Jan 21 17:25:43 1999
+++ Src/Zle/zle_tricky.c Thu Jan 21 18:13:16 1999
@@ -3307,7 +3307,7 @@
compnmatches = mnum;
incompfunc = 1;
startparamscope();
- makecompparams();
+ makecompparamsptr();
NEWHEAPS(compheap) {
doshfunc(compfunc, list, args, 0, 1);
} OLDHEAPS;
--
Peter Stephenson <pws@ibmth.df.unipi.it> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH: zsh-3.1.5-pws-4 + Sven's new completion: dl fix (+ problem)
@ 1999-01-22 9:44 Sven Wischnowsky
0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 1999-01-22 9:44 UTC (permalink / raw)
To: zsh-workers
Peter Stephenson wrote:
>
> Here's a patch which allows Sven's patches for the new completion
> system to work with dynamic loading when the symbols in zle aren't
> directly available from compctl and vice versa. I added a warning
> where it wasn't obvious you could be sure the pointers to zle
> functions were properly set, however I haven't chased the calling
> sequence and it may be this is unnecessary. This all now compiles
> OK.
Thanks!
> However ---- Sven, I can't find any changes to the widget definitions
> in your patches. Have I missed a patch, or should there be some
> more hunks to add ZLE_ISCOMP flags to some widgets? Otherwise zle -c
> won't recognize widgets as being of the right type to use.
My fault, it seems, I somehow didn't include the following patch. Sorry.
Bye
Sven
*** ../zdy/Src/Zle/iwidgets.list Fri Nov 6 09:47:38 1998
--- Src/Zle/iwidgets.list Wed Dec 16 14:11:40 1998
***************
*** 25,35 ****
"beginning-of-line-hist", beginningoflinehist, 0
"capitalize-word", capitalizeword, 0
"clear-screen", clearscreen, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL | ZLE_NOTCOMMAND
! "complete-word", completeword, ZLE_MENUCMP | ZLE_KEEPSUFFIX
"copy-prev-word", copyprevword, 0
"copy-region-as-kill", copyregionaskill, ZLE_KEEPSUFFIX
"delete-char", deletechar, ZLE_KEEPSUFFIX
! "delete-char-or-list", deletecharorlist, ZLE_MENUCMP | ZLE_KEEPSUFFIX
"delete-word", deleteword, ZLE_KEEPSUFFIX
"describe-key-briefly", describekeybriefly, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL
"digit-argument", digitargument, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL | ZLE_NOTCOMMAND
--- 25,35 ----
"beginning-of-line-hist", beginningoflinehist, 0
"capitalize-word", capitalizeword, 0
"clear-screen", clearscreen, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL | ZLE_NOTCOMMAND
! "complete-word", completeword, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_ISCOMP
"copy-prev-word", copyprevword, 0
"copy-region-as-kill", copyregionaskill, ZLE_KEEPSUFFIX
"delete-char", deletechar, ZLE_KEEPSUFFIX
! "delete-char-or-list", deletecharorlist, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_ISCOMP
"delete-word", deleteword, ZLE_KEEPSUFFIX
"describe-key-briefly", describekeybriefly, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL
"digit-argument", digitargument, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL | ZLE_NOTCOMMAND
***************
*** 48,55 ****
"execute-named-cmd", NULL, 0
"expand-cmd-path", expandcmdpath, 0
"expand-history", expandhistory, 0
! "expand-or-complete", expandorcomplete, ZLE_MENUCMP | ZLE_KEEPSUFFIX
! "expand-or-complete-prefix", expandorcompleteprefix, ZLE_MENUCMP | ZLE_KEEPSUFFIX
"expand-word", expandword, 0
"forward-char", forwardchar, 0
"forward-word", forwardword, 0
--- 48,55 ----
"execute-named-cmd", NULL, 0
"expand-cmd-path", expandcmdpath, 0
"expand-history", expandhistory, 0
! "expand-or-complete", expandorcomplete, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_ISCOMP
! "expand-or-complete-prefix", expandorcompleteprefix, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_ISCOMP
"expand-word", expandword, 0
"forward-char", forwardchar, 0
"forward-word", forwardword, 0
***************
*** 68,78 ****
"kill-region", killregion, ZLE_KILL | ZLE_KEEPSUFFIX
"kill-whole-line", killwholeline, ZLE_KILL | ZLE_KEEPSUFFIX
"kill-word", killword, ZLE_KILL | ZLE_KEEPSUFFIX
! "list-choices", listchoices, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL
"list-expand", listexpand, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL
"magic-space", magicspace, 0
! "menu-complete", menucomplete, ZLE_MENUCMP | ZLE_KEEPSUFFIX
! "menu-expand-or-complete", menuexpandorcomplete, ZLE_MENUCMP | ZLE_KEEPSUFFIX
"neg-argument", negargument, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL | ZLE_NOTCOMMAND
"overwrite-mode", overwritemode, 0
"pound-insert", poundinsert, 0
--- 68,78 ----
"kill-region", killregion, ZLE_KILL | ZLE_KEEPSUFFIX
"kill-whole-line", killwholeline, ZLE_KILL | ZLE_KEEPSUFFIX
"kill-word", killword, ZLE_KILL | ZLE_KEEPSUFFIX
! "list-choices", listchoices, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL | ZLE_ISCOMP
"list-expand", listexpand, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL
"magic-space", magicspace, 0
! "menu-complete", menucomplete, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_ISCOMP
! "menu-expand-or-complete", menuexpandorcomplete, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_ISCOMP
"neg-argument", negargument, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL | ZLE_NOTCOMMAND
"overwrite-mode", overwritemode, 0
"pound-insert", poundinsert, 0
***************
*** 84,90 ****
"quote-region", quoteregion, 0
"redisplay", redisplay, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL
"redo", redo, 0
! "reverse-menu-complete", reversemenucomplete, ZLE_MENUCMP | ZLE_KEEPSUFFIX
"run-help", processcmd, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL
"self-insert", selfinsert, ZLE_MENUCMP | ZLE_KEEPSUFFIX
"self-insert-unmeta", selfinsertunmeta, ZLE_MENUCMP | ZLE_KEEPSUFFIX
--- 84,90 ----
"quote-region", quoteregion, 0
"redisplay", redisplay, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL
"redo", redo, 0
! "reverse-menu-complete", reversemenucomplete, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_ISCOMP
"run-help", processcmd, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL
"self-insert", selfinsert, ZLE_MENUCMP | ZLE_KEEPSUFFIX
"self-insert-unmeta", selfinsertunmeta, ZLE_MENUCMP | ZLE_KEEPSUFFIX
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1999-01-22 9:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-22 9:10 PATCH: zsh-3.1.5-pws-4 + Sven's new completion: dl fix (+ problem) Peter Stephenson
1999-01-22 9:44 Sven Wischnowsky
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).