[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 083862d829 06/12: Use new denote--slug-no-punct-
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/denote 083862d829 06/12: Use new denote--slug-no-punct-for-signature in denote-sluggify-signature |
|
Date: |
Thu, 4 Jan 2024 06:57:54 -0500 (EST) |
branch: externals/denote
commit 083862d8298c572758f69b8783aacd30e1ff64c0
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Use new denote--slug-no-punct-for-signature in denote-sluggify-signature
---
denote.el | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/denote.el b/denote.el
index 6b21b724a2..d3e7c2ae0f 100644
--- a/denote.el
+++ b/denote.el
@@ -618,6 +618,21 @@ as the aforementioned variables."
(setq str (replace-regexp-in-string regexp "" str))))
str)
+(defun denote--slug-no-punct-for-signature (str &optional extra-characters)
+ "Remove punctuation (except = signs) from STR.
+
+This works the same way as `denote--slug-no-punct', except that =
+signs are not removed from STR.
+
+EXTRA-CHARACTERS is an optional string. See
+`denote--slug-no-punct' for its documentation."
+ (dolist (regexp (list denote-excluded-punctuation-regexp
+ denote-excluded-punctuation-extra-regexp
+ extra-characters))
+ (when (stringp regexp)
+ (setq str (replace-regexp-in-string (string-replace "=" "" regexp) ""
str))))
+ str)
+
(defun denote--slug-hyphenate (str)
"Replace spaces and underscores with hyphens in STR.
Also replace multiple hyphens with a single one and remove any
@@ -661,7 +676,7 @@ any leading and trailing signs."
(defun denote-sluggify-signature (str)
"Make STR an appropriate slug for signatures.
Perform letter casing according to `denote-file-name-letter-casing'."
- (denote-letter-case 'signature (denote--slug-put-equals
(denote--slug-no-punct str "-+"))))
+ (denote-letter-case 'signature (denote--slug-put-equals
(denote--slug-no-punct-for-signature str "-+"))))
(defun denote-sluggify-and-join (str)
"Sluggify STR while joining separate words."
@@ -2485,7 +2500,7 @@ file-naming scheme."
(format "Rename `%s' with keywords (empty to remove)" file-in-prompt)
(denote-convert-file-name-keywords-to-crm (or
(denote-retrieve-filename-keywords file) "")))
(denote-signature-prompt
- (string-replace "=" " " (or (denote-retrieve-filename-signature file)
""))
+ (or (denote-retrieve-filename-signature file) "")
(format "Rename `%s' with signature (empty to remove)" file-in-prompt))
current-prefix-arg)))
(let* ((dir (file-name-directory file))
@@ -2530,7 +2545,7 @@ the changes made to the file: perform them outright."
(format "Rename `%s' with keywords (empty to
remove)" file-in-prompt)
(denote-convert-file-name-keywords-to-crm (or
(denote-retrieve-filename-keywords file) "")))))
(signature (denote-signature-prompt
- (string-replace "=" " " (or
(denote-retrieve-filename-signature file) ""))
+ (or (denote-retrieve-filename-signature file) "")
(format "Rename `%s' with signature (empty to
remove)" file-in-prompt)))
(extension (denote-get-file-extension file))
(new-name (denote-format-file-name dir id keywords
(denote-sluggify title 'title) extension (denote-sluggify-signature
signature))))
@@ -2593,7 +2608,7 @@ Specifically, do the following:
(let* ((dir (file-name-directory file))
(id (or (denote-retrieve-filename-identifier file)
(denote-create-unique-file-identifier file used-ids)))
- (signature (string-replace "=" " " (or
(denote-retrieve-filename-signature file) "")))
+ (signature (or (denote-retrieve-filename-signature file) ""))
(file-type (denote-filetype-heuristics file))
(title (denote--retrieve-title-or-filename file file-type))
(extension (denote-get-file-extension file))
@@ -2637,7 +2652,7 @@ does internally."
(id (denote-retrieve-filename-identifier file)))
(let* ((sluggified-title (denote-sluggify title 'title))
(keywords (denote-retrieve-front-matter-keywords-value file
file-type))
- (signature (string-replace "=" " " (or
(denote-retrieve-filename-signature file) "")))
+ (signature (or (denote-retrieve-filename-signature file) ""))
(extension (denote-get-file-extension file))
(dir (file-name-directory file))
(new-name (denote-format-file-name dir id keywords
sluggified-title extension (denote-sluggify-signature signature))))
- [elpa] externals/denote updated (5e9b6b3bf0 -> 4731e0ab0f), ELPA Syncer, 2024/01/04
- [elpa] externals/denote 4ec5bfbd7b 01/12: Make denote-rename-file prompts more consistent, ELPA Syncer, 2024/01/04
- [elpa] externals/denote c41d3427f8 05/12: Sort keywords outside denote-keywords-sort, ELPA Syncer, 2024/01/04
- [elpa] externals/denote 63d25e0cfd 08/12: Update README section on the file naming scheme, ELPA Syncer, 2024/01/04
- [elpa] externals/denote 7011c3894a 04/12: Fix denote-directory-files, ELPA Syncer, 2024/01/04
- [elpa] externals/denote c76eba3708 07/12: Refactor slug functions and denote-letter-case, ELPA Syncer, 2024/01/04
- [elpa] externals/denote 083862d829 06/12: Use new denote--slug-no-punct-for-signature in denote-sluggify-signature,
ELPA Syncer <=
- [elpa] externals/denote 4731e0ab0f 12/12: Merge pull request #217 from jeanphilippegg/denote-region, ELPA Syncer, 2024/01/04
- [elpa] externals/denote b5ef3f5481 02/12: Simplify denote-convert-file-name-keywords-to-crm, ELPA Syncer, 2024/01/04
- [elpa] externals/denote ca1c534ac9 09/12: Make denote-region obey denote-prompts, ELPA Syncer, 2024/01/04
- [elpa] externals/denote 15736c648e 10/12: Merge pull request #208 from jeanphilippegg/denote-rename-file, ELPA Syncer, 2024/01/04
- [elpa] externals/denote 6da2d7b2e4 11/12: Merge pull request #210 from jeanphilippegg/slug-functions, ELPA Syncer, 2024/01/04
- [elpa] externals/denote 0fde4498e5 03/12: Simplify denote-keywords-prompt, ELPA Syncer, 2024/01/04