wasamasa / eyebrowse

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

create new slot with the given name if none exists #67

Closed blaenk closed 7 years ago

blaenk commented 7 years ago

I like the eyebrowse-switch-to-window-config function and I looked at the eyebrowse--read-slot function which it uses and noticed the docstring said this:

If no match was found, the user input is interpreted as a new
slot to switch to.

I'm sure I'm misunderstanding this, as I took it to mean that if I type my own choice which doesn't match any of the candidates, then it would create a new slot at the end, with the tag set to what I typed. I've tried this though and it doesn't seem to happen. It would be nice if it did, I think it would be very ergonomic/logical behavior.

wasamasa commented 7 years ago

Slots are numbers. If you have slots 1 and 2, use M-x eyebrowse-switch-to-window-config and enter "3", it correctly switches to slot 3, creating it in the process. Similarly, switching to "4 - Foo" would extract the number from it and use that as the slot, however there is no extraction of the tag or anything else of that kind going on, simply because for that you'd need to write a parser that works on the basis of a (user-customizable) format string and I didn't want to spend way more time on implementing the basic feature than needed. Last time I've checked, nothing of the things eyebrowse imitates does that, so I don't see a big need for it either, it's just a nice-to-have. If you do, knock yourself out and present me a PR without extra dependencies.

blaenk commented 7 years ago

Ah I see how it's intended to work now then. I feel like that functionality is a bit redundant with the numbered-binds that one most likely has which AFAIK (still new to this) do the same thing. It makes more sense to me that if the user is allowed to type any arbitrary thing that doesn't necessarily match any of the candidates, then it implies that eyebrowse is able to do something with that input, which to me it would make sense if it would make a new slot with that input as its tag.

It's no big deal, it's just what I was imagining. Indeed it would be a nice-to-have, to be able to create a new slot with a user-named tag in one go. I suppose it's something I can just write myself.