From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#57003: 28.1.90; Can local variables be loaded before loading major mode? Date: Sat, 06 Aug 2022 15:06:26 +0200 Message-ID: <87v8r54j3h.fsf@gnus.org> References: <87czdeoqy7.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7335"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 57003@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 06 15:07:14 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 1oKJWL-0001jj-VS for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Aug 2022 15:07:13 +0200 Original-Received: from localhost ([::1]:49768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oKJWK-0002ra-SC for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Aug 2022 09:07:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKJWA-0002qV-Kw for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2022 09:07:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oKJWA-00063r-CM for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2022 09:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oKJWA-0003Yj-7t for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2022 09:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Aug 2022 13:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57003 X-GNU-PR-Package: emacs Original-Received: via spool by 57003-submit@debbugs.gnu.org id=B57003.165979119813633 (code B ref 57003); Sat, 06 Aug 2022 13:07:02 +0000 Original-Received: (at 57003) by debbugs.gnu.org; 6 Aug 2022 13:06:38 +0000 Original-Received: from localhost ([127.0.0.1]:33028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKJVl-0003Xp-OV for submit@debbugs.gnu.org; Sat, 06 Aug 2022 09:06:38 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:46916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKJVj-0003XX-JZ for 57003@debbugs.gnu.org; Sat, 06 Aug 2022 09:06:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=IgXbeYmwLppiJRrNKBqOfLVJfBMld6ltQpYw7r5xe1U=; b=GNicZfV9k/7O9zLP5JVT9kJaRg 0Izn8RUtQeFrn7M4PkEvrdkeX4ntDFnzs4X59x4xFXxSUYgvfMbkNHvFYLD8GJe8D1SDpaD5R3SCs rKR/kozgN3QtJF/xCXFUt+vDNMKS28pep3YRUfF23yHOUKhrO/fvGZ/jA7iQSk+AAcz8=; Original-Received: from 2.151.51.97.tmi.telenormobil.no ([2.151.51.97] helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oKJVa-00048G-Ug; Sat, 06 Aug 2022 15:06:29 +0200 In-Reply-To: <87czdeoqy7.fsf@localhost> (Ihor Radchenko's message of "Fri, 05 Aug 2022 19:44:16 +0800") 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:238983 Archived-At: Ihor Radchenko writes: > Some user settings in Org mode need to be set before loading the major mode. > Further, some people want to set such settings in individual files > using file-local variables. > > However, Emacs loads file-local variables only _after_ major mode is > being loaded. > As a result, we are getting user requests like > https://list.orgmode.org/587be554-906c-5370-2cf2-f08b14fa58ff@gmail.com/T/#u Is the problem here that there are defvars in the major-mode file being loaded that depend on one another? (I'm not sure I understand the explanation in that bug report.) If that's the case, then this is inherently fragile, since the user may have already loaded the .el file otherwise. So visiting files in a different order will lead to other results, and eval-ing local variables before loading the files won't really help, in general.