[sorry if you're getting this twice Stefan, i forgot to cc everyone else] On Thu, Oct 5, 2017 at 2:11 PM, Stefan Monnier wrote: > > >> :sentinel > >> (lambda (p _ev) > > way to do this is to check if 'p' is 'eq' to the buffer-local value of > > clang-flymake--procress. > > While I agree that it should check whether `p` is obsolete (just in case > something went wrong elsewhere), `p` should have been killed when the > other process was launched, I believe the code examples presented here already do that: >> (when (process-live-p gcc--flymake-proc) >> (kill-process gcc--flymake-proc)) > so this sentinel should only be called with an obsolete `p` in response to such a kill. But while a "killed" 'p' is obsolete, the reverse isn't true. When lauching B, the process A might have already have exited cleanly. Hence A it is not live anymore, and can't be killed. But A's sentinel might not have had a chance to run yet. When it does run, A's sentinel must notice that it is obsolete by some means, and checking for eqness seems the easiest (in flymake-proc.el I set an 'obsolete' property in the proc). > BTW, it should also check `ev` in case the event is just that someone > suspended/resumed the background process. That is true. We should come up with a canonic way to launch flymake processes and then either hide that behind an abstraction or document it. João