From a591bd061382532d9c58695d1ba5710c1de11ea7 Mon Sep 17 00:00:00 2001 From: Chris Barrett Date: Tue, 14 Mar 2023 22:20:35 +1300 Subject: [PATCH] Make plisty validator fns return input --- lisp/plisty.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/plisty.el b/lisp/plisty.el index e5da8db..53c0161 100644 --- a/lisp/plisty.el +++ b/lisp/plisty.el @@ -118,7 +118,7 @@ which are compared using `plist-equal' recursively." (cl-assert (listp required-keys)) (cl-assert (seq-every-p #'keywordp required-keys)) (cl-assert (seq-every-p #'keywordp all-keys)) - `(defsubst ,(plisty--validator-for-type type) (value &optional strict) + `(defun ,(plisty--validator-for-type type) (value &optional strict) (cl-assert (listp value) t "Expected a plist" ) (let ((required-keys ',required-keys) (all-keys ',all-keys) @@ -134,7 +134,8 @@ which are compared using `plist-equal' recursively." (cl-assert (null (seq-difference keys all-keys)) t "Unexpected additional keys: %s" - (seq-difference keys all-keys)))))) + (seq-difference keys all-keys))) + value))) (defun plisty--pred-accessor-name (type keyword) (intern (format "%s-%s" type (string-remove-prefix ":" (symbol-name keyword)))))