branch: externals/ivy-posframe
commit 3bc6301f9161eb563b098b4cbf0813a1ba4f4b55
Author: Feng Shu <[email protected]>
Commit: Feng Shu <[email protected]>
Add ivy-posframe-workable-p
---
ivy-posframe.el | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/ivy-posframe.el b/ivy-posframe.el
index ac28f8c..b041f34 100644
--- a/ivy-posframe.el
+++ b/ivy-posframe.el
@@ -33,10 +33,12 @@
;; * ivy-posframe's code
(require 'cl-lib)
(require 'posframe)
+(require 'ivy)
(push '(ivy-posframe-display
+ :when ivy-posframe-workable-p
:cleanup ivy-posframe-cleanup)
- ivy-display-function-props)
+ ivy-display-functions-props)
(defgroup ivy-posframe nil
"Using posframe to show ivy"
@@ -73,6 +75,13 @@ Using current frame's font if it it nil."
"Clean ivy's posframe."
(posframe-hide ivy-posframe-buffer))
+(defun ivy-posframe-workable-p ()
+ "Test ivy-posframe workable or not."
+ (and (>= emacs-major-version 26)
+ (not (or noninteractive
+ emacs-basic-display
+ (not (display-graphic-p))))))
+
;;;###autoload
(defun ivy-posframe-enable ()
(interactive)