changeset 13209:c2f172263810

(variable-at-point, function-called-at-point): Switch temporarily to emacs-lisp-mode-syntax-table.
author Richard M. Stallman <rms@gnu.org>
date Sat, 14 Oct 1995 00:39:58 +0000
parents 7a20f2bb5ac9
children 8453192a1032
files lisp/help.el
diffstat 1 files changed, 24 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/help.el	Fri Oct 13 19:18:29 1995 +0000
+++ b/lisp/help.el	Sat Oct 14 00:39:58 1995 +0000
@@ -444,14 +444,18 @@
 		(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 @@
 
 (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)