zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: completion for file descriptors
@ 2000-04-20  7:18 Sven Wischnowsky
  2000-04-20  9:19 ` Oliver Kiddle
  0 siblings, 1 reply; 8+ messages in thread
From: Sven Wischnowsky @ 2000-04-20  7:18 UTC (permalink / raw)
  To: zsh-workers


Oliver Kiddle wrote:

> ...
> 
> If put _file_descriptors in Core because
> it will be used by _redirect and because other things like _options is
> there - it can always be moved.

Yes, function moving and ordering before 4.0...

The directories we have now have mostly historical reasons and several 
functions could sensibly be moved in other directories even now.

What I would like is a more logical ordering. I haven't really thought 
about this yet, but maybe a Core with some of the functions it
contains now, a directory with functions like _arguments (not really
generating completions, only helping to add them), one directory with
all those functions that generate a certain type of matches (options,
jobs, pids, file-descriptors, etc.). And then certainly one for the
builtin commands.

The other stuff is harder to decide. _rpm, for example can also be
useful on non-Linux systems. I don't know debian, but I guess the
commands from that directory can be useful elsewhere, too. So maybe we 
should package the functions in a way that reflects what the commands
do (network, package-managers, ...).

I'd like to hear suggestions about all this. (And now Andrej comes and 
says that we should put all the GNU commands on the side... which
wouldn't work with the ordering-by-what-they-do, of course. I still
think there should be only one function per command and we try to find 
out what to complete by investigating the environment inside the
functions.)


Bye
 Sven


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


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Completion function directories
@ 2000-04-28  9:07 Sven Wischnowsky
  0 siblings, 0 replies; 8+ messages in thread
From: Sven Wischnowsky @ 2000-04-28  9:07 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Apr 27, 11:59am, Andrej Borsenkow wrote:
>
> ...
> 
> > I believe, in all cases when it is
> > possible we need automatic test for GNU utilities so, that completion
> > really works "out of the box". And only when it's not possible - last
> > resort like styles for particular command.
> 
> Following the same sort of suggestion as above, we'd have something like
> 
>     _detect_gnu () {
>         (( $+_is_gnu )) || typeset -gA _is_gnu
>         if (( ! $+_is_gnu[$1] ))
>         then
>                 if [[ $(_call version "$@" </dev/null 2>/dev/null) = *GNU* ]]
>                 then
>                         _is_gnu[$1]=yes 
>                 else
>                         _is_gnu[$1]= 
>                 fi
>         fi
> 	[[ $_is_gnu[$1] = yes ]]
>     }
> 
> And then _make would use
> 
> 	if _detect_gnu $words[1] -v -f /dev/null; then
> 
> and _diff_options would use
> 
> 	if _detect_gnu $cmd -v; then
> 
> and so on for any other completion functions that needed to notice GNU.

Hmhm. Does anyone see if and how we could turn this into a more
generic `_check_type' function? Something like:

  local type

  _check_type type $words[1] ... # args?

  case $type in
  GNU) ...
  AIX) ...
  *)   ...
  esac

Would that be possible withou making _check_type too expensive?

Bye
 Sven


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


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

end of thread, other threads:[~2000-05-01  3:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-20  7:18 PATCH: completion for file descriptors Sven Wischnowsky
2000-04-20  9:19 ` Oliver Kiddle
2000-04-20  9:31   ` Thomas Köhler
2000-04-24  5:23   ` Completion function directories Bart Schaefer
2000-04-27  7:59     ` Andrej Borsenkow
2000-04-27 22:09       ` Bart Schaefer
2000-05-01  2:43     ` PATCH: Spelling corrections in Etc/ files Oliver Kiddle
2000-04-28  9:07 Completion function directories 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).