summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2006-04-13 14:31:23 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2006-04-13 14:31:23 +0000
commita04e10bc37de92d6ce7d07b9782be6f0cabdcbb4 (patch)
treecf7c24d66a6daaa24580daa92a3e7da446517908 /lisp
parentfd4545a0c97d0039813cb406b47fb9d56e662172 (diff)
downloademacs-a04e10bc37de92d6ce7d07b9782be6f0cabdcbb4.tar.gz
(find-function-search-for-symbol): Add comments.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/find-func.el8
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."
(with-syntax-table emacs-lisp-mode-syntax-table
(goto-char (point-min))
(if (or (re-search-forward regexp nil t)
+ ;; `regexp' matches definitions using known forms like
+ ;; `defun', or `defvar'. But some functions/variables
+ ;; are defined using special macros (or functions), so
+ ;; if `regexp' can't find the definition, we look for
+ ;; something of the form "(SOMETHING <symbol> ...)".
+ ;; This fails to distinguish function definitions from
+ ;; variable declarations (or even uses thereof), but is
+ ;; a good pragmatic fallback.
(re-search-forward
(concat "^([^ ]+" find-function-space-re "['(]?"
(regexp-quote (symbol-name symbol))