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, 06 Aug 2022 21:35:13 +0800 Message-ID: <875yj5xzou.fsf@localhost> References: <87czdeoqy7.fsf@localhost> <87v8r54j3h.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16753"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57003@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 06 15:35:40 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 1oKJxr-0004CF-O2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Aug 2022 15:35:39 +0200 Original-Received: from localhost ([::1]:58072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oKJxq-0001Yn-Gf for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Aug 2022 09:35:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKJxG-0001VL-Uq for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2022 09:35:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oKJxG-0001jg-MA for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2022 09:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oKJxG-000064-CS for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2022 09:35: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, 06 Aug 2022 13:35: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.1659792860307 (code B ref 57003); Sat, 06 Aug 2022 13:35:02 +0000 Original-Received: (at 57003) by debbugs.gnu.org; 6 Aug 2022 13:34:20 +0000 Original-Received: from localhost ([127.0.0.1]:33079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKJwa-00004r-4T for submit@debbugs.gnu.org; Sat, 06 Aug 2022 09:34:20 -0400 Original-Received: from mail-pg1-f181.google.com ([209.85.215.181]:37646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKJwW-0008WH-Sk for 57003@debbugs.gnu.org; Sat, 06 Aug 2022 09:34:18 -0400 Original-Received: by mail-pg1-f181.google.com with SMTP id bh13so4855186pgb.4 for <57003@debbugs.gnu.org>; Sat, 06 Aug 2022 06:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=WKfar4Yh1Pr+YM4hMIVP4gvneiooKLs0G6dUQRCfEw0=; b=IoY/Cp23aH4cmUTR344l/rdxG12LeyIu9iNjU1maUVeKkZri8anRkxgWWG2qiPDJrD fh6XBx0zaIEmM/6uhL1FfCDAw/4UV3rlXSHNWy751wle3j1omfmQQmh6oHgDzmfNYLwV WICjOLOez03KYb4m8+15sAnD6Zhqo8ZCUVXUrgwkoWDlOSk7NtDXcngp8WvHQ836yzJQ UsTl/4L852DLfwM2p6OV9W4OB9TQfRorTZRxjH0X9NVPqHFGi2WLh01TGy7fSRAwZcYe 4hb8bTaNfi9+8KTPA4/681r3ko8FEZ29zI9j2egZgj/N2P7Ib876nJZg5YPLYvrw5xip sw5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=WKfar4Yh1Pr+YM4hMIVP4gvneiooKLs0G6dUQRCfEw0=; b=UE+vF8IZ4Z3DLH4YJ8hGyqrktGp8SnKn5BymMnBskwDuLLCEKo/CHuBCkUI+Op9Fn3 VDzvIj8eQKmVUFXvfJdWsLR+0haNQgSuGSY5eA7TEFDNuu7SrgGwFnlagyHSQ1Nt52fQ nmi9FvBOjM+ohgl9udEQw1w/xfHsYtPKJmqzbQ6GuWRTPPNJw76jd16p0Ml6l9EyHvPD 6Oa5oi5r/7ETQOwvUV1aEMLxznnlaElAI2DSzwzQeuBSnPTuZxHVxKCguTZI2Gd1o+Av bPI3S1s9hbhxk5vMQS2KOqp6azw8ZVFVYL+6VGZjLz2xgAiDiDaKO5eg1kKT3RgcSOw2 UsLQ== X-Gm-Message-State: ACgBeo13oftauabv5423ODNtBxdOFD/Wdut79dtyT0XBscRkgH8yImKx pdK3VPDsNCGdeEIoCmHWZ1ndPsCeTYA= X-Google-Smtp-Source: AA6agR6lFYRKEEusJNJNNHCIskG5puhSZmfNUdckO8m3pGoMlyb2ml7PyxAF+2XmRpZbLGS8jMMTTg== X-Received: by 2002:a05:6a00:1949:b0:52d:a742:ff9c with SMTP id s9-20020a056a00194900b0052da742ff9cmr11158251pfk.10.1659792850754; Sat, 06 Aug 2022 06:34:10 -0700 (PDT) Original-Received: from localhost ([2409:8a70:2b5:4040:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id y3-20020aa793c3000000b005289fad1bbesm5173975pff.94.2022.08.06.06.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Aug 2022 06:34:10 -0700 (PDT) In-Reply-To: <87v8r54j3h.fsf@gnus.org> 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:238987 Archived-At: Lars Ingebrigtsen writes: > 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.) No. Let me try to explain a simple case when setting variables before/after loading Org mode matters. 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. There are also less trivial cases like some variables controlling Org parser. For example, we have org-todo-keywords. Its value controls how the headlines are parsed. Because Org parser is initialized during Org loading, setting this variable after loading Org mode can be simply disastrous. Best, Ihor