[Top][All Lists]

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

[Emacs-bug-tracker] bug#7053: closed (reftex and up-list)

From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#7053: closed (reftex and up-list)
Date: Mon, 20 Sep 2010 23:48:02 +0000

Your message dated Tue, 21 Sep 2010 01:40:19 +0200
with message-id <address@hidden>
and subject line Re: bug#7053: [AUCTeX-devel] Re: bug#7053: Reftex is fully 
has caused the GNU bug report #7053,
regarding reftex and up-list
to be marked as done.

(If you believe you have received this mail in error, please contact

7053: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7053
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Reftex is fully broken Date: Fri, 17 Sep 2010 11:41:27 +0200

The reftex package seems completely broken in the dev. version.
Basically any reftex operation (e.g. table of contents, C-c =) freeze
the full emacs. It starts using 100% but doesn't react to any keystroke,
(including C-g), the menubar is frozen as well. The frame (X11 window)
is refreshed, but I cannot close it by clicking on the "close window".

It freezes even without using any explicit command: If I try to type
\ref{label:valami} into a buffer, then it will freeze at the next
character I press.

I use this version:

bzr log -r-1 -v
revno: 101456
committer: Jan D <address@hidden>
branch nick: trunk
timestamp: Fri 2010-09-17 11:04:35 +0200
  Expose tool-bar pixel width to lisp and use it for speedbar (Bug#7048)
  * dframe.el (dframe-reposition-frame-emacs): Use tool-bar-pixel-width
  in calculating new frame position.  Add more space between new and
  parent on the left.
  * frame.c (Ftool_bar_pixel_width): New function to expose tool
  bar's pixel width to Lisp.

--- End Message ---
--- Begin Message --- Subject: Re: bug#7053: [AUCTeX-devel] Re: bug#7053: Reftex is fully broken Date: Tue, 21 Sep 2010 01:40:19 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)
>> bothered to follow the switch to Bazaar.  It might take a while to make
>> myself acquainted with it.  And unfortunately I failed to find a web
>> interface to the current Emacs sources in order to find out if somebody
>> has changed the RefTeX files, or in which way.

> I suspect the change is not in the reftex file but in the behavior of
> up-list which now obeys forward-sexp-function, which means that under
> latex-mode, it will now move from

>   \begin{foo}
>> here<
>   \end{foo}
> to just before the \begin.  So if the reftex code does not expect that
> (and/or for performance reason doesn't want that), it should protect
> against it by binding forward-sexp-function around calls to up-list
> and friends.

I think in the end, the core reason for the problem was a bug in the new
up-list code (it just silently did nothing when reaching BOB), which
I've just fixed.  I also additionally installed the patch below which
circumvents the bug and also avoids slowing things down unnecessarily.


=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog      2010-09-20 21:45:09 +0000
+++ lisp/ChangeLog      2010-09-20 22:35:46 +0000
@@ -1,5 +1,9 @@
 2010-09-20  Stefan Monnier  <address@hidden>
+       * textmodes/reftex-parse.el (reftex-what-macro)
+       (reftex-context-substring): Let-bind forward-sexp-function to nil
+       since we don't need/want to treat \begin...\end as a block.
        * emacs-lisp/lisp.el (up-list): Don't do nothing silently.
        * simple.el (blink-matching-open): Use syntax-class.

=== modified file 'lisp/textmodes/reftex-parse.el'
--- lisp/textmodes/reftex-parse.el      2010-09-20 13:27:59 +0000
+++ lisp/textmodes/reftex-parse.el      2010-09-20 22:35:33 +0000
@@ -385,7 +385,7 @@
 (defun reftex-section-info (file)
   ;; Return a section entry for the current match.
-  ;; Carefull: This function expects the match-data to be still in place!
+  ;; Careful: This function expects the match-data to be still in place!
   (let* ((marker (set-marker (make-marker) (1- (match-beginning 3))))
          (macro (reftex-match-string 3))
          (prefix (save-match-data
@@ -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))
@@ -965,15 +967,14 @@
             (if (re-search-forward "\\\\end{" nil t)
                 (match-beginning 0)
-   ((or (= (preceding-char) ?\{)
-        (= (preceding-char) ?\[))
+   ((memq (preceding-char) '(?\{ ?\[))
     ;; Inside a list - get only the list.
      (min (+ (point) 150)
           (condition-case nil
-              (progn
+              (let ((forward-sexp-function nil)) ;Unneeded fanciness.
                 (up-list 1)
                 (1- (point)))
             (error (point-max))))))

--- End Message ---

reply via email to

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