Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Moving completion functions



Oliver Kiddle wrote:

> ...
> 
> I'm not sure that it should be _ps_utils because the psutils is a single
> package of utilities distributed together which has always been called psutils
> in one word. _ps_utils might imply that some other unrelated PostScript utility
> should go in there also. Keeping it _mysql_utils and renaming to _x_utils is
> fine though.

Ok.

> ...
> 
> > - And there could be a better name for _compalso.
> 
> I agree but I can't think of anything better.

Neither could I.

> > - For the label functions (and the tag functions) I think we should
> >   either leave them or try to find names that are both readable and
> >   have the sorting behaviour Bart wants (and not only he, I like that, 
> >   too). So...
> > 
> >     _tags        _tags
> >     _wanted      _tag_wanted
> >     _requested   _tag_requested or _tag_selected
> >     _all_labels  _labels_for
> >     _next_label  _label_selected
> >
> 
> I like the sorting behaviour too but am not particularly convinced by these.
> _tag_requested just seems quite long for something which is used a lot. One
> option is removing the 'ed' so we just have _tag_want and _tag_request.
> 
> Another option which I think I prefer would be to use something like _want_now
> or _wanted_now for _requested which groups it with _wanted while possibly
> better expressing the difference with _wanted which you were getting at with
> the _tag_selected idea.

I haven't changed these yet (below is the next version of the script).

I don't like _want(|ed)_now, though, because it is too easily confused 
with _wanted, I think.  And with _wanted we want to add the
completions *now*, too.


Bart Schaefer wrote:

> ...
> 
> So I think _use_lo actually belongs in Unix/Command/, where the convention
> is to use names that describe the command for which the function completes,
> rather than names that describe what the function completes, or how.
> 
> Hence I think _use_lo should move to Unix/Command/_gnu_generic ...  I'd
> say _gnu_style, except for other "style" connotations.

Good point, good name, I've used it.

> ...
> 
> } > Graphic and Sound is a more complex issue
> } > because you might care about programs which manipulate sound files or
> } > images but not have the ability to play or display them.
> } 
> } Yes, similar foe Network if it's a first level directory.  There are
> } network commands that need X and ones that don't.
> 
> I'd put anything that actually needs X under X first.
> 
> The biggest problem with doing so is X programs that are nothing more
> than front-ends for text-based tools, when the text one is not installed.
> Presumably it does little harm to have a few completion functions for X
> commands that don't exist, but if there are actually dependencies among
> the completion functions, errors could result if a completion for one of
> those X commands happens to be attempted.

Radical idea: let's just wait and do nothing about all this yet.  If
we get more functions that make the kind of logical grouping we are
talking about more important we could think about adding configuration 
magic that builds link farms for logical groups of commands.  And then 
leave the functions in the system-specific and development-friendly
grouping we have now.


There's now the call to `cvs tag' in it, too.  I think using a tag
that looks completely different than the version tags is a good idea
but I otherwise I don't know what to use as a tag.


Bye
 Sven


move2() {
  perl -ne \
    's/\b_set_options\b/_options_set/g;
     s/\b_unset_options\b/_options_unset/g;
     s/\b_call\b/_call_program/g;
     s/\b_funcall\b/_call_function/g;
     print' $1 > $2
}


