54 |
;; :prefix "find-function" |
;; :prefix "find-function" |
55 |
:group 'lisp) |
:group 'lisp) |
56 |
|
|
57 |
|
(defconst find-function-space-re "\\(?:\\s-\\|\n\\|;.*\n\\)+") |
58 |
|
|
59 |
(defcustom find-function-regexp |
(defcustom find-function-regexp |
60 |
;; Match things like (defun foo ...), (defmacro foo ...), |
;; Match things like (defun foo ...), (defmacro foo ...), |
61 |
;; (define-skeleton foo ...), (define-generic-mode 'foo ...), |
;; (define-skeleton foo ...), (define-generic-mode 'foo ...), |
62 |
;; (define-derived-mode foo ...), (define-minor-mode foo) |
;; (define-derived-mode foo ...), (define-minor-mode foo) |
63 |
"^\\s-*(\\(def\\(ine-skeleton\\|ine-generic-mode\\|ine-derived-mode\\|\ |
(concat |
64 |
|
"^\\s-*(\\(def\\(ine-skeleton\\|ine-generic-mode\\|ine-derived-mode\\|\ |
65 |
\[^cgv\W]\\w+\\*?\\)\\|define-minor-mode\ |
\[^cgv\W]\\w+\\*?\\)\\|define-minor-mode\ |
66 |
\\|easy-mmode-define-global-mode\\)\\(\\s-\\|\n\\)+\\('\\|\(quote \\)?\ |
\\|easy-mmode-define-global-mode\\)" find-function-space-re |
67 |
%s\\(\\s-\\|$\\|\(\\|\)\\)" |
"\\('\\|\(quote \\)?%s\\(\\s-\\|$\\|\(\\|\)\\)") |
68 |
"The regexp used by `find-function' to search for a function definition. |
"The regexp used by `find-function' to search for a function definition. |
69 |
Note it must contain a `%s' at the place where `format' |
Note it must contain a `%s' at the place where `format' |
70 |
should insert the function name. The default value avoids `defconst', |
should insert the function name. The default value avoids `defconst', |
76 |
:version "21.1") |
:version "21.1") |
77 |
|
|
78 |
(defcustom find-variable-regexp |
(defcustom find-variable-regexp |
79 |
"^\\s-*(def[^umag]\\(\\w\\|\\s_\\)+\\*?\\s-+%s\\(\\s-\\|$\\)" |
(concat"^\\s-*(def[^umag]\\(\\w\\|\\s_\\)+\\*?" find-function-space-re "%s\\(\\s-\\|$\\)") |
80 |
"The regexp used by `find-variable' to search for a variable definition. |
"The regexp used by `find-variable' to search for a variable definition. |
81 |
It should match right up to the variable name. The default value |
It should match right up to the variable name. The default value |
82 |
avoids `defun', `defmacro', `defalias', `defadvice', `defgroup'. |
avoids `defun', `defmacro', `defalias', `defadvice', `defgroup'. |
148 |
(goto-char (point-min)) |
(goto-char (point-min)) |
149 |
(if (or (re-search-forward regexp nil t) |
(if (or (re-search-forward regexp nil t) |
150 |
(re-search-forward |
(re-search-forward |
151 |
(concat "^([^ ]+\\(\\s-\\|\n\\)+" |
(concat "^([^ ]+" find-function-space-re "['(]" |
152 |
(regexp-quote (symbol-name symbol)) |
(regexp-quote (symbol-name symbol)) |
153 |
"\\>") |
"\\>") |
154 |
nil t)) |
nil t)) |