[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 55e923ffc5 12/12: Make denote-format-file-name a
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 55e923ffc5 12/12: Make denote-format-file-name also accept nil TITLE and SIGNATURE |
Date: |
Sun, 11 Feb 2024 03:57:54 -0500 (EST) |
branch: externals/denote
commit 55e923ffc5e7a22b6cbc4dbbd5fb8a07121260eb
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Make denote-format-file-name also accept nil TITLE and SIGNATURE
We do not want to limit this to empty strings, because there are cases
we will need to arrange for the return value to be that. Whereas we
get nil for free.
---
denote.el | 4 ++--
tests/denote-test.el | 9 +++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/denote.el b/denote.el
index 17aa113cf6..ab791ed402 100644
--- a/denote.el
+++ b/denote.el
@@ -1757,9 +1757,9 @@ which case it is not added to the base file name."
((not (string-match-p denote-id-regexp id))
(error "ID `%s' does not match `denote-id-regexp'" id)))
(let ((file-name (concat dir-path id)))
- (when (not (string-empty-p signature))
+ (when (and signature (not (string-empty-p signature)))
(setq file-name (concat file-name "==" (denote-sluggify 'signature
signature))))
- (when (not (string-empty-p title))
+ (when (and title (not (string-empty-p title)))
(setq file-name (concat file-name "--" (denote-sluggify 'title title))))
(when keywords
(setq file-name (concat file-name "__" (denote-keywords-combine
(denote-sluggify-keywords keywords)))))
diff --git a/tests/denote-test.el b/tests/denote-test.el
index d46b57f2e0..41e5784798 100644
--- a/tests/denote-test.el
+++ b/tests/denote-test.el
@@ -356,6 +356,15 @@ Extend what we do in
`denote-test--denote-file-type-extensions'."
"")
"/tmp/test-denote/20231128T055311.org"))
+ (should (equal (denote-format-file-name
+ (denote-directory)
+ id
+ nil
+ nil
+ (denote--file-extension 'org)
+ nil)
+ "/tmp/test-denote/20231128T055311.org"))
+
(should (equal (denote-format-file-name
(denote-directory)
id
- [elpa] externals/denote e66f275c15 01/12: Ensure that denote-surround-with-quotes does not return "nil" if S is nil, (continued)
- [elpa] externals/denote e66f275c15 01/12: Ensure that denote-surround-with-quotes does not return "nil" if S is nil, ELPA Syncer, 2024/02/11
- [elpa] externals/denote a2229e03ff 09/12: Simplify 'denote-parse-date' now that 'denote-valid-date-p' does the work, ELPA Syncer, 2024/02/11
- [elpa] externals/denote d862b65526 06/12: Define denote-get-identifier function, ELPA Syncer, 2024/02/11
- [elpa] externals/denote 9dced4b7fd 07/12: Harden the conditionality of denote-valid-date-p, ELPA Syncer, 2024/02/11
- [elpa] externals/denote af17af9f2b 04/12: Move a helper function above where it is first called, ELPA Syncer, 2024/02/11
- [elpa] externals/denote 07e8d0bf90 08/12: Clarify the documentation of denote-valid-date-p, ELPA Syncer, 2024/02/11
- [elpa] externals/denote 121ed6d04d 11/12: Use the new 'denote-get-identifier' where appropriate, ELPA Syncer, 2024/02/11
- [elpa] externals/denote 6c503ed953 02/12: Rename denote-surround-with-quotes to denote-format-string-for-md-front-matter, ELPA Syncer, 2024/02/11
- [elpa] externals/denote 675f5e44ba 03/12: Add denote-format-string-for-org-front-matter, ELPA Syncer, 2024/02/11
- [elpa] externals/denote 2339e51633 05/12: Rename 'denote--valid-date' to 'denote-valid-date-p', ELPA Syncer, 2024/02/11
- [elpa] externals/denote 55e923ffc5 12/12: Make denote-format-file-name also accept nil TITLE and SIGNATURE,
ELPA Syncer <=
- [elpa] externals/denote 91f51e6cab 10/12: Use the correct number for the {{{development-version}}} in the docs, ELPA Syncer, 2024/02/11