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

From: Mauro Aranda <[email-masked]>
Date: Mon, 23 Oct 2023 11:21:44 -0300

Severity: wishlist

This is a feature request.  The idea is to provide an Easy Customization
interface to editing .dir-locals.el files:
https://lists.gnu.org/archive/html/emacs-devel/2023-09/msg01306.html

Currently, there are two ways of handling .dir-locals.el: either by
hand or by using the *-dir-locals commands.  Using the Customize
interface has, IMO, the following non-exhaustive advantages:
- It's useful for beginners or for people that are used to using the
interface for customizing the init file.
- Validation for defcustom :type, unlike the commands in files-x.el
- Ability to edit multiple settings and then save just once.
- Ability to quickly select the .dir-locals file to edit.

I'll attach a patch once I get assigned a Bug#.  The patch adds a new
command, customize-dirlocals to pop up a buffer with the dirlocals
settings in a .dir-locals.el file.  The file can be changed later on in
the buffer.  Saving, reverting and validating customizations is
supported.  There is also support for the menubar and the toolbar.

There are some differences with the usual Customize buffer.  One is
that, since these customizations don't go to the custom-file, I didn't
reuse all of the functions for creating the Custom buffer, neither I
reuse Custom-mode.  Other one is that there's no "magic" widget, no
information about the STATE of the variable, or the widget.

The most important difference, I think, is that the buffer needs to
update upon each option the user wants to edit.  This is similar to the
situation for the customize-create-theme buffer, but my code follows a
different approach.  It lets the user enter any symbol, and upon hitting
RET or TAB it updates the widget that will hold the value.  The *Custom
Theme* buffer prompts for the variable to edit, so it can add the right
editing widget.