# HG changeset patch # User Richard M. Stallman # Date 1152720227 0 # Node ID fcc45339ef471f707e791c3218b135d7efb071f0 # Parent 5da49f1eb5857b44091a1831eab9a7b6d26ec540 (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. diff -r 5da49f1eb585 -r fcc45339ef47 lisp/emacs-lisp/find-func.el --- a/lisp/emacs-lisp/find-func.el Wed Jul 12 16:00:45 2006 +0000 +++ b/lisp/emacs-lisp/find-func.el Wed Jul 12 16:03:47 2006 +0000 @@ -205,6 +205,9 @@ ;;;###autoload (defun find-function-search-for-symbol (symbol type library) "Search for SYMBOL's definition of type TYPE in LIBRARY. +Visit the library in a buffer, and return a cons cell (BUFFER . POSITION), +or just (BUFFER . nil) if the definition can't be found in the file. + If TYPE is nil, look for a function definition. Otherwise, TYPE specifies the kind of definition, and it is interpreted via `find-function-regexp-alist'. @@ -244,8 +247,7 @@ (progn (beginning-of-line) (cons (current-buffer) (point))) - (error "Cannot find definition of `%s' in library `%s'" - symbol library)))))))) + (cons (current-buffer) nil)))))))) ;;;###autoload (defun find-function-noselect (function) @@ -253,7 +255,8 @@ Finds the source file containing the definition of FUNCTION in a buffer and the point of the definition. The buffer is -not selected. +not selected. If the function definition can't be found in +the buffer, returns (BUFFER). If the file where FUNCTION is defined is not known, then it is searched for in `find-function-source-path' if non nil, otherwise @@ -335,7 +338,7 @@ (when (memq new-buf orig-buffers) (push-mark orig-point)) (funcall switch-fn new-buf) - (goto-char new-point) + (when new-point (goto-char new-point)) (recenter find-function-recenter-line) (run-hooks 'find-function-after-hook)))) @@ -376,6 +379,7 @@ Finds the library containing the definition of VARIABLE in a buffer and the point of the definition. The buffer is not selected. +If the variable's definition can't be found in the buffer, return (BUFFER). The library where VARIABLE is defined is searched for in FILE or `find-function-source-path', if non nil, otherwise in `load-path'." @@ -421,6 +425,7 @@ ;;;###autoload (defun find-definition-noselect (symbol type &optional file) "Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL. +If the definition can't be found in the buffer, return (BUFFER). TYPE says what type of definition: nil for a function, `defvar' for a variable, `defface' for a face. This function does not switch to the buffer nor display it.