From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist Date: Tue, 18 Oct 2022 09:25:26 -0400 Message-ID: References: <87sfjsgkl4.fsf@posteo.net> <865ygn4pno.fsf@mail.linkov.net> <87y1tiabq5.fsf@gnus.org> <87czauzhch.fsf@gmail.com> <87k052h1zt.fsf@posteo.net> <87ilkl78cd.fsf@gnus.org> <86h701pp45.fsf@mail.linkov.net> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1625"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 58506@debbugs.gnu.org, Lars Ingebrigtsen , Stefan Kangas , Philip Kaludercic , Robert Pluim To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 18 15:26:23 2022 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 1okmbu-00008y-PF for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Oct 2022 15:26:22 +0200 Original-Received: from localhost ([::1]:46280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okmbt-0008Rf-87 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Oct 2022 09:26:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okmbb-0008Qk-7Z for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2022 09:26:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52505) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1okmba-000492-HD for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2022 09:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1okmba-0004BC-6f for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2022 09:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Oct 2022 13:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58506 X-GNU-PR-Package: emacs Original-Received: via spool by 58506-submit@debbugs.gnu.org id=B58506.166609954016034 (code B ref 58506); Tue, 18 Oct 2022 13:26:02 +0000 Original-Received: (at 58506) by debbugs.gnu.org; 18 Oct 2022 13:25:40 +0000 Original-Received: from localhost ([127.0.0.1]:51582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okmbD-0004AX-VC for submit@debbugs.gnu.org; Tue, 18 Oct 2022 09:25:40 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:47453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okmbA-0004AF-5E for 58506@debbugs.gnu.org; Tue, 18 Oct 2022 09:25:38 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4945F80814; Tue, 18 Oct 2022 09:25:29 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A5BFE805DB; Tue, 18 Oct 2022 09:25:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1666099527; bh=0YCugoi/AtS9uFs1M5mzU/+O/R1pfpnImjapb+9x/Z8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=LULXKwsME6FFdvc9UMty1ZVBhdVNiQsbtZMkKzSaHX0Vr4FUIVPcluktvpXlcv1aJ iCbMOjtMk7+FX+Q9lyF0it+Gv5DblhHj7btkMUo6UMQMyrzHdZze1nBw01Jj9IqMIZ Yy17+mR2tJ9RQ8hiLjJtVp9BkjQVTvcxo3SuuwWYnP55TcXb16L5nigbDYiD5+VQ6N DszBQ9oTQA/0OfkNoCSUbnMx00tbjUZIH1WhhVswzDcr4jAqnPT0X5jEG1yjzjsiWl qXfUPeYEYPyAg7dAgl795lD/2bjKj6N5xBusWPUQovCUODzWiEafuwkroo3D+tWPy5 I9clibFHlpFNw== Original-Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 663EB120F20; Tue, 18 Oct 2022 09:25:27 -0400 (EDT) In-Reply-To: <86h701pp45.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 18 Oct 2022 10:28:27 +0300") 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" Xref: news.gmane.io gmane.emacs.bugs:245793 Archived-At: >> I think the above is better written: >> >> ((nil >> (tab-width . 8) >> (sentence-end-double-space . t) >> (fill-column . 70) >> (emacs-lisp-docstring-fill-column . 65) >> (vc-git-annotate-switches . "-w") >> (bug-reference-url-format . "https://debbugs.gnu.org/%s") >> (diff-add-log-use-relative-names . t)) >> (c-mode >> (c-file-style . "GNU") >> (c-noise-macro-names . ("INLINE" "ATTRIBUTE_NO_SANITIZE_UNDEFINED" "UNINIT" "CALLBACK" "ALIGN_STACK")) >> (electric-quote-comment . nil) >> (electric-quote-string . nil) >> (indent-tabs-mode . t) >> (mode . bug-reference-prog))) > > So the dotted pair notation should be avoided only at the first level. That's one way to look at it. The other is that the dotted syntax doesn't make much sense when what you have after the `.` is always a list. > Then what about making it closer to the syntax of display-buffer-alist rules > where CONDITION is passed to buffer-match-p that can match not only major-mode, > but also a regular expression of a buffer name. No opinion on that. But indeed, it could be useful to specify a kind of local `auto-mode-alist` additions. > >> Maybe something like: >> >> (c-mode >> (:set c-file-style "GNU") >> (:set treesit-thing t) >> (:set odd-list (cons 3 odd-list)) >> (:minor-mode indent-tabs-mode -1) ;; Disable >> (:minor-mode blink-parentheses-mode)) > > The drawback of the current syntax is that `mode` and `eval` > are used like variables, but really are keywords. Using the > keyword syntax `:` will help to resolve this ambiguity. I think that's minor. The fact that it only contains values rather than (safely computable) expressions is the more problematic part. > Also should file-local variables support the same :keyword syntax? I don't think there's as much need for changes there, so I'd rather wait for the dir-locals part to stabilize before trying to see if/how to move it over to file-local variables. Stefan