zsh-workers
 help / color / mirror / code / Atom feed
* Distributed Completion/ structure and compinit
@ 2001-04-25 15:44 Bart Schaefer
  2001-04-26  7:11 ` Sven Wischnowsky
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2001-04-25 15:44 UTC (permalink / raw)
  To: zsh-workers

The doc for compinit says:

 For incomplete installations, if compinit does not find enough files
 beginning with an underscore (fewer than twenty) in the search path, it
 will try to find more by adding the directory _compdir to the search
 path.  Furthermore, if the directory in question ends in the path
 segment Base, or has a subdirectory named Base, compinit will add all
 subdirectories of the directory where Base is to the path: this allows
 the functions to be in the same format as in the zsh source
 distribution.

This doesn't quite work any more.  It handles one level of subdirectories,
as in an install with --enable-function-subdirs, but not two levels of
subdirectories as in the source.

Also, I'm curious why this line in compaudit was commented out:

  ### [[ -d $_compdir/../Base ]] && _compdir=${_compdir:h}

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

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: Distributed Completion/ structure and compinit
  2001-04-25 15:44 Distributed Completion/ structure and compinit Bart Schaefer
@ 2001-04-26  7:11 ` Sven Wischnowsky
  2001-04-26  8:10   ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Sven Wischnowsky @ 2001-04-26  7:11 UTC (permalink / raw)
  To: zsh-workers

Bart Schaefer wrote:

> The doc for compinit says:
> 
>  For incomplete installations, if compinit does not find enough files
>  beginning with an underscore (fewer than twenty) in the search path, it
>  will try to find more by adding the directory _compdir to the search
>  path.  Furthermore, if the directory in question ends in the path
>  segment Base, or has a subdirectory named Base, compinit will add all
>  subdirectories of the directory where Base is to the path: this allows
>  the functions to be in the same format as in the zsh source
>  distribution.
> 
> This doesn't quite work any more.  It handles one level of subdirectories,
> as in an install with --enable-function-subdirs, but not two levels of
> subdirectories as in the source.

Intentionally.  I wanted it to be able to work in a installation-like
setup, thinking that those who work with the source-form of the
completion system know how to set up their $fpath properly.

Do you want to say that we should change the tests to also look for,
say, $_compdir/Base/Core and if that exists, add `$_compdir/*/*(/)'?

> Also, I'm curious why this line in compaudit was commented out:
> 
>   ### [[ -d $_compdir/../Base ]] && _compdir=${_compdir:h}

I thought that this once was intended to cope with the case that
$_compdir is set to the directory that (before the move) contained the
comp* functions.  There the thing above made sense.  But since nowadays
the comp* functions are in the top-level directory itself it didn't seem
to make sense to look for certain sub-directories of the parent
directory of $_compdir.  Was I mistaken?

Bye
  Sven


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


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

* Re: Distributed Completion/ structure and compinit
  2001-04-26  7:11 ` Sven Wischnowsky
@ 2001-04-26  8:10   ` Bart Schaefer
  2001-04-26 13:01     ` Sven Wischnowsky
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2001-04-26  8:10 UTC (permalink / raw)
  To: zsh-workers

On Apr 26,  9:11am, Sven Wischnowsky wrote:
} Subject: Re: Distributed Completion/ structure and compinit
}
} Bart Schaefer wrote:
} 
} > The doc for compinit says:
} > 
} >  subdirectories of the directory where Base is to the path: this allows
} >  the functions to be in the same format as in the zsh source
} >  distribution.
} > 
} > This doesn't quite work any more.
} 
} Do you want to say that we should change the tests to also look for,
} say, $_compdir/Base/Core and if that exists, add `$_compdir/*/*(/)'?

Either that, or we should fix the docs.  Having it work for the source
tree layout is helpful to developers, I think:  No "make install" before
trying out some change, just set _compdir and let compinstall figure it
out.  However, developers are also likely capable of setting the fpath
manually, so it's not that big a deal.
 
} > Also, I'm curious why this line in compaudit was commented out:
} > 
} >   ### [[ -d $_compdir/../Base ]] && _compdir=${_compdir:h}
} 
} [...] since nowadays the comp* functions are in the top-level
} directory itself it didn't seem to make sense to look for certain
} sub-directories of the parent directory of $_compdir. Was I mistaken?

No, that's OK, I just was curious.

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

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: Distributed Completion/ structure and compinit
  2001-04-26  8:10   ` Bart Schaefer
