[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist
From: |
Juri Linkov |
Subject: |
bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist |
Date: |
Tue, 18 Oct 2022 10:28:27 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) |
> 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.
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. And display-buffer-alist's
ACTION alist already looks like dir-locals's alist.
> 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.
Then for backwards-compatibility dir-locals could support both
the current dotted pairs and new :keyword syntax, where unrecognized
keywords are simply ignored in older versions.
Also should file-local variables support the same :keyword syntax?
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist, (continued)
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist, Stefan Monnier, 2022/10/15
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist, Lars Ingebrigtsen, 2022/10/16
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist, Stefan Kangas, 2022/10/15
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist, Stefan Monnier, 2022/10/15
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist, Lars Ingebrigtsen, 2022/10/16
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist, Philip Kaludercic, 2022/10/16
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist, Lars Ingebrigtsen, 2022/10/16
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist, Stefan Monnier, 2022/10/16
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist, Lars Ingebrigtsen, 2022/10/16
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist, Stefan Monnier, 2022/10/18
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist,
Juri Linkov <=
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist, Stefan Monnier, 2022/10/18
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist, Stefan Monnier, 2022/10/14
- bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist, Philip Kaludercic, 2022/10/14
- bug#58486: [PATCH] Prevent .dir-locals.el from being byte-compiled, Stefan Monnier, 2022/10/14
- bug#58486: [PATCH] Prevent .dir-locals.el from being byte-compiled, Juri Linkov, 2022/10/15
- bug#58486: [PATCH] Prevent .dir-locals.el from being byte-compiled, Stefan Monnier, 2022/10/16
bug#58486: [PATCH] Prevent .dir-locals.el from being byte-compiled, Lars Ingebrigtsen, 2022/10/13