aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDaniel Colascione2025-03-27 16:04:51 -0400
committerDaniel Colascione2025-03-27 16:21:13 -0400
commit364c3dbc12e7b6d41ab449dd495c96d08874310e (patch)
tree33b6c05a49a9f71b12ee4096afa78f5c067e4371 /doc
parent59fd8c26be2f7724a5c8cb583383f2025171c660 (diff)
downloademacs-364c3dbc12e7b6d41ab449dd495c96d08874310e.tar.gz
emacs-364c3dbc12e7b6d41ab449dd495c96d08874310e.zip
Help find-function find methods defined inside macros
* doc/lispref/functions.texi (Finding Definitions): Document the expanded definition-finding extension mechanism. * etc/NEWS: Briefly describe the new feature. * lisp/emacs-lisp/cl-generic.el (cl--generic-find-defgeneric-regexp): Use defconst now that we no longer have purespace. (cl--generic-search-method-make-form-matcher): New function. * lisp/emacs-lisp/find-func.el (find-function-regexp-alist) (find-function-search-for-symbol): Parse out the new factory function. (find-function--search-by-expanding-macros): Try using it when searching for definitions by expanding macros.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/functions.texi18
1 files changed, 15 insertions, 3 deletions
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 1279b15b819..83acbff0885 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -849,9 +849,16 @@ The alist @code{find-function-regexp-alist} associates object types with
849a regexp or function that finds the definition of that object in its 849a regexp or function that finds the definition of that object in its
850source file. Each element's car is a symbol the describes the type of 850source file. Each element's car is a symbol the describes the type of
851object, or @code{nil} to identify functions defined with @code{defun}. 851object, or @code{nil} to identify functions defined with @code{defun}.
852Each element's cdr is a symbol: either the value of that symbol is a 852Each element's cdr can be:
853string interpreted as a regexp, or that symbol names a function that can 853
854find the definition. 854@itemize
855@item
856A symbol whose value is a string interpreted as a regexp
857@item
858A symbol naming a function that can find the definition
859@item
860A 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
861@end itemize
855 862
856A regexp string is actually a format string, and @code{%s} will be 863A regexp string is actually a format string, and @code{%s} will be
857substituted with the name of the symbol we are looking for. 864substituted with the name of the symbol we are looking for.
@@ -859,6 +866,11 @@ substituted with the name of the symbol we are looking for.
859A function will be called with one argument, the (symbol for) the object 866A function will be called with one argument, the (symbol for) the object
860we are searching for. 867we are searching for.
861 868
869The form-matcher function in a cons cell value is called with one argument (the
870symbol being sought) and should return a function that takes a form and returns
871non-nil if the form defines the sought symbol. This is useful for finding
872definitions that are created by macro expansion.
873
862@cindex @code{definition-name} (symbol property) 874@cindex @code{definition-name} (symbol property)
863If the function to be found is defined by a macro, it may be hard for 875If the function to be found is defined by a macro, it may be hard for
864Emacs to find the definition site in the source code. A macro call may 876Emacs to find the definition site in the source code. A macro call may