emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a property "definition-type" would help find macro-defined tests


From: Eli Zaretskii
Subject: Re: a property "definition-type" would help find macro-defined tests
Date: Thu, 09 Jan 2025 08:57:06 +0200

> From: Stephen Gildea <stepheng+emacs@gildea.com>
> 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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]