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: Sat, 29 Oct 2022 06:24:43 +0000 Message-ID: <87h6zni1uc.fsf@localhost> References: <87czdeoqy7.fsf@localhost> <87v8r54j3h.fsf@gnus.org> <875yj5xzou.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="35014"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , 57003@debbugs.gnu.org, Ihor Radchenko To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 29 08:25:17 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 1oofHR-0008vL-6f for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 Oct 2022 08:25:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oofHF-0000jN-Q4; Sat, 29 Oct 2022 02:25:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oofHD-0000cZ-Ay for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 02:25:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oofHC-0007jB-Ra for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 02:25:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oofHC-0002OI-4a for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 02:25: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: Sat, 29 Oct 2022 06:25: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.16670246529115 (code B ref 57003); Sat, 29 Oct 2022 06:25:02 +0000 Original-Received: (at 57003) by debbugs.gnu.org; 29 Oct 2022 06:24:12 +0000 Original-Received: from localhost ([127.0.0.1]:34815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oofGN-0002Mx-Rn for submit@debbugs.gnu.org; Sat, 29 Oct 2022 02:24:12 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:58349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oofGL-0002Mg-Ck for 57003@debbugs.gnu.org; Sat, 29 Oct 2022 02:24:10 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6F388240103 for <57003@debbugs.gnu.org>; Sat, 29 Oct 2022 08:24:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1667024643; bh=/mCSV7bcN/pXy22yBsZ3uU4j1x5TI6HzLs1zC3qb5zU=; h=From:To:Cc:Subject:Date:From; b=lPd61DPqxhG4Jx+98+mGDfRPh4D4euHHjOIs83OKl9wjYCpSkk9y269tLigCH3Mal TW+IGosAfuH+V+yFci3ASl7/RT1cbD4YC5sYRjivZoVGumrEBOBj9iAxzsKN1DUCko nuHV+erprf0XFmaBD5TUzYJGNG3eOGHN3RxxTdxO7Szz7S12+giIu5TNJuWMJsPBBS fJF4u3h3nOS9LqMbCjFTv7MOIGm0oJHUyaCMf0cjiNwvLGwWlZizQXTp+gTLrtz5n7 3Vy1hFF/RgcmS5s8eQvoaEzeqrYpFhYytaa9jPFYHh/PymN0kNc9SZT9ycW05JprG+ UMp4bF4wSFj4A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MzqB82cP3z6tmM; Sat, 29 Oct 2022 08:23:59 +0200 (CEST) In-Reply-To: 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246486 Archived-At: Stefan Monnier writes: > 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. I guess that it can be an option. Though such hook will also need to be guarded against repetitive execution (if `hack-local-variables' is called by some minor mode or a command). However, pretty much all the BODY in Org major mode definition will need to go into the hook. It feels awkward. Will moving the whole major mode definition into `hack-local-variables-hook' be safe? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at