diff options
| author | Stefan Monnier | 2001-10-30 04:51:55 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-10-30 04:51:55 +0000 |
| commit | 1c787e34e5e286f6b09ce4f0723c653e9b496410 (patch) | |
| tree | 554338ed74125b09c7b266176f07687ea1690fc3 | |
| parent | 98a68b08dffde383d2ce520cb8fef4351ecd2a0f (diff) | |
| download | emacs-1c787e34e5e286f6b09ce4f0723c653e9b496410.tar.gz emacs-1c787e34e5e286f6b09ce4f0723c653e9b496410.zip | |
(find-function-search-for-symbol):
If the regexp doesn't match, use a looser one.
(find-variable-noselect): Add `file' argument.
| -rw-r--r-- | lisp/emacs-lisp/find-func.el | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index db5be92b7b1..99ad46c88b0 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el | |||
| @@ -144,7 +144,12 @@ If VARIABLE-P is nil, `find-function-regexp' is used, otherwise | |||
| 144 | (progn | 144 | (progn |
| 145 | (set-syntax-table emacs-lisp-mode-syntax-table) | 145 | (set-syntax-table emacs-lisp-mode-syntax-table) |
| 146 | (goto-char (point-min)) | 146 | (goto-char (point-min)) |
| 147 | (if (re-search-forward regexp nil t) | 147 | (if (or (re-search-forward regexp nil t) |
| 148 | (re-search-forward | ||
| 149 | (concat "^([^ ]+ +" | ||
| 150 | (regexp-quote (symbol-name symbol)) | ||
| 151 | "\\>") | ||
| 152 | nil t)) | ||
| 148 | (progn | 153 | (progn |
| 149 | (beginning-of-line) | 154 | (beginning-of-line) |
| 150 | (cons (current-buffer) (point))) | 155 | (cons (current-buffer) (point))) |
| @@ -278,18 +283,18 @@ See `find-function' for more details." | |||
| 278 | (find-function-do-it function nil 'switch-to-buffer-other-frame)) | 283 | (find-function-do-it function nil 'switch-to-buffer-other-frame)) |
| 279 | 284 | ||
| 280 | ;;;###autoload | 285 | ;;;###autoload |
| 281 | (defun find-variable-noselect (variable) | 286 | (defun find-variable-noselect (variable &optional file) |
| 282 | "Return a pair `(buffer . point)' pointing to the definition of SYMBOL. | 287 | "Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL. |
| 283 | 288 | ||
| 284 | Finds the Emacs Lisp library containing the definition of SYMBOL | 289 | Finds the Emacs Lisp library containing the definition of SYMBOL |
| 285 | in a buffer and the point of the definition. The buffer is | 290 | in a buffer and the point of the definition. The buffer is |
| 286 | not selected. | 291 | not selected. |
| 287 | 292 | ||
| 288 | The library where VARIABLE is defined is searched for in | 293 | The library where VARIABLE is defined is searched for in FILE or |
| 289 | `find-function-source-path', if non nil, otherwise in `load-path'." | 294 | `find-function-source-path', if non nil, otherwise in `load-path'." |
| 290 | (if (not variable) | 295 | (if (not variable) |
| 291 | (error "You didn't specify a variable")) | 296 | (error "You didn't specify a variable")) |
| 292 | (let ((library (symbol-file variable))) | 297 | (let ((library (or file (symbol-file variable)))) |
| 293 | (find-function-search-for-symbol variable 'variable library))) | 298 | (find-function-search-for-symbol variable 'variable library))) |
| 294 | 299 | ||
| 295 | ;;;###autoload | 300 | ;;;###autoload |