Commit 8a8bd38f authored by Tassilo Horn's avatar Tassilo Horn

Fix issues with BibTeX entries containing ")".

* textmodes/reftex.el (reftex-syntax-table-for-bib): Give ( and )
punctuation syntax since to allow bibtex fields with values such
as {Test 1) and 2)} (bug#19205, bug#19707).
(reftex--prepare-syntax-tables): New function.
(reftex-mode): Use it.
parent 173ac1ca
2015-01-28 Tassilo Horn <tsdh@gnu.org>
* textmodes/reftex.el (reftex-syntax-table-for-bib): Give ( and )
punctuation syntax since to allow bibtex fields with values such
as {Test 1) and 2)} (bug#19205, bug#19707).
(reftex--prepare-syntax-tables): New function.
(reftex-mode): Use it.
2015-01-26 Fabián Ezequiel Gallina <fgallina@gnu.org>
python.el: New non-global state dependent indentation engine.
......
......@@ -106,17 +106,21 @@
(defvar reftex-syntax-table nil)
(defvar reftex-syntax-table-for-bib nil)
(unless reftex-syntax-table
(defun reftex--prepare-syntax-tables ()
(setq reftex-syntax-table (copy-syntax-table))
(modify-syntax-entry ?\( "." reftex-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))
(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))
(modify-syntax-entry ?\] "." reftex-syntax-table-for-bib)
(modify-syntax-entry ?\( "." reftex-syntax-table-for-bib)
(modify-syntax-entry ?\) "." reftex-syntax-table-for-bib))
(unless (and reftex-syntax-table reftex-syntax-table-for-bib)
(reftex--prepare-syntax-tables))
;; The following definitions are out of place, but I need them here
;; to make the compilation of reftex-mode not complain.
......@@ -180,15 +184,7 @@ on the menu bar.
(put 'reftex-auto-recenter-toc '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))
(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)
(reftex--prepare-syntax-tables)
(run-hooks 'reftex-mode-hook))
;; Mode was turned off
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment