[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote e11a468873 28/32: Merge pull request #225 from j
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/denote e11a468873 28/32: Merge pull request #225 from jeanphilippegg/file-name-rules |
|
Date: |
Sat, 20 Jan 2024 00:57:43 -0500 (EST) |
branch: externals/denote
commit e11a468873d015ffe6360441b027df7fd4749992
Merge: cfd8961ac4 6a1e7a11d1
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: GitHub <noreply@github.com>
Merge pull request #225 from jeanphilippegg/file-name-rules
Enforce other rules in the file name
---
denote.el | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/denote.el b/denote.el
index e8b140ade2..71a8fbf306 100644
--- a/denote.el
+++ b/denote.el
@@ -718,6 +718,14 @@ leading and trailing hyphen."
"-\\{2,\\}" "-"
(replace-regexp-in-string "_\\|\s+" "-" str))))
+(defun denote--remove-dot-characters (str)
+ "Remove the dot character from STR."
+ (replace-regexp-in-string "\\." "" str))
+
+(defun denote--trim-right-token-characters (str)
+ "Remove =, - and _ from the end of STR."
+ (string-trim-right str "=-_"))
+
(defun denote--replace-consecutive-token-characters (str)
"Replace consecutive characters with a single one in STR.
Spaces, underscores and equal signs are replaced with a single
@@ -747,7 +755,9 @@ used as the keywords separator in file names."
(funcall (or slug-function
#'denote-sluggify-keyword) str)))
((eq component 'signature)
(funcall (or slug-function
#'denote-sluggify-signature) str)))))
- (denote--replace-consecutive-token-characters str-slug)))
+ (denote--trim-right-token-characters
+ (denote--replace-consecutive-token-characters
+ (denote--remove-dot-characters str-slug)))))
(make-obsolete
'denote-letter-case
- [elpa] externals/denote cc393d7616 05/32: Rename user option to denote-org-store-link-to-heading and document it better, (continued)
- [elpa] externals/denote cc393d7616 05/32: Rename user option to denote-org-store-link-to-heading and document it better, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 10d332bb29 11/32: Expand the documentation of user option to link to Org heading, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 2e04e409ae 13/32: Fix typo in the manual, ELPA Syncer, 2024/01/20
- [elpa] externals/denote cc02a5160d 14/32: Merge branch 'link-to-org-headings' of github.com:protesilaos/denote into link-to-org-headings, ELPA Syncer, 2024/01/20
- [elpa] externals/denote a86267786b 15/32: Add denote-org.el, which defines 'denote-org-link-to-heading' command, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 423122e5e6 17/32: Clarify that org-insert-link is needed after org-store-link, ELPA Syncer, 2024/01/20
- [elpa] externals/denote ff61ed7fed 20/32: Define denote-link-ol-get-heading function, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 8faccbd216 23/32: Mention denote-org-store-link-to-heading in the link handler, ELPA Syncer, 2024/01/20
- [elpa] externals/denote cdb8a19116 26/32: Document the denote-org-link-to-heading command in the manual, ELPA Syncer, 2024/01/20
- [elpa] externals/denote cfd8961ac4 27/32: Mention 'denote-link' in 'denote-org-link-to-heading' doc string, ELPA Syncer, 2024/01/20
- [elpa] externals/denote e11a468873 28/32: Merge pull request #225 from jeanphilippegg/file-name-rules,
ELPA Syncer <=
- [elpa] externals/denote 3110c6dd16 30/32: Fix denote--trim-right-token-characters, ELPA Syncer, 2024/01/20