aboutsummaryrefslogtreecommitdiffhomepage
path: root/generic
diff options
context:
space:
mode:
authorGravatar Pierre Courtieu <Pierre.Courtieu@cnam.fr>2015-11-13 16:37:28 +0100
committerGravatar Pierre Courtieu <Pierre.Courtieu@cnam.fr>2015-11-13 16:37:28 +0100
commit95c86b944368015804f0bfd0002dc098578bda58 (patch)
tree25c400e092b9cfda6c508839987e72296691267d /generic
parent6c47d20a9e1fa0a30be041dc565ae71090ffcd4a (diff)
Experimenting less brutal frame deletion.
Only in coq mode for now. There are still some strange frame deletion some times.
Diffstat (limited to 'generic')
-rw-r--r--generic/pg-assoc.el16
-rw-r--r--generic/pg-response.el5
2 files changed, 11 insertions, 10 deletions
diff --git a/generic/pg-assoc.el b/generic/pg-assoc.el
index 7b983bbf..6a27cd29 100644
--- a/generic/pg-assoc.el
+++ b/generic/pg-assoc.el
@@ -40,15 +40,17 @@ Some may be dead/nil."
;;;###autoload
-(defun proof-associated-windows ()
+(defun proof-associated-windows (&optional all-frames)
"Return a list of the associated buffers windows.
-Dead or nil buffers are not represented in the list."
+Dead or nil buffers are not represented in the list. Optional
+argument ALL-FRAMES has the same meaning than for
+`get-buffer-window'."
(let ((bufs (proof-associated-buffers))
buf wins)
(while bufs
(setq buf (car bufs))
- (if (and buf (get-buffer-window buf))
- (setq wins (cons (get-buffer-window buf) wins)))
+ (if (and buf (get-buffer-window-list buf nil all-frames))
+ (setq wins (append (get-buffer-window-list buf nil all-frames) wins)))
(setq bufs (cdr bufs)))
wins))
@@ -60,11 +62,9 @@ Dead or nil buffers are not represented in the list."
"Remove windows of LW not displaying at least one associated buffer."
(remove-if-not (lambda (w) (proof-associated-buffer-p (window-buffer w))) lw))
-(defun proof-find-all-associated-windows ()
- "Return the list of windows displaying an associated buffer."
- (proof-filter-associated-windows (window-list-1 nil nil t)))
-(defun proof-find-all-associated-frames ()
+;;;###autoload
+(defun proof-associated-frames ()
"Return the list of frames displaying at least one associated buffer."
(remove-if-not (lambda (f) (proof-filter-associated-windows (window-list f)))
(frame-list)))
diff --git a/generic/pg-response.el b/generic/pg-response.el
index e903858e..b0cf217d 100644
--- a/generic/pg-response.el
+++ b/generic/pg-response.el
@@ -188,7 +188,8 @@ Following POLICY, which can be one of 'smart, 'horizontal,
proof-script-buffer proof-goals-buffer proof-response-buffer
policy))))
-
+;; this is a canidate for replacing proof-delete-other-frames below, less brutal.
+;; For the moment we experiment this locall on coq mode.
(defun proof-delete-all-associated-windows ()
"Delete windows (and maybe frames) showing associated buffers.
Delete a frame if it displays only associated buffers, unless it
@@ -198,7 +199,7 @@ is the only frame (try to bury buffers then)."
(if (not (frame-root-window-p w)) (delete-window w)
(if (< 1 (length (frame-list))) (delete-frame (window-frame w))
(window--display-buffer (other-buffer) w 'window))))
- (proof-find-all-associated-windows)))
+ (proof-associated-windows t)))
(defvar pg-frame-configuration nil
"Variable storing last used frame configuration.")