]> git.eshelyaron.com Git - emacs.git/commitdiff
(find-function-search-for-symbol): Add comments.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 13 Apr 2006 14:31:23 +0000 (14:31 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 13 Apr 2006 14:31:23 +0000 (14:31 +0000)
lisp/emacs-lisp/find-func.el

index 754ad9fdf195e29c97c185abd03f5432dd05a019..5d5045863238c4c3c5037eddb439383388d0ae96 100644 (file)
@@ -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))