From 25d828c32e3a0da6b97b574cc96d3fde8fe66a17 Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Sun, 20 Feb 2022 13:14:58 -0800 Subject: [PATCH] (chore): fix lints on master (#2099) --- .dir-locals.el | 3 +++ org-roam-capture.el | 3 ++- org-roam-node.el | 18 ++++++++---------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el index e526e3b..9ac25e1 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -4,6 +4,9 @@ (elisp-lint-ignored-validators . ("byte-compile" "package-lint")) (elisp-lint-indent-specs . ((describe . 1) (it . 1) + (thread-first . 0) + (cl-flet . 1) + (cl-flet* . 1) (org-element-map . defun) (org-roam-dolist-with-progress . 2) (org-roam-with-temp-buffer . 1) diff --git a/org-roam-capture.el b/org-roam-capture.el index 429d139..0d25679 100644 --- a/org-roam-capture.el +++ b/org-roam-capture.el @@ -591,7 +591,8 @@ Return the ID of the location." PATH is a string that can optionally contain templated text in it." (or (org-roam-node-file org-roam-capture--node) - (thread-first path + (thread-first + path (org-roam-capture--fill-template t) (string-trim) (expand-file-name org-roam-directory)))) diff --git a/org-roam-node.el b/org-roam-node.el index 8cfb9a5..92ab903 100644 --- a/org-roam-node.el +++ b/org-roam-node.el @@ -131,8 +131,8 @@ It takes a single argument REF, which is a propertized string." :type 'boolean) (defcustom org-roam-extract-new-file-path "%<%Y%m%d%H%M%S>-${slug}.org" - "The file path template (relative to `org-roam-directory') to use -when a node is extracted to its own file." + "The file path template to use when a node is extracted to its own file. +This path is relative to `org-roam-directory'." :group 'org-roam :type 'string) @@ -187,14 +187,12 @@ when a node is extracted to its own file." 816 ; U+0330 COMBINING TILDE BELOW 817 ; U+0331 COMBINING MACRON BELOW ))) - (cl-flet* ((nonspacing-mark-p (char) - (memq char slug-trim-chars)) - (strip-nonspacing-marks (s) - (string-glyph-compose - (apply #'string (seq-remove #'nonspacing-mark-p - (string-glyph-decompose s))))) - (cl-replace (title pair) - (replace-regexp-in-string (car pair) (cdr pair) title))) + (cl-flet* ((nonspacing-mark-p (char) (memq char slug-trim-chars)) + (strip-nonspacing-marks (s) (string-glyph-compose + (apply #'string + (seq-remove #'nonspacing-mark-p + (string-glyph-decompose s))))) + (cl-replace (title pair) (replace-regexp-in-string (car pair) (cdr pair) title))) (let* ((pairs `(("[^[:alnum:][:digit:]]" . "_") ;; convert anything not alphanumeric ("__*" . "_") ;; remove sequential underscores ("^_" . "") ;; remove starting underscore