auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] Problem with reftex-toc when both LaTeX and Texinfo file ar


From: Vincent Belaïche
Subject: Re: [AUCTeX] Problem with reftex-toc when both LaTeX and Texinfo file are visited.
Date: Mon, 06 Jan 2014 22:08:35 +0100

Hello,

Here is the complete patch with date added to comment and ChangeLog
entry. Hopefully this fulfills your expectation.

Thank you Tassilo for doing the change to RefTeX.

   Vincent.

diff --git a/ChangeLog b/ChangeLog
index a541e40..6c1f644 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2014-01-06  Vincent Belaïche  <address@hidden>
+
+       * tex-info.el (Texinfo-reftex-hook): Replace use of
+       reftex-tables-dirty by that of reftex-default-label-alist-entries
+       to trigger call to reftex-compile-variables in a standard way. The
+       problem was that generating a toc for a Texinfo file and then for
+       a LaTeX file was not working for the LaTeX file because the
+       Texinfo file was using LaTeX label style and as such
+       reftex-ensure-compiled-variables was not calling
+       reftex-compile-variables, which caused wrong
+       reftex-everything-regexp for sections.
+
 2013-08-03  Mosè Giordano  <address@hidden>
 
        * latex.el (TeX-arg-ref): New function.
diff --git a/tex-info.el b/tex-info.el
index 6649b40..e326a52 100644
--- a/tex-info.el
+++ b/tex-info.el
@@ -392,10 +392,17 @@ for @node."
   "Hook function to plug Texinfo into RefTeX."
   ;; force recompilation of variables
   (when (string= TeX-base-mode-name "Texinfo")
+    ;; dirty temporary hook to remove when reftex has a Texinfo builtin 
+    ;; TODO --- taken on <2014-01-06 mon> --- remove the dirty trick once 
reftex
+    ;; has been corrected for long enough a time
+    (unless (assq 'Texinfo reftex-label-alist-builtin)
+      (setq reftex-label-alist-builtin (append reftex-label-alist-builtin
+                                              '((Texinfo "Texinfo default 
environments" nil)))))
     (dolist (v `((reftex-section-pre-regexp . "@")
                 ; section post-regexp must contain exactly one group
                 (reftex-section-post-regexp . "\\([ \t]+\\)")
                 (reftex-section-info-function . Texinfo-reftex-section-info)
+                (reftex-default-label-alist-entries . (Texinfo))
               (reftex-section-levels
                . ,(mapcar
                    (lambda (x)
@@ -405,7 +412,6 @@ for @node."
                        (cons (car x) (cadr x))))
                    texinfo-section-list))))
       (set (make-local-variable (car v) ) (cdr v)))
-    (setq reftex-tables-dirty t)
     (reftex-ensure-compiled-variables)))
 
 ;;; Keymap:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]