diff options
| author | Daniel Colascione | 2025-03-27 16:04:51 -0400 |
|---|---|---|
| committer | Daniel Colascione | 2025-03-27 16:21:13 -0400 |
| commit | 364c3dbc12e7b6d41ab449dd495c96d08874310e (patch) | |
| tree | 33b6c05a49a9f71b12ee4096afa78f5c067e4371 /doc | |
| parent | 59fd8c26be2f7724a5c8cb583383f2025171c660 (diff) | |
| download | emacs-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.texi | 18 |
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 | |||
| 849 | a regexp or function that finds the definition of that object in its | 849 | a regexp or function that finds the definition of that object in its |
| 850 | source file. Each element's car is a symbol the describes the type of | 850 | source file. Each element's car is a symbol the describes the type of |
| 851 | object, or @code{nil} to identify functions defined with @code{defun}. | 851 | object, or @code{nil} to identify functions defined with @code{defun}. |
| 852 | Each element's cdr is a symbol: either the value of that symbol is a | 852 | Each element's cdr can be: |
| 853 | string interpreted as a regexp, or that symbol names a function that can | 853 | |
| 854 | find the definition. | 854 | @itemize |
| 855 | @item | ||
| 856 | A symbol whose value is a string interpreted as a regexp | ||
| 857 | @item | ||
| 858 | A symbol naming a function that can find the definition | ||
| 859 | @item | ||
| 860 | 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 | ||
| 861 | @end itemize | ||
| 855 | 862 | ||
| 856 | A regexp string is actually a format string, and @code{%s} will be | 863 | A regexp string is actually a format string, and @code{%s} will be |
| 857 | substituted with the name of the symbol we are looking for. | 864 | substituted 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. | |||
| 859 | A function will be called with one argument, the (symbol for) the object | 866 | A function will be called with one argument, the (symbol for) the object |
| 860 | we are searching for. | 867 | we are searching for. |
| 861 | 868 | ||
| 869 | The form-matcher function in a cons cell value is called with one argument (the | ||
| 870 | symbol being sought) and should return a function that takes a form and returns | ||
| 871 | non-nil if the form defines the sought symbol. This is useful for finding | ||
| 872 | definitions that are created by macro expansion. | ||
| 873 | |||
| 862 | @cindex @code{definition-name} (symbol property) | 874 | @cindex @code{definition-name} (symbol property) |
| 863 | If the function to be found is defined by a macro, it may be hard for | 875 | If the function to be found is defined by a macro, it may be hard for |
| 864 | Emacs to find the definition site in the source code. A macro call may | 876 | Emacs to find the definition site in the source code. A macro call may |