aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2019-05-01 12:37:48 -0400
committerStefan Monnier2019-05-01 12:37:48 -0400
commit5bd25c095eb7f7d148b47e6823c7eccd6416a693 (patch)
tree3f4902d3369da65ccafdf4c0ae6182c0f1673811
parent5a4f58f7eef542a61663360866f69f477472090c (diff)
downloademacs-5bd25c095eb7f7d148b47e6823c7eccd6416a693.tar.gz
emacs-5bd25c095eb7f7d148b47e6823c7eccd6416a693.zip
* lisp/help.el (function-called-at-point): Use Elisp's forward-sexp-function
-rw-r--r--lisp/help.el24
1 files changed, 13 insertions, 11 deletions
diff --git a/lisp/help.el b/lisp/help.el
index d1f473517d5..4dfe471c106 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -265,17 +265,19 @@ If that doesn't give a function, return nil."
265 (condition-case () 265 (condition-case ()
266 (save-excursion 266 (save-excursion
267 (save-restriction 267 (save-restriction
268 (narrow-to-region (max (point-min) 268 (let ((forward-sexp-function nil)) ;Use elisp-mode's value
269 (- (point) 1000)) (point-max)) 269 (narrow-to-region (max (point-min)
270 ;; Move up to surrounding paren, then after the open. 270 (- (point) 1000))
271 (backward-up-list 1) 271 (point-max))
272 (forward-char 1) 272 ;; Move up to surrounding paren, then after the open.
273 ;; If there is space here, this is probably something 273 (backward-up-list 1)
274 ;; other than a real Lisp function call, so ignore it. 274 (forward-char 1)
275 (if (looking-at "[ \t]") 275 ;; If there is space here, this is probably something
276 (error "Probably not a Lisp function call")) 276 ;; other than a real Lisp function call, so ignore it.
277 (let ((obj (read (current-buffer)))) 277 (if (looking-at "[ \t]")
278 (and (symbolp obj) (fboundp obj) obj)))) 278 (error "Probably not a Lisp function call"))
279 (let ((obj (read (current-buffer))))
280 (and (symbolp obj) (fboundp obj) obj)))))
279 (error nil)) 281 (error nil))
280 (let* ((str (find-tag-default)) 282 (let* ((str (find-tag-default))
281 (sym (if str (intern-soft str)))) 283 (sym (if str (intern-soft str))))