rejeep / prodigy.el

Manage external services from within Emacs
GNU General Public License v3.0
550 stars 39 forks source link

Add :ready-output option #41

Closed shosti closed 10 years ago

shosti commented 10 years ago

It seems like this:

:on-output (lambda (service output)
               (when (s-matches? "Ready!" output)
                 (prodigy-set-status service 'ready)))

is a pretty common pattern. It would be easier to do something like:

:ready-ouput "Ready!"

instead.

rejeep commented 10 years ago

Yes, I agree, that would be nice. Are you up for implementing it?

shosti commented 10 years ago

Sure, I'll get on it when I get a chance. Quick question--are you pretty set on having the prodigy-define-service options be equivalent to the prodigy-services options? This sort of thing would be much easier to implement with a pre-processor in prodigy-define-service.

rejeep commented 10 years ago

are you pretty set on having the prodigy-define-service options be equivalent to the prodigy-services options?

As long as it doesn't make something really complex I would like to keep it. I don't use it myself, but I know others are. This makes more sense when it is validated using customize, which there is an open issue for. See https://github.com/rejeep/prodigy.el/issues/1

This sort of thing would be much easier to implement with a pre-processor in prodigy-define-service.

Easier, yes. But this particilar feature should be very easy to implement now that we have prodigy-process-on-output-hook. It should be just a matter adding a new function that does the when/set-status thing.

You have good points, but I think the cost is still very low to keep the definer functions "stupid".