From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2763 invoked from network); 11 Apr 2000 08:20:59 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 11 Apr 2000 08:20:59 -0000 Received: (qmail 21359 invoked by alias); 11 Apr 2000 08:20:47 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10635 Received: (qmail 21348 invoked from network); 11 Apr 2000 08:20:47 -0000 Date: Tue, 11 Apr 2000 10:20:45 +0200 (MET DST) Message-Id: <200004110820.KAA03945@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Mon, 10 Apr 2000 23:35:03 +0000 Subject: Re: PATCH: Use "make -p" to get targets Bart Schaefer wrote: > I wrote: > > We'll just have to set up a style, as in _diff. > > Strictly speaking, the _is_gnu branch would work for Solaris make as well > (as long as nobody actually created a target named .PHONY that had any > real rules). I suppose you can fake it with the version style: > > zstyle ':completion:*:make:version' echo GNU zstyle '...:version' command echo GNU > Somebody please "make" a better suggestion. Hm, dunno, but: > ... > > +if (( ! $+_is_gnu[$1] )); then Different from _diff_options, _make doesn't get the command-to-call as the first argument. And somehow my patch(1) didn't complain that it couldn't apply the hunks for the _wanted change in _make. Weird. Bye Sven Index: Completion/User/_make =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/User/_make,v retrieving revision 1.4 diff -u -r1.4 _make --- Completion/User/_make 2000/04/10 23:40:44 1.4 +++ Completion/User/_make 2000/04/11 08:20:26 @@ -4,12 +4,12 @@ (( $+_is_gnu )) || typeset -gA _is_gnu -if (( ! $+_is_gnu[$1] )); then - if [[ $(_call version $1 -v -f /dev/null /dev/null) = *GNU* ]] +if (( ! $+_is_gnu[$words[1]] )); then + if [[ $(_call version $words[1] -v -f /dev/null /dev/null) = *GNU* ]] then - _is_gnu[$1]=yes + _is_gnu[$words[1]]=yes else - _is_gnu[$1]= + _is_gnu[$words[1]]= fi fi @@ -31,7 +31,7 @@ file='' fi - if [[ -n "$file" ]] && _wanted targets; then + if [[ -n "$file" ]] && _tags targets; then if [[ -n "$_is_gnu[$1]" ]]; then tmp=( $(make -nsp --no-print-directory -f "$file" .PHONY | awk '/^[a-zA-Z0-9][^\/\t=]+:/ {print $1}' FS=:) ) else @@ -42,7 +42,7 @@ FS=: $file) ) fi - _all_labels targets expl 'make target' compadd "$tmp[@]" && return 0 + _wanted targets expl 'make target' compadd "$tmp[@]" && return 0 fi compset -P 1 '*=' _files -- Sven Wischnowsky wischnow@informatik.hu-berlin.de