From ae5657fcc992dc72e2a2fea4a3fbea6447ae3bc7 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Mon, 30 Dec 2024 10:39:29 +0100 Subject: [PATCH] Add small utility to zoom into dedicated window Taken from prot, see comment. --- site-lisp/db-utils.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/site-lisp/db-utils.el b/site-lisp/db-utils.el index 94db277..6187d3f 100644 --- a/site-lisp/db-utils.el +++ b/site-lisp/db-utils.el @@ -637,6 +637,20 @@ quite sure whether something like this exists already?" (funcall entry) entry))) +;; From https://protesilaos.com/codelog/2020-08-03-emacs-custom-functions-galore/, where it has been +;; based on `windower' by Pierre Neidhardt (ambrevar on GitLab); pointer by +;; https://sachachua.com/blog/2024/12/emacs-tv/ +(let (saved-window-configuration) + (define-minor-mode db/window-single-toggle + "Toggle between multiple windows and single window." + :lighter " Z" + :global nil + (if (one-window-p) + (when saved-window-configuration + (set-window-configuration saved-window-configuration)) + (setq saved-window-configuration (current-window-configuration)) + (delete-other-windows)))) + ;;; Base45 Decoding