[emacs-berlin] Mastering Emacs
Diez B. Roggisch
deets at web.de
Sat May 20 08:20:06 UTC 2023
I improved my code a bit, it looks like this now:
(setq switch-to-buffer-obey-display-actions t)
;; Introduce a bottom side window that catches
;; compilations, deadgreps etc.
(add-to-list 'display-buffer-alist
'("\\*deadgrep.*\\|\\*Compilation\\*"
(display-buffer-in-side-window)
(side . bottom)
(slot . 0)
(window-parameters
(no-delete-other-windows . t))))
(defun deets/side-window-resize (enlarge)
(let ((bottom-windows (window-at-side-list (window-normalize-frame
nil) 'bottom)))
(dolist (window bottom-windows)
(when (symbolp (window-parameter window 'window-side))
(if enlarge
(window-resize window (window-height window))
(window-resize window (- (/ (window-height window) 2))))))))
(defun deets/side-window-toggle (arg)
(interactive "P")
(cond ((null arg) (window-toggle-side-windows))
((listp arg) (deets/side-window-resize t))
((symbolp arg) (deets/side-window-resize nil))))
;; Remove our side-windows
(global-set-key (read-kbd-macro "C-x w") 'deets/side-window-toggle)
Now using prefix-arguments (C-u C-x w) and (C-u - C-x w) the bottom side
window is doubled or halved in size. Very useful for me. I'm already
thinking about putting documentation/info/etc to the right side.
Diez
On 19.05.23 12:34, Andreas Röhler wrote:
> Danke!
>
> Am 19.05.23 um 11:56 schrieb Diez B. Roggisch:
>> Hey fellow Emacsians,
>>
>> I've just bought a copy of "Mastering Emacs", first and foremost to
>> appreciate the author for this article:
>>
>>
>> https://www.masteringemacs.org/article/demystifying-emacs-window-manager
>>
>>
>>
>> This has since just a few hours already changed my emacs life. I've
>> always been annoyed by process buffers (compilation, ripgrep/deadgrep,
>> etc) getting their own window, destroying my C-x 0, 1, 2, 3 - based
>> window arrangement. Since this morning I'm using the following tiny
>> snippet to manage (for now just a bottom) side windows:
>>
>> (setq switch-to-buffer-obey-display-actions t)
>> ;; Introduce a bottom side window that catches
>> ;; compilations, deadgreps etc.
>> (add-to-list 'display-buffer-alist
>> '("\\*deadgrep.*\\|\\*Compilation\\*"
>> (display-buffer-in-side-window)
>> (side . bottom)
>> (slot . 0)
>> (window-parameters
>> (no-delete-other-windows . t))))
>> ;; Remove our side-windows
>> (global-set-key (read-kbd-macro "C-x w") 'window-toggle-side-windows)
>>
>> Life-changing for me. The rex was created with buffer list view and
>> re-builder, the latter I also learned from the author of the book. I'm
>> sure there's plenty of more stuff to discover once I dive deeper into
>> the e-book! Which I read with 'nov-mode' now courtesy to his
>> suggestion ;)
>>
>> Just wanted to make you aware of the website, the Emacs functionality,
>> and the book so you can share my enjoyment.
>>
>> Happy hacking,
>>
>> Diez
>>
>> _______________________________________________
>> emacs-berlin mailing list
>> emacs-berlin at emacs-berlin.org
>> https://mailb.org/mailman/listinfo/emacs-berlin
> _______________________________________________
> emacs-berlin mailing list
> emacs-berlin at emacs-berlin.org
> https://mailb.org/mailman/listinfo/emacs-berlin
More information about the emacs-berlin
mailing list