diff options
author | Yann Herklotz <git@yannherklotz.com> | 2023-04-24 19:03:15 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2023-04-24 19:03:49 +0100 |
commit | 02145bb456a667a399bf086b7214fcca16f933c6 (patch) | |
tree | f4523529cfda90c92d15c6042921c1911893eea2 /ymh-emacs/ymh-common.el | |
parent | f57834ffbb6345a0d8f7113e4866c693280c625f (diff) | |
download | ymh-emacs-02145bb456a667a399bf086b7214fcca16f933c6.tar.gz ymh-emacs-02145bb456a667a399bf086b7214fcca16f933c6.zip |
Check the number of open frames for Coq window creation
Diffstat (limited to 'ymh-emacs/ymh-common.el')
-rw-r--r-- | ymh-emacs/ymh-common.el | 26 |
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." |