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: Tue, 09 Aug 2022 19:29:49 +0800 Message-ID: <871qtp64eq.fsf@localhost> References: <87czdeoqy7.fsf@localhost> <87v8r54j3h.fsf@gnus.org> <875yj5xzou.fsf@localhost> <875yj443zy.fsf@gnus.org> <874jyo6vd6.fsf@localhost> <87k07k18ro.fsf@gnus.org> <871qts6tzy.fsf@localhost> <87bksv0ya6.fsf@gnus.org> <87edxqzzm6.fsf@localhost> <87leryzzdl.fsf@gnus.org> <87a68ezycj.fsf@localhost> <875yj2zudw.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="38072"; 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 Tue Aug 09 13:29:29 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 1oLNQO-0009fc-Vq for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Aug 2022 13:29:29 +0200 Original-Received: from localhost ([::1]:45924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLNQN-0002Dt-Hq for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Aug 2022 07:29:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLNPy-0002D1-Oi for bug-gnu-emacs@gnu.org; Tue, 09 Aug 2022 07:29:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oLNPy-0004Um-Fb for bug-gnu-emacs@gnu.org; Tue, 09 Aug 2022 07:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oLNPy-00086E-6w for bug-gnu-emacs@gnu.org; Tue, 09 Aug 2022 07:29: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: Tue, 09 Aug 2022 11:29: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.166004453831125 (code B ref 57003); Tue, 09 Aug 2022 11:29:02 +0000 Original-Received: (at 57003) by debbugs.gnu.org; 9 Aug 2022 11:28:58 +0000 Original-Received: from localhost ([127.0.0.1]:42715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLNPu-00085w-HU for submit@debbugs.gnu.org; Tue, 09 Aug 2022 07:28:58 -0400 Original-Received: from mail-pf1-f173.google.com ([209.85.210.173]:38785) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLNPq-00085g-GA for 57003@debbugs.gnu.org; Tue, 09 Aug 2022 07:28:55 -0400 Original-Received: by mail-pf1-f173.google.com with SMTP id d20so10514465pfq.5 for <57003@debbugs.gnu.org>; Tue, 09 Aug 2022 04:28:54 -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=zZcOjXB7qM+AJo/c9TixJqyazkfjzj2G95PUNe6H9Co=; b=CRPFh8jHzhJvD7Qo/bMk7nIhHzAAEoPfhnYZRy7c7NpksZqUJ4xzjLgy260BV8QeD9 jMdTzFZUdfZ9e5kEe5rrMh6iTebhxsUolveOq5c+jII15HRXGUCwmDTWOkKtuaso4pm8 BqJwOI1/oIXoeqDlDv4Gd1XbZO1xPQiRyTj+22UqH4H7sQXaR2Z8aAqvHbiGduFB5MQI sfROqtaACDUYRtg4XgHjYZzrPgDDOV9BgNLp/tFMpfC+dzv5WfT7a7HoCQqPa1CWMmpG y7trnwFP5pFcvNK+Vn8WZIS250OpGFF+C12lAXdmCACEqaGeG/SQeRWvtXJduJkS7GuQ fAnw== 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=zZcOjXB7qM+AJo/c9TixJqyazkfjzj2G95PUNe6H9Co=; b=daQDcvzepz3WTgXPeO3qFO/nH/C/h/rCxWfvLlPvb8F16NJCzHMqptmoanmOj/YBs4 FHr68h5ELHeufd2Ldqdm4RK0RNo3H03bJ2jx5J+y1dR4US8lOpqtIsDXSJYrw/d3ZuYe cvYu163P1mMKVUUQp0kSU2rkAHEyE8bYPLoVfdEbzOb2jRpAcEt8n8RQWlWY7OcwOWIT yG7Vh67VW1L/IqjtOvFe04XpUcexj0vKPA9pQ4xTIwX+md7ojW2FAYnkkPdeIdfA9ySP FDB3uNMLat3Q8E4fQs3UoyN1DBAXVZDN6xUtXn4AC1w+aT9tY1cBMD6j2pehRuZyM7CZ CUpw== X-Gm-Message-State: ACgBeo3zg54sp53Fb5mNvLjWqMLE9Pb+iFJojBfsUOsqb+gN54VdvNOo I/UnTr7ctLdmSXTTfNTorCSrfHCT8cQ= X-Google-Smtp-Source: AA6agR6Gy72ykncsrt05+Smd7QqesPl2e1EpPKI3CRuSLryxCH94mVA4XiRnF+SQyMD2r+uJWjpPvA== X-Received: by 2002:a63:6a05:0:b0:41d:ba0a:6fe5 with SMTP id f5-20020a636a05000000b0041dba0a6fe5mr4133757pgc.306.1660044528355; Tue, 09 Aug 2022 04:28:48 -0700 (PDT) Original-Received: from localhost ([2409:8a70:2bf:80b0:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id f4-20020a170902ce8400b0016cd74dae66sm10787556plg.28.2022.08.09.04.28.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 04:28:47 -0700 (PDT) In-Reply-To: <875yj2zudw.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:239146 Archived-At: Lars Ingebrigtsen writes: > Sorry, phrased that all wrong -- I meant that if we had a mechanism to > read the dir-locals earlier, then if you make the variables > permanently-local, then things would indeed work fine without any > further scaffolding here. > > So perhaps we should just allow that, but I'm not sure how we'd specify > this. I am not sure what you mean by earlier. The first thing executed when activating a major-mode is (according to define-derived-mode) kill-all-local-variables which consist of run_hook (Qchange_major_mode_hook); reset_buffer_local_variables (current_buffer, 0); bset_update_mode_line (current_buffer); Having 'permanent-local variables will only affect change-major-mode-hook. I know no other hook ran earlier. Why not instead add something that is run _after_ kill-all-local-variables? Then, there will be no need to fiddle with 'permanently-local (which might have undesired side effects). Best, Ihor