bmag / emacs-purpose

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

collision with shackle-mode #157

Closed hekinami closed 5 years ago

hekinami commented 5 years ago

I am trying to use shackle-mode (https://github.com/wasamasa/shackle) with purpose-mode,

however according to the minor mode definition

(define-minor-mode purpose-mode nil
  :global t :lighter (:eval (purpose--modeline-string))
  (if purpose-mode
      (progn
        (purpose--add-advices)
        (setq display-buffer-overriding-action
              '(purpose--action-function . nil))
        (setq purpose--active-p t)
        (purpose-fix-install))
    (purpose--remove-advices)
    (setq purpose--active-p `nil)))

purpose set display-buffer-overriding-action which overrides all the other actions in the action variables and arguments passed to ‘display-buffer’. (according to the docstring)

shackle-mode use display-buffer-alist for user actions, and because display-buffer-overriding-action was set, it becomes not working.

I haven't read all code of purpose-mode, so not sure if display-buffer-overriding-action is a MUST for its functions, if possible I suggest use display-buffer-alist instead of display-buffer-overriding-action to allow coexistence with other packages

bmag commented 5 years ago

If you can't use purpose-action-function-ignore-buffer-names to make shackle work with purpose, then look at https://github.com/bmag/emacs-purpose/issues/124.

Using display-buffer-alist for purpose is not viable, but using display-buffer-base-action instead of display-buffer-overriding-action is almost surely viable, and there is some progress towards it in the base-action branch of this repository. If I will ever get around to finishing version 2.0 of purpose, it will use display-buffer-base-action and should be compatible with shackle out of the box. (but honestly it might never happen)