[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 26629820f7 2/6: Refactor denote-retrieve-title-o
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 26629820f7 2/6: Refactor denote-retrieve-title-or-filename |
Date: |
Mon, 9 Dec 2024 06:58:47 -0500 (EST) |
branch: externals/denote
commit 26629820f7c05393b6e14ad9848258258d72e836
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Refactor denote-retrieve-title-or-filename
Use denote-file-has-denoted-filename-p function. It does not validate
the location of the file. It validates that the file respects Denote's
file-naming scheme instead of only the presence of an identifier.
---
denote.el | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/denote.el b/denote.el
index 3fb9532f30..992c57ce39 100644
--- a/denote.el
+++ b/denote.el
@@ -2145,13 +2145,16 @@ or `line', referring to what the function should
retrieve."
"Return appropriate title for FILE given its TYPE.
This is a wrapper for `denote-retrieve-front-matter-title-value' and
`denote-retrieve-filename-title'."
- (if-let* (((denote-filename-is-note-p file))
- (title (denote-retrieve-front-matter-title-value file type))
- ((not (string-blank-p title))))
- title
- (or (denote-retrieve-filename-title file)
- (and (not (denote-file-has-identifier-p file))
- (file-name-base file)))))
+ (let ((has-denoted-filename (denote-file-has-denoted-filename-p file))
+ (has-supported-extension (denote-file-has-supported-extension-p file)))
+ (cond ((and has-denoted-filename has-supported-extension)
+ (or (denote-retrieve-front-matter-title-value file type)
+ (denote-retrieve-filename-title file)
+ ""))
+ (has-denoted-filename
+ (or (denote-retrieve-filename-title file) ""))
+ (t
+ (file-name-base file)))))
(defun denote--retrieve-location-in-xrefs (identifier)
"Return list of xrefs for IDENTIFIER with their respective location.
- [elpa] externals/denote updated (7a2034516e -> c68e9bee1e), ELPA Syncer, 2024/12/09
- [elpa] externals/denote a89755c686 1/6: Add denote-file-has-denoted-filename-p function, ELPA Syncer, 2024/12/09
- [elpa] externals/denote 26629820f7 2/6: Refactor denote-retrieve-title-or-filename,
ELPA Syncer <=
- [elpa] externals/denote 63a6603b62 5/6: Merge pull request #491 from jeanphilippegg/denote-retrieve-title-or-filename, ELPA Syncer, 2024/12/09
- [elpa] externals/denote c68e9bee1e 6/6: Mention denote-file-has-denoted-filename-p in the manual, ELPA Syncer, 2024/12/09
- [elpa] externals/denote f89f9ee963 4/6: Make denote-date-prompt accept optional INITIAL-DATE and PROMPT-TEXT, ELPA Syncer, 2024/12/09
- [elpa] externals/denote 5ae74c1158 3/6: Change the way denote--used-ids is used, ELPA Syncer, 2024/12/09