6

Zone Mode is awesome

But when I run it using M-x zone, or by setting zone-when-idle variable it starts animating only one(selected) window.

Is there any way to run it for all windows?

4
  • 1
    As far as I can see this is not a very low hanging fruit since zone is very focused on the current window. One way could be to display the same zonery in every window and remember the state of each window when zone starts.
    – Marco Wahl
    Commented Oct 20, 2017 at 17:09
  • Good idea, but I think, displaying the same zone everywhere could be done easier. For example, I can open their default *zone* buffer in every window, then execute (zone) so it will modify this buffer(which is displayed in all windows). At the end, when the zone is interrupted it kills own buffer which will cause all windows to revert to their previous state. Should work, right? Commented Oct 20, 2017 at 18:34
  • AFAICT the call to zone is blocking. I encourage you to try something anyway.
    – Marco Wahl
    Commented Oct 21, 2017 at 9:19
  • @OlesSavluk Have you come up with a solution for this? I'd be interested in this too.
    – haff
    Commented Feb 1, 2018 at 21:26

1 Answer 1

0

The first solution that comes to my mind was to run zone fullscreen. It can be done, but you're left with single zoned window, and it feels a little bit off.

It's achievable by modifying display-buffer-alist.

(add-to-list 'display-buffer-alist '("*zone*" (display-buffer-full-frame)))

Now on running (zone) in multiple window.

From what I've found, (zone) takes the current buffer content to operate, so just switching every window buffer to *zone* resulting in empty zoned buffer.

So, the solution is to switch all window to *zone* buffer, except the operating window, then zone on the operating window.

Doing it using advice, so that we can run it using zone-with-idle

(define-advice zone (:around (orig-fn &rest _) "zone-all-buffer")
  (save-window-excursion
    (let ((op-win (car (window-list))))
      (mapc (lambda (w)
              (with-selected-window w
                (switch-to-buffer "*zone*")))
            (cdr (window-list)))
      (with-selected-window op-win
        (funcall orig-fn)))))

As far as I know, zone blocks emacs' processes. So, unless we modify how zoning works, we can't have zone process with different buffer content.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.