unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: 66663@debbugs.gnu.org
Subject: bug#66663: 30.0.50; Allow dir locals file selection in *-dir-local-variable functions
Date: Sat, 21 Oct 2023 09:08:21 -0300	[thread overview]
Message-ID: <03e5c99d-f900-4c8f-88b3-e7b458c0c777@gmail.com> (raw)

Severity: wishlist

This is a feature request, which is a part of trying to land an Easy
Customization interface to editing dir locals files:
https://lists.gnu.org/archive/html/emacs-devel/2023-09/msg01306.html

The need is to be able to specify the file to modify, so that the
.dir-locals.el or .dir-locals-2.el can be customized. Currently, the
situation is:

emacs -Q
Go to a directory without a .dir-locals.el file
Use add-directory-local-variable to add a variable.  It goes to
.dir-locals.el, which is fine.  But it would be nice if I could select
to add it to .dir-locals-2.el instead.

Similarly, if both .dir-locals.el and .dir-locals-2.el exist, only the
.dir-locals-2.el can be modified with *-dir-local-variables, according
to my testing.  It'd be nice to be able to modify either.

The patch I'll send once I get assigned a Bug# is my first approach to
it.  I made the commands take an optional argument, which indicates: "I
want to modify that other file".  The intention is:
With no prefix arg:
- If no dir locals file exists, modify .dir-locals.el
- If one of them exists, modify that one.
- If the two exists, modify .dir-locals-2.el

This is just how today everything works, AFAICT.

With a prefix arg:
- If no dir locals file exists, modify .dir-locals-2.el
- If one of them exists, modify the other one.
- If the two exists, modify .dir-locals.el

Additionally, I made modify-dir-local-variable take a 5th argument,
optional, which can be a boolean or a string (a filename).  The string
use case is to be able to directly specify the file to modify, which is
useful so one doesn't have to check which file exists and which doesn't
(it'll prove useful in the customize code).  I'm not posting the code
for cus-edit.el because some part of the code depends if this proposed
change gets accepted.






             reply	other threads:[~2023-10-21 12:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-21 12:08 Mauro Aranda [this message]
2023-10-21 12:16 ` bug#66663: 30.0.50; Allow dir locals file selection in *-dir-local-variable functions Mauro Aranda
2023-10-21 12:45   ` Eli Zaretskii
2023-10-21 13:49     ` Mauro Aranda
2023-10-21 14:06       ` Mauro Aranda
2023-10-21 18:21         ` Juri Linkov
2023-10-21 22:10           ` Mauro Aranda
2023-10-22 17:55             ` 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=03e5c99d-f900-4c8f-88b3-e7b458c0c777@gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=66663@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).