Don't back up if we start at the beginning of a symbol.
(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)))
(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)))