zsh-workers
 help / color / mirror / code / Atom feed
From: Frank Terbeck <ft@zsh.org>
To: "Daniel Shahaf" <d.s@daniel.shahaf.name>
Cc: zsh-workers@zsh.org
Subject: Re: Question to maintainers of third-party packages that install zsh completions
Date: Fri, 02 Apr 2021 13:56:41 +0200	[thread overview]
Message-ID: <87zgyg3nnq.fsf@ft.bewatermyfriend.org> (raw)
In-Reply-To: <65b1ebd7-d090-4642-b755-ad4a0eec34cf@www.fastmail.com> (Daniel Shahaf's message of "Thu, 01 Apr 2021 23:11:28 +0000")

Hi,

Daniel Shahaf wrote:
> Where would you expect the answer to "How does one install third-party
> zsh completions in such a way that zsh will pick them up automatically?"
> to be found?  I'd like to make sure the documentation has this
> information where people who look for it will find it.

Tough question to answer in full generality.  Depends on the kind of in-
stallation you're interested in, too. Debian's vendor package, for exam-
ple, has the following convention¹:

[..snip..]
Load-path for functions from other packages
-------------------------------------------

In respsonse to #620452, the  zsh-binary from Debian's zsh package star-
ted to provide two entries to $fpath (the search path for loadable func-
tions) for other packages to drop function files into:

  - /usr/share/zsh/vendor-completions for functions  that add functiona-
    lity to zsh's function based completion system (compsys)

  - /usr/share/zsh/vendor-functions for all other functions

If you  maintain another Debian package  that wants to add  functions to
zsh's function load-path, please use  the those conventions when instal-
ling function files.
[..snap..]

This  was done  to keep  ‘/usr/local/share/zsh/site-functions’ available
for purely  local additions to  the load-path.  Debian does not  put the
‘site-functions’ directory  into ‘/usr’ (sans /local),  because the non-
local part of ‘/usr’ is meant to be managed by Debian's package system.

Not all vendors do this, of course. But it neatly keeps package and site
local installation separate.


Still, however, the ‘site-functions’ directory is always the first entry
in the load-path list, based on all compile-time options. So, for purely
local function installation, this may be good enough:

  zsh -f -c 'print ${fpath[1]}'

Vendors may have additional requirements  when it comes to their package
system.


Regards, Frank

¹ https://salsa.debian.org/debian/zsh/-/blob/debian/debian/README.Debian


      parent reply	other threads:[~2021-04-02 11:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01 23:11 Daniel Shahaf
2021-04-02  6:00 ` Stephane Chazelas
2021-04-22 17:13   ` Marlon Richert
2021-04-02 11:56 ` Frank Terbeck [this message]

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=87zgyg3nnq.fsf@ft.bewatermyfriend.org \
    --to=ft@zsh.org \
    --cc=d.s@daniel.shahaf.name \
    --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).