> Thanks.  Unfortunately, we don't have a test suite for proced.el, so
> non-trivial changes to it always ruin the risk of producing regressions.
> How to test this, and how did you test it?

If it's helpful, I've attached a (seperate) patch containing a test suite (or at least the start of) for proced.el (though some parts are somewhat awkward - mainly testing the proced buffer contains strings we would expect - of course comments on the approach welcome), the last test there: 'proced-refine-with-update-test' fails without the original patch.  I didn't want to conflate the original patch with it, I can open a new report with it if you prefer.

> What happens if that process did exit?  Shouldn't we reset
> proced-refinements to nil?

This could lead to bad behaviour if multiple refinements are active in a buffer, for example if I refine by CPU usage of process A (which makes proced only show processes with usage >= process A's) and then again by the CPU usage of process B, if process A exits, our second refinement is still valid (given process B is still running) eventhough the first isn't.  We could remove the refinement from the list, but it wouldn't change the behaviour.

Thanks, Laurence