changeset 46904:7af0f250bfd0

(reftex-mode): Moved creation of special syntax tables to top-level.
author Carsten Dominik <dominik@science.uva.nl>
date Thu, 15 Aug 2002 11:28:50 +0000
parents 42b66cce768d
children 23b6ab646d7b
files lisp/textmodes/reftex.el
diffstat 1 files changed, 13 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/reftex.el	Thu Aug 15 11:27:45 2002 +0000
+++ b/lisp/textmodes/reftex.el	Thu Aug 15 11:28:50 2002 +0000
@@ -314,6 +314,19 @@
 (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)))
+  (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))
+  (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))
+
 (defvar reftex-auto-view-crossref-timer nil
   "The timer used for auto-view-crossref.")
 
@@ -368,16 +381,6 @@
 	  (and reftex-auto-view-crossref
 	       (reftex-toggle-auto-view-crossref))
 	  (put 'reftex-auto-view-crossref 'initialized t))
-	(unless reftex-syntax-table
-	  (setq reftex-syntax-table (copy-syntax-table (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))
-	  (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)))