Skip to content

Commit

Permalink
Backport "cl-typep" pcase pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Oct 16, 2024
1 parent 45a77c5 commit 4e62b1f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
(require 'eieio)
(require 'edmacro)
(require 'format-spec)
(require 'pcase)

(eval-and-compile
(when (and (featurep 'seq)
Expand Down Expand Up @@ -85,6 +86,15 @@ similar defect.") :emergency))
(defvar Man-notify-method)
(defvar pp-default-function) ; since Emacs 29.1

(eval-and-compile
(when (< emacs-major-version 28)
(pcase-defmacro cl-type (type)
"Pcase pattern that matches objects of TYPE.
TYPE is a type descriptor as accepted by `cl-typep', which see."
(static-if (< emacs-major-version 30)
`(pred (pcase--flip cl-typep ',type))
`(pred (cl-typep _ ',type))))))

(defmacro transient--with-emergency-exit (id &rest body)
(declare (indent defun))
(unless (keywordp id)
Expand Down

0 comments on commit 4e62b1f

Please sign in to comment.