Mercurial > emacs
diff lisp/textmodes/reftex-parse.el @ 110450:9b627013b805
* 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.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 21 Sep 2010 00:42:47 +0200 |
parents | 6cf93d8fc391 |
children | 417b1e4d63cd |
line wrap: on
line diff
--- a/lisp/textmodes/reftex-parse.el Tue Sep 21 01:35:37 2010 +0300 +++ b/lisp/textmodes/reftex-parse.el Tue Sep 21 00:42:47 2010 +0200 @@ -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))))))