seam

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

commit cbabd1dac3b6a809da8332b326daec926c6c5495
parent 3733774bcc9bb6d6f27f25d06a6e7f2ff316db18
Author: Spencer Williams <spnw@plexwave.org>
Date:   Sun,  6 Apr 2025 13:29:08 -0400

Minor cleanup

Diffstat:
Mseam.el | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/seam.el b/seam.el @@ -70,6 +70,9 @@ naming. Must be a function taking two arguments: TITLE and TYPE." (defun seam-html-directories () (mapcar #'car seam-export-alist)) +(defun seam-slugify (title) + (downcase (string-join (string-split title "\\W+" t) "-"))) + (defun seam-lookup-slug (slug) (cl-dolist (type seam-note-types) (let ((file (file-name-concat seam-note-directory type (concat slug ".org")))) @@ -184,9 +187,6 @@ naming. Must be a function taking two arguments: TITLE and TYPE." (let ((completion-ignore-case t)) (apply seam-completing-read-function args))) -(defun seam-slugify (title) - (downcase (string-join (string-split title "\\W+" t) "-"))) - (defun seam-make-note (title &optional type select) (unless type (setq type seam-default-note-type)) @@ -313,9 +313,9 @@ completion prompt is given to choose the type." (let* ((old (buffer-file-name)) (type (seam-get-note-type old t))) (when type - (let* ((title (or (seam-get-title-from-buffer) - (error "Note must have a title"))) - (slug (seam-get-slug-from-buffer)) + (unless (seam-get-title-from-buffer) + (error "Note must have a title")) + (let* ((slug (seam-get-slug-from-buffer)) (new (seam-make-file-name slug type))) (unless (string= old new) ;This is valid because ;`seam-save-buffer' cannot