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#66702: Add easy customization for .dir-locals.el files Date: Mon, 23 Oct 2023 11:21:44 -0300 Message-ID: <26133bfe-9782-46eb-b1a0-880fbf7cd48d@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="21075"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 66702@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 23 16:22:50 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 1quvpS-0005F9-0E for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Oct 2023 16:22:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quvpC-0001Sa-KE; Mon, 23 Oct 2023 10:22:34 -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 1quvpB-0001R7-7O for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 10:22:33 -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 1quvpA-0000Yr-VN for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 10:22:32 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quvpd-0002kw-UB for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 10:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Oct 2023 14:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66702 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.169807095010551 (code B ref -1); Mon, 23 Oct 2023 14:23:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Oct 2023 14:22:30 +0000 Original-Received: from localhost ([127.0.0.1]:51260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quvp8-0002k6-6L for submit@debbugs.gnu.org; Mon, 23 Oct 2023 10:22:30 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:45596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quvp5-0002js-TI for submit@debbugs.gnu.org; Mon, 23 Oct 2023 10:22:29 -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 1quvoX-0001I2-2n for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 10:21:53 -0400 Original-Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quvoV-0000Ra-HJ for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 10:21:52 -0400 Original-Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6b6f4c118b7so2666270b3a.0 for ; Mon, 23 Oct 2023 07:21:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698070908; x=1698675708; 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=VB36PvlfOphHgVKQOb5p/l73TLGhpkYrJmsxPONLEpg=; b=EeTk/ANhYCw57iBqutmnPY3exGupSiZeh+aFew1571pWPilKvYQqNjJREH0opGSTZz MZw+KaNaxvJpp3AzeVtyWuryauPs9JUeZJPoM7OlrcXHWzO9mC5j3ixKZ2FY0vozlgO4 BrfRt5l0feKi8CyxAvUTgOM0PCxZ/lMBeJLIjAV6WQYokPW8kZ8RWbeUUJjaaAb4G7TL ZY30snT4PaRKSCOLZdq6LCbp2VwmYnNlkueHRp4NThFWLGU0bHJaufksHU1q4js17DWg VB9kp5SZc43Xq4at8+f0estkxuWqPBpxQsCJ//wJrBZ60OFG/1UL1fWfHOnU/F2gZNxd 6Zyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698070908; x=1698675708; 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=VB36PvlfOphHgVKQOb5p/l73TLGhpkYrJmsxPONLEpg=; b=A2Eesfw/ydKRx40b2nmKMTJd07RheCdEOE3RayjH3cPZHI8o/GM0qwz5PhdLg5nMLY k7DHDdGqeq7lR6q8BWobaSGQL4ka2wkwfw6LL9fupCQ7xbaY0soScrx10FIUOG0JVsei W3CuQRyHWu7O3BGMt6d74VWHFPAMhun1aDOtqiNx/ahOMYlyIdcZnM9m/QhwGNedSB6Q vXVGJ6butzXtV4iX23Hy4yGAgIIkR4/qU0Q4Jap10ItEXflUu6qwhryLbT6hUX0soosa NHDBaZB6Ejb6vP9NFz7QX/QwdwKpt419GmlCZrLHAOdoQCbTknOlaskiih4hpN1oTLKU ZDXQ== X-Gm-Message-State: AOJu0YwnwWlwk0FsJ8G8+8MED9QV06Ss9C6kCAqXFomePWVsAkHFZ5vO P5vQfGTuaRt0JAyMEpsYm3uf2UvDXRqoHw== X-Google-Smtp-Source: AGHT+IHjyHUCRoutLYcxkKCXOHpU525nAYtdHBRHV/W/nuWdv15LnuMcg3S4X2n5cWAo3M9P4cBr7w== X-Received: by 2002:a05:6a20:7d8a:b0:17d:b929:4bc9 with SMTP id v10-20020a056a207d8a00b0017db9294bc9mr4878993pzj.26.1698070907746; Mon, 23 Oct 2023 07:21:47 -0700 (PDT) Original-Received: from [192.168.0.234] ([152.168.142.156]) by smtp.gmail.com with ESMTPSA id z2-20020aa79f82000000b00692cac7a065sm6135700pfr.151.2023.10.23.07.21.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Oct 2023 07:21:47 -0700 (PDT) Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=maurooaranda@gmail.com; helo=mail-pf1-x430.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:273021 Archived-At: 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.