From: João Távora Date: Fri, 3 Aug 2012 02:29:59 +0000 (+0800) Subject: Workaround for latex-forward-sexp slowness. X-Git-Tag: emacs-24.2.90~882 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0ffee6167f5a90c13fffc53f27a7e13d35475645;p=emacs.git Workaround for latex-forward-sexp slowness. * textmodes/tex-mode.el (latex-forward-sexp): Terminate the loop if sexp scanning does not move point. Fixes: debbugs:5734 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a09042d9faf..b550c8db7e2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-03 João Távora + + * textmodes/tex-mode.el (latex-forward-sexp): Terminate the loop + if sexp scanning does not move point (Bug#5734). + 2012-08-02 Tassilo Horn * textmodes/reftex-vars.el (reftex-default-label-alist-entries): diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 5571af1ad9b..9a3462773fc 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -1722,9 +1722,12 @@ Mark is left at original location." "Like `forward-sexp' but aware of multi-char elements and escaped parens." (interactive "P") (unless arg (setq arg 1)) - (let ((pos (point))) + (let ((pos (point)) + (opoint 0)) (condition-case err - (while (/= arg 0) + (while (and (/= (point) opoint) + (/= arg 0)) + (setq opoint (point)) (setq arg (if (> arg 0) (progn (latex-forward-sexp-1) (1- arg))