summaryrefslogtreecommitdiff
path: root/lisp/help.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-10-10 20:03:31 +0000
committerRichard M. Stallman <rms@gnu.org>1995-10-10 20:03:31 +0000
commit4f03937734de009fc96a95a2403e46440c6ca0ee (patch)
treea6678045b20f66b9c690ff7053cc526042ac3296 /lisp/help.el
parent36a8622b60481f69b400378feb8bd38612c84a13 (diff)
downloademacs-4f03937734de009fc96a95a2403e46440c6ca0ee.tar.gz
(function-called-at-point, variable-at-point):
Don't back up if we start at the beginning of a symbol.
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/help.el b/lisp/help.el
index f9a689bf081..48192073baf 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -445,7 +445,9 @@ C-w print information on absence of warranty for GNU Emacs."
(error nil))
(condition-case ()
(save-excursion
- (forward-sexp -1)
+ (and (or (eq (char-syntax (preceding-char)) ?_)
+ (eq (char-syntax (preceding-char)) ?w))
+ (forward-sexp -1))
(skip-chars-forward "'")
(let ((obj (read (current-buffer))))
(and (symbolp obj) (fboundp obj) obj)))
@@ -540,7 +542,9 @@ C-w print information on absence of warranty for GNU Emacs."
(defun variable-at-point ()
(condition-case ()
(save-excursion
- (forward-sexp -1)
+ (and (or (eq (char-syntax (preceding-char)) ?_)
+ (eq (char-syntax (preceding-char)) ?w))
+ (forward-sexp -1))
(skip-chars-forward "'")
(let ((obj (read (current-buffer))))
(and (symbolp obj) (boundp obj) obj)))