From 0cc4aad9798f864fd1e7698655e4698f2c1d550f Mon Sep 17 00:00:00 2001 From: BirDt_ Date: Wed, 20 May 2026 20:10:37 +0800 Subject: [PATCH] Put grep down and make side windows not selectable with other-window --- window-utils.el | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/window-utils.el b/window-utils.el index f6a34f7..49e6ca1 100644 --- a/window-utils.el +++ b/window-utils.el @@ -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