branch: externals/substitute
commit b665f84d4b042a968c079c336c56761078cc92af
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Reuse code in substitute--prompt-with-highlight
---
 substitute.el | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/substitute.el b/substitute.el
index f029b96845..58a53dd358 100644
--- a/substitute.el
+++ b/substitute.el
@@ -100,18 +100,13 @@ and related."
 
 (defun substitute--prompt-with-highlight (target scope)
   "Prompt for string while referencing TARGET and SCOPE.
-Substantiate the interactivity of `substitute-replace-target'."
+Highlight the TARGET's matching occurences per the user option
+`substitute-highlight'."
   (let ((pretty-target (substitute--pretty-target target)))
     (unwind-protect
         (progn
           (highlight-regexp target (substitute--highlight-face))
-          (read-string
-           (format "Replace `%s' %s with: "
-                   (propertize pretty-target 'face 'error)
-                   (substitute--scope scope))
-           nil
-           'substitute--history
-           pretty-target))
+          (substitute--prompt-without-highlight pretty-target scope))
       (unhighlight-regexp target))))
 
 (defun substitute--prompt (target scope)

Reply via email to