diff --git a/config.org b/config.org index 5694c34..f958bf6 100644 --- a/config.org +++ b/config.org @@ -857,6 +857,24 @@ If IMPURE is t, then allow impure builds." path)) #+end_src +** Popup Rules + +#+call: confpkg("Support: Popup") + +Doom Emacs has a system to tame secondary windows called the /popup system/. To use the popup system, the config can set rules to match certain buffers and automatically place them in convenient locations as they pop up, or set other nice properties, such as removing the modeline for a cleaner look. + +Doom also includes its own default popup rules. Most of these are inoffensive, but there are some that I need to replace with my own. This function does that by deleting the default rules from the alist where they are stored, ~+popup--display-buffer-alist~. + +#+begin_src emacs-lisp +(defun replace-popup-rule! (predicate &rest args) + "Remove the popup rule with the predicate PREDICATE and replace it with this one. + +See `set-popup-rule!' for the arguments this function should take." + (setq +popup--display-buffer-alist + (assoc-delete-all predicate +popup--display-buffer-alist)) + (apply #'set-popup-rule! predicate args)) +#+end_src + * Doom Modules One of Doom Emacs's most useful features is its modular configuration system, allowing configuration code to be sectioned into modules that can be enabled or customized individually. Doom provides a full suite of prewritten modules to enable. @@ -2347,10 +2365,9 @@ I don't like the default placement of =undo-tree= on the left side of the window #+begin_src emacs-lisp (after! undo-tree - (setq undo-tree-visualizer-diff nil)) - -(set-popup-rule! "^ \\*undo-tree\\*" - :slot 2 :side 'right :size 30 :select t :quit nil) + (setq undo-tree-visualizer-diff nil) + (replace-popup-rule! "^ \\*undo-tree\\*" + :slot 2 :side 'right :size 30 :select t :quit nil)) #+end_src ** VTerm @@ -2715,7 +2732,7 @@ I use the standard Unix-style password management system, [[https://www.password ;; Move to right side (after! pass - (set-popup-rule! "^\\*Password-Store" :side 'right :size 0.25 :quit nil)) + (replace-popup-rule! "^\\*Password-Store" :side 'right :size 0.25 :quit nil)) #+end_src *** Tweaks