From: Eli Zaretskii <eliz@gnu.org>
To: Stephen Gildea <stepheng+emacs@gildea.com>
Cc: emacs-devel@gnu.org
Subject: Re: a property "definition-type" would help find macro-defined tests
Date: Thu, 09 Jan 2025 08:57:06 +0200 [thread overview]
Message-ID: <86frls3265.fsf@gnu.org> (raw)
In-Reply-To: <326902.1736358296@pental.sg.gildea.net> (message from Stephen Gildea on Wed, 08 Jan 2025 09:44:56 -0800)
> 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?
prev parent reply other threads:[~2025-01-09 6:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-21 16:53 a property "definition-type" would help find macro-defined tests Stephen Gildea
2024-12-22 17:12 ` Richard Lawrence
2025-01-07 22:13 ` Stephen Gildea
2025-01-08 12:31 ` Eli Zaretskii
2025-01-08 17:44 ` Stephen Gildea
2025-01-09 6:57 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86frls3265.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=stepheng+emacs@gildea.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).