[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/substitute c6fb22fe78 1/3: Enable empty string substitu
From: |
ELPA Syncer |
Subject: |
[elpa] externals/substitute c6fb22fe78 1/3: Enable empty string substitution |
Date: |
Tue, 31 Jan 2023 01:58:15 -0500 (EST) |
branch: externals/substitute
commit c6fb22fe78017c0cb84ac522512b9a891a4e5751
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Enable empty string substitution
We could not do that with 'read-string' as the empty input is
automatically interpreted as the value of the DEFAULT-VALUE argument.
This is standard for most Emacs minibuffer interactions, though in our
case it makes sense to accept an empty string, as we may, e.g., want
to remove a prefix from a target.
Thanks to Kostas Andreadis for discussing this with me in issue 2 on
the GitHub mirror as well as pull request 3:
- <https://github.com/protesilaos/substitute/issues/2>
- <https://github.com/protesilaos/substitute/pull/3>
---
substitute.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/substitute.el b/substitute.el
index 90d332f5bc..04ebc85049 100644
--- a/substitute.el
+++ b/substitute.el
@@ -113,11 +113,11 @@ and related."
"Prompt for string while referencing TARGET and SCOPE."
(let ((pretty-target (substitute--prettify-target-description target)))
(substitute--collect-targets target scope)
- (read-string
+ (read-from-minibuffer
(format "Substitute `%s' %s with: "
(propertize pretty-target 'face 'error)
(substitute--scope-description scope))
- nil
+ nil nil nil
'substitute--history
pretty-target)))