From 087165a9934b678b9c2ce97790bcb0ee8c2e5616 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 7 Dec 2023 22:27:24 -0800 Subject: [PATCH] Show error if STATUS isn't one of the accepted values --- tekuti.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tekuti.el b/tekuti.el index 9fbbbf9..02b23db 100644 --- a/tekuti.el +++ b/tekuti.el @@ -65,6 +65,12 @@ with a ‘/’.") (list "COMMENTS-CLOSED-DATE" (and (not (string-empty-p date)) (tekuti--format-date date)))) + (`("STATUS" ,status) + (let ((accepted-values '("publish" "draft" "private"))) + (if (member status accepted-values) + pair + (error "Unknown post status: %s; Accepted values are: %s" + status accepted-values)))) (_ pair))) (defun tekuti-build-data-from-org ()