branch: externals/embark
commit 923d0ec52e2e3e0ae44e497c31c7888e87d08a8f
Merge: 3750901e7f a6e48a4e09
Author: Omar AntolĂ­n Camarena <omar.anto...@gmail.com>
Commit: GitHub <nore...@github.com>

    Merge pull request #750 from 
LemonBreezes/work-around-browse-url-interactive-arg
    
    fix: limit set--this-command-keys to browse-url
---
 embark.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/embark.el b/embark.el
index 58ca314387..913f8bdd5c 100644
--- a/embark.el
+++ b/embark.el
@@ -2070,12 +2070,15 @@ minibuffer before executing the action."
                             (embark--run-action-hooks embark-pre-action-hooks
                                                       action target quit)
                             (minibuffer-with-setup-hook inject
-                              ;; pacify commands that use (this-command-keys)
-                              (when (= (length (this-command-keys)) 0)
+                              ;; HACK work around `browse-url-interactive-arg'
+                              ;; expecting a non-empty `this-command-keys'
+                              ;; output.
+                              (when (and (eq action 'browse-url)
+                                         (= (length (this-command-keys)) 0))
                                 (set--this-command-keys
                                  (if (characterp last-command-event)
                                      (string last-command-event)
-                                  "\r")))
+                                   "\r")))
                               (setq this-command action)
                               (embark--run-around-action-hooks
                                action target quit)))

Reply via email to