I need to programmatically resize a window, so I don't know how to:
among all windows in the current frame find one that's running specified mode, e.g. "dired".
let's say, I have:
|-------+------------+-----|
| Dired | Emacs-lisp | Org |
| | -x- | |
| | | |
|-------+------------+-----|
(with point being at 2nd window) now I need to programmatically find window with Dired mode (note that it can be at any position) and adjust its width.
To adjust the width, I know I can use something like:
(defun fit-w ()
(let ((fit-window-to-buffer-horizontally t))
(fit-window-to-buffer)))
but first I need to detect the window