[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tex-parens 6a649c48ac 2/3: Generalize Avy regexp
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tex-parens 6a649c48ac 2/3: Generalize Avy regexp |
Date: |
Sun, 15 Sep 2024 18:59:02 -0400 (EDT) |
branch: externals/tex-parens
commit 6a649c48acb91024a594010a0f168442c91a0ca3
Author: Paul Nelson <ultrono@gmail.com>
Commit: Paul Nelson <ultrono@gmail.com>
Generalize Avy regexp
* tex-parens.el (tex-parens-avy-regexp): Generalize the math
environments matched by this.
---
tex-parens.el | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/tex-parens.el b/tex-parens.el
index 324d50e4fd..61fd1d528c 100644
--- a/tex-parens.el
+++ b/tex-parens.el
@@ -1081,12 +1081,20 @@ Otherwise, call `self-insert-command'."
;;; Avy integration
(defcustom tex-parens-avy-regexp
- "\\(. \\$\\|..\n[[:space:]]*\\\\begin{\\(eq\\|ali\\)\\)"
+ (rx (or
+ (seq (= 2 anything) "$$")
+ (seq (= 2 anything) "\\(")
+ (seq (= 2 anything) "\\[")
+ (seq anything " $")
+ (seq (= 2 anything)
+ "\n"
+ (zero-or-more space)
+ "\\begin{"
+ (or "eq" "ali" "multline" "gath"))))
"Regular expression for `tex-parens-avy-jump-to-math'.
-This regexp should match the start of inline math expressions
-and equation environments."
- :type 'regexp
- :group 'tex-parens)
+This regexp matches the start of various math environments, keeping a
+couple of characters before the primary match to leave space for Avy."
+ :type 'regexp)
(defun tex-parens-avy-jump-to-math ()
"Jump inside a math expression using Avy.