#1174 looks to be a separate feature. I don't think it's dependent on #1175 from a code standpoint, but it probably needs it to work properly in all situations.
I think #1175 is close to being ready for commit. Pavel, will you produce an updated patch based on our last discussion? I'll set this patch to waiting on author.
I expected so your version was a final. I have no problem to do other enhancing (by me) , but I don't fully understand to your last proposal. Can you specify it more, please?