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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9399 invoked from network); 16 Oct 2020 13:29:19 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Oct 2020 13:29:19 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1602854959; b=WyWLlt1YWS9cwcDA2E4Rbns3OLu5oMEGGIfG9o/PsfBO6UgUZE9rGy/+y+oyKWMsydgJGnd6uu urnTk56034YDxBfR5gu6gRNXUvz/4MfUHcGWd6W8gskYEzJvxSefN7C1xxHRL/I2WdWI0QBl5d kJC8LOSga6APZDd+N2u28HmlMF04/pIykEWA9GNgnIdGGUfHWYCw0GSR1y1U6gFnmQz7Uz6PDv 47CMptXvj0dwcgNQaFRi+4bIA93+EZhazPMWcOPvJ/z0dlyqJJfw7pPXQxzRrdBpvddQmpOs9S 2UbCQMcNy5Vk8U4Do+U0qSYD/W89hSeW1j2/gKeTQ96UMA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1602854959; bh=zjTd28F9IdJTuTIfDVpgHXh65s1BZLRNuC3JbRmPZXM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Subject:Cc:To:From: Date:References:In-Reply-To:Message-ID:MIME-Version:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=Uf4RfUWg0AVJYWrTxKyUAaE4N05Ll6f8PwVzS75w0Y+BwIZfbXtxpRVzhq9OCMjv/r9yt2mn5r hMkbSiU+UxMnk3j3tiBRSEJ9lYAaghBp4j2rKMn9IaES+AoDDkSJ5un+nY35cfR5W/gaCRjQ/K 36k1icgb/0q0LqIgj9UJj1y5ksTxUdnU0fo9XZ8H58py8WzzOSf9c3jJqENtuSo2+S6haThC1g P9aDXkQA6Nfhg9gX1aGARU4TCViR9MGp1hy+LJbH+OUJ9WlLeeB8wX23+8oooBVC4WRWBpHju7 PQZLWoYbM6OmpRxiPb5WpbHJdR5mbkdkifP2Tz8NovG6Nw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Subject:Cc:To:From:Date:References:In-Reply-To:Message-Id: Mime-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=gq5T51+5yo5XpVFhiPCfoj1yx6k5bd0XdsNs/TG4M34=; b=R75BLSyGGWRv0msxiTWEfm+50A 9lVhWrer0mjtEihDoZiivNe9ZUY+2u4xJqaoZc6gV69W90N1dCsvfayx2GmYRslpzkfBMX43MQAeU 8lFQg2Xv8/igvao1yitofdw7b3daV4if5F4rMYchjup9SWH54QaXifmsP4LyOQI45PD/1Sh3J2EuE f2qJzYBWZRYcjiSuLNL6Wq9JwrnVO+bT1cj5rEb5BgQiSEn3D2jFTZhKwxiMi20OAoEx25NYMkSvD qR2LsjkjnXsx5vZfhunTDgtFHuShhrOrZQh+AOH5Ba/Pl6bhEiGMHczTu6TWezlWY+Uvm8HTeEMMC +8w1FV4Q==; Received: from authenticated user by zero.zsh.org with local id 1kTPnJ-000Mz2-Ho; Fri, 16 Oct 2020 13:29:17 +0000 Authentication-Results: zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from out2-smtp.messagingengine.com ([66.111.4.26]:54845) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1kTPmz-000Moi-VL; Fri, 16 Oct 2020 13:28:59 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id AF1305C0103; Fri, 16 Oct 2020 09:28:56 -0400 (EDT) Received: from imap22 ([10.202.2.72]) by compute3.internal (MEProxy); Fri, 16 Oct 2020 09:28:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=mime-version:message-id:in-reply-to :references:date:from:to:cc:subject:content-type :content-transfer-encoding; s=fm1; bh=gq5T51+5yo5XpVFhiPCfoj1yx6 k5bd0XdsNs/TG4M34=; b=KzQGdkav5LoeVCNWUvf3yO4++dqjue15BpEKpgyGoA Nuuc9DThpTb4KA/mJtW0nMV88FX7Ph0lLlPICJnUdgR9rcrcdYgzo9YIJvOrQHq8 CP/YirAxfNpsayQZc3MBnUmpKK0hdqulettI22iqm0aVDabhbievocQ2Gpi3MuHn mw8z8haJbJqAqnupuHoihsFBDSY77IwwgLxbiucn7R5BOEqGOnaq79O5IF4pgzAB RLt53pHrAmTEnXdiTnH1ses7MeGBxx+Q9HBRnVVSYdBmHeXDbylUQV84iHF/+Mko t9t9IGJ59TPen6qro7KjWfn4fa41yJ+SOGtdmDo/MZ+w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=gq5T51+5yo5XpVFhiPCfoj1yx6k5bd0XdsNs/TG4M 34=; b=hmNCVVYSoSKzf6YWDO3FtCZFK2dzf1vfGVoONfYxLJmPejZAJMOn5P+vj oDiX0tOf1+GnL6WdZ1c97G9tDZRj/EFHZ3tGNnjVML0YTIQvQ7Lz29//dO1os/j3 oLDqfYoEPQVnM3lOyLl/ymjwaYPi7UIZHzVoNgJ7PFljlLRRL/tXv1L/bKJXS1mj HEUwfk8VRlXLvWzVTDXKEV24kZDwNkN0ZUcKhwFQ+PPCNc3VW+5bkqwrTtP00RdD HYqEGBJ9jgwEViUtavaG+N6DrdpJ5SU1bGhcEmSQjxR+LN6LVGyvMUxaoekOPtfx GYMYHxiby/0OvLMJTFXlRAPVmHr8w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrieehgdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepfdffrghn ihgvlhcuufhhrghhrghffdcuoegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvg eqnecuggftrfgrthhtvghrnhepfefhkeefveeileelheeiffdtkedujeelvdfhtdejtdeg gedvuefffeelhefhvdfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepugdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgv X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 0CAC26680078; Fri, 16 Oct 2020 09:28:55 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-489-gf39678d-fm-20201011.001-gf39678d0 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <20201014204621.4cf5b2b0@tarpaulin.shahaf.local2> Date: Fri, 16 Oct 2020 13:28:35 +0000 From: "Daniel Shahaf" To: "Roman Perepelitsa" Cc: "Marlon Richert" , "Zsh hackers list" Subject: =?UTF-8?Q?Re:_region=5Fhighlight_converts_`fg=3Ddefault`_to_`none`,_whic?= =?UTF-8?Q?h_is_not_the_same?= Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Seq: 47465 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: Roman Perepelitsa wrote on Thu, 15 Oct 2020 07:37 +00:00: > I could imagine two simple merging strategies: >=20 > 1. All attributes are merged, so fg=3D1 + bg=3D2 + underline would res= ult > in underlined red text on green background. > 2. The second highlight completely overrides the first. fg=3D1 + bg=3D= 2 + > underline results in underlined text with the default color and no > background. >=20 > The meaning of "none" naturally follows from the choice of merging > strategy. In the first case region highlight with "none" spec has no > effect (X + none =3D> X). In the second case such a region is displaye= d > without any highlighting (X + none =3D> no highlighting). >=20 > The actual code does something else. If a spec has fg or bg with any > value other than "default", then the spec completely overrides the > previous spec. Otherwise the spec is merged with the previous spec > with one exception: fg=3Ddefault and bg=3Ddefault have no effect (fg=3D= 1 + > fg=3Ddefault,underline =3D> fg=3D1,underline). >=20 > Note: "special" highlight is merged with a different algorithm. All > other highlights, including "region", "isearch" and "paste", are > merged the same way as the elements of region_highlights. >=20 > A few examples of what the current code does: >=20 > - fg=3D1 + bg=3D2 =3D> bg=3D2 > * the second spec completely overrides the first > - fg=3D1 + underline =3D> fg=3D1,underline > * specs are merged > - underline + fg=3D1 =3D> fg=3D1 > * the second spec completely overrides the first > - fg=3D1 + none =3D> fg=3D1 > * specs are merged > - fg=3D1 + fg=3Ddefault,underline =3D> fg=3D1,underline > * specs are merged except that fg=3Ddefault has no effect >=20 > This doesn't look ideal. So, how can we fix it? =E2=8B=AE > Thoughts? The inconsistent augmentation semantics have bugged me since I first ran= into them. I'd love to see them rationalized. Short on time, but in general terms: 1. Heed PEP 20. (E.g., the points about explicitness and ambiguity) 2. Proposed acceptance test: When two specs are added, A+B, for any desired visual outcome there should be a value of B that, _regardless= of the value of A_, achieves that outcome. Not sure how to get from the current semantics to acceptable ones. Mayb= e we could do, say: - fg=3D1 + bg=3D2,fg=3Dinherit =E2=87=92 fg=3D1,bg=3D2 - underline + fg=3D1,underline=3Dinherit =E2=87=92 fg=3D1,underline - none + fg=3D1,underline=3Dinherit =E2=87=92 fg=3D1 [no underline] As to =C2=ABfg=3D1 + fg=3Ddefault =E2=87=92 fg=3D1=C2=BB, I think we can= treat it as a bug and break compatibility?