commit 2e1ae69f61449f74f816176d92bd790fbd9dc358 parent 9222a9b277359ae53bbc7026dc2d6a4d6c95a926 Author: Spencer Williams <spnw@plexwave.org> Date: Thu, 17 Apr 2025 15:02:20 -0400 Fix improper handling of titles with single quotes Diffstat:
| M | CHANGELOG.org | | | 2 | ++ |
| M | lisp/seam-test.el | | | 4 | ++-- |
| M | lisp/seam.el | | | 5 | ++++- |
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.org b/CHANGELOG.org @@ -35,6 +35,8 @@ *** Bugfixes +- Notes with single quotes in the name (') are no longer broken. + - =seam-visited-notes= no longer returns buffers that visit non-note files within =seam-note-directory=. This could have resulted in Seam inappropriately modifying those files (e.g. updating links). diff --git a/lisp/seam-test.el b/lisp/seam-test.el @@ -121,9 +121,9 @@ (ert-deftest seam-test-make-note-weird-filename () (should (equal - '("./Weird file name!" ("private/weird-file-name.org")) + '("./Weir'd file name!" ("private/weird-file-name.org")) (seam-test-with-notes () - ((weird "./Weird file name! ")) + ((weird "./Weir'd file name! ")) (list (buffer-name weird) (seam-test-list-files)))))) diff --git a/lisp/seam.el b/lisp/seam.el @@ -72,7 +72,10 @@ naming. Must be a function taking two arguments: TITLE and TYPE." (mapcar #'car seam-export-alist)) (defun seam-slugify (title) - (downcase (string-join (string-split title "\\W+" t) "-"))) + (setq title (string-replace "'" "" title)) + (setq title (string-split title "\\W+" t)) + (setq title (string-join title "-")) + (downcase title)) (defun seam-lookup-slug (slug) (cl-dolist (type seam-note-types)