auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] Changes to reftex/lisp/reftex-base.el,v


From: Ralf Angeli
Subject: [AUCTeX-diffs] Changes to reftex/lisp/reftex-base.el,v
Date: Sat, 03 May 2008 09:19:47 +0000

CVSROOT:        /sources/auctex
Module name:    reftex
Changes by:     Ralf Angeli <angeli>    08/05/03 09:19:47

Index: reftex-base.el
===================================================================
RCS file: /sources/auctex/reftex/lisp/reftex-base.el,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- reftex-base.el      13 Apr 2008 13:24:26 -0000      1.11
+++ reftex-base.el      3 May 2008 09:19:46 -0000       1.12
@@ -1053,27 +1053,16 @@
                                           reftex-include-file-commands "\\|")
                                "\\)[{ \t]+\\([^} \t\n\r]+\\)"))
            (section-re
-;;             (concat wbol "\\\\\\("
-;;                     (mapconcat (lambda (x) (regexp-quote (car x)))
-;;                                reftex-section-levels-all "\\|")
-;;                     "\\)\\*?\\(\\[[^]]*\\]\\)?[[{ \t\r\n]"))
-           ;; The old regexp above could not deal with stuff like
-           ;; "\begin{foo}\label{x}", so we now try to treat
-           ;; environments and macros differently without changing
-           ;; the regexp groups too much.
+           ;; 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 "\\\\\\("
-                   ;; Environments ("begin{foo}")
-                    (reftex-mapconcat-with-predicate
-                    (lambda (x) (regexp-quote (car x)))
-                    reftex-section-levels-all "\\|"
-                    (lambda (x) (string-match "begin{[^}]*}" (car x))))
-                   "\\|\\(?:"
-                   ;; Macros ("foo")
-                    (reftex-mapconcat-with-predicate
-                    (lambda (x) (regexp-quote (car x)))
-                    reftex-section-levels-all "\\|"
-                    (lambda (x) (not (string-match "begin{[^}]*}" (car x)))))
-                    "\\)\\*?\\(\\[[^]]*\\]\\)?[[{ \t\r\n]\\)"))
+                    (mapconcat (lambda (x) (regexp-quote (car x)))
+                               reftex-section-levels-all "\\|")
+                    "\\)\\*?\\(\\[[^]]*\\]\\)?[[{ \t\r\n\\]"))
            (appendix-re (concat wbol "\\(\\\\appendix\\)"))
            (macro-re
             (if macros-with-labels
@@ -2078,18 +2067,6 @@
    ((= (length text) 0) (make-string 1 ?\ ))
    (t text)))
 
-(defun reftex-mapconcat-with-predicate (function sequence separator predicate)
-  "Apply FUNCTION to each element of SEQUENCE and concatenate the results.
-Put SEPARATOR between each pair of results.  Use only those
-elements of SEQUENCE where PREDICATE returns non-nil.  PREDICATE
-is a function accepting one parameter, an element of SEQUENCE."
-  (let (list)
-    (dolist (elt sequence)
-      (when (funcall predicate elt)
-       (add-to-list 'list elt t)))
-    (delq nil list)
-    (mapconcat function list separator)))
-
 
 ;;; =========================================================================
 ;;;




reply via email to

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