From ed8eef8420b1ad6cfb14a901c5f39cba859bf155 Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Mon, 19 Dec 2022 07:05:39 -0500 Subject: [PATCH] Disable writeroom maximization effect --- init.el | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/init.el b/init.el index 77ac849..eb81222 100644 --- a/init.el +++ b/init.el @@ -1312,31 +1312,15 @@ DOCSTRING is an optional form that is discarded upon expansion." ;; writeroom-mode ;; ---------------------------------- ;; -(defun user/writeroom-auto-disable (&rest _) - "Disable writeroom mode if the previous command hid the writeroom buffer." - (if writeroom--buffers - (let ((writeroom-buffer (car writeroom--buffers))) - (unless (or (active-minibuffer-window) - (get-buffer-window writeroom-buffer)) - (with-current-buffer writeroom-buffer (writeroom-mode -1)) - (remove-hook 'post-command-hook #'user/writeroom-auto-disable))) - (remove-hook 'post-command-hook #'user/writeroom-auto-disable))) - (external-package writeroom-mode - "Maximizes the active window and centers the working text area" + "Centers the working text area in the active buffer" :custom (writeroom-width 140 "Set the working area width to 140 columns.") - (writeroom-maximize-window t "Automatically maximize the active window.") + (writeroom-maximize-window nil "Do not maximize the active window.") (writeroom-mode-line t "Show the mode line while writeroom-mode is active.") (writeroom-header-line t "Show the header line while writeroom-mode is active.") (writeroom-global-effects nil "Disable all frame-wide writeroom effects.") (writeroom-fringes-outside-margins nil "Keep the fringes close to the text.") - (writeroom-restore-window-config t "Restore the previous window layout upon deactivation.") - :hook - (writeroom-mode-enable-hook . (lambda () - (add-hook 'post-command-hook #'user/writeroom-auto-disable))) - (writeroom-mode-disable-hook . (lambda () - (remove-hook 'post-command-hook #'user/writeroom-auto-disable))) :bind (("C-c f" . writeroom-mode) (:map writeroom-mode-map