Commit 5bd25c09 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/help.el (function-called-at-point): Use Elisp's forward-sexp-function

parent 5a4f58f7
Pipeline #1521 failed with stage
in 90 minutes and 1 second
...@@ -265,17 +265,19 @@ If that doesn't give a function, return nil." ...@@ -265,17 +265,19 @@ If that doesn't give a function, return nil."
(condition-case () (condition-case ()
(save-excursion (save-excursion
(save-restriction (save-restriction
(narrow-to-region (max (point-min) (let ((forward-sexp-function nil)) ;Use elisp-mode's value
(- (point) 1000)) (point-max)) (narrow-to-region (max (point-min)
;; Move up to surrounding paren, then after the open. (- (point) 1000))
(backward-up-list 1) (point-max))
(forward-char 1) ;; Move up to surrounding paren, then after the open.
;; If there is space here, this is probably something (backward-up-list 1)
;; other than a real Lisp function call, so ignore it. (forward-char 1)
(if (looking-at "[ \t]") ;; If there is space here, this is probably something
(error "Probably not a Lisp function call")) ;; other than a real Lisp function call, so ignore it.
(let ((obj (read (current-buffer)))) (if (looking-at "[ \t]")
(and (symbolp obj) (fboundp obj) obj)))) (error "Probably not a Lisp function call"))
(let ((obj (read (current-buffer))))
(and (symbolp obj) (fboundp obj) obj)))))
(error nil)) (error nil))
(let* ((str (find-tag-default)) (let* ((str (find-tag-default))
(sym (if str (intern-soft str)))) (sym (if str (intern-soft str))))
......
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