[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote b5ef3f5481 02/12: Simplify denote-convert-file-n
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote b5ef3f5481 02/12: Simplify denote-convert-file-name-keywords-to-crm |
Date: |
Thu, 4 Jan 2024 06:57:53 -0500 (EST) |
branch: externals/denote
commit b5ef3f548175d7e45b6b3f6d42d19262260b8ddb
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Simplify denote-convert-file-name-keywords-to-crm
---
denote.el | 8 +++-----
tests/denote-test.el | 3 +--
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/denote.el b/denote.el
index 466d3faefd..df44325206 100644
--- a/denote.el
+++ b/denote.el
@@ -990,9 +990,7 @@ Inferred keywords are filtered by the user option
STRING consists of underscore-separated words, as those appear in
the keywords component of a Denote file name. STRING is the same
as the return value of `denote-retrieve-filename-keywords'."
- (when (and string (not (string-empty-p string)))
- (let ((list-of-strings (split-string string "_" :omit-nulls "_")))
- (mapconcat #'identity list-of-strings ","))))
+ (string-join (split-string string "_" :omit-nulls "_") ","))
(defvar denote--keyword-history nil
"Minibuffer history of inputted keywords.")
@@ -2492,7 +2490,7 @@ file-naming scheme."
(format "Rename `%s' with title (empty to remove)" file-in-prompt))
(denote-keywords-prompt
(format "Rename `%s' with keywords (empty to remove)" file-in-prompt)
- (denote-convert-file-name-keywords-to-crm
(denote-retrieve-filename-keywords file)))
+ (denote-convert-file-name-keywords-to-crm (or
(denote-retrieve-filename-keywords file) "")))
(denote-signature-prompt
(string-replace "=" " " (or (denote-retrieve-filename-signature file)
""))
(format "Rename `%s' with signature (empty to remove)" file-in-prompt))
@@ -2535,7 +2533,7 @@ the changes made to the file: perform them outright."
(format "Rename `%s' with title (empty to remove)"
file-in-prompt)))
(keywords (denote-keywords-prompt
(format "Rename `%s' with keywords (empty to
remove)" file-in-prompt)
- (denote-convert-file-name-keywords-to-crm
(denote-retrieve-filename-keywords file))))
+ (denote-convert-file-name-keywords-to-crm (or
(denote-retrieve-filename-keywords file) ""))))
(signature (denote-signature-prompt
(string-replace "=" " " (or
(denote-retrieve-filename-signature file) ""))
(format "Rename `%s' with signature (empty to
remove)" file-in-prompt)))
diff --git a/tests/denote-test.el b/tests/denote-test.el
index 074660a573..f61d9b9b68 100644
--- a/tests/denote-test.el
+++ b/tests/denote-test.el
@@ -393,8 +393,7 @@ Extend what we do in
`denote-test--denote-file-type-extensions'."
(should
(and (equal (denote-convert-file-name-keywords-to-crm
"_denote_keywords_testing") "denote,keywords,testing")
(equal (denote-convert-file-name-keywords-to-crm "_denote") "denote")
- (null (denote-convert-file-name-keywords-to-crm ""))
- (null (denote-convert-file-name-keywords-to-crm nil)))))
+ (equal (denote-convert-file-name-keywords-to-crm "") ""))))
;;;; denote-journal-extras.el
- [elpa] externals/denote updated (5e9b6b3bf0 -> 4731e0ab0f), ELPA Syncer, 2024/01/04
- [elpa] externals/denote 4ec5bfbd7b 01/12: Make denote-rename-file prompts more consistent, ELPA Syncer, 2024/01/04
- [elpa] externals/denote c41d3427f8 05/12: Sort keywords outside denote-keywords-sort, ELPA Syncer, 2024/01/04
- [elpa] externals/denote 63d25e0cfd 08/12: Update README section on the file naming scheme, ELPA Syncer, 2024/01/04
- [elpa] externals/denote 7011c3894a 04/12: Fix denote-directory-files, ELPA Syncer, 2024/01/04
- [elpa] externals/denote c76eba3708 07/12: Refactor slug functions and denote-letter-case, ELPA Syncer, 2024/01/04
- [elpa] externals/denote 083862d829 06/12: Use new denote--slug-no-punct-for-signature in denote-sluggify-signature, ELPA Syncer, 2024/01/04
- [elpa] externals/denote 4731e0ab0f 12/12: Merge pull request #217 from jeanphilippegg/denote-region, ELPA Syncer, 2024/01/04
- [elpa] externals/denote b5ef3f5481 02/12: Simplify denote-convert-file-name-keywords-to-crm,
ELPA Syncer <=
- [elpa] externals/denote ca1c534ac9 09/12: Make denote-region obey denote-prompts, ELPA Syncer, 2024/01/04
- [elpa] externals/denote 15736c648e 10/12: Merge pull request #208 from jeanphilippegg/denote-rename-file, ELPA Syncer, 2024/01/04
- [elpa] externals/denote 6da2d7b2e4 11/12: Merge pull request #210 from jeanphilippegg/slug-functions, ELPA Syncer, 2024/01/04
- [elpa] externals/denote 0fde4498e5 03/12: Simplify denote-keywords-prompt, ELPA Syncer, 2024/01/04