zsh-workers
 help / color / mirror / code / Atom feed
From: Henri Menke <henrimenke@gmail.com>
To: zsh-workers@zsh.org
Subject: [PATCH] completion: Unison uses the $UNISON variable
Date: Sun, 29 Mar 2020 17:15:09 +1300	[thread overview]
Message-ID: <20200329041509.ao7tcppwp55qmmtu@worklaptop> (raw)

[-- Attachment #1: Type: text/plain, Size: 307 bytes --]

Dear zsh maintainers,

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.

Kind regards,
Henri


[-- Attachment #2: 0001-completion-Unison-uses-the-UNISON-variable.patch --]
[-- Type: text/plain, Size: 1335 bytes --]

From ba2b421f957a42378ac180827c07a27d0946630a Mon Sep 17 00:00:00 2001
From: Henri Menke <henri@icp.uni-stuttgart.de>
Date: Sun, 29 Mar 2020 17:07:31 +1300
Subject: [PATCH] completion: Unison uses the $UNISON variable

By default Unison uses the ~/.unison directory to store its cache and
profiles.  However, this location is configurable through the $UNISON
environment variable.  Quoting from the manual [1]:

> If the environment variable UNISON is defined, then its value will be
> used as the name of this directory.

This patch enables users to move the .unison directory and still enjoy
zsh completion for profiles.

[1] https://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#unisondir
---
 Completion/Unix/Command/_unison | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Completion/Unix/Command/_unison b/Completion/Unix/Command/_unison
index 2a3333742..d8cf7458f 100644
--- a/Completion/Unix/Command/_unison
+++ b/Completion/Unix/Command/_unison
@@ -86,7 +86,7 @@ _arguments \
 if [[ $state == profile ]]; then
     local -a profiles
 
-    profiles=( ~/.unison/*.prf(N) )
+    profiles=( ${UNISON:-~/.unison}/*.prf(N) )
     (( $#profiles )) && \
-	compadd "$@" - ${${profiles#~/.unison/}%.prf}
+	compadd "$@" - ${${profiles#${UNISON:-~/.unison}/}%.prf}
 fi
-- 
2.26.0


             reply	other threads:[~2020-03-29  4:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-29  4:15 Henri Menke [this message]
2020-03-29 20:29 ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200329041509.ao7tcppwp55qmmtu@worklaptop \
    --to=henrimenke@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).