From a9127f657f96d13ba37a3617589fdfe2d462e6ec Mon Sep 17 00:00:00 2001 From: Spencer Williams Date: Mon, 7 Apr 2025 22:47:40 -0400 Subject: Add note type validation function --- lisp/seam.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lisp/seam.el') diff --git a/lisp/seam.el b/lisp/seam.el index 25213c3..6ebdceb 100644 --- a/lisp/seam.el +++ b/lisp/seam.el @@ -183,11 +183,14 @@ naming. Must be a function taking two arguments: TITLE and TYPE." (defun seam-format-title (title type) (funcall seam-title-formatter title type)) +(defun seam-validate-note-type (type) + (unless (member type seam-note-types) + (error "`%s' is not a valid Seam note type" type))) + (defun seam-make-note (title &optional type select) (unless type (setq type seam-default-note-type)) - (unless (member type seam-note-types) - (error "`%s' is not a valid Seam note type" type)) + (seam-validate-note-type type) (seam-ensure-note-subdirectories-exist) (let* ((slug (seam-slugify title)) (file (file-name-concat seam-note-directory -- cgit v1.2.3