[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 2fa33eb: Add `rx-submatch-n' for compatibility (bug
From: |
Mattias Engdegård |
Subject: |
[Emacs-diffs] master 2fa33eb: Add `rx-submatch-n' for compatibility (bug#37517) |
Date: |
Sun, 29 Sep 2019 11:08:52 -0400 (EDT) |
branch: master
commit 2fa33eb6ee20e48a4c6488bb0d55b3c1c9a1f721
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
Add `rx-submatch-n' for compatibility (bug#37517)
It was an internal symbol in the old `rx' implementation, used in old
versions of the `flycheck' package.
* lisp/emacs-lisp/rx.el (rx-submatch-n): Alias of `rx-to-string'.
* test/lisp/emacs-lisp/rx-tests.el (rx-compat): Test it.
---
lisp/emacs-lisp/rx.el | 3 +++
test/lisp/emacs-lisp/rx-tests.el | 3 +++
2 files changed, 6 insertions(+)
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index a192ed1..45fec79 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -1254,6 +1254,9 @@ following constructs:
`(app (match-string ,i) ,name))
(reverse rx--pcase-vars))))))
+;; Obsolete internal symbol, used in old versions of the `flycheck' package.
+(define-obsolete-function-alias 'rx-submatch-n 'rx-to-string "27.1")
+
(provide 'rx)
;;; rx.el ends here
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index 11de477..76dcf41 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -416,5 +416,8 @@
(should (equal (rx-to-string '(seq (delta a b c) (* (epsilon d e))) t)
"\\(?:<(delta a b c)>\\)\\(?:<(epsilon d e)>\\)*"))))
+(ert-deftest rx-compat ()
+ "Test old symbol retained for compatibility (bug#37517)."
+ (should (equal (rx-submatch-n '(group-n 3 (+ nonl) eol)) "\\(?3:.+$\\)")))
(provide 'rx-tests)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 2fa33eb: Add `rx-submatch-n' for compatibility (bug#37517),
Mattias Engdegård <=