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

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

[elpa] externals/ivy-posframe 3aabf14 085/195: ivy-posframe-demo: let it


From: Feng Shu
Subject: [elpa] externals/ivy-posframe 3aabf14 085/195: ivy-posframe-demo: let it toggle
Date: Sat, 3 Oct 2020 07:11:50 -0400 (EDT)

branch: externals/ivy-posframe
commit 3aabf14e24c407c39ee5af85e18cb26f1f157af5
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>

    ivy-posframe-demo: let it toggle
---
 ivy-posframe.el | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/ivy-posframe.el b/ivy-posframe.el
index 13953b3..a8863e4 100644
--- a/ivy-posframe.el
+++ b/ivy-posframe.el
@@ -444,12 +444,18 @@ selection, non-nil otherwise."
 
 ;;;###autoload
 (defun ivy-posframe-demo ()
-  "Enable a demo config of ivy-posframe.
-This function is used to test ivy-posframe."
+  "Toggle a demo config of ivy-posframe.
+This function is ONLY used to test ivy-posframe."
   (interactive)
-  (push '(t . ivy-posframe-display-at-frame-center)
-        ivy-display-functions-alist)
-  (ivy-posframe-enable))
+  (ivy-posframe-enable)
+  (let ((config '(t . ivy-posframe-display-at-frame-center)))
+    (if (member config ivy-display-functions-alist)
+        (progn
+          (setq ivy-display-functions-alist
+                (remove config ivy-display-functions-alist))
+          (message "Ivy-posframe: Demo is disabled."))
+      (push config ivy-display-functions-alist)
+      (message "Ivy-posframe: Demo is enabled."))))
 
 (provide 'ivy-posframe)
 



reply via email to

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