seam

Personal wiki toolkit for Emacs
Log | Files | Refs | LICENSE

commit a9127f657f96d13ba37a3617589fdfe2d462e6ec
parent 2988531c18eedb54f01faefd7dffa61dfe440e44
Author: Spencer Williams <spnw@plexwave.org>
Date:   Mon,  7 Apr 2025 22:47:40 -0400

Add note type validation function

Diffstat:
Mlisp/seam.el | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 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