diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2024-09-26 16:40:54 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2024-09-26 16:40:54 -0400 |
commit | 4591d93a8e5e79e7fea8a67c84c6adf0ea8add28 (patch) | |
tree | 5cf1ac249cc4a260ae190e3e440016148465de19 /lisp/emacs-lisp/pcase.el | |
parent | 37bed70f4c0a2e33de238eab90d7470d34366f13 (diff) | |
download | emacs-4591d93a8e5e79e7fea8a67c84c6adf0ea8add28.tar.gz emacs-4591d93a8e5e79e7fea8a67c84c6adf0ea8add28.tar.bz2 emacs-4591d93a8e5e79e7fea8a67c84c6adf0ea8add28.zip |
* lisp/emacs-lisp/pcase.el (pcase--expand-\`): Improve warning message
And also move the warning "out of the way" so it doesn't
confuse optimizations.
Diffstat (limited to 'lisp/emacs-lisp/pcase.el')
-rw-r--r-- | lisp/emacs-lisp/pcase.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index fe62820f0cb..898d460c144 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -1172,12 +1172,13 @@ The predicate is the logical-AND of: (upatd (pcase--expand-\` (cdr qpat)))) (if (and (eq (car-safe upata) 'quote) (eq (car-safe upatd) 'quote)) `'(,(cadr upata) . ,(cadr upatd)) - `(and ,@(when (eq (car qpat) '\`) - `((guard ,(macroexp-warn-and-return - "Nested ` are not supported" t nil nil qpat)))) - (pred consp) + `(and (pred consp) (app car-safe ,upata) - (app cdr-safe ,upatd))))) + (app cdr-safe ,upatd) + ,@(when (eq (car qpat) '\`) + `((guard ,(macroexp-warn-and-return + "Nested ` are not supported in Pcase patterns" + t nil nil qpat)))))))) ((or (stringp qpat) (numberp qpat) (symbolp qpat)) `',qpat) ;; In all other cases just raise an error so we can't break ;; backward compatibility when adding \` support for other |