aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/help.el
diff options
context:
space:
mode:
authorJuri Linkov <[email protected]>2004-09-02 16:37:01 +0000
committerJuri Linkov <[email protected]>2004-09-02 16:37:01 +0000
commit542e904c45959b990146846094519e799e7a5711 (patch)
tree96fc3e1c742093abaa7e584570c7d2a92c319b26 /lisp/help.el
parentfc11ddc8d7b8eb0013a8573fcecf6e0e934348e5 (diff)
(function-called-at-point): Try `find-tag-default' when other methods failed.
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el55
1 files changed, 29 insertions, 26 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 52a772779a..bf0df4358a 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -237,32 +237,35 @@ C-w Display information on absence of warranty for GNU Emacs."
(defun function-called-at-point ()
"Return a function around point or else called by the list containing point.
If that doesn't give a function, return nil."
- (with-syntax-table emacs-lisp-mode-syntax-table
- (or (condition-case ()
- (save-excursion
- (or (not (zerop (skip-syntax-backward "_w")))
- (eq (char-syntax (following-char)) ?w)
- (eq (char-syntax (following-char)) ?_)
- (forward-sexp -1))
- (skip-chars-forward "'")
- (let ((obj (read (current-buffer))))
- (and (symbolp obj) (fboundp obj) obj)))
- (error nil))
- (condition-case ()
- (save-excursion
- (save-restriction
- (narrow-to-region (max (point-min)
- (- (point) 1000)) (point-max))
- ;; Move up to surrounding paren, then after the open.
- (backward-up-list 1)
- (forward-char 1)
- ;; If there is space here, this is probably something
- ;; other than a real Lisp function call, so ignore it.
- (if (looking-at "[ \t]")
- (error "Probably not a Lisp function call"))
- (let ((obj (read (current-buffer))))
- (and (symbolp obj) (fboundp obj) obj))))
- (error nil)))))
+ (or (with-syntax-table emacs-lisp-mode-syntax-table
+ (or (condition-case ()
+ (save-excursion
+ (or (not (zerop (skip-syntax-backward "_w")))
+ (eq (char-syntax (following-char)) ?w)
+ (eq (char-syntax (following-char)) ?_)
+ (forward-sexp -1))
+ (skip-chars-forward "'")
+ (let ((obj (read (current-buffer))))
+ (and (symbolp obj) (fboundp obj) obj)))
+ (error nil))
+ (condition-case ()
+ (save-excursion
+ (save-restriction
+ (narrow-to-region (max (point-min)
+ (- (point) 1000)) (point-max))
+ ;; Move up to surrounding paren, then after the open.
+ (backward-up-list 1)
+ (forward-char 1)
+ ;; If there is space here, this is probably something
+ ;; other than a real Lisp function call, so ignore it.
+ (if (looking-at "[ \t]")
+ (error "Probably not a Lisp function call"))
+ (let ((obj (read (current-buffer))))
+ (and (symbolp obj) (fboundp obj) obj))))
+ (error nil))))
+ (let* ((str (find-tag-default))
+ (obj (if str (read str))))
+ (and (symbolp obj) (fboundp obj) obj))))
;;; `User' help functions