[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote d179c692b4 1/2: Fix regression in denote--slug-n
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote d179c692b4 1/2: Fix regression in denote--slug-no-punct |
Date: |
Tue, 31 Oct 2023 06:57:54 -0400 (EDT) |
branch: externals/denote
commit d179c692b41bd7c2b07adf6de7dbd70a9671b4af
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Fix regression in denote--slug-no-punct
We want to omit dashes from signatures, though not from other strings.
---
denote.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/denote.el b/denote.el
index ea492d1cfe..9ac3d372d3 100644
--- a/denote.el
+++ b/denote.el
@@ -601,15 +601,18 @@ before falling back to the value of the variable
(default-value 'denote-directory))))
(file-name-as-directory (expand-file-name path))))
-(defun denote--slug-no-punct (str)
+(defun denote--slug-no-punct (str &optional extra-characters)
"Remove punctuation from STR.
Concretely, replace with spaces anything that matches the
`denote-excluded-punctuation-regexp' and
-`denote-excluded-punctuation-extra-regexp'."
+`denote-excluded-punctuation-extra-regexp'.
+
+With optional EXTRA-CHARACTERS as a string, include them in the
+regexp to be replaced."
(replace-regexp-in-string
(concat denote-excluded-punctuation-regexp
denote-excluded-punctuation-extra-regexp
- "-")
+ extra-characters)
"" str))
(defun denote--slug-hyphenate (str)
@@ -661,7 +664,7 @@ described in the user option
`denote-file-name-letter-casing'.
A nil value of COMPONENT has the same meaning as applying
`downcase' to STR."
- (denote-letter-case component (denote--slug-put-equals
(denote--slug-no-punct str))))
+ (denote-letter-case component (denote--slug-put-equals
(denote--slug-no-punct str "-"))))
(defun denote-sluggify-and-join (str)
"Sluggify STR while joining separate words."