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

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

[elpa] externals/vertico-posframe 5438a6949c 1/3: Better support vertico


From: ELPA Syncer
Subject: [elpa] externals/vertico-posframe 5438a6949c 1/3: Better support vertico-multiform. #24
Date: Sun, 18 Dec 2022 18:58:13 -0500 (EST)

branch: externals/vertico-posframe
commit 5438a6949cb5e40f5b2af9a11b427df7e66ca0fe
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>

    Better support vertico-multiform. #24
    
    (setq vertico-multiform-commands
          '((consult-line posframe (vertico-posframe-poshandler . 
posframe-poshandler-frame-top-center))
            (t buffer)))
---
 vertico-posframe.el | 37 ++++++++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 13 deletions(-)

diff --git a/vertico-posframe.el b/vertico-posframe.el
index 49a0ec28b4..9fecbc44e4 100644
--- a/vertico-posframe.el
+++ b/vertico-posframe.el
@@ -212,19 +212,30 @@ is called, window-point will be set to WINDOW-POINT."
   (let ((posframe
          ;; Some posframe poshandlers need infos of last-window.
          (with-selected-window (vertico-posframe-last-window)
-           (apply #'posframe-show
-                  buffer
-                  :font vertico-posframe-font
-                  :poshandler vertico-posframe-poshandler
-                  :background-color (face-attribute 'vertico-posframe 
:background nil t)
-                  :foreground-color (face-attribute 'vertico-posframe 
:foreground nil t)
-                  :border-width vertico-posframe-border-width
-                  :border-color (vertico-posframe--get-border-color)
-                  :override-parameters vertico-posframe-parameters
-                  :refposhandler vertico-posframe-refposhandler
-                  :hidehandler #'vertico-posframe-hidehandler
-                  :lines-truncate vertico-posframe-truncate-lines
-                  (funcall vertico-posframe-size-function)))))
+           ;; Variable settings in `vertico-multiform-commands' of
+           ;; will save to BUFFER as buffer-local variables, so we
+           ;; need to switch to BUFFER to get settings, for example:
+           ;;
+           ;; (setq vertico-multiform-commands
+           ;;       '((consult-line
+           ;;          posframe
+           ;;          (vertico-posframe-poshandler . 
posframe-poshandler-frame-top-center))
+           ;;         (t buffer)))
+           ;;
+           (with-current-buffer buffer
+             (apply #'posframe-show
+                    buffer
+                    :font vertico-posframe-font
+                    :poshandler vertico-posframe-poshandler
+                    :background-color (face-attribute 'vertico-posframe 
:background nil t)
+                    :foreground-color (face-attribute 'vertico-posframe 
:foreground nil t)
+                    :border-width vertico-posframe-border-width
+                    :border-color (vertico-posframe--get-border-color)
+                    :override-parameters vertico-posframe-parameters
+                    :refposhandler vertico-posframe-refposhandler
+                    :hidehandler #'vertico-posframe-hidehandler
+                    :lines-truncate vertico-posframe-truncate-lines
+                    (funcall vertico-posframe-size-function))))))
     ;; NOTE: `posframe-show' will force set window-point to 0, so we
     ;; need reset it again after `posframe-show'.
     (when (numberp window-point)



reply via email to

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