It seems, there is no consensus about new variable-definition feature. So I removed it from this patch.
Later I will send a new patch for discussing it.
 
I rebased on the latest emacs-29 and also fixed a test that failed on this branch.
Please find the patch in the attachment.
 
23.12.2023, 12:42, "Eli Zaretskii" <eliz@gnu.org>:
 From: Denis Zubarev <dvzubarev@yandex.ru>
 Cc: Dmitry Gutov <dmitry@gutov.dev>,
         Eli Zaretskii <eliz@gnu.org>,
         "67061@debbugs.gnu.org" <67061@debbugs.gnu.org>
 Date: Sun, 17 Dec 2023 05:07:01 +0300
 
 > Thanks. I think the only thing that’s still up to discussion is the variable-definition rules. Others can
 be merged to emacs-29.
  
 I can extract part with variable-definition into the next patch.
 In case it is ok, I attached patch without new variable-definition feature.


Thanks, but it doesn't apply cleanly to the current emacs-29 branch.
Would you mind please rebasing the patch on the emacs-29 branch and
resubmitting it?