From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: bindkey bug with zsh-3.1.6-dev-21?
Date: Wed, 19 Apr 2000 15:41:10 +0200 (MET DST) [thread overview]
Message-ID: <200004191341.PAA19686@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Sven Wischnowsky's message of Wed, 19 Apr 2000 11:26:30 +0200 (MET DST)
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
reply other threads:[~2000-04-19 13:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200004191341.PAA19686@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).