The current behavior is inconsistent with that of the normal backquote
macro, so to avoid surprises, warn about the use of nested backquotes.
* lisp/emacs-lisp/pcase.el (pcase--expand-\`): Warn about nested backquotes.
* lisp/emacs-lisp/testcover.el (testcover-analyze-coverage)
(testcover-analyze-coverage-wrapped-form): Avoid nested backquotes
(cherry picked from commit
e8f5df5175170d36f526e46b63b3d428bb9a8950)
\f
* Incompatible Lisp Changes in Emacs 31.1
+** Nested backquotes are not supported any more in Pcase patterns.
+
** The 'rx' category name 'chinese-two-byte' must now be spelled correctly.
An old alternative name (without the first 'e') has been removed.
(upatd (pcase--expand-\` (cdr qpat))))
(if (and (eq (car-safe upata) 'quote) (eq (car-safe upatd) 'quote))
`'(,(cadr upata) . ,(cadr upatd))
- `(and (pred consp)
+ `(and ,@(when (eq (car qpat) '\`)
+ `((guard ,(macroexp-warn-and-return
+ "Nested ` are not supported" t nil nil qpat))))
+ (pred consp)
(app car-safe ,upata)
(app cdr-safe ,upatd)))))
((or (stringp qpat) (numberp qpat) (symbolp qpat)) `',qpat)
;; form to look odd. See bug#25316.
'testcover-1value)
- (`(\` ,bq-form)
+ (`(,'\` ,bq-form)
(testcover-analyze-coverage-backquote-form bq-form))
((or 't 'nil (pred keywordp))
'testcover-1value))
((pred atom)
'testcover-1value)
- (`(\` ,bq-form)
+ (`(,'\` ,bq-form)
(testcover-analyze-coverage-backquote-form bq-form))
(`(defconst ,sym ,val . ,_)
(push sym testcover-module-constants)