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: Wed, 17 Aug 2022 18:08:56 +0800 Message-ID: <87wnb7yyfb.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> <871qtp64eq.fsf@localhost> <878rntskld.fsf@gnus.org> <877d3c7by7.fsf@localhost> <87h72gjr3a.fsf@gnus.org> <87ilmw5o4j.fsf@localhost> <87k07ayz7u.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="14811"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 57003@debbugs.gnu.org To: rms@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 17 12:09:23 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 1oOFzH-0003dH-A9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Aug 2022 12:09:23 +0200 Original-Received: from localhost ([::1]:44704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oOFzF-00086V-Tm for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Aug 2022 06:09:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOFyw-000850-EF for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 06:09:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oOFyv-0001FC-To for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 06:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oOFyv-0006pZ-Pe for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 06:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Aug 2022 10:09:01 +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.166073088226191 (code B ref 57003); Wed, 17 Aug 2022 10:09:01 +0000 Original-Received: (at 57003) by debbugs.gnu.org; 17 Aug 2022 10:08:02 +0000 Original-Received: from localhost ([127.0.0.1]:49462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oOFxx-0006oM-QI for submit@debbugs.gnu.org; Wed, 17 Aug 2022 06:08:02 -0400 Original-Received: from mail-oi1-f177.google.com ([209.85.167.177]:33779) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oOFxv-0006ns-DS for 57003@debbugs.gnu.org; Wed, 17 Aug 2022 06:08:00 -0400 Original-Received: by mail-oi1-f177.google.com with SMTP id v125so236304oie.0 for <57003@debbugs.gnu.org>; Wed, 17 Aug 2022 03:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc; bh=0koI18j1lddN+/NGQhGZU3nA9K41zZGexN9r6QhX7+A=; b=AkAPfYHsiZRDygvDgWZ6LHMor9ynLwKmnDHGa5MUQh3UCvgGEdxxSXdgfLHR9NDbIB UjGDUbo3NSU8ahM3LC/mNyGDe8HVfBlFnhkdpF9l4xx6dy4/CpHB6vC5GujgQ8bAqZDg NU9W8gZ5gGgmJ2Ev9oR5SCxdCokQTBMPYVByiDeDG0GwLEnpQy0Wvn6tVuARAafxxXzN 6FWfZ1go9Qk3sz3Mabpfy4wdmnWLvgGgxvzK5Y038o9ysSHYJmPWOvLfyV/bHdv3Gk6l 7TOtXVYly5IhfSmilN+oCEgOstbG8JDAafWfhCRfuEJSdPb4g6F+Ei1vxv7YY8QHAwWX uLRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc; bh=0koI18j1lddN+/NGQhGZU3nA9K41zZGexN9r6QhX7+A=; b=BJ91C/ywiRVITS2A6GTFxQTI4J/iC0evl7cJPtomlmejIJ3UV+ydfUJWKA0xPp4f/E TYpYWF+yiPf627fvcTWLJS4RR0un9aCRVByH1uNS5WOt9VIlWb2GOItHxT/pDFf7mAED SfM+11gRxBzJw2ZZ7hfeUWBdzqTbB7Dx2cgRMdeE9rj1Rzu9CjykuFLhTm2TPnaFF1X6 QqzghvXE/I7WJpsODOi/i9BeQUV6NvH4oMYYocWyeAoeiQ0Oi0bztlUTb5Inamq7sWop FIgK1V0PAkid3kXI0sPixV3813Yhuf92gxZFdz1if1Hrcjknif1CrozdX8YwJaRTheOP 0Z2A== X-Gm-Message-State: ACgBeo0JE1LxxMQgjXGt5beQ71YaJjRh5+PL1SFFR87FNwtQalB+rhHg KpkLVyzhHrwG2GlewsSHhAliRHjyikq52J4Atak= X-Google-Smtp-Source: AA6agR7mmeij2hWVKsmzj63qxBjarVVt+s8YhfRe4boOwJD6D90jN7y/BL4Mw13bxE/WnvYlLxcBIw== X-Received: by 2002:a05:6808:1b0b:b0:343:60fc:b610 with SMTP id bx11-20020a0568081b0b00b0034360fcb610mr1075299oib.133.1660730873775; Wed, 17 Aug 2022 03:07:53 -0700 (PDT) Original-Received: from localhost ([115.154.175.57]) by smtp.gmail.com with ESMTPSA id o18-20020a05680803d200b0034290c4ed01sm2855069oie.41.2022.08.17.03.07.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 03:07:52 -0700 (PDT) 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: , 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:240034 Archived-At: Richard Stallman writes: > > 'early-local will apply file/directory-local variables _before_ executing > > the major-mode body. In contrast, the variables without this property > > are applied _after_ executing the major-mode body. > > I suppose you'll do something to protect those local variables from > `kill-all-local-variables' so it won't kill them. No. Not killing the _already existing_ local variables is what 'persistent-local is for. What I am proposing here is only relevant to buffer-local and directory-local variables that are going to be loaded anyway. The change will only affect _when_ they are loaded. > Will it distinguish THIS major mode's early local variables from the > early local variables of the PREVIOUS major mode? Those ought to be > killed with all the rest. I do not propose to keep the local variable values from the previous major mode. What I suggest is running a part of hack-local-variables earlier. Either way, file/directory-local variables will be set in the buffer. Hope I clarified the confusion. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92