changeset 70013:d30be4cf861a

(find-function-search-for-symbol): Add comments.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 13 Apr 2006 14:31:23 +0000
parents 5ef1c2eeca24
children 876ca9433460
files lisp/emacs-lisp/find-func.el
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/find-func.el	Thu Apr 13 13:50:07 2006 +0000
+++ b/lisp/emacs-lisp/find-func.el	Thu Apr 13 14:31:23 2006 +0000
@@ -228,6 +228,14 @@
 	  (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))