Lewis,
I looked into this, and it seems that the patch below addresses the problem.
To explain, I think what happened is this. The one-buffer-one-frame package needs to hide frames sometimes rather than delete them. This is because Emacs expects at least one frame to be around at all times (receiving key events, for example, is tied to the selected frame).
The sequence on actions in your bug report hides a frame with buffer o1, because the o2 buffer is killed at one point. When that happens, the frame switches to showing o1, and that frame is hidden. Later, you ask to show file o1, and Aquamacs finds the hidden frame and determines that this should be made visible.
There are two bugs here. First, it should prefer the already visible frame and bring that up. That is now done with the patch.
Second, however, when a hidden frame is made visible, we have to call “make-frame-visible” because apparently that frame can be in some sort of zombie state, as you observed. I found this by selecting another frame, listing and finding the frame object with (frame-list) and (frame-parameters xx) and observing that “visibility” was nil, even though the frame was shown. So there was some inconsistency, and indeed, `make-frame-visible’ brought it back to life.
So, I’ll check the patch below in, and if you’d be so kind, please try out the new build.
David
diff --git a/aquamacs/src/site-lisp/one-buffer-one-frame.el b/aquamacs/src/site-lisp/one-buffer-one-frame.el
index afbe4db821..9f0a78a3f1 100644
--- a/aquamacs/src/site-lisp/one-buffer-one-frame.el
+++ b/aquamacs/src/site-lisp/one-buffer-one-frame.el
@@ -23,7 +23,8 @@
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
-;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013, 2014 David Reitter
+;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013, 2014,
+;; 2019: David Reitter
;; DESCRIPTION:
;;
@@ -406,9 +407,11 @@ obof-force-current-space
(switch t)
(window-to-select))
;; search for a window already displaying this buffer.
- (walk-windows
+ (dolist (include-hidden '(nil t))
+ (walk-windows
(lambda (w)
(when (and
+ (not window-to-select)
;; buffer is displayed in this window
(equal (window-buffer w) (get-bufobj (car args)))
;; Either window's frame *need not be* in the current space,
@@ -416,7 +419,7 @@ obof-force-current-space
;; or it *is* in the current space
(memq (window-frame w) (ns-visible-frame-list))))
(setq switch nil)
- (setq window-to-select w))) t t) ;) ;; t = include-hidden-frame (must be t)
+ (setq window-to-select w))) t include-hidden)) ;) ;; t = include-hidden-frame (must be t)
(if switch
;; Did *not* find a suitable window displaying the buffer.
(let ((same-window-regexps
@@ -453,7 +456,10 @@ obof-force-current-space
;; the next top-level event loop (assumption)
;; but because the normal switch-to-buffer does it right away
;; we should do it manually.
- (set-buffer (window-buffer window-to-select)))
+ (set-buffer (window-buffer window-to-select))
+ ;; Make sure frame is visible (can become unresponsive otherwise):
+ ;;
https://groups.google.com/forum/#!topic/aquamacs-devel/ensH24d-P-U
+ (make-frame-visible (window-frame window-to-select)))
(unless ad-return-value (setq ad-return-value (current-buffer)))))
;; else: not one-buffer-one-frame
(if (or (ns-visible-frame-list)
> --
> You received this message because you are subscribed to the Google Groups "aquamacs-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
aquamacs-deve...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/aquamacs-devel/e22ac62e-5e2a-4e8a-9900-ea4b8206f28c%40googlegroups.com.