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

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

[elpa] externals/ivy-posframe 8a54dbb 011/195: Use ivy-display-function-


From: Feng Shu
Subject: [elpa] externals/ivy-posframe 8a54dbb 011/195: Use ivy-display-function-fallback
Date: Sat, 3 Oct 2020 07:11:35 -0400 (EDT)

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

    Use ivy-display-function-fallback
---
 ivy-posframe.el | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/ivy-posframe.el b/ivy-posframe.el
index c1bea4c..19fbba3 100644
--- a/ivy-posframe.el
+++ b/ivy-posframe.el
@@ -49,7 +49,6 @@
 (require 'ivy)
 
 (push '(ivy-posframe-display
-        :check ivy-posframe-workable-p
         :cleanup ivy-posframe-cleanup)
       ivy-display-functions-props)
 
@@ -81,23 +80,26 @@ More details can be found in docstring of `posframe-show'."
 
 (defun ivy-posframe-display (str)
   "Show ivy's posframe."
-  (with-selected-window (ivy--get-window ivy-last)
-    (posframe-show
-     ivy-posframe-buffer
-     :font ivy-posframe-font
-     :string (concat ivy--prompt ivy-text str)
-     :position (point)
-     :poshandler (or ivy-posframe-poshandler
-                     #'posframe-poshandler-window-bottom-left-corner)
-     :background-color (face-attribute 'ivy-posframe :background)
-     :foreground-color (face-attribute 'ivy-posframe :foreground)
-     :height ivy-height
-     :min-height 10
-     :min-width 50)))
+  (if (not (ivy-posframe-workable-p))
+      (ivy-display-function-fallback str)
+    (with-selected-window (ivy--get-window ivy-last)
+      (posframe-show
+       ivy-posframe-buffer
+       :font ivy-posframe-font
+       :string (concat ivy--prompt ivy-text str)
+       :position (point)
+       :poshandler (or ivy-posframe-poshandler
+                       #'posframe-poshandler-window-bottom-left-corner)
+       :background-color (face-attribute 'ivy-posframe :background)
+       :foreground-color (face-attribute 'ivy-posframe :foreground)
+       :height ivy-height
+       :min-height 10
+       :min-width 50))))
 
 (defun ivy-posframe-cleanup ()
   "Clean ivy's posframe."
-  (posframe-hide ivy-posframe-buffer))
+  (when (ivy-posframe-workable-p)
+    (posframe-hide ivy-posframe-buffer)))
 
 (defun ivy-posframe-workable-p ()
   "Test ivy-posframe workable or not."



reply via email to

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