zsh-workers
 help / color / mirror / code / Atom feed
* Re: Completion no longer enabled in zsh -f
@ 2000-02-09  8:56 Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 2000-02-09  8:56 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> ...
> 
> -    load_module("zsh/zle");
> +    load_module("zsh/zle") && load_module("zsh/compctl");

I like this, very shell-ish. But it makes my gcc warn about a `value
computed is not used'.

Bye
 Sven

diff -ru ../z.old/Src/init.c Src/init.c
--- ../z.old/Src/init.c	Wed Feb  9 09:30:18 2000
+++ Src/init.c	Wed Feb  9 09:49:58 2000
@@ -1012,7 +1012,8 @@
 autoload_zleread(char *lp, char *rp, int ha)
 {
     zlereadptr = fallback_zleread;
-    load_module("zsh/zle") && load_module("zsh/compctl");
+    if (load_module("zsh/zle"))
+	load_module("zsh/compctl");
     return zleread(lp, rp, ha);
 }
 

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Completion no longer enabled in zsh -f
@ 2000-02-07  4:23 Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2000-02-07  4:23 UTC (permalink / raw)
  To: zsh-workers

I just built 3.1.6-dev-17, patched up through 9589.  Running "zsh -f":

zagzig% ls <TAB>

Nothing happens.

I just fielded a post from somebody on comp.unix.shells who was confused
because zsh didn't complete anything at all for him.  I pointed him at
compinit but said that plain file completion should still work by default,
which at the moment it doesn't.  This must have started happening after
the patch in 8770; you must run at least one "compctl" command or the
like, or "zmodload compctl", for completion to be active.

The following is the simplest fix I could think of; one shortcoming is
that the compctl module doesn't strictly need to be loaded if the complete
module has been.  However, thanks to the way load_module() works, it is
possible to prevent loading of zsh/compctl by loading zsh/zle (either
explicitly or implicitly) in your init files; zsh/zle is already loaded as
a side-effect of "compinit", so for anyone already using new completion in
their init files, this change is invisible.

Index: Src/init.c
===================================================================
@@ -1021,7 +1021,7 @@
 autoload_zleread(char *lp, char *rp, int ha)
 {
     zlereadptr = fallback_zleread;
-    load_module("zsh/zle");
+    load_module("zsh/zle") && load_module("zsh/compctl");
     return zleread(lp, rp, ha);
 }
 

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-02-09  8:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-09  8:56 Completion no longer enabled in zsh -f Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2000-02-07  4:23 Bart Schaefer

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).