all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Ralf Angeli <angeli@caeruleus.net>
Cc: auctex-devel@gnu.org, "Alpár Jüttner" <alpar@cs.elte.hu>,
	"Carsten Dominik" <dominik@science.uva.nl>
Subject: bug#7053: [AUCTeX-devel] Re: bug#7053: Reftex is fully broken
Date: Tue, 21 Sep 2010 01:40:19 +0200	[thread overview]
Message-ID: <jwvmxrcyrbq.fsf-monnier+emacs__22689.1291830272$1285027886$gmane$org@gnu.org> (raw)
In-Reply-To: <jwv62y39gts.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 18 Sep 2010 18:11:59 +0200")

>> 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.


        Stefan


=== 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  <monnier@iro.umontreal.ca>
 
+	* 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)
               (point-max))))))
-   ((or (= (preceding-char) ?\{)
-        (= (preceding-char) ?\[))
+   ((memq (preceding-char) '(?\{ ?\[))
     ;; Inside a list - get only the list.
     (buffer-substring-no-properties
      (point)
      (min (+ (point) 150)
           (point-max)
           (condition-case nil
-              (progn
+              (let ((forward-sexp-function nil)) ;Unneeded fanciness.
                 (up-list 1)
                 (1- (point)))
             (error (point-max))))))






  parent reply	other threads:[~2010-09-20 23:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-17  9:41 bug#7053: Reftex is fully broken Alpár Jüttner
2010-09-17 11:52 ` Eli Zaretskii
2010-09-17 13:49   ` Alpár Jüttner
2010-09-17 16:20     ` Eli Zaretskii
2010-09-18  4:19       ` Alpár Jüttner
2010-09-18  9:21         ` Eli Zaretskii
2010-09-18 14:47         ` Stefan Monnier
2010-09-19  5:34           ` Alpár Jüttner
     [not found]         ` <83mxrfz9se.fsf@gnu.org>
2010-09-18 15:16           ` bug#7053: [AUCTeX-devel] " Ralf Angeli
     [not found]           ` <87vd635bfi.fsf@caeruleus.net>
2010-09-18 16:11             ` Stefan Monnier
     [not found]             ` <jwv62y39gts.fsf-monnier+emacs@gnu.org>
2010-09-18 16:28               ` Ralf Angeli
2010-09-19  8:48               ` Andreas Röhler
2010-09-20 23:40               ` Stefan Monnier [this message]
2010-09-19  5:24           ` Alpár Jüttner
2010-09-19  5:58             ` Eli Zaretskii
     [not found]             ` <E1OxCvN-0001nb-Jl@fencepost.gnu.org>
2010-09-19  6:42               ` Alpár Jüttner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='jwvmxrcyrbq.fsf-monnier+emacs__22689.1291830272$1285027886$gmane$org@gnu.org' \
    --to=monnier@iro.umontreal.ca \
    --cc=alpar@cs.elte.hu \
    --cc=angeli@caeruleus.net \
    --cc=auctex-devel@gnu.org \
    --cc=dominik@science.uva.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.