diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-10-14 00:39:58 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-10-14 00:39:58 +0000 |
commit | 61ebdba49f50f8717e0fd16f9611c3d4bed08bd4 (patch) | |
tree | 7794c89f19c6027ba5a094ef9acefecca1f5c72e | |
parent | 53e82b93b5596e9d5bef0f5729576637cc9a6f24 (diff) | |
download | emacs-61ebdba49f50f8717e0fd16f9611c3d4bed08bd4.tar.gz |
(variable-at-point, function-called-at-point):
Switch temporarily to emacs-lisp-mode-syntax-table.
-rw-r--r-- | lisp/help.el | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/lisp/help.el b/lisp/help.el index bcd646c1281..d81e433f755 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -444,14 +444,18 @@ C-w print information on absence of warranty for GNU Emacs." (and (symbolp obj) (fboundp obj) obj)))) (error nil)) (condition-case () - (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) (fboundp obj) obj))) + (let ((stab (syntax-table))) + (unwind-protect + (save-excursion + (set-syntax-table emacs-lisp-mode-syntax-table) + (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) (fboundp obj) obj))) + (set-syntax-table stab))) (error nil)))) (defun describe-function-find-file (function) @@ -542,14 +546,18 @@ C-w print information on absence of warranty for GNU Emacs." (defun variable-at-point () (condition-case () - (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))) + (let ((stab (syntax-table))) + (unwind-protect + (save-excursion + (set-syntax-table emacs-lisp-mode-syntax-table) + (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))) + (set-syntax-table stab))) (error nil))) (defun describe-variable (variable) |