From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs 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 Message-ID: <03e5c99d-f900-4c8f-88b3-e7b458c0c777@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8740"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 66663@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 21 14:10:27 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1quAoF-00024M-3F for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Oct 2023 14:10:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quAnn-0005sE-W9; Sat, 21 Oct 2023 08:10:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quAnP-0005cK-2D for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 08:09:36 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quAnO-0001pF-Qh for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 08:09:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quAnq-00010M-79 for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 08:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Oct 2023 12:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66663 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16978901653786 (code B ref -1); Sat, 21 Oct 2023 12:10:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Oct 2023 12:09:25 +0000 Original-Received: from localhost ([127.0.0.1]:42463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quAmz-0000ye-Oj for submit@debbugs.gnu.org; Sat, 21 Oct 2023 08:09:24 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:45534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quAmu-0000xx-BE for submit@debbugs.gnu.org; Sat, 21 Oct 2023 08:09:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quAmL-0002eJ-8K for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 08:08:29 -0400 Original-Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quAmI-0001QF-RO for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 08:08:28 -0400 Original-Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6b36e1fcee9so1546282b3a.3 for ; Sat, 21 Oct 2023 05:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697890104; x=1698494904; darn=gnu.org; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=pozP2tJAfMs80N++Clh/HWcZEy89MvLX4TwuLEoMbwg=; b=OcRz+K70n8LussBmGHGLl5+OSHmvb144tBD8V2/koHSKUUB15AJFlK+ApQJtKvTdvL qmYbXH9fv9UpxaBYmwKO2xfrk1+lt9WMpl1wxFbHYi4ZE6cBWqeCIO8Bi7skzV8XxcGl gIxRyLTTpXZs3sfnUra7bqDyIyW9r+KEgPFrrDdz7IaDmLVX6OeienOhGvALrwB3Oghr s1qVqAMgAyFy90LBe3xOChBlR6qQvw76VUSEP4agZGy3+p9rRuDCyR3wcWbUpwMY8Nw3 4IapL+lJue/Z9HZuHimsRMo5j5fUKhWmrw2rNWoHDjkRglh5Wbhn+/KW/GFZe7KeHg7H 7dkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697890104; x=1698494904; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=pozP2tJAfMs80N++Clh/HWcZEy89MvLX4TwuLEoMbwg=; b=Q7yH7np+sQsKkdPL4LXliqIkZ+Vb2JSr6wbTc3R4f+gpzHG6MprXfil/5cgyCU7L34 jMS+W3jIUhH4whEgpCHt31OgY2aLDlozUAfF/8Nn+HxcHow2KrOX1onXhWWxJRk/K5JT XBljiNMnJkVsIvRocyMH1e/sPC5tpf9JEpE3fB+lim8TW1Q3dHq65yUxnGlbBEz+Yzfk 4V3TOOv1thfcaK+K4aeUUSsz01yqp40vkrksd1IZmaS+7KyGGDsgC/qGCogJFQx9xW0g G4egJqSZsgMw38KOcHeLj4Pmojl+AAxeqveFLt7xXyWjTjq9OdDI26rW9CLLpl750eT2 z/wA== X-Gm-Message-State: AOJu0YwmRotjranT2hWbXeuWNm4/IcYuOph+T+TGZ2Vc9O+m/0B67JGO qKsJ6vRPKg7vlxqGrp0OtMnfrLNIMCIpxgBd X-Google-Smtp-Source: AGHT+IEZGfULhwIxoJQAqsrfZaTimrM0V0dRWdOj+ns33kSrcJyG90XSQSuj0uRjp7oI55IJggki9A== X-Received: by 2002:aa7:988c:0:b0:6b5:ec98:427d with SMTP id r12-20020aa7988c000000b006b5ec98427dmr3239346pfl.17.1697890104362; Sat, 21 Oct 2023 05:08:24 -0700 (PDT) Original-Received: from [192.168.0.234] ([152.168.142.156]) by smtp.gmail.com with ESMTPSA id f125-20020a625183000000b0065a1b05193asm3281972pfb.185.2023.10.21.05.08.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 21 Oct 2023 05:08:23 -0700 (PDT) Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=maurooaranda@gmail.com; helo=mail-pf1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272881 Archived-At: 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.