Commits

dominik  committed bc61f83

syntax table bug fixes. Wrapped make-local-hook.

  • Participants
  • Parent commits 2871c0a

Comments (0)

Files changed (4)

File reftex-index.el

 	      "  R<" 'reftex-index-restriction-indicator ">"
 	      " -%-"))
   (setq truncate-lines t)
-  (make-local-hook 'post-command-hook)
-  (make-local-hook 'pre-command-hook)
+  (when (featurep 'xemacs)
+    ;; XEmacs needs the call to make-local-hook
+    (make-local-hook 'post-command-hook)
+    (make-local-hook 'pre-command-hook))
   (make-local-variable 'reftex-last-follow-point)
   (easy-menu-add reftex-index-menu reftex-index-map)
   (add-hook 'post-command-hook 'reftex-index-post-command-hook nil t)

File reftex-sel.el

 
   (interactive)
   (kill-all-local-variables)
-  (make-local-hook 'pre-command-hook)
-  (make-local-hook 'post-command-hook)
+  (when (featurep 'xemacs)
+    ;; XEmacs needs the call to make-local-hook
+    (make-local-hook 'pre-command-hook)
+    (make-local-hook 'post-command-hook))
   (setq major-mode 'reftex-select-label-mode
 	mode-name "LSelect")
   (set (make-local-variable 'reftex-select-marked) nil)
 \\{reftex-select-label-map}"
   (interactive)
   (kill-all-local-variables)
-  (make-local-hook 'pre-command-hook)
-  (make-local-hook 'post-command-hook)
+  (when (featurep 'xemacs)
+    ;; XEmacs needs the call to make-local-hook
+    (make-local-hook 'pre-command-hook)
+    (make-local-hook 'post-command-hook))
   (setq major-mode 'reftex-select-bib-mode
 	mode-name "BSelect")
   (set (make-local-variable 'reftex-select-marked) nil)

File reftex-toc.el

 	      "  T<" 'reftex-toc-max-level-indicator ">"
 	      " -%-"))
   (setq truncate-lines t)
-  (make-local-hook 'post-command-hook)
-  (make-local-hook 'pre-command-hook)
+  (when (featurep 'xemacs)
+    ;; XEmacs needs the call to make-local-hook
+    (make-local-hook 'post-command-hook)
+    (make-local-hook 'pre-command-hook))
   (make-local-variable 'reftex-last-follow-point)
   (add-hook 'post-command-hook 'reftex-toc-post-command-hook nil t)
   (add-hook 'pre-command-hook  'reftex-toc-pre-command-hook nil t)
 (defvar reftex-syntax-table nil)
 (defvar reftex-syntax-table-for-bib nil)
 
+(unless reftex-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))
+  (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.")
 
 	  (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))
+
+	;; 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)))