From e6c71ce69c7bdec94326061962a5b4579caabd27 Mon Sep 17 00:00:00 2001 From: Tobias Ostner Date: Sun, 26 Apr 2026 11:25:52 +0200 Subject: [PATCH] Reversible C-x 1 --- flakes/emacs/config/init.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/flakes/emacs/config/init.el b/flakes/emacs/config/init.el index 09263a2..3ec0f0b 100644 --- a/flakes/emacs/config/init.el +++ b/flakes/emacs/config/init.el @@ -199,7 +199,16 @@ (use-package emacs :ensure nil :demand t - :bind (("" . ignore) + :preface + (defun to/toggle-delete-other-windows () + "Delete other windows, or restore the previous window configuration." + (interactive) + (if (and winner-mode + (one-window-p t)) + (winner-undo) + (delete-other-windows))) + :bind (("C-x 1" . to/toggle-delete-other-windows) + ("" . ignore) ("" . ignore) ("" . ignore)) :config