From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: a property "definition-type" would help find macro-defined tests Date: Thu, 09 Jan 2025 08:57:06 +0200 Message-ID: <86frls3265.fsf@gnu.org> References: <326902.1736358296@pental.sg.gildea.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5025"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stephen Gildea Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 09 07:58:18 2025 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 1tVmUj-0001Aw-9k for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Jan 2025 07:58:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVmTo-0003YW-49; Thu, 09 Jan 2025 01:57:20 -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 1tVmTl-0003YD-1r for emacs-devel@gnu.org; Thu, 09 Jan 2025 01:57:17 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tVmTh-0000OQ-T5; Thu, 09 Jan 2025 01:57:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=m01cAs3wnUNN63FsCVt5EpzC4lbGOeDLBB+EwCpX1M0=; b=L+741tSDA924 ESdpaYhCQcd9WKUPAbRPBHcA9a/8swLmL5B+WNVZ8icSWmd83xmS4H9SE7v8yGsfuUjOPaBA9qPaQ oZ2TFboqjl9Q7OCMTdovyVlvv0pl0f8ePo+4jFPyh0LE/ul5lXUIdziehHnjT7/DAf33P1lI6OkVE +9Z4YiC3S1SOyWuqjESloxYgWVCsrbIpVjOLvZe+j/K2FXuRgnqMSSCzAvR20KnArSSkzLT/Qr3fx azsxpYKEp/2FiadG1mdrodTxZq3M0rljzelCBwOV79jtmUrMM37Rqf65OxlFyM4sKfpY0OW8aenr0 X1tHczlvMxCFOEn0lt4cbw==; In-Reply-To: <326902.1736358296@pental.sg.gildea.net> (message from Stephen Gildea on Wed, 08 Jan 2025 09:44:56 -0800) 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:327806 Archived-At: > From: Stephen Gildea > Date: Wed, 08 Jan 2025 09:44:56 -0800 > > Thank you for your implied offer to review my small patch. > I had not expected so much interest. I thought you did, actually. > --- a/lisp/emacs-lisp/find-func.el > +++ b/lisp/emacs-lisp/find-func.el > @@ -400,9 +400,13 @@ find-function-search-for-symbol > Visit the library in a buffer, and return a cons cell (BUFFER . POSITION), > or just (BUFFER . nil) if the definition can't be found in the file. > > -If TYPE is nil, look for a function definition. > -Otherwise, TYPE specifies the kind of definition, > -and it is interpreted via `find-function-regexp-alist'. > +If TYPE is nil, look for a function definition, otherwise, TYPE specifies > +the kind of definition. If SYMBOL has a property `definition-type', > +the property value is used instead of TYPE. (Macros that define objects > +can put a `definition-type' on the symbol to help find an > +unusual-looking definition site.) > +TYPE is interpreted via `find-function-regexp-alist'. I think this kind of details do not belong to doc strings. If you think it's very important to point this out to readers of the doc string, you could include in the doc string a link to the ELisp reference manual. > --- a/doc/lispref/symbols.texi > +++ b/doc/lispref/symbols.texi > @@ -536,9 +536,16 @@ Standard Properties > related functions. @xref{Variable Definitions}. > > @item definition-name > -This property is used to find the definition of a symbol in the source > -code, when it might be hard to find the definition by textual search > -of the source file. For example, a @code{define-derived-mode} > +@itemx definition-type > +These properties help find the definition of a symbol in the source > +code when it might be hard to find the definition by textual search > +of the source file. > +The Emacs Help commands such as @kbd{C-h f} (@pxref{Help,,, > +emacs, The GNU Emacs Manual}) use these properties to show the definition > +of a symbol via a button in the @file{*Help*} buffer where the > +symbol's documentation is shown. These (and AFAICT all the other properties in this node) should be indexed. > +Here is an example using a function to find the definition: This is a long example with 3 distinct top-level forms in it. I suggest to wrap each group in @group..@end @group" to prevent breaking each group between different pages, which makes them harder to read. Finally, what about a NEWS entry announcing this new property?