emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote 6a1e7a11d1 22/32: Add denote--remove-dot-charact


From: ELPA Syncer
Subject: [elpa] externals/denote 6a1e7a11d1 22/32: Add denote--remove-dot-characters and denote--trim-right-token-characters and use them in denote-sluggify
Date: Sat, 20 Jan 2024 00:57:42 -0500 (EST)

branch: externals/denote
commit 6a1e7a11d1e1e1c23eede586a45589b5e27c883f
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>

    Add denote--remove-dot-characters and denote--trim-right-token-characters 
and use them in denote-sluggify
---
 denote.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/denote.el b/denote.el
index 680df2206f..11cc23eb2d 100644
--- a/denote.el
+++ b/denote.el
@@ -666,6 +666,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
@@ -695,7 +703,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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]