zsh-workers
 help / color / mirror / code / Atom feed
From: Tom Vaughan <thomas.david.vaughan@gmail.com>
To: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
Cc: zsh-workers@zsh.org
Subject: Re: Literal `~` directory created?
Date: Thu, 18 May 2023 14:48:17 -0400	[thread overview]
Message-ID: <74770309-94CB-4C2B-8FC4-C89A8064B293@gmail.com> (raw)
In-Reply-To: <ZGZnm5Hv8ldicqBD@fullerene.field.pennock-tech.net>



> On May 18, 2023, at 13:59, Phil Pennock <zsh-workers+phil.pennock@spodhuis.org> wrote:
> 
> On 2023-05-18 at 13:50 -0400, Tom Vaughan wrote:
>> Thanks, Phil. Based on this it seems like the problem is due to:
>> 
>>    mkdir -m 0700 -p "$_cache_dir"
> 
>> Tilde is not expanded when quoted, right? _cache_dir is set a little higher up at https://github.com/zsh-users/zsh/blob/master/Completion/Base/Utility/_store_cache#L10:
>> 
>>    $ echo $_cache_dir
>> 
>>    $ zstyle -s ":completion:${curcontext}:" cache-path _cache_dir
>> 
>>    $ echo $_cache_dir
>>    ~/.cache/zsh/compcache
>> 
>> Perhaps this tilde should be expanded? Running the mkdir command above creates a literal '~' directory in the current working directory.
> 
> It should have been expanded _when you set the style_.
> 
> So don't quote a parameter when invoking zstyle to set it, because then
> you're setting the style's value to hold the literal string.
> 
> You should have things like:
> 
>    zstyle ':completion:*' urls ~/.urls
>    zstyle ':completion:*' cache-path ~/.cache/zsh/${HOST%%.*}

Sorry, I'm a bit confused. The previous link is to the zsh source code mirror on GitHub, specifically the definition for _store_cache which is what calls zstyle and mkdir. 

Do you mean that, in this particular case, radian should include these two zstyle commands above in its setup? But if zsh provides a fallback, is this really a requirement?

FYI - I left out that I traced brew, which calls _store_cache at  https://github.com/Homebrew/brew/blob/16b2a14c9408140b04828462b660d30056421fdb/Library/Homebrew/completions/zsh.erb#L143

-Tom



  reply	other threads:[~2023-05-18 18:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18 13:59 thomas.david.vaughan
2023-05-18 16:52 ` Phil Pennock
2023-05-18 17:50   ` Tom Vaughan
2023-05-18 17:59     ` Phil Pennock
2023-05-18 18:48       ` Tom Vaughan [this message]
2023-05-18 21:37         ` Phil Pennock
2023-05-18 22:25           ` Tom Vaughan

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=74770309-94CB-4C2B-8FC4-C89A8064B293@gmail.com \
    --to=thomas.david.vaughan@gmail.com \
    --cc=zsh-workers+phil.pennock@spodhuis.org \
    --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).