From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#57003: 28.1.90; Can local variables be loaded before loading major mode? Date: Fri, 12 Aug 2022 14:38:22 +0200 Message-ID: <878rntskld.fsf@gnus.org> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40212"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 57003@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 12 14:39: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 1oMTwn-000AL2-G2 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Aug 2022 14:39:29 +0200 Original-Received: from localhost ([::1]:35366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMTwm-00065s-HL for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Aug 2022 08:39:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMTwN-00063d-Ev for bug-gnu-emacs@gnu.org; Fri, 12 Aug 2022 08:39:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMTwN-000342-6P for bug-gnu-emacs@gnu.org; Fri, 12 Aug 2022 08:39:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oMTwM-0003JN-E0 for bug-gnu-emacs@gnu.org; Fri, 12 Aug 2022 08:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Aug 2022 12:39: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.166030791612691 (code B ref 57003); Fri, 12 Aug 2022 12:39:02 +0000 Original-Received: (at 57003) by debbugs.gnu.org; 12 Aug 2022 12:38:36 +0000 Original-Received: from localhost ([127.0.0.1]:55851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oMTvw-0003Ic-5v for submit@debbugs.gnu.org; Fri, 12 Aug 2022 08:38:36 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:53984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oMTvs-0003IO-JH for 57003@debbugs.gnu.org; Fri, 12 Aug 2022 08:38:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ymu96ASrzFRv4gNmS33iPPrIvNzmp5O80uCHO0Zf+Hc=; b=OXw+/Kx+a+fINAcJrqSfOlOYgL UjQV/hzEC7qxgajAs1w8f2s8Tsf0ryoHH9xGiVgphVTm7V3BgCkUS56fPf/2zvxUjd69N3Jt/giZz cIdLN0I5O87T6JKnPFGddm9zjU9PxFq4mdlLszonwg4zyPV58UePOUOA2AdZCaXnFftM=; Original-Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oMTvj-0004iZ-Jd; Fri, 12 Aug 2022 14:38:26 +0200 In-Reply-To: <871qtp64eq.fsf@localhost> (Ihor Radchenko's message of "Tue, 09 Aug 2022 19:29:49 +0800") Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAALVBMVEX9/fPd3drBpZGb d4I0JihRQUJhV1yXaVoHBgspFhxOMC1mMTCeUzy+kXD///+LNd4MAAAAAWJLR0QOb70wTwAAAAd0 SU1FB+YIDAwlBwniGmYAAAE1SURBVDjLY2AYAYBRAJeEkoAgI4OgoCCGhCACoOhmdg0FgrC09LK0 9PRUINMAKsHWAQQzp8xaumvV8VUrgOwEZIlZS1xcU2eVu3jMmIEq0TllideqFakeHeg6OqdEeXnt dJ2BLtE502XVEvfyEgyJ2Z6eXqt871Z1oEl01sxc1eKy9q4L0I5OuATzio5e4VmzPT3W6nZ4Iutg 3rNtTfnqli0npld1zESRmF1zunzLrKMnW2d0uE7xRLJj5qrj6TNnHwm/lNKB4ir2mV3HV+fWXump TVMqQXHVzN3dtXfvXj91PFdJqbjKcwVcYveps+VVe07P2L3s0t27WUt2wiSYzpbfXgUELjNnTnFZ CTQqACZRpGueblxelgYFqbD4wB3pSJEsIAiMfGzqgMlCUICgAaOA7gAAlKmXRLWPAKcAAAAldEVY dGRhdGU6Y3JlYXRlADIwMjItMDgtMTJUMTI6Mzc6MDcrMDA6MDBooUscAAAAJXRFWHRkYXRlOm1v ZGlmeQAyMDIyLTA4LTEyVDEyOjM3OjA3KzAwOjAwGfzzoAAAAABJRU5ErkJggg== X-Now-Playing: Two Nice Girls's _2 Nice Girls_: "Looking Out" 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:239404 Archived-At: Ihor Radchenko writes: > 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). That'd work for things that use `define-derived-mode', but not all modes are defined that way and call `kill-all-local-variables' "manually".