Mischa Arefiev
Mischa Arefiev

Reputation: 5417

Reuse *compilation* window in another frame

How is it possible to enforce display-buffer-reuse-frames-like behavior for certain frames with display-buffer-alist?

I have tried doing

(setq display-buffer-alist
      '(("\\*compilation\\*" .
         (display-buffer-reuse-window '((inhibit-same-window . t))))
        ))

, but to no avail. The documentation is long and cryptic even by Emacs standards, and has no examples.

This is not the same as question 3311577 because (setq-default display-buffer-reuse-frames t) is deprecated.

Upvotes: 2

Views: 1325

Answers (1)

phils
phils

Reputation: 73246

It sounds like you want to be using the reusable-frames entry in your ALIST argument to display-buffer-reuse-window, rather than inhabit-same-window? (or perhaps you wanted both?)

You also want to be using add-to-list rather than clobbering the entire list with setq.

Edit: My original answer messed up the list structure, as I was using the dotted-pair notation from the documentation, but had omitted one of the dots!

So the correct value is:

(add-to-list
 'display-buffer-alist
 '("\\*compilation\\*" . (display-buffer-reuse-window
                          . ((reusable-frames . t)))))

or equivalently:

(add-to-list
 'display-buffer-alist
 '("\\*compilation\\*" display-buffer-reuse-window
                         (reusable-frames . t)))

I also notice that there's a good customize interface for configuring this.

Upvotes: 3

Related Questions