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 1192 invoked from network); 29 Mar 2020 20:30:39 -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 UTF8ESMTPZ; 29 Mar 2020 20:30:39 -0000 Received: (qmail 6949 invoked by alias); 29 Mar 2020 20:30:26 -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: 45649 Received: (qmail 28336 invoked by uid 1010); 29 Mar 2020 20:30:25 -0000 X-Qmail-Scanner-Diagnostics: from wout4-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25765. spamassassin: 3.4.2. Clear:RC:0(64.147.123.20):SA:0(-2.6/5.0):. Processed in 4.654658 secs); 29 Mar 2020 20:30:25 -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: gggruggvucftvghtrhhoucdtuddrgedugedrudeifedgudehfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkjghfofggtgfgsehtjedttdertddvnecuhfhrohhmpeffrghn ihgvlhcuufhhrghhrghfuceougdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvqe enucfkphepjeelrddujeeirdduvdehrddvfedvnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomhepugdrshesuggrnhhivghlrdhshhgrhhgrfhdrnh grmhgv X-ME-Proxy: Date: Sun, 29 Mar 2020 20:29:40 +0000 From: Daniel Shahaf To: Henri Menke Cc: zsh-workers@zsh.org Subject: Re: [PATCH] completion: Unison uses the $UNISON variable Message-ID: <20200329202940.04cf1ae5@tarpaulin.shahaf.local2> In-Reply-To: <20200329041509.ao7tcppwp55qmmtu@worklaptop> References: <20200329041509.ao7tcppwp55qmmtu@worklaptop> 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=US-ASCII Content-Transfer-Encoding: 7bit Henri Menke wrote on Sun, 29 Mar 2020 17:15 +1300: > Please find attached my improvement for the Unison completion file. > Details as to why this patch is necessary are in the commit message. > > If you need clarification or want me to improve the patch, please reply > to me directly, as I am not subscribed to the list. Thanks, applied. Note that it will honour $UNISON even if that variable isn't exported. I also have a further tweak: 8<--8<-- From: Daniel Shahaf Date: Sun, 29 Mar 2020 20:20:49 +0000 Subject: [PATCH] completion: Simplify Unison completion. No functional change. --- Completion/Unix/Command/_unison | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Completion/Unix/Command/_unison b/Completion/Unix/Command/_unison index d8cf7458f..5963d66c6 100644 --- a/Completion/Unix/Command/_unison +++ b/Completion/Unix/Command/_unison @@ -84,9 +84,6 @@ _arguments \ '*:profile:->profile' if [[ $state == profile ]]; then - local -a profiles - - profiles=( ${UNISON:-~/.unison}/*.prf(N) ) - (( $#profiles )) && \ - compadd "$@" - ${${profiles#${UNISON:-~/.unison}/}%.prf} + local -a profiles=( ${UNISON:-~/.unison}/*.prf(N:t:r) ) + compadd "$@" -a profiles fi (Not trying to golf it, but to improve readability.) Cheers, Daniel