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: Sun, 16 Oct 2022 09:38:48 -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> <875ygk2lzz.fsf@gnus.org> 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="39429"; 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, Philip Kaludercic , Stefan Kangas , Robert Pluim , Juri Linkov To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 16 15:44:18 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 1ok3wA-000A1d-46 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Oct 2022 15:44:18 +0200 Original-Received: from localhost ([::1]:44712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ok3w8-00026O-Gu for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Oct 2022 09:44:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ok3s4-0005q3-3i for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2022 09:40:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ok3s3-0002hK-1I for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2022 09:40:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ok3s2-0001zB-Gm for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2022 09:40: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: Sun, 16 Oct 2022 13:40: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.16659275477551 (code B ref 58506); Sun, 16 Oct 2022 13:40:02 +0000 Original-Received: (at 58506) by debbugs.gnu.org; 16 Oct 2022 13:39:07 +0000 Original-Received: from localhost ([127.0.0.1]:43694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok3r9-0001xj-55 for submit@debbugs.gnu.org; Sun, 16 Oct 2022 09:39:07 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:9462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok3r0-0001x3-5R for 58506@debbugs.gnu.org; Sun, 16 Oct 2022 09:39:06 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 72A8B4408B6; Sun, 16 Oct 2022 09:38:52 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D604F440897; Sun, 16 Oct 2022 09:38:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1665927530; bh=SNmtsjamp8mtABTA21cDkQkZWsnQ+Ie0b5bOUjsjwNM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=GdFOKg0GSxul5TCdHwfVBA3Hp0NHCnbBDc4TxSjip15ow/7gr52Yr8uiwrQsz4J4i I/q2W6KlYdN8l/ZENTR1NZEzzObhTkdAC/P/dVyGFn7UiBtN9YKs1S3NZiVOOnhSem teHLrMB3//sChgOVS9umhWgHrWnWjLvAQaMfgfx8tGJkMmSt0Ijzh38Fk+M+skEqvC 8iEnpRHg+9FwZkXc69I1FpNX7t/yCZo372sFqTexjak10+mmbm92q574l2ni+JVITU M+eOFPx/lOE3yWwh6wyNDtwcEUC7oOcr5FAxFSInLBqDfI/QRAyuwBo0X/6Jp/+EQ9 iYY1dhpyDXg1Q== Original-Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9047412047D; Sun, 16 Oct 2022 09:38:50 -0400 (EDT) In-Reply-To: <875ygk2lzz.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 16 Oct 2022 10:47:28 +0200") 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:245647 Archived-At: >> [ I dropped the "set-early" because I still haven't heard any good >> reason why we'd need that nor what that would really mean (e.g. how it >> could be implemented). ] > > Some major modes react to variables to change how they work. So > you'd say > > (setq org-thingamabob-syntax-version 2) > (org-thingamabob-mode) We've been solving this problem for the last 30 years without introducing a new kind of "set before mode", so I don't understand your example. If `org-thingamabob-mode` is a major mode, then it starts with `kill-all-local-variables`, so either you mark `org-thingamabob-syntax-version` as persistent-local or you're screwed from the outset (you can try some convoluted hack using `change-major-mode-hook` but it's gonna be ugly). OTOH using `:after-hook` or `hack-local-variables-hook` works right now without very much effort. > And this has to be set before the mode is called, because the mode is > very expensive and re-interpreting the file afterwards is ungood. So: delay the expensive part. It's usually pretty easy, and most of the time it's a good idea for all kinds of other reasons. >>> `safep' would have to be a bit adjusted -- a `safep' for `odd-list' >>> would be (cl-every #'oddp) etc. >> Sorry, I don't know what problem you're alluding to. >> Why would `safep` need to be adjusted? > It's not necessary, but it'd be nice to be able to say "this element is > safe to add to the list" instead of saying "after adding this element to > the list, the resulting list is safe". Ah, I see. My intuition is YAGNI but I haven't thought too much about it. Stefan