summaryrefslogtreecommitdiffstats
path: root/ymh-emacs/ymh-common.el
diff options
context:
space:
mode:
Diffstat (limited to 'ymh-emacs/ymh-common.el')
-rw-r--r--ymh-emacs/ymh-common.el43
1 files changed, 22 insertions, 21 deletions
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."