bmag / emacs-purpose

Manage Windows and Buffers According to Purposes
GNU General Public License v3.0
496 stars 23 forks source link

How to change the purpose of the compilation buffer to become non-popup? #159

Open taquangtrung opened 4 years ago

taquangtrung commented 4 years ago

Hi,

Is it possible to change the purpose of the compilation buffer *compilation* to become non-popup?

I'm using two Emacs frames in two monitors, and I want to fix the compilation buffer into one monitor. However, whenever I press C-g, the buffer *compilation* disappears, since it is assigned to popb purpose.

I tried to set that buffer or its window to be dedicated, but it doesn't work.

I also remove the compilation-mode from purpose-x-popwin-major-modes, and call purpose-x-popwin-update-conf to update the configuration, but this doesn't work either. Here is the function that I wrote to enable/disable the compilation buffer from being set as popb.

Could you advise me what is wrong? Or how can I properly enable/disable that feature?

(Note that I already disable the old popwin mode and use only spacemacs-purpose-popwin)

(defun toggle-popup-compilation ()
  (interactive)
  (cond ((memq 'compilation-mode purpose-x-popwin-major-modes)
         (setq purpose-x-popwin-major-modes
               (remove 'compilation-mode purpose-x-popwin-major-modes))
         (purpose-x-popwin-update-conf))
        (t
         (add-to-list 'purpose-x-popwin-major-modes 'compilation-mode)
         (purpose-x-popwin-update-conf))))

Thank you very much!

gjhenrique commented 11 months ago

Hi,

I have the following functions to open certain buffers in another frame assigned to its purpose

(defun zezin-add-reusable-buffers (buffer-regex)
  (add-to-list 'display-buffer-alist
           `(,buffer-regex
         nil
         (reusable-frames . t))))

(zezin-add-reusable-buffers "\\*Go Test\\*")
(zezin-add-reusable-buffers "\\**compilation\\*")
(zezin-add-reusable-buffers "\\magit*")