diff options
author | Spencer Williams <spnw@plexwave.org> | 2025-04-07 22:47:40 -0400 |
---|---|---|
committer | Spencer Williams <spnw@plexwave.org> | 2025-04-07 22:47:40 -0400 |
commit | a9127f657f96d13ba37a3617589fdfe2d462e6ec (patch) | |
tree | cb8d53d27978c0e89164a5bbd825baaec96e999e /lisp/seam.el | |
parent | 2988531c18eedb54f01faefd7dffa61dfe440e44 (diff) |
Add note type validation function
Diffstat (limited to 'lisp/seam.el')
-rw-r--r-- | lisp/seam.el | 7 |
1 files changed, 5 insertions, 2 deletions
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 |