diff options
| author | Richard M. Stallman | 2006-07-12 16:03:47 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-07-12 16:03:47 +0000 |
| commit | 39ff5f6495b22f79f2b94bf251d23ebe4d18b0ad (patch) | |
| tree | 5a105df4a30a2ae05e24fd7846a9dc8e498e129e | |
| parent | 84333e068eca39d0867d169b8bc479bb2c32a69c (diff) | |
| download | emacs-39ff5f6495b22f79f2b94bf251d23ebe4d18b0ad.tar.gz emacs-39ff5f6495b22f79f2b94bf251d23ebe4d18b0ad.zip | |
(find-function-search-for-symbol):
If can't find definition, return nil for position.
(find-function-do-it): Handle new return value of find-definition-noselect.
(find-definition-noselect, find-variable-noselect): Doc fix.
(find-function-noselect): Doc fix.
| -rw-r--r-- | lisp/emacs-lisp/find-func.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 5d504586323..41c940f1cec 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el | |||
| @@ -205,6 +205,9 @@ TYPE should be nil to find a function, or `defvar' to find a variable." | |||
| 205 | ;;;###autoload | 205 | ;;;###autoload |
| 206 | (defun find-function-search-for-symbol (symbol type library) | 206 | (defun find-function-search-for-symbol (symbol type library) |
| 207 | "Search for SYMBOL's definition of type TYPE in LIBRARY. | 207 | "Search for SYMBOL's definition of type TYPE in LIBRARY. |
| 208 | Visit the library in a buffer, and return a cons cell (BUFFER . POSITION), | ||
| 209 | or just (BUFFER . nil) if the definition can't be found in the file. | ||
| 210 | |||
| 208 | If TYPE is nil, look for a function definition. | 211 | If TYPE is nil, look for a function definition. |
| 209 | Otherwise, TYPE specifies the kind of definition, | 212 | Otherwise, TYPE specifies the kind of definition, |
| 210 | and it is interpreted via `find-function-regexp-alist'. | 213 | and it is interpreted via `find-function-regexp-alist'. |
| @@ -244,8 +247,7 @@ The search is done in the source for library LIBRARY." | |||
| 244 | (progn | 247 | (progn |
| 245 | (beginning-of-line) | 248 | (beginning-of-line) |
| 246 | (cons (current-buffer) (point))) | 249 | (cons (current-buffer) (point))) |
| 247 | (error "Cannot find definition of `%s' in library `%s'" | 250 | (cons (current-buffer) nil)))))))) |
| 248 | symbol library)))))))) | ||
| 249 | 251 | ||
| 250 | ;;;###autoload | 252 | ;;;###autoload |
| 251 | (defun find-function-noselect (function) | 253 | (defun find-function-noselect (function) |
| @@ -253,7 +255,8 @@ The search is done in the source for library LIBRARY." | |||
| 253 | 255 | ||
| 254 | Finds the source file containing the definition of FUNCTION | 256 | Finds the source file containing the definition of FUNCTION |
| 255 | in a buffer and the point of the definition. The buffer is | 257 | in a buffer and the point of the definition. The buffer is |
| 256 | not selected. | 258 | not selected. If the function definition can't be found in |
| 259 | the buffer, returns (BUFFER). | ||
| 257 | 260 | ||
| 258 | If the file where FUNCTION is defined is not known, then it is | 261 | If the file where FUNCTION is defined is not known, then it is |
| 259 | searched for in `find-function-source-path' if non nil, otherwise | 262 | searched for in `find-function-source-path' if non nil, otherwise |
| @@ -335,7 +338,7 @@ Set mark before moving, if the buffer already existed." | |||
| 335 | (when (memq new-buf orig-buffers) | 338 | (when (memq new-buf orig-buffers) |
| 336 | (push-mark orig-point)) | 339 | (push-mark orig-point)) |
| 337 | (funcall switch-fn new-buf) | 340 | (funcall switch-fn new-buf) |
| 338 | (goto-char new-point) | 341 | (when new-point (goto-char new-point)) |
| 339 | (recenter find-function-recenter-line) | 342 | (recenter find-function-recenter-line) |
| 340 | (run-hooks 'find-function-after-hook)))) | 343 | (run-hooks 'find-function-after-hook)))) |
| 341 | 344 | ||
| @@ -376,6 +379,7 @@ See `find-function' for more details." | |||
| 376 | 379 | ||
| 377 | Finds the library containing the definition of VARIABLE in a buffer and | 380 | Finds the library containing the definition of VARIABLE in a buffer and |
| 378 | the point of the definition. The buffer is not selected. | 381 | the point of the definition. The buffer is not selected. |
| 382 | If the variable's definition can't be found in the buffer, return (BUFFER). | ||
| 379 | 383 | ||
| 380 | The library where VARIABLE is defined is searched for in FILE or | 384 | The library where VARIABLE is defined is searched for in FILE or |
| 381 | `find-function-source-path', if non nil, otherwise in `load-path'." | 385 | `find-function-source-path', if non nil, otherwise in `load-path'." |
| @@ -421,6 +425,7 @@ See `find-variable' for more details." | |||
| 421 | ;;;###autoload | 425 | ;;;###autoload |
| 422 | (defun find-definition-noselect (symbol type &optional file) | 426 | (defun find-definition-noselect (symbol type &optional file) |
| 423 | "Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL. | 427 | "Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL. |
| 428 | If the definition can't be found in the buffer, return (BUFFER). | ||
| 424 | TYPE says what type of definition: nil for a function, `defvar' for a | 429 | TYPE says what type of definition: nil for a function, `defvar' for a |
| 425 | variable, `defface' for a face. This function does not switch to the | 430 | variable, `defface' for a face. This function does not switch to the |
| 426 | buffer nor display it. | 431 | buffer nor display it. |