aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Távora2012-08-03 10:29:59 +0800
committerChong Yidong2012-08-03 10:29:59 +0800
commit0ffee6167f5a90c13fffc53f27a7e13d35475645 (patch)
tree0a19cce1c4f2ca00563433776a67f0c84a4891b9
parentf35ef0edeeef54286775c79ddf0df7b1e5f26a25 (diff)
downloademacs-0ffee6167f5a90c13fffc53f27a7e13d35475645.tar.gz
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
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/textmodes/tex-mode.el7
2 files changed, 10 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a09042d9faf..b550c8db7e2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-08-03 João Távora <joaotavora@gmail.com>
2
3 * textmodes/tex-mode.el (latex-forward-sexp): Terminate the loop
4 if sexp scanning does not move point (Bug#5734).
5
12012-08-02 Tassilo Horn <tsdh@gnu.org> 62012-08-02 Tassilo Horn <tsdh@gnu.org>
2 7
3 * textmodes/reftex-vars.el (reftex-default-label-alist-entries): 8 * 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."
1722 "Like `forward-sexp' but aware of multi-char elements and escaped parens." 1722 "Like `forward-sexp' but aware of multi-char elements and escaped parens."
1723 (interactive "P") 1723 (interactive "P")
1724 (unless arg (setq arg 1)) 1724 (unless arg (setq arg 1))
1725 (let ((pos (point))) 1725 (let ((pos (point))
1726 (opoint 0))
1726 (condition-case err 1727 (condition-case err
1727 (while (/= arg 0) 1728 (while (and (/= (point) opoint)
1729 (/= arg 0))
1730 (setq opoint (point))
1728 (setq arg 1731 (setq arg
1729 (if (> arg 0) 1732 (if (> arg 0)
1730 (progn (latex-forward-sexp-1) (1- arg)) 1733 (progn (latex-forward-sexp-1) (1- arg))