aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2006-01-21 20:39:30 +0000
committerEli Zaretskii2006-01-21 20:39:30 +0000
commit3bdedbcb8c937964dbedceb413e7dde0c9ae97e4 (patch)
tree9f651787aeaec05e92146ae8579f14628abdbc27
parent7ab3896295d7a812e8dcb697c05a44df9e5be73d (diff)
downloademacs-3bdedbcb8c937964dbedceb413e7dde0c9ae97e4.tar.gz
emacs-3bdedbcb8c937964dbedceb413e7dde0c9ae97e4.zip
(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.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/emacs-lisp/find-func.el49
2 files changed, 36 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8b4e87a1682..3e73d399844 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12006-01-21 Martin Rudalics <rudalics@gmx.at>
2
3 * emacs-lisp/find-func.el (find-definition-noselect)
4 (find-variable-noselect): Search variables in C source code too.
5 (find-function-C-source, find-function-noselect, find-function)
6 (find-function-other-frame, find-variable-noselect, find-variable)
7 (find-variable-other-frame, find-variable-at-point):
8 Fix docstrings.
9
12006-01-21 Francesco Potorti` <pot@gnu.org> 102006-01-21 Francesco Potorti` <pot@gnu.org>
2 11
3 * mail/rmailout.el (rmail-output): Don't use content-type if it is nil. 12 * mail/rmailout.el (rmail-output): Don't use content-type if it is nil.
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 43e8b917ce8..4c218263a62 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -165,7 +165,7 @@ If nil, do not try to find the source code of functions and variables
165defined in C.") 165defined in C.")
166 166
167(defun find-function-C-source (fun-or-var file type) 167(defun find-function-C-source (fun-or-var file type)
168 "Find the source location where SUBR-OR-VAR is defined in FILE. 168 "Find the source location where FUN-OR-VAR is defined in FILE.
169TYPE should be nil to find a function, or `defvar' to find a variable." 169TYPE should be nil to find a function, or `defvar' to find a variable."
170 (unless find-function-C-source-directory 170 (unless find-function-C-source-directory
171 (setq find-function-C-source-directory 171 (setq find-function-C-source-directory
@@ -243,7 +243,7 @@ The search is done in the source for library LIBRARY."
243(defun find-function-noselect (function) 243(defun find-function-noselect (function)
244 "Return a pair (BUFFER . POINT) pointing to the definition of FUNCTION. 244 "Return a pair (BUFFER . POINT) pointing to the definition of FUNCTION.
245 245
246Finds the Emacs Lisp library containing the definition of FUNCTION 246Finds the source file containing the definition of FUNCTION
247in a buffer and the point of the definition. The buffer is 247in a buffer and the point of the definition. The buffer is
248not selected. 248not selected.
249 249
@@ -335,7 +335,7 @@ Set mark before moving, if the buffer already existed."
335(defun find-function (function) 335(defun find-function (function)
336 "Find the definition of the FUNCTION near point. 336 "Find the definition of the FUNCTION near point.
337 337
338Finds the Emacs Lisp library containing the definition of the function 338Finds the source file containing the definition of the function
339near point (selected by `function-called-at-point') in a buffer and 339near point (selected by `function-called-at-point') in a buffer and
340places point before the definition. 340places point before the definition.
341Set mark before moving, if the buffer already existed. 341Set mark before moving, if the buffer already existed.
@@ -356,7 +356,7 @@ See `find-function' for more details."
356 356
357;;;###autoload 357;;;###autoload
358(defun find-function-other-frame (function) 358(defun find-function-other-frame (function)
359 "Find, in ananother frame, the definition of FUNCTION near point. 359 "Find, in another frame, the definition of FUNCTION near point.
360 360
361See `find-function' for more details." 361See `find-function' for more details."
362 (interactive (find-function-read)) 362 (interactive (find-function-read))
@@ -364,24 +364,25 @@ See `find-function' for more details."
364 364
365;;;###autoload 365;;;###autoload
366(defun find-variable-noselect (variable &optional file) 366(defun find-variable-noselect (variable &optional file)
367 "Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL. 367 "Return a pair `(BUFFER . POINT)' pointing to the definition of VARIABLE.
368 368
369Finds the Emacs Lisp library containing the definition of SYMBOL 369Finds the library containing the definition of VARIABLE in a buffer and
370in a buffer, and the point of the definition. It does not switch 370the point of the definition. The buffer is not selected.
371to the buffer or display it.
372 371
373The library where VARIABLE is defined is searched for in FILE or 372The library where VARIABLE is defined is searched for in FILE or
374`find-function-source-path', if non nil, otherwise in `load-path'." 373`find-function-source-path', if non nil, otherwise in `load-path'."
375 (if (not variable) 374 (if (not variable)
376 (error "You didn't specify a variable")) 375 (error "You didn't specify a variable")
377 (let ((library (or file (symbol-file variable 'defvar)))) 376 (let ((library (or file
378 (find-function-search-for-symbol variable 'defvar library))) 377 (symbol-file variable 'defvar)
378 (help-C-file-name variable 'var))))
379 (find-function-search-for-symbol variable 'defvar library))))
379 380
380;;;###autoload 381;;;###autoload
381(defun find-variable (variable) 382(defun find-variable (variable)
382 "Find the definition of the VARIABLE near point. 383 "Find the definition of the VARIABLE near point.
383 384
384Finds the Emacs Lisp library containing the definition of the variable 385Finds the library containing the definition of the variable
385near point (selected by `variable-at-point') in a buffer and 386near point (selected by `variable-at-point') in a buffer and
386places point before the definition. 387places point before the definition.
387 388
@@ -403,7 +404,7 @@ See `find-variable' for more details."
403 404
404;;;###autoload 405;;;###autoload
405(defun find-variable-other-frame (variable) 406(defun find-variable-other-frame (variable)
406 "Find, in annother frame, the definition of VARIABLE near point. 407 "Find, in another frame, the definition of VARIABLE near point.
407 408
408See `find-variable' for more details." 409See `find-variable' for more details."
409 (interactive (find-function-read 'defvar)) 410 (interactive (find-function-read 'defvar))
@@ -412,18 +413,22 @@ See `find-variable' for more details."
412;;;###autoload 413;;;###autoload
413(defun find-definition-noselect (symbol type &optional file) 414(defun find-definition-noselect (symbol type &optional file)
414 "Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL. 415 "Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL.
415TYPE says what type of definition: nil for a function, 416TYPE says what type of definition: nil for a function, `defvar' for a
416`defvar' or `defface' for a variable or face. This function 417variabke, `defface' for a face. This function does not switch to the
417does not switch to the buffer or display it. 418buffer nor display it.
418 419
419The library where SYMBOL is defined is searched for in FILE or 420The library where SYMBOL is defined is searched for in FILE or
420`find-function-source-path', if non nil, otherwise in `load-path'." 421`find-function-source-path', if non nil, otherwise in `load-path'."
421 (if (not symbol) 422 (cond
422 (error "You didn't specify a symbol")) 423 ((not symbol)
423 (if (null type) 424 (error "You didn't specify a symbol"))
424 (find-function-noselect symbol) 425 ((null type)
426 (find-function-noselect symbol))
427 ((eq type 'defvar)
428 (find-variable-noselect symbol file))
429 (t
425 (let ((library (or file (symbol-file symbol type)))) 430 (let ((library (or file (symbol-file symbol type))))
426 (find-function-search-for-symbol symbol type library)))) 431 (find-function-search-for-symbol symbol type library)))))
427 432
428;; For symmetry, this should be called find-face; but some programs 433;; For symmetry, this should be called find-face; but some programs
429;; assume that, if that name is defined, it means something else. 434;; 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 485
481;;;###autoload 486;;;###autoload
482(defun find-variable-at-point () 487(defun find-variable-at-point ()
483 "Find directly the function at point in the other window." 488 "Find directly the variable at point in the other window."
484 (interactive) 489 (interactive)
485 (let ((symb (variable-at-point))) 490 (let ((symb (variable-at-point)))
486 (when (and symb (not (equal symb 0))) 491 (when (and symb (not (equal symb 0)))