* PATCH: Re: bindkey bug with zsh-3.1.6-dev-21?
@ 2000-04-19 13:41 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-04-19 13:41 UTC (permalink / raw)
To: zsh-workers
I wrote:
> ...
>
> Hm, maybe a test of the form
>
> if (load(zle) || !loaded(complete)) load(compctl);
>
> There's find_module() for that kind of test.
>
> Does that sound sensible?
Oops. No, Sven, we can't do that in autoload_zleread(), obviously.
So this puts the test in docomplete().
And it adds module_loaded() which can be used to test if a module is
really loaded.
Bye
Sven
Index: Src/module.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/module.c,v
retrieving revision 1.1.1.35
diff -u -r1.1.1.35 module.c
--- Src/module.c 2000/02/23 15:18:45 1.1.1.35
+++ Src/module.c 2000/04/19 13:40:33
@@ -447,6 +447,18 @@
}
/**/
+mod_export int
+module_loaded(const char *name)
+{
+ LinkNode node;
+ Module m;
+
+ return ((node = find_module(name)) &&
+ (m = ((Module) getdata(node)))->u.handle &&
+ !(m->flags & MOD_UNLOAD));
+}
+
+/**/
#ifdef DYNAMIC
/**/
Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.6
diff -u -r1.6 zle_tricky.c
--- Src/Zle/zle_tricky.c 2000/04/17 11:17:10 1.6
+++ Src/Zle/zle_tricky.c 2000/04/19 13:40:34
@@ -523,6 +523,9 @@
if (undoing)
setlastline();
+ if (!module_loaded("zsh/complete"))
+ load_module("zsh/compctl");
+
if (runhookdef(BEFORECOMPLETEHOOK, (void *) &lst))
return 0;
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-04-19 13:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-19 13:41 PATCH: Re: bindkey bug with zsh-3.1.6-dev-21? 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).