Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Setting/Querying cache-policy (was: Re: sudo autocompletion)
- X-seq: zsh-workers 45418
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Setting/Querying cache-policy (was: Re: sudo autocompletion)
- Date: Tue, 11 Feb 2020 10:28:41 +0000
- In-reply-to: <17405-1581415941.062275@CNCV.ghXS.ifR->
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <912d22db-8a8f-90f2-6738-f9f395994dcb@gmail.com> <CAN=4vMqvzUTZ7bBLcbTzi-pKAVEP1xDbq=f5pLAxmffxUjTszQ@mail.gmail.com> <1770be62-54d8-70a6-8b05-cfc98faa9b9f@gmail.com> <20200210030219.527a3ccf@tarpaulin.shahaf.local2> <ADE72275-1311-44BE-9B1D-5E617E3D9F94@gmail.com> <D0BDD1BB-192E-4D50-A0D2-0BB54388B9B9@dana.is> <20200210192033.1bae83dc@tarpaulin.shahaf.local2> <17405-1581415941.062275@CNCV.ghXS.ifR->
Oliver Kiddle wrote on Tue, 11 Feb 2020 11:12 +0100:
> Daniel Shahaf wrote:
> > dana wrote on Mon, 10 Feb 2020 11:13 -0600:
> > > + zstyle -e ":completion:${curcontext%:}:*" command-path \
> > > + 'reply=( $path ${path/%\/bin//sbin} )'
>
> I don't like it when completion functions set zstyles. I know that the
> cache functions do it but even with one bad precedent I think it is
> better to not proliferate the practice further.
+1
Speaking of the cache-policy style, why do the following places use
":completion:*:*:$service:*" in the «zstyle -s» call? Shouldn't that
use ${curcontext}?
% ag cache-policy Completion/ | grep -v curcontext | vipe
Completion/Debian/Type/_deb_packages:101: zstyle -s ":completion:*:*:$service:*" cache-policy update_policy
Completion/Debian/Type/_deb_packages:103: zstyle ":completion:*:*:$service:*" cache-policy _debs_caching_policy
Completion/Debian/Command/_apt:629: zstyle -s ":completion:*:*:$service:*" cache-policy update_policy
Completion/Debian/Command/_apt:631: zstyle ":completion:*:*:$service:*" cache-policy _apt_caching_policy
Completion/Darwin/Type/_retrieve_mac_apps:64: zstyle -s ":completion:*:*:$service:*" cache-policy cache_policy
Completion/Darwin/Type/_retrieve_mac_apps:66: zstyle ":completion:*:*:$service:*" cache-policy _mac_apps_caching_policy
Completion/Redhat/Command/_rpm:433:zstyle -s ":completion:*:*:rpm:*" cache-policy update_policy
Completion/Redhat/Command/_rpm:435: zstyle ":completion:*:*:rpm:*" cache-policy _rpms_caching_policy
Completion/Unix/Command/_subversion:26: zstyle -s ":completion:*:*:$service:*" cache-policy update_policy
Completion/Unix/Command/_subversion:28: zstyle ":completion:*:*:$service:*" cache-policy _svn_caching_policy
Completion/Unix/Command/_gradle:13:zstyle -s ":completion:*:*:$service:*" cache-policy cache_policy || \
Completion/Unix/Command/_gradle:14: zstyle ":completion:*:*:$service:*" cache-policy _gradle_caching_policy
Completion/Unix/Command/_composer:802: zstyle -s ":completion:*:*:$service:*" cache-policy tmp
Completion/Unix/Command/_composer:804: zstyle ":completion:*:*:$service:*" cache-policy __composer_cache_policy
Completion/Linux/Command/_modutils:18: zstyle -s ":completion:*:*:$service:*" cache-policy update_policy
Completion/Linux/Command/_modutils:20: zstyle ":completion:*:*:$service:*" cache-policy _modules_caching_policy
Completion/Linux/Command/_opkg:301: zstyle -s ":completion:*:*:$service:*" cache-policy cache_policy
Completion/Linux/Command/_opkg:303: zstyle ":completion:*:*:$service:*" cache-policy __opkg_cache_policy
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author