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

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

[elpa] externals/popper c96915cb77 043/102: Merge commit 'b120c68' into


From: ELPA Syncer
Subject: [elpa] externals/popper c96915cb77 043/102: Merge commit 'b120c68' into feature
Date: Fri, 8 Sep 2023 15:58:52 -0400 (EDT)

branch: externals/popper
commit c96915cb7711c36abcca2d38837cc727f83d66b2
Merge: 598571f025 b120c6836c
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>

    Merge commit 'b120c68' into feature
---
 popper.el | 37 ++++++++++++++++++++++++++++++++-----
 1 file changed, 32 insertions(+), 5 deletions(-)

diff --git a/popper.el b/popper.el
index c2d97c345d..6acb863b8b 100644
--- a/popper.el
+++ b/popper.el
@@ -163,6 +163,30 @@ Built-in choices include
           (const :tag "Group by directory" popper-group-by-directory)
           (function :tag "Custom function")))
 
+(defcustom popper-window-height #'popper--fit-window-height
+  "Specify the height of the popup window. 
+
+This can be a number representing the height in chars or a
+function that optionally takes one argument (the popup window)
+and returns the height in chars. This option is ignored when
+`popper-display-control' is set to nil.
+
+Examples:
+
+;; Popup windows are always 20 chars tall
+20
+
+;; The default, scale window height with buffer size up to 33% of
+the frame height.
+(lambda (win)
+  (fit-window-to-buffer
+   win
+   (floor (frame-height) 3)))
+"
+  :group 'popper
+  :type '(choice (integer :tag "Height in chars")
+                 (function :tag "Height function")))
+
 (defvar popper-reference-names nil
   "List of buffer names whose windows are treated as popups.")
 
@@ -186,14 +210,17 @@ grouped by the predicate `popper-group-function'.")
 'raised    : This is a POPUP buffer raised to regular status by the user.
 'user-popup: This is a regular buffer lowered to popup status by the user.")
 
+(defun popper--fit-window-height (win)
+  "Determine the popper window height by fitting it to the buffer's content."
+  (fit-window-to-buffer
+   win
+   (floor (frame-height) 3)))
+
 (defun popper-select-popup-at-bottom (buffer &optional _alist)
   "Display and switch to popup-buffer BUFFER at the bottom of the screen."
   (let ((window (display-buffer-in-side-window
                  buffer
-                 '((window-height . (lambda (win)
-                                      (fit-window-to-buffer
-                                       win
-                                       (floor (frame-height) 3))))
+                 '((window-height . popper--fit-window-height)
                    (side . bottom)
                    (slot . 1)))))
     (select-window window)))
@@ -513,7 +540,7 @@ If BUFFER is not specified act on the current buffer 
instead."
   `popper-suppress-buffers' list. This should run after
   `popper-update-popups' in `window-configuration-change-hook'."
 
-  
+;;(popper-find-popups ())  
   
 
 )



reply via email to

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