* textmodes/tex-mode.el (latex-forward-sexp): Terminate the loop if
sexp scanning does not move point.
Fixes: debbugs:5734
+2012-08-03 João Távora <joaotavora@gmail.com>
+
+ * textmodes/tex-mode.el (latex-forward-sexp): Terminate the loop
+ if sexp scanning does not move point (Bug#5734).
+
2012-08-02 Tassilo Horn <tsdh@gnu.org>
* textmodes/reftex-vars.el (reftex-default-label-alist-entries):
"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))