aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-07-12 16:03:47 +0000
committerRichard M. Stallman2006-07-12 16:03:47 +0000
commit39ff5f6495b22f79f2b94bf251d23ebe4d18b0ad (patch)
tree5a105df4a30a2ae05e24fd7846a9dc8e498e129e
parent84333e068eca39d0867d169b8bc479bb2c32a69c (diff)
downloademacs-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.el13
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.
208Visit the library in a buffer, and return a cons cell (BUFFER . POSITION),
209or just (BUFFER . nil) if the definition can't be found in the file.
210
208If TYPE is nil, look for a function definition. 211If TYPE is nil, look for a function definition.
209Otherwise, TYPE specifies the kind of definition, 212Otherwise, TYPE specifies the kind of definition,
210and it is interpreted via `find-function-regexp-alist'. 213and 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
254Finds the source file containing the definition of FUNCTION 256Finds the source file containing the definition of FUNCTION
255in a buffer and the point of the definition. The buffer is 257in a buffer and the point of the definition. The buffer is
256not selected. 258not selected. If the function definition can't be found in
259the buffer, returns (BUFFER).
257 260
258If the file where FUNCTION is defined is not known, then it is 261If the file where FUNCTION is defined is not known, then it is
259searched for in `find-function-source-path' if non nil, otherwise 262searched 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
377Finds the library containing the definition of VARIABLE in a buffer and 380Finds the library containing the definition of VARIABLE in a buffer and
378the point of the definition. The buffer is not selected. 381the point of the definition. The buffer is not selected.
382If the variable's definition can't be found in the buffer, return (BUFFER).
379 383
380The library where VARIABLE is defined is searched for in FILE or 384The 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.
428If the definition can't be found in the buffer, return (BUFFER).
424TYPE says what type of definition: nil for a function, `defvar' for a 429TYPE says what type of definition: nil for a function, `defvar' for a
425variable, `defface' for a face. This function does not switch to the 430variable, `defface' for a face. This function does not switch to the
426buffer nor display it. 431buffer nor display it.