bmag / emacs-purpose

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

add support for zone.el #134

Closed deb0ch closed 5 years ago

deb0ch commented 6 years ago

Hey !

Just realised that I wrote this but never PRed it 😅

I am basically adding support for zone.el, because else when Emacs starts zoning out the zone buffer does not appear at the right place and everything seems off.

This is undoubtably Emacs' and Purpose's most important feature to this day.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-12.3%) to 71.676% when pulling 7b72978e2461ede7a318186fb128ada06cba0296 on deb0ch:master into 2b640955235d0a50dd1e3128612f41d595bc6dc8 on bmag:master.

deb0ch commented 6 years ago

Just haven't written a test yet but I'm not sure how to test this and don't have time for exploring too much, it would be great if you could give me some hints in that matter 😸

bmag commented 6 years ago

Have you tried:

(purpose-set-extension-configuration
 :zone
 (purpose-conf "zone" :name-purposes `(("*zone*" . Zone))))
(add-to-list 'purpose-special-action-sequences '(Zone display-buffer-same-window))

Adding it as fix in window-purpose-fixes.el, wrapped in with-eval-after-load, makes much more sense. You can see how the guide-key and which-key fixes are implemented as examples (purpose--fix-guide-key, purpose--fix-which-key). I'm ok with not adding a test.

P.S. You know I'm not going to modify the core (window-purpose-core.el) just to handle Zone as a special case, right?

P.P.S from my fast reply you'd think this really is an important feature, but actually that's because of good timing of the PR and the fix being easy.

deb0ch commented 6 years ago

Thank you for the tip, and no I did not try this or even knew something like this existed 😅I will try it like that and update my PR if it works (next time I have a period of nothing-to-do-at-work)

I don't know if you're willing to modify the core for Zone, yes Zone is a completely funny but useless feature but on the other hand it is integrated to Emacs itself so it's not like it's a completely random exotic package used by 3 randos 😸

I wouldn't think it is an important feature, I'm more like convinced it is the most central feature introduced in Emacs-purpose to this day 😁

deb0ch commented 6 years ago

Just did what you said, it worked like a charm :thumbsup::sparkles:

I even used it for integrating vterm 😸

deb0ch commented 6 years ago

Though I have no idea why I'm getting errors when naming the purpose zone instead of Zone 😕

deb0ch commented 5 years ago

Ping ?

bmag commented 5 years ago

Merged, and I also took the opportunity to replace eval-after-load with with-eval-after-load.

getting errors when naming the purpose zone instead of Zone

Well, that's because zone is a valid function, so in purpose-special-action-sequences Purpose thinks it's a predicate function and not a symbol denoting a purpose.

deb0ch commented 5 years ago

Yay ! Thank you for everything 👍✨