|
| From: | ELPA Syncer |
| Subject: | [nongnu] elpa/tuareg a19099803d 1/2: Prevent Invalid search bound error on long patterns |
| Date: | Fri, 12 May 2023 10:03:10 -0400 (EDT) |
branch: elpa/tuareg
commit a19099803d577433a0d58b8f0b63272a86040774
Author: Aaron L. Zeng <azeng@janestreet.com>
Commit: Aaron L. Zeng <azeng@janestreet.com>
Prevent Invalid search bound error on long patterns
When `tuareg--pattern-pre-form-let' is invoked at the beginning of a
let binding whose LHS is very long (> 800 characters), it can signal
the following error:
Invalid search bound (wrong side of point)
This happens when a balanced set of parentheses includes the limit
position, so `forward-list' skips past it and thereby causes point to
exceed limit.
Apply the same fix to `tuareg--pattern-pre-form-fun' by analogy.
`tuareg--pattern-equal-matcher' is already correct.
---
tuareg.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tuareg.el b/tuareg.el
index f032fe2495..0c5a2e30dd 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -1348,6 +1348,7 @@ It must not be used outside fontification purposes."
pos)
(setq tuareg--pattern-matcher-limit nil)
(while (and
+ (<= (point) limit)
(setq pos (re-search-forward "[=({:]" limit t))
(progn
(backward-char)
@@ -1387,6 +1388,7 @@ It must not be used outside fontification purposes."
(limit (+ opoint 800))
pos)
(while (and
+ (<= (point) limit)
(setq pos (re-search-forward "[-({]" limit t))
(cond
((or (char-equal ?\( (char-before))
| [Prev in Thread] | Current Thread | [Next in Thread] |