From: Stefan Monnier Date: Thu, 13 Apr 2006 14:31:23 +0000 (+0000) Subject: (find-function-search-for-symbol): Add comments. X-Git-Tag: emacs-pretest-22.0.90~3148 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a04e10bc37de92d6ce7d07b9782be6f0cabdcbb4;p=emacs.git (find-function-search-for-symbol): Add comments. --- 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 ...)". + ;; 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))