summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2023-05-11 10:28:38 +0100
committerYann Herklotz <git@yannherklotz.com>2023-05-11 10:29:25 +0100
commite11f6fab9eb28d02aef11976785915c1ded6d449 (patch)
tree8fda9d41319d10098fbe9f6f5947574e8edb40a0
parent7f7e8ae886342a8b8c76c984a6fa4904e710f525 (diff)
downloadymh-emacs-e11f6fab9eb28d02aef11976785915c1ded6d449.tar.gz
ymh-emacs-e11f6fab9eb28d02aef11976785915c1ded6d449.zip
Update coq window creation
-rw-r--r--init.el2
-rw-r--r--ymh-emacs/ymh-common.el43
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."