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

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

[elpa] externals/ivy-posframe 084cc59 2/2: Merge pull request #111 from


From: ELPA Syncer
Subject: [elpa] externals/ivy-posframe 084cc59 2/2: Merge pull request #111 from tttuuu888/work-dispatching-call
Date: Mon, 26 Apr 2021 17:57:10 -0400 (EDT)

branch: externals/ivy-posframe
commit 084cc59ea2cd62afaa51445ada3d00404749a541
Merge: 7f1ab78 081636a
Author: tumashu <tumashu@163.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #111 from tttuuu888/work-dispatching-call
    
    Add ivy-posframe-dispatching-call and ivy-posframe--dispatching-call
---
 ivy-posframe.el | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/ivy-posframe.el b/ivy-posframe.el
index 464be6f..723141f 100644
--- a/ivy-posframe.el
+++ b/ivy-posframe.el
@@ -375,6 +375,25 @@ This variable is useful for `ivy-posframe-read-action' .")
   (let ((ivy-read-action-function #'ivy-posframe-read-action-by-key))
     (ivy-posframe--dispatching-done)))
 
+(defun ivy-posframe--dispatching-call ()
+  "Select one of the available actions and call `ivy-call'."
+  (interactive)
+  (setq ivy-current-prefix-arg current-prefix-arg)
+  (let ((actions (copy-sequence (ivy-state-action ivy-last)))
+        (old-ivy-text ivy-text))
+    (unwind-protect
+        (when (ivy-read-action)
+          (ivy-set-text old-ivy-text)
+          (ivy-call))
+      (ivy-set-action actions)))
+  (ivy-posframe-shrink-after-dispatching))
+
+(defun ivy-posframe-dispatching-call ()
+  "Ivy-posframe's `ivy-dispatching-call'."
+  (interactive)
+  (let ((ivy-read-action-function #'ivy-posframe-read-action-by-key))
+    (ivy-posframe--dispatching-call)))
+
 (defun ivy-posframe-read-action ()
   "Ivy-posframe version `ivy-read-action'"
   (interactive)
@@ -632,7 +651,8 @@ This variable is useful for `ivy-posframe-read-action' .")
   :keymap '(([remap ivy-avy]              . ivy-posframe-avy)
             ([remap swiper-avy]           . ivy-posframe-swiper-avy)
             ([remap ivy-read-action]      . ivy-posframe-read-action)
-            ([remap ivy-dispatching-done] . ivy-posframe-dispatching-done))
+            ([remap ivy-dispatching-done] . ivy-posframe-dispatching-done)
+            ([remap ivy-dispatching-call] . ivy-posframe-dispatching-call))
   (if ivy-posframe-mode
       (mapc (lambda (elm)
               (advice-add (car elm) :around (cdr elm)))



reply via email to

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