Here is a version of the patch rebased on top of emacs-26 (the other was for master / 27).