From: Sven Wischnowsky <wischnow@berkom.de>
To: zsh-workers@sunsite.dk
Subject: Re: About menu selection (again)
Date: Tue, 20 Aug 2002 13:58:27 +0200 [thread overview]
Message-ID: <15714.12003.280325.857811@wischnow.berkom.de> (raw)
In-Reply-To: <1020817172639.ZM6260@candle.brasslantern.com>
Bart Schaefer wrote:
> ...
>
> Could we do something along the lines of shuffling the hookdefs so that
> the completion hooks are not defined until `zle -C' runs the first time,
> even if the zsh/complete module has been loaded? And then test for the
> presence of the hook rather than the presence of the module, and load
> compctl if the hook doesn't exist?
Sorry for the delay, we had problems with our router...
We should actually be able to get by with just a tiny flag, that's set
when a completion widget is defined. Or am I wrong.
Ideally, this should really check, if any completion widgets are bound
to keys, shouldn't it?
Bye
Sven
Index: Src/Zle/zle_main.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_main.c,v
retrieving revision 1.26
diff -u -r1.26 zle_main.c
--- Src/Zle/zle_main.c 4 Jul 2002 10:13:38 -0000 1.26
+++ Src/Zle/zle_main.c 20 Aug 2002 11:52:58 -0000
@@ -1355,6 +1355,7 @@
varedarg = NULL;
incompfunc = incompctlfunc = hascompmod = 0;
+ hascompwidgets = 0;
clwords = (char **) zcalloc((clwsize = 16) * sizeof(char *));
Index: Src/Zle/zle_thingy.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_thingy.c,v
retrieving revision 1.8
diff -u -r1.8 zle_thingy.c
--- Src/Zle/zle_thingy.c 7 Jun 2002 18:04:14 -0000 1.8
+++ Src/Zle/zle_thingy.c 20 Aug 2002 11:52:58 -0000
@@ -601,6 +601,8 @@
zwarnnam(name, "widget name `%s' is protected", args[0], 0);
return 1;
}
+ hascompwidgets++;
+
return 0;
}
Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.39
diff -u -r1.39 zle_tricky.c
--- Src/Zle/zle_tricky.c 8 Jul 2002 09:03:05 -0000 1.39
+++ Src/Zle/zle_tricky.c 20 Aug 2002 11:52:58 -0000
@@ -146,6 +146,11 @@
/**/
mod_export int comprecursive;
+/* != 0 if there are any defined completion widgets. */
+
+/**/
+int hascompwidgets;
+
/* Find out if we have to insert a tab (instead of trying to complete). */
/**/
@@ -557,7 +562,11 @@
if (undoing)
setlastline();
- if (!module_loaded("zsh/complete"))
+ /* We the C-code's point of view, we can only use compctl as a default
+ * type of completion. Load it if it hasn't been loaded already and
+ * no completion widgets are defined. */
+
+ if (!module_loaded("zsh/compctl") && !hascompwidgets)
load_module("zsh/compctl");
if (runhookdef(BEFORECOMPLETEHOOK, (void *) &lst)) {
--
Sven Wischnowsky wischnow@berkom.de
next prev parent reply other threads:[~2002-08-20 12:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-11 20:47 DervishD
2002-08-12 6:01 ` Bart Schaefer
2002-08-13 13:16 ` DervishD
2002-08-13 15:00 ` Bart Schaefer
2002-08-13 18:50 ` DervishD
2002-08-13 18:55 ` More information on why compctl is not loaded DervishD
2002-08-14 2:27 ` About menu selection (again) Bart Schaefer
2002-08-16 12:08 ` DervishD
2002-08-16 12:05 ` Sven Wischnowsky
2002-08-17 17:26 ` Bart Schaefer
2002-08-19 7:40 ` Sven Wischnowsky
2002-08-20 11:58 ` Sven Wischnowsky [this message]
2002-08-20 15:07 ` Bart Schaefer
2002-08-20 15:21 ` Sven Wischnowsky
2002-08-18 16:29 ` DervishD
2002-08-18 23:07 ` Bart Schaefer
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=15714.12003.280325.857811@wischnow.berkom.de \
--to=wischnow@berkom.de \
--cc=zsh-workers@sunsite.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).