rejeep / prodigy.el

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

Make it possible to control service from its log buffer. #114

Closed Fuco1 closed 5 years ago

Fuco1 commented 6 years ago

Fix #107.

We extend the prodigy-relevant-services to return the "active" service if the selected window is the log window. This makes it seamlessly work with almost all existing functions.

We introduce prodigy-current-service and use it instead of prodigy-service-at-pos when it makes sense (jump-to-magit/directory and similar).

Finally, bind C-c prefix in the view buffer to forward to prodigy-mode-map---this way all the bindings will stay consistent between the list and view buffers.

Gods bless you for having a sensible architecture in place :)

TODO

Fuco1 commented 6 years ago

In the log buffer we extend from view-mode which binds a bunch of keys so they are taken, most notably s and r are used for searching (short for C-s and C-r). I also think prefix makes it a bit safer not to accidentally restart/stop services (and possibly losing state). This is not a problem in the control buffer (I think) because its sole purpose is to manipulate the services so it's expected.

Also having a prefix allows to reuse the map and have the bindings consistent instead of keeping them in sync manually. But I have no strong opinion either way.

rejeep commented 6 years ago

Make sense 👍

narendraj9 commented 5 years ago

Is there a reason that this hasn't been merged yet? I would really like to have this feature.

Fuco1 commented 5 years ago

Hey @narendraj9 I think I still need to write some tests but otherwise it is shippable. You can probably use it in the meantime after rebasing on master.