wasamasa / eyebrowse

A simple-minded way of managing window configs in emacs
GNU General Public License v3.0
437 stars 24 forks source link

Feature Request: Create new slot on non-matching input to `eyebrowse-switch-to-window-config` #58

Closed braham-snyder closed 7 years ago

braham-snyder commented 7 years ago

It might be convenient to make eyebrowse-switch-to-window-config behave as find-file and persp-switch do, such that input not matching an existing slot creates such a slot (named by the given input).

wasamasa commented 7 years ago

This was a tad harder than expected. Thanks for bringing this to my attention!

braham-snyder commented 7 years ago

That was quick--thanks for implementing it! That said, I realize now that I misunderstood your earlier comment regarding "slot" vs. "tag". I was actually envisioning being able to input a non-matching tag to create a new slot named with said tag. If you're not interested, I may or may not attempt implementing that at some point. Thanks again!

wasamasa commented 7 years ago

I don't see a clean way of implementing this. How would you figure out both the slot and tag from reading in arbitrary user input? Would you impose an extra convention that's different from the way a workspace is rendered in the modeline indicator? Would you reuse it (and write a parser operating on format strings) and force the user to type it out exactly the same way?

Given these questions, it doesn't seem worth to me to go any further than reading in a slot and rejecting anything not looking like one.

braham-snyder commented 7 years ago

Why couldn't we just use eyebrowse-create-window-config (or similar) to create a window configuration in some unoccupied slot (whenever the input doesn't match any existing tag or slot, or if the user uses ivy-immediate-done or similar)? I feel like I'm missing something, but I don't know what.

wasamasa commented 7 years ago

I'm sorry, but that solution breaks entirely with what eyebrowse-switch-to-window-config is supposed to do. If it normally expects a slot and accepts a yet unknown slot, why would entering something else create an unoccupied one and tag it? What does justify that unexpected behavior if one could create a new window config with eyebrowse-create-window-config and tag it afterwards? Combining these into what eyebrowse-switch-to-window-config can do just seems too magic to me.

braham-snyder commented 7 years ago

My apologies, the thought crossed my mind after your initial comment regarding slots vs. tags (in the other thread) that Spacemacs and/or ivy might be allowing eyebrowse-switch-to-window-config to magically match tags (as well as slots), but after briefly looking at the code I mistakenly thought that was quite unlikely (which, of course, illustrates one of the drawbacks of such magic).

I ought to more readily retest functionality I'm unsure of with emacs -q--sorry about that.