@ 2001-04-26 13:01     ` Sven Wischnowsky
  0 siblings, 0 replies; 4+ messages in thread
From: Sven Wischnowsky @ 2001-04-26 13:01 UTC (permalink / raw)
  To: zsh-workers

Bart Schaefer wrote:

> ...
> 
> Either that, or we should fix the docs.  Having it work for the source
> tree layout is helpful to developers, I think:  No "make install" before
> trying out some change, just set _compdir and let compinstall figure it
> out.  However, developers are also likely capable of setting the fpath
> manually, so it's not that big a deal.

Not tested, but should work.

Bye
  Sven

Index: Completion/compaudit
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/compaudit,v
retrieving revision 1.2
diff -u -r1.2 compaudit
--- Completion/compaudit	2001/04/02 13:04:04	1.2
+++ Completion/compaudit	2001/04/26 13:00:56
@@ -55,11 +55,11 @@
     # Too few files: we need some more directories, or we need to check
     # that all directories (not just Base) are present.
     _i_addfiles=()
-    if [[ $_compdir = */Base ]]; then
-      # Add all the Completion subdirectories
-      _i_addfiles=(${_compdir:h}/*(/))
+    if [[ -d $_compdir/Base/Core ]]; then
+      # Add all the Completion subdirectories (CVS-layout)
+      _i_addfiles=(${_compdir}/*/*(/))
     elif [[ -d $_compdir/Base ]]; then
-      # Likewise
+      # Likewise (installation-layout)
       _i_addfiles=(${_compdir}/*(/))
     fi
     for _i_line in {1..$#i_addfiles}; do
Index: Completion/compinstall
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/compinstall,v
retrieving revision 1.2
diff -u -r1.2 compinstall
--- Completion/compinstall	2001/04/02 13:04:04	1.2
+++ Completion/compinstall	2001/04/26 13:00:57
@@ -190,7 +190,9 @@
 
 __ci_set_compdir $fpath
 
-if [[ -d $compdir/Base ]]; then
+if [[ -d $compdir/Base/Core ]]; then
+  subdirs=2
+elif [[ -d $compdir/Base ]]; then
   subdirs=1
   ### compdir=${compdir:h}
 fi
@@ -229,12 +231,18 @@
 compinstall again."
     fi
   fi
-  if [[ -n $subdirs ]]; then
+  if [[ $subdirs = 2 ]]; then
+    fpath_line=($compdir/[A-Z]*/[A-Z]*)
+    fpath_line="fpath=($fpath ${(F)fpath_line})"
+  elif [[ -n $subdirs ]]; then
     fpath_line=($compdir/[A-Z]*)
     fpath_line="fpath=($fpath ${(F)fpath_line})"
   fi
 else
-  if [[ -n $subdirs ]]; then
+  if [[ $subdirs = 2 ]]; then
+    print "Completion directories $compdir/*/*
+are already in your \$fpath, good."
+  elif [[ -n $subdirs ]]; then
     print "Completion directories $compdir/*
 are already in your \$fpath, good."
   else
Index: Doc/Zsh/compsys.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/compsys.yo,v
retrieving revision 1.118
diff -u -r1.118 compsys.yo
--- Doc/Zsh/compsys.yo	2001/04/26 12:13:37	1.118
+++ Doc/Zsh/compsys.yo	2001/04/26 13:00:59
@@ -142,9 +142,10 @@
 For incomplete installations, if tt(compinit) does not find enough files
 beginning with an underscore (fewer than twenty) in the search path, it
 will try to find more by adding the directory tt(_compdir) to the search
-path.  Furthermore, if the directory in question ends in the path segment
-tt(Base), or has a subdirectory named tt(Base), tt(compinit) will add all
-subdirectories of the directory where tt(Base) is to the path: this allows
+path.  If that directory has a subdirectory named tt(Base), all
+subdirectories will be added to the path.  Furthermore, if the subdirectory
+tt(Base) has a subdirectory named tt(Core), tt(compinit) will add all
+subdirectories of the subdirectories is to the path: this allows
 the functions to be in the same format as in the tt(zsh) source
 distribution.
 

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


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

end of thread, other threads:[~2001-04-26 13:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-25 15:44 Distributed Completion/ structure and compinit Bart Schaefer
2001-04-26  7:11 ` Sven Wischnowsky
2001-04-26  8:10   ` Bart Schaefer
2001-04-26 13:01     ` 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).