Skip to content

Commit

Permalink
Don't use internal rx functions
Browse files Browse the repository at this point in the history
Use rx-to-string instead of the internal rx-submatch-n, which is gone
in Emacs 27 and never was intended for public use.  Fixes GH-1626.
  • Loading branch information
mattiase authored and cpitclaudel committed Sep 26, 2019
1 parent 0006a59 commit 9fcdff7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flycheck.el
Original file line number Diff line number Diff line change
Expand Up @@ -1400,16 +1400,16 @@ Safely delete all files and directories listed in
"Translate the `(file-name)' FORM into a regular expression."
(let ((body (or (cdr form) '((minimal-match
(one-or-more not-newline))))))
(rx-submatch-n `(group-n 1 ,@body))))
(rx-to-string `(group-n 1 ,@body) t)))

(defun flycheck-rx-message (form)
"Translate the `(message)' FORM into a regular expression."
(let ((body (or (cdr form) '((one-or-more not-newline)))))
(rx-submatch-n `(group-n 4 ,@body))))
(rx-to-string `(group-n 4 ,@body) t)))

(defun flycheck-rx-id (form)
"Translate the `(id)' FORM into a regular expression."
(rx-submatch-n `(group-n 5 ,@(cdr form))))
(rx-to-string `(group-n 5 ,@(cdr form)) t))

(defun flycheck-rx-to-string (form &optional no-group)
"Like `rx-to-string' for FORM, but with special keywords:
Expand Down

0 comments on commit 9fcdff7

Please sign in to comment.