;;; -*- lexical-binding: t -*- (require 'shackle) (defun my/shackle-rules () (let ((rules-common '(((:custom buffer-file-name) :other t) (direx:direx-mode :align left :size 40 :select t) ("*Flycheck error messages*" :align below :size 15 :select nil))) (rules-wide '(("magit-.*-popup" :regexp t :align right :select t) ((magit-log-mode magit-status-mode) :align bottom :size 15 :select t) ((magit-diff-mode magit-revision-mode) :align right :size 80))) (rules-narrow-tall '(("magit-.*-popup" :regexp t :align bottom :select t) (magit-status-mode :align bottom :size 25 :select t) ((magit-diff-mode magit-revision-mode) :align bottom :size 25))) (rules-narrow-short '(("magit-.*-popup" :regexp t :align bottom :select t) (magit-status-mode :align bottom :size 0.8 :select t) ((magit-diff-mode magit-revision-mode) :align bottom :size 0.65)))) (cond ((>= (frame-text-cols) 120) (append rules-common rules-wide)) ((>= (frame-text-lines) 30) (append rules-common rules-narrow-tall)) (t (append rules-common rules-narrow-short))))) (setq shackle-default-rule '(:align below :select t :size 15)) (setq shackle-default-size 0.5) (defun shackle-match (buffer-or-name) (cl-loop for (condition . plist) in (my/shackle-rules) when (shackle--match buffer-or-name condition plist) return plist finally return shackle-default-rule)) (shackle-mode)