changeset 13170:7fd22a2485f2

(function-called-at-point, variable-at-point): Don't back up if we start at the beginning of a symbol.
author Richard M. Stallman <rms@gnu.org>
date Tue, 10 Oct 1995 20:03:31 +0000
parents d72f18f068a8
children ed9465203ed6
files lisp/help.el
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/help.el	Mon Oct 09 20:52:43 1995 +0000
+++ b/lisp/help.el	Tue Oct 10 20:03:31 1995 +0000
@@ -445,7 +445,9 @@
 	(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 @@
 (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)))