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#57003: 28.1.90; Can local variables be loaded before loading major mode? Date: Tue, 18 Oct 2022 09:29:40 -0400 Message-ID: References: <87czdeoqy7.fsf@localhost> <87v8r54j3h.fsf@gnus.org> <875yj5xzou.fsf@localhost> 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="28669"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , 57003@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 18 15:31: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 1okmgd-0007AC-KN for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Oct 2022 15:31:15 +0200 Original-Received: from localhost ([::1]:47836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okmgc-0001bQ-45 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Oct 2022 09:31:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okmfT-0001Z5-A8 for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2022 09:30:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1okmfS-0004cK-Ui for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2022 09:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1okmfS-0004HC-Oj for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2022 09:30: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:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57003 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 57003-submit@debbugs.gnu.org id=B57003.166609979016379 (code B ref 57003); Tue, 18 Oct 2022 13:30:02 +0000 Original-Received: (at 57003) by debbugs.gnu.org; 18 Oct 2022 13:29:50 +0000 Original-Received: from localhost ([127.0.0.1]:51594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okmfF-0004G6-PF for submit@debbugs.gnu.org; Tue, 18 Oct 2022 09:29:50 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:42882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okmfE-0004Fu-Ci for 57003@debbugs.gnu.org; Tue, 18 Oct 2022 09:29:48 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id F0E22442868; Tue, 18 Oct 2022 09:29:42 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9C2B9442865; Tue, 18 Oct 2022 09:29:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1666099781; bh=FBY5/dSwzjPHJPOw7VxAu7/Qu5hkUnLKMpCM6XUqFLk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TJWh7PBV9659omPMia07WxmvT1467FUerAmAJnwF5r5aI4u4g7LgYRvLmh87/kXSH uMGdWmgKv9uNhwpbfrFEnh4ewqT+QvDEQrt2rSn70YsN6tgrTGJQUnqPRHzf4iqgP8 roNYd0Nhlv6SdUOJBRDLze/0btKztXJI8ipn0AQiPRBU49gqOHcl2A3wqUMv4ZWKPy 77LqOkcqd88s/YP3zrbCh+G4tMexZlLU31IM005psNy18SBhNKp9CaxzsIjHEbcGIl GsHYNW6PHFLFz6ABaqLPf+JxOC4XRMC+5yYSLuHAbbD3DeR42KRuCP4+qtv3d8EePY Dovmzo1Wsvj3Q== Original-Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 79AB9120F15; Tue, 18 Oct 2022 09:29:41 -0400 (EDT) In-Reply-To: <875yj5xzou.fsf@localhost> (Ihor Radchenko's message of "Sat, 06 Aug 2022 21:35:13 +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:245794 Archived-At: > We have a variable org-startup-folded: > > Non-nil means entering Org mode will switch to OVERVIEW. > > This variable controls the initial state of the Org buffer. > When, non-nil, headings will be folded at the end of Org initialization. > This folding happens inside org-mode specification and hence setting the > variable after Org mode is loaded makes no difference. The problem is not that the variables are set too late,it's that you fold too early: the folding should not to take place from within `org-mode` but instead `org-mode` should add the folding function to `hack-local-variables-hook`. What you request is a common need, and `hack-local-variables-hook` is the standard answer. Stefan