aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJuri Linkov <[email protected]>2004-12-16 13:05:37 +0000
committerJuri Linkov <[email protected]>2004-12-16 13:05:37 +0000
commit918f2e56d9ab0bf94ea260aec9d224a20c80c44f (patch)
treebea506d250f8f5da9e27142bf91ec43013acec51 /lisp
parent8270a848c898e19a5f46eb2ea79b71645562e0cd (diff)
* help.el (function-called-at-point):
As a last resort try striping non-word prefixes and suffixes.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/help.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 5ec9b1f529..992a9b85f4 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -267,8 +267,13 @@ If that doesn't give a function, return nil."
(and (symbolp obj) (fboundp obj) obj))))
(error nil))))
(let* ((str (find-tag-default))
- (obj (if str (intern str))))
- (and (symbolp obj) (fboundp obj) obj))))
+ (sym (if str (intern-soft str))))
+ (if (and sym (fboundp sym))
+ sym
+ (save-match-data
+ (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str))
+ (setq sym (intern-soft (match-string 1 str)))
+ (and (fboundp sym) sym)))))))
;;; `User' help functions