]> jturnerusa.dev Git - emacs.d/commitdiff
removed display-buffer-alist update function
authorJohn Turner <jturner.usa@gmail.com>
Wed, 5 Oct 2022 02:32:18 +0000 (22:32 -0400)
committerJohn Turner <jturner.usa@gmail.com>
Wed, 5 Oct 2022 02:32:18 +0000 (22:32 -0400)
Before we had a function that updated display-buffer-alist whenever
the frame's size was changed, so that info windows like flymake or
flycheck open would snap to either the bottom or right hand side of the
frame depending on whether the window manager had the frame squeezed
vertically (like when you have two windows side by side split
vertically).

Now instead of having that function run every time the frame resizes,
we just make the 'side property a function that should get evaluated
each time the property is read. The function returns either 'bottom or
'right depending on the frame's current size in pixels.

config/display-buffer/config-display-buffer-alist.el
config/flycheck/config-flycheck.el
config/flymake/config-flymake.el

index caf2229fb3201c4bb2565a7dd7d824b4984fe633..e64f10998a3c7efb6a170d948e6228581eef1d9e 100644 (file)
@@ -4,20 +4,3 @@
   (if (> (+ (frame-pixel-width) config-display-buffer-gaps-width) (/ (x-display-pixel-width) 2))
       'right
     'bottom))
-
-(defun config-display-buffer-update-alist (_)
-  (let ((side (config-display-buffer-which-side)))
-    (setq display-buffer-alist `(("\\*Flymake diagnostics.*"
-                                  (display-buffer-in-side-window)
-                                  (side . ,side)
-                                  (window-height . 15)
-                                 (window-width  . 75)
-                                 ("\*Flycheck errors\*"
-                                  (display-buffer-in-side-window)
-                                  (side . ,side)
-                                  (window-height . 15)
-                                  (window-width . 75)))))))
-
-(add-hook 'after-make-frame-functions 'config-display-buffer-update-alist)
-
-(add-hook 'window-size-change-functions 'config-display-buffer-update-alist)
index 7478606fee39c2d839c888b9b1445f00488eb00c..0c1ae1b445fa2bb67acb727b8be648012b9fa6a9 100644 (file)
@@ -1,7 +1,13 @@
 (require 'flycheck)
 
+(load "config-flycheck-cargo-has-command-p-fix")
+
 (add-hook 'flycheck-error-list-mode-hook (lambda () (visual-line-mode 1)))
 
-(load "config-flycheck-cargo-has-command-p-fix")
+(add-to-list 'display-buffer-alist '("\\*Flycheck errors.*"
+                                     (display-buffer-in-side-window)
+                                     (side . (config-display-buffer-which-side))
+                                     (window-height . 15)
+                                     (window-width . 75)))
 
 (provide 'config-flycheck)
index 203e52b3069043eb21c59f3be06e0336d526e68c..c691bee2f7f10cd9e0f781b787b146de205110fd 100644 (file)
@@ -2,4 +2,10 @@
 
 (load "config-flymake-hooks")
 
+(add-to-list 'display-buffer-alist '("\\*Flymake diagnostics.*"
+                                     (display-buffer-in-side-window)
+                                     (side . (config-display-buffer-which-side))
+                                     (window-height . 15)
+                                     (window-width . 75)))
+
 (provide 'config-flymake)