[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 05e55e16c0 7/8: Change where signatures are slug
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/denote 05e55e16c0 7/8: Change where signatures are sluggified for consistency |
|
Date: |
Sat, 4 Nov 2023 00:57:51 -0400 (EDT) |
branch: externals/denote
commit 05e55e16c0d6c873e655ae938648c22afee45eb3
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Change where signatures are sluggified for consistency
We do not want the prompt to perform this step. All it should do is
get the user's input. This is how we do it with the title as well.
---
README.org | 17 +++++++----------
denote.el | 22 ++++++++--------------
2 files changed, 15 insertions(+), 24 deletions(-)
diff --git a/README.org b/README.org
index d25a02adb1..63a8a56ede 100644
--- a/README.org
+++ b/README.org
@@ -3781,7 +3781,7 @@ might change them without further notice.
#+findex: denote-sluggify-signature
+ Function ~denote-sluggify-signature~ :: Make =STR= an appropriate
- slug for signatures.
+ slug for signatures ([[#h:6ae1ab8c-5e36-4216-8e93-f37f4447582c][Contol the
letter casing of file names]]).
#+findex: denote-sluggify-keywords
+ Function ~denote-sluggify-keywords~ :: Sluggify =KEYWORDS=, which is
@@ -3878,17 +3878,14 @@ might change them without further notice.
from =FILE= front matter per =FILE-TYPE=.
#+findex: denote-signature-prompt
-+ Function ~denote-signature-prompt~ :: Prompt for signature string
- and apply ~denote-sluggify-signature~ to it. With optional
- =DEFAULT-SIGNATURE= use it as the default minibuffer value. With
- optional =PROMPT-TEXT= use it in the minibuffer instead of the
- default prompt. Previous inputs at this prompt are available for
- minibuffer completion. Consider ~savehist-mode~ to persist
++ Function ~denote-signature-prompt~ :: Prompt for signature string.
+ With optional =DEFAULT-SIGNATURE= use it as the default minibuffer
+ value. With optional =PROMPT-TEXT= use it in the minibuffer instead
+ of the default prompt. Previous inputs at this prompt are available
+ for minibuffer completion. Consider ~savehist-mode~ to persist
minibuffer histories between sessions. [ The =DEFAULT-SIGNATURE= and
=PROMPT-TEXT= arguments, as well as previous input completion, are
- added as part of {{{development-version}}}. Same for the parsing
- application of ~denote-sluggify-signature~ to the user input (this
- was always the intent). ]
+ added as part of {{{development-version}}}. ]
#+findex: denote-file-prompt
+ Function ~denote-file-prompt~ :: Prompt for file with identifier in
diff --git a/denote.el b/denote.el
index 73b287227c..92b6661623 100644
--- a/denote.el
+++ b/denote.el
@@ -677,16 +677,10 @@ any leading and trailing signs."
"=\\{2,\\}" "="
(replace-regexp-in-string "_\\|\s+" "=" str))))
-(defun denote-sluggify-signature (str &optional component)
+(defun denote-sluggify-signature (str)
"Make STR an appropriate slug for signatures.
-
-COMPONENT is a symbol used to retrieve the letter casing method
-corresponding to the file name field is references. COMPONENT is
-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 "-"))))
+Perform letter casing according to `denote-file-name-letter-casing'."
+ (denote-letter-case 'signature (denote--slug-put-equals
(denote--slug-no-punct str "-"))))
(defun denote-sluggify-and-join (str)
"Sluggify STR while joining separate words."
@@ -1561,7 +1555,7 @@ construct path to DIR."
(denote-sluggify title 'title)
(denote--file-extension file-type)
(when signature
- (denote-sluggify-signature signature 'signature))))
+ (denote-sluggify-signature signature))))
;; Adapted from `org-hugo--org-date-time-to-rfc3339' in the `ox-hugo'
;; package: <https://github.com/kaushalmodi/ox-hugo>.
@@ -1891,7 +1885,7 @@ packages such as `marginalia' and `embark')."
"Minibuffer history of `denote-signature-prompt'.")
(defun denote-signature-prompt (&optional default-signature prompt-text)
- "Prompt for signature string and apply `denote-sluggify-signature' to it.
+ "Prompt for signature string.
With optional DEFAULT-SIGNATURE use it as the default minibuffer
value. With optional PROMPT-TEXT use it in the minibuffer
instead of the default prompt.
@@ -2378,7 +2372,7 @@ relevant changes."
(title (or title (denote--retrieve-title-or-filename file file-type)))
(keywords (or keywords (denote-retrieve-keywords-value file
file-type)))
(signature (or signature (denote-retrieve-filename-signature file)))
- (new-name (denote-format-file-name dir id keywords (denote-sluggify
title 'title) extension signature))
+ (new-name (denote-format-file-name dir id keywords (denote-sluggify
title 'title) extension (denote-sluggify-signature signature)))
(max-mini-window-height denote-rename-max-mini-window-height))
(when (or no-confirm (denote-rename-file-prompt file new-name))
(denote-rename-file-and-buffer file new-name)
@@ -2489,7 +2483,7 @@ place."
(title (or title (denote--retrieve-title-or-filename file file-type)))
(keywords (or keywords (denote-retrieve-keywords-value file
file-type)))
(signature (or signature (denote-retrieve-filename-signature file)))
- (new-name (denote-format-file-name dir id keywords (denote-sluggify
title 'title) extension signature))
+ (new-name (denote-format-file-name dir id keywords (denote-sluggify
title 'title) extension (denote-sluggify-signature signature)))
(max-mini-window-height denote-rename-max-mini-window-height))
(when (or denote-rename-no-confirm (denote-rename-file-prompt file
new-name))
(denote-rename-file-and-buffer file new-name)
@@ -2583,7 +2577,7 @@ Specifically, do the following:
(file-type (denote-filetype-heuristics file))
(title (denote--retrieve-title-or-filename file file-type))
(extension (denote-get-file-extension file))
- (new-name (denote-format-file-name dir id keywords
(denote-sluggify title 'title) extension signature)))
+ (new-name (denote-format-file-name dir id keywords
(denote-sluggify title 'title) extension (denote-sluggify-signature
signature))))
(denote-rename-file-and-buffer file new-name)
(when (denote-file-is-writable-and-supported-p new-name)
(if (denote--edit-front-matter-p new-name file-type)
- [elpa] externals/denote updated (0d7b81955d -> a2d5c4e174), ELPA Syncer, 2023/11/04
- [elpa] externals/denote 7969bb533a 4/8: Revert "Make denote-dired-rename-marked-files-with-keywords use denote--rename-file-subr", ELPA Syncer, 2023/11/04
- [elpa] externals/denote 0f449dd3a5 5/8: Tweak denote-dired-rename-marked-files-with-keywords docstring and prompt, ELPA Syncer, 2023/11/04
- [elpa] externals/denote eba22e8c2b 2/8: Remove needless comment, ELPA Syncer, 2023/11/04
- [elpa] externals/denote 3b1397bd9d 6/8: Set denote-dired-rename-marked-files-with-keywords lexical variable directly, ELPA Syncer, 2023/11/04
- [elpa] externals/denote 05e55e16c0 7/8: Change where signatures are sluggified for consistency,
ELPA Syncer <=
- [elpa] externals/denote bd3ddfbe42 1/8: Stop using the 'denote--rename-file-subr' in 'denote-rename-file', ELPA Syncer, 2023/11/04
- [elpa] externals/denote dc66c56cb1 3/8: Add user option 'denote-rename-no-confirm', ELPA Syncer, 2023/11/04
- [elpa] externals/denote a2d5c4e174 8/8: Make denote-dired-rename-files not use the 'denote--rename-file-subr', ELPA Syncer, 2023/11/04