From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#57003: 28.1.90; Can local variables be loaded before loading major mode? Date: Fri, 05 Aug 2022 19:44:16 +0800 Message-ID: <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="35886"; mail-complaints-to="usenet@ciao.gmane.io" To: 57003@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 05 13:49:45 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 1oJvpo-00096o-Ui for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Aug 2022 13:49:44 +0200 Original-Received: from localhost ([::1]:55014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJvpn-0003K7-Kn for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Aug 2022 07:49:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJvkI-0007rx-SG for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 07:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJvkI-0006Ys-Gj for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 07:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJvkI-00051b-CM for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 07:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Aug 2022 11:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57003 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.165969979819233 (code B ref -1); Fri, 05 Aug 2022 11:44:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Aug 2022 11:43:18 +0000 Original-Received: from localhost ([127.0.0.1]:56395 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJvjZ-000508-VI for submit@debbugs.gnu.org; Fri, 05 Aug 2022 07:43:18 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:35768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJvjY-0004zw-2M for submit@debbugs.gnu.org; Fri, 05 Aug 2022 07:43:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJvjX-0006sM-Ts for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 07:43:15 -0400 Original-Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:36752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJvjW-0006Sn-7f for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 07:43:15 -0400 Original-Received: by mail-pl1-x636.google.com with SMTP id x10so2420797plb.3 for ; Fri, 05 Aug 2022 04:43:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=YQ7YPZX3C6ss7FMbM3Vn/+mIybAnf7cqTQ67r4V2/vc=; b=VyKXLuyQu7RyfMs5PSZ7KjNBwMbrSeFa0n7KMdjR9/ubxCg18qRTY3H9+Y4P15ploE MGeIApD+BTtbBmkbCTtzBHT2KfiSFq7qzmghn5aP2F5XI2p7qI+D5PzsH7zAWOhMFEtr POXoz9EsPpQEvzx60YlhArCPyLO0YBKN5EssyzB8OgSl1v7u54ewhmqfVDKlZnAUvCYy d/b/SB0ATC0i9q18oqPx1IHnzZs8AXN4YI74Jpc7xy+F71bYp8amd3lyPXT7MTw6KAZo MyZ3v3gv8UcDkGDW0ttmwLSpvetuhG6UzwD9maPH1FiLS3AZzTSnr+onsdpA3nz5rXBs BFnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=YQ7YPZX3C6ss7FMbM3Vn/+mIybAnf7cqTQ67r4V2/vc=; b=AwmnuzGJFC4UHB61+4B96fdq0mgTW7WLOaM4QaS+pb+WkYTuu9n68PfxUH4Hj8eFEU tmUoalYb3jE+EDS0vEKofEYKxglOr7mycxHc4FOMXfuenaANtqj7mA/CBGNX9sA7kGoA izEKVCPKcRe7MT11aLpCbmkHdPemCHoBelICdiXiq98oSRhbn0Xr4XP8/63uIc44isaS gKf0NH2qzJIhW/76kEh2rgCZB7qyfIWmaVh/1LuN6fcxrz8XkPZ+aKuhioK7wdmtPVTH HP1XDdujwdQeyxkN2ItIeRUHNQ96RXCmmx7/mGOU0PkEmPIYShUc3XbfsqR8aJI0pAjR Xnqg== X-Gm-Message-State: ACgBeo1Qd54j6DODkkFj7KxjbtjJFMNs/319n9hCs1cAh/nBOqmoi7fD rIF+2EeP/GsQVNOtGm/E8NaUQ46/xnw= X-Google-Smtp-Source: AA6agR5F+BsG5GFUR4qgkxnW1UXM1Ojyx0cYTLfe6AcRV1nhK4MvDRSqTt933k761WFVjxndvZZLNw== X-Received: by 2002:a17:902:edc4:b0:16c:d2ef:7fd2 with SMTP id q4-20020a170902edc400b0016cd2ef7fd2mr6432243plk.160.1659699791832; Fri, 05 Aug 2022 04:43:11 -0700 (PDT) Original-Received: from localhost ([2409:8a70:2b5:4040:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id e12-20020a170902784c00b0016d22e6ed57sm2706030pln.293.2022.08.05.04.43.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 04:43:11 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=yantar92@gmail.com; helo=mail-pl1-x636.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.bugs:238867 Archived-At: Hi, 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 Currently, Elisp allows manual loading of file-local variables via `hack-local-variables'. However, this function itself is too forceful, and it is running, e.g. in non-file buffers. Moreover, calling `hack-local-variables' does not prevent its subsequent call after Org mode is loaded, which sometimes causes double unsafe variable prompts. See https://list.orgmode.org/87r11wkmew.fsf@ucl.ac.uk/T/#mab6359ed2107d5515c6bb6b266551f0c5049ceca Would it be possible in Emacs to implement a function or possibly major-mode option that will make Emacs load local variables before loading major mode, not after? Best, Ihor