comparison lisp/emacs-lisp/find-func.el @ 32226:2af46c6c8bde

(find-function-regexp): Remove spurion. Fix for define-minor-mode. (function-at-point): Alias to function-called-at-point.
author Dave Love <fx@gnu.org>
date Fri, 06 Oct 2000 18:35:24 +0000
parents 880b9764ac5d
children 02b0153b79a7
comparison
equal deleted inserted replaced
32225:15a7324321bb 32226:2af46c6c8bde
70 :type 'regexp 70 :type 'regexp
71 :group 'find-function 71 :group 'find-function
72 :version "21.1") 72 :version "21.1")
73 73
74 (defcustom find-variable-regexp 74 (defcustom find-variable-regexp
75 "^\\s-*(def[^uma\W]\\w+\\*?\\s-+%s\\(\\s-\\|$\\)" 75 "^\\s-*(def[^uma]\\(\\w\\|\\s_\\)+\\*?\\s-+%s\\(\\s-\\|$\\)"
76 "The regexp used by `find-variable' to search for a variable definition. 76 "The regexp used by `find-variable' to search for a variable definition.
77 It should match right up to the variable name. The default value 77 It should match right up to the variable name. The default value
78 avoids `defun', `defmacro', `defalias', `defadvice'. 78 avoids `defun', `defmacro', `defalias', `defadvice'.
79 79
80 Please send improvements and fixes to the maintainer." 80 Please send improvements and fixes to the maintainer."
81 :type 'regexp 81 :type 'regexp
82 :group 'find-function 82 :group 'find-function
83 :version "20.3") 83 :version "21.1")
84 84
85 (defcustom find-function-source-path nil 85 (defcustom find-function-source-path nil
86 "The default list of directories where `find-function' searches. 86 "The default list of directories where `find-function' searches.
87 87
88 If this variable is nil then `find-function' searches `load-path' by 88 If this variable is nil then `find-function' searches `load-path' by
184 (cond ((eq (car-safe def) 'autoload) 184 (cond ((eq (car-safe def) 'autoload)
185 (nth 1 def)) 185 (nth 1 def))
186 ((symbol-file function))))) 186 ((symbol-file function)))))
187 (find-function-search-for-symbol function nil library)))) 187 (find-function-search-for-symbol function nil library))))
188 188
189 (defun function-at-point () 189 (defalias 'function-at-point 'function-called-at-point)
190 (or (condition-case ()
191 (let ((stab (syntax-table)))
192 (unwind-protect
193 (save-excursion
194 (set-syntax-table emacs-lisp-mode-syntax-table)
195 (or (not (zerop (skip-syntax-backward "_w")))
196 (eq (char-syntax (char-after (point))) ?w)
197 (eq (char-syntax (char-after (point))) ?_)
198 (forward-sexp -1))
199 (skip-chars-forward "`'")
200 (let ((obj (read (current-buffer))))
201 (and (symbolp obj) (fboundp obj) obj)))
202 (set-syntax-table stab)))
203 (error nil))
204 (condition-case ()
205 (save-excursion
206 (save-restriction
207 (narrow-to-region (max (point-min) (- (point) 1000)) (point-max))
208 (backward-up-list 1)
209 (forward-char 1)
210 (let (obj)
211 (setq obj (read (current-buffer)))
212 (and (symbolp obj) (fboundp obj) obj))))
213 (error nil))))
214 190
215 (defun find-function-read (&optional variable-p) 191 (defun find-function-read (&optional variable-p)
216 "Read and return an interned symbol, defaulting to the one near point. 192 "Read and return an interned symbol, defaulting to the one near point.
217 193
218 If the optional VARIABLE-P is nil, then a function is gotten 194 If the optional VARIABLE-P is nil, then a function is gotten