summaryrefslogtreecommitdiff
path: root/lisp/textmodes/tex-mode.el
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2012-08-03 10:29:59 +0800
committerChong Yidong <cyd@gnu.org>2012-08-03 10:29:59 +0800
commit0ffee6167f5a90c13fffc53f27a7e13d35475645 (patch)
tree0a19cce1c4f2ca00563433776a67f0c84a4891b9 /lisp/textmodes/tex-mode.el
parentf35ef0edeeef54286775c79ddf0df7b1e5f26a25 (diff)
downloademacs-0ffee6167f5a90c13fffc53f27a7e13d35475645.tar.gz
emacs-0ffee6167f5a90c13fffc53f27a7e13d35475645.tar.bz2
emacs-0ffee6167f5a90c13fffc53f27a7e13d35475645.zip
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
Diffstat (limited to 'lisp/textmodes/tex-mode.el')
-rw-r--r--lisp/textmodes/tex-mode.el7
1 files changed, 5 insertions, 2 deletions
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))