changeset 46928:cbd08432d202

* reftex.el (reftex-mode): Create special syntax tables. (reftex-syntax-table): Set a default in case this is being used outside a LaTeX file. (reftex-syntax-table-for-bib): Set a default in case this is being used outside a LaTeX file.
author Carsten Dominik <dominik@science.uva.nl>
date Sat, 17 Aug 2002 09:21:19 +0000
parents e1aab27b11be
children b47455879984
files lisp/textmodes/reftex.el
diffstat 1 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/reftex.el	Sat Aug 17 05:01:44 2002 +0000
+++ b/lisp/textmodes/reftex.el	Sat Aug 17 09:21:19 2002 +0000
@@ -314,14 +314,14 @@
 (defvar reftex-syntax-table nil)
 (defvar reftex-syntax-table-for-bib nil)
 
-;; Prepare the special syntax tables.
 (unless reftex-syntax-table
-  (setq reftex-syntax-table (copy-syntax-table (syntax-table)))
+  (setq reftex-syntax-table (copy-syntax-table))
   (modify-syntax-entry ?\( "." reftex-syntax-table)
   (modify-syntax-entry ?\) "." reftex-syntax-table))
-
+	
 (unless reftex-syntax-table-for-bib
-  (setq reftex-syntax-table-for-bib (copy-syntax-table reftex-syntax-table))
+  (setq reftex-syntax-table-for-bib
+	(copy-syntax-table reftex-syntax-table))
   (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib)
   (modify-syntax-entry ?\" "." reftex-syntax-table-for-bib)
   (modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib)
@@ -381,6 +381,19 @@
 	  (and reftex-auto-view-crossref
 	       (reftex-toggle-auto-view-crossref))
 	  (put 'reftex-auto-view-crossref 'initialized t))
+
+	;; Prepare the special syntax tables.
+	(setq reftex-syntax-table (copy-syntax-table (syntax-table)))
+	(modify-syntax-entry ?\( "." reftex-syntax-table)
+	(modify-syntax-entry ?\) "." reftex-syntax-table)
+	
+	(setq reftex-syntax-table-for-bib
+	      (copy-syntax-table reftex-syntax-table))
+	(modify-syntax-entry ?\' "." reftex-syntax-table-for-bib)
+	(modify-syntax-entry ?\" "." reftex-syntax-table-for-bib)
+	(modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib)
+	(modify-syntax-entry ?\] "." reftex-syntax-table-for-bib)
+
         (run-hooks 'reftex-mode-hook))
     ;; Mode was turned off
     (easy-menu-remove reftex-mode-menu)))