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

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

[elpa] externals/corfu 3687394 2/4: Move default child frame parameters


From: Protesilaos Stavrou
Subject: [elpa] externals/corfu 3687394 2/4: Move default child frame parameters to a separate variable
Date: Fri, 7 May 2021 14:37:48 -0400 (EDT)

branch: externals/corfu
commit 36873942539d6126512737b566df4d4a5e82006f
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Move default child frame parameters to a separate variable
    
    This allows easier tweaking.
---
 corfu.el | 61 +++++++++++++++++++++++++++++++------------------------------
 1 file changed, 31 insertions(+), 30 deletions(-)

diff --git a/corfu.el b/corfu.el
index 29d301d..477d821 100644
--- a/corfu.el
+++ b/corfu.el
@@ -174,12 +174,37 @@ Set to nil in order to disable confirmation."
     corfu--extra-properties)
   "Buffer-local state variables used by Corfu.")
 
+(defvar corfu--child-frame-params
+  '((no-accept-focus . t)
+    (min-width . t)
+    (min-height . t)
+    (width . 0)
+    (height . 0)
+    (border-width . 0)
+    (internal-border-width . 1)
+    (child-frame-border-width . 1)
+    (left-fringe . 0)
+    (right-fringe . 0)
+    (vertical-scroll-bars . nil)
+    (horizontal-scroll-bars . nil)
+    (menu-bar-lines . 0)
+    (tool-bar-lines . 0)
+    (tab-bar-lines . 0)
+    (no-other-frame . t)
+    (unsplittable . t)
+    (undecorated . t)
+    (cursor-type . nil)
+    (minibuffer . nil)
+    (visibility . nil)
+    (no-special-glyphs . t)
+    (desktop-dont-save . t))
+  "Default child frame parameters.")
+
 ;; Function adapted from posframe.el by tumashu
 (defun corfu--child-frame (x y width height content)
   "Show child frame at X/Y with WIDTH/HEIGHT and CONTENT."
   (let* ((window-min-height 1)
          (window-min-width 1)
-         (ls line-spacing)
          (x-gtk-resize-child-frames
           (let ((case-fold-search t))
             (and
@@ -221,35 +246,11 @@ Set to nil in order to disable confirmation."
         (goto-char (point-min))))
     (unless (and (frame-live-p corfu--frame)
                  (eq (frame-parent corfu--frame) (window-frame)))
-      (when corfu--frame
-        (delete-frame corfu--frame))
-      (setq corfu--frame
-            (make-frame
-             `((parent-frame . ,(window-frame))
-               (no-accept-focus . t)
-               (min-width . t)
-               (min-height . t)
-               (width . 0)
-               (height . 0)
-               (line-spacing . ,ls)
-               (border-width . 0)
-               (internal-border-width . 1)
-               (child-frame-border-width . 1)
-               (left-fringe . 0)
-               (right-fringe . 0)
-               (vertical-scroll-bars . nil)
-               (horizontal-scroll-bars . nil)
-               (menu-bar-lines . 0)
-               (tool-bar-lines . 0)
-               (tab-bar-lines . 0)
-               (no-other-frame . t)
-               (unsplittable . t)
-               (undecorated . t)
-               (cursor-type . nil)
-               (minibuffer . nil)
-               (visibility . nil)
-               (no-special-glyphs . t)
-               (desktop-dont-save . t)))))
+      (when corfu--frame (delete-frame corfu--frame))
+      (setq corfu--frame (make-frame
+                          `((parent-frame . ,(window-frame))
+                            (line-spacing . ,line-spacing)
+                            ,@corfu--child-frame-params))))
     (set-face-background
      (if (facep 'child-frame-border) 'child-frame-border 'internal-border)
      (face-attribute 'corfu-border :background) corfu--frame)



reply via email to

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