branch: elpa/isl
commit 71c2c2bdaccf799934ee80d46460d43686324747
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    New user var isl-align-regexp-group-pattern
---
 isl.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/isl.el b/isl.el
index b38c075ccc0..7ad6cb1e419 100644
--- a/isl.el
+++ b/isl.el
@@ -214,6 +214,10 @@ You can toggle this at any time with 
\\<isl-map>\\[isl-toggle-multi-search-in-li
 (defcustom isl-no-invisible-search-in-modes nil
   "Do not search invisible text in these modes."
   :type '(repeat symbol))
+
+(defcustom isl-align-regexp-group-pattern t
+  "Always surround isl-pattern with parens when non nil."
+  :type 'boolean)
 
 (defface isl-match
   '((t :background "Brown4"))
@@ -756,7 +760,9 @@ Numeric prefix ARG is applied to the SPACING arg of 
`align-regexp'."
     (align-regexp isl--point-min isl--point-max
                   (concat "\\(\\s-+\\)"
                           (if (equal (isl-matching-style) "Regex")
-                              isl-pattern
+                              (if isl-align-regexp-group-pattern
+                                  (format "\\(%s\\)" isl-pattern)
+                                isl-pattern)
                             (regexp-quote isl-pattern)))
                   1 arg)
     ;; Align-regexp has probably added or removed spaces so update

Reply via email to