Subject: bug#66702: Add easy customization for .dir-locals.el files

From: Mauro Aranda <[email-masked]>
Date: Tue, 24 Oct 2023 06:45:04 -0300

On 24/10/23 03:58, Juri Linkov wrote:
 >>> I tried it out on emacs/.dir-locals.el, and one thing that I 
noticed is that
 >>> it changes the order of modes by sorting them alphabetically.  I'm sure
 >>> people won't like if their files will get so much changes especially
 >>> when they intend to commit a change in a single value.
 >>
 >> That's modify-dir-local-variable doing the sorting.
 >>
 >> You get the same results by doing:
 >> emacs -Q
 >> M-x add-dir-local-variable RET nil RET foo RET t
 >> M-x diff-buffer-with-file RET RET
 >>
 >> Should we add a nosort option somewhere?
 >
 > The assumption was that .dir-locals.el will always be modified
 > by these commands.  But since it's often modified manually
 > with an arbitrary order, this means that the sorting order
 > is not important.  So we could simply remove the sorting code.

Hmm, but that would be backward incompatible.  Someone out there might
be relying in these commands to keep the settings sorted.

 > PS: This is not directly related to your current patch that I believe
 > is ready to be installed if no one will have more comments.

Great.  Thank you!