Mercurial > emacs
changeset 56884:69c4e722e542
(variable-at-point): Try `find-tag-default' when other methods failed.
author | Juri Linkov <juri@jurta.org> |
---|---|
date | Thu, 02 Sep 2004 16:37:22 +0000 |
parents | 96649ac41424 |
children | 3171d2f5b945 |
files | lisp/help-fns.el |
diffstat | 1 files changed, 15 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/help-fns.el Thu Sep 02 16:37:01 2004 +0000 +++ b/lisp/help-fns.el Thu Sep 02 16:37:22 2004 +0000 @@ -461,18 +461,21 @@ (defun variable-at-point () "Return the bound variable symbol found around point. Return 0 if there is no such symbol." - (condition-case () - (with-syntax-table emacs-lisp-mode-syntax-table - (save-excursion - (or (not (zerop (skip-syntax-backward "_w"))) - (eq (char-syntax (following-char)) ?w) - (eq (char-syntax (following-char)) ?_) - (forward-sexp -1)) - (skip-chars-forward "'") - (let ((obj (read (current-buffer)))) - (or (and (symbolp obj) (boundp obj) obj) - 0)))) - (error 0))) + (or (condition-case () + (with-syntax-table emacs-lisp-mode-syntax-table + (save-excursion + (or (not (zerop (skip-syntax-backward "_w"))) + (eq (char-syntax (following-char)) ?w) + (eq (char-syntax (following-char)) ?_) + (forward-sexp -1)) + (skip-chars-forward "'") + (let ((obj (read (current-buffer)))) + (and (symbolp obj) (boundp obj) obj)))) + (error nil)) + (let* ((str (find-tag-default)) + (obj (if str (read str)))) + (and (symbolp obj) (boundp obj) obj)) + 0)) ;;;###autoload (defun describe-variable (variable &optional buffer)