removed display-buffer-alist update function

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.
master
John Turner 2 years ago
parent 3cc613b509
commit 8a028d54dd
No known key found for this signature in database
GPG Key ID: 422FE10CC41A94A2

@ -4,20 +4,3 @@
(if (> (+ (frame-pixel-width) config-display-buffer-gaps-width) (/ (x-display-pixel-width) 2)) (if (> (+ (frame-pixel-width) config-display-buffer-gaps-width) (/ (x-display-pixel-width) 2))
'right 'right
'bottom)) '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)

@ -1,7 +1,13 @@
(require 'flycheck) (require 'flycheck)
(load "config-flycheck-cargo-has-command-p-fix")
(add-hook 'flycheck-error-list-mode-hook (lambda () (visual-line-mode 1))) (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) (provide 'config-flycheck)

@ -2,4 +2,10 @@
(load "config-flymake-hooks") (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) (provide 'config-flymake)

Loading…
Cancel
Save