From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Dmitry Gutov <dmitry@gutov.dev>
Newsgroups: gmane.emacs.devel
Subject: Re: Improving 'pcase' documentation
Date: Mon, 20 Nov 2023 15:54:16 +0200
Message-ID: <05bd1167-13b6-01e5-ac6e-22370daaf41d@gutov.dev>
References: <19a64b7a-cec0-ed8a-d413-096451cc7413@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="38730"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
To: Jim Porter <jporterbugs@gmail.com>, emacs-devel@gnu.org
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 20 14:55:21 2023
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
Envelope-to: ged-emacs-devel@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1r54kC-0009pu-U5
	for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Nov 2023 14:55:21 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-devel-bounces@gnu.org>)
	id 1r54jM-00059L-AS; Mon, 20 Nov 2023 08:54:28 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <dmitry@gutov.dev>) id 1r54jK-00058g-52
 for emacs-devel@gnu.org; Mon, 20 Nov 2023 08:54:26 -0500
Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <dmitry@gutov.dev>) id 1r54jH-0004nQ-Sq
 for emacs-devel@gnu.org; Mon, 20 Nov 2023 08:54:25 -0500
Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46])
 by mailout.nyi.internal (Postfix) with ESMTP id 785755C034C;
 Mon, 20 Nov 2023 08:54:20 -0500 (EST)
Original-Received: from mailfrontend1 ([10.202.2.162])
 by compute2.internal (MEProxy); Mon, 20 Nov 2023 08:54:20 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :content-transfer-encoding:content-type:content-type:date:date
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:sender:subject:subject:to:to; s=fm2; t=
 1700488460; x=1700574860; bh=SHVAK4FkEaL2tMw2LGlVJVRjwEqcmOgu2Sw
 4xYcJPqI=; b=r36Ftp5+884/1UfHVKBhqPzZ8kvoFTQImoPEBY5TM/U9rr2RQB4
 sDTZebVQMsmn0xyy9Lgd++wTm0Md+qirtGI3OsE67t+UgnG0HGqpu2ILcxJBGkKl
 DGtsPjYq4xRAnN1OyzKPbwwy3xYPPmwtvkQs/RpyOp9v7gvIbii0+BV2r/g7VfKh
 86X+FOoEwjp3RIBd/Ly/fXu90oHp1HPWRTt5IOLVBhYfCt5GxGHyUAMqLJufautf
 DfcclfzRVoe5uFWdcnFH0EiqPGJNvxC8MtiCcXolUoWmTFIBUDUdQORu1NUlHf15
 Pv2flSk5jHD7GTFNkXK1QUgn3aIq6HqS79A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :content-type:date:date:feedback-id:feedback-id:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1700488460; x=
 1700574860; bh=SHVAK4FkEaL2tMw2LGlVJVRjwEqcmOgu2Sw4xYcJPqI=; b=y
 2CMHjIocLnnRQqPdKIAz8FxxRBPlGem4pcOwcCyQ31jCfO1gCsEQgTLe9AziH2b0
 PWChJiurH3syR927NDvTbvZzgbFaPO0PCTV4Q6qkiLBZJTyMyz7Qv24uUnYEInP/
 wWPvealLAuKfYilE1pOq8dH61uOHArca1MknWr19C4Cx/4LmC1dCVurFPMUMSAiQ
 6Bk7xe+Pahk0ozl1ByZfjbbs50x208xg0X2IuWzptlV7S3dWmFmmlzbTlJB8PlaH
 7LOY2e1L2rEb8iXzLWbg/2QOb2RuKjMuMf5LM6mkfffJhZLNhqYXmFZh/fVhcsst
 NASH94MsOBSS/o/F5+DDA==
X-ME-Sender: <xms:DGVbZQeVJHVICZ2bDBIxvcd284s31F_JP83TORCwgmX40GK3nQQfsw>
 <xme:DGVbZSPa4XqpmHZFkGaZIkqixrQ_n7i7UCEBUuszsQCIyRZb3uv-tOImkZXEZmUz-
 Q3VXxsNhlUX0lkqq9I>
X-ME-Received: <xmr:DGVbZRiryaU_48A60xjJJzcU4GgwemCRu81rVMWSs7zlZem3Yvl6prECeD3iyzrLjIBerA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudegjedgfeduucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtje
 ertddtfeejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhu
 thhovhdruggvvheqnecuggftrfgrthhtvghrnhepgeehtdehudejieetuedttdejkeehje
 etueekheffuddtjeeuvdefveeuveeiuddunecuvehluhhsthgvrhfuihiivgeptdenucfr
 rghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:DGVbZV_VmJVky55vZ5YLIt8F9jEnc1g6qvuLJOibac7vRz3rWNcgBA>
 <xmx:DGVbZcv3nVOc6sXsjn-fe0Pzl12Jt_Yq11UNduuXqNNdD37T2EC4Ag>
 <xmx:DGVbZcF_7YAYYRMinGjXGR9bEphkM1YiyI31x3s-caN1MU3RjmTHCg>
 <xmx:DGVbZS0TCGtB95hXcOdeCXBP2ADbbFwK_wwn3s3UOLXzcYotIdpLdg>
Feedback-ID: i0e71465a:Fastmail
Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 20 Nov 2023 08:54:19 -0500 (EST)
Content-Language: en-US
In-Reply-To: <19a64b7a-cec0-ed8a-d413-096451cc7413@gmail.com>
Received-SPF: pass client-ip=66.111.4.25; envelope-from=dmitry@gutov.dev;
 helo=out1-smtp.messagingengine.com
X-Spam_score_int: -67
X-Spam_score: -6.8
X-Spam_bar: ------
X-Spam_report: (-6.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-4.009,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=subscribe>
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org
Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org
Xref: news.gmane.io gmane.emacs.devel:313045
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/313045>

On 19/11/2023 22:14, Jim Porter wrote:
> Does anyone have any particular feedback on these ideas, suggestions of 
> what would be the most beneficial, etc?

I don't have much to add at the moment, but the list sounds great.

Number 6 might be more difficult to do than the rest, since we currently 
don't have any support for context-local syntax (another example would 
be 'should' forms in ert tests) in completion/font-lock, and any such 
logic would have consider the level of quoting/unquoting, but ultimately 
it can be done.

 > (I also think it'd be nice to font-lock anything that looks like 
",SYMBOL", even outside of 'pcase', but maybe others would find that 
annoying.)

And that sounds like a part of more general feature where local 
variables would be highlighted with font-lock-variable-name-face and 
font-lock-variable-use-face. To determine that ,foo is a variable 
declaration (inside a pcase form or anywhere) and not just a reference, 
font-lock would have to do some macro-expansion. I wonder what would be 
the performance implications of such general approach.