Commit 3bdedbcb authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

(find-definition-noselect, find-variable-noselect): Search variables in

C source code too.
(find-function-C-source, find-function-noselect, find-function)
(find-function-other-frame, find-variable-noselect, find-variable)
(find-variable-other-frame, find-variable-at-point): Fix docstrings.
parent 7ab38962
2006-01-21 Martin Rudalics <rudalics@gmx.at>
* emacs-lisp/find-func.el (find-definition-noselect)
(find-variable-noselect): Search variables in C source code too.
(find-function-C-source, find-function-noselect, find-function)
(find-function-other-frame, find-variable-noselect, find-variable)
(find-variable-other-frame, find-variable-at-point):
Fix docstrings.
2006-01-21 Francesco Potorti` <pot@gnu.org> 2006-01-21 Francesco Potorti` <pot@gnu.org>
   
* mail/rmailout.el (rmail-output): Don't use content-type if it is nil. * mail/rmailout.el (rmail-output): Don't use content-type if it is nil.
......
...@@ -165,7 +165,7 @@ If nil, do not try to find the source code of functions and variables ...@@ -165,7 +165,7 @@ If nil, do not try to find the source code of functions and variables
defined in C.") defined in C.")
(defun find-function-C-source (fun-or-var file type) (defun find-function-C-source (fun-or-var file type)
"Find the source location where SUBR-OR-VAR is defined in FILE. "Find the source location where FUN-OR-VAR is defined in FILE.
TYPE should be nil to find a function, or `defvar' to find a variable." TYPE should be nil to find a function, or `defvar' to find a variable."
(unless find-function-C-source-directory (unless find-function-C-source-directory
(setq find-function-C-source-directory (setq find-function-C-source-directory
...@@ -243,7 +243,7 @@ The search is done in the source for library LIBRARY." ...@@ -243,7 +243,7 @@ The search is done in the source for library LIBRARY."
(defun find-function-noselect (function) (defun find-function-noselect (function)
"Return a pair (BUFFER . POINT) pointing to the definition of FUNCTION. "Return a pair (BUFFER . POINT) pointing to the definition of FUNCTION.
Finds the Emacs Lisp library containing the definition of FUNCTION Finds the source file containing the definition of FUNCTION
in a buffer and the point of the definition. The buffer is in a buffer and the point of the definition. The buffer is
not selected. not selected.
...@@ -335,7 +335,7 @@ Set mark before moving, if the buffer already existed." ...@@ -335,7 +335,7 @@ Set mark before moving, if the buffer already existed."
(defun find-function (function) (defun find-function (function)
"Find the definition of the FUNCTION near point. "Find the definition of the FUNCTION near point.
Finds the Emacs Lisp library containing the definition of the function Finds the source file containing the definition of the function
near point (selected by `function-called-at-point') in a buffer and near point (selected by `function-called-at-point') in a buffer and
places point before the definition. places point before the definition.
Set mark before moving, if the buffer already existed. Set mark before moving, if the buffer already existed.
...@@ -356,7 +356,7 @@ See `find-function' for more details." ...@@ -356,7 +356,7 @@ See `find-function' for more details."
;;;###autoload ;;;###autoload
(defun find-function-other-frame (function) (defun find-function-other-frame (function)
"Find, in ananother frame, the definition of FUNCTION near point. "Find, in another frame, the definition of FUNCTION near point.
See `find-function' for more details." See `find-function' for more details."
(interactive (find-function-read)) (interactive (find-function-read))
...@@ -364,24 +364,25 @@ See `find-function' for more details." ...@@ -364,24 +364,25 @@ See `find-function' for more details."
;;;###autoload ;;;###autoload
(defun find-variable-noselect (variable &optional file) (defun find-variable-noselect (variable &optional file)
"Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL. "Return a pair `(BUFFER . POINT)' pointing to the definition of VARIABLE.
Finds the Emacs Lisp library containing the definition of SYMBOL Finds the library containing the definition of VARIABLE in a buffer and
in a buffer, and the point of the definition. It does not switch the point of the definition. The buffer is not selected.
to the buffer or display it.
The library where VARIABLE is defined is searched for in FILE or The library where VARIABLE is defined is searched for in FILE or
`find-function-source-path', if non nil, otherwise in `load-path'." `find-function-source-path', if non nil, otherwise in `load-path'."
(if (not variable) (if (not variable)
(error "You didn't specify a variable")) (error "You didn't specify a variable")
(let ((library (or file (symbol-file variable 'defvar)))) (let ((library (or file
(find-function-search-for-symbol variable 'defvar library))) (symbol-file variable 'defvar)
(help-C-file-name variable 'var))))
(find-function-search-for-symbol variable 'defvar library))))
;;;###autoload ;;;###autoload
(defun find-variable (variable) (defun find-variable (variable)
"Find the definition of the VARIABLE near point. "Find the definition of the VARIABLE near point.
Finds the Emacs Lisp library containing the definition of the variable Finds the library containing the definition of the variable
near point (selected by `variable-at-point') in a buffer and near point (selected by `variable-at-point') in a buffer and
places point before the definition. places point before the definition.
...@@ -403,7 +404,7 @@ See `find-variable' for more details." ...@@ -403,7 +404,7 @@ See `find-variable' for more details."
;;;###autoload ;;;###autoload
(defun find-variable-other-frame (variable) (defun find-variable-other-frame (variable)
"Find, in annother frame, the definition of VARIABLE near point. "Find, in another frame, the definition of VARIABLE near point.
See `find-variable' for more details." See `find-variable' for more details."
(interactive (find-function-read 'defvar)) (interactive (find-function-read 'defvar))
...@@ -412,18 +413,22 @@ See `find-variable' for more details." ...@@ -412,18 +413,22 @@ See `find-variable' for more details."
;;;###autoload ;;;###autoload
(defun find-definition-noselect (symbol type &optional file) (defun find-definition-noselect (symbol type &optional file)
"Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL. "Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL.
TYPE says what type of definition: nil for a function, TYPE says what type of definition: nil for a function, `defvar' for a
`defvar' or `defface' for a variable or face. This function variabke, `defface' for a face. This function does not switch to the
does not switch to the buffer or display it. buffer nor display it.
The library where SYMBOL is defined is searched for in FILE or The library where SYMBOL is defined is searched for in FILE or
`find-function-source-path', if non nil, otherwise in `load-path'." `find-function-source-path', if non nil, otherwise in `load-path'."
(if (not symbol) (cond
(error "You didn't specify a symbol")) ((not symbol)
(if (null type) (error "You didn't specify a symbol"))
(find-function-noselect symbol) ((null type)
(find-function-noselect symbol))
((eq type 'defvar)
(find-variable-noselect symbol file))
(t
(let ((library (or file (symbol-file symbol type)))) (let ((library (or file (symbol-file symbol type))))
(find-function-search-for-symbol symbol type library)))) (find-function-search-for-symbol symbol type library)))))
;; For symmetry, this should be called find-face; but some programs ;; For symmetry, this should be called find-face; but some programs
;; assume that, if that name is defined, it means something else. ;; assume that, if that name is defined, it means something else.
...@@ -480,7 +485,7 @@ Set mark before moving, if the buffer already existed." ...@@ -480,7 +485,7 @@ Set mark before moving, if the buffer already existed."
;;;###autoload ;;;###autoload
(defun find-variable-at-point () (defun find-variable-at-point ()
"Find directly the function at point in the other window." "Find directly the variable at point in the other window."
(interactive) (interactive)
(let ((symb (variable-at-point))) (let ((symb (variable-at-point)))
(when (and symb (not (equal symb 0))) (when (and symb (not (equal symb 0)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment