[Top][All Lists]

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

[elpa] externals/ivy-posframe 0032ed4 130/195: define define-display-fun

From: Feng Shu
Subject: [elpa] externals/ivy-posframe 0032ed4 130/195: define define-display-function macro instead of eval form
Date: Sat, 3 Oct 2020 07:11:59 -0400 (EDT)

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

    define define-display-function macro instead of eval form
 ivy-posframe.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/ivy-posframe.el b/ivy-posframe.el
index ba98b24..c8ebcee 100644
--- a/ivy-posframe.el
+++ b/ivy-posframe.el
@@ -278,14 +278,14 @@ This variable is useful for `ivy-posframe-read-action' .")
     (frame-bottom-left  . frame-bottom-left-corner)
     (point              . point-bottom-left-corner)))
- `(progn
-    ,@(mapcar
-       (lambda (elm)
-         `(defun ,(intern (format "ivy-posframe-display-at-%s" (car elm))) 
-            ,(format "Display STR via `posframe' at %s." (car elm))
-            (ivy-posframe--display str #',(intern (format 
"posframe-poshandler-%s" (cdr elm))))))
-       ivy-posframe-display-function-alist)))
+(defmacro ivy-posframe-define-display-function (pair)
+  "Define display-function for ivy-posframe."
+  `(defun ,(intern (format "ivy-posframe-display-at-%s" (car pair))) (str)
+     ,(format "Display STR via `posframe' at %s." (car pair))
+     (ivy-posframe--display str #',(intern (format "posframe-poshandler-%s" 
(cdr pair))))))
+(mapc (lambda (elm) (ivy-posframe-define-display-function elm))
+      ivy-posframe-display-function-alist)
 (defun ivy-posframe-display-at-frame-bottom-window-center (str)
   "Display STR via `posframe' at frame-bottom-window-center."

reply via email to

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