From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#61925: 30.0.50; normal-mode does not set up local variables in temporary buffers (scratch, with-temp-buffer) Date: Wed, 10 Jan 2024 03:08:02 -0800 Message-ID: References: <9c0bc5b9-4dad-993a-f0e8-5aebca46a52e@gmx.de> <834jr0byz0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34693"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61925-done@debbugs.gnu.org, Wolfgang Scherer To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 10 12:09:24 2024 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 1rNWSa-0008sM-OJ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Jan 2024 12:09:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNWS9-00008a-S4; Wed, 10 Jan 2024 06:08:57 -0500 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 1rNWS7-000080-EH for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 06:08:55 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNWS7-0004lY-5m for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 06:08:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rNWSE-0008AY-G0 for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 06:09:02 -0500 Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Jan 2024 11:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 61925 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Mail-Followup-To: 61925@debbugs.gnu.org, stefankangas@gmail.com, Wolfgang.Scherer@gmx.de Original-Received: via spool by 61925-done@debbugs.gnu.org id=D61925.170488489931322 (code D ref 61925); Wed, 10 Jan 2024 11:09:02 +0000 Original-Received: (at 61925-done) by debbugs.gnu.org; 10 Jan 2024 11:08:19 +0000 Original-Received: from localhost ([127.0.0.1]:42175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNWRW-000897-L5 for submit@debbugs.gnu.org; Wed, 10 Jan 2024 06:08:19 -0500 Original-Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:57520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNWRT-00088t-VI for 61925-done@debbugs.gnu.org; Wed, 10 Jan 2024 06:08:17 -0500 Original-Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-557dcb0f870so2880227a12.2 for <61925-done@debbugs.gnu.org>; Wed, 10 Jan 2024 03:08:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704884883; x=1705489683; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=gjETzhE/5a89r2hP9va4qropFJEwGLB36ztBhv3RiT0=; b=T2uW3wLhYR4ow8PE2Nhwb4E4y36f7jcKE54YcyfWhW5ilbsyPBesPiG/yrfRbNaYQA 0PtzZDURDdmEwqBFQndbIyfqUppm7zAQbHp8VzDZi5YiZqd76AXRL0upQy+4PL39HfxI /+k/or5ROSzFqlfNSTTIGClqkfN6pZJDry6pWR1CjhZky/IUK+ggj9xUbchxDbt0RLxs +76VjGZ9OuF00Ui2O0TTqqjwZ0YIadYWyZD6RRInoP0jfqPi85ybPIWVyzfrnOStz971 fb8nInyHLNqvockgQoHtoVh0q0o/8h67hkiJVUdwvqiiAnXMOmqbLl0+T8d+1eNum9WB uJvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704884883; x=1705489683; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=gjETzhE/5a89r2hP9va4qropFJEwGLB36ztBhv3RiT0=; b=JwlEKqViEWAKbn39iK2VcGATo5+LAVJrdhyQgOYx2Pvie2vkQUpeyKXcPI3e0Qkrkb jBjpqVA/54b6l9bZwgZ3xZWf27REufMnj+65ToZ/818a06Ev6hLoJhvTj+kIQ4WguuDf u2dHXU+lnqiKjUfUksRYkT4prGsVD/YVVD8dOwBqdqlsUC06F5RegUWUbu8fukInNr7Y jrvO47ndckEzXM7n6y6qQENe4THDRKYNJKjrclYZpW5ChA/qv2ld307PLfkN84yWnCNV f1QMUhfZ3Q7FFtyBdjoJxDW6S11nxQm4AiMb9FSep7I2a9IhUh34q7QeSfyu3JSUTOC/ UrEw== X-Gm-Message-State: AOJu0Yx5sURSko/f7UICZrjSBcMTVna8MvrhPuWAUlENGySGjK2npYJQ h7RzCSaqxxFDKgs5bJE17FV9nbFoSuHZijjEuWA= X-Google-Smtp-Source: AGHT+IGTXxgqTc0eF1pAohFNVz3FhQ7nJ3heX+JRXriKIDn8FnI3rmj+Zt1qZCLsGVqCqkHDnKNP9NYE0iYQp3ADV7I= X-Received: by 2002:aa7:c691:0:b0:557:c93a:d726 with SMTP id n17-20020aa7c691000000b00557c93ad726mr341547edq.53.1704884882442; Wed, 10 Jan 2024 03:08:02 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 10 Jan 2024 03:08:02 -0800 In-Reply-To: <834jr0byz0.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 04 Mar 2023 12:19:31 +0200") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277711 Archived-At: Eli Zaretskii writes: > tags 61925 notabug > thanks > >> Date: Fri, 3 Mar 2023 00:11:13 +0100 >> From: Wolfgang Scherer >> >> The command `normal-mode' does not set file local variables, if a >> buffer does not have a `buffer-file-name'. This affects *scratch* and >> buffers created using `with-temp-buffer'. >> >> The behavior changed at some time between Emacs version 20.5.2.2 and 20.= 6.3. >> See output from various Emacs versions further below. >> >> If that was an intentional change, it should be prominently documented >> to avoid the confusion when examples do not work in a *scratch* buffer. > > This was an intentional change, yes. > > And AFAICT, it _is_ documented in the ELisp Reference manual: > > -- Command: normal-mode &optional find-file > This function establishes the proper major mode and buffer-local > variable bindings for the current buffer. It calls =E2=80=98set-aut= o-mode=E2=80=99 > (see below). As of Emacs 26.1, it no longer runs > =E2=80=98hack-local-variables=E2=80=99, this now being done in =E2= =80=98run-mode-hooks=E2=80=99 at > the initialization of major modes (*note Mode Hooks::). > > And the documentation of run-mode-hooks says: > > > -- Function: run-mode-hooks &rest hookvars > Major modes should run their mode hook using this function. It is > similar to =E2=80=98run-hooks=E2=80=99 (*note Hooks::), but it also = runs > =E2=80=98change-major-mode-after-body-hook=E2=80=99, =E2=80=98hack-l= ocal-variables=E2=80=99 (when > the buffer is visiting a file) (*note File Local Variables::) ^^^^ > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > The user manual indeed didn't mention this caveat; I've now mentioned > that aspect there (and also in the doc strings of the relevant > functions). > > (The change in Emacs 26 that caused this as a side effect was to fix > bug#15577 and bug#23407.) > >> I would even recommend a warning prompt in normal-mode, when called >> interactively. > > I think such a warning could be an annoyance. It seems like we're not going to be making any changes here, as this is the expected behavior. I'm therefore closing this bug report.