move1() {
  local name dir1 dir2

  name=${1:t}
  [[ $2 = */*/* && $2 != */*/*/* ]] && 2=${2}/${name}

  if [[ ! -f $1 ]]; then
    if [[ -f $2 ]]; then
      echo $1 already moved to $2
      return
    else
      echo ERROR: $1 does not exist
      return
    fi
  fi

  echo moving $1 to $2

  dir2=${2:h}
  dir1=${dir2:h}

  if [[ ! -d $dir1 ]]; then
    echo new directory $dir1
    mkdir $dir1
    echo "  cvs add    $dir1"
    cvs add $dir1
    echo "  cvs commit $dir1"
    cvs commit -m 'new completion directory' $dir1
  fi

  if [[ ! -d $dir2 ]]; then
    echo new directory $dir2
    mkdir $dir2
    echo "  cvs add    $dir2"
    cvs add $dir2
    echo "  cvs commit $dir2"
    cvs commit -m 'new completion directory' $dir2
  fi

  move2 $1 $2
  chmod 600 $2
  rm $1

  echo "  cvs remove $1"
  cvs remove $1
  echo "  cvs commit $1"
  cvs commit -m "moved to $2" $1

  echo "  cvs add    $2"
  cvs add $2
  echo "  cvs commit $2"
  cvs commit -m "moved from $1" $2
}


# Overall structure:
#
# Completion
#   comp{init,install,...}
#   Base
#     Core        basic functions
#     Completer   completers
#     Utility     utility functions (_arguments,...)
#     Widget      bindable commands
#   Zsh
#     Type        types of matches
#     Context     special contexts
#     Command     builtins and functions
#   Unix
#     Type
#     Command
#   X/AIX/BSD/Debian/Redhat
#     Utility
#     Type
#     Command


files=(

Core/_all_labels                Base/Core
Core/_all_matches               Base/Completer
Core/_alternative               Base/Utility
Core/_approximate               Base/Completer
Core/_call                      Base/Core/_call_program
Core/_compalso                  Base/Core
Core/_complete                  Base/Completer
Core/_correct                   Base/Completer
Core/_description               Base/Core
Core/_expand                    Base/Completer
Core/_expand_alias              Base/Completer
Core/_file_descriptors          Zsh/Type
Core/_files                     Unix/Type
Core/_funcall                   Base/Core/_call_function
Core/_history                   Base/Completer
Core/_ignored                   Base/Completer
Core/_list                      Base/Completer
Core/_main_complete             Base/Core
Core/_match                     Base/Completer
Core/_menu                      Base/Completer
Core/_message                   Base/Core
Core/_multi_parts               Base/Utility
Core/_next_label                Base/Core
Core/_normal                    Base/Core
Core/_oldlist                   Base/Completer
Core/_options                   Zsh/Type
Core/_parameters                Zsh/Type
Core/_path_files                Unix/Type
Core/_prefix                    Base/Completer
Core/_requested                 Base/Core
Core/_sep_parts                 Base/Utility
Core/_set_options               Zsh/Type/_options_set
Core/_setup                     Base/Core
Core/_tags                      Base/Core
Core/_unset_options             Zsh/Type/_options_unset
Core/_wanted                    Base/Core
Core/compaudit                  compaudit
Core/compdump                   compdump
Core/compinit                   compinit
Core/compinstall                compinstall

Base/_arg_compile               Base/Utility
Base/_arguments                 Base/Utility
Base/_brace_parameter           Zsh/Context
Base/_cache_invalid             Base/Utility
Base/_combination               Base/Utility
Base/_command_names             Zsh/Type
Base/_condition                 Zsh/Context
Base/_default                   Zsh/Context
Base/_describe                  Base/Utility
Base/_equal                     Zsh/Context
Base/_first                     Zsh/Context
Base/_in_vared                  Zsh/Context
Base/_jobs                      Zsh/Type
Base/_math                      Zsh/Context
Base/_parameter                 Zsh/Context
Base/_precommand                Zsh/Command
Base/_redirect                  Zsh/Context
Base/_regex_arguments           Base/Utility
Base/_retrieve_cache            Base/Utility
Base/_store_cache               Base/Utility
Base/_sub_commands              Base/Utility
Base/_subscript                 Zsh/Context
Base/_tilde                     Zsh/Context
Base/_value                     Zsh/Context
Base/_values                    Base/Utility

Commands/_bash_completions      Base/Widget
Commands/_complete_debug        Base/Widget
Commands/_complete_help         Base/Widget
Commands/_complete_tag          Base/Widget
Commands/_correct_filename      Base/Widget
Commands/_correct_word          Base/Widget
Commands/_expand_word           Base/Widget
Commands/_generic               Base/Widget
Commands/_history_complete_word Base/Widget
Commands/_most_recent_file      Base/Widget
Commands/_next_tags             Base/Widget
Commands/_read_comp             Base/Widget

Builtins/_aliases               Zsh/Type
Builtins/_arrays                Zsh/Type
Builtins/_autoload              Zsh/Command
Builtins/_bg_jobs               Zsh/Type/_jobs_bg
Builtins/_bindkey               Zsh/Command
Builtins/_builtin               Zsh/Command
Builtins/_cd                    Zsh/Command
Builtins/_command               Zsh/Command
Builtins/_compdef               Zsh/Command
Builtins/_disable               Zsh/Command
Builtins/_echotc                Zsh/Command
Builtins/_emulate               Zsh/Command
Builtins/_enable                Zsh/Command
Builtins/_fc                    Zsh/Command
Builtins/_fg_jobs               Zsh/Type/_jobs_fg
Builtins/_functions             Zsh/Type
Builtins/_hash                  Zsh/Command
Builtins/_kill                  Zsh/Command
Builtins/_limits                Zsh/Type
Builtins/_nothing               Base/Utility
Builtins/_pids                  Unix/Type
Builtins/_popd                  Zsh/Command
Builtins/_print                 Zsh/Command
Builtins/_read                  Zsh/Command
Builtins/_sched                 Zsh/Command
Builtins/_set                   Zsh/Command
Builtins/_setopt                Zsh/Command
Builtins/_signals               Unix/Type
Builtins/_source                Zsh/Command
Builtins/_stat                  Zsh/Command
Builtins/_trap                  Zsh/Command
Builtins/_unhash                Zsh/Command
Builtins/_unsetopt              Zsh/Command
Builtins/_vars                  Zsh/Type
Builtins/_vars_eq               Zsh/Command/_typeset
Builtins/_wait                  Zsh/Command
Builtins/_which                 Zsh/Command
Builtins/_zcompile              Zsh/Command
Builtins/_zftp                  Zsh/Command
Builtins/_zle                   Zsh/Command
Builtins/_zmodload              Zsh/Command
Builtins/_zpty                  Zsh/Command
Builtins/_zstyle                Zsh/Command

User/_a2ps                      Unix/Command
User/_apachectl                 Unix/Command
User/_archie                    Unix/Command
User/_arp                       Unix/Command
User/_bison                     Unix/Command
User/_bzip2                     Unix/Command
User/_chown                     Unix/Command
User/_compress                  Unix/Command
User/_configure                 Unix/Command
User/_cvs                       Unix/Command
User/_dd                        Unix/Command
User/_dict                      Unix/Command
User/_diff                      Unix/Command
User/_diff_options              Unix/Type
User/_dir_list                  Unix/Type
User/_dirs                      Unix/Type/_directories
User/_domains                   Unix/Type
User/_dvi                       Unix/Command
User/_enscript                  Unix/Command
User/_fakeroot                  Unix/Command
User/_fetchmail                 Unix/Command
User/_find                      Unix/Command
User/_finger                    Unix/Command
User/_flex                      Unix/Command
User/_gcc                       Unix/Command
User/_gdb                       Unix/Command
User/_getconf                   Unix/Command
User/_gprof                     Unix/Command
User/_grep                      Unix/Command
User/_groups                    Unix/Type
User/_gs                        Unix/Command
User/_gv                        X/Command
User/_gzip                      Unix/Command
User/_hosts                     Unix/Type
User/_iconv                     Unix/Command
User/_imagemagick               Unix/Command
User/_init_d                    Unix/Command
User/_ispell                    Unix/Command
User/_java                      Unix/Command
User/_joe                       Unix/Command
User/_killall                   Unix/Command
User/_look                      Unix/Command
User/_lp                        Unix/Command
User/_ls                        Unix/Command
User/_lynx                      Unix/Command
User/_lzop                      Unix/Command
User/_mailboxes                 Unix/Type
User/_make                      Unix/Command
User/_man                       Unix/Command
User/_mere                      Zsh/Command
User/_mh                        Unix/Command
User/_mount                     Unix/Command
User/_mutt                      Unix/Command
User/_my_accounts               Unix/Type
User/_mysql_utils               Unix/Command
User/_ncftp                     Unix/Command
User/_nedit                     X/Command
User/_netscape                  X/Command
User/_newsgroups                Unix/Type
User/_nslookup                  Unix/Command
User/_other_accounts            Unix/Type
User/_pack                      Unix/Command
User/_patch                     Unix/Command
User/_pbm                       Unix/Command
User/_pdf                       Unix/Type
User/_perl                      Unix/Command
User/_perl_basepods             Unix/Type
User/_perl_builtin_funcs        Unix/Type
User/_perl_modules              Unix/Type
User/_perldoc                   Unix/Command
User/_ports                     Unix/Type
User/_prcs                      Unix/Command
User/_printers                  Unix/Type
User/_prompt                    Zsh/Command
User/_ps                        Unix/Type
User/_pspdf                     Unix/Type
User/_psutils                   Unix/Command
User/_rcs                       Unix/Command
User/_rlogin                    Unix/Command
User/_sh                        Unix/Command
User/_slrn                      Unix/Command
User/_socket                    Unix/Command
User/_ssh                       Unix/Command
User/_strip                     Unix/Command
User/_stty                      Unix/Command
User/_su                        Unix/Command
User/_sudo                      Unix/Command
User/_tar                       Unix/Command
User/_tar_archive               Unix/Type
User/_telnet                    Unix/Command
User/_tex                       Unix/Type
User/_texi                      Unix/Type
User/_tiff                      Unix/Command
User/_tilde_files               Unix/Type
User/_tin                       Unix/Command
User/_urls                      Unix/Type
User/_use_lo                    Unix/Command/_gnu_generic
User/_user_at_host              Unix/Type
User/_users                     Unix/Type
User/_users_on                  Unix/Type
User/_w3m                       Unix/Command
User/_webbrowser                Unix/Command
User/_wget                      Unix/Command
User/_whereis                   Unix/Command
User/_whois                     Unix/Command
User/_xargs                     Unix/Command
User/_yodl                      Unix/Command
User/_yp                        Unix/Command
User/_zcat                      Unix/Command
User/_zdump                     Unix/Command
User/_zip                       Unix/Command

X/_x_arguments                  X/Utility
X/_x_borderwidth                X/Type
X/_x_color                      X/Type
X/_x_colormapid                 X/Type
X/_x_cursor                     X/Type
X/_x_display                    X/Type
X/_x_extension                  X/Type
X/_x_font                       X/Type
X/_x_geometry                   X/Type
X/_x_keysym                     X/Type
X/_x_locale                     X/Type
X/_x_modifier                   X/Type
X/_x_name                       X/Type
X/_x_resource                   X/Type
X/_x_selection_timeout          X/Type
X/_x_title                      X/Type
X/_x_window                     X/Type
X/_xauth                        X/Command
X/_xdvi                         X/Command
X/_xfig                         X/Command
X/_xmodmap                      X/Command
X/_xrdb                         X/Command
X/_xset                         X/Command
X/_xt_arguments                 X/Utility
X/_xt_session_id                X/Type
X/_xterm                        X/Command
X/_xutils                       X/Command/_x_utils
X/_xv                           X/Command
X/_xwit                         X/Command

AIX/_floppy                     AIX/Command
AIX/_logical_volumes            AIX/Type
AIX/_lscfg                      AIX/Command
AIX/_lsdev                      AIX/Command
AIX/_lslv                       AIX/Command
AIX/_lspv                       AIX/Command
AIX/_lsvg                       AIX/Command
AIX/_object_classes             AIX/Type
AIX/_physical_volumes           AIX/Type
AIX/_smit                       AIX/Command
AIX/_volume_groups              AIX/Type

Bsd/_bsd_pkg                    BSD/Command
Bsd/_cvsup                      BSD/Command
Bsd/_kld                        BSD/Command

Linux/_rpm                      Redhat/Command

Debian/_apt                     Debian/Command
Debian/_bug                     Debian/Command
Debian/_deb_packages            Debian/Type
Debian/_dpkg                    Debian/Command
Debian/_dpkg-source             Debian/Command/_dpkg_source
Debian/_dupload                 Debian/Command

)


move() {
  local i

  while (( $# )); do
    move1 Completion/$1 Completion/$2

    shift 2
  done

  for i in Completion/*/*(/)
    print "DISTFILES_SRC='" >  $i/.distfiles
    print .distfiles        >> $i/.distfiles
    print -c $i/*(.)        >> $i/.distfiles
    print "'"               >> $i/.distfiles
  done

  # Change:
  #   Completion/.distfiles
  #   Completion/compaudit
  #   Completion/compinstall
  #   Doc/Zsh/compsys.yo
  #   Doc/Zsh/contrib.yo
  #   Doc/Zsh/zftpsys.yo
  #   INSTALL
  #   Src/Zle/complete.mdd
  #   Test/ztst.zsh
  #   Etc/completion-style-guide
  #   _dict_words
  #   The Guide
}


echo adding tag
cvs tag comp-dirs .

move $files

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author