emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/embark 9d02dd1359: Remove invisible text from input in


From: ELPA Syncer
Subject: [elpa] externals/embark 9d02dd1359: Remove invisible text from input in embark-become
Date: Sun, 9 Jul 2023 18:57:49 -0400 (EDT)

branch: externals/embark
commit 9d02dd1359892d7f72af253e624f19f51a2348e0
Author: Omar Antolín Camarena <omar.antolin@gmail.com>
Commit: Omar Antolín Camarena <omar.antolin@gmail.com>

    Remove invisible text from input in embark-become
    
    This fixes #646
---
 CHANGELOG.org |  3 +++
 embark.el     | 11 ++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.org b/CHANGELOG.org
index c568fb14a6..9bb78fdd0f 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -8,6 +8,9 @@
 - Added key bindings for org agenda items consistent with those of org
   headings where possible. Also improved bindings for org targets in
   general.
+- =embark-become= now removes any invisible text from the minibuffer
+  input on the grounds that users probably expect the target command
+  to receive exactly the input they can see.
 * Version 0.22.1 (2023-04-20)
 ** New feature: selections
 Now users can select several targets to make an ad hoc collection. The
diff --git a/embark.el b/embark.el
index f36ad30c4d..cf08fec1fb 100644
--- a/embark.el
+++ b/embark.el
@@ -2529,11 +2529,12 @@ point."
   (interactive "P")
   (unless (minibufferp)
     (user-error "Not in a minibuffer"))
-  (let* ((target (if full
-                     (minibuffer-contents)
-                   (pcase-let ((`(,beg . ,end) (embark--boundaries)))
-                     (substring (minibuffer-contents) beg
-                                (+ end (embark--minibuffer-point))))))
+  (let* ((target (embark--display-string ; remove invisible portions
+                  (if full
+                      (minibuffer-contents)
+                    (pcase-let ((`(,beg . ,end) (embark--boundaries)))
+                      (substring (minibuffer-contents) beg
+                                 (+ end (embark--minibuffer-point)))))))
          (keymap (embark--become-keymap))
          (targets `((:type embark-become :target ,target)))
          (indicators (mapcar #'funcall embark-indicators))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]