From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8023 invoked from network); 17 Mar 2022 21:39:32 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 Mar 2022 21:39:32 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1647553172; b=sVTfyyMOSY81JJ30Z1Em0ufaIxQ1hkTUd78OIypZkCHSAipN6sfwaw/2cknzZ+lQK74h9YJoa0 8xB20EQOPg0xoD/6OqwHQcQ1ue9wi5KhHC23hIWlYJSCt0+Dsqc3CJYuv31zXfZE0A46o6Runp MCH0Ltjjjrg29BHqtbNiOGLElqdupSPOyt4B2K9BdvicVkKtholtrXDLgBcZeZ3zwonzNr66in CZCIp4ky2Uc4n5Aj+ar5JMet6L3CgLuuLa41y/dw1PEa+sSTXSKktGO78DQM8mjG3ZTnVLC5WS 2oef/Kplvge7S+OLzRLqRh/i3rwxubupxFU+AUIiuOkLkQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mx.spodhuis.org) smtp.remote-ip=94.142.241.89; dkim=pass header.d=spodhuis.org header.s=d202202e2 header.a=ed25519-sha256; dkim=pass header.d=spodhuis.org header.s=d202202 header.a=rsa-sha256; dmarc=pass header.from=spodhuis.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1647553172; bh=2DCzGoDbs3nJRs0oPPo6RdZJqkWxBY1+u3NIY+AQTCo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:DKIM-Signature:DKIM-Signature:DKIM-Signature; b=V2RrDNaa+m7woHs7g8M6Mmi3P/4KYk3KqVIl5HT7sRuU2+gu0v8sKnwyotHOJqEfvA8KFTCcQH p+XTWBxfz7tszFXfp6LHHLQjOV6KpV+KeMIv7Vx46Y7xfQZhcmgQnKn3dry9KDtj1E5lMCFYzs wejLXxhwvG/BrArma58BGpFUr87/0XSaer4UqLvB78yGvfvy+A4E3C1F94YpeM52tOwPwq84OS xtqTMco+ovWRuEBOYo2l1n7zYkHxTtvyihwwjxltMFxGgvW7LiAKfSEKMTFS2ESVRBsOQWyO3t 5t0vHE44N0JSzZTWkozP0fxjk8L6vqYc3TkfTaOJwWP9fA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=lkS6h6ttJTyBohrJso56cuc9zdH32aidwk1SEhTgQz0=; b=nzb/vbfzrzgoQaH+LmEVqrqv3n tFL6pikuDL++934DnxRMKKtXJxcqicfPzhndGgBsbt7C8qXJhE17cw/Gt/8dp9mhbbWO/GytSXnx3 WrclXB3seqYSf9rFzdGIPtcc+Lv+AEdQxljHjoSJMfAl/VB4O/mmrQjC+OVIkRbtqWUDOjpb/DIAr YqhtDEgiWyW+Gl+7T34gtLZ/lNed2ORRAFCHtq2klsvnnXiVd/gn9uY+0DTWnJEfA4WJuw/nJPrEf MvL4wpIb9g7CyzGsGsk4Ybk1+3dPRH1DORX4hFo2spo9L2pYn56v2OwcynBcZJI/3DIpk3lCrPwy3 9aEtShrQ==; Received: from authenticated user by zero.zsh.org with local id 1nUxqF-00090p-Qo; Thu, 17 Mar 2022 21:39:31 +0000 Authentication-Results: zsh.org; iprev=pass (mx.spodhuis.org) smtp.remote-ip=94.142.241.89; dkim=pass header.d=spodhuis.org header.s=d202202e2 header.a=ed25519-sha256; dkim=pass header.d=spodhuis.org header.s=d202202 header.a=rsa-sha256; dmarc=pass header.from=spodhuis.org; arc=none Received: from mx.spodhuis.org ([94.142.241.89]:27256) (DNSSEC AD) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1nUxph-0008JM-QJ; Thu, 17 Mar 2022 21:38:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d202202; h=OpenPGP:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Reply-To:Subject:Date:To: Cc:Content-Transfer-Encoding:Content-ID:Content-Description:OpenPGP: Organization:Auto-Submitted; bh=lkS6h6ttJTyBohrJso56cuc9zdH32aidwk1SEhTgQz0=; t=1647553137; x=1648762737; b=gueK0JbUeYzCVB0UfWGCvdAg7Y9z6GJYm/oOgrltx98v3uE qH1lkGwL0iDoJvGYY0G7HWYDxVlAJvwLCg/BnFPWy0/HMHOP/GBmiP6n1c6fOVFl+zu826kM+zVqh a07OkxcGDChywdbHKpNPD4gGmbJe7217VCo+3dlaI7QmjW5Wdog8zqUOMnJkSwjdzgXbtiyQeSef1 2sR6kWcrISIWxSzpErA71OSmhzzeO/zRFI+0cDWKr7/A+YPybOoM+49tWy/Lx/v2wQlklqybB9DCp brye1IMb1GOmUOkYtKBWgWY74RcesRLt/kIRLwoHUVIspaVioi6U8syQeItoTIVA==; DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d202202e2; h=OpenPGP:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Reply-To:Subject:Date:To: Cc:Content-Transfer-Encoding:Content-ID:Content-Description:OpenPGP: Organization:Auto-Submitted; bh=lkS6h6ttJTyBohrJso56cuc9zdH32aidwk1SEhTgQz0=; t=1647553137; x=1648762737; b=ByXWTuse6mIZ+Xdgh7b9lB8a4IscQUw0m4Y12QbKg7MMszW tl6R9RE8VqE5QLVeCFHn6NvdFKl5sytBB/d9ACg==; Received: from authenticated user by smtp.spodhuis.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1nUxph-0008JF-2x; Thu, 17 Mar 2022 21:38:57 +0000 Date: Thu, 17 Mar 2022 17:38:54 -0400 From: Phil Pennock To: Bart Schaefer Cc: Zsh Users Subject: Re: More-verbose tab-completion idiom? Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: OpenPGP: url=https://www.security.spodhuis.org/PGP/keys/keys-2013rsa-2020cv25519.asc X-Seq: 27577 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 2022-03-17 at 13:44 -0700, Bart Schaefer wrote: > Are the key-value pairs at least all on one line each? Just choosing > a json file that's lying around on my Ubuntu: Yes, yes they are. For now. And I'm in a position to chat with the tool maintainer and try to make sure they stay that way. > json2hash () { > zmodload zsh/mapfile > setopt localoptions extendedglob > # Might have to undo gmail line wrapping here > typeset -gA $1=( > ${(z)${(@)${(f)mapfile[$2]}:#[{}]}/(#b)([^:]#):(*)/${(Q)match[1]} > ${(q)${(z)${match[2]%,}}}} ) > } > json2hash scopes /usr/share/unity/client-scopes.json > typeset -p scopes Switching from `jq` to this: described_contexts+=("${nctx//:/\\:}:${${${${(@M)${(f)mapfile[$nats_ctxdir/$nctx.json]}:#[[:space:]]##\"description\":*}#*: \"}%,}%\"}") means that the time to complete, across 35 files, drops from "a few seconds where things appear to have hung" to "faster than I can notice", so I am going to publish a version using this, and most of Daniel's suggestions, in a few minutes. I just have to switch from "extra-verbose" to "verbose" simply because of the difference in overhead now. Thank you! -Phil