; Fix documentation of a recently-installed change

* lisp/emacs-lisp/find-func.el (find-function-regexp-alist): Doc fix.

* doc/lispref/functions.texi (Finding Definitions): Fix wording
and markup.

* etc/NEWS: Move the new item where it belongs.
This commit is contained in:
Eli Zaretskii 2025-03-28 09:32:29 +03:00
parent 01f4a0cb6c
commit 9720e1a96e
3 changed files with 22 additions and 17 deletions

View file

@ -849,15 +849,17 @@ The alist @code{find-function-regexp-alist} associates object types with
a regexp or function that finds the definition of that object in its
source file. Each element's car is a symbol the describes the type of
object, or @code{nil} to identify functions defined with @code{defun}.
Each element's cdr can be:
Each element's cdr can be one of the following:
@itemize
@item
A symbol whose value is a string interpreted as a regexp
A symbol whose value is a string interpreted as a regexp.
@item
A symbol naming a function that can find the definition
A symbol naming a function that can find the definition.
@item
A cons cell where the car is a regexp (or function that returns one) and the cdr is a function that creates a matcher for macroexpanded forms
A cons cell where the @code{car} is a regexp (or function that returns
one) and the @code{cdr} is @dfn{form-matcher}: a function that creates a
matcher for macro-expanded forms.
@end itemize
A regexp string is actually a format string, and @code{%s} will be
@ -866,10 +868,11 @@ substituted with the name of the symbol we are looking for.
A function will be called with one argument, the (symbol for) the object
we are searching for.
The form-matcher function in a cons cell value is called with one argument (the
symbol being sought) and should return a function that takes a form and returns
non-nil if the form defines the sought symbol. This is useful for finding
definitions that are created by macro expansion.
The form-matcher function in a cons cell value is called with one
argument (the symbol being sought) and should return a function; that
function should take a form and return non-@code{nil} if the form
defines the sought symbol. This is useful for finding definitions that
are created by expansion of macros.
@cindex @code{definition-name} (symbol property)
If the function to be found is defined by a macro, it may be hard for

View file

@ -75,8 +75,7 @@ the 'standard-display-table's extra slots with Unicode characters.
Please see the documentation of that function to see which slots of the
display table it changes.
---
** 'find-function' can now find cl-defmethod invocations hidden inside macros.
+++
** Child frames are now supported on TTY frames.
This supports use-cases like Posframe, Corfu, and child frames acting
like tooltips.
@ -147,6 +146,9 @@ The new minor mode defines the keys at a higher precedence level than
the old function, one more usual for a minor mode. To restore the old
behavior, customize 'find-function-mode-lower-precedence' to non-nil.
---
** 'find-function' can now find 'cl-defmethod' invocations inside macros.
** Minibuffer and Completions
+++

View file

@ -146,13 +146,13 @@ we're looking for) and it should search for it.
A value can also be a cons (REGEX . EXPANDED-FORM-MATCHER-FACTORY).
REGEX is as above; EXPANDED-FORM-MATCHER-FACTORY is a function of one
argument, the same as we'd pass to a REGEX function, that returns
another function of one argument that returns true if we're looking at a
macroexpanded form that defines what we're looking for. If you want to
use EXPANDED-FORM-MATCHER-FACTORY exclusively, you can set REGEX to a
never-match regex and force the fallback to
EXPANDED-FORM-MATCHER-FACTORY. The buffer to search is current during
the call to EXPANDED-FORM-MATCHER-FACTORY.
argument, the same object we'd pass to a REGEX function; it should return
another function of one argument that returns non-nil if we're looking at
a macroexpanded form that defines the object we're looking for.
If you want to use EXPANDED-FORM-MATCHER-FACTORY exclusively, you can
set REGEX to a never-match regexp, and force the fallback to
EXPANDED-FORM-MATCHER-FACTORY. EXPANDED-FORM-MATCHER-FACTORY is
called with the buffer to search the current one.
Symbols can have their own version of this alist on
the property `find-function-type-alist'.