feature/popup: replace +popup-enable-*-rules w/ +all/+defaults flags #394
This commit is contained in:
parent
5b19ad50a6
commit
e0fd1b9043
2 changed files with 25 additions and 34 deletions
|
@ -30,7 +30,9 @@
|
|||
(require 'core (concat user-emacs-directory "core/core"))
|
||||
|
||||
(doom! :feature
|
||||
popup ; tame sudden yet inevitable temporary windows
|
||||
(popup ; tame sudden yet inevitable temporary windows
|
||||
+all ; catch all popups that start with an asterix
|
||||
+defaults) ; default popup rules
|
||||
;debugger ; FIXME stepping through code, to help you add bugs
|
||||
eval ; run code, run (also, repls)
|
||||
evil ; come to the dark side, we have cookies
|
||||
|
|
|
@ -81,15 +81,6 @@ a brief description of some native window parameters that Emacs uses:
|
|||
(select . ignore))
|
||||
"The default window parameters.")
|
||||
|
||||
(defvar +popup-enable-fallback-rules t
|
||||
"If non-nil, feature/popup will declare fallback rules for any special buffer
|
||||
that falls through all other rules. A special buffer starts with optional
|
||||
whitespace and an asterix.")
|
||||
|
||||
(defvar +popup-enable-default-rules t
|
||||
"If non-nil, feature/popup will declare a set of default rules for various
|
||||
core Emacs and Doom buffers that should be treated as popups.")
|
||||
|
||||
(defvar +popup-ttl 10
|
||||
"The default time-to-live for transient buffers whose popup buffers have been
|
||||
deleted.")
|
||||
|
@ -154,13 +145,12 @@ ALIST supports one custom parameter: `size', which will resolve to
|
|||
;; Default popup rules & bootstrap
|
||||
;;
|
||||
|
||||
(defun +popup|init ()
|
||||
(eval-when-compile
|
||||
(when +popup-enable-fallback-rules
|
||||
(when (featurep! +all)
|
||||
(set! :popup "^ \\*" '((slot . 1) (vslot . -1) (size . +popup-shrink-to-fit)))
|
||||
(set! :popup "^\\*" '((slot . 1) (vslot . -1)) '((select . t))))
|
||||
|
||||
(when +popup-enable-default-rules
|
||||
(when (featurep! +defaults)
|
||||
(set! :popup "^\\*Completions" '((slot . -1) (vslot . -2)) '((transient . 0)))
|
||||
(set! :popup "^\\*Compil\\(ation\\|e-Log\\)" nil '((transient . 0) (quit . t)))
|
||||
(set! :popup "^\\*\\(?:scratch\\|Messages\\)" nil '((transient)))
|
||||
|
@ -171,16 +161,15 @@ ALIST supports one custom parameter: `size', which will resolve to
|
|||
'((size . 0.25))
|
||||
'((quit) (transient . 0)))
|
||||
(set! :popup "^\\*doom:"
|
||||
'((size . 0.35) (side . top))
|
||||
'((size . 0.35) (side . bottom))
|
||||
'((select . t) (modeline . t) (quit) (transient)))
|
||||
(set! :popup "^\\*\\(?:\\(?:Pp E\\|doom e\\)val\\)"
|
||||
'((size . +popup-shrink-to-fit)) '((transient . 0) (select . ignore))))
|
||||
nil)
|
||||
|
||||
(setq +popup--display-buffer-alist (eval-when-compile +popup--display-buffer-alist))
|
||||
(+popup-mode +1))
|
||||
|
||||
(add-hook 'doom-init-ui-hook #'+popup|init)
|
||||
(add-hook 'doom-init-ui-hook #'+popup-mode)
|
||||
(add-hook! '+popup-buffer-mode-hook #'(+popup|adjust-fringes +popup|set-modeline))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue