diff options
author | Yann Herklotz <git@yannherklotz.com> | 2023-05-11 10:28:38 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2023-05-11 10:29:25 +0100 |
commit | e11f6fab9eb28d02aef11976785915c1ded6d449 (patch) | |
tree | 8fda9d41319d10098fbe9f6f5947574e8edb40a0 | |
parent | 7f7e8ae886342a8b8c76c984a6fa4904e710f525 (diff) | |
download | ymh-emacs-e11f6fab9eb28d02aef11976785915c1ded6d449.tar.gz ymh-emacs-e11f6fab9eb28d02aef11976785915c1ded6d449.zip |
Update coq window creation
-rw-r--r-- | init.el | 2 | ||||
-rw-r--r-- | ymh-emacs/ymh-common.el | 43 |
2 files changed, 24 insertions, 21 deletions
@@ -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." |