unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#66663: 30.0.50; Allow dir locals file selection in *-dir-local-variable functions
@ 2023-10-21 12:08 Mauro Aranda
  2023-10-21 12:16 ` Mauro Aranda
  0 siblings, 1 reply; 8+ messages in thread
From: Mauro Aranda @ 2023-10-21 12:08 UTC (permalink / raw)
  To: 66663

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.






^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-10-22 17:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-21 12:08 bug#66663: 30.0.50; Allow dir locals file selection in *-dir-local-variable functions Mauro Aranda
2023-10-21 12:16 ` 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

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).