[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 3d8e575260 03/10: Add default values to denote--
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 3d8e575260 03/10: Add default values to denote--*-key-regexp functions |
Date: |
Mon, 18 Nov 2024 03:57:59 -0500 (EST) |
branch: externals/denote
commit 3d8e575260f86d2dfdfd31509fae59d71ea8e54d
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Add default values to denote--*-key-regexp functions
---
denote.el | 47 ++++++++++++++++++++++++++++-------------------
1 file changed, 28 insertions(+), 19 deletions(-)
diff --git a/denote.el b/denote.el
index c1c78c9f6e..35421add56 100644
--- a/denote.el
+++ b/denote.el
@@ -1745,9 +1745,10 @@ this list for new note creation. The default is `org'.")
(defun denote--title-key-regexp (file-type)
"Return the title key regexp associated to FILE-TYPE."
- (plist-get
- (alist-get file-type denote-file-types)
- :title-key-regexp))
+ (or (plist-get
+ (alist-get file-type denote-file-types)
+ :title-key-regexp)
+ "^denote12345678987654321")) ; Will not be found
(defun denote--title-value-function (file-type)
"Convert title string to a front matter title, per FILE-TYPE."
@@ -1763,9 +1764,10 @@ this list for new note creation. The default is `org'.")
(defun denote--keywords-key-regexp (file-type)
"Return the keywords key regexp associated to FILE-TYPE."
- (plist-get
- (alist-get file-type denote-file-types)
- :keywords-key-regexp))
+ (or (plist-get
+ (alist-get file-type denote-file-types)
+ :keywords-key-regexp)
+ "^denote12345678987654321")) ; Will not be found
(defun denote--keywords-value-function (file-type)
"Convert keywords' string to front matter keywords, per FILE-TYPE."
@@ -1781,9 +1783,10 @@ this list for new note creation. The default is `org'.")
(defun denote--signature-key-regexp (file-type)
"Return the signature key regexp associated to FILE-TYPE."
- (plist-get
- (alist-get file-type denote-file-types)
- :signature-key-regexp))
+ (or (plist-get
+ (alist-get file-type denote-file-types)
+ :signature-key-regexp)
+ "^denote12345678987654321")) ; Will not be found
(defun denote--signature-value-function (file-type)
"Convert signature string to front matter signature, per FILE-TYPE."
@@ -1799,9 +1802,10 @@ this list for new note creation. The default is `org'.")
(defun denote--identifier-key-regexp (file-type)
"Return the identifier key regexp associated to FILE-TYPE."
- (plist-get
- (alist-get file-type denote-file-types)
- :identifier-key-regexp))
+ (or (plist-get
+ (alist-get file-type denote-file-types)
+ :identifier-key-regexp)
+ "^denote12345678987654321")) ; Will not be found
(defun denote--identifier-value-function (file-type)
"Convert identifier string to front matter identifier, per FILE-TYPE."
@@ -1817,9 +1821,10 @@ this list for new note creation. The default is `org'.")
(defun denote--date-key-regexp (file-type)
"Return the date key regexp associated to FILE-TYPE."
- (plist-get
- (alist-get file-type denote-file-types)
- :date-key-regexp))
+ (or (plist-get
+ (alist-get file-type denote-file-types)
+ :date-key-regexp)
+ "^denote12345678987654321")) ; Will not be found
(defun denote--date-value-function (file-type)
"Convert date object to front matter date, per FILE-TYPE."
@@ -1880,11 +1885,15 @@ TITLE, SIGNATURE, and ID are strings. DATE is a date
object. KEYWORDS
is a list of strings. FILETYPE is one of the values of variable
`denote-file-type'."
(let* ((fm (denote--front-matter filetype))
- (title-string (funcall (denote--title-value-function filetype) title))
+ (title-value-function (denote--title-value-function filetype))
+ (keywords-value-function (denote--keywords-value-function filetype))
+ (id-value-function (denote--identifier-value-function filetype))
+ (signature-value-function (denote--signature-value-function filetype))
+ (title-string (if title-value-function (funcall title-value-function
title) ""))
(date-string (denote--format-front-matter-date date filetype))
- (keywords-string (funcall (denote--keywords-value-function filetype)
(denote-sluggify-keywords keywords)))
- (id-string (funcall (denote--identifier-value-function filetype) id))
- (signature-string (funcall (denote--signature-value-function
filetype) (denote-sluggify-signature signature))))
+ (keywords-string (if keywords-value-function (funcall
keywords-value-function (denote-sluggify-keywords keywords)) ""))
+ (id-string (if id-value-function (funcall id-value-function id) ""))
+ (signature-string (if signature-value-function (funcall
signature-value-function (denote-sluggify-signature signature)) "")))
(if fm (format fm title-string date-string keywords-string id-string
signature-string) "")))
;;;; Front matter or content retrieval functions
- [elpa] externals/denote updated (7c8ed195d8 -> ad7a102116), ELPA Syncer, 2024/11/18
- [elpa] externals/denote 73571a65fb 08/10: Reindent files, ELPA Syncer, 2024/11/18
- [elpa] externals/denote ef93ebd781 06/10: Fix docstring of denote--keywords-value-function, ELPA Syncer, 2024/11/18
- [elpa] externals/denote 0cc5f450d7 01/10: Fix regression when renaming new unsaved note, ELPA Syncer, 2024/11/18
- [elpa] externals/denote 3026f6ada5 02/10: Add signature to front matter, ELPA Syncer, 2024/11/18
- [elpa] externals/denote 3d8e575260 03/10: Add default values to denote--*-key-regexp functions,
ELPA Syncer <=
- [elpa] externals/denote e6656d4fc2 04/10: Make it possible to change the date/id of a note, ELPA Syncer, 2024/11/18
- [elpa] externals/denote 45f3eef294 07/10: Merge pull request #480 from jeanphilippegg/features-and-fix, ELPA Syncer, 2024/11/18
- [elpa] externals/denote ad7a102116 10/10: Use denote-get-link-description instead of denote--link-get-description in denote-org-extras.el, ELPA Syncer, 2024/11/18
- [elpa] externals/denote 51fa48dcd7 05/10: Add denote-rename-file-date, ELPA Syncer, 2024/11/18
- [elpa] externals/denote ef033a5084 09/10: Fix mistake made by the previous commit, ELPA Syncer, 2024/11/18