From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 474A024F78 for ; Sun, 10 Nov 2024 19:57:32 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1731265052; b=aUlSDAqYf/PC70MLurRVLDhbGBZuWguHJx/HQ3lHzmObfDsSqlGORdSHEGXR3v1cNSjhGrwmIZ 5HwOvl+AgMmTM8+MpZUNq7PbAAEknlD6gcFgbSZhwvt8y+fh6GZoTlIjD9gx1WiEGYiyTfeDOG hXzaVO4NmKraTn9wVGdKntSx9lisxSrtPg+g1VY3FV4QMS0FunZtiQmenO6OQzlHQ9r6FqJuwZ bf4R1jhpB9wfEzJy5hILtZcXl9v7XFWaDY2qaLBano8yzBmWRMR4f7jEMputpL+htWxZKjZoAT VJvNcFf1o8FgO5ERGGHqGwBWWkKjPiK1VeSa78WbkSc7mw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtp-in1.ms.mff.cuni.cz) smtp.remote-ip=195.113.20.234; dkim=pass header.d=mff.cuni.cz header.s=submission header.a=rsa-sha256; dmarc=none header.from=matfyz.cz; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1731265052; bh=nI6Hk+Q729ROuJ0evnqyVGthDZd5ivPOlO8SI+OhzmQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:References:Content-Transfer-Encoding: MIME-Version:To:Subject:Cc:From:Message-ID:Date:Content-Type:DKIM-Signature: DKIM-Signature; b=qCQ2CaY33zsPpvxe2W+gpqqJOBHj+d2dFl6Vr+Xo9fPJ21ljgmY7jAioU5kftevH+6gF1id8DC vSlUr3P2JS7E84bFjXG47WG0voffbhCWaqUHmxdm+V9fRskUXJcnLsUbu/WG4l6s5wjb8vn0qJ RNdJYk0MNLWSLFVlaXS/rFpMnfLCrL+ajjMxXpZCNb4DGXS8uXtJgkr6ypt7s970dOgUVYQdaq EKTQFX/WzJJ8loFM29zOTylAKMF1HBuC0S8lh6WitJAJnpJ+70gTVOlMMzoPq0FoQgjnZ7mNBo TVQVe8uE0SQyLP42WBDsfrBXxXJvYyo7KTqy/dx+S8WXcw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:References: Content-Transfer-Encoding:Mime-Version:To:Subject:Cc:From:Message-Id:Date: Content-Type:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=tjUlAiVsiEe4qQnOL3DC8EegmY+FJ0oqgfnoPaABBjk=; b=Js9C4menPXsxqdrhSXRne7DEkj ubMqEewZOsZeusLN7Q6+PQ+GuCY87PO4fGyrAEq2S4QDEx1dnXBR0fxE96t9AJNmj6dGb/pqStiP9 88CS3cX0Cg0a8glEZ2CPaWfEjWd0OuIR35Agg4WQYvpFz4Kb8oBUZg4H150I3uP4MUMqlS73RMetA EqtnmD1fVQsW5c0lm/Xt+FeBRiO4p6PihlZ71Tfx9Ru3J0r0wu3PnDDuvLU/ZwbFPxp5aUsIXZRIV m6WSHKtrYV+6WjHZtLEOcV4hG/RJCb9bO/uiSi7XlcSI9cU9sg9TPPjHiLFV/9lIqmaSyK08U73cD bW6cSVEg==; Received: by zero.zsh.org with local id 1tAD7q-000Pt9-SX; Sun, 10 Nov 2024 18:57:30 +0000 Authentication-Results: zsh.org; iprev=pass (smtp-in1.ms.mff.cuni.cz) smtp.remote-ip=195.113.20.234; dkim=pass header.d=mff.cuni.cz header.s=submission header.a=rsa-sha256; dmarc=none header.from=matfyz.cz; arc=none Received: from smtp-in1.ms.mff.cuni.cz ([195.113.20.234]:59511 helo=smtp1.ms.mff.cuni.cz) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1tAD79-000PZN-Bt; Sun, 10 Nov 2024 18:56:48 +0000 X-SubmittedBy: id balejk@matfyz.cz subject /postalCode=110+2000/O=Univerzita+20Karlova/street=Ovocn+5CxC3+5CxBD+20trh+20560/5/ST=Praha,+20Hlavn+5CxC3+5CxAD+20m+5CxC4+5Cx9Bsto/C=CZ/CN=Karel+20Balej/emailAddress=balejk@matfyz.cz serial F5FD910E8FE2121B897F7E55B84E351D issued by /C=NL/O=GEANT+20Vereniging/CN=GEANT+20Personal+20CA+204 auth type TLS.CUNI DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mff.cuni.cz; s=submission; t=1731265004; x=1732565004; bh=tjUlAiVsiEe4qQnOL3DC8EegmY+FJ0oqgfnoPaABBjk=; h=From; b=JrTyArfa7LDgyKVRCiJvEbGaou76iZqpfT4HED2Fs0rdCTEEKb9XwlBZlSZXxaGUU MzZ5mpU3AThGDhX6g50fjNhbfFf8ErVsYYiGtwjR4bBfQPu4pv5ogLOW2PDybipFnX P5kUa2g6GcDtXksJNcfgeyDtPdnsLjrfRvudav50y4rNH4X/CLkoibnpH1lr8zYi8e lMqy2eAgsZCnSuYtLMfUUuuW3AlzAFsdNg7Au179R+xt3CdFRscil9wdbBSG7fJLCR MiSvwzMNd/hShXhK0LBvl8mPcHSFcQimVuxrCX9izyP+7VKZ3ZgUbA3uqz4H5SXemq ZvSj5YLQThsaw== Received: from localhost (internet5.mraknet.com [185.200.108.250]) (authenticated) by smtp1.ms.mff.cuni.cz (8.16.1/8.16.1) with ESMTPS id 4AAIuh8H079164 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Sun, 10 Nov 2024 19:56:44 +0100 (CET) (envelope-from balejk@matfyz.cz) Content-Type: text/plain; charset=UTF-8 Date: Sun, 10 Nov 2024 19:56:43 +0100 Message-Id: From: "Karel Balej" Cc: Subject: Re: [RFC PATCH 1/2] complete absolute paths for mpc add To: "Bart Schaefer" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable References: <20240927163300.25833-1-balejk@matfyz.cz> In-Reply-To: X-Seq: 53234 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: Bart Schaefer, 2024-11-09T11:44:08-08:00: > I didn't see this the first time around for some reason. > > On Fri, Sep 27, 2024 at 9:34=E2=80=AFAM Karel Balej wr= ote: > > > > +(( $+functions[_mpc_helper_all_files] )) || > > +_mpc_helper_all_files() { > > + if [[ $words[CURRENT] =3D=3D [/~]* ]]; then > > + _files > > + fi > > + _mpc_helper_files > > +} > > If _files succeeds ($? =3D=3D 0) but _mpc_helper_files fails ($? !=3D 0) > then _mpc_helper_all_files will appear to fail and completion will > proceed to the next possible alternative. > > Does something like the following still give the result you expect? > > _mpc_helper_all_files() { > local ret=3D1 > if [[ $words[CURRENT] =3D=3D [/~]* ]]; then > _files > ret=3D$? > fi > _mpc_helper_files || return ret > } Thank you, this seems to give me the same results as the original, however I don't immediately see any difference in behaviour even when I force _mpc_helper_files to fail -- the _files results are still completed even without the ret handling. Or do I just misunderstand how this should work? Again, I might misunderstand how this "next possible alternative" mechanism works, however it occurred to me whether it might be possible and possibly simpler to just have _mpc_helper_files fail on no matches and have the completion fall back to _files only then? Best regards, K. B.