From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7297 invoked by alias); 12 Oct 2016 04:35:00 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39618 Received: (qmail 24846 invoked from network); 12 Oct 2016 04:35:00 -0000 X-Qmail-Scanner-Diagnostics: from mail-vk0-f41.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.213.41):SA:0(1.1/5.0):. Processed in 0.434613 secs); 12 Oct 2016 04:35:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=DATE_IN_PAST_03_06, FREEMAIL_FROM,SPF_PASS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: gmesalazar@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.213.41 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=LRBlS5UUxZymK4HbF0ZfA3bv7scOW0DUelXCacZDtI0=; b=M7Hm9ByhSvbvCRHIkElJ0YJCXC8PjCq+SnNL1EiIfGWB5kBJG2LkbOgJxi4MiHKs9c vxD/lHhT8PuxsB1CrrHwGOTpoouxVWr8PuaClVbqpuKseSQg+Ui1VwHXVJ3T89N5dVnC tf8r/FwBTkdwu9aqXs5lsoe6bJmbOaTBvrGRsp3zduytvCkANJkigqBdDnbXPoZDdK4K +SR4b/JWKurLiXE6sAp6s247Abxb7FLruu8G3W3YypMrqV4aCvbVf4xTTh1/5tM9em6B e4xSqFjFEMV755DFon4B0VQrIDmj8HkB9GrSB34qMwB3Z06N2xbH+vtl1yjlUlAAoJeq uowQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=LRBlS5UUxZymK4HbF0ZfA3bv7scOW0DUelXCacZDtI0=; b=cL5Hu9T89rVq03tnlaBLbG9fV5ayRSz2nnTH08KOpaEWgbYDLJ2O4ApGjG9d5RBKBT UL/R5JPdGZ3M2PZ37IAgweDFxCN8aYburnwvoiMTMCkIQ3HiX4evVius/JTwgqqmouG/ tYInHPchraAudqXAThZy84layH3vKAj5E0vQ6gSyhonpi/BMReum2rn7m10W08z0JZ4A To6yHQeb2jlKFCBjkzm34nXC2qQSlSzVazRjRMofpJXlMYyferp49da/KKFESWiBoK9c 2eoIpVV1N+Xq1bNFJy/xof+RyqKA/rAv3cIl33BAIhwc5T5tuXkNdrkwT7F3WRukfYpX 6rSQ== X-Gm-Message-State: AA6/9RnEFShurxj2QoIjc2yumm5Obn9sHC87yif0E83QUu6m0gtMUcsfjm5DKMcXGU4sbTJe5GXteC0Ey5gE3Q== X-Received: by 10.31.181.142 with SMTP id e136mr4332733vkf.45.1476228454944; Tue, 11 Oct 2016 16:27:34 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20161011212150.GA24484@fujitsu.shahaf.local2> References: <20161011212150.GA24484@fujitsu.shahaf.local2> From: Guilherme Salazar Date: Tue, 11 Oct 2016 20:27:14 -0300 Message-ID: Subject: Re: zsh make(1) completion on FreeBSD To: Daniel Shahaf Cc: zsh-workers@zsh.org, Baptiste Daroussin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Daniel, > I'd like to see this fixed but I'm not on FreeBSD right now. Any chance > you could write a patch? I think there are two approaches, either (a) > figure out what incantation of BSD make is equivalent to =C2=ABgmake -nsp= f > $file=C2=BB, or (b) use the -d switch to ask make what are the targets, > variables, and other things that _make-parseMakefile extracts. Baptiste (cc'ed) kindly sent me a patch he uses to get targets completion [1]. Using it and adding variable completion, I got to the following: ```` --- /usr/ports/shells/zsh/work/zsh-5.2/Completion/Unix/Command/_make 2015-08-08 14:51:33.000000000 -0300 +++ /usr/local/share/zsh/5.2/functions/Completion/Unix/_make 2016-10-11 20:14:43.403084000 -0300 @@ -268,7 +268,14 @@ else case "$OSTYPE" in freebsd*) - _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp -f "$file" .PHONY 2> /dev/null) + if [[ $words[1] =3D=3D *'gmake'* ]] + then + args=3D"-nsp" + else + args=3D"-nsdg1Fstdout" + TARGETS+=3D(${=3D${(f)"$(_call_program targets \"$words[1]\" -s -f "$file" -V.ALLTARGETS 2> /dev/null)"}}) + fi + _make-parseMakefile $PWD < <(_call_program targets "$words[1]" $args -f "$file" .PHONY 2> /dev/null) ;; *) _make-parseMakefile $PWD < $file ```` It works well for bmake without breaking gmake. [1] https://people.freebsd.org/~bapt/_make.diff