aboutsummaryrefslogtreecommitdiff
path: root/seam.el
diff options
context:
space:
mode:
authorSpencer Williams <spnw@plexwave.org>2025-04-06 13:29:08 -0400
committerSpencer Williams <spnw@plexwave.org>2025-04-06 13:29:08 -0400
commitcbabd1dac3b6a809da8332b326daec926c6c5495 (patch)
tree4cd74b5bac85cc5b6b32ecd2c807c96b7d391e44 /seam.el
parent3733774bcc9bb6d6f27f25d06a6e7f2ff316db18 (diff)
Minor cleanup
Diffstat (limited to 'seam.el')
-rw-r--r--seam.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/seam.el b/seam.el
index 7ed2f8b..bfac0a0 100644
--- 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