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.3 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 4389 invoked from network); 10 Nov 2022 21:43:03 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 10 Nov 2022 21:43:03 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1668116583; b=iCTJMUmy+qfwdwxcwm5B1acpnjeD3IUYvH7FS2gayO4l3twuFmxJ2sEuASS3j4O8RMgdP+9RFv EP/bGivvawurda94QTiwtu6OcR0ewXt9K+8x+LrvbzSHLhoSJzxvgtzMkHlS9d3n3gf+VHmn77 KplXppteVpjqDc+GutpEBm8ib5iirkIGZT3F4S9c/jOBE9wrihNQqnCjij77ncJcTZ6XX1bCTf zpIoQdQ/sxTOj/sSWiiIsk6htWSNTuE82VrCxOqzEX4ODw7WkMTok1lLc3FHJtZgDnTatvsygl vW9cmRNtwGZ2NG0hbF1zX200BZJokH854Bj/6YIhl8SZLA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; 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=1668116583; bh=tRViZ2OzOBoYIj+yVkFy6OO13Yf3eW5niPxqr/27tTs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature; b=N2dSmRhcNFRGPXJZZaodG4zcS3fE3ITUK6OLeH3EOJBrgvdqWzfpHehGPyl4RCEBbGGUVWiZPs gcq5L3gLIvI+a1qiVMac7FEifbHe1tiSt3Zzcauyv6Uh/JDfQnBA4usKftmJdnd3w/A5+SvIyk 3QD0yR1Tyy+D0a2xuWtQidzsuKIDFEv2AjkEPqlGgASaTvuP4Wb0zZXE91rJV1092jdbvh6cu+ G+pjxjYTXsCFnGLasg7mvUEa4IopXFIV3cWp9fBQ6PwlthhAMKk7K6K0h+4vYWzXlaCaqtYMTA HXoPEMwOdAnsYR2dzBsqWOGJfbHIJBU9LPXJi73DyVm6bw==; 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:From:References:To:Subject: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=MYNv7uyfhCngyYSJgxYna8QGpMEECqvjOlZcz4zLOfY=; b=a7Rel2qqrOTxTup+mOvVcVInD1 XsbxLKXsuVQdKo4Zw/q9eFPdDLB2YfhiYKf8KANSiUhSj0hdun7QkzBzSE+XDrNeDjCyosA9Fn/lm fY3thATQL2D1dBLyCC9LFD9RiJuZAXHE6dzYc26OzTbHrQ3AHneI5/n8kmgPQTCZHYBI8MAflCt/D OPr+PcaqkXf7XneEDDmY58g21O+3yIXplYEJjNU27seUk5NDbvYXXJOup6bh8gc/+hx0bAyssbHQK lf4kib8N1yPvBftj/sr3d2QKjfH+mW0Fm8Xl1hnorI4t0e3H1+DwuWLoNfxeP1T8/ovJWg0+FYhB9 uZU4K+sg==; Received: by zero.zsh.org with local id 1otFKA-000C51-7p; Thu, 10 Nov 2022 21:43:02 +0000 Authentication-Results: zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none Received: from mta04.eastlink.ca ([24.224.136.10]:50459) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1otFJW-000BMe-WF; Thu, 10 Nov 2022 21:42:23 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta04.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RL500GQ1CTTM211@mta04.eastlink.ca> for zsh-users@zsh.org; Thu, 10 Nov 2022 17:42:21 -0400 (AST) Received: from [192.168.0.3] ([24.207.18.108]) by Eastlink with ESMTPSA id tFJVovUuxkffJtFJVosMqb; Thu, 10 Nov 2022 17:42:21 -0400 X-Authority-Analysis: v=2.4 cv=Lbf6qBTi c=1 sm=1 tr=0 ts=636d703d a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=22lwMXuji3cV7KeFJ4YA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrfeeggdduheefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepiedtjeffvefgtdehgefgteekueeggeeitedutddvvdduteetffdvveelgfeukedunecukfhppedvgedrvddtjedrudekrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrddukedruddtkedphhgvlhhopegludelvddrudeikedrtddrfegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: <6d7ba212-be9d-6bb4-f5ce-9a796032ade0@eastlink.ca> Date: Thu, 10 Nov 2022 13:42:20 -0800 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: coloring substitution seems to eat next line. Content-language: en-US To: zsh-users@zsh.org References: <549715c2-8b36-8b7e-e3ac-cac02f43dd0f@eastlink.ca> <0a7dbe0d-1554-269a-f420-bfe320c7c838@eastlink.ca> From: Ray Andrews In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28363 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-11-10 12:22, Bart Schaefer wrote: > > Most of the time you want the parens when assigning all the elements > of an array at once. You should not use the parens for anything > that's meant to be a single string (or number). Slowly I figure out what's really going on and don't have to rely on rote copying of syntax. > local MATCH MBEGIN MEND > which should never appear except inside a function, and should only > appear at the beginning of the function and not inside a loop. Heavy duty diagnostic stuff it seems. > $~foo (or ${~foo} means that the value of $foo should be interpreted > as a glob pattern rather than as a literal string. Ah!  When you type it in there verbatim it seems to always be the pattern, but as a variable who's to say that the intention is?  So some way of making it explicit avoids semantic confusion.  That's robust, I like it.  One more little thing: string="${cc[$aa]/*(#i)$filter*/}" if [[ "$string" ]]; then cc[aa]='' else cc[$aa]=${cc[$aa]/(#b)($~zsh_case${filter})/$'\e['$color;1m${match[1]}$'\e[0m'} ... to delete non-matching lines, but I'll bet there's a better way than this failed substitution.