aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Belaïche2012-11-25 06:05:34 +0100
committerVincent Belaïche2012-11-25 06:05:34 +0100
commite2cb57f5f5794d75cd237e2d6ec2b4d16157c2cd (patch)
tree0f863f509fe1c2ea0ed8d1b3e3fdf0a0b5d49dfd
parent1c4f115d4c4eb1aa71c25d21e8bdec2f8da97700 (diff)
downloademacs-e2cb57f5f5794d75cd237e2d6ec2b4d16157c2cd.tar.gz
emacs-e2cb57f5f5794d75cd237e2d6ec2b4d16157c2cd.zip
* textmodes/reftex-parse.el (reftex-parse-from-file): Use variable reftex-section-info-function in order to be compatible with Texinfo integration.
* textmodes/reftex.el (reftex-section-pre-regexp, reftex-section-post-regexp, reftex-section-info-function): New variable. (reftex-compile-variables): Use variables reftex-section-pre-regexp, reftex-section-post-regexp, and reftex-section-info-function in order to be compatible with Texinfo integration. * textmodes/reftex-toc.el (reftex-toc-promote-action): use reftex-section-pre-regexp variable in order to be compatible with Texinfo integration.
-rw-r--r--lisp/ChangeLog17
-rw-r--r--lisp/textmodes/reftex-parse.el2
-rw-r--r--lisp/textmodes/reftex-toc.el2
-rw-r--r--lisp/textmodes/reftex.el24
4 files changed, 34 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2e7e6c5be50..f0a487370d3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,20 @@
12012-11-24 Vincent Belaïche <vincentb1@users.sourceforge.net>
2
3 * textmodes/reftex-parse.el (reftex-parse-from-file): Use variable
4 reftex-section-info-function in order to be compatible with
5 Texinfo integration.
6
7 * textmodes/reftex.el (reftex-section-pre-regexp)
8 (reftex-section-post-regexp, reftex-section-info-function): New
9 variable.
10 (reftex-compile-variables): Use variables
11 reftex-section-pre-regexp, reftex-section-post-regexp, and
12 reftex-section-info-function in order to be compatible with Texinfo integration.
13
14 * textmodes/reftex-toc.el (reftex-toc-promote-action): use
15 reftex-section-pre-regexp variable in order to be compatible with
16 Texinfo integration.
17
12012-11-25 Chong Yidong <cyd@gnu.org> 182012-11-25 Chong Yidong <cyd@gnu.org>
2 19
3 * faces.el: Make face-spec-set more analogous to setq. 20 * faces.el: Make face-spec-set more analogous to setq.
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index 791b5d7b945..7169e70d6c4 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -251,7 +251,7 @@ of master file."
251 ;; the next parsing iteration. 251 ;; the next parsing iteration.
252 (when (eq (char-before) ?\\) (backward-char)) 252 (when (eq (char-before) ?\\) (backward-char))
253 ;; Insert in List 253 ;; Insert in List
254 (setq toc-entry (reftex-section-info file)) 254 (setq toc-entry (funcall reftex-section-info-function file))
255 (when toc-entry 255 (when toc-entry
256 ;; It can happen that section info returns nil 256 ;; It can happen that section info returns nil
257 (setq level (nth 5 toc-entry)) 257 (setq level (nth 5 toc-entry))
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index 4f73322d3f5..eec15be4d83 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -785,7 +785,7 @@ PRO-OR-DE is assumed to be dynamically scoped into this function."
785 (marker (nth 4 data))) 785 (marker (nth 4 data)))
786 (with-current-buffer (marker-buffer marker) 786 (with-current-buffer (marker-buffer marker)
787 (goto-char (marker-position marker)) 787 (goto-char (marker-position marker))
788 (if (looking-at (concat "\\([ \t]*\\\\\\)" (regexp-quote name))) 788 (if (looking-at (concat "\\([ \t]*" reftex-section-pre-regexp "\\)" (regexp-quote name)))
789 (replace-match (concat "\\1" newname)) 789 (replace-match (concat "\\1" newname))
790 (error "Fatal error during %smotion" pro-or-de))))) 790 (error "Fatal error during %smotion" pro-or-de)))))
791 791
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index bdee0fcf1d4..dfbeda38fd9 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -301,7 +301,9 @@ on the menu bar.
301 (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib) 301 (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib)
302 (modify-syntax-entry ?\" "." reftex-syntax-table-for-bib) 302 (modify-syntax-entry ?\" "." reftex-syntax-table-for-bib)
303 (modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib) 303 (modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib)
304 (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib)) 304 (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib)
305
306 (run-hooks 'reftex-mode-hook))
305 ;; Mode was turned off 307 ;; Mode was turned off
306 (easy-menu-remove reftex-mode-menu))) 308 (easy-menu-remove reftex-mode-menu)))
307 309
@@ -664,6 +666,16 @@ will deactivate it."
664(defvar reftex-find-label-regexp-format nil) 666(defvar reftex-find-label-regexp-format nil)
665(defvar reftex-find-label-regexp-format2 nil) 667(defvar reftex-find-label-regexp-format2 nil)
666 668
669;; Constants for making RefTeX open to Texinfo hooking
670(defvar reftex-section-pre-regexp "\\\\")
671;; Including `\' as a character to be matched at the end of the regexp
672;; will allow stuff like \begin{foo}\label{bar} to be matched. This
673;; will make the parser to advance one char too much. Therefore
674;; `reftex-parse-from-file' will step one char back if a section is
675;; found.
676(defvar reftex-section-post-regexp "\\*?\\(\\[[^]]*\\]\\)?[[{ \t\r\n\\]")
677(defvar reftex-section-info-function 'reftex-section-info)
678
667(defvar reftex-memory nil 679(defvar reftex-memory nil
668 "Memorizes old variable values to indicate changes in these variables.") 680 "Memorizes old variable values to indicate changes in these variables.")
669 681
@@ -1083,16 +1095,10 @@ This enforces rescanning the buffer on next use."
1083 reftex-include-file-commands "\\|") 1095 reftex-include-file-commands "\\|")
1084 "\\)[{ \t]+\\([^} \t\n\r]+\\)")) 1096 "\\)[{ \t]+\\([^} \t\n\r]+\\)"))
1085 (section-re 1097 (section-re
1086 ;; Including `\' as a character to be matched at the end 1098 (concat wbol reftex-section-pre-regexp "\\("
1087 ;; of the regexp will allow stuff like
1088 ;; \begin{foo}\label{bar} to be matched. This will make
1089 ;; the parser to advance one char too much. Therefore
1090 ;; `reftex-parse-from-file' will step one char back if a
1091 ;; section is found.
1092 (concat wbol "\\\\\\("
1093 (mapconcat (lambda (x) (regexp-quote (car x))) 1099 (mapconcat (lambda (x) (regexp-quote (car x)))
1094 reftex-section-levels-all "\\|") 1100 reftex-section-levels-all "\\|")
1095 "\\)\\*?\\(\\[[^]]*\\]\\)?[[{ \t\r\n\\]")) 1101 "\\)" reftex-section-post-regexp))
1096 (appendix-re (concat wbol "\\(\\\\appendix\\)")) 1102 (appendix-re (concat wbol "\\(\\\\appendix\\)"))
1097 (macro-re 1103 (macro-re
1098 (if macros-with-labels 1104 (if macros-with-labels