From: Stefan Monnier Date: Mon, 20 Sep 2010 22:42:47 +0000 (+0200) Subject: * lisp/textmodes/reftex-parse.el (reftex-what-macro) X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~47^2~56 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5d8e0d5d1444141bc4234232929f942d92c6d43b;p=emacs.git * lisp/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. Fixes: debbugs:7053 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 96c953452fa..2f94752943b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2010-09-20 Stefan Monnier + * 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 (bug#7053). + * emacs-lisp/lisp.el (up-list): Don't do nothing silently. * simple.el (blink-matching-open): Use syntax-class. diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el index 4854ca7ba3b..fa0275b58be 100644 --- a/lisp/textmodes/reftex-parse.el +++ b/lisp/textmodes/reftex-parse.el @@ -385,7 +385,7 @@ of master file." (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 @@ of master file." (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 @@ of master file." (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))))))