diff --git a/modules/ui/popup/autoload/popup.el b/modules/ui/popup/autoload/popup.el index b72c3b9f1..7fd12b176 100644 --- a/modules/ui/popup/autoload/popup.el +++ b/modules/ui/popup/autoload/popup.el @@ -263,6 +263,14 @@ disabled." (let ((f (if (bound-and-true-p +popup-buffer-mode) 0))) (set-window-fringes nil f f fringes-outside-margins))) +;;;###autoload +(defun +popup|adjust-margins () + "Creates padding for the popup window determined by `+popup-margin-width', +restoring it if `+popup-buffer-mode' is disabled." + (when +popup-margin-width + (let ((m (if (bound-and-true-p +popup-buffer-mode) +popup-margin-width))) + (set-window-margins nil m m)))) + ;;;###autoload (defun +popup|set-modeline-on-enable () "Don't show modeline in popup windows without a `modeline' window-parameter. diff --git a/modules/ui/popup/config.el b/modules/ui/popup/config.el index e27f455fb..56b7ea365 100644 --- a/modules/ui/popup/config.el +++ b/modules/ui/popup/config.el @@ -94,9 +94,9 @@ a brief description of some native window parameters that Emacs uses: (no-other-window . t)) "The default window parameters.") -(defvar +popup-ttl 5 - "The default time-to-live for transient buffers whose popup buffers have been -deleted.") +(defvar +popup-margin-width 1 + "Size of the margins to give popup windows. Set this to nil to disable margin +adjustment.") ;; @@ -144,6 +144,7 @@ deleted.") (add-hook 'doom-init-ui-hook #'+popup-mode) (add-hook! '+popup-buffer-mode-hook #'(+popup|adjust-fringes + +popup|adjust-margins +popup|set-modeline-on-enable +popup|unset-modeline-on-disable))