Following https://lists.gnu.org/archive/html/emacs-devel/2018-12/msg00446.html here's the patch that implement this feature: