summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2023-04-24 19:03:15 +0100
committerYann Herklotz <git@yannherklotz.com>2023-04-24 19:03:49 +0100
commit02145bb456a667a399bf086b7214fcca16f933c6 (patch)
treef4523529cfda90c92d15c6042921c1911893eea2
parentf57834ffbb6345a0d8f7113e4866c693280c625f (diff)
downloadymh-emacs-02145bb456a667a399bf086b7214fcca16f933c6.tar.gz
ymh-emacs-02145bb456a667a399bf086b7214fcca16f933c6.zip
Check the number of open frames for Coq window creation
-rw-r--r--ymh-emacs/ymh-common.el26
1 files changed, 19 insertions, 7 deletions
diff --git a/ymh-emacs/ymh-common.el b/ymh-emacs/ymh-common.el
index 09ebe08..8f36973 100644
--- a/ymh-emacs/ymh-common.el
+++ b/ymh-emacs/ymh-common.el
@@ -17,13 +17,25 @@
(defun ymh/reset-coq-windows ()
"Resets the Goal and Response windows."
(interactive)
- (other-frame 1)
- (delete-other-windows)
- (split-window-below)
- (switch-to-buffer "*goals*")
- (other-window 1)
- (switch-to-buffer "*response*")
- (other-frame 1))
+ (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)))))
(defun ymh/pass (query)
"Return the password as a string from QUERY."