unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: 66702@debbugs.gnu.org
Subject: bug#66702: Add easy customization for .dir-locals.el files
Date: Mon, 23 Oct 2023 11:21:44 -0300	[thread overview]
Message-ID: <26133bfe-9782-46eb-b1a0-880fbf7cd48d@gmail.com> (raw)

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.







             reply	other threads:[~2023-10-23 14:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23 14:21 Mauro Aranda [this message]
2023-10-23 14:24 ` bug#66702: Add easy customization for .dir-locals.el files Mauro Aranda
2023-10-23 17:16   ` Juri Linkov
2023-10-23 20:43     ` Mauro Aranda
2023-10-24  6:58       ` Juri Linkov
2023-10-24  9:45         ` Mauro Aranda
2023-10-25  6:48           ` Juri Linkov
2023-10-27 11:06             ` Mauro Aranda
2023-10-28 17:02   ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26133bfe-9782-46eb-b1a0-880fbf7cd48d@gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=66702@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).