From e11f6fab9eb28d02aef11976785915c1ded6d449 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Thu, 11 May 2023 10:28:38 +0100 Subject: Update coq window creation --- init.el | 2 ++ ymh-emacs/ymh-common.el | 43 ++++++++++++++++++++++--------------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/init.el b/init.el index d37ade3..0dd683e 100644 --- a/init.el +++ b/init.el @@ -1118,6 +1118,8 @@ https://yannherklotz.com")) (use-package darkroom :ensure t + :bind (:map ymh-map + ("d" . darkroom-mode)) ;; :hook (text-mode . darkroom-tentative-mode) :custom (darkroom-text-scale-increase 1)) diff --git a/ymh-emacs/ymh-common.el b/ymh-emacs/ymh-common.el index 8066f3c..c372764 100644 --- a/ymh-emacs/ymh-common.el +++ b/ymh-emacs/ymh-common.el @@ -11,28 +11,29 @@ (interactive) (other-window -1)) -(defun ymh/reset-coq-windows () +(defun ymh/reset-coq-windows (&optional prefix) "Resets the Goal and Response windows." - (interactive) - (let ((frame-n (length (frame-list)))) - (cond - ((eq frame-n 2) - (other-frame 1) - (delete-other-windows) - (split-window-below) - (switch-to-buffer "*goals*") - (other-window 1) - (switch-to-buffer "*response*") - (other-frame 1)) - (t - (delete-other-windows) - (split-window-right) - (other-window 1) - (switch-to-buffer "*goals*") - (split-window-below) - (other-window 1) - (switch-to-buffer "*response*") - (other-window 1))))) + (interactive (list (when current-prefix-arg + (prefix-numeric-value current-prefix-arg)))) + (message prefix) + (cond + ((and prefix (> prefix 0)) + (other-frame 1) + (delete-other-windows) + (split-window-below) + (switch-to-buffer "*goals*") + (other-window 1) + (switch-to-buffer "*response*") + (other-frame 1)) + (t + (delete-other-windows) + (split-window-right) + (other-window 1) + (switch-to-buffer "*goals*") + (split-window-below) + (other-window 1) + (switch-to-buffer "*response*") + (other-window 1)))) (defun ymh/pass (query) "Return the password as a string from QUERY." -- cgit