Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Perspectives lazy loading #2845

Closed
wants to merge 33 commits into from

Conversation

CestDiego
Copy link
Contributor

Now that I understand better lazy loading and elisp I figured I'd give
the perspectives layer another go. I try to replicate the microstate
from Eyebrowse, but still working on the custom-perspectives.

I would appreciate some feedback until this is merged

@CestDiego CestDiego force-pushed the perspectives-fix branch 3 times, most recently from fbb25e5 to 1933564 Compare September 1, 2015 03:38
@robbyoconnor
Copy link
Contributor

👀 👍 👓 👀


(defun perspectives/init-perspective ()
(use-package perspective
:defer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be :defer t? In any case, using :commands implies :defer t

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed the :defer is irrelevant

@CestDiego
Copy link
Contributor Author

I'm currently working in having a way to easily add custom perspectives and even having a microstate for them so please don't merge this one yet

@sooheon
Copy link

sooheon commented Sep 1, 2015

Great, I'm already enjoying the old perspectives layer, but the loading could be wonky. Curious what are the benefits of microstate over a hydra?

@CestDiego
Copy link
Contributor Author

for the benefits I think @syl20bnr could elaborate more on that. I'm not really that familiar with hydra either

@robbyoconnor
Copy link
Contributor

I like microstates personally

@syl20bnr
Copy link
Owner

syl20bnr commented Sep 1, 2015

microstates and hydra are the same thing, hydra is more powerful but:

  1. I don't like the hydra API which is not obvious
  2. we need a custom solution that better fit spacemacs need (evil-leader, vim, holy-mode etc...)

I may in the future use hydras as backend for some part of the microstates but we will always have our own macro.

@CestDiego
Copy link
Contributor Author

I would love for spacemacs microstates to achieve something like this: http://emacs.stackexchange.com/a/14293

alt

@syl20bnr
Copy link
Owner

syl20bnr commented Sep 1, 2015

Hydra does not use magit-popup AFAIK.
For the API part check what the API can give: https://github.com/abo-abo/hydra/wiki/Rectangle-Operations
I find it very unintuitive and does not fit with what I want for such important part in Spacemacs.

@syl20bnr
Copy link
Owner

syl20bnr commented Sep 1, 2015

I would love for spacemacs microstates to achieve something like this: http://emacs.stackexchange.com/a/14293

That's cool, we should be able to do this in microstates.
BTW the cote above the screenshot is very missleading, the twitter hydra is more complicated than that.

@syl20bnr
Copy link
Owner

syl20bnr commented Sep 1, 2015

The twitter hydra is here: https://github.com/abo-abo/hydra/wiki/Twittering
It illustrates one point I don't like about hydras: it makes you write unreadable docstring in the code... this is ridiculous.
There is now a column keyword though so the point above is less a pain point, as I said I may use hydra as backend for microstate, the point is to use the powerful hydra feature but hide the awkward API.

@CestDiego
Copy link
Contributor Author

what could we do then? it may be unreadable but the ^ symbols have to be there for formatting I guess? ... what solution could we implement instead? I think micro-states have the potential to be one of the killer features of spacemacs, :3 but I don't undestand how they work yet :(

@syl20bnr
Copy link
Owner

syl20bnr commented Sep 1, 2015

They work exactly like a hydra, this is the same thing underneath (look for transient maps in Emacs doc).
You wrote several micro-states but you don't know how they work ? :-)

@robbyoconnor
Copy link
Contributor

To be fair, I barely understand emacs lisp :P

On Tuesday, September 1, 2015, Sylvain Benner notifications@github.com
wrote:

They work exactly like a hydra, this is the same thing underneath (look
for transient maps in Emacs doc).
You wrote several micro-states but you don't know how they work ? :-)


Reply to this email directly or view it on GitHub
#2845 (comment).

-Rob

@CestDiego
Copy link
Contributor Author

I'm familiar with the api and way to create ones but I mean the internals...I just look and the macro and hide on the corner scared of the backquotes and @ signs... :( I just read the docstring. I'm working on a hacky way of using micro-states for custom-perspectives, by having the create-custom-persp macro I found save items of the form ("keybinding" . function) into an alist that I will then walk to define the custom-perspectives macro...of course it would be awesome just to put an alist in the micro-states macro and it to recognize it and parse it like:

:bindings
alist-here
"h" foo-bar-function

allis-here being:

'(("l" is-for-the-way-you-look-at-me)
  ("o" is-for-all-the-only-one-I-see))
``
etc etc

@syl20bnr
Copy link
Owner

syl20bnr commented Sep 1, 2015

What do you want to achieve with the perspective micro-state ? Is it something like eyebrowse ?

@CestDiego
Copy link
Contributor Author

@syl20bnr yes, it is working already D:

@CestDiego
Copy link
Contributor Author

see above ^

@syl20bnr
Copy link
Owner

syl20bnr commented Sep 1, 2015

ok so what do you want to do that does not work ?

@CestDiego
Copy link
Contributor Author

Custom perspectives can be defined by the user, this are perspectives that are not from projectile but let's say a perspective that open Rcirc with 4 channels opened. I want all custom perspectives, created with the spacemacs/create-custom-persp macro to be added into a variable, then create a microstate with the custom-perspectives

@syl20bnr
Copy link
Owner

syl20bnr commented Sep 1, 2015

I see, I wonder why you need to differentiate perspecitves and custom perspectives, I don't know perpsective :-)

@syl20bnr
Copy link
Owner

syl20bnr commented Sep 1, 2015

Why not having both in the same micro-state ?

@CestDiego
Copy link
Contributor Author

oh...the perspectives micro-state is for changing between opened perspectives... while custom perspectives create user-defined ones.

@syl20bnr
Copy link
Owner

syl20bnr commented Sep 1, 2015

oh ok, you may consider renaming the micro-state to incorporate a verb then, maybe manage ?

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

branch

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

so

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

everyone

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

can

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

now

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

test

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

it

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

I

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

swapped

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

the bindings

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

for

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

avy-jump-line

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

and

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

perspective micro-state

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

because

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

scopes

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

have

@person808
Copy link
Contributor

MOO

  • Interrupting cow

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

lower case

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

keys

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

thanks @person808 , I was going to hit 300 :-D

Thank you @CestDiego, tremendous work on this one, I hope we will be able to make it the official layout solution for Spacemacs 👍 💜

@syl20bnr syl20bnr closed this Nov 5, 2015
@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

BTW I hope I did not forget any commit, the history was indeed pretty funky :-)

@joehillen
Copy link
Contributor

😂

@dvcrn
Copy link
Contributor

dvcrn commented Nov 5, 2015

screen shot 2015-11-05 at 2 35 45 pm

my inbox exploded

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2015

Oops, I did not think about email spamming... my bad, sorry for this... time to go to bed I guess!

@robbyoconnor
Copy link
Contributor

@syl20bnr this is okay -- Spamming is okay :)

@CestDiego
Copy link
Contributor Author

Thank you all for the work on this branch! :) @cmccloud @TheBB @syl20bnr @person808 and everyone that helped in the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.