Commit 2fa33eb6 authored by Mattias Engdegård's avatar Mattias Engdegård

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.
parent 9d7fae5a
Pipeline #3373 passed with stage
in 55 minutes and 40 seconds
......@@ -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
......@@ -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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment