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=-4.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18834 invoked from network); 4 Feb 2023 16:01:51 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 4 Feb 2023 16:01:51 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1675526511; b=cybwF/GkklAAMf6zxz+R3+f4EX8a1ImlG0vlIz6cCt8Xkg4NO5vwGTnSDe0NiKf96qcJA50a6f gpb32cCoKkQt5tRvWF0yKaKnhdNXrBylXh9l6a4GKUexyNJp1ui+39oOpU2vlxf5v9H/nR8OCd 12KijVzmv1xaNG0E5ExSZgQ/dcD8XzWAfhUT+RQm9MFSyIbs+sQNy5ufyJiUdzECJv3TnW2F79 UXG1OWKxaVLER/R4+vq3v+N86T9prYTMar9vHIK6oAk1f265/xqeqvgVnYOgssSFqg7cGE5f8c T9ZTUpTisB+wUzJocHZ3WJghqmm85xzgS+YQG42oFJys8w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta01.eastlink.ca) smtp.remote-ip=24.224.136.30; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1675526511; bh=hpaX950lEub5ZvCuijUwOY3C84OwJytXKr6VCuPHGRU=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To: References:To:Subject:From:MIME-Version:Date:Message-ID:DKIM-Signature; b=Dpqxel+YIcIWK3ZHaihZARrbAiq3UkuqmKOjtM87B/7UrNxjOmuibfIJNGEyXIF42T4JajvkUD gPdKF/OE31gv5HksQhnT4CFy24ZvyFa9mmfC533a94efpUm3MF2k1fDyB+hrOrB2NYIF4OxTue AsJtcLKlX3lJk2sdPMz/U9ZhtMyV4o2hXKhnDjxupoYawBApDSMTpqK3SaF93Aam+4qqLOG3UY zdkQ9mgzftGchSjpPWmIDzAuEeJaFx/i+qqHfMwJ5SClIhrCD680Q4Ak4hevPe4G6+z4sNhbC1 H5zm51xvQy9DBY2kNIdFA+CeQf5U+24hmUa/qFRUYAUc4Q==; 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:Content-transfer-encoding: Content-type:In-reply-to:References:To:Subject:From:MIME-version:Date: Message-id:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=10Zne2k6wsTXL8ltodU2A1Gx/kPQfqz8RVa1YJoRuSs=; b=kj4qz51DxJx34SQSPXPQFcjQOl oz7S1wmUSIdl8XC+nN+ITIArtcz8aD/2x67E8HZrXYueZNogfUrZ/0FR27fG5LeOBOD4DglO5A+3T sxEShOsCkHlOXJe/8kflrJBy2ycRqVf26Y6YEaBSMbYB/It2KjzZU4P9E1Tpj8Nx0BvCbOkNT88a0 39AAm+ujbRJmUCrOa+KqFoycyOPGncgnAEtSr229FJwLPRiYYKqTHvHB13M5/PbHiStdNKQ12sNYJ 75eN4K3axGh/ASH9QNK46RttqgAxmVwHFCHRE2CNyquthbQL8JUd5qqXatNLxZQ+dMKul1BQUPw7B wzgFT3cQ==; Received: by zero.zsh.org with local id 1pOKz7-000Eca-S1; Sat, 04 Feb 2023 16:01:49 +0000 Authentication-Results: zsh.org; iprev=pass (mta01.eastlink.ca) smtp.remote-ip=24.224.136.30; dmarc=none header.from=eastlink.ca; arc=none Received: from mta01.eastlink.ca ([24.224.136.30]:58366) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1pOKyK-000DwY-0B; Sat, 04 Feb 2023 16:01:00 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta01.eastlink.ca ([24.224.136.30]) with ESMTPS id <0RPK001KZBZXES81@mta01.eastlink.ca> for zsh-users@zsh.org; Sat, 04 Feb 2023 12:00:58 -0400 (AST) Received: from [192.168.0.4] (host-24-207-18-108.public.eastlink.ca [24.207.18.108]) by csp01.eastlink.ca ([71.7.199.166]) with ESMTPSA id OKyHp5fGp6z6sOKyIpkBiq (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Sat, 04 Feb 2023 12:00:58 -0400 X-Authority-Analysis: v=2.4 cv=bOzQYtyZ c=1 sm=1 tr=0 ts=63de813a a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=IsHmlhtZedXm1WVSu88A:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudegvddgkeefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfhffuvfhfjggtgfesthekredttdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepueeileffuedtvdeuueeugfdvjeffffdvueeuuedttdekuedtvdeitefgieekvddtnecukfhppedvgedrvddtjedrudekrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrddukedruddtkedphhgvlhhopegludelvddrudeikedrtddrgegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: <10bbd1e3-ba0d-08e2-8a4a-830768c2ce70@eastlink.ca> Date: Sat, 4 Feb 2023 08:00:57 -0800 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 From: Ray Andrews Subject: Re: color To: zsh-users@zsh.org References: Content-language: en-US In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28903 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 2023-02-03 20:25, Bart Schaefer wrote: > The first thing you should do is try to get rid of the calls to "sed". > You'll be happier in the long run if you don't have to keep adding > increasingly baroque regular expressions. I'm happy with the condensation to single letter identifiers, it keeps the display narrow and justified.  I had thought/hoped/wanted 'typeset -mp' to show them but it doesn't. And it makes it easy to see patterns.   Probably better done with native zsh replacements  tho.  I have it so you can optionally view the entire string too.  Very nice to have that. Self-explaining output.  This is zsh being friendly. 2 /aWorking/Zsh/Source/Wk 0 $ . v; v ,f z* scalar:  Z = /aWorking/Zsh array:  zle_bracketed_paste = ( $'\C-[[?2004h' $'\C-[[?2004l' ) scalar:  ZSH_ARGZERO = zsh scalar:  ZSHBOOT = /aWorking/Zsh/Boot scalar-readonly-tied-special:  ZSH_EVAL_CONTEXT = toplevel:shfunc:cmdsubst array-readonly-tied-special:  zsh_eval_context = ( toplevel shfunc cmdsubst ) scalar:  ZSH_NAME = zsh scalar:  ZSH_PATCHLEVEL = debian/5.8-6+deb11u1 array-readonly-hide-hideval-special: zsh_scheduled_events = !hidden! integer-readonly-special:  ZSH_SUBSHELL = 1 scalar:  ZSH_VERSION = 5.8 2 /aWorking/Zsh/Source/Wk 0 $ . v; v z* S     Z = /aWorking/Zsh A     zle_bracketed_paste = ( $'\C-[[?2004h' $'\C-[[?2004l' ) S     ZSH_ARGZERO = zsh S     ZSHBOOT = /aWorking/Zsh/Boot Srts  ZSH_EVAL_CONTEXT = toplevel:shfunc:cmdsubst Arts  zsh_eval_context = ( toplevel shfunc cmdsubst ) S     ZSH_NAME = zsh S     ZSH_PATCHLEVEL = debian/5.8-6+deb11u1 Arhvs zsh_scheduled_events = !hidden! Irs   ZSH_SUBSHELL = 1 S     ZSH_VERSION = 5.8 > It's not unique, it's an associative array. Variables like "commands" > (after loading from zsh/parameter module) will show up the same way. Ok, I'll be on the lookout for others like that.  There's a dozen AAs but none of them display that way -- that I've seen.  'color' seemed unique in how it displays. > You're going to have to have separate cases for each of > scalar/array/associative. To get both the keys and the values of an > associate array, you need ${(kv)aary}. Probably not worth the trouble, I was just trying to duplicate 'typeset -m' output via other means and the alternate line I showed comes very close.  I've learned to avoid subshells if I can.  In this case I was just curious about 'print $color' and indeed 'print ${(kv)color}' shows sensible output -- I should have known that -- but I'm not going to attempt separate code for different types. 'typeset -m' is fine tho a bit slower. > This set of threads has gone on long enough, the whole point of your > function is to show you parameter type information so start paying > attention to what's different about THAT and you'll make more > progress. It's basically finished.  I was just curious about 'colors'.