Subject: bug#7053: Reftex is fully broken

From: Stefan Monnier <[email-masked]>
Date: Sat, 18 Sep 2010 16:47:01 +0200

> I'm sorry. Here comes the lisp backtrace (when pressing C-c = ):

> Lisp Backtrace:
> "forward-sexp" (0xbfffc9b4)
> "backward-sexp" (0xbfffcae4)
> ---Type <return> to continue, or q <return> to quit---
> "latex-backward-sexp-1" (0xbfffcc24)
> "byte-code" (0xbfffccd0)
> "latex-forward-sexp" (0xbfffcf64)
> "forward-sexp" (0xbfffd094)
> "byte-code" (0xbfffd140)
> "up-list" (0xbfffd3e4)
> "byte-code" (0xbfffd490)
> "byte-code" (0xbfffd6b0)
> "reftex-what-macro" (0xbfffd924)
> "reftex-label-location" (0xbfffda64)
> "reftex-label-info" (0xbfffdba4)
> "byte-code" (0xbfffdc60)
> "reftex-parse-from-file" (0xbfffdef4)
> "byte-code" (0xbfffdfa0)
> "reftex-do-parse" (0xbfffe174)
> "reftex-access-scan-info" (0xbfffe2a4)
> "reftex-toc" (0xbfffe414)
> "call-interactively" (0xbfffe5ac)
> (gdb) 

Can you try the patch below, to see if it fixes your problem?

        Stefan

=== modified file 'lisp/textmodes/reftex-parse.el'
--- lisp/textmodes/reftex-parse.el	2010-08-29 22:13:49 +0000
+++ lisp/textmodes/reftex-parse.el	2010-09-18 14:45:39 +0000
@@ -778,13 +778,15 @@
           (narrow-to-region (max (point-min) bound) (point-max))
           ;; move back out of the current parenthesis
           (while (condition-case nil
-                     (progn (up-list -1) t)
+                     (let ((forward-sexp-function nil))
+                       (up-list -1) t)
                    (error nil))
             (setq cnt 1 cnt-opt 0)
             ;; move back over any touching sexps
             (while (and (reftex-move-to-previous-arg bound)
                         (condition-case nil
-                            (progn (backward-sexp) t)
+                            (let ((forward-sexp-function nil))
+                              (backward-sexp) t)
                           (error nil)))
               (if (eq (following-char) ?\[) (incf cnt-opt))
               (incf cnt))
@@ -973,7 +975,7 @@
      (min (+ (point) 150)
           (point-max)
           (condition-case nil
-              (progn
+              (let ((forward-sexp-function nil))
                 (up-list 1)
                 (1- (point)))
             (error (point-max))))))