[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r111006: * textmodes/reftex-parse.el
From: |
Vincent Belaïche |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r111006: * textmodes/reftex-parse.el (reftex-parse-from-file): Use variable reftex-section-info-function in order to be compatible with Texinfo integration. |
Date: |
Sun, 25 Nov 2012 06:05:34 +0100 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 111006
committer: Vincent Belaïche <address@hidden>
branch nick: trunk
timestamp: Sun 2012-11-25 06:05:34 +0100
message:
* 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.
modified:
lisp/ChangeLog
lisp/textmodes/reftex-parse.el
lisp/textmodes/reftex-toc.el
lisp/textmodes/reftex.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-11-25 04:50:20 +0000
+++ b/lisp/ChangeLog 2012-11-25 05:05:34 +0000
@@ -1,3 +1,20 @@
+2012-11-24 Vincent Belaïche <address@hidden>
+
+ * 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.
+
2012-11-25 Chong Yidong <address@hidden>
* faces.el: Make face-spec-set more analogous to setq.
=== modified file 'lisp/textmodes/reftex-parse.el'
--- a/lisp/textmodes/reftex-parse.el 2012-09-30 20:30:13 +0000
+++ b/lisp/textmodes/reftex-parse.el 2012-11-25 05:05:34 +0000
@@ -251,7 +251,7 @@
;; the next parsing iteration.
(when (eq (char-before) ?\\) (backward-char))
;; Insert in List
- (setq toc-entry (reftex-section-info file))
+ (setq toc-entry (funcall reftex-section-info-function file))
(when toc-entry
;; It can happen that section info returns nil
(setq level (nth 5 toc-entry))
=== modified file 'lisp/textmodes/reftex-toc.el'
--- a/lisp/textmodes/reftex-toc.el 2012-09-30 20:30:13 +0000
+++ b/lisp/textmodes/reftex-toc.el 2012-11-25 05:05:34 +0000
@@ -785,7 +785,7 @@
(marker (nth 4 data)))
(with-current-buffer (marker-buffer marker)
(goto-char (marker-position marker))
- (if (looking-at (concat "\\([ \t]*\\\\\\)" (regexp-quote name)))
+ (if (looking-at (concat "\\([ \t]*" reftex-section-pre-regexp "\\)"
(regexp-quote name)))
(replace-match (concat "\\1" newname))
(error "Fatal error during %smotion" pro-or-de)))))
=== modified file 'lisp/textmodes/reftex.el'
--- a/lisp/textmodes/reftex.el 2012-10-05 05:57:24 +0000
+++ b/lisp/textmodes/reftex.el 2012-11-25 05:05:34 +0000
@@ -301,7 +301,9 @@
(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)
+
+ (run-hooks 'reftex-mode-hook))
;; Mode was turned off
(easy-menu-remove reftex-mode-menu)))
@@ -664,6 +666,16 @@
(defvar reftex-find-label-regexp-format nil)
(defvar reftex-find-label-regexp-format2 nil)
+;; Constants for making RefTeX open to Texinfo hooking
+(defvar reftex-section-pre-regexp "\\\\")
+;; Including `\' as a character to be matched at the end of the regexp
+;; will allow stuff like \begin{foo}\label{bar} to be matched. This
+;; will make the parser to advance one char too much. Therefore
+;; `reftex-parse-from-file' will step one char back if a section is
+;; found.
+(defvar reftex-section-post-regexp "\\*?\\(\\[[^]]*\\]\\)?[[{ \t\r\n\\]")
+(defvar reftex-section-info-function 'reftex-section-info)
+
(defvar reftex-memory nil
"Memorizes old variable values to indicate changes in these variables.")
@@ -1083,16 +1095,10 @@
reftex-include-file-commands "\\|")
"\\)[{ \t]+\\([^} \t\n\r]+\\)"))
(section-re
- ;; Including `\' as a character to be matched at the end
- ;; of the regexp will allow stuff like
- ;; \begin{foo}\label{bar} to be matched. This will make
- ;; the parser to advance one char too much. Therefore
- ;; `reftex-parse-from-file' will step one char back if a
- ;; section is found.
- (concat wbol "\\\\\\("
+ (concat wbol reftex-section-pre-regexp "\\("
(mapconcat (lambda (x) (regexp-quote (car x)))
reftex-section-levels-all "\\|")
- "\\)\\*?\\(\\[[^]]*\\]\\)?[[{ \t\r\n\\]"))
+ "\\)" reftex-section-post-regexp))
(appendix-re (concat wbol "\\(\\\\appendix\\)"))
(macro-re
(if macros-with-labels
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r111006: * textmodes/reftex-parse.el (reftex-parse-from-file): Use variable reftex-section-info-function in order to be compatible with Texinfo integration.,
Vincent Belaïche <=