diff options
| author | Stefan Monnier | 2006-04-13 14:31:23 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2006-04-13 14:31:23 +0000 |
| commit | a04e10bc37de92d6ce7d07b9782be6f0cabdcbb4 (patch) | |
| tree | cf7c24d66a6daaa24580daa92a3e7da446517908 | |
| parent | fd4545a0c97d0039813cb406b47fb9d56e662172 (diff) | |
| download | emacs-a04e10bc37de92d6ce7d07b9782be6f0cabdcbb4.tar.gz emacs-a04e10bc37de92d6ce7d07b9782be6f0cabdcbb4.zip | |
(find-function-search-for-symbol): Add comments.
| -rw-r--r-- | lisp/emacs-lisp/find-func.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 754ad9fdf19..5d504586323 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el | |||
| @@ -228,6 +228,14 @@ The search is done in the source for library LIBRARY." | |||
| 228 | (with-syntax-table emacs-lisp-mode-syntax-table | 228 | (with-syntax-table emacs-lisp-mode-syntax-table |
| 229 | (goto-char (point-min)) | 229 | (goto-char (point-min)) |
| 230 | (if (or (re-search-forward regexp nil t) | 230 | (if (or (re-search-forward regexp nil t) |
| 231 | ;; `regexp' matches definitions using known forms like | ||
| 232 | ;; `defun', or `defvar'. But some functions/variables | ||
| 233 | ;; are defined using special macros (or functions), so | ||
| 234 | ;; if `regexp' can't find the definition, we look for | ||
| 235 | ;; something of the form "(SOMETHING <symbol> ...)". | ||
| 236 | ;; This fails to distinguish function definitions from | ||
| 237 | ;; variable declarations (or even uses thereof), but is | ||
| 238 | ;; a good pragmatic fallback. | ||
| 231 | (re-search-forward | 239 | (re-search-forward |
| 232 | (concat "^([^ ]+" find-function-space-re "['(]?" | 240 | (concat "^([^ ]+" find-function-space-re "['(]?" |
| 233 | (regexp-quote (symbol-name symbol)) | 241 | (regexp-quote (symbol-name symbol)) |