From 914a48d0f0579bf6c08f5aa3bd391717820270d8 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 14 Oct 1995 00:39:58 +0000 Subject: [PATCH] (variable-at-point, function-called-at-point): Switch temporarily to emacs-lisp-mode-syntax-table. --- lisp/help.el | 40 ++++++++++++++++++++++++---------------- 1 file 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) -- 2.39.2