Commit cc3064a5 authored by Juri Linkov's avatar Juri Linkov

(variable-at-point): Try `find-tag-default' when other methods failed.

parent 542e904c
...@@ -461,18 +461,21 @@ face (according to `face-differs-from-default-p')." ...@@ -461,18 +461,21 @@ face (according to `face-differs-from-default-p')."
(defun variable-at-point () (defun variable-at-point ()
"Return the bound variable symbol found around point. "Return the bound variable symbol found around point.
Return 0 if there is no such symbol." Return 0 if there is no such symbol."
(condition-case () (or (condition-case ()
(with-syntax-table emacs-lisp-mode-syntax-table (with-syntax-table emacs-lisp-mode-syntax-table
(save-excursion (save-excursion
(or (not (zerop (skip-syntax-backward "_w"))) (or (not (zerop (skip-syntax-backward "_w")))
(eq (char-syntax (following-char)) ?w) (eq (char-syntax (following-char)) ?w)
(eq (char-syntax (following-char)) ?_) (eq (char-syntax (following-char)) ?_)
(forward-sexp -1)) (forward-sexp -1))
(skip-chars-forward "'") (skip-chars-forward "'")
(let ((obj (read (current-buffer)))) (let ((obj (read (current-buffer))))
(or (and (symbolp obj) (boundp obj) obj) (and (symbolp obj) (boundp obj) obj))))
0)))) (error nil))
(error 0))) (let* ((str (find-tag-default))
(obj (if str (read str))))
(and (symbolp obj) (boundp obj) obj))
0))
;;;###autoload ;;;###autoload
(defun describe-variable (variable &optional buffer) (defun describe-variable (variable &optional buffer)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment