From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 9231 invoked from network); 30 Apr 2020 22:35:17 -0000 Received-SPF: pass (primenet.com.au: domain of zsh.org designates 203.24.36.2 as permitted sender) receiver=inbox.vuxu.org; client-ip=203.24.36.2 envelope-from= Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 30 Apr 2020 22:35:17 -0000 Received: (qmail 5259 invoked by alias); 30 Apr 2020 22:35:09 -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: List-Unsubscribe: X-Seq: 45752 Received: (qmail 14829 invoked by uid 1010); 30 Apr 2020 22:35:09 -0000 X-Qmail-Scanner-Diagnostics: from out4-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25793. spamassassin: 3.4.4. Clear:RC:0(66.111.4.28):SA:0(-1.1/5.0):. Processed in 3.704086 secs); 30 Apr 2020 22:35:09 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrieeigddutdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkjghfofggtgfgsehtqhdttdertdejnecuhfhrohhmpeffrghnihgv lhcuufhhrghhrghfuceougdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpefhtdetfeehveeutdehuddtieefgeettedtjedtffehudeiieej leetteekudetheenucfkphepuddtledrieeirdduhedrvdefleenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhh rghhrghfrdhnrghmvg X-ME-Proxy: Date: Thu, 30 Apr 2020 22:34:26 +0000 From: Daniel Shahaf To: Vincent Lefevre Cc: Bart Schaefer , "zsh-workers@zsh.org" Subject: Re: completion for compilers (cc, gcc...) and -o Message-ID: <20200430223426.2be58968@tarpaulin.shahaf.local2> In-Reply-To: <20200430205409.GC818727@zira.vinc17.org> References: <20200430085111.GA1649750@zira.vinc17.org> <20200430181459.051d3fd1@tarpaulin.shahaf.local2> <20200430201747.GA818727@zira.vinc17.org> <20200430205409.GC818727@zira.vinc17.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Vincent Lefevre wrote on Thu, 30 Apr 2020 22:54 +0200: > Now I'm wondering whether there is a way to automatically apply > the zstyle to the _gcc command list (I also sometimes use clang > and so on). This? =E2=80=94 zstyle -e ":completion::complete:*:option-o-1:" file-patterns '(( ${+funcst= ack[_gcc]} )) && reply=3D( =E2=80=A6 )' --- More generally, I think it might be nice if the code evaluated by =C2=ABzstyle -e=C2=BB could be told what context it's being looked up under. Something like this: % zstyle -e '*' foo 'echo $CONTEXT > /dev/tty' % zstyle -s bar foo REPLY bar %=20 (though the name $CONTEXT is already taken) > I was also wondering whether there is a way to get the extension > list automatically from the one in _gcc (assuming that it could > evolve[*]). >=20 I don't know how likely it is to evolve, but I suppose we could drop the list of extensions in a variable, =C2=ABcc_extensions=3D( c h cc C cxx = cpp hpp )=C2=BB, then you'll be able to use =C2=ABzstyle -e=C2=BB to build on t= op of it? > [*] On this subject, I'm quite sure I've already used the .cpp > extension. I do not program in C++, but sometimes have to do > some tests of small examples... I think that it should be added > to the standard list, but C++ programmers may tell you more. Sure. This? =E2=80=94 diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index 9ec09200e..20b3abe59 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -390,7 +390,7 @@ languages=3D( # generic options (from --help) args+=3D( '-###[print commands to run this compilation]' - '-o:output file:_files -g "^*.(c|h|cc|C|cxx)(-.)"' + '-o:output file:_files -g "^*.(c|h|cc|C|cxx|cpp|hpp)(-.)"' '-x[Specify the language of the following input files]:input file langua= ge:('"$languages"')' '+e-:virtual function definitions in classes:((0\:only\ interface 1\:gen= erate\ code))' '-d-:dump:->dump' @@ -1004,7 +1004,7 @@ args+=3D( '--help[Display this information]' '--no-warnings[Same as -w]' '--optimize[Same as -O]' - '--output[Same as -o]' + '--output:output file:_files -g "^*.(c|h|cc|C|cxx|cpp|hpp)(-.)"' '--param[Set parameter to value. See manpage for a complete lis= t of parameters]:name=3Dvalue' '--verbose[Same as -v]' '--version[Display version information]' Cheers,