Put grep down and make side windows not selectable with other-window

This commit is contained in:
BirDt_ 2026-05-20 20:10:37 +08:00
parent 4a0eaa1f9b
commit 0cc4aad979

View file

@ -42,12 +42,28 @@
'(5 1 5 2)))
(add-to-list 'display-buffer-alist
`("\\*Help\\*"
`("\\*Help"
(display-buffer-in-side-window)
(side . ,(if (equal system-type 'android) 'bottom 'right))
(slot . ,(if (equal system-type 'android) 0 4))
(window-height . 0.2)))
(add-to-list 'display-buffer-alist
`("\\*grep\\*"
(display-buffer-in-side-window)
(side . bottom)
(slot . 1)))
(defun mark-side-window-as-no-other (orig-fun &rest args)
"Set `no-other-window' to t for any window being displayed as a side window."
(let ((window (apply orig-fun args)))
(when (window-live-p window)
(set-window-parameter window 'no-other-window t))
window))
(advice-add 'display-buffer-in-side-window :around #'mark-side-window-as-no-other)
(setq windmove-allow-all-windows t)
(provide 'window-utils)
;;; window-utils.el ends here