Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: bindkey bug with zsh-3.1.6-dev-21?
- X-seq: zsh-workers 10828
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: Re: bindkey bug with zsh-3.1.6-dev-21?
- Date: Wed, 19 Apr 2000 15:41:10 +0200 (MET DST)
- In-reply-to: Sven Wischnowsky's message of Wed, 19 Apr 2000 11:26:30 +0200 (MET DST)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author