From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Lawrence Newsgroups: gmane.emacs.devel Subject: Re: a property "definition-type" would help find macro-defined tests Date: Sun, 22 Dec 2024 18:12:59 +0100 Message-ID: <87wmfrmyjo.fsf@recursewithless.net> References: <353457.1734800027@pental.sg.gildea.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34867"; mail-complaints-to="usenet@ciao.gmane.io" To: Stephen Gildea , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 22 18:14:37 2024 Return-path: 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 ) id 1tPPXH-0008tE-C3 for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Dec 2024 18:14:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPPVv-00030U-Mi; Sun, 22 Dec 2024 12:13:11 -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 ) id 1tPPVt-000303-U1 for emacs-devel@gnu.org; Sun, 22 Dec 2024 12:13:09 -0500 Original-Received: from fout-b7-smtp.messagingengine.com ([202.12.124.150]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tPPVs-0000Mv-5d for emacs-devel@gnu.org; Sun, 22 Dec 2024 12:13:09 -0500 Original-Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id EAE69114006F; Sun, 22 Dec 2024 12:13:06 -0500 (EST) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Sun, 22 Dec 2024 12:13:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= recursewithless.net; h=cc:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1734887586; x=1734973986; bh=WseDyvEI633ck+UfLd3imtl4CnSi47UnlkUAV0pA1Pc=; b= SYZKGGsMjJPbxK9MkCxA3bf//3vAYDJFpqbkbbXAtkQ8SNyXSezkQwgLuXxQbd9/ XVqpJDKNKfZXTI0pdnH27YdeWxg7TSmhts5xvohBd7qNilcf79D8bjgIkvsgxMze jXj7ARnkv0KOJ3wB40UWAwpH9yQymcMViyNMGv4DUyhmUNpoYTxGMkWOBJQHvTcn mksIMFDoUsvw2y860Xqx3ZD581hjjiWE+lJBZ9pifhffhDTRqkuSJNjZhfj9dHPd kjkbxvYREDFgu8pAGB03cpsQwDFLNbHlcCOPK6+0QvZoVIfgSNMV8/qA19sjeu+i 6oZg1BGCbOITNB2Ac3feuQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1734887586; x=1734973986; bh=WseDyvEI633ck+UfLd3imtl4CnSi47UnlkU AV0pA1Pc=; b=d8itdD76Cd9VQgh2ZoE4X2Mrnq+lfl6rI8+mp4m9ZSRh8t1zbG0 93RTz7HEb5Rrn5yX8NHmLPfRf4XzFcId4rwUJlCykyVAIiINdqJgaU9G/s0EytyT H/awbr9UB+11SjG5qKTGF+fg3ul5SVbWuAn4Yp7RgU65Ow5SJBX7hDwYF7HPNUAJ kyOODrx0/NKNJ6xB5+ecz4rxUJWoWdRDoEajMxYPfbNaUFIgRTnaQGZ4f9aj4pFK On5EVTLD0xTk1gEpcCWbbooyU/d2PF2M0O15rbsL92eehZdEdxusSEcsdNxIcFBV fdZGb/CcZqZaUnDq2wnwAM2n91Qs/AzpWnw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddtkedgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffujg hffffkgggtsehttdertddttddtnecuhfhrohhmpeftihgthhgrrhguucfnrgifrhgvnhgt vgcuoehrfihlsehrvggtuhhrshgvfihithhhlhgvshhsrdhnvghtqeenucggtffrrghtth gvrhhnpeffuddviedtveejteeggfffffduhfehlefhffeivefgleejvdefkeevgfektdff hfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrfi hlsehrvggtuhhrshgvfihithhhlhgvshhsrdhnvghtpdhnsggprhgtphhtthhopedvpdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehsthgvphhhvghnghdovghmrggtshesgh hilhguvggrrdgtohhmpdhrtghpthhtohepvghmrggtshdquggvvhgvlhesghhnuhdrohhr gh X-ME-Proxy: Feedback-ID: if7394488:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 22 Dec 2024 12:13:06 -0500 (EST) In-Reply-To: <353457.1734800027@pental.sg.gildea.net> Received-SPF: pass client-ip=202.12.124.150; envelope-from=rwl@recursewithless.net; helo=fout-b7-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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:326868 Archived-At: Stephen Gildea writes: > I propose a new property, "definition-type", that a macro could > put on a symbol. If present, "find-function-search-for-symbol" > would use that type instead of the passed-in type. > > With this enhancement, any subsystem that uses a macro to > define objects could > - have the macro set property "definition-type" on the > symbols it defines, and > - add an entry to "find-function-regexp-alist" saying how to > find the new type. > ... > Does this seem like a generally useful addition? As someone who's recently written a macro to define a bunch of tests, and was then mildly frustrated that e.g. ert-results-pop-to-should-forms-for-test-at-point didn't even come close to finding the definitions, something like this sounds useful to me! I wonder if there isn't already some better way to do this, though, that find-function-search-for-symbol could make use of. I got curious and briefly went down a rabbit hole looking for one, since there are functions like `symbol-file' and the intriguing `symbol-with-pos-pos'. The latter extracts a position from a mysterious-to-me entity called a "symbol with position". Perhaps there's *already* a standard way to tag a symbol with a position in a source file somehow, and what's needed is to encourage macro writers to use it, and to adjust the find-function* functions to look for it? Someone who knows more than me about Emacs internals could shed more light here...but anyway, if there isn't, I like the idea! Best, Richard