rejeep / prodigy.el

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

Highlight services for given output #3

Closed magnars closed 10 years ago

magnars commented 10 years ago

Hi Johan. What an excellent idea! :) It's like something I always wanted, but didn't know until you made it.

Some of the services I use will fail, but not let go of the process. So I have to $ into each of them when started to see if they've failed or not.

Maybe I could specify a regexp - and when that regexp is matched in the process buffer, it would be highlighted in the *prodigy* list buffer?

Or maybe even:

(prodigy-define-service
  :name "my-service"
  :match-actions '("Error starting" :highlight
                   "Exception" :popwin
                   "Can't find file" :restart))

If that second idea brings this over the top, I would be happy just with the first one. :)

rejeep commented 10 years ago

I'm not sure I understand the use case? If the process fails, that process state should still show, right?

magnars commented 10 years ago

It doesn't fail. It doesn't end. It just hangs there with an error in the log.

magnars commented 10 years ago

The exception case is useful too - in that I want to know if one of my services is in trouble.

rejeep commented 10 years ago

Ok, that sucks :)

I guess we are looking at hooks or events then. And an easy way to make custom modifications to a service line.

Cant think of a lot of other use cases for this right now, but I'm pretty sure there are some that I'll find out about when I start using this for real.

rejeep commented 10 years ago

@magnars What about this API:

(prodigy-define-service
  :name "Rails Project"
  :cwd "~/Code/rails-project"
  :command "bundle"
  :args '("exec" "rails" "server" "--port" "3001")
  :tags '(rails)
  :on-output (lambda (service output)
               (when (s-contains? "RunTimeException" output)
                 (growl "Rails project exception" output))))
magnars commented 10 years ago

Looking good. Could I get the service as well, and set its status?

rejeep commented 10 years ago

Added service above. To set the status, I think prodigy has to expose a function for this, but I guess that makes sense anyway.

magnars commented 10 years ago

Looks excellent to me. Ref my latest comment on #28, I think this is all that is needed for that one too.

rejeep commented 10 years ago

Fixed in https://github.com/rejeep/prodigy.el/commit/e8427f464c006cbbbe6a939125555ab3d4f255b5. Will be released in version 0.3.

magnars commented 10 years ago

Nice!