summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2001-10-30 04:51:55 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2001-10-30 04:51:55 +0000
commit1c787e34e5e286f6b09ce4f0723c653e9b496410 (patch)
tree554338ed74125b09c7b266176f07687ea1690fc3 /lisp/emacs-lisp
parent98a68b08dffde383d2ce520cb8fef4351ecd2a0f (diff)
downloademacs-1c787e34e5e286f6b09ce4f0723c653e9b496410.tar.gz
emacs-1c787e34e5e286f6b09ce4f0723c653e9b496410.tar.bz2
emacs-1c787e34e5e286f6b09ce4f0723c653e9b496410.zip
(find-function-search-for-symbol):
If the regexp doesn't match, use a looser one. (find-variable-noselect): Add `file' argument.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/find-func.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index db5be92b7b1..99ad46c88b0 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -144,7 +144,12 @@ If VARIABLE-P is nil, `find-function-regexp' is used, otherwise
(progn
(set-syntax-table emacs-lisp-mode-syntax-table)
(goto-char (point-min))
- (if (re-search-forward regexp nil t)
+ (if (or (re-search-forward regexp nil t)
+ (re-search-forward
+ (concat "^([^ ]+ +"
+ (regexp-quote (symbol-name symbol))
+ "\\>")
+ nil t))
(progn
(beginning-of-line)
(cons (current-buffer) (point)))
@@ -278,18 +283,18 @@ See `find-function' for more details."
(find-function-do-it function nil 'switch-to-buffer-other-frame))
;;;###autoload
-(defun find-variable-noselect (variable)
- "Return a pair `(buffer . point)' pointing to the definition of SYMBOL.
+(defun find-variable-noselect (variable &optional file)
+ "Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL.
Finds the Emacs Lisp library containing the definition of SYMBOL
in a buffer and the point of the definition. The buffer is
not selected.
-The library where VARIABLE is defined is searched for in
+The library where VARIABLE is defined is searched for in FILE or
`find-function-source-path', if non nil, otherwise in `load-path'."
(if (not variable)
(error "You didn't specify a variable"))
- (let ((library (symbol-file variable)))
+ (let ((library (or file (symbol-file variable))))
(find-function-search-for-symbol variable 'variable library)))
;;;###autoload