branch: externals/xr
commit 0d787debe67ca1d5ddd5b1ce4760a2421688f1b8
Author: Mattias EngdegĂ„rd <[email protected]>
Commit: Mattias EngdegĂ„rd <[email protected]>

    Use eval-and-compile around pcase-defmacro for Emacs 27 compat
---
 xr.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/xr.el b/xr.el
index 754e4d1c06..d464a3785a 100644
--- a/xr.el
+++ b/xr.el
@@ -83,9 +83,13 @@ END is nil if unknown."
                                 lower multibyte nonascii print punct space
                                 unibyte upper word xdigit)))
 
-(pcase-defmacro xr--char-class ()
-  "Match any standard regexp char class as a symbol."
-  `(or ,@(mapcar (lambda (x) `(quote ,x)) xr--char-classes)))
+;; FIXME: `eval-and-compile' around `pcase-defmacro' only necessary
+;; for compatibility with Emacs 27.
+(eval-and-compile
+  (pcase-defmacro xr--char-class ()
+    "Match any standard regexp char class as a symbol."
+    `(or ,@(mapcar (lambda (x) `(quote ,x)) xr--char-classes)))
+  )
 
 (defvar xr--string)
 (defvar xr--len)

Reply via email to