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

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

[elpa] externals/ivy-posframe a7fe06e 098/195: fix addition ivy-display-


From: Feng Shu
Subject: [elpa] externals/ivy-posframe a7fe06e 098/195: fix addition ivy-display-function-props
Date: Sat, 3 Oct 2020 07:11:53 -0400 (EDT)

branch: externals/ivy-posframe
commit a7fe06e71b77e3ff5987f309df884dd19f49bff8
Author: conao3 <conao3@gmail.com>
Commit: conao3 <conao3@gmail.com>

    fix addition ivy-display-function-props
    
    by add ivy-posframe-display-functions
---
 ivy-posframe.el | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/ivy-posframe.el b/ivy-posframe.el
index ff9f6fd..9030821 100644
--- a/ivy-posframe.el
+++ b/ivy-posframe.el
@@ -247,6 +247,15 @@ This variable is useful for `ivy-posframe-read-action' .")
 (defun ivy-posframe-display-at-point (str)
   (ivy-posframe--display str #'posframe-poshandler-point-bottom-left-corner))
 
+(defvar ivy-posframe-display-functions
+  '(ivy-posframe-display
+    ivy-posframe-display-at-window-center
+    ivy-posframe-display-at-frame-center
+    ivy-posframe-display-at-window-bottom-left
+    ivy-posframe-display-at-frame-bottom-left
+    ivy-posframe-display-at-frame-bottom-window-center
+    ivy-posframe-display-at-point))
+
 (defun ivy-posframe-cleanup ()
   "Cleanup ivy's posframe."
   (when (posframe-workable-p)
@@ -431,15 +440,11 @@ selection, non-nil otherwise."
 (defun ivy-posframe-enable ()
   "Enable ivy-posframe."
   (interactive)
-  ;; Add all display functions of ivy-posframe to
-  ;; `ivy-display-functions-props'.
-  (mapatoms
-   (lambda (func)
-     (when (and (functionp func)
-                (string-match-p "^ivy-posframe-display" (symbol-name func))
-                (not (assq func ivy-display-functions-props)))
-       (push `(,func :cleanup ivy-posframe-cleanup)
-             ivy-display-functions-props))))
+  (eval
+   `(progn
+      (mapcar (lambda (fn)
+                `(push `(,fn :cleanup ivy-posframe-cleanup) 
ivy-display-functions-props))
+              ivy-posframe-display-functions)))
   (define-key ivy-minibuffer-map
     [remap ivy-read-action] 'ivy-posframe-read-action)
   (define-key ivy-minibuffer-map



reply via email to